@xano/xanoscript-monaco-editor 0.1.0 → 0.1.2
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/README.md +77 -126
- package/dist/.vite/manifest.json +54 -54
- package/dist/assets/{editor-BivTGeL1.js → editor-4HUBGwOu.js} +1 -1
- package/dist/assets/{extensionHost.worker-bYZXB0kM.js → extensionHost.worker-BEj8h9xB.js} +7 -7
- package/dist/assets/{files.contribution._fileEditorFactory-vS4ZLYi1.js → files.contribution._fileEditorFactory-YNF_vxMj.js} +1 -1
- package/dist/assets/{iconv-lite-umd-DQaTktu2.js → iconv-lite-umd-BCZHOywd.js} +2 -7
- package/dist/assets/{iconv-lite-umd-DYWd8cEa.js → iconv-lite-umd-BGIeO9cR.js} +2 -7
- package/dist/assets/{index-CrbRjSB_.js → index-9GTRLRSC.js} +1 -1
- package/dist/assets/{index-BGwiFEyd.js → index-B48SQPT2.js} +1 -1
- package/dist/assets/{index-VRHnXpb2.js → index-B7W-kS7G.js} +1 -1
- package/dist/assets/{index-51WpeTZl.js → index-CBODr4QR.js} +3 -3
- package/dist/assets/{index-C3pnKX8a.js → index-Cw1WVxjJ.js} +1 -1
- package/dist/assets/{index-BwfWF2CI.js → index-DSexFukl.js} +47 -47
- package/dist/assets/{index-C25FTAfE.js → index-DV2XmbY1.js} +1 -1
- package/dist/assets/{index-B132pG6E.js → index-DoXiLhIy.js} +2 -2
- package/dist/assets/{index-DgK2LcnW.js → index-r-mEMSNw.js} +2 -2
- package/dist/assets/{index-yPQeQvu7.js → index-sQEJqDvC.js} +1 -1
- package/dist/assets/main--VvQJcub.js +4 -0
- package/dist/assets/main-DUUA0eUQ.js +4 -0
- package/dist/assets/main-DWv94O3B.js +1 -0
- package/dist/assets/main-Du3mMy1c.js +1 -0
- package/dist/assets/{tokenClassificationRegistry-DcBtqg2t.js → tokenClassificationRegistry-CZyxOMX0.js} +1 -1
- package/dist/assets/{views-hUfpm9tT.js → views-Bu3Oa5Y-.js} +3 -3
- package/dist/assets/{views-C4cPu3oQ.css → views-qXWInm-E.css} +1 -1
- package/dist/assets/workbenchThemeService.service-CXlQNmVU.js +1 -0
- package/dist/assets/{worker-BIMDXoFp.js → worker-BiA-ZZ0u.js} +2 -2
- package/dist/index.html +1 -1
- package/dist/logic-assistant-script.js +22301 -16325
- package/dist/logic-assistant-script.js.map +4 -4
- package/dist/worker.js +20541 -14435
- package/dist/worker.js.map +4 -4
- package/package.json +3 -1
- package/dist/assets/main-D6ceXGB_.js +0 -4
- package/dist/assets/main-DNugpDp4.js +0 -4
- package/dist/assets/main-FP17jmvp.js +0 -1
- package/dist/assets/main-b5eBH2vx.js +0 -1
- package/dist/assets/workbenchThemeService.service-qBFVnuYD.js +0 -1
|
@@ -14,7 +14,7 @@ ${e.toString()}`}}class Lp{constructor(e=new Ax,t=!1,i,s=t8){this._services=e,th
|
|
|
14
14
|
`).slice(3,4).join(`
|
|
15
15
|
`)):ui._None}static traceCreation(e,t){return e?new ui(zo.Creation,t.name):ui._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new ui(zo.Branch,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;ui._totals+=e;let t=!1;function i(r,o){const a=[],l=new Array(r+1).join(" ");for(const[c,u,d]of o._dep)if(u&&d){t=!0,a.push(`${l}CREATES -> ${c}`);const f=i(r+1,d);f&&a.push(f)}else a.push(`${l}uses -> ${c}`);return a.join(`
|
|
16
16
|
`)}const s=[`${this.type===zo.Creation?"CREATE":"CALL"} ${this.name}`,`${i(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${ui._totals.toFixed(2)}ms)`];(e>2||t)&&ui.all.add(s.join(`
|
|
17
|
-
`))}};ui.all=new Set,ui._None=new class extends ui{constructor(){super(zo.None,null)}stop(){}branch(){return this}},ui._totals=0;let Ku=ui;const nt=pe("IExtHostRpcService");class n8{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}}const Q1=pe("IURITransformerService");class i8{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)}}function V(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 L(n,e){return function(t,i){e(t,i,n)}}class s8{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class r8{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===R.Period)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?kx(e,this._value,0,e.length,this._from,this._to):Jh(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class RC{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===R.Slash||this._splitOnBackslash&&i===R.Backslash))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(t===R.Slash||this._splitOnBackslash&&t===R.Backslash)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?kx(e,this._value,0,e.length,this._from,this._to):Jh(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}var bn;(function(n){n[n.Scheme=1]="Scheme",n[n.Authority=2]="Authority",n[n.Path=3]="Path",n[n.Query=4]="Query",n[n.Fragment=5]="Fragment"})(bn||(bn={}));class LC{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(bn.Scheme),this._value.authority&&this._states.push(bn.Authority),this._value.path&&(this._pathIterator=new RC(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(bn.Path)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(bn.Query),this._value.fragment&&this._states.push(bn.Fragment)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===bn.Path&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===bn.Path&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===bn.Scheme)return Vv(e,this._value.scheme);if(this._states[this._stateIdx]===bn.Authority)return Vv(e,this._value.authority);if(this._states[this._stateIdx]===bn.Path)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===bn.Query)return Va(e,this._value.query);if(this._states[this._stateIdx]===bn.Fragment)return Va(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===bn.Scheme)return this._value.scheme;if(this._states[this._stateIdx]===bn.Authority)return this._value.authority;if(this._states[this._stateIdx]===bn.Path)return this._pathIterator.value();if(this._states[this._stateIdx]===bn.Query)return this._value.query;if(this._states[this._stateIdx]===bn.Fragment)return this._value.fragment;throw new Error}}const kd=class kd{static wrap(e){return e===void 0?kd.Val:e}static unwrap(e){return e===kd.Val?void 0:e}};kd.Val=Symbol("undefined_placeholder");let or=kd;class Ef{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}var ut;(function(n){n[n.Left=-1]="Left",n[n.Mid=0]="Mid",n[n.Right=1]="Right"})(ut||(ut={}));class Rs{static forUris(e=()=>!1,t=()=>!1){return new Rs(new LC(e,t))}static forPaths(e=!1){return new Rs(new RC(void 0,!e))}static forStrings(){return new Rs(new s8)}static forConfigKeys(){return new Rs(new r8)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);ME(i);for(const s of i)this.set(s,e)}else{const i=e.slice(0);ME(i);for(const s of i)this.set(s[0],s[1])}}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new Ef,this._root.segment=i.value());const r=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new Ef,s.left.segment=i.value()),r.push([ut.Left,s]),s=s.left;else if(a<0)s.right||(s.right=new Ef,s.right.segment=i.value()),r.push([ut.Right,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new Ef,s.mid.segment=i.value()),r.push([ut.Mid,s]),s=s.mid;else break}const o=or.unwrap(s.value);s.value=or.wrap(t),s.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=r[a][0],d=r[a+1][0];if(u===ut.Right&&d===ut.Right)r[a][1]=l.rotateLeft();else if(u===ut.Left&&d===ut.Left)r[a][1]=l.rotateRight();else if(u===ut.Right&&d===ut.Left)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(u===ut.Left&&d===ut.Right)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case ut.Left:r[a-1][1].left=r[a][1];break;case ut.Right:r[a-1][1].right=r[a][1];break;case ut.Mid:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}get(e){return or.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let r=this._root;for(;r;){const o=i.cmp(r.segment);if(o>0)s.push([ut.Left,r]),r=r.left;else if(o<0)s.push([ut.Right,r]),r=r.right;else if(i.hasNext())i.next(),s.push([ut.Mid,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const o=[[ut.Right,r]],a=this._min(r.right,o);if(a.key){r.key=a.key,r.value=a.value,r.segment=a.segment;const l=a.right;if(o.length>1){const[u,d]=o[o.length-1];switch(u){case ut.Left:d.left=l;break;case ut.Mid:Ov(!1);case ut.Right:Ov(!1)}}else r.right=l;const c=this._balanceByStack(o);if(s.length>0){const[u,d]=s[s.length-1];switch(u){case ut.Left:d.left=c;break;case ut.Mid:d.mid=c;break;case ut.Right:d.right=c;break}}else this._root=c}}else{const o=r.left??r.right;if(s.length>0){const[a,l]=s[s.length-1];switch(a){case ut.Left:l.left=o;break;case ut.Mid:l.mid=o;break;case ut.Right:l.right=o;break}}else this._root=o}this._root=this._balanceByStack(s)??this._root}}_min(e,t){for(;e.left;)t.push([ut.Left,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const s=i.balanceFactor();if(s>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):s<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),t>0)switch(e[t-1][0]){case ut.Left:e[t-1][1].left=e[t][1];break;case ut.Right:e[t-1][1].right=e[t][1];break;case ut.Mid:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(t.hasNext())t.next(),s=or.unwrap(i.value)||s,i=i.mid;else break}return i&&or.unwrap(i.value)||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const r=i.cmp(s.segment);if(r>0)s=s.left;else if(r<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?or.unwrap(s.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,or.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){const e=t=>{if(!t)return!0;const i=t.balanceFactor();return i<-1||i>1?!1:e(t.left)&&e(t.right)};return e(this._root)}}function wt(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.entries(n).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?wt(i):i}),e}function NC(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();for(const i in t)if(OC.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!U5(s)&&e.push(s)}}return n}const OC=Object.prototype.hasOwnProperty;function Nc(n,e){return Xv(n,e,new Set)}function Xv(n,e,t){if(tn(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const r of n)s.push(Xv(r,e,t));return s}if(nn(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const r in n)OC.call(n,r)&&(s[r]=Xv(n[r],e,t));return t.delete(n),s}return n}function qa(n,e,t=!0){return nn(n)?(nn(e)&&Object.keys(e).forEach(i=>{i in n?t&&(nn(n[i])&&nn(e[i])?qa(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Gn(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!Gn(n[t],e[t]))return!1}else{const s=[];for(i in n)s.push(i);s.sort();const r=[];for(i in e)r.push(i);if(r.sort(),!Gn(s,r))return!1;for(t=0;t<s.length;t++)if(!Gn(n[s[t]],e[s[t]]))return!1}return!0}function o8(n){const e=new Set;return JSON.stringify(n,(t,i)=>{if(nn(i)||Array.isArray(i)){if(e.has(i))return"[Circular]";e.add(i)}return typeof i=="bigint"?`[BigInt ${i.toString()}]`:i})}function SS(n,e){const t=Object.create(null);for(const[i,s]of Object.entries(n))e(i,s)&&(t[i]=s);return t}class a8{constructor(){this._next=0}getNext(){return this._next++}}var va;(function(n){n[n.Unknown=0]="Unknown",n[n.File=1]="File",n[n.Directory=2]="Directory",n[n.SymbolicLink=64]="SymbolicLink"})(va||(va={}));var Oc;(function(n){n[n.Readonly=1]="Readonly",n[n.Locked=2]="Locked"})(Oc||(Oc={}));var Qr;(function(n){n[n.UPDATED=2]="UPDATED",n[n.ADDED=4]="ADDED",n[n.DELETED=8]="DELETED"})(Qr||(Qr={}));var ks;(function(n){n[n.None=0]="None",n[n.FileReadWrite=2]="FileReadWrite",n[n.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",n[n.FileReadStream=16]="FileReadStream",n[n.FileFolderCopy=8]="FileFolderCopy",n[n.PathCaseSensitive=1024]="PathCaseSensitive",n[n.Readonly=2048]="Readonly",n[n.Trash=4096]="Trash",n[n.FileWriteUnlock=8192]="FileWriteUnlock",n[n.FileAtomicRead=16384]="FileAtomicRead",n[n.FileAtomicWrite=32768]="FileAtomicWrite",n[n.FileAtomicDelete=65536]="FileAtomicDelete",n[n.FileClone=131072]="FileClone"})(ks||(ks={}));var Fe;(function(n){n.FileExists="EntryExists",n.FileNotFound="EntryNotFound",n.FileNotADirectory="EntryNotADirectory",n.FileIsADirectory="EntryIsADirectory",n.FileExceedsStorageQuota="EntryExceedsStorageQuota",n.FileTooLarge="EntryTooLarge",n.FileWriteLocked="EntryWriteLocked",n.NoPermissions="NoPermissions",n.Unavailable="Unavailable",n.Unknown="Unknown"})(Fe||(Fe={}));class J1 extends Error{static create(e,t){const i=new J1(e.toString(),t);return FC(i,t),i}constructor(e,t){super(e),this.code=t}}function FC(n,e){return n.name=e?`${e} (FileSystemError)`:"FileSystemError",n}function Np(n){if(!n)return Fe.Unknown;if(n instanceof J1)return n.code;const e=/^(.+) \(FileSystemError\)$/.exec(n.name);if(!e)return Fe.Unknown;switch(e[1]){case Fe.FileExists:return Fe.FileExists;case Fe.FileIsADirectory:return Fe.FileIsADirectory;case Fe.FileNotADirectory:return Fe.FileNotADirectory;case Fe.FileNotFound:return Fe.FileNotFound;case Fe.FileTooLarge:return Fe.FileTooLarge;case Fe.FileWriteLocked:return Fe.FileWriteLocked;case Fe.NoPermissions:return Fe.NoPermissions;case Fe.Unavailable:return Fe.Unavailable}return Fe.Unknown}function l8(n){if(n instanceof Yv)return n.fileOperationResult;switch(Np(n)){case Fe.FileNotFound:return Si.FILE_NOT_FOUND;case Fe.FileIsADirectory:return Si.FILE_IS_DIRECTORY;case Fe.FileNotADirectory:return Si.FILE_NOT_DIRECTORY;case Fe.FileWriteLocked:return Si.FILE_WRITE_LOCKED;case Fe.NoPermissions:return Si.FILE_PERMISSION_DENIED;case Fe.FileExists:return Si.FILE_MOVE_CONFLICT;case Fe.FileTooLarge:return Si.FILE_TOO_LARGE;default:return Si.FILE_OTHER_ERROR}}var ys;(function(n){n[n.CREATE=0]="CREATE",n[n.DELETE=1]="DELETE",n[n.MOVE=2]="MOVE",n[n.COPY=3]="COPY",n[n.WRITE=4]="WRITE"})(ys||(ys={}));var Qu;(function(n){n[n.UPDATED=0]="UPDATED",n[n.ADDED=1]="ADDED",n[n.DELETED=2]="DELETED"})(Qu||(Qu={}));class Yv extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}var Si;(function(n){n[n.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",n[n.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",n[n.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",n[n.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",n[n.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",n[n.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",n[n.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",n[n.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",n[n.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",n[n.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",n[n.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Si||(Si={}));var kS;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(kS||(kS={}));const c8="";function DS(n){if(!(typeof n.size!="number"||typeof n.mtime!="number"))return n.mtime.toString(29)+n.size.toString(31)}const _n=class _n{static formatSize(e){return ga(e)||(e=0),e<_n.KB?h(1884,"{0}B",e.toFixed(0)):e<_n.MB?h(1885,"{0}KB",(e/_n.KB).toFixed(2)):e<_n.GB?h(1886,"{0}MB",(e/_n.MB).toFixed(2)):e<_n.TB?h(1887,"{0}GB",(e/_n.GB).toFixed(2)):h(1888,"{0}TB",(e/_n.TB).toFixed(2))}};_n.KB=1024,_n.MB=_n.KB*_n.KB,_n.GB=_n.MB*_n.KB,_n.TB=_n.GB*_n.KB;let IS=_n;var Fd;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(Fd||(Fd={}));(function(n){const e="error",t="warning",i="warn",s="info",r="ignore";function o(l){return l?co(e,l)?n.Error:co(t,l)||co(i,l)?n.Warning:co(s,l)?n.Info:n.Ignore:n.Ignore}n.fromValue=o;function a(l){switch(l){case n.Error:return e;case n.Warning:return t;case n.Info:return s;default:return r}}n.toString=a})(Fd||(Fd={}));var Qt=Fd,CS;(function(n){n[n.DEFAULT=0]="DEFAULT",n[n.OPTIONAL=1]="OPTIONAL",n[n.SILENT=2]="SILENT",n[n.URGENT=3]="URGENT"})(CS||(CS={}));var TS;(function(n){n[n.WORKSPACE=0]="WORKSPACE",n[n.PROFILE=1]="PROFILE",n[n.APPLICATION=2]="APPLICATION"})(TS||(TS={}));var PS;(function(n){n[n.OFF=0]="OFF",n[n.ERROR=1]="ERROR"})(PS||(PS={}));function u8(n){const e=n;return typeof e?.id=="string"&&x.isUri(e.uri)}function d8(n){const e=n;return typeof e?.id=="string"&&x.isUri(e.configPath)}var Op;(function(n){n[n.EMPTY=1]="EMPTY",n[n.FOLDER=2]="FOLDER",n[n.WORKSPACE=3]="WORKSPACE"})(Op||(Op={}));let h8=class{get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}constructor(e,t,i,s,r){this._id=e,this._transient=i,this._configuration=s,this.ignorePathCasing=r,this.foldersMap=Rs.forUris(this.ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this.ignorePathCasing=e.ignorePathCasing,this.folders=e.folders}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this.foldersMap.findSubstr(e)||null}updateFoldersMap(){this.foldersMap=Rs.forUris(this.ignorePathCasing,()=>!0);for(const e of this.folders)this.foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}};class MC{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return An(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}function Z_(n){return new MC({uri:n,index:0,name:jv(n)},{uri:n.toString()})}const f8="code-workspace";h(2386,"Code Workspace");class p8{constructor(){this._systemSchemes=new Set(Object.keys(le)),this._providerInfo=new Map,this.extUri=new Xh(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&ks.PathCaseSensitive)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}}const hu=pe("IExtHostFileSystemInfo"),Sn=function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);const n=new Uint8Array(16),e=[];for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(n),n[6]=n[6]&15|64,n[8]=n[8]&63|128;let i=0,s="";return s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s}}(),Zv=Object.freeze({create:n=>Il(n.map(e=>e.toString())).join(`\r
|
|
17
|
+
`))}};ui.all=new Set,ui._None=new class extends ui{constructor(){super(zo.None,null)}stop(){}branch(){return this}},ui._totals=0;let Ku=ui;const nt=pe("IExtHostRpcService");class n8{constructor(e){this.getProxy=e.getProxy.bind(e),this.set=e.set.bind(e),this.dispose=e.dispose.bind(e),this.assertRegistered=e.assertRegistered.bind(e),this.drain=e.drain.bind(e)}}const Q1=pe("IURITransformerService");class i8{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)}}function V(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 L(n,e){return function(t,i){e(t,i,n)}}class s8{constructor(){this._value="",this._pos=0}reset(e){return this._value=e,this._pos=0,this}next(){return this._pos+=1,this}hasNext(){return this._pos<this._value.length-1}cmp(e){const t=e.charCodeAt(0),i=this._value.charCodeAt(this._pos);return t-i}value(){return this._value[this._pos]}}class r8{constructor(e=!0){this._caseSensitive=e}reset(e){return this._value=e,this._from=0,this._to=0,this.next()}hasNext(){return this._to<this._value.length}next(){this._from=this._to;let e=!0;for(;this._to<this._value.length;this._to++)if(this._value.charCodeAt(this._to)===R.Period)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?kx(e,this._value,0,e.length,this._from,this._to):Jh(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}class RC{constructor(e=!0,t=!0){this._splitOnBackslash=e,this._caseSensitive=t}reset(e){this._from=0,this._to=0,this._value=e,this._valueLen=e.length;for(let t=e.length-1;t>=0;t--,this._valueLen--){const i=this._value.charCodeAt(t);if(!(i===R.Slash||this._splitOnBackslash&&i===R.Backslash))break}return this.next()}hasNext(){return this._to<this._valueLen}next(){this._from=this._to;let e=!0;for(;this._to<this._valueLen;this._to++){const t=this._value.charCodeAt(this._to);if(t===R.Slash||this._splitOnBackslash&&t===R.Backslash)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?kx(e,this._value,0,e.length,this._from,this._to):Jh(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}}var bn;(function(n){n[n.Scheme=1]="Scheme",n[n.Authority=2]="Authority",n[n.Path=3]="Path",n[n.Query=4]="Query",n[n.Fragment=5]="Fragment"})(bn||(bn={}));class LC{constructor(e,t){this._ignorePathCasing=e,this._ignoreQueryAndFragment=t,this._states=[],this._stateIdx=0}reset(e){return this._value=e,this._states=[],this._value.scheme&&this._states.push(bn.Scheme),this._value.authority&&this._states.push(bn.Authority),this._value.path&&(this._pathIterator=new RC(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(bn.Path)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(bn.Query),this._value.fragment&&this._states.push(bn.Fragment)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===bn.Path&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===bn.Path&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===bn.Scheme)return Vv(e,this._value.scheme);if(this._states[this._stateIdx]===bn.Authority)return Vv(e,this._value.authority);if(this._states[this._stateIdx]===bn.Path)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===bn.Query)return Va(e,this._value.query);if(this._states[this._stateIdx]===bn.Fragment)return Va(e,this._value.fragment);throw new Error}value(){if(this._states[this._stateIdx]===bn.Scheme)return this._value.scheme;if(this._states[this._stateIdx]===bn.Authority)return this._value.authority;if(this._states[this._stateIdx]===bn.Path)return this._pathIterator.value();if(this._states[this._stateIdx]===bn.Query)return this._value.query;if(this._states[this._stateIdx]===bn.Fragment)return this._value.fragment;throw new Error}}const kd=class kd{static wrap(e){return e===void 0?kd.Val:e}static unwrap(e){return e===kd.Val?void 0:e}};kd.Val=Symbol("undefined_placeholder");let or=kd;class Ef{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){const e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){const e=this.left;return this.left=e.right,e.right=this,this.updateHeight(),e.updateHeight(),e}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}}var ut;(function(n){n[n.Left=-1]="Left",n[n.Mid=0]="Mid",n[n.Right=1]="Right"})(ut||(ut={}));class Rs{static forUris(e=()=>!1,t=()=>!1){return new Rs(new LC(e,t))}static forPaths(e=!1){return new Rs(new RC(void 0,!e))}static forStrings(){return new Rs(new s8)}static forConfigKeys(){return new Rs(new r8)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){const i=t.slice(0);ME(i);for(const s of i)this.set(s,e)}else{const i=e.slice(0);ME(i);for(const s of i)this.set(s[0],s[1])}}set(e,t){const i=this._iter.reset(e);let s;this._root||(this._root=new Ef,this._root.segment=i.value());const r=[];for(s=this._root;;){const a=i.cmp(s.segment);if(a>0)s.left||(s.left=new Ef,s.left.segment=i.value()),r.push([ut.Left,s]),s=s.left;else if(a<0)s.right||(s.right=new Ef,s.right.segment=i.value()),r.push([ut.Right,s]),s=s.right;else if(i.hasNext())i.next(),s.mid||(s.mid=new Ef,s.mid.segment=i.value()),r.push([ut.Mid,s]),s=s.mid;else break}const o=or.unwrap(s.value);s.value=or.wrap(t),s.key=e;for(let a=r.length-1;a>=0;a--){const l=r[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=r[a][0],d=r[a+1][0];if(u===ut.Right&&d===ut.Right)r[a][1]=l.rotateLeft();else if(u===ut.Left&&d===ut.Left)r[a][1]=l.rotateRight();else if(u===ut.Right&&d===ut.Left)l.right=r[a+1][1]=r[a+1][1].rotateRight(),r[a][1]=l.rotateLeft();else if(u===ut.Left&&d===ut.Right)l.left=r[a+1][1]=r[a+1][1].rotateLeft(),r[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(r[a-1][0]){case ut.Left:r[a-1][1].left=r[a][1];break;case ut.Right:r[a-1][1].right=r[a][1];break;case ut.Mid:r[a-1][1].mid=r[a][1];break}else this._root=r[0][1]}}return o}get(e){return or.unwrap(this._getNode(e)?.value)}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const s=t.cmp(i.segment);if(s>0)i=i.left;else if(s<0)i=i.right;else if(t.hasNext())t.next(),i=i.mid;else break}return i}has(e){const t=this._getNode(e);return!(t?.value===void 0&&t?.mid===void 0)}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){const i=this._iter.reset(e),s=[];let r=this._root;for(;r;){const o=i.cmp(r.segment);if(o>0)s.push([ut.Left,r]),r=r.left;else if(o<0)s.push([ut.Right,r]),r=r.right;else if(i.hasNext())i.next(),s.push([ut.Mid,r]),r=r.mid;else break}if(r){if(t?(r.left=void 0,r.mid=void 0,r.right=void 0,r.height=1):(r.key=void 0,r.value=void 0),!r.mid&&!r.value)if(r.left&&r.right){const o=[[ut.Right,r]],a=this._min(r.right,o);if(a.key){r.key=a.key,r.value=a.value,r.segment=a.segment;const l=a.right;if(o.length>1){const[u,d]=o[o.length-1];switch(u){case ut.Left:d.left=l;break;case ut.Mid:Ov(!1);case ut.Right:Ov(!1)}}else r.right=l;const c=this._balanceByStack(o);if(s.length>0){const[u,d]=s[s.length-1];switch(u){case ut.Left:d.left=c;break;case ut.Mid:d.mid=c;break;case ut.Right:d.right=c;break}}else this._root=c}}else{const o=r.left??r.right;if(s.length>0){const[a,l]=s[s.length-1];switch(a){case ut.Left:l.left=o;break;case ut.Mid:l.mid=o;break;case ut.Right:l.right=o;break}}else this._root=o}this._root=this._balanceByStack(s)??this._root}}_min(e,t){for(;e.left;)t.push([ut.Left,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){const i=e[t][1];i.updateHeight();const s=i.balanceFactor();if(s>1?(i.right.balanceFactor()>=0||(i.right=i.right.rotateRight()),e[t][1]=i.rotateLeft()):s<-1&&(i.left.balanceFactor()<=0||(i.left=i.left.rotateLeft()),e[t][1]=i.rotateRight()),t>0)switch(e[t-1][0]){case ut.Left:e[t-1][1].left=e[t][1];break;case ut.Right:e[t-1][1].right=e[t][1];break;case ut.Mid:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){const t=this._iter.reset(e);let i=this._root,s;for(;i;){const r=t.cmp(i.segment);if(r>0)i=i.left;else if(r<0)i=i.right;else if(t.hasNext())t.next(),s=or.unwrap(i.value)||s,i=i.mid;else break}return i&&or.unwrap(i.value)||s}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let s=this._root;for(;s;){const r=i.cmp(s.segment);if(r>0)s=s.left;else if(r<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else return s.mid?this._entries(s.mid):t?or.unwrap(s.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(const[t,i]of this)e(i,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){const t=[];return this._dfsEntries(e,t),t[Symbol.iterator]()}_dfsEntries(e,t){e&&(e.left&&this._dfsEntries(e.left,t),e.value!==void 0&&t.push([e.key,or.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){const e=t=>{if(!t)return!0;const i=t.balanceFactor();return i<-1||i>1?!1:e(t.left)&&e(t.right)};return e(this._root)}}function wt(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;const e=Array.isArray(n)?[]:{};return Object.entries(n).forEach(([t,i])=>{e[t]=i&&typeof i=="object"?wt(i):i}),e}function NC(n){if(!n||typeof n!="object")return n;const e=[n];for(;e.length>0;){const t=e.shift();for(const i in t)if(OC.call(t,i)){const s=t[i];typeof s=="object"&&!Object.isFrozen(s)&&!U5(s)&&e.push(s)}}return n}const OC=Object.prototype.hasOwnProperty;function Nc(n,e){return Xv(n,e,new Set)}function Xv(n,e,t){if(tn(n))return n;const i=e(n);if(typeof i<"u")return i;if(Array.isArray(n)){const s=[];for(const r of n)s.push(Xv(r,e,t));return s}if(nn(n)){if(t.has(n))throw new Error("Cannot clone recursive data-structure");t.add(n);const s={};for(const r in n)OC.call(n,r)&&(s[r]=Xv(n[r],e,t));return t.delete(n),s}return n}function qa(n,e,t=!0){return nn(n)?(nn(e)&&Object.keys(e).forEach(i=>{i in n?t&&(nn(n[i])&&nn(e[i])?qa(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Gn(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!Gn(n[t],e[t]))return!1}else{const s=[];for(i in n)s.push(i);s.sort();const r=[];for(i in e)r.push(i);if(r.sort(),!Gn(s,r))return!1;for(t=0;t<s.length;t++)if(!Gn(n[s[t]],e[s[t]]))return!1}return!0}function o8(n){const e=new Set;return JSON.stringify(n,(t,i)=>{if(nn(i)||Array.isArray(i)){if(e.has(i))return"[Circular]";e.add(i)}return typeof i=="bigint"?`[BigInt ${i.toString()}]`:i})}function SS(n,e){const t=Object.create(null);for(const[i,s]of Object.entries(n))e(i,s)&&(t[i]=s);return t}class a8{constructor(){this._next=0}getNext(){return this._next++}}var va;(function(n){n[n.Unknown=0]="Unknown",n[n.File=1]="File",n[n.Directory=2]="Directory",n[n.SymbolicLink=64]="SymbolicLink"})(va||(va={}));var Oc;(function(n){n[n.Readonly=1]="Readonly",n[n.Locked=2]="Locked"})(Oc||(Oc={}));var Qr;(function(n){n[n.UPDATED=2]="UPDATED",n[n.ADDED=4]="ADDED",n[n.DELETED=8]="DELETED"})(Qr||(Qr={}));var ks;(function(n){n[n.None=0]="None",n[n.FileReadWrite=2]="FileReadWrite",n[n.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",n[n.FileReadStream=16]="FileReadStream",n[n.FileFolderCopy=8]="FileFolderCopy",n[n.PathCaseSensitive=1024]="PathCaseSensitive",n[n.Readonly=2048]="Readonly",n[n.Trash=4096]="Trash",n[n.FileWriteUnlock=8192]="FileWriteUnlock",n[n.FileAtomicRead=16384]="FileAtomicRead",n[n.FileAtomicWrite=32768]="FileAtomicWrite",n[n.FileAtomicDelete=65536]="FileAtomicDelete",n[n.FileClone=131072]="FileClone"})(ks||(ks={}));var Fe;(function(n){n.FileExists="EntryExists",n.FileNotFound="EntryNotFound",n.FileNotADirectory="EntryNotADirectory",n.FileIsADirectory="EntryIsADirectory",n.FileExceedsStorageQuota="EntryExceedsStorageQuota",n.FileTooLarge="EntryTooLarge",n.FileWriteLocked="EntryWriteLocked",n.NoPermissions="NoPermissions",n.Unavailable="Unavailable",n.Unknown="Unknown"})(Fe||(Fe={}));class J1 extends Error{static create(e,t){const i=new J1(e.toString(),t);return FC(i,t),i}constructor(e,t){super(e),this.code=t}}function FC(n,e){return n.name=e?`${e} (FileSystemError)`:"FileSystemError",n}function Np(n){if(!n)return Fe.Unknown;if(n instanceof J1)return n.code;const e=/^(.+) \(FileSystemError\)$/.exec(n.name);if(!e)return Fe.Unknown;switch(e[1]){case Fe.FileExists:return Fe.FileExists;case Fe.FileIsADirectory:return Fe.FileIsADirectory;case Fe.FileNotADirectory:return Fe.FileNotADirectory;case Fe.FileNotFound:return Fe.FileNotFound;case Fe.FileTooLarge:return Fe.FileTooLarge;case Fe.FileWriteLocked:return Fe.FileWriteLocked;case Fe.NoPermissions:return Fe.NoPermissions;case Fe.Unavailable:return Fe.Unavailable}return Fe.Unknown}function l8(n){if(n instanceof Yv)return n.fileOperationResult;switch(Np(n)){case Fe.FileNotFound:return Si.FILE_NOT_FOUND;case Fe.FileIsADirectory:return Si.FILE_IS_DIRECTORY;case Fe.FileNotADirectory:return Si.FILE_NOT_DIRECTORY;case Fe.FileWriteLocked:return Si.FILE_WRITE_LOCKED;case Fe.NoPermissions:return Si.FILE_PERMISSION_DENIED;case Fe.FileExists:return Si.FILE_MOVE_CONFLICT;case Fe.FileTooLarge:return Si.FILE_TOO_LARGE;default:return Si.FILE_OTHER_ERROR}}var ys;(function(n){n[n.CREATE=0]="CREATE",n[n.DELETE=1]="DELETE",n[n.MOVE=2]="MOVE",n[n.COPY=3]="COPY",n[n.WRITE=4]="WRITE"})(ys||(ys={}));var Qu;(function(n){n[n.UPDATED=0]="UPDATED",n[n.ADDED=1]="ADDED",n[n.DELETED=2]="DELETED"})(Qu||(Qu={}));class Yv extends Error{constructor(e,t,i){super(e),this.fileOperationResult=t,this.options=i}}var Si;(function(n){n[n.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",n[n.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",n[n.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",n[n.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",n[n.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",n[n.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",n[n.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",n[n.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",n[n.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",n[n.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",n[n.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(Si||(Si={}));var kS;(function(n){n[n.FILE=0]="FILE",n[n.FOLDER=1]="FOLDER",n[n.ROOT_FOLDER=2]="ROOT_FOLDER"})(kS||(kS={}));const c8="";function DS(n){if(!(typeof n.size!="number"||typeof n.mtime!="number"))return n.mtime.toString(29)+n.size.toString(31)}const _n=class _n{static formatSize(e){return ga(e)||(e=0),e<_n.KB?h(1884,"{0}B",e.toFixed(0)):e<_n.MB?h(1885,"{0}KB",(e/_n.KB).toFixed(2)):e<_n.GB?h(1886,"{0}MB",(e/_n.MB).toFixed(2)):e<_n.TB?h(1887,"{0}GB",(e/_n.GB).toFixed(2)):h(1888,"{0}TB",(e/_n.TB).toFixed(2))}};_n.KB=1024,_n.MB=_n.KB*_n.KB,_n.GB=_n.MB*_n.KB,_n.TB=_n.GB*_n.KB;let IS=_n;var Fd;(function(n){n[n.Ignore=0]="Ignore",n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(Fd||(Fd={}));(function(n){const e="error",t="warning",i="warn",s="info",r="ignore";function o(l){return l?co(e,l)?n.Error:co(t,l)||co(i,l)?n.Warning:co(s,l)?n.Info:n.Ignore:n.Ignore}n.fromValue=o;function a(l){switch(l){case n.Error:return e;case n.Warning:return t;case n.Info:return s;default:return r}}n.toString=a})(Fd||(Fd={}));var Qt=Fd,CS;(function(n){n[n.DEFAULT=0]="DEFAULT",n[n.OPTIONAL=1]="OPTIONAL",n[n.SILENT=2]="SILENT",n[n.URGENT=3]="URGENT"})(CS||(CS={}));var TS;(function(n){n[n.WORKSPACE=0]="WORKSPACE",n[n.PROFILE=1]="PROFILE",n[n.APPLICATION=2]="APPLICATION"})(TS||(TS={}));var PS;(function(n){n[n.OFF=0]="OFF",n[n.ERROR=1]="ERROR"})(PS||(PS={}));function u8(n){const e=n;return typeof e?.id=="string"&&x.isUri(e.uri)}function d8(n){const e=n;return typeof e?.id=="string"&&x.isUri(e.configPath)}var Op;(function(n){n[n.EMPTY=1]="EMPTY",n[n.FOLDER=2]="FOLDER",n[n.WORKSPACE=3]="WORKSPACE"})(Op||(Op={}));let h8=class{get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}constructor(e,t,i,s,r){this._id=e,this._transient=i,this._configuration=s,this.ignorePathCasing=r,this.foldersMap=Rs.forUris(this.ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this.ignorePathCasing=e.ignorePathCasing,this.folders=e.folders}get id(){return this._id}get transient(){return this._transient}get configuration(){return this._configuration}set configuration(e){this._configuration=e}getFolder(e){return e&&this.foldersMap.findSubstr(e)||null}updateFoldersMap(){this.foldersMap=Rs.forUris(this.ignorePathCasing,()=>!0);for(const e of this.folders)this.foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration}}};class MC{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return An(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}function Z_(n){return new MC({uri:n,index:0,name:jv(n)},{uri:n.toString()})}const f8="code-workspace";h(2386,"Code Workspace");class p8{constructor(){this._systemSchemes=new Set(Object.keys(le)),this._providerInfo=new Map,this.extUri=new Xh(e=>{const t=this._providerInfo.get(e.scheme);return!(t===void 0||t&ks.PathCaseSensitive)})}$acceptProviderInfos(e,t){t===null?this._providerInfo.delete(e.scheme):this._providerInfo.set(e.scheme,t)}isFreeScheme(e){return!this._providerInfo.has(e)&&!this._systemSchemes.has(e)}getCapabilities(e){return this._providerInfo.get(e)}}const hu=pe("IExtHostFileSystemInfo"),Sn=(function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);const n=new Uint8Array(16),e=[];for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(n),n[6]=n[6]&15|64,n[8]=n[8]&63|128;let i=0,s="";return s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+="-",s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s+=e[n[i++]],s}})(),Zv=Object.freeze({create:n=>Il(n.map(e=>e.toString())).join(`\r
|
|
18
18
|
`),split:n=>n.split(`\r
|
|
19
19
|
`),parse:n=>Zv.split(n).filter(e=>!e.startsWith("#"))});var AS;(function(n){n[n.InitialConsonant=4352]="InitialConsonant",n[n.Vowel=4449]="Vowel",n[n.FinalConsonant=4520]="FinalConsonant",n[n.CompatibilityJamo=12593]="CompatibilityJamo"})(AS||(AS={}));var te;(function(n){n[n.NUL=0]="NUL",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z"})(te||(te={}));var Ze;(function(n){n[n.fa=24934]="fa",n[n.fg=26470]="fg",n[n.fq=29030]="fq",n[n.fr=29286]="fr",n[n.ft=29798]="ft",n[n.fv=30310]="fv",n[n.fx=30822]="fx",n[n.hk=27496]="hk",n[n.hl=27752]="hl",n[n.ho=28520]="ho",n[n.ml=27757]="ml",n[n.nj=27246]="nj",n[n.nl=27758]="nl",n[n.np=28782]="np",n[n.qt=29809]="qt",n[n.rt=29810]="rt",n[n.sg=26483]="sg",n[n.sw=30579]="sw"})(Ze||(Ze={}));new Uint8Array([te.r,te.R,te.s,te.e,te.E,te.f,te.a,te.q,te.Q,te.t,te.T,te.d,te.w,te.W,te.c,te.z,te.x,te.v,te.g]);new Uint16Array([te.k,te.o,te.i,te.O,te.j,te.p,te.u,te.P,te.h,Ze.hk,Ze.ho,Ze.hl,te.y,te.n,Ze.nj,Ze.np,Ze.nl,te.b,te.m,Ze.ml,te.l]);new Uint16Array([te.r,te.R,Ze.rt,te.s,Ze.sw,Ze.sg,te.e,te.f,Ze.fr,Ze.fa,Ze.fq,Ze.ft,Ze.fx,Ze.fv,Ze.fg,te.a,te.q,Ze.qt,te.t,te.T,te.d,te.w,te.c,te.z,te.x,te.v,te.g]);new Uint16Array([te.r,te.R,Ze.rt,te.s,Ze.sw,Ze.sg,te.e,te.E,te.f,Ze.fr,Ze.fa,Ze.fq,Ze.ft,Ze.fx,Ze.fv,Ze.fg,te.a,te.q,te.Q,Ze.qt,te.t,te.T,te.d,te.w,te.W,te.c,te.z,te.x,te.v,te.g,te.k,te.o,te.i,te.O,te.j,te.p,te.u,te.P,te.h,Ze.hk,Ze.ho,Ze.hl,te.y,te.n,Ze.nj,Ze.np,Ze.nl,te.b,te.m,Ze.ml,te.l]);function UC(...n){return function(e,t){for(let i=0,s=n.length;i<s;i++){const r=n[i](e,t);if(r)return r}return null}}HC.bind(void 0,!1);const $C=HC.bind(void 0,!0);function HC(n,e,t){if(!t||t.length<e.length)return null;let i;return n?i=Dx(t,e):i=t.indexOf(e)===0,i?e.length>0?[{start:0,end:e.length}]:[]:null}function g8(n,e){const t=e.toLowerCase().indexOf(n.toLowerCase());return t===-1?null:[{start:t,end:t+n.length}]}function m8(n,e){return ew(n.toLowerCase(),e.toLowerCase(),0,0)}function ew(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]===e[i]){let s=null;return(s=ew(n,e,t+1,i+1))?WC({start:i,end:i+1},s):null}return ew(n,e,t,i+1)}function Rx(n){return R.a<=n&&n<=R.z}function X1(n){return R.A<=n&&n<=R.Z}function Lx(n){return R.Digit0<=n&&n<=R.Digit9}function _8(n){return n===R.Space||n===R.Tab||n===R.LineFeed||n===R.CarriageReturn}const v8=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(n=>v8.add(n.charCodeAt(0)));function BC(n){return Rx(n)||X1(n)||Lx(n)}function WC(n,e){return e.length===0?e=[n]:n.end===e[0].start?e[0].start=n.start:e.unshift(n),e}function VC(n,e){for(let t=e;t<n.length;t++){const i=n.charCodeAt(t);if(X1(i)||Lx(i)||t>0&&!BC(n.charCodeAt(t-1)))return t}return n.length}function tw(n,e,t,i){if(t===n.length)return[];if(i===e.length)return null;if(n[t]!==e[i].toLowerCase())return null;{let s=null,r=i+1;for(s=tw(n,e,t+1,i+1);!s&&(r=VC(e,r))<e.length;)s=tw(n,e,t+1,r),r++;return s===null?null:WC({start:i,end:i+1},s)}}function w8(n){let e=0,t=0,i=0,s=0,r=0;for(let u=0;u<n.length;u++)r=n.charCodeAt(u),X1(r)&&e++,Rx(r)&&t++,BC(r)&&i++,Lx(r)&&s++;const o=e/n.length,a=t/n.length,l=i/n.length,c=s/n.length;return{upperPercent:o,lowerPercent:a,alphaPercent:l,numericPercent:c}}function b8(n){const{upperPercent:e,lowerPercent:t}=n;return t===0&&e>.6}function y8(n){const{upperPercent:e,lowerPercent:t,alphaPercent:i,numericPercent:s}=n;return t>.2&&e<.8&&i>.6&&s<.2}function x8(n){let e=0,t=0,i=0,s=0;for(let r=0;r<n.length;r++)i=n.charCodeAt(r),X1(i)&&e++,Rx(i)&&t++,_8(i)&&s++;return(e===0||t===0)&&s===0?n.length<=30:e<=5}function zC(n,e){if(!e||(e=e.trim(),e.length===0)||!x8(n))return null;e.length>60&&(e=e.substring(0,60));const t=w8(e);if(!y8(t)){if(!b8(t))return null;e=e.toLowerCase()}let i=null,s=0;for(n=n.toLowerCase();s<e.length&&(i=tw(n,e,0,s))===null;)s=VC(e,s+1);return i}UC($C,zC,g8);UC($C,zC,m8);new vx(1e4);const RS=128;function Nx(){const n=[],e=[];for(let t=0;t<=RS;t++)e[t]=0;for(let t=0;t<=RS;t++)n.push(e.slice(0));return n}Nx();Nx();Nx();var LS;(function(n){n[n.Diag=1]="Diag",n[n.Left=2]="Left",n[n.LeftLeft=3]="LeftLeft"})(LS||(LS={}));var NS;(function(n){n.Default=[-100,0];function e(t){return!t||t.length===2&&t[0]===-100&&t[1]===0}n.isDefault=e})(NS||(NS={}));const nw=Object.create(null);function g(n,e){if(it(e)){const t=nw[e];if(t===void 0)throw new Error(`${n} references an unknown codicon: ${e}`);e=t}return nw[n]=e,{id:n}}function E8(){return nw}const S8={add:g("add",6e4),plus:g("plus",6e4),gistNew:g("gist-new",6e4),repoCreate:g("repo-create",6e4),lightbulb:g("lightbulb",60001),lightBulb:g("light-bulb",60001),repo:g("repo",60002),repoDelete:g("repo-delete",60002),gistFork:g("gist-fork",60003),repoForked:g("repo-forked",60003),gitPullRequest:g("git-pull-request",60004),gitPullRequestAbandoned:g("git-pull-request-abandoned",60004),recordKeys:g("record-keys",60005),keyboard:g("keyboard",60005),tag:g("tag",60006),gitPullRequestLabel:g("git-pull-request-label",60006),tagAdd:g("tag-add",60006),tagRemove:g("tag-remove",60006),person:g("person",60007),personFollow:g("person-follow",60007),personOutline:g("person-outline",60007),personFilled:g("person-filled",60007),gitBranch:g("git-branch",60008),gitBranchCreate:g("git-branch-create",60008),gitBranchDelete:g("git-branch-delete",60008),sourceControl:g("source-control",60008),mirror:g("mirror",60009),mirrorPublic:g("mirror-public",60009),star:g("star",60010),starAdd:g("star-add",60010),starDelete:g("star-delete",60010),starEmpty:g("star-empty",60010),comment:g("comment",60011),commentAdd:g("comment-add",60011),alert:g("alert",60012),warning:g("warning",60012),search:g("search",60013),searchSave:g("search-save",60013),logOut:g("log-out",60014),signOut:g("sign-out",60014),logIn:g("log-in",60015),signIn:g("sign-in",60015),eye:g("eye",60016),eyeUnwatch:g("eye-unwatch",60016),eyeWatch:g("eye-watch",60016),circleFilled:g("circle-filled",60017),primitiveDot:g("primitive-dot",60017),closeDirty:g("close-dirty",60017),debugBreakpoint:g("debug-breakpoint",60017),debugBreakpointDisabled:g("debug-breakpoint-disabled",60017),debugHint:g("debug-hint",60017),terminalDecorationSuccess:g("terminal-decoration-success",60017),primitiveSquare:g("primitive-square",60018),edit:g("edit",60019),pencil:g("pencil",60019),info:g("info",60020),issueOpened:g("issue-opened",60020),gistPrivate:g("gist-private",60021),gitForkPrivate:g("git-fork-private",60021),lock:g("lock",60021),mirrorPrivate:g("mirror-private",60021),close:g("close",60022),removeClose:g("remove-close",60022),x:g("x",60022),repoSync:g("repo-sync",60023),sync:g("sync",60023),clone:g("clone",60024),desktopDownload:g("desktop-download",60024),beaker:g("beaker",60025),microscope:g("microscope",60025),vm:g("vm",60026),deviceDesktop:g("device-desktop",60026),file:g("file",60027),fileText:g("file-text",60027),more:g("more",60028),ellipsis:g("ellipsis",60028),kebabHorizontal:g("kebab-horizontal",60028),mailReply:g("mail-reply",60029),reply:g("reply",60029),organization:g("organization",60030),organizationFilled:g("organization-filled",60030),organizationOutline:g("organization-outline",60030),newFile:g("new-file",60031),fileAdd:g("file-add",60031),newFolder:g("new-folder",60032),fileDirectoryCreate:g("file-directory-create",60032),trash:g("trash",60033),trashcan:g("trashcan",60033),history:g("history",60034),clock:g("clock",60034),folder:g("folder",60035),fileDirectory:g("file-directory",60035),symbolFolder:g("symbol-folder",60035),logoGithub:g("logo-github",60036),markGithub:g("mark-github",60036),github:g("github",60036),terminal:g("terminal",60037),console:g("console",60037),repl:g("repl",60037),zap:g("zap",60038),symbolEvent:g("symbol-event",60038),error:g("error",60039),stop:g("stop",60039),variable:g("variable",60040),symbolVariable:g("symbol-variable",60040),array:g("array",60042),symbolArray:g("symbol-array",60042),symbolModule:g("symbol-module",60043),symbolPackage:g("symbol-package",60043),symbolNamespace:g("symbol-namespace",60043),symbolObject:g("symbol-object",60043),symbolMethod:g("symbol-method",60044),symbolFunction:g("symbol-function",60044),symbolConstructor:g("symbol-constructor",60044),symbolBoolean:g("symbol-boolean",60047),symbolNull:g("symbol-null",60047),symbolNumeric:g("symbol-numeric",60048),symbolNumber:g("symbol-number",60048),symbolStructure:g("symbol-structure",60049),symbolStruct:g("symbol-struct",60049),symbolParameter:g("symbol-parameter",60050),symbolTypeParameter:g("symbol-type-parameter",60050),symbolKey:g("symbol-key",60051),symbolText:g("symbol-text",60051),symbolReference:g("symbol-reference",60052),goToFile:g("go-to-file",60052),symbolEnum:g("symbol-enum",60053),symbolValue:g("symbol-value",60053),symbolRuler:g("symbol-ruler",60054),symbolUnit:g("symbol-unit",60054),activateBreakpoints:g("activate-breakpoints",60055),archive:g("archive",60056),arrowBoth:g("arrow-both",60057),arrowDown:g("arrow-down",60058),arrowLeft:g("arrow-left",60059),arrowRight:g("arrow-right",60060),arrowSmallDown:g("arrow-small-down",60061),arrowSmallLeft:g("arrow-small-left",60062),arrowSmallRight:g("arrow-small-right",60063),arrowSmallUp:g("arrow-small-up",60064),arrowUp:g("arrow-up",60065),bell:g("bell",60066),bold:g("bold",60067),book:g("book",60068),bookmark:g("bookmark",60069),debugBreakpointConditionalUnverified:g("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:g("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:g("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:g("debug-breakpoint-data-unverified",60072),debugBreakpointData:g("debug-breakpoint-data",60073),debugBreakpointDataDisabled:g("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:g("debug-breakpoint-log-unverified",60074),debugBreakpointLog:g("debug-breakpoint-log",60075),debugBreakpointLogDisabled:g("debug-breakpoint-log-disabled",60075),briefcase:g("briefcase",60076),broadcast:g("broadcast",60077),browser:g("browser",60078),bug:g("bug",60079),calendar:g("calendar",60080),caseSensitive:g("case-sensitive",60081),check:g("check",60082),checklist:g("checklist",60083),chevronDown:g("chevron-down",60084),chevronLeft:g("chevron-left",60085),chevronRight:g("chevron-right",60086),chevronUp:g("chevron-up",60087),chromeClose:g("chrome-close",60088),chromeMaximize:g("chrome-maximize",60089),chromeMinimize:g("chrome-minimize",60090),chromeRestore:g("chrome-restore",60091),circleOutline:g("circle-outline",60092),circle:g("circle",60092),debugBreakpointUnverified:g("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:g("terminal-decoration-incomplete",60092),circleSlash:g("circle-slash",60093),circuitBoard:g("circuit-board",60094),clearAll:g("clear-all",60095),clippy:g("clippy",60096),closeAll:g("close-all",60097),cloudDownload:g("cloud-download",60098),cloudUpload:g("cloud-upload",60099),code:g("code",60100),collapseAll:g("collapse-all",60101),colorMode:g("color-mode",60102),commentDiscussion:g("comment-discussion",60103),creditCard:g("credit-card",60105),dash:g("dash",60108),dashboard:g("dashboard",60109),database:g("database",60110),debugContinue:g("debug-continue",60111),debugDisconnect:g("debug-disconnect",60112),debugPause:g("debug-pause",60113),debugRestart:g("debug-restart",60114),debugStart:g("debug-start",60115),debugStepInto:g("debug-step-into",60116),debugStepOut:g("debug-step-out",60117),debugStepOver:g("debug-step-over",60118),debugStop:g("debug-stop",60119),debug:g("debug",60120),deviceCameraVideo:g("device-camera-video",60121),deviceCamera:g("device-camera",60122),deviceMobile:g("device-mobile",60123),diffAdded:g("diff-added",60124),diffIgnored:g("diff-ignored",60125),diffModified:g("diff-modified",60126),diffRemoved:g("diff-removed",60127),diffRenamed:g("diff-renamed",60128),diff:g("diff",60129),diffSidebyside:g("diff-sidebyside",60129),discard:g("discard",60130),editorLayout:g("editor-layout",60131),emptyWindow:g("empty-window",60132),exclude:g("exclude",60133),extensions:g("extensions",60134),eyeClosed:g("eye-closed",60135),fileBinary:g("file-binary",60136),fileCode:g("file-code",60137),fileMedia:g("file-media",60138),filePdf:g("file-pdf",60139),fileSubmodule:g("file-submodule",60140),fileSymlinkDirectory:g("file-symlink-directory",60141),fileSymlinkFile:g("file-symlink-file",60142),fileZip:g("file-zip",60143),files:g("files",60144),filter:g("filter",60145),flame:g("flame",60146),foldDown:g("fold-down",60147),foldUp:g("fold-up",60148),fold:g("fold",60149),folderActive:g("folder-active",60150),folderOpened:g("folder-opened",60151),gear:g("gear",60152),gift:g("gift",60153),gistSecret:g("gist-secret",60154),gist:g("gist",60155),gitCommit:g("git-commit",60156),gitCompare:g("git-compare",60157),compareChanges:g("compare-changes",60157),gitMerge:g("git-merge",60158),githubAction:g("github-action",60159),githubAlt:g("github-alt",60160),globe:g("globe",60161),grabber:g("grabber",60162),graph:g("graph",60163),gripper:g("gripper",60164),heart:g("heart",60165),home:g("home",60166),horizontalRule:g("horizontal-rule",60167),hubot:g("hubot",60168),inbox:g("inbox",60169),issueReopened:g("issue-reopened",60171),issues:g("issues",60172),italic:g("italic",60173),jersey:g("jersey",60174),json:g("json",60175),kebabVertical:g("kebab-vertical",60176),key:g("key",60177),law:g("law",60178),lightbulbAutofix:g("lightbulb-autofix",60179),linkExternal:g("link-external",60180),link:g("link",60181),listOrdered:g("list-ordered",60182),listUnordered:g("list-unordered",60183),liveShare:g("live-share",60184),loading:g("loading",60185),location:g("location",60186),mailRead:g("mail-read",60187),mail:g("mail",60188),markdown:g("markdown",60189),megaphone:g("megaphone",60190),mention:g("mention",60191),milestone:g("milestone",60192),gitPullRequestMilestone:g("git-pull-request-milestone",60192),mortarBoard:g("mortar-board",60193),move:g("move",60194),multipleWindows:g("multiple-windows",60195),mute:g("mute",60196),noNewline:g("no-newline",60197),note:g("note",60198),octoface:g("octoface",60199),openPreview:g("open-preview",60200),package:g("package",60201),paintcan:g("paintcan",60202),pin:g("pin",60203),play:g("play",60204),run:g("run",60204),plug:g("plug",60205),preserveCase:g("preserve-case",60206),preview:g("preview",60207),project:g("project",60208),pulse:g("pulse",60209),question:g("question",60210),quote:g("quote",60211),radioTower:g("radio-tower",60212),reactions:g("reactions",60213),references:g("references",60214),refresh:g("refresh",60215),regex:g("regex",60216),remoteExplorer:g("remote-explorer",60217),remote:g("remote",60218),remove:g("remove",60219),replaceAll:g("replace-all",60220),replace:g("replace",60221),repoClone:g("repo-clone",60222),repoForcePush:g("repo-force-push",60223),repoPull:g("repo-pull",60224),repoPush:g("repo-push",60225),report:g("report",60226),requestChanges:g("request-changes",60227),rocket:g("rocket",60228),rootFolderOpened:g("root-folder-opened",60229),rootFolder:g("root-folder",60230),rss:g("rss",60231),ruby:g("ruby",60232),saveAll:g("save-all",60233),saveAs:g("save-as",60234),save:g("save",60235),screenFull:g("screen-full",60236),screenNormal:g("screen-normal",60237),searchStop:g("search-stop",60238),server:g("server",60240),settingsGear:g("settings-gear",60241),settings:g("settings",60242),shield:g("shield",60243),smiley:g("smiley",60244),sortPrecedence:g("sort-precedence",60245),splitHorizontal:g("split-horizontal",60246),splitVertical:g("split-vertical",60247),squirrel:g("squirrel",60248),starFull:g("star-full",60249),starHalf:g("star-half",60250),symbolClass:g("symbol-class",60251),symbolColor:g("symbol-color",60252),symbolConstant:g("symbol-constant",60253),symbolEnumMember:g("symbol-enum-member",60254),symbolField:g("symbol-field",60255),symbolFile:g("symbol-file",60256),symbolInterface:g("symbol-interface",60257),symbolKeyword:g("symbol-keyword",60258),symbolMisc:g("symbol-misc",60259),symbolOperator:g("symbol-operator",60260),symbolProperty:g("symbol-property",60261),wrench:g("wrench",60261),wrenchSubaction:g("wrench-subaction",60261),symbolSnippet:g("symbol-snippet",60262),tasklist:g("tasklist",60263),telescope:g("telescope",60264),textSize:g("text-size",60265),threeBars:g("three-bars",60266),thumbsdown:g("thumbsdown",60267),thumbsup:g("thumbsup",60268),tools:g("tools",60269),triangleDown:g("triangle-down",60270),triangleLeft:g("triangle-left",60271),triangleRight:g("triangle-right",60272),triangleUp:g("triangle-up",60273),twitter:g("twitter",60274),unfold:g("unfold",60275),unlock:g("unlock",60276),unmute:g("unmute",60277),unverified:g("unverified",60278),verified:g("verified",60279),versions:g("versions",60280),vmActive:g("vm-active",60281),vmOutline:g("vm-outline",60282),vmRunning:g("vm-running",60283),watch:g("watch",60284),whitespace:g("whitespace",60285),wholeWord:g("whole-word",60286),window:g("window",60287),wordWrap:g("word-wrap",60288),zoomIn:g("zoom-in",60289),zoomOut:g("zoom-out",60290),listFilter:g("list-filter",60291),listFlat:g("list-flat",60292),listSelection:g("list-selection",60293),selection:g("selection",60293),listTree:g("list-tree",60294),debugBreakpointFunctionUnverified:g("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:g("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:g("debug-breakpoint-function-disabled",60296),debugStackframeActive:g("debug-stackframe-active",60297),circleSmallFilled:g("circle-small-filled",60298),debugStackframeDot:g("debug-stackframe-dot",60298),terminalDecorationMark:g("terminal-decoration-mark",60298),debugStackframe:g("debug-stackframe",60299),debugStackframeFocused:g("debug-stackframe-focused",60299),debugBreakpointUnsupported:g("debug-breakpoint-unsupported",60300),symbolString:g("symbol-string",60301),debugReverseContinue:g("debug-reverse-continue",60302),debugStepBack:g("debug-step-back",60303),debugRestartFrame:g("debug-restart-frame",60304),debugAlt:g("debug-alt",60305),callIncoming:g("call-incoming",60306),callOutgoing:g("call-outgoing",60307),menu:g("menu",60308),expandAll:g("expand-all",60309),feedback:g("feedback",60310),gitPullRequestReviewer:g("git-pull-request-reviewer",60310),groupByRefType:g("group-by-ref-type",60311),ungroupByRefType:g("ungroup-by-ref-type",60312),account:g("account",60313),gitPullRequestAssignee:g("git-pull-request-assignee",60313),bellDot:g("bell-dot",60314),debugConsole:g("debug-console",60315),library:g("library",60316),output:g("output",60317),runAll:g("run-all",60318),syncIgnored:g("sync-ignored",60319),pinned:g("pinned",60320),githubInverted:g("github-inverted",60321),serverProcess:g("server-process",60322),serverEnvironment:g("server-environment",60323),pass:g("pass",60324),issueClosed:g("issue-closed",60324),stopCircle:g("stop-circle",60325),playCircle:g("play-circle",60326),record:g("record",60327),debugAltSmall:g("debug-alt-small",60328),vmConnect:g("vm-connect",60329),cloud:g("cloud",60330),merge:g("merge",60331),export:g("export",60332),graphLeft:g("graph-left",60333),magnet:g("magnet",60334),notebook:g("notebook",60335),redo:g("redo",60336),checkAll:g("check-all",60337),pinnedDirty:g("pinned-dirty",60338),passFilled:g("pass-filled",60339),circleLargeFilled:g("circle-large-filled",60340),circleLarge:g("circle-large",60341),circleLargeOutline:g("circle-large-outline",60341),combine:g("combine",60342),gather:g("gather",60342),table:g("table",60343),variableGroup:g("variable-group",60344),typeHierarchy:g("type-hierarchy",60345),typeHierarchySub:g("type-hierarchy-sub",60346),typeHierarchySuper:g("type-hierarchy-super",60347),gitPullRequestCreate:g("git-pull-request-create",60348),runAbove:g("run-above",60349),runBelow:g("run-below",60350),notebookTemplate:g("notebook-template",60351),debugRerun:g("debug-rerun",60352),workspaceTrusted:g("workspace-trusted",60353),workspaceUntrusted:g("workspace-untrusted",60354),workspaceUnknown:g("workspace-unknown",60355),terminalCmd:g("terminal-cmd",60356),terminalDebian:g("terminal-debian",60357),terminalLinux:g("terminal-linux",60358),terminalPowershell:g("terminal-powershell",60359),terminalTmux:g("terminal-tmux",60360),terminalUbuntu:g("terminal-ubuntu",60361),terminalBash:g("terminal-bash",60362),arrowSwap:g("arrow-swap",60363),copy:g("copy",60364),personAdd:g("person-add",60365),filterFilled:g("filter-filled",60366),wand:g("wand",60367),debugLineByLine:g("debug-line-by-line",60368),inspect:g("inspect",60369),layers:g("layers",60370),layersDot:g("layers-dot",60371),layersActive:g("layers-active",60372),compass:g("compass",60373),compassDot:g("compass-dot",60374),compassActive:g("compass-active",60375),azure:g("azure",60376),issueDraft:g("issue-draft",60377),gitPullRequestClosed:g("git-pull-request-closed",60378),gitPullRequestDraft:g("git-pull-request-draft",60379),debugAll:g("debug-all",60380),debugCoverage:g("debug-coverage",60381),runErrors:g("run-errors",60382),folderLibrary:g("folder-library",60383),debugContinueSmall:g("debug-continue-small",60384),beakerStop:g("beaker-stop",60385),graphLine:g("graph-line",60386),graphScatter:g("graph-scatter",60387),pieChart:g("pie-chart",60388),bracket:g("bracket",60175),bracketDot:g("bracket-dot",60389),bracketError:g("bracket-error",60390),lockSmall:g("lock-small",60391),azureDevops:g("azure-devops",60392),verifiedFilled:g("verified-filled",60393),newline:g("newline",60394),layout:g("layout",60395),layoutActivitybarLeft:g("layout-activitybar-left",60396),layoutActivitybarRight:g("layout-activitybar-right",60397),layoutPanelLeft:g("layout-panel-left",60398),layoutPanelCenter:g("layout-panel-center",60399),layoutPanelJustify:g("layout-panel-justify",60400),layoutPanelRight:g("layout-panel-right",60401),layoutPanel:g("layout-panel",60402),layoutSidebarLeft:g("layout-sidebar-left",60403),layoutSidebarRight:g("layout-sidebar-right",60404),layoutStatusbar:g("layout-statusbar",60405),layoutMenubar:g("layout-menubar",60406),layoutCentered:g("layout-centered",60407),target:g("target",60408),indent:g("indent",60409),recordSmall:g("record-small",60410),errorSmall:g("error-small",60411),terminalDecorationError:g("terminal-decoration-error",60411),arrowCircleDown:g("arrow-circle-down",60412),arrowCircleLeft:g("arrow-circle-left",60413),arrowCircleRight:g("arrow-circle-right",60414),arrowCircleUp:g("arrow-circle-up",60415),layoutSidebarRightOff:g("layout-sidebar-right-off",60416),layoutPanelOff:g("layout-panel-off",60417),layoutSidebarLeftOff:g("layout-sidebar-left-off",60418),blank:g("blank",60419),heartFilled:g("heart-filled",60420),map:g("map",60421),mapHorizontal:g("map-horizontal",60421),foldHorizontal:g("fold-horizontal",60421),mapFilled:g("map-filled",60422),mapHorizontalFilled:g("map-horizontal-filled",60422),foldHorizontalFilled:g("fold-horizontal-filled",60422),circleSmall:g("circle-small",60423),bellSlash:g("bell-slash",60424),bellSlashDot:g("bell-slash-dot",60425),commentUnresolved:g("comment-unresolved",60426),gitPullRequestGoToChanges:g("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:g("git-pull-request-new-changes",60428),searchFuzzy:g("search-fuzzy",60429),commentDraft:g("comment-draft",60430),send:g("send",60431),sparkle:g("sparkle",60432),insert:g("insert",60433),mic:g("mic",60434),thumbsdownFilled:g("thumbsdown-filled",60435),thumbsupFilled:g("thumbsup-filled",60436),coffee:g("coffee",60437),snake:g("snake",60438),game:g("game",60439),vr:g("vr",60440),chip:g("chip",60441),piano:g("piano",60442),music:g("music",60443),micFilled:g("mic-filled",60444),repoFetch:g("repo-fetch",60445),copilot:g("copilot",60446),lightbulbSparkle:g("lightbulb-sparkle",60447),robot:g("robot",60448),sparkleFilled:g("sparkle-filled",60449),diffSingle:g("diff-single",60450),diffMultiple:g("diff-multiple",60451),surroundWith:g("surround-with",60452),share:g("share",60453),gitStash:g("git-stash",60454),gitStashApply:g("git-stash-apply",60455),gitStashPop:g("git-stash-pop",60456),vscode:g("vscode",60457),vscodeInsiders:g("vscode-insiders",60458),codeOss:g("code-oss",60459),runCoverage:g("run-coverage",60460),runAllCoverage:g("run-all-coverage",60461),coverage:g("coverage",60462),githubProject:g("github-project",60463),mapVertical:g("map-vertical",60464),foldVertical:g("fold-vertical",60464),mapVerticalFilled:g("map-vertical-filled",60465),foldVerticalFilled:g("fold-vertical-filled",60465),goToSearch:g("go-to-search",60466),percentage:g("percentage",60467),sortPercentage:g("sort-percentage",60467),attach:g("attach",60468),goToEditingSession:g("go-to-editing-session",60469),editSession:g("edit-session",60470),codeReview:g("code-review",60471),copilotWarning:g("copilot-warning",60472),python:g("python",60473),copilotLarge:g("copilot-large",60474),copilotWarningLarge:g("copilot-warning-large",60475),keyboardTab:g("keyboard-tab",60476),copilotBlocked:g("copilot-blocked",60477),copilotNotConnected:g("copilot-not-connected",60478),flag:g("flag",60479),lightbulbEmpty:g("lightbulb-empty",60480),symbolMethodArrow:g("symbol-method-arrow",60481),copilotUnavailable:g("copilot-unavailable",60482),repoPinned:g("repo-pinned",60483),keyboardTabAbove:g("keyboard-tab-above",60484),keyboardTabBelow:g("keyboard-tab-below",60485),gitPullRequestDone:g("git-pull-request-done",60486),mcp:g("mcp",60487),extensionsLarge:g("extensions-large",60488),layoutPanelDock:g("layout-panel-dock",60489),layoutSidebarLeftDock:g("layout-sidebar-left-dock",60490),layoutSidebarRightDock:g("layout-sidebar-right-dock",60491)},k8={dialogError:g("dialog-error","error"),dialogWarning:g("dialog-warning","warning"),dialogInfo:g("dialog-info","info"),dialogClose:g("dialog-close","close"),treeItemExpanded:g("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:g("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:g("tree-filter-on-type-off","list-selection"),treeFilterClear:g("tree-filter-clear","close"),treeItemLoading:g("tree-item-loading","loading"),menuSelection:g("menu-selection","check"),menuSubmenu:g("menu-submenu","chevron-right"),menuBarMore:g("menubar-more","more"),scrollbarButtonLeft:g("scrollbar-button-left","triangle-left"),scrollbarButtonRight:g("scrollbar-button-right","triangle-right"),scrollbarButtonUp:g("scrollbar-button-up","triangle-up"),scrollbarButtonDown:g("scrollbar-button-down","triangle-down"),toolBarMore:g("toolbar-more","more"),quickInputBack:g("quick-input-back","arrow-left"),dropDownButton:g("drop-down-button",60084),symbolCustomColor:g("symbol-customcolor",60252),exportIcon:g("export",60332),workspaceUnspecified:g("workspace-unspecified",60355),newLine:g("newline",60394),thumbsDownFilled:g("thumbsdown-filled",60435),thumbsUpFilled:g("thumbsup-filled",60436),gitFetch:g("git-fetch",60445),lightbulbSparkleAutofix:g("lightbulb-sparkle-autofix",60447),debugBreakpointPending:g("debug-breakpoint-pending",60377)},_e={...S8,...k8};var Fc;(function(n){function e(t){return!!t&&typeof t=="object"&&typeof t.id=="string"}n.isThemeColor=e})(Fc||(Fc={}));var sn;(function(n){n.iconNameSegment="[A-Za-z0-9]+",n.iconNameExpression="[A-Za-z0-9-]+",n.iconModifierExpression="~[A-Za-z]+",n.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${n.iconNameExpression})(${n.iconModifierExpression})?$`);function t(f){const p=e.exec(f.id);if(!p)return t(_e.error);const[,_,w]=p,v=["codicon","codicon-"+_];return w&&v.push("codicon-modifier-"+w.substring(1)),v}n.asClassNameArray=t;function i(f){return t(f).join(" ")}n.asClassName=i;function s(f){return"."+t(f).join(".")}n.asCSSSelector=s;function r(f){return!!f&&typeof f=="object"&&typeof f.id=="string"&&(typeof f.color>"u"||Fc.isThemeColor(f.color))}n.isThemeIcon=r;const o=new RegExp(`^\\$\\((${n.iconNameExpression}(?:${n.iconModifierExpression})?)\\)$`);function a(f){const p=o.exec(f);if(!p)return;const[,_]=p;return{id:_}}n.fromString=a;function l(f){return{id:f}}n.fromId=l;function c(f,p){let _=f.id;const w=_.lastIndexOf("~");return w!==-1&&(_=_.substring(0,w)),p&&(_=`${_}~${p}`),{id:_}}n.modify=c;function u(f){const p=f.id.lastIndexOf("~");if(p!==-1)return f.id.substring(p+1)}n.getModifier=u;function d(f,p){return f.id===p.id&&f.color?.id===p.color?.id}n.isEqual=d})(sn||(sn={}));const Ox=new RegExp(`\\$\\(${sn.iconNameExpression}(?:${sn.iconModifierExpression})?\\)`,"g"),D8=new RegExp(`(\\\\)?${Ox.source}`,"g");function I8(n){return n.replace(D8,(e,t)=>t?e:`\\${e}`)}new RegExp(`\\\\${Ox.source}`,"g");new RegExp(`(\\s)?(\\\\)?${Ox.source}(\\s)?`,"g");new RegExp(`\\$\\(${sn.iconNameCharacter}+\\)`,"g");var Fp;(function(n){n[n.Paragraph=0]="Paragraph",n[n.Break=1]="Break"})(Fp||(Fp={}));let Mc=class qC{static lift(e){const t=new qC(e.value,e);return t.uris=e.uris,t.baseUri=e.baseUri?x.revive(e.baseUri):void 0,t}constructor(e="",t=!1){if(this.value=e,typeof this.value!="string")throw Ve("value");typeof t=="boolean"?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1)}appendText(e,t=Fp.Paragraph){return this.value+=C8(this.supportThemeIcons?I8(e):e).replace(/([ \t]+)/g,(i,s)=>" ".repeat(s.length)).replace(/\>/gm,"\\>").replace(/\n/g,t===Fp.Break?`\\
|
|
20
20
|
`:`
|
|
@@ -84,10 +84,10 @@ Received: '{1}'.`,e,qo.getLexeme(t)),r=t.offset,o=qo.getLexeme(t);return this._p
|
|
|
84
84
|
- Use 0 to automatically compute the line height from the font size.
|
|
85
85
|
- Values between 0 and 8 will be used as a multiplier with the font size.
|
|
86
86
|
- Values greater than or equal to 8 will be used as effective values.`)})}compute(e,t,i){return e.fontInfo.lineHeight}}class Y7 extends ft{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:"\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$",sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(O.minimap,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:h(337,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:h(338,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[h(339,"The minimap has the same size as the editor contents (and might scroll)."),h(340,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),h(341,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:h(342,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:h(343,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:h(344,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:h(345,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:h(346,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:h(347,"Limit the width of the minimap to render at most a certain number of columns.")},"editor.minimap.showRegionSectionHeaders":{type:"boolean",default:e.showRegionSectionHeaders,description:h(348,"Controls whether named regions are shown as section headers in the minimap.")},"editor.minimap.showMarkSectionHeaders":{type:"boolean",default:e.showMarkSectionHeaders,description:h(349,"Controls whether MARK: comments are shown as section headers in the minimap.")},"editor.minimap.markSectionHeaderRegex":{type:"string",default:e.markSectionHeaderRegex,description:h(350,"Defines the regular expression used to find section headers in comments. The regex must contain a named match group `label` (written as `(?<label>.+)`) that encapsulates the section header, otherwise it will not work. Optionally you can include another match group named `separator`. Use \\n in the pattern to match multi-line headers.")},"editor.minimap.sectionHeaderFontSize":{type:"number",default:e.sectionHeaderFontSize,description:h(351,"Controls the font size of section headers in the minimap.")},"editor.minimap.sectionHeaderLetterSpacing":{type:"number",default:e.sectionHeaderLetterSpacing,description:h(352,"Controls the amount of space (in pixels) between characters of section header. This helps the readability of the header in small font sizes.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;let i=this.defaultValue.markSectionHeaderRegex;const s=e.markSectionHeaderRegex;if(typeof s=="string")try{new RegExp(s,"d"),i=s}catch{}return{enabled:ie(t.enabled,this.defaultValue.enabled),autohide:ie(t.autohide,this.defaultValue.autohide),size:vt(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:vt(t.side,this.defaultValue.side,["right","left"]),showSlider:vt(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:ie(t.renderCharacters,this.defaultValue.renderCharacters),scale:Je.clampedInt(t.scale,1,1,3),maxColumn:Je.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:ie(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:ie(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:i,sectionHeaderFontSize:$i.clamp(t.sectionHeaderFontSize??this.defaultValue.sectionHeaderFontSize,4,32),sectionHeaderLetterSpacing:$i.clamp(t.sectionHeaderLetterSpacing??this.defaultValue.sectionHeaderLetterSpacing,0,5)}}}function Z7(n){return n==="ctrlCmd"?Li?"metaKey":"ctrlKey":"altKey"}class eL extends ft{constructor(){super(O.padding,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:h(353,"Controls the amount of space between the top edge of the editor and the first line.")},"editor.padding.bottom":{type:"number",default:0,minimum:0,maximum:1e3,description:h(354,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{top:Je.clampedInt(t.top,0,0,1e3),bottom:Je.clampedInt(t.bottom,0,0,1e3)}}}class tL extends ft{constructor(){const e={enabled:!0,cycle:!0};super(O.parameterHints,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:h(355,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:h(356,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ie(t.enabled,this.defaultValue.enabled),cycle:ie(t.cycle,this.defaultValue.cycle)}}}class nL extends al{constructor(){super(O.pixelRatio)}compute(e,t,i){return e.pixelRatio}}class iL extends ft{constructor(){super(O.placeholder,"placeholder",void 0)}validate(e){return typeof e>"u"?this.defaultValue:typeof e=="string"?e:this.defaultValue}}class sL extends ft{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[h(357,"Quick suggestions show inside the suggest widget"),h(358,"Quick suggestions show as ghost text"),h(359,"Quick suggestions are disabled")]}];super(O.quickSuggestions,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:h(360,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:h(361,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:h(362,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:h(363,"Controls whether suggestions should automatically show up while typing. This can be controlled for typing in comments, strings, and other code. Quick suggestion can be configured to show as ghost text or with the suggest widget. Also be aware of the {0}-setting which controls if suggestions are triggered by special characters.","`#editor.suggestOnTriggerCharacters#`")}),this.defaultValue=e}validate(e){if(typeof e=="boolean"){const c=e?"on":"off";return{comments:c,strings:c,other:c}}if(!e||typeof e!="object")return this.defaultValue;const{other:t,comments:i,strings:s}=e,r=["on","inline","off"];let o,a,l;return typeof t=="boolean"?o=t?"on":"off":o=vt(t,this.defaultValue.other,r),typeof i=="boolean"?a=i?"on":"off":a=vt(i,this.defaultValue.comments,r),typeof s=="boolean"?l=s?"on":"off":l=vt(s,this.defaultValue.strings,r),{other:o,comments:a,strings:l}}}var Fn;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval",n[n.Custom=4]="Custom"})(Fn||(Fn={}));class rL extends ft{constructor(){super(O.lineNumbers,"lineNumbers",{renderType:Fn.On,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[h(364,"Line numbers are not rendered."),h(365,"Line numbers are rendered as absolute number."),h(366,"Line numbers are rendered as distance in lines to cursor position."),h(367,"Line numbers are rendered every 10 lines.")],default:"on",description:h(368,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return typeof e<"u"&&(typeof e=="function"?(t=Fn.Custom,i=e):e==="interval"?t=Fn.Interval:e==="relative"?t=Fn.Relative:e==="on"?t=Fn.On:t=Fn.Off),{renderType:t,renderFn:i}}}class oL extends ft{constructor(){const e=[],t={type:"number",description:h(369,"Number of monospace characters at which this editor ruler will render.")};super(O.rulers,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:h(370,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:h(371,"Render vertical rulers after a certain number of monospace characters. Use multiple values for multiple rulers. No rulers are drawn if array is empty.")})}validate(e){if(Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="number")t.push({column:Je.clampedInt(i,0,0,1e4),color:null});else if(i&&typeof i=="object"){const s=i;t.push({column:Je.clampedInt(s.column,0,0,1e4),color:s.color})}return t.sort((i,s)=>i.column-s.column),t}return this.defaultValue}}class aL extends ft{constructor(){super(O.readOnlyMessage,"readOnlyMessage",void 0)}validate(e){return!e||typeof e!="object"?this.defaultValue:e}}function qS(n,e){if(typeof n!="string")return e;switch(n){case"hidden":return wa.Hidden;case"visible":return wa.Visible;default:return wa.Auto}}class lL extends ft{constructor(){const e={vertical:wa.Auto,horizontal:wa.Auto,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1,ignoreHorizontalScrollbarInContentHeight:!1};super(O.scrollbar,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[h(372,"The vertical scrollbar will be visible only when necessary."),h(373,"The vertical scrollbar will always be visible."),h(374,"The vertical scrollbar will always be hidden.")],default:"auto",description:h(375,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[h(376,"The horizontal scrollbar will be visible only when necessary."),h(377,"The horizontal scrollbar will always be visible."),h(378,"The horizontal scrollbar will always be hidden.")],default:"auto",description:h(379,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:h(380,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:h(381,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:h(382,"Controls whether clicks scroll by page or jump to click position.")},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:"boolean",default:e.ignoreHorizontalScrollbarInContentHeight,description:h(383,"When set, the horizontal scrollbar will not increase the size of the editor's content.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e,i=Je.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),s=Je.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:Je.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:qS(t.vertical,this.defaultValue.vertical),horizontal:qS(t.horizontal,this.defaultValue.horizontal),useShadows:ie(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:ie(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:ie(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:ie(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:ie(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:Je.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:s,verticalSliderSize:Je.clampedInt(t.verticalSliderSize,s,0,1e3),scrollByPage:ie(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:ie(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}}const Wi="inUntrustedWorkspace",Oo={allowedCharacters:"editor.unicodeHighlight.allowedCharacters",invisibleCharacters:"editor.unicodeHighlight.invisibleCharacters",nonBasicASCII:"editor.unicodeHighlight.nonBasicASCII",ambiguousCharacters:"editor.unicodeHighlight.ambiguousCharacters",includeComments:"editor.unicodeHighlight.includeComments",includeStrings:"editor.unicodeHighlight.includeStrings",allowedLocales:"editor.unicodeHighlight.allowedLocales"};class cL extends ft{constructor(){const e={nonBasicASCII:Wi,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:Wi,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(O.unicodeHighlighting,"unicodeHighlight",e,{[Oo.nonBasicASCII]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Wi],default:e.nonBasicASCII,description:h(384,"Controls whether all non-basic ASCII characters are highlighted. Only characters between U+0020 and U+007E, tab, line-feed and carriage-return are considered basic ASCII.")},[Oo.invisibleCharacters]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:h(385,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[Oo.ambiguousCharacters]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:h(386,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[Oo.includeComments]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Wi],default:e.includeComments,description:h(387,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[Oo.includeStrings]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,Wi],default:e.includeStrings,description:h(388,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[Oo.allowedCharacters]:{restricted:!0,type:"object",default:e.allowedCharacters,description:h(389,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[Oo.allowedLocales]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:h(390,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(Gn(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},i=!0)),t.allowedLocales&&e&&(Gn(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},i=!0));const s=super.applyUpdate(e,t);return i?new Qf(s.newValue,!0):s}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{nonBasicASCII:nc(t.nonBasicASCII,Wi,[!0,!1,Wi]),invisibleCharacters:ie(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:ie(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:nc(t.includeComments,Wi,[!0,!1,Wi]),includeStrings:nc(t.includeStrings,Wi,[!0,!1,Wi]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!="object"||!e)return t;const i={};for(const[s,r]of Object.entries(e))r===!0&&(i[s]=!0);return i}}class uL extends ft{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1,fontFamily:"default",syntaxHighlightingEnabled:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:"auto",allowCodeShifting:"always",useMultiLineGhostText:!0},experimental:{suppressInlineSuggestions:[]}};super(O.inlineSuggest,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:h(391,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover","never"],enumDescriptions:[h(392,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),h(393,"Show the inline suggestion toolbar when hovering over an inline suggestion."),h(394,"Never show the inline suggestion toolbar.")],description:h(395,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:"boolean",default:e.syntaxHighlightingEnabled,description:h(396,"Controls whether to show syntax highlighting for inline suggestions in the editor.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:h(397,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:"array",tags:["experimental","onExp"],items:{type:"string"},description:h(398,"Suppresses inline completions for specified extension IDs.")},"editor.inlineSuggest.fontFamily":{type:"string",default:e.fontFamily,description:h(399,"Controls the font family of the inline suggestions.")},"editor.inlineSuggest.edits.allowCodeShifting":{type:"string",default:e.edits.allowCodeShifting,description:h(400,"Controls whether showing a suggestion will shift the code to make space for the suggestion inline."),enum:["always","horizontal","never"],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.renderSideBySide":{type:"string",default:e.edits.renderSideBySide,description:h(401,"Controls whether larger suggestions can be shown side by side."),enum:["auto","never"],enumDescriptions:[h(402,"Larger suggestions will show side by side if there is enough space, otherwise they will be shown below."),h(403,"Larger suggestions are never shown side by side and will always be shown below.")],tags:["nextEditSuggestions"]},"editor.inlineSuggest.edits.showCollapsed":{type:"boolean",default:e.edits.showCollapsed,description:h(404,"Controls whether the suggestion will show as collapsed until jumping to it."),tags:["nextEditSuggestions"]}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ie(t.enabled,this.defaultValue.enabled),mode:vt(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:vt(t.showToolbar,this.defaultValue.showToolbar,["always","onHover","never"]),suppressSuggestions:ie(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:ie(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:Mn.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:ie(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),edits:{enabled:ie(t.edits?.enabled,this.defaultValue.edits.enabled),showCollapsed:ie(t.edits?.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:vt(t.edits?.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,["always","horizontal","never"]),renderSideBySide:vt(t.edits?.renderSideBySide,this.defaultValue.edits.renderSideBySide,["never","auto"]),useMultiLineGhostText:ie(t.edits?.useMultiLineGhostText,this.defaultValue.edits.useMultiLineGhostText)},experimental:{suppressInlineSuggestions:R7(t.experimental?.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions)}}}}class dL extends ft{constructor(){const e={enabled:BS.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:BS.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(O.bracketPairColorization,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:h(405,"Controls whether bracket pair colorization is enabled or not. Use {0} to override the bracket highlight colors.","`#workbench.colorCustomizations#`")},"editor.bracketPairColorization.independentColorPoolPerBracketType":{type:"boolean",default:e.independentColorPoolPerBracketType,description:h(406,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ie(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:ie(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}class hL extends ft{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(O.guides,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[h(407,"Enables bracket pair guides."),h(408,"Enables bracket pair guides only for the active bracket pair."),h(409,"Disables bracket pair guides.")],default:e.bracketPairs,description:h(410,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[h(411,"Enables horizontal guides as addition to vertical bracket pair guides."),h(412,"Enables horizontal guides only for the active bracket pair."),h(413,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:h(414,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:h(415,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:h(416,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[h(417,"Highlights the active indent guide."),h(418,"Highlights the active indent guide even if bracket guides are highlighted."),h(419,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:h(420,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{bracketPairs:nc(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:nc(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:ie(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:ie(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:nc(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}function nc(n,e,t){const i=t.indexOf(n);return i===-1?e:t[i]}class fL extends ft{constructor(){const e={insertMode:"insert",filterGraceful:!0,snippetsPreventQuickSuggestions:!1,localityBonus:!1,shareSuggestSelections:!1,selectionMode:"always",showIcons:!0,showStatusBar:!1,preview:!1,previewMode:"subwordSmart",showInlineDetails:!0,showMethods:!0,showFunctions:!0,showConstructors:!0,showDeprecated:!0,matchOnWordStartOnly:!0,showFields:!0,showVariables:!0,showClasses:!0,showStructs:!0,showInterfaces:!0,showModules:!0,showProperties:!0,showEvents:!0,showOperators:!0,showUnits:!0,showValues:!0,showConstants:!0,showEnums:!0,showEnumMembers:!0,showKeywords:!0,showWords:!0,showColors:!0,showFiles:!0,showReferences:!0,showFolders:!0,showTypeParameters:!0,showSnippets:!0,showUsers:!0,showIssues:!0};super(O.suggest,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[h(421,"Insert suggestion without overwriting text right of the cursor."),h(422,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:h(423,"Controls whether words are overwritten when accepting completions. Note that this depends on extensions opting into this feature.")},"editor.suggest.filterGraceful":{type:"boolean",default:e.filterGraceful,description:h(424,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:h(425,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:h(426,"Controls whether remembered suggestion selections are shared between multiple workspaces and windows (needs `#editor.suggestSelection#`).")},"editor.suggest.selectionMode":{type:"string",enum:["always","never","whenTriggerCharacter","whenQuickSuggestion"],enumDescriptions:[h(427,"Always select a suggestion when automatically triggering IntelliSense."),h(428,"Never select a suggestion when automatically triggering IntelliSense."),h(429,"Select a suggestion only when triggering IntelliSense from a trigger character."),h(430,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:h(431,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions ({0} and {1}) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.","`#editor.quickSuggestions#`","`#editor.suggestOnTriggerCharacters#`")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:h(432,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:h(433,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:h(434,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:h(435,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:h(436,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:h(437,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:h(438,"This setting is deprecated, please use separate settings like 'editor.suggest.showKeywords' or 'editor.suggest.showSnippets' instead.")},"editor.suggest.showMethods":{type:"boolean",default:!0,markdownDescription:h(439,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:h(440,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:h(441,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:h(442,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:h(443,"When enabled IntelliSense filtering requires that the first character matches on a word start. For example, `c` on `Console` or `WebContext` but _not_ on `description`. When disabled IntelliSense will show more results but still sorts them by match quality.")},"editor.suggest.showFields":{type:"boolean",default:!0,markdownDescription:h(444,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:h(445,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:h(446,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:h(447,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:h(448,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:h(449,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:h(450,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:h(451,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:h(452,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:h(453,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:h(454,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:h(455,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:h(456,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:h(457,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:h(458,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:h(459,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:h(460,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:h(461,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:h(462,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:h(463,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:h(464,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:h(465,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:h(466,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:h(467,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:h(468,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{insertMode:vt(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:ie(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:ie(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:ie(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:ie(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:vt(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:ie(t.showIcons,this.defaultValue.showIcons),showStatusBar:ie(t.showStatusBar,this.defaultValue.showStatusBar),preview:ie(t.preview,this.defaultValue.preview),previewMode:vt(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:ie(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:ie(t.showMethods,this.defaultValue.showMethods),showFunctions:ie(t.showFunctions,this.defaultValue.showFunctions),showConstructors:ie(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:ie(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:ie(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:ie(t.showFields,this.defaultValue.showFields),showVariables:ie(t.showVariables,this.defaultValue.showVariables),showClasses:ie(t.showClasses,this.defaultValue.showClasses),showStructs:ie(t.showStructs,this.defaultValue.showStructs),showInterfaces:ie(t.showInterfaces,this.defaultValue.showInterfaces),showModules:ie(t.showModules,this.defaultValue.showModules),showProperties:ie(t.showProperties,this.defaultValue.showProperties),showEvents:ie(t.showEvents,this.defaultValue.showEvents),showOperators:ie(t.showOperators,this.defaultValue.showOperators),showUnits:ie(t.showUnits,this.defaultValue.showUnits),showValues:ie(t.showValues,this.defaultValue.showValues),showConstants:ie(t.showConstants,this.defaultValue.showConstants),showEnums:ie(t.showEnums,this.defaultValue.showEnums),showEnumMembers:ie(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:ie(t.showKeywords,this.defaultValue.showKeywords),showWords:ie(t.showWords,this.defaultValue.showWords),showColors:ie(t.showColors,this.defaultValue.showColors),showFiles:ie(t.showFiles,this.defaultValue.showFiles),showReferences:ie(t.showReferences,this.defaultValue.showReferences),showFolders:ie(t.showFolders,this.defaultValue.showFolders),showTypeParameters:ie(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:ie(t.showSnippets,this.defaultValue.showSnippets),showUsers:ie(t.showUsers,this.defaultValue.showUsers),showIssues:ie(t.showIssues,this.defaultValue.showIssues)}}}class pL extends ft{constructor(){super(O.smartSelect,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:h(469,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:h(470,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return!e||typeof e!="object"?this.defaultValue:{selectLeadingAndTrailingWhitespace:ie(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:ie(e.selectSubwords,this.defaultValue.selectSubwords)}}}class gL extends ft{constructor(){const e=[];super(O.wordSegmenterLocales,"wordSegmenterLocales",e,{anyOf:[{description:h(471,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"string"},{description:h(471,"Locales to be used for word segmentation when doing word related navigations or operations. Specify the BCP 47 language tag of the word you wish to recognize (e.g., ja, zh-CN, zh-Hant-TW, etc.)."),type:"array",items:{type:"string"}}]})}validate(e){if(typeof e=="string"&&(e=[e]),Array.isArray(e)){const t=[];for(const i of e)if(typeof i=="string")try{Intl.Segmenter.supportedLocalesOf(i).length>0&&t.push(i)}catch{}return t}return this.defaultValue}}var lr;(function(n){n[n.None=0]="None",n[n.Same=1]="Same",n[n.Indent=2]="Indent",n[n.DeepIndent=3]="DeepIndent"})(lr||(lr={}));class mL extends ft{constructor(){super(O.wrappingIndent,"wrappingIndent",lr.Same,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[h(472,"No indentation. Wrapped lines begin at column 1."),h(473,"Wrapped lines get the same indentation as the parent."),h(474,"Wrapped lines get +1 indentation toward the parent."),h(475,"Wrapped lines get +2 indentation toward the parent.")],description:h(476,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return lr.None;case"same":return lr.Same;case"indent":return lr.Indent;case"deepIndent":return lr.DeepIndent}return lr.Same}compute(e,t,i){return t.get(O.accessibilitySupport)===wr.Enabled?lr.None:i}}class _L extends al{constructor(){super(O.wrappingInfo)}compute(e,t,i){const s=t.get(O.layoutInfo);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:s.isWordWrapMinified,isViewportWrapping:s.isViewportWrapping,wrappingColumn:s.wrappingColumn}}}class vL extends ft{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(O.dropIntoEditor,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:h(477,"Controls whether you can drag and drop a file into a text editor by holding down the `Shift` key (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:h(478,"Controls if a widget is shown when dropping files into the editor. This widget lets you control how the file is dropped."),enum:["afterDrop","never"],enumDescriptions:[h(479,"Show the drop selector widget after a file is dropped into the editor."),h(480,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ie(t.enabled,this.defaultValue.enabled),showDropSelector:vt(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}class wL extends ft{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(O.pasteAs,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:h(481,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:h(482,"Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),enum:["afterPaste","never"],enumDescriptions:[h(483,"Show the paste selector widget after content is pasted into the editor."),h(484,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||typeof e!="object")return this.defaultValue;const t=e;return{enabled:ie(t.enabled,this.defaultValue.enabled),showPasteSelector:vt(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}const bL="Consolas, 'Courier New', monospace",yL="Menlo, Monaco, 'Courier New', monospace",xL="'Droid Sans Mono', 'monospace', monospace",Tr={fontFamily:Li?yL:Qn?bL:xL,fontWeight:"normal",fontSize:Li?12:14,lineHeight:0,letterSpacing:0},EL=[];function U(n){return EL[n.id]=n,n}var O;(function(n){n[n.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",n[n.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",n[n.accessibilitySupport=2]="accessibilitySupport",n[n.accessibilityPageSize=3]="accessibilityPageSize",n[n.allowVariableLineHeights=4]="allowVariableLineHeights",n[n.ariaLabel=5]="ariaLabel",n[n.ariaRequired=6]="ariaRequired",n[n.autoClosingBrackets=7]="autoClosingBrackets",n[n.autoClosingComments=8]="autoClosingComments",n[n.screenReaderAnnounceInlineSuggestion=9]="screenReaderAnnounceInlineSuggestion",n[n.autoClosingDelete=10]="autoClosingDelete",n[n.autoClosingOvertype=11]="autoClosingOvertype",n[n.autoClosingQuotes=12]="autoClosingQuotes",n[n.autoIndent=13]="autoIndent",n[n.automaticLayout=14]="automaticLayout",n[n.autoSurround=15]="autoSurround",n[n.bracketPairColorization=16]="bracketPairColorization",n[n.guides=17]="guides",n[n.codeLens=18]="codeLens",n[n.codeLensFontFamily=19]="codeLensFontFamily",n[n.codeLensFontSize=20]="codeLensFontSize",n[n.colorDecorators=21]="colorDecorators",n[n.colorDecoratorsLimit=22]="colorDecoratorsLimit",n[n.columnSelection=23]="columnSelection",n[n.comments=24]="comments",n[n.contextmenu=25]="contextmenu",n[n.copyWithSyntaxHighlighting=26]="copyWithSyntaxHighlighting",n[n.cursorBlinking=27]="cursorBlinking",n[n.cursorSmoothCaretAnimation=28]="cursorSmoothCaretAnimation",n[n.cursorStyle=29]="cursorStyle",n[n.cursorSurroundingLines=30]="cursorSurroundingLines",n[n.cursorSurroundingLinesStyle=31]="cursorSurroundingLinesStyle",n[n.cursorWidth=32]="cursorWidth",n[n.disableLayerHinting=33]="disableLayerHinting",n[n.disableMonospaceOptimizations=34]="disableMonospaceOptimizations",n[n.domReadOnly=35]="domReadOnly",n[n.dragAndDrop=36]="dragAndDrop",n[n.dropIntoEditor=37]="dropIntoEditor",n[n.experimentalEditContextEnabled=38]="experimentalEditContextEnabled",n[n.emptySelectionClipboard=39]="emptySelectionClipboard",n[n.experimentalGpuAcceleration=40]="experimentalGpuAcceleration",n[n.experimentalWhitespaceRendering=41]="experimentalWhitespaceRendering",n[n.extraEditorClassName=42]="extraEditorClassName",n[n.fastScrollSensitivity=43]="fastScrollSensitivity",n[n.find=44]="find",n[n.fixedOverflowWidgets=45]="fixedOverflowWidgets",n[n.folding=46]="folding",n[n.foldingStrategy=47]="foldingStrategy",n[n.foldingHighlight=48]="foldingHighlight",n[n.foldingImportsByDefault=49]="foldingImportsByDefault",n[n.foldingMaximumRegions=50]="foldingMaximumRegions",n[n.unfoldOnClickAfterEndOfLine=51]="unfoldOnClickAfterEndOfLine",n[n.fontFamily=52]="fontFamily",n[n.fontInfo=53]="fontInfo",n[n.fontLigatures=54]="fontLigatures",n[n.fontSize=55]="fontSize",n[n.fontWeight=56]="fontWeight",n[n.fontVariations=57]="fontVariations",n[n.formatOnPaste=58]="formatOnPaste",n[n.formatOnType=59]="formatOnType",n[n.glyphMargin=60]="glyphMargin",n[n.gotoLocation=61]="gotoLocation",n[n.hideCursorInOverviewRuler=62]="hideCursorInOverviewRuler",n[n.hover=63]="hover",n[n.inDiffEditor=64]="inDiffEditor",n[n.inlineSuggest=65]="inlineSuggest",n[n.letterSpacing=66]="letterSpacing",n[n.lightbulb=67]="lightbulb",n[n.lineDecorationsWidth=68]="lineDecorationsWidth",n[n.lineHeight=69]="lineHeight",n[n.lineNumbers=70]="lineNumbers",n[n.lineNumbersMinChars=71]="lineNumbersMinChars",n[n.linkedEditing=72]="linkedEditing",n[n.links=73]="links",n[n.matchBrackets=74]="matchBrackets",n[n.minimap=75]="minimap",n[n.mouseStyle=76]="mouseStyle",n[n.mouseWheelScrollSensitivity=77]="mouseWheelScrollSensitivity",n[n.mouseWheelZoom=78]="mouseWheelZoom",n[n.multiCursorMergeOverlapping=79]="multiCursorMergeOverlapping",n[n.multiCursorModifier=80]="multiCursorModifier",n[n.multiCursorPaste=81]="multiCursorPaste",n[n.multiCursorLimit=82]="multiCursorLimit",n[n.occurrencesHighlight=83]="occurrencesHighlight",n[n.occurrencesHighlightDelay=84]="occurrencesHighlightDelay",n[n.overtypeCursorStyle=85]="overtypeCursorStyle",n[n.overtypeOnPaste=86]="overtypeOnPaste",n[n.overviewRulerBorder=87]="overviewRulerBorder",n[n.overviewRulerLanes=88]="overviewRulerLanes",n[n.padding=89]="padding",n[n.pasteAs=90]="pasteAs",n[n.parameterHints=91]="parameterHints",n[n.peekWidgetDefaultFocus=92]="peekWidgetDefaultFocus",n[n.placeholder=93]="placeholder",n[n.definitionLinkOpensInPeek=94]="definitionLinkOpensInPeek",n[n.quickSuggestions=95]="quickSuggestions",n[n.quickSuggestionsDelay=96]="quickSuggestionsDelay",n[n.readOnly=97]="readOnly",n[n.readOnlyMessage=98]="readOnlyMessage",n[n.renameOnType=99]="renameOnType",n[n.renderControlCharacters=100]="renderControlCharacters",n[n.renderFinalNewline=101]="renderFinalNewline",n[n.renderLineHighlight=102]="renderLineHighlight",n[n.renderLineHighlightOnlyWhenFocus=103]="renderLineHighlightOnlyWhenFocus",n[n.renderValidationDecorations=104]="renderValidationDecorations",n[n.renderWhitespace=105]="renderWhitespace",n[n.revealHorizontalRightPadding=106]="revealHorizontalRightPadding",n[n.roundedSelection=107]="roundedSelection",n[n.rulers=108]="rulers",n[n.scrollbar=109]="scrollbar",n[n.scrollBeyondLastColumn=110]="scrollBeyondLastColumn",n[n.scrollBeyondLastLine=111]="scrollBeyondLastLine",n[n.scrollPredominantAxis=112]="scrollPredominantAxis",n[n.selectionClipboard=113]="selectionClipboard",n[n.selectionHighlight=114]="selectionHighlight",n[n.selectOnLineNumbers=115]="selectOnLineNumbers",n[n.showFoldingControls=116]="showFoldingControls",n[n.showUnused=117]="showUnused",n[n.snippetSuggestions=118]="snippetSuggestions",n[n.smartSelect=119]="smartSelect",n[n.smoothScrolling=120]="smoothScrolling",n[n.stickyScroll=121]="stickyScroll",n[n.stickyTabStops=122]="stickyTabStops",n[n.stopRenderingLineAfter=123]="stopRenderingLineAfter",n[n.suggest=124]="suggest",n[n.suggestFontSize=125]="suggestFontSize",n[n.suggestLineHeight=126]="suggestLineHeight",n[n.suggestOnTriggerCharacters=127]="suggestOnTriggerCharacters",n[n.suggestSelection=128]="suggestSelection",n[n.tabCompletion=129]="tabCompletion",n[n.tabIndex=130]="tabIndex",n[n.unicodeHighlighting=131]="unicodeHighlighting",n[n.unusualLineTerminators=132]="unusualLineTerminators",n[n.useShadowDOM=133]="useShadowDOM",n[n.useTabStops=134]="useTabStops",n[n.wordBreak=135]="wordBreak",n[n.wordSegmenterLocales=136]="wordSegmenterLocales",n[n.wordSeparators=137]="wordSeparators",n[n.wordWrap=138]="wordWrap",n[n.wordWrapBreakAfterCharacters=139]="wordWrapBreakAfterCharacters",n[n.wordWrapBreakBeforeCharacters=140]="wordWrapBreakBeforeCharacters",n[n.wordWrapColumn=141]="wordWrapColumn",n[n.wordWrapOverride1=142]="wordWrapOverride1",n[n.wordWrapOverride2=143]="wordWrapOverride2",n[n.wrappingIndent=144]="wrappingIndent",n[n.wrappingStrategy=145]="wrappingStrategy",n[n.showDeprecated=146]="showDeprecated",n[n.inlayHints=147]="inlayHints",n[n.effectiveCursorStyle=148]="effectiveCursorStyle",n[n.editorClassName=149]="editorClassName",n[n.pixelRatio=150]="pixelRatio",n[n.tabFocusMode=151]="tabFocusMode",n[n.layoutInfo=152]="layoutInfo",n[n.wrappingInfo=153]="wrappingInfo",n[n.defaultColorDecorators=154]="defaultColorDecorators",n[n.colorDecoratorsActivatedOn=155]="colorDecoratorsActivatedOn",n[n.inlineCompletionsAccessibilityVerbose=156]="inlineCompletionsAccessibilityVerbose",n[n.effectiveExperimentalEditContextEnabled=157]="effectiveExperimentalEditContextEnabled"})(O||(O={}));U(new Ne(O.acceptSuggestionOnCommitCharacter,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:h(485,"Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.")})),U(new pt(O.acceptSuggestionOnEnter,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",h(486,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:h(487,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),U(new N7),U(new Je(O.accessibilityPageSize,"accessibilityPageSize",500,1,Vn.MAX_SAFE_SMALL_INTEGER,{description:h(488,"Controls the number of lines in the editor that can be read out by a screen reader at once. When we detect a screen reader we automatically set the default to be 500. Warning: this has a performance implication for numbers larger than the default."),tags:["accessibility"]})),U(new Ne(O.allowVariableLineHeights,"allowVariableLineHeights",!0)),U(new Mn(O.ariaLabel,"ariaLabel",h(489,"Editor content"))),U(new Ne(O.ariaRequired,"ariaRequired",!1,void 0)),U(new Ne(O.screenReaderAnnounceInlineSuggestion,"screenReaderAnnounceInlineSuggestion",!0,{description:h(490,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),U(new pt(O.autoClosingBrackets,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",h(491,"Use language configurations to determine when to autoclose brackets."),h(492,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:h(493,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),U(new pt(O.autoClosingComments,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",h(494,"Use language configurations to determine when to autoclose comments."),h(495,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:h(496,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),U(new pt(O.autoClosingDelete,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",h(497,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:h(498,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),U(new pt(O.autoClosingOvertype,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",h(499,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:h(500,"Controls whether the editor should type over closing quotes or brackets.")})),U(new pt(O.autoClosingQuotes,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",h(501,"Use language configurations to determine when to autoclose quotes."),h(502,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:h(503,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),U(new Iu(O.autoIndent,"autoIndent",io.Full,"full",["none","keep","brackets","advanced","full"],L7,{enumDescriptions:[h(504,"The editor will not insert indentation automatically."),h(505,"The editor will keep the current line's indentation."),h(506,"The editor will keep the current line's indentation and honor language defined brackets."),h(507,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),h(508,"The editor will keep the current line's indentation, honor language defined brackets, invoke special onEnterRules defined by languages, and honor indentationRules defined by languages.")],description:h(509,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),U(new Ne(O.automaticLayout,"automaticLayout",!1)),U(new pt(O.autoSurround,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[h(510,"Use language configurations to determine when to automatically surround selections."),h(511,"Surround with quotes but not brackets."),h(512,"Surround with brackets but not quotes."),""],description:h(513,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),U(new dL),U(new hL),U(new Ne(O.stickyTabStops,"stickyTabStops",!1,{description:h(514,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),U(new Ne(O.codeLens,"codeLens",!0,{description:h(515,"Controls whether the editor shows CodeLens.")})),U(new Mn(O.codeLensFontFamily,"codeLensFontFamily","",{description:h(516,"Controls the font family for CodeLens.")})),U(new Je(O.codeLensFontSize,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:h(517,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),U(new Ne(O.colorDecorators,"colorDecorators",!0,{description:h(518,"Controls whether the editor should render the inline color decorators and color picker.")})),U(new pt(O.colorDecoratorsActivatedOn,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[h(519,"Make the color picker appear both on click and hover of the color decorator"),h(520,"Make the color picker appear on hover of the color decorator"),h(521,"Make the color picker appear on click of the color decorator")],description:h(522,"Controls the condition to make a color picker appear from a color decorator.")})),U(new Je(O.colorDecoratorsLimit,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:h(523,"Controls the max number of color decorators that can be rendered in an editor at once.")})),U(new Ne(O.columnSelection,"columnSelection",!1,{description:h(524,"Enable that the selection with the mouse and keys is doing column selection.")})),U(new O7),U(new Ne(O.contextmenu,"contextmenu",!0)),U(new Ne(O.copyWithSyntaxHighlighting,"copyWithSyntaxHighlighting",!0,{description:h(525,"Controls whether syntax highlighting should be copied into the clipboard.")})),U(new Iu(O.cursorBlinking,"cursorBlinking",so.Blink,"blink",["blink","smooth","phase","expand","solid"],F7,{description:h(526,"Control the cursor animation style.")})),U(new pt(O.cursorSmoothCaretAnimation,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[h(527,"Smooth caret animation is disabled."),h(528,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),h(529,"Smooth caret animation is always enabled.")],description:h(530,"Controls whether the smooth caret animation should be enabled.")})),U(new Iu(O.cursorStyle,"cursorStyle",ns.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],zS,{description:h(531,"Controls the cursor style in insert input mode.")})),U(new Iu(O.overtypeCursorStyle,"overtypeCursorStyle",ns.Block,"block",["line","block","underline","line-thin","block-outline","underline-thin"],zS,{description:h(532,"Controls the cursor style in overtype input mode.")})),U(new Je(O.cursorSurroundingLines,"cursorSurroundingLines",0,0,Vn.MAX_SAFE_SMALL_INTEGER,{description:h(533,"Controls the minimal number of visible leading lines (minimum 0) and trailing lines (minimum 1) surrounding the cursor. Known as 'scrollOff' or 'scrollOffset' in some other editors.")})),U(new pt(O.cursorSurroundingLinesStyle,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[h(534,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),h(535,"`cursorSurroundingLines` is enforced always.")],markdownDescription:h(536,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),U(new Je(O.cursorWidth,"cursorWidth",0,0,Vn.MAX_SAFE_SMALL_INTEGER,{markdownDescription:h(537,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),U(new Ne(O.disableLayerHinting,"disableLayerHinting",!1)),U(new Ne(O.disableMonospaceOptimizations,"disableMonospaceOptimizations",!1)),U(new Ne(O.domReadOnly,"domReadOnly",!1)),U(new Ne(O.dragAndDrop,"dragAndDrop",!0,{description:h(538,"Controls whether the editor should allow moving selections via drag and drop.")})),U(new U7),U(new vL),U(new Ne(O.experimentalEditContextEnabled,"experimentalEditContextEnabled",!0,{description:h(539,"Sets whether the new experimental edit context should be used instead of the text area."),included:Sx||lC||rC})),U(new K7),U(new pt(O.experimentalGpuAcceleration,"experimentalGpuAcceleration","off",["off","on"],{tags:["experimental"],enumDescriptions:[h(540,"Use regular DOM-based rendering."),h(541,"Use GPU acceleration.")],description:h(542,"Controls whether to use the experimental GPU acceleration to render the editor.")})),U(new pt(O.experimentalWhitespaceRendering,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[h(543,"Use a new rendering method with svgs."),h(544,"Use a new rendering method with font characters."),h(545,"Use the stable rendering method.")],description:h(546,"Controls whether whitespace is rendered with a new, experimental method.")})),U(new Mn(O.extraEditorClassName,"extraEditorClassName","")),U(new $i(O.fastScrollSensitivity,"fastScrollSensitivity",5,n=>n<=0?5:n,{markdownDescription:h(547,"Scrolling speed multiplier when pressing `Alt`.")})),U(new $7),U(new Ne(O.fixedOverflowWidgets,"fixedOverflowWidgets",!1)),U(new Ne(O.folding,"folding",!0,{description:h(548,"Controls whether the editor has code folding enabled.")})),U(new pt(O.foldingStrategy,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[h(549,"Use a language-specific folding strategy if available, else the indentation-based one."),h(550,"Use the indentation-based folding strategy.")],description:h(551,"Controls the strategy for computing folding ranges.")})),U(new Ne(O.foldingHighlight,"foldingHighlight",!0,{description:h(552,"Controls whether the editor should highlight folded ranges.")})),U(new Ne(O.foldingImportsByDefault,"foldingImportsByDefault",!1,{description:h(553,"Controls whether the editor automatically collapses import ranges.")})),U(new Je(O.foldingMaximumRegions,"foldingMaximumRegions",5e3,10,65e3,{description:h(554,"The maximum number of foldable regions. Increasing this value may result in the editor becoming less responsive when the current source has a large number of foldable regions.")})),U(new Ne(O.unfoldOnClickAfterEndOfLine,"unfoldOnClickAfterEndOfLine",!1,{description:h(555,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),U(new Mn(O.fontFamily,"fontFamily",Tr.fontFamily,{description:h(556,"Controls the font family.")})),U(new H7),U(new sw),U(new V7),U(new ow),U(new rw),U(new Ne(O.formatOnPaste,"formatOnPaste",!1,{description:h(557,"Controls whether the editor should automatically format the pasted content. A formatter must be available and the formatter should be able to format a range in a document.")})),U(new Ne(O.formatOnType,"formatOnType",!1,{description:h(558,"Controls whether the editor should automatically format the line after typing.")})),U(new Ne(O.glyphMargin,"glyphMargin",!0,{description:h(559,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),U(new z7),U(new Ne(O.hideCursorInOverviewRuler,"hideCursorInOverviewRuler",!1,{description:h(560,"Controls whether the cursor should be hidden in the overview ruler.")})),U(new q7),U(new Ne(O.inDiffEditor,"inDiffEditor",!1)),U(new $i(O.letterSpacing,"letterSpacing",Tr.letterSpacing,n=>$i.clamp(n,-5,20),{description:h(561,"Controls the letter spacing in pixels.")})),U(new G7),U(new J7),U(new X7),U(new rL),U(new Je(O.lineNumbersMinChars,"lineNumbersMinChars",5,1,300)),U(new Ne(O.linkedEditing,"linkedEditing",!1,{description:h(562,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),U(new Ne(O.links,"links",!0,{description:h(563,"Controls whether the editor should detect links and make them clickable.")})),U(new pt(O.matchBrackets,"matchBrackets","always",["always","near","never"],{description:h(564,"Highlight matching brackets.")})),U(new Y7),U(new pt(O.mouseStyle,"mouseStyle","text",["text","default","copy"])),U(new $i(O.mouseWheelScrollSensitivity,"mouseWheelScrollSensitivity",1,n=>n===0?1:n,{markdownDescription:h(565,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),U(new Ne(O.mouseWheelZoom,"mouseWheelZoom",!1,{markdownDescription:Li?h(566,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):h(567,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),U(new Ne(O.multiCursorMergeOverlapping,"multiCursorMergeOverlapping",!0,{description:h(568,"Merge multiple cursors when they are overlapping.")})),U(new Iu(O.multiCursorModifier,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],Z7,{markdownEnumDescriptions:[h(569,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),h(570,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:h(571,"The modifier to be used to add multiple cursors with the mouse. The Go to Definition and Open Link mouse gestures will adapt such that they do not conflict with the [multicursor modifier](https://code.visualstudio.com/docs/editor/codebasics#_multicursor-modifier).")})),U(new pt(O.multiCursorPaste,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[h(572,"Each cursor pastes a single line of the text."),h(573,"Each cursor pastes the full text.")],markdownDescription:h(574,"Controls pasting when the line count of the pasted text matches the cursor count.")})),U(new Je(O.multiCursorLimit,"multiCursorLimit",1e4,1,1e5,{markdownDescription:h(575,"Controls the max number of cursors that can be in an active editor at once.")})),U(new pt(O.occurrencesHighlight,"occurrencesHighlight","singleFile",["off","singleFile","multiFile"],{markdownEnumDescriptions:[h(576,"Does not highlight occurrences."),h(577,"Highlights occurrences only in the current file."),h(578,"Experimental: Highlights occurrences across all valid open files.")],markdownDescription:h(579,"Controls whether occurrences should be highlighted across open files.")})),U(new Je(O.occurrencesHighlightDelay,"occurrencesHighlightDelay",0,0,2e3,{description:h(580,"Controls the delay in milliseconds after which occurrences are highlighted."),tags:["preview"]})),U(new Ne(O.overtypeOnPaste,"overtypeOnPaste",!0,{description:h(581,"Controls whether pasting should overtype.")})),U(new Ne(O.overviewRulerBorder,"overviewRulerBorder",!0,{description:h(582,"Controls whether a border should be drawn around the overview ruler.")})),U(new Je(O.overviewRulerLanes,"overviewRulerLanes",3,0,3)),U(new eL),U(new wL),U(new tL),U(new pt(O.peekWidgetDefaultFocus,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[h(583,"Focus the tree when opening peek"),h(584,"Focus the editor when opening peek")],description:h(585,"Controls whether to focus the inline editor or the tree in the peek widget.")})),U(new iL),U(new Ne(O.definitionLinkOpensInPeek,"definitionLinkOpensInPeek",!1,{description:h(586,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),U(new sL),U(new Je(O.quickSuggestionsDelay,"quickSuggestionsDelay",10,0,Vn.MAX_SAFE_SMALL_INTEGER,{description:h(587,"Controls the delay in milliseconds after which quick suggestions will show up.")})),U(new Ne(O.readOnly,"readOnly",!1)),U(new aL),U(new Ne(O.renameOnType,"renameOnType",!1,{description:h(588,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:h(589,"Deprecated, use `editor.linkedEditing` instead.")})),U(new Ne(O.renderControlCharacters,"renderControlCharacters",!0,{description:h(590,"Controls whether the editor should render control characters."),restricted:!0})),U(new pt(O.renderFinalNewline,"renderFinalNewline",yo?"dimmed":"on",["off","on","dimmed"],{description:h(591,"Render last line number when the file ends with a newline.")})),U(new pt(O.renderLineHighlight,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",h(592,"Highlights both the gutter and the current line.")],description:h(593,"Controls how the editor should render the current line highlight.")})),U(new Ne(O.renderLineHighlightOnlyWhenFocus,"renderLineHighlightOnlyWhenFocus",!1,{description:h(594,"Controls if the editor should render the current line highlight only when the editor is focused.")})),U(new pt(O.renderValidationDecorations,"renderValidationDecorations","editable",["editable","on","off"])),U(new pt(O.renderWhitespace,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",h(595,"Render whitespace characters except for single spaces between words."),h(596,"Render whitespace characters only on selected text."),h(597,"Render only trailing whitespace characters."),""],description:h(598,"Controls how the editor should render whitespace characters.")})),U(new Je(O.revealHorizontalRightPadding,"revealHorizontalRightPadding",15,0,1e3)),U(new Ne(O.roundedSelection,"roundedSelection",!0,{description:h(599,"Controls whether selections should have rounded corners.")})),U(new oL),U(new lL),U(new Je(O.scrollBeyondLastColumn,"scrollBeyondLastColumn",4,0,Vn.MAX_SAFE_SMALL_INTEGER,{description:h(600,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),U(new Ne(O.scrollBeyondLastLine,"scrollBeyondLastLine",!0,{description:h(601,"Controls whether the editor will scroll beyond the last line.")})),U(new Ne(O.scrollPredominantAxis,"scrollPredominantAxis",!0,{description:h(602,"Scroll only along the predominant axis when scrolling both vertically and horizontally at the same time. Prevents horizontal drift when scrolling vertically on a trackpad.")})),U(new Ne(O.selectionClipboard,"selectionClipboard",!0,{description:h(603,"Controls whether the Linux primary clipboard should be supported."),included:yo})),U(new Ne(O.selectionHighlight,"selectionHighlight",!0,{description:h(604,"Controls whether the editor should highlight matches similar to the selection.")})),U(new Ne(O.selectOnLineNumbers,"selectOnLineNumbers",!0)),U(new pt(O.showFoldingControls,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[h(605,"Always show the folding controls."),h(606,"Never show the folding controls and reduce the gutter size."),h(607,"Only show the folding controls when the mouse is over the gutter.")],description:h(608,"Controls when the folding controls on the gutter are shown.")})),U(new Ne(O.showUnused,"showUnused",!0,{description:h(609,"Controls fading out of unused code.")})),U(new Ne(O.showDeprecated,"showDeprecated",!0,{description:h(610,"Controls strikethrough deprecated variables.")})),U(new Q7),U(new pt(O.snippetSuggestions,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[h(611,"Show snippet suggestions on top of other suggestions."),h(612,"Show snippet suggestions below other suggestions."),h(613,"Show snippets suggestions with other suggestions."),h(614,"Do not show snippet suggestions.")],description:h(615,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),U(new pL),U(new Ne(O.smoothScrolling,"smoothScrolling",!1,{description:h(616,"Controls whether the editor will scroll using an animation.")})),U(new Je(O.stopRenderingLineAfter,"stopRenderingLineAfter",1e4,-1,Vn.MAX_SAFE_SMALL_INTEGER)),U(new fL),U(new uL),U(new Ne(O.inlineCompletionsAccessibilityVerbose,"inlineCompletionsAccessibilityVerbose",!1,{description:h(617,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),U(new Je(O.suggestFontSize,"suggestFontSize",0,0,1e3,{markdownDescription:h(618,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),U(new Je(O.suggestLineHeight,"suggestLineHeight",0,0,1e3,{markdownDescription:h(619,"Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.","`0`","`#editor.lineHeight#`")})),U(new Ne(O.suggestOnTriggerCharacters,"suggestOnTriggerCharacters",!0,{description:h(620,"Controls whether suggestions should automatically show up when typing trigger characters.")})),U(new pt(O.suggestSelection,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[h(621,"Always select the first suggestion."),h(622,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),h(623,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:h(624,"Controls how suggestions are pre-selected when showing the suggest list.")})),U(new pt(O.tabCompletion,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[h(625,"Tab complete will insert the best matching suggestion when pressing tab."),h(626,"Disable tab completions."),h(627,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:h(628,"Enables tab completions.")})),U(new Je(O.tabIndex,"tabIndex",0,-1,Vn.MAX_SAFE_SMALL_INTEGER)),U(new cL),U(new pt(O.unusualLineTerminators,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[h(629,"Unusual line terminators are automatically removed."),h(630,"Unusual line terminators are ignored."),h(631,"Unusual line terminators prompt to be removed.")],description:h(632,"Remove unusual line terminators that might cause problems.")})),U(new Ne(O.useShadowDOM,"useShadowDOM",!0)),U(new Ne(O.useTabStops,"useTabStops",!0,{description:h(633,"Spaces and tabs are inserted and deleted in alignment with tab stops.")})),U(new pt(O.wordBreak,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[h(634,"Use the default line break rule."),h(635,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:h(636,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),U(new gL),U(new Mn(O.wordSeparators,"wordSeparators",sT,{description:h(637,"Characters that will be used as word separators when doing word related navigations or operations.")})),U(new pt(O.wordWrap,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[h(638,"Lines will never wrap."),h(639,"Lines will wrap at the viewport width."),h(640,"Lines will wrap at `#editor.wordWrapColumn#`."),h(641,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:h(642,"Controls how lines should wrap.")})),U(new Mn(O.wordWrapBreakAfterCharacters,"wordWrapBreakAfterCharacters"," })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」")),U(new Mn(O.wordWrapBreakBeforeCharacters,"wordWrapBreakBeforeCharacters","([{‘“〈《「『【〔([{「£¥$£¥++")),U(new Je(O.wordWrapColumn,"wordWrapColumn",80,1,Vn.MAX_SAFE_SMALL_INTEGER,{markdownDescription:h(643,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),U(new pt(O.wordWrapOverride1,"wordWrapOverride1","inherit",["off","on","inherit"])),U(new pt(O.wordWrapOverride2,"wordWrapOverride2","inherit",["off","on","inherit"])),U(new B7),U(new M7),U(new pt(O.defaultColorDecorators,"defaultColorDecorators","auto",["auto","always","never"],{enumDescriptions:[h(644,"Show default color decorators only when no extension provides colors decorators."),h(645,"Always show default color decorators."),h(646,"Never show default color decorators.")],description:h(647,"Controls whether inline color decorations should be shown using the default document color provider.")})),U(new nL),U(new Ne(O.tabFocusMode,"tabFocusMode",!1,{markdownDescription:h(648,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),U(new Yu),U(new _L),U(new mL),U(new j7),U(new W7);let Ti=class Mo{constructor(e,t){this.lineNumber=e,this.column=t}with(e=this.lineNumber,t=this.column){return e===this.lineNumber&&t===this.column?this:new Mo(e,t)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(e){return Mo.equals(this,e)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Mo.isBefore(this,e)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(e){return Mo.isBeforeOrEqual(this,e)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){const i=e.lineNumber|0,s=t.lineNumber|0;if(i===s){const r=e.column|0,o=t.column|0;return r-o}return i-s}clone(){return new Mo(this.lineNumber,this.column)}toString(){return"("+this.lineNumber+","+this.column+")"}static lift(e){return new Mo(e.lineNumber,e.column)}static isIPosition(e){return e&&typeof e.lineNumber=="number"&&typeof e.column=="number"}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}},et=class ln{constructor(e,t,i,s){e>i||e===i&&t>s?(this.startLineNumber=i,this.startColumn=s,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s)}isEmpty(){return ln.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return ln.containsPosition(this,e)}static containsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<e.startColumn||t.lineNumber===e.endLineNumber&&t.column>e.endColumn)}static strictContainsPosition(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber||t.lineNumber===e.startLineNumber&&t.column<=e.startColumn||t.lineNumber===e.endLineNumber&&t.column>=e.endColumn)}containsRange(e){return ln.containsRange(this,e)}static containsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)}strictContainsRange(e){return ln.strictContainsRange(this,e)}static strictContainsRange(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber||t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber||t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn||t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)}plusRange(e){return ln.plusRange(this,e)}static plusRange(e,t){let i,s,r,o;return t.startLineNumber<e.startLineNumber?(i=t.startLineNumber,s=t.startColumn):t.startLineNumber===e.startLineNumber?(i=t.startLineNumber,s=Math.min(t.startColumn,e.startColumn)):(i=e.startLineNumber,s=e.startColumn),t.endLineNumber>e.endLineNumber?(r=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(r=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(r=e.endLineNumber,o=e.endColumn),new ln(i,s,r,o)}intersectRanges(e){return ln.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,s=e.startColumn,r=e.endLineNumber,o=e.endColumn;const a=t.startLineNumber,l=t.startColumn,c=t.endLineNumber,u=t.endColumn;return i<a?(i=a,s=l):i===a&&(s=Math.max(s,l)),r>c?(r=c,o=u):r===c&&(o=Math.min(o,u)),i>r||i===r&&s>o?null:new ln(i,s,r,o)}equalsRange(e){return ln.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t?!0:!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return ln.getEndPosition(this)}static getEndPosition(e){return new Ti(e.endLineNumber,e.endColumn)}getStartPosition(){return ln.getStartPosition(this)}static getStartPosition(e){return new Ti(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new ln(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new ln(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return ln.collapseToStart(this)}static collapseToStart(e){return new ln(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return ln.collapseToEnd(this)}static collapseToEnd(e){return new ln(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new ln(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(e,t=e){return new ln(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new ln(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&typeof e.startLineNumber=="number"&&typeof e.startColumn=="number"&&typeof e.endLineNumber=="number"&&typeof e.endColumn=="number"}static areIntersectingOrTouching(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn)}static areIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber||e.endLineNumber===t.startLineNumber&&e.endColumn<=t.startColumn||t.endLineNumber<e.startLineNumber||t.endLineNumber===e.startLineNumber&&t.endColumn<=e.startColumn)}static areOnlyIntersecting(e,t){return!(e.endLineNumber<t.startLineNumber-1||e.endLineNumber===t.startLineNumber&&e.endColumn<t.startColumn-1||t.endLineNumber<e.startLineNumber-1||t.endLineNumber===e.startLineNumber&&t.endColumn<e.startColumn-1)}static compareRangesUsingStarts(e,t){if(e&&t){const r=e.startLineNumber|0,o=t.startLineNumber|0;if(r===o){const a=e.startColumn|0,l=t.startColumn|0;if(a===l){const c=e.endLineNumber|0,u=t.endLineNumber|0;if(c===u){const d=e.endColumn|0,f=t.endColumn|0;return d-f}return c-u}return a-l}return r-o}return(e?1:0)-(t?1:0)}static compareRangesUsingEnds(e,t){return e.endLineNumber===t.endLineNumber?e.endColumn===t.endColumn?e.startLineNumber===t.startLineNumber?e.startColumn-t.startColumn:e.startLineNumber-t.startLineNumber:e.endColumn-t.endColumn:e.endLineNumber-t.endLineNumber}static spansMultipleLines(e){return e.endLineNumber>e.startLineNumber}toJSON(){return this}};var jS;(function(n){n[n.Null=0]="Null",n[n.PlainText=1]="PlainText"})(jS||(jS={}));var GS;(function(n){n[n.NotSet=-1]="NotSet",n[n.None=0]="None",n[n.Italic=1]="Italic",n[n.Bold=2]="Bold",n[n.Underline=4]="Underline",n[n.Strikethrough=8]="Strikethrough"})(GS||(GS={}));var Wp;(function(n){n[n.None=0]="None",n[n.DefaultForeground=1]="DefaultForeground",n[n.DefaultBackground=2]="DefaultBackground"})(Wp||(Wp={}));var Al;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(Al||(Al={}));var KS;(function(n){n[n.LANGUAGEID_MASK=255]="LANGUAGEID_MASK",n[n.TOKEN_TYPE_MASK=768]="TOKEN_TYPE_MASK",n[n.BALANCED_BRACKETS_MASK=1024]="BALANCED_BRACKETS_MASK",n[n.FONT_STYLE_MASK=30720]="FONT_STYLE_MASK",n[n.FOREGROUND_MASK=16744448]="FOREGROUND_MASK",n[n.BACKGROUND_MASK=4278190080]="BACKGROUND_MASK",n[n.ITALIC_MASK=2048]="ITALIC_MASK",n[n.BOLD_MASK=4096]="BOLD_MASK",n[n.UNDERLINE_MASK=8192]="UNDERLINE_MASK",n[n.STRIKETHROUGH_MASK=16384]="STRIKETHROUGH_MASK",n[n.SEMANTIC_USE_ITALIC=1]="SEMANTIC_USE_ITALIC",n[n.SEMANTIC_USE_BOLD=2]="SEMANTIC_USE_BOLD",n[n.SEMANTIC_USE_UNDERLINE=4]="SEMANTIC_USE_UNDERLINE",n[n.SEMANTIC_USE_STRIKETHROUGH=8]="SEMANTIC_USE_STRIKETHROUGH",n[n.SEMANTIC_USE_FOREGROUND=16]="SEMANTIC_USE_FOREGROUND",n[n.SEMANTIC_USE_BACKGROUND=32]="SEMANTIC_USE_BACKGROUND",n[n.LANGUAGEID_OFFSET=0]="LANGUAGEID_OFFSET",n[n.TOKEN_TYPE_OFFSET=8]="TOKEN_TYPE_OFFSET",n[n.BALANCED_BRACKETS_OFFSET=10]="BALANCED_BRACKETS_OFFSET",n[n.FONT_STYLE_OFFSET=11]="FONT_STYLE_OFFSET",n[n.FOREGROUND_OFFSET=15]="FOREGROUND_OFFSET",n[n.BACKGROUND_OFFSET=24]="BACKGROUND_OFFSET"})(KS||(KS={}));class QS{static insert(e,t){return{range:new et(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class SL{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this._colorMap=null}handleChange(e){this._onDidChange.fire({changedLanguages:e,changedColorMap:!1})}register(e,t){return this._tokenizationSupports.set(e,t),this.handleChange([e]),we(()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))})}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){this._factories.get(e)?.dispose();const i=new kL(this,e,t);return this._factories.set(e,i),we(()=>{const s=this._factories.get(e);!s||s!==i||(this._factories.delete(e),s.dispose())})}async getOrCreate(e){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(await i.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;const i=this._factories.get(e);return!!(!i||i.isResolved)}setColorMap(e){this._colorMap=e,this._onDidChange.fire({changedLanguages:Array.from(this._tokenizationSupports.keys()),changedColorMap:!0})}getColorMap(){return this._colorMap}getDefaultBackground(){return this._colorMap&&this._colorMap.length>Wp.DefaultBackground?this._colorMap[Wp.DefaultBackground]:null}}class kL extends Se{get isResolved(){return this._isResolved}constructor(e,t,i){super(),this._registry=e,this._languageId=t,this._factory=i,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}async _create(){const e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}}var JS;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(JS||(JS={}));var F;(function(n){n[n.Method=0]="Method",n[n.Function=1]="Function",n[n.Constructor=2]="Constructor",n[n.Field=3]="Field",n[n.Variable=4]="Variable",n[n.Class=5]="Class",n[n.Struct=6]="Struct",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Event=10]="Event",n[n.Operator=11]="Operator",n[n.Unit=12]="Unit",n[n.Value=13]="Value",n[n.Constant=14]="Constant",n[n.Enum=15]="Enum",n[n.EnumMember=16]="EnumMember",n[n.Keyword=17]="Keyword",n[n.Text=18]="Text",n[n.Color=19]="Color",n[n.File=20]="File",n[n.Reference=21]="Reference",n[n.Customcolor=22]="Customcolor",n[n.Folder=23]="Folder",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue",n[n.Tool=27]="Tool",n[n.Snippet=28]="Snippet"})(F||(F={}));var XS;(function(n){const e=new Map;e.set(F.Method,_e.symbolMethod),e.set(F.Function,_e.symbolFunction),e.set(F.Constructor,_e.symbolConstructor),e.set(F.Field,_e.symbolField),e.set(F.Variable,_e.symbolVariable),e.set(F.Class,_e.symbolClass),e.set(F.Struct,_e.symbolStruct),e.set(F.Interface,_e.symbolInterface),e.set(F.Module,_e.symbolModule),e.set(F.Property,_e.symbolProperty),e.set(F.Event,_e.symbolEvent),e.set(F.Operator,_e.symbolOperator),e.set(F.Unit,_e.symbolUnit),e.set(F.Value,_e.symbolValue),e.set(F.Enum,_e.symbolEnum),e.set(F.Constant,_e.symbolConstant),e.set(F.Enum,_e.symbolEnum),e.set(F.EnumMember,_e.symbolEnumMember),e.set(F.Keyword,_e.symbolKeyword),e.set(F.Snippet,_e.symbolSnippet),e.set(F.Text,_e.symbolText),e.set(F.Color,_e.symbolColor),e.set(F.File,_e.symbolFile),e.set(F.Reference,_e.symbolReference),e.set(F.Customcolor,_e.symbolCustomColor),e.set(F.Folder,_e.symbolFolder),e.set(F.TypeParameter,_e.symbolTypeParameter),e.set(F.User,_e.account),e.set(F.Issue,_e.issues),e.set(F.Tool,_e.tools);function t(o){let a=e.get(o);return a||(console.info("No codicon found for CompletionItemKind "+o),a=_e.symbolProperty),a}n.toIcon=t;function i(o){switch(o){case F.Method:return h(765,"Method");case F.Function:return h(766,"Function");case F.Constructor:return h(767,"Constructor");case F.Field:return h(768,"Field");case F.Variable:return h(769,"Variable");case F.Class:return h(770,"Class");case F.Struct:return h(771,"Struct");case F.Interface:return h(772,"Interface");case F.Module:return h(773,"Module");case F.Property:return h(774,"Property");case F.Event:return h(775,"Event");case F.Operator:return h(776,"Operator");case F.Unit:return h(777,"Unit");case F.Value:return h(778,"Value");case F.Constant:return h(779,"Constant");case F.Enum:return h(780,"Enum");case F.EnumMember:return h(781,"Enum Member");case F.Keyword:return h(782,"Keyword");case F.Text:return h(783,"Text");case F.Color:return h(784,"Color");case F.File:return h(785,"File");case F.Reference:return h(786,"Reference");case F.Customcolor:return h(787,"Custom Color");case F.Folder:return h(788,"Folder");case F.TypeParameter:return h(789,"Type Parameter");case F.User:return h(790,"User");case F.Issue:return h(791,"Issue");case F.Tool:return h(792,"Tool");case F.Snippet:return h(793,"Snippet");default:return""}}n.toLabel=i;const s=new Map;s.set("method",F.Method),s.set("function",F.Function),s.set("constructor",F.Constructor),s.set("field",F.Field),s.set("variable",F.Variable),s.set("class",F.Class),s.set("struct",F.Struct),s.set("interface",F.Interface),s.set("module",F.Module),s.set("property",F.Property),s.set("event",F.Event),s.set("operator",F.Operator),s.set("unit",F.Unit),s.set("value",F.Value),s.set("constant",F.Constant),s.set("enum",F.Enum),s.set("enum-member",F.EnumMember),s.set("enumMember",F.EnumMember),s.set("keyword",F.Keyword),s.set("snippet",F.Snippet),s.set("text",F.Text),s.set("color",F.Color),s.set("file",F.File),s.set("reference",F.Reference),s.set("customcolor",F.Customcolor),s.set("folder",F.Folder),s.set("type-parameter",F.TypeParameter),s.set("typeParameter",F.TypeParameter),s.set("account",F.User),s.set("issue",F.Issue),s.set("tool",F.Tool);function r(o,a){let l=s.get(o);return typeof l>"u"&&!a&&(l=F.Property),l}n.fromString=r})(XS||(XS={}));var Vp;(function(n){n[n.Deprecated=1]="Deprecated"})(Vp||(Vp={}));var ba;(function(n){n[n.None=0]="None",n[n.KeepWhitespace=1]="KeepWhitespace",n[n.InsertAsSnippet=4]="InsertAsSnippet"})(ba||(ba={}));var Zu;(function(n){n[n.Word=0]="Word",n[n.Line=1]="Line",n[n.Suggest=2]="Suggest"})(Zu||(Zu={}));var ed;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(ed||(ed={}));var zp;(function(n){n[n.Automatic=0]="Automatic",n[n.Explicit=1]="Explicit"})(zp||(zp={}));var qp;(function(n){n[n.Accepted=0]="Accepted",n[n.Rejected=1]="Rejected",n[n.Ignored=2]="Ignored"})(qp||(qp={}));var jp;(function(n){n[n.Invoke=1]="Invoke",n[n.Auto=2]="Auto"})(jp||(jp={}));var YS;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(YS||(YS={}));var ZS;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(ZS||(ZS={}));var e2;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(e2||(e2={}));function DL(n){return n&&x.isUri(n.uri)&&et.isIRange(n.range)&&(et.isIRange(n.originSelectionRange)||et.isIRange(n.targetSelectionRange))}function IL(n){return n&&x.isUri(n.uri)&&et.isIRange(n.range)}var K;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(K||(K={}));K.Array+"",h(794,"array"),K.Boolean+"",h(795,"boolean"),K.Class+"",h(796,"class"),K.Constant+"",h(797,"constant"),K.Constructor+"",h(798,"constructor"),K.Enum+"",h(799,"enumeration"),K.EnumMember+"",h(800,"enumeration member"),K.Event+"",h(801,"event"),K.Field+"",h(802,"field"),K.File+"",h(803,"file"),K.Function+"",h(804,"function"),K.Interface+"",h(805,"interface"),K.Key+"",h(806,"key"),K.Method+"",h(807,"method"),K.Module+"",h(808,"module"),K.Namespace+"",h(809,"namespace"),K.Null+"",h(810,"null"),K.Number+"",h(811,"number"),K.Object+"",h(812,"object"),K.Operator+"",h(813,"operator"),K.Package+"",h(814,"package"),K.Property+"",h(815,"property"),K.String+"",h(816,"string"),K.Struct+"",h(817,"struct"),K.TypeParameter+"",h(818,"type parameter"),K.Variable+"",h(819,"variable");var Gp;(function(n){n[n.Deprecated=1]="Deprecated"})(Gp||(Gp={}));var t2;(function(n){const e=new Map;e.set(K.File,_e.symbolFile),e.set(K.Module,_e.symbolModule),e.set(K.Namespace,_e.symbolNamespace),e.set(K.Package,_e.symbolPackage),e.set(K.Class,_e.symbolClass),e.set(K.Method,_e.symbolMethod),e.set(K.Property,_e.symbolProperty),e.set(K.Field,_e.symbolField),e.set(K.Constructor,_e.symbolConstructor),e.set(K.Enum,_e.symbolEnum),e.set(K.Interface,_e.symbolInterface),e.set(K.Function,_e.symbolFunction),e.set(K.Variable,_e.symbolVariable),e.set(K.Constant,_e.symbolConstant),e.set(K.String,_e.symbolString),e.set(K.Number,_e.symbolNumber),e.set(K.Boolean,_e.symbolBoolean),e.set(K.Array,_e.symbolArray),e.set(K.Object,_e.symbolObject),e.set(K.Key,_e.symbolKey),e.set(K.Null,_e.symbolNull),e.set(K.EnumMember,_e.symbolEnumMember),e.set(K.Struct,_e.symbolStruct),e.set(K.Event,_e.symbolEvent),e.set(K.Operator,_e.symbolOperator),e.set(K.TypeParameter,_e.symbolTypeParameter);function t(r){let o=e.get(r);return o||(console.info("No codicon found for SymbolKind "+r),o=_e.symbolProperty),o}n.toIcon=t;const i=new Map;i.set(K.File,F.File),i.set(K.Module,F.Module),i.set(K.Namespace,F.Module),i.set(K.Package,F.Module),i.set(K.Class,F.Class),i.set(K.Method,F.Method),i.set(K.Property,F.Property),i.set(K.Field,F.Field),i.set(K.Constructor,F.Constructor),i.set(K.Enum,F.Enum),i.set(K.Interface,F.Interface),i.set(K.Function,F.Function),i.set(K.Variable,F.Variable),i.set(K.Constant,F.Constant),i.set(K.String,F.Text),i.set(K.Number,F.Value),i.set(K.Boolean,F.Value),i.set(K.Array,F.Value),i.set(K.Object,F.Value),i.set(K.Key,F.Keyword),i.set(K.Null,F.Value),i.set(K.EnumMember,F.EnumMember),i.set(K.Struct,F.Struct),i.set(K.Event,F.Event),i.set(K.Operator,F.Operator),i.set(K.TypeParameter,F.TypeParameter);function s(r){let o=i.get(r);return o===void 0&&(console.info("No completion kind found for SymbolKind "+r),o=F.File),o}n.toCompletionKind=s})(t2||(t2={}));let CL=class{static asEditOperation(e){const t=et.lift(e.range);return t.isEmpty()?QS.insert(t.getStartPosition(),e.text):QS.replace(t,e.text)}static isTextEdit(e){const t=e;return typeof t.text=="string"&&et.isIRange(t.range)}};var ni;let _l=(ni=class{static fromValue(e){switch(e){case"comment":return ni.Comment;case"imports":return ni.Imports;case"region":return ni.Region}return new ni(e)}constructor(e){this.value=e}},ni.Comment=new ni("comment"),ni.Imports=new ni("imports"),ni.Region=new ni("region"),ni);var n2;(function(n){n[n.AIGenerated=1]="AIGenerated"})(n2||(n2={}));var Kp;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(Kp||(Kp={}));var aw;(function(n){function e(t){return!t||typeof t!="object"?!1:typeof t.id=="string"&&typeof t.title=="string"}n.is=e})(aw||(aw={}));var Rl;(function(n){n[n.Collapsed=0]="Collapsed",n[n.Expanded=1]="Expanded"})(Rl||(Rl={}));var td;(function(n){n[n.Unresolved=0]="Unresolved",n[n.Resolved=1]="Resolved"})(td||(td={}));var nd;(function(n){n[n.Current=0]="Current",n[n.Outdated=1]="Outdated"})(nd||(nd={}));var i2;(function(n){n[n.Editing=0]="Editing",n[n.Preview=1]="Preview"})(i2||(i2={}));var s2;(function(n){n[n.Published=0]="Published",n[n.Draft=1]="Draft"})(s2||(s2={}));var r2;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(r2||(r2={}));new SL;var o2;(function(n){n[n.None=0]="None",n[n.Option=1]="Option",n[n.Default=2]="Default",n[n.Preferred=3]="Preferred"})(o2||(o2={}));var Qp;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(Qp||(Qp={}));var lw;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=4]="Right",n[n.Full=7]="Full"})(lw||(lw={}));var a2;(function(n){n[n.Left=1]="Left",n[n.Center=2]="Center",n[n.Right=3]="Right"})(a2||(a2={}));var l2;(function(n){n[n.Inline=1]="Inline",n[n.Gutter=2]="Gutter"})(l2||(l2={}));var c2;(function(n){n[n.Normal=1]="Normal",n[n.Underlined=2]="Underlined"})(c2||(c2={}));var u2;(function(n){n[n.Both=0]="Both",n[n.Right=1]="Right",n[n.Left=2]="Left",n[n.None=3]="None"})(u2||(u2={}));var cr;(function(n){n[n.TextDefined=0]="TextDefined",n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(cr||(cr={}));var Ud;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(Ud||(Ud={}));var Ll;(function(n){n[n.LF=0]="LF",n[n.CRLF=1]="CRLF"})(Ll||(Ll={}));class cw{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}}var Nl;(function(n){n[n.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",n[n.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",n[n.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",n[n.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"})(Nl||(Nl={}));var d2;(function(n){n[n.Left=0]="Left",n[n.Right=1]="Right",n[n.None=2]="None",n[n.LeftOfInjectedText=3]="LeftOfInjectedText",n[n.RightOfInjectedText=4]="RightOfInjectedText"})(d2||(d2={}));var h2;(function(n){n[n.FIRST_LINE_DETECTION_LENGTH_LIMIT=1e3]="FIRST_LINE_DETECTION_LENGTH_LIMIT"})(h2||(h2={}));class TL{constructor(e,t,i){this.regex=e,this.wordSeparators=t,this.simpleSearch=i}}class PL{constructor(e,t,i){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=i}}var Ol;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(Ol||(Ol={}));var si;(function(n){n[n.Hint=1]="Hint",n[n.Info=2]="Info",n[n.Warning=4]="Warning",n[n.Error=8]="Error"})(si||(si={}));(function(n){function e(l,c){return c-l}n.compare=e;const t=Object.create(null);t[n.Error]=h(1936,"Error"),t[n.Warning]=h(1937,"Warning"),t[n.Info]=h(1938,"Info");function i(l){return t[l]||""}n.toString=i;const s=Object.create(null);s[n.Error]=h(1939,"Errors"),s[n.Warning]=h(1940,"Warnings"),s[n.Info]=h(1941,"Infos");function r(l){return s[l]||""}n.toStringPlural=r;function o(l){switch(l){case Qt.Error:return n.Error;case Qt.Warning:return n.Warning;case Qt.Info:return n.Info;case Qt.Ignore:return n.Hint}}n.fromSeverity=o;function a(l){switch(l){case n.Error:return Qt.Error;case n.Warning:return Qt.Warning;case n.Info:return Qt.Info;case n.Hint:return Qt.Ignore}}n.toSeverity=a})(si||(si={}));var f2;(function(n){function t(s){return i(s,!0)}n.makeKey=t;function i(s,r){const o=[""];return s.source?o.push(s.source.replace("¦","\\¦")):o.push(""),s.code?typeof s.code=="string"?o.push(s.code.replace("¦","\\¦")):o.push(s.code.value.replace("¦","\\¦")):o.push(""),s.severity!==void 0&&s.severity!==null?o.push(si.toString(s.severity)):o.push(""),s.message&&r?o.push(s.message.replace("¦","\\¦")):o.push(""),s.startLineNumber!==void 0&&s.startLineNumber!==null?o.push(s.startLineNumber.toString()):o.push(""),s.startColumn!==void 0&&s.startColumn!==null?o.push(s.startColumn.toString()):o.push(""),s.endLineNumber!==void 0&&s.endLineNumber!==null?o.push(s.endLineNumber.toString()):o.push(""),s.endColumn!==void 0&&s.endColumn!==null?o.push(s.endColumn.toString()):o.push(""),o.push(""),o.join("¦")}n.makeKeyOptionalMessage=i})(f2||(f2={}));const AL=pe("progressService");pe("editorProgressService");var id;(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"})(id||(id={}));const LE=class LE{get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};LE.None=Object.freeze({report(){}});let $d=LE,p2=class extends Se{constructor(e,t){super(),this.deferred=new Eo,t.withProgress(e,i=>(this.reporter=i,this.lastStep&&i.report(this.lastStep),this.deferred.p)),this._register(we(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};p2=V([L(1,AL)],p2);class RL{constructor(){this.data=new Map}add(e,t){qn(it(e)),qn(nn(t)),qn(!this.data.has(e),"There is already an extension with this id"),this.data.set(e,t)}knows(e){return this.data.has(e)}as(e){return this.data.get(e)||null}dispose(){this.data.forEach(e=>{G4(e.dispose)&&e.dispose()}),this.data.clear()}}const mn=new RL;function nv(n,e){return e&&(n.stack||n.stacktrace)?h(105,"{0}: {1}",m2(n),g2(n.stack)||g2(n.stacktrace)):m2(n)}function g2(n){return Array.isArray(n)?n.join(`
|
|
87
|
-
`):n}function m2(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?h(106,"A system error occurred ({0})",n.message):n.message||h(107,"An unknown error occurred. Please consult the log for more details.")}function gu(n=null,e=!1){if(!n)return h(107,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=rn(n),i=gu(t[0],e);return t.length>1?h(108,"{0} ({1} errors in total)",i,t.length):i}if(it(n))return n;if(n.detail){const t=n.detail;if(t.error)return nv(t.error,e);if(t.exception)return nv(t.exception,e)}return n.stack?nv(n,e):n.message?n.message:h(107,"An unknown error occurred. Please consult the log for more details.")}class LL extends Se{constructor(e,t="",i="",s=!0,r){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=r}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}const g1=class g1 extends LL{constructor(){super(g1.ID,h(43,"(empty)"),void 0,!1)}};g1.ID="vs.actions.empty";let _2=g1;const NL={EditorFactory:"workbench.contributions.editor.inputFactories"},OL={id:"default",displayName:h(3877,"Text Editor"),providerDisplayName:h(3878,"Built-in")};var v2;(function(n){n[n.PROGRAMMATIC=1]="PROGRAMMATIC",n[n.USER=2]="USER",n[n.EDIT=3]="EDIT",n[n.NAVIGATION=4]="NAVIGATION",n[n.JUMP=5]="JUMP"})(v2||(v2={}));var w2;(function(n){n[n.IDENTICAL=1]="IDENTICAL",n[n.SIMILAR=2]="SIMILAR",n[n.DIFFERENT=3]="DIFFERENT"})(w2||(w2={}));var b2;(function(n){n[n.SHORT=0]="SHORT",n[n.MEDIUM=1]="MEDIUM",n[n.LONG=2]="LONG"})(b2||(b2={}));var Fl;(function(n){n[n.EXPLICIT=1]="EXPLICIT",n[n.AUTO=2]="AUTO",n[n.FOCUS_CHANGE=3]="FOCUS_CHANGE",n[n.WINDOW_CHANGE=4]="WINDOW_CHANGE"})(Fl||(Fl={}));var y2;(function(n){n[n.None=0]="None",n[n.Readonly=2]="Readonly",n[n.Untitled=4]="Untitled",n[n.Singleton=8]="Singleton",n[n.RequiresTrust=16]="RequiresTrust",n[n.CanSplitInGroup=32]="CanSplitInGroup",n[n.ForceDescription=64]="ForceDescription",n[n.CanDropIntoEditor=128]="CanDropIntoEditor",n[n.MultipleEditors=256]="MultipleEditors",n[n.Scratchpad=512]="Scratchpad"})(y2||(y2={}));var x2;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.REPLACE=1]="REPLACE",n[n.MOVE=2]="MOVE",n[n.UNPIN=3]="UNPIN"})(x2||(x2={}));var E2;(function(n){n[n.GROUP_ACTIVE=0]="GROUP_ACTIVE",n[n.GROUP_INDEX=1]="GROUP_INDEX",n[n.GROUP_LABEL=2]="GROUP_LABEL",n[n.GROUP_LOCKED=3]="GROUP_LOCKED",n[n.EDITORS_SELECTION=4]="EDITORS_SELECTION",n[n.EDITOR_OPEN=5]="EDITOR_OPEN",n[n.EDITOR_CLOSE=6]="EDITOR_CLOSE",n[n.EDITOR_MOVE=7]="EDITOR_MOVE",n[n.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",n[n.EDITOR_LABEL=9]="EDITOR_LABEL",n[n.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",n[n.EDITOR_PIN=11]="EDITOR_PIN",n[n.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",n[n.EDITOR_STICKY=13]="EDITOR_STICKY",n[n.EDITOR_DIRTY=14]="EDITOR_DIRTY",n[n.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(E2||(E2={}));var S2;(function(n){n[n.PRIMARY=1]="PRIMARY",n[n.SECONDARY=2]="SECONDARY",n[n.BOTH=3]="BOTH",n[n.ANY=4]="ANY"})(S2||(S2={}));var k2;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.KEYBOARD=1]="KEYBOARD",n[n.MOUSE=2]="MOUSE"})(k2||(k2={}));var D2;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(D2||(D2={}));class FL{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(Yh);for(const[i,s]of this.editorSerializerConstructors)this.createEditorSerializer(i,s,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const s=i.createInstance(t);this.editorSerializerInstances.set(e,s)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return Tc(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw new Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),we(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e=="string"?e:e.typeId)}}mn.add(NL.EditorFactory,new FL);var I2;(function(n){n[n.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",n[n.SEQUENTIAL=1]="SEQUENTIAL"})(I2||(I2={}));let Uo;function uT(n){Uo?Uo instanceof C2?Uo.loggers.push(n):Uo=new C2([Uo,n]):Uo=n}function En(){return Uo}let uw;function ML(n){uw=n}function UL(n){uw&&uw(n)}class C2{constructor(e){this.loggers=e}handleObservableCreated(e){for(const t of this.loggers)t.handleObservableCreated(e)}handleOnListenerCountChanged(e,t){for(const i of this.loggers)i.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const i of this.loggers)i.handleObservableUpdated(e,t)}handleAutorunCreated(e){for(const t of this.loggers)t.handleAutorunCreated(e)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,i){for(const s of this.loggers)s.handleAutorunDependencyChanged(e,t,i)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,i){for(const s of this.loggers)s.handleDerivedDependencyChanged(e,t,i)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}}var Cn;(function(n){n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(Cn||(Cn={}));class dT{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i){this._debugNameData=e,this._runFn=t,this._changeTracker=i,this._state=Cn.stale,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),En()?.handleAutorunCreated(this),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),En()?.handleAutorunDisposed(this)}}_run(){const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=Cn.upToDate;try{if(!this._disposed){En()?.handleAutorunStarted(this);const t=this._changeSummary,i=this._delayedStore;i!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,t),this._changeSummary=this._changeTracker.createChangeSummary(t)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,t)}catch(s){wp(s)}finally{this._isRunning=!1,i!==void 0&&i.dispose()}}}finally{this._disposed||En()?.handleAutorunFinished(this);for(const t of this._dependenciesToBeRemoved)t.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===Cn.upToDate&&(this._state=Cn.dependenciesMightHaveChanged),this._updateCount++}endUpdate(e){try{if(this._updateCount===1)do{if(this._state===Cn.dependenciesMightHaveChanged){this._state=Cn.upToDate;for(const t of this._dependencies)if(t.reportChanges(),this._state===Cn.stale)break}this._state!==Cn.upToDate&&this._run()}while(this._state!==Cn.upToDate)}finally{this._updateCount--}z4(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===Cn.upToDate&&this._isDependency(e)&&(this._state=Cn.dependenciesMightHaveChanged)}handleChange(e,t){if(this._isDependency(e)){En()?.handleAutorunDependencyChanged(this,e,t);try{(this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:s=>s===e},this._changeSummary):!0)&&(this._state=Cn.stale)}catch(i){wp(i)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Un("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new Un("Cannot access store after dispose");return this._store===void 0&&(this._store=new xe),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new Un("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new xe),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state}}debugRerun(){this._isRunning?this._state=Cn.stale:this._run()}}const Hd=(n,e)=>n===e;function dw(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!dw(n[t],e[t]))return!1;return!0}if(n&&typeof n=="object"&&e&&typeof e=="object"&&Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(e)===Object.prototype){const t=n,i=e,s=Object.keys(t),r=Object.keys(i),o=new Set(r);if(s.length!==r.length)return!1;for(const a of s)if(!o.has(a)||!dw(t[a],i[a]))return!1;return!0}return!1}class So{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return $L(e,this)}}const T2=new Map,hw=new WeakMap;function $L(n,e){const t=hw.get(n);if(t)return t;const i=HL(n,e);if(i){let s=T2.get(i)??0;s++,T2.set(i,s);const r=s===1?i:`${i}#${s}`;return hw.set(n,r),r}}function HL(n,e){const t=hw.get(n);if(t)return t;const i=e.owner?WL(e.owner)+".":"";let s;const r=e.debugNameSource;if(r!==void 0)if(typeof r=="function"){if(s=r(),s!==void 0)return i+s}else return i+r;const o=e.referenceFn;if(o!==void 0&&(s=Vx(o),s!==void 0))return i+s;if(e.owner!==void 0){const a=BL(e.owner,n);if(a!==void 0)return i+a}}function BL(n,e){for(const t in n)if(n[t]===e)return t}const P2=new Map,A2=new WeakMap;function WL(n){const e=A2.get(n);if(e)return e;const t=hT(n)??"Object";let i=P2.get(t)??0;i++,P2.set(t,i);const s=i===1?t:`${t}#${i}`;return A2.set(n,s),s}function hT(n){const e=n.constructor;if(e)return e.name==="Object"?void 0:e.name}function Vx(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(i?i[1]:void 0)?.trim()}let fw;function VL(n){fw=n}let fT;function zL(n){fT=n}let pT;function qL(n){pT=n}class jL{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return fw({owner:i,debugName:()=>{const r=Vx(s);if(r!==void 0)return r;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:s},r=>s(this.read(r),r))}flatten(){return fw({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(fT(this,t)),this}keepObserved(e){return e.add(pT(this)),this}get debugValue(){return this.get()}}class i_ extends jL{constructor(){super(),this._observers=new Set,En()?.handleObservableCreated(this)}addObserver(e){const t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&En()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&En()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){const e=!!En();return UL(this),e||En()?.handleObservableCreated(this),this}debugGetObservers(){return this._observers}}var jt;(function(n){n[n.initial=0]="initial",n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(jt||(jt={}));class is extends i_{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this._changeTracker=i,this._handleLastObserverRemoved=s,this._equalityComparator=r,this._state=jt.initial,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=jt.initial,this._value=void 0,En()?.handleDerivedCleared(this);for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._observers.size===0){let e;try{this._isReaderValid=!0;let t;this._changeTracker&&(t=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,t)),e=this._computeFn(this,t)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),e}else{do{if(this._state===jt.dependenciesMightHaveChanged){for(const e of this._dependencies)if(e.reportChanges(),this._state===jt.stale)break}this._state===jt.dependenciesMightHaveChanged&&(this._state=jt.upToDate),this._state!==jt.upToDate&&this._recompute()}while(this._state!==jt.upToDate);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const i=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,i),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(i));const s=this._state!==jt.initial,r=this._value;this._state=jt.upToDate;const o=this._delayedStore;o!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,i)}finally{this._isReaderValid=!1;for(const a of this._dependenciesToBeRemoved)a.removeObserver(this);this._dependenciesToBeRemoved.clear(),o!==void 0&&o.dispose()}e=this._didReportChange||s&&!this._equalityComparator(r,this._value),En()?.handleObservableUpdated(this,{oldValue:r,newValue:this._value,change:void 0,didChange:e,hadValue:s})}catch(i){wp(i)}if(this._isComputing=!1,!this._didReportChange&&e)for(const i of this._observers)i.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new Un("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const t=this._updateCount===1;if(this._state===jt.upToDate&&(this._state=jt.dependenciesMightHaveChanged,!t))for(const i of this._observers)i.handlePossibleChange(this);if(t)for(const i of this._observers)i.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){const t=[...this._observers];for(const i of t)i.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const i=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const s of i)s.endUpdate(this)}}z4(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===jt.upToDate&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=jt.dependenciesMightHaveChanged;for(const t of this._observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){En()?.handleDerivedDependencyChanged(this,e,t);let i=!1;try{i=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:r=>r===e},this._changeSummary):!0}catch(r){wp(r)}const s=this._state===jt.upToDate;if(i&&(this._state===jt.dependenciesMightHaveChanged||s)&&(this._state=jt.stale,s))for(const r of this._observers)r.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new Un("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(const t of this._observers)t.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new xe),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new xe),this._delayedStore}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}setValue(e,t,i){this._value=e;const s=this._observers;t.updateObserver(this,this);for(const r of s)r.handleChange(this,i)}}function GL(n,e){return e!==void 0?new is(new So(n,void 0,e),e,void 0,void 0,Hd):new is(new So(void 0,void 0,n),n,void 0,void 0,Hd)}function gT(n,e){return new is(new So(n.owner,n.debugName,n.debugReferenceFn),e,void 0,n.onLastObserverRemoved,n.equalsFn??Hd)}VL(gT);function mT(n){return new dT(new So(void 0,void 0,n),n,void 0)}function R2(n){const e=new Error("BugIndicatingErrorRecovery: "+n);On(e),console.error("recovered from an error that indicates a bug",e)}function Bd(n,e){const t=new _T(n,e);try{n(t)}finally{t.finish()}}function KL(n,e,t){n?e(n):Bd(e,t)}class _T{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],En()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Vx(this._fn)}updateObserver(e,t){if(!this._updatingObservers){R2("Transaction already finished!"),Bd(i=>{i.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this._updatingObservers;if(!e){R2("transaction.finish() has already been called!");return}for(let t=0;t<e.length;t++){const{observer:i,observable:s}=e[t];i.endUpdate(s)}this._updatingObservers=null,En()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}}function s_(n,e){let t;return typeof n=="string"?t=new So(void 0,n,void 0):t=new So(n,void 0,void 0),new pw(t,e,Hd)}class pw extends i_{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._value=t,En()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let s;t||(t=s=new _T(()=>{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),En()?.handleObservableUpdated(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const o of this._observers)t.updateObserver(o,this),o.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function gw(...n){let e,t,i;return n.length===3?[e,t,i]=n:[t,i]=n,new sa(new So(e,void 0,i),t,i,()=>sa.globalTransaction,Hd)}class sa extends i_{constructor(e,t,i,s,r){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=s,this._equalityComparator=r,this._hasValue=!1,this.handleEvent=o=>{const a=this._getValue(o),l=this._value,c=!this._hasValue||!this._equalityComparator(l,a);let u=!1;c&&(this._value=a,this._hasValue&&(u=!0,KL(this._getTransaction(),d=>{En()?.handleObservableUpdated(this,{oldValue:l,newValue:a,change:void 0,didChange:c,hadValue:this._hasValue});for(const f of this._observers)d.updateObserver(f,this),f.handleChange(this,void 0)},()=>{const d=this.getDebugName();return"Event fired"+(d?`: ${d}`:"")})),this._hasValue=!0),u||En()?.handleObservableUpdated(this,{oldValue:l,newValue:a,change:void 0,didChange:c,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}}(function(n){n.Observer=sa;function e(t,i){let s=!1;sa.globalTransaction===void 0&&(sa.globalTransaction=t,s=!0);try{i()}finally{s&&(sa.globalTransaction=void 0)}}n.batchEventsGlobally=e})(gw||(gw={}));function QL(n){const e=new vT(!1,void 0);return n.addObserver(e),we(()=>{n.removeObserver(e)})}qL(QL);function JL(n,e){const t=new vT(!0,e);n.addObserver(t);try{t.beginUpdate(n)}finally{t.endUpdate(n)}return we(()=>{n.removeObserver(t)})}zL(JL);class vT{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}let kf;function XL(n){kf||(kf=new YL,uT(kf)),kf.addFilteredObj(n)}class YL{constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return ZL([vl(n9("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[vl(" "),Ui(xr(e.oldValue,70),{color:"red",strikeThrough:!0}),vl(" "),Ui(xr(e.newValue,60),{color:"green"})]:[vl(" (unchanged)")]:[vl(" "),Ui(xr(e.newValue,60),{color:"green"}),vl(" (initial)")]}handleObservableCreated(e){if(e instanceof is){const t=e;this.changedObservablesSets.set(t,new Set)}}handleOnListenerCountChanged(e,t){}handleObservableUpdated(e,t){if(this._isIncluded(e)){if(e instanceof is){this._handleDerivedRecomputed(e,t);return}console.log(...this.textToConsoleArgs([wl("observable value changed"),Ui(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t)]))}}formatChanges(e){if(e.size!==0)return Ui(" (changed deps: "+[...e].map(t=>t.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,t,i){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(t)}_handleDerivedRecomputed(e,t){if(!this._isIncluded(e))return;const i=this.changedObservablesSets.get(e);i&&(console.log(...this.textToConsoleArgs([wl("derived recomputed"),Ui(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),this.formatChanges(i),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),i.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("derived cleared"),Ui(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,t){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("observable from event triggered"),Ui(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,t,i){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(t)}handleAutorunStarted(e){const t=this.changedObservablesSets.get(e);t&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("autorun"),Ui(e.debugName,{color:"BlueViolet"}),this.formatChanges(t),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),t.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let t=e.getDebugName();t===void 0&&(t=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("transaction"),Ui(t,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}}function ZL(n){const e=new Array,t=[];let i="";function s(o){if("length"in o)for(const a of o)a&&s(a);else"text"in o?(i+=`%c${o.text}`,e.push(o.style),o.data&&t.push(...o.data)):"data"in o&&t.push(...o.data)}s(n);const r=[i,...e];return r.push(...t),r}function vl(n){return Ui(n,{color:"black"})}function wl(n){return Ui(i9(`${n}: `,10),{color:"black",bold:!0})}function Ui(n,e={color:"black"}){function t(s){return Object.entries(s).reduce((r,[o,a])=>`${r}${o}:${a};`,"")}const i={color:e.color};return e.strikeThrough&&(i["text-decoration"]="line-through"),e.bold&&(i["font-weight"]="bold"),{text:n,style:t(i)}}function xr(n,e){switch(typeof n){case"number":return""+n;case"string":return n.length+2<=e?`"${n}"`:`"${n.substr(0,e-7)}"+...`;case"boolean":return n?"true":"false";case"undefined":return"undefined";case"object":return n===null?"null":Array.isArray(n)?e9(n,e):t9(n,e);case"symbol":return n.toString();case"function":return`[[Function${n.name?" "+n.name:""}]]`;default:return""+n}}function e9(n,e){let t="[ ",i=!0;for(const s of n){if(i||(t+=", "),t.length-5>e){t+="...";break}i=!1,t+=`${xr(s,e-t.length)}`}return t+=" ]",t}function t9(n,e){if(typeof n.toString=="function"&&n.toString!==Object.prototype.toString){const r=n.toString();return r.length<=e?r:r.substring(0,e-3)+"..."}const t=hT(n);let i=t?t+"(":"{ ",s=!0;for(const[r,o]of Object.entries(n)){if(s||(i+=", "),i.length-5>e){i+="...";break}s=!1,i+=`${r}: ${xr(o,e-i.length)}`}return i+=t?")":" }",i}function n9(n,e){let t="";for(let i=1;i<=e;i++)t+=n;return t}function i9(n,e){for(;n.length<e;)n+=" ";return n}class Jp{static createHost(e,t){return new Jp(e,t)}static createClient(e,t){return new Jp(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:r=>{const o=r,a=this._getHandler().notifications[o[0]];if(!a)throw new Error(`Unknown notification "${o[0]}"!`);a(...o[1])},handleRequest:r=>{const o=r;try{return{type:"result",value:this._getHandler().requests[o[0]](...o[1])}}catch(a){return{type:"error",value:a}}}});const i=new Proxy({},{get:(r,o)=>async(...a)=>{const l=await this._channel.sendRequest([o,a]);if(l.type==="error")throw l.value;return l.value}}),s=new Proxy({},{get:(r,o)=>(...a)=>{this._channel.sendNotification([o,a])}});this.api={notifications:s,requests:i}}}function s9(n,e){const t=globalThis;let i=[],s;const{channel:r,handler:o}=r9({sendNotification:l=>{s?s.sendNotification(l):i.push(l)}});let a;return(t.$$debugValueEditor_debugChannels??(t.$$debugValueEditor_debugChannels={}))[n]=l=>{a=e(),s=l;for(const c of i)l.sendNotification(c);return i=[],o},Jp.createClient(r,()=>{if(!a)throw new Error("Not supported");return a})}function r9(n){let e;return{channel:i=>(e=i,{sendNotification:s=>{n.sendNotification(s)},sendRequest:s=>{throw new Error("not supported")}}),handler:{handleRequest:i=>i.type==="notification"?e?.handleNotification(i.data):e?.handleRequest(i.data)}}}function L2(n,e){const t=n.split(`
|
|
87
|
+
`):n}function m2(n){return n.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${n.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof n.code=="string"&&typeof n.errno=="number"&&typeof n.syscall=="string"?h(106,"A system error occurred ({0})",n.message):n.message||h(107,"An unknown error occurred. Please consult the log for more details.")}function gu(n=null,e=!1){if(!n)return h(107,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(n)){const t=rn(n),i=gu(t[0],e);return t.length>1?h(108,"{0} ({1} errors in total)",i,t.length):i}if(it(n))return n;if(n.detail){const t=n.detail;if(t.error)return nv(t.error,e);if(t.exception)return nv(t.exception,e)}return n.stack?nv(n,e):n.message?n.message:h(107,"An unknown error occurred. Please consult the log for more details.")}class LL extends Se{constructor(e,t="",i="",s=!0,r){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=e,this._label=t,this._cssClass=i,this._enabled=s,this._actionCallback=r}get id(){return this._id}get label(){return this._label}set label(e){this._setLabel(e)}_setLabel(e){this._label!==e&&(this._label=e,this._onDidChange.fire({label:e}))}get tooltip(){return this._tooltip||""}set tooltip(e){this._setTooltip(e)}_setTooltip(e){this._tooltip!==e&&(this._tooltip=e,this._onDidChange.fire({tooltip:e}))}get class(){return this._cssClass}set class(e){this._setClass(e)}_setClass(e){this._cssClass!==e&&(this._cssClass=e,this._onDidChange.fire({class:e}))}get enabled(){return this._enabled}set enabled(e){this._setEnabled(e)}_setEnabled(e){this._enabled!==e&&(this._enabled=e,this._onDidChange.fire({enabled:e}))}get checked(){return this._checked}set checked(e){this._setChecked(e)}_setChecked(e){this._checked!==e&&(this._checked=e,this._onDidChange.fire({checked:e}))}async run(e,t){this._actionCallback&&await this._actionCallback(e)}}const g1=class g1 extends LL{constructor(){super(g1.ID,h(43,"(empty)"),void 0,!1)}};g1.ID="vs.actions.empty";let _2=g1;const NL={EditorFactory:"workbench.contributions.editor.inputFactories"},OL={id:"default",displayName:h(3877,"Text Editor"),providerDisplayName:h(3878,"Built-in")};var v2;(function(n){n[n.PROGRAMMATIC=1]="PROGRAMMATIC",n[n.USER=2]="USER",n[n.EDIT=3]="EDIT",n[n.NAVIGATION=4]="NAVIGATION",n[n.JUMP=5]="JUMP"})(v2||(v2={}));var w2;(function(n){n[n.IDENTICAL=1]="IDENTICAL",n[n.SIMILAR=2]="SIMILAR",n[n.DIFFERENT=3]="DIFFERENT"})(w2||(w2={}));var b2;(function(n){n[n.SHORT=0]="SHORT",n[n.MEDIUM=1]="MEDIUM",n[n.LONG=2]="LONG"})(b2||(b2={}));var Fl;(function(n){n[n.EXPLICIT=1]="EXPLICIT",n[n.AUTO=2]="AUTO",n[n.FOCUS_CHANGE=3]="FOCUS_CHANGE",n[n.WINDOW_CHANGE=4]="WINDOW_CHANGE"})(Fl||(Fl={}));var y2;(function(n){n[n.None=0]="None",n[n.Readonly=2]="Readonly",n[n.Untitled=4]="Untitled",n[n.Singleton=8]="Singleton",n[n.RequiresTrust=16]="RequiresTrust",n[n.CanSplitInGroup=32]="CanSplitInGroup",n[n.ForceDescription=64]="ForceDescription",n[n.CanDropIntoEditor=128]="CanDropIntoEditor",n[n.MultipleEditors=256]="MultipleEditors",n[n.Scratchpad=512]="Scratchpad"})(y2||(y2={}));var x2;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.REPLACE=1]="REPLACE",n[n.MOVE=2]="MOVE",n[n.UNPIN=3]="UNPIN"})(x2||(x2={}));var E2;(function(n){n[n.GROUP_ACTIVE=0]="GROUP_ACTIVE",n[n.GROUP_INDEX=1]="GROUP_INDEX",n[n.GROUP_LABEL=2]="GROUP_LABEL",n[n.GROUP_LOCKED=3]="GROUP_LOCKED",n[n.EDITORS_SELECTION=4]="EDITORS_SELECTION",n[n.EDITOR_OPEN=5]="EDITOR_OPEN",n[n.EDITOR_CLOSE=6]="EDITOR_CLOSE",n[n.EDITOR_MOVE=7]="EDITOR_MOVE",n[n.EDITOR_ACTIVE=8]="EDITOR_ACTIVE",n[n.EDITOR_LABEL=9]="EDITOR_LABEL",n[n.EDITOR_CAPABILITIES=10]="EDITOR_CAPABILITIES",n[n.EDITOR_PIN=11]="EDITOR_PIN",n[n.EDITOR_TRANSIENT=12]="EDITOR_TRANSIENT",n[n.EDITOR_STICKY=13]="EDITOR_STICKY",n[n.EDITOR_DIRTY=14]="EDITOR_DIRTY",n[n.EDITOR_WILL_DISPOSE=15]="EDITOR_WILL_DISPOSE"})(E2||(E2={}));var S2;(function(n){n[n.PRIMARY=1]="PRIMARY",n[n.SECONDARY=2]="SECONDARY",n[n.BOTH=3]="BOTH",n[n.ANY=4]="ANY"})(S2||(S2={}));var k2;(function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.KEYBOARD=1]="KEYBOARD",n[n.MOUSE=2]="MOUSE"})(k2||(k2={}));var D2;(function(n){n[n.LEFT=0]="LEFT",n[n.RIGHT=1]="RIGHT"})(D2||(D2={}));class FL{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){const t=this.instantiationService=e.get(Yh);for(const[i,s]of this.editorSerializerConstructors)this.createEditorSerializer(i,s,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,i){const s=i.createInstance(t);this.editorSerializerInstances.set(e,s)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw new Error("Can only register one file editor factory.");this.fileEditorFactory=e}getFileEditorFactory(){return Tc(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw new Error(`A editor serializer with type ID '${e}' was already registered.`);return this.instantiationService?this.createEditorSerializer(e,t,this.instantiationService):this.editorSerializerConstructors.set(e,t),we(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e=="string"?e:e.typeId)}}mn.add(NL.EditorFactory,new FL);var I2;(function(n){n[n.MOST_RECENTLY_ACTIVE=0]="MOST_RECENTLY_ACTIVE",n[n.SEQUENTIAL=1]="SEQUENTIAL"})(I2||(I2={}));let Uo;function uT(n){Uo?Uo instanceof C2?Uo.loggers.push(n):Uo=new C2([Uo,n]):Uo=n}function En(){return Uo}let uw;function ML(n){uw=n}function UL(n){uw&&uw(n)}class C2{constructor(e){this.loggers=e}handleObservableCreated(e){for(const t of this.loggers)t.handleObservableCreated(e)}handleOnListenerCountChanged(e,t){for(const i of this.loggers)i.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(const i of this.loggers)i.handleObservableUpdated(e,t)}handleAutorunCreated(e){for(const t of this.loggers)t.handleAutorunCreated(e)}handleAutorunDisposed(e){for(const t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,i){for(const s of this.loggers)s.handleAutorunDependencyChanged(e,t,i)}handleAutorunStarted(e){for(const t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(const t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,i){for(const s of this.loggers)s.handleDerivedDependencyChanged(e,t,i)}handleDerivedCleared(e){for(const t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(const t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(const t of this.loggers)t.handleEndTransaction(e)}}var Cn;(function(n){n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(Cn||(Cn={}));class dT{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i){this._debugNameData=e,this._runFn=t,this._changeTracker=i,this._state=Cn.stale,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),En()?.handleAutorunCreated(this),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),En()?.handleAutorunDisposed(this)}}_run(){const e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=Cn.upToDate;try{if(!this._disposed){En()?.handleAutorunStarted(this);const t=this._changeSummary,i=this._delayedStore;i!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,t),this._changeSummary=this._changeTracker.createChangeSummary(t)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,t)}catch(s){wp(s)}finally{this._isRunning=!1,i!==void 0&&i.dispose()}}}finally{this._disposed||En()?.handleAutorunFinished(this);for(const t of this._dependenciesToBeRemoved)t.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===Cn.upToDate&&(this._state=Cn.dependenciesMightHaveChanged),this._updateCount++}endUpdate(e){try{if(this._updateCount===1)do{if(this._state===Cn.dependenciesMightHaveChanged){this._state=Cn.upToDate;for(const t of this._dependencies)if(t.reportChanges(),this._state===Cn.stale)break}this._state!==Cn.upToDate&&this._run()}while(this._state!==Cn.upToDate)}finally{this._updateCount--}z4(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===Cn.upToDate&&this._isDependency(e)&&(this._state=Cn.dependenciesMightHaveChanged)}handleChange(e,t){if(this._isDependency(e)){En()?.handleAutorunDependencyChanged(this,e,t);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:s=>s===e},this._changeSummary))&&(this._state=Cn.stale)}catch(i){wp(i)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new Un("The reader object cannot be used outside its compute function!")}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new Un("Cannot access store after dispose");return this._store===void 0&&(this._store=new xe),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new Un("Cannot access store after dispose");return this._delayedStore===void 0&&(this._delayedStore=new xe),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state}}debugRerun(){this._isRunning?this._state=Cn.stale:this._run()}}const Hd=(n,e)=>n===e;function dw(n,e){if(n===e)return!0;if(Array.isArray(n)&&Array.isArray(e)){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!dw(n[t],e[t]))return!1;return!0}if(n&&typeof n=="object"&&e&&typeof e=="object"&&Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(e)===Object.prototype){const t=n,i=e,s=Object.keys(t),r=Object.keys(i),o=new Set(r);if(s.length!==r.length)return!1;for(const a of s)if(!o.has(a)||!dw(t[a],i[a]))return!1;return!0}return!1}class So{constructor(e,t,i){this.owner=e,this.debugNameSource=t,this.referenceFn=i}getDebugName(e){return $L(e,this)}}const T2=new Map,hw=new WeakMap;function $L(n,e){const t=hw.get(n);if(t)return t;const i=HL(n,e);if(i){let s=T2.get(i)??0;s++,T2.set(i,s);const r=s===1?i:`${i}#${s}`;return hw.set(n,r),r}}function HL(n,e){const t=hw.get(n);if(t)return t;const i=e.owner?WL(e.owner)+".":"";let s;const r=e.debugNameSource;if(r!==void 0)if(typeof r=="function"){if(s=r(),s!==void 0)return i+s}else return i+r;const o=e.referenceFn;if(o!==void 0&&(s=Vx(o),s!==void 0))return i+s;if(e.owner!==void 0){const a=BL(e.owner,n);if(a!==void 0)return i+a}}function BL(n,e){for(const t in n)if(n[t]===e)return t}const P2=new Map,A2=new WeakMap;function WL(n){const e=A2.get(n);if(e)return e;const t=hT(n)??"Object";let i=P2.get(t)??0;i++,P2.set(t,i);const s=i===1?t:`${t}#${i}`;return A2.set(n,s),s}function hT(n){const e=n.constructor;if(e)return e.name==="Object"?void 0:e.name}function Vx(n){const e=n.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(e);return(i?i[1]:void 0)?.trim()}let fw;function VL(n){fw=n}let fT;function zL(n){fT=n}let pT;function qL(n){pT=n}class jL{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=t===void 0?void 0:e,s=t===void 0?e:t;return fw({owner:i,debugName:()=>{const r=Vx(s);if(r!==void 0)return r;const a=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(s.toString());if(a)return`${this.debugName}.${a[2]}`;if(!i)return`${this.debugName} (mapped)`},debugReferenceFn:s},r=>s(this.read(r),r))}flatten(){return fw({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(fT(this,t)),this}keepObserved(e){return e.add(pT(this)),this}get debugValue(){return this.get()}}class i_ extends jL{constructor(){super(),this._observers=new Set,En()?.handleObservableCreated(this)}addObserver(e){const t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&En()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){const t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&En()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){const e=!!En();return UL(this),e||En()?.handleObservableCreated(this),this}debugGetObservers(){return this._observers}}var jt;(function(n){n[n.initial=0]="initial",n[n.dependenciesMightHaveChanged=1]="dependenciesMightHaveChanged",n[n.stale=2]="stale",n[n.upToDate=3]="upToDate"})(jt||(jt={}));class is extends i_{get debugName(){return this._debugNameData.getDebugName(this)??"(anonymous)"}constructor(e,t,i,s=void 0,r){super(),this._debugNameData=e,this._computeFn=t,this._changeTracker=i,this._handleLastObserverRemoved=s,this._equalityComparator=r,this._state=jt.initial,this._value=void 0,this._updateCount=0,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._changeSummary=void 0,this._isUpdating=!1,this._isComputing=!1,this._didReportChange=!1,this._isInBeforeUpdate=!1,this._isReaderValid=!1,this._store=void 0,this._delayedStore=void 0,this._removedObserverToCallEndUpdateOn=null,this._changeSummary=this._changeTracker?.createChangeSummary(void 0)}onLastObserverRemoved(){this._state=jt.initial,this._value=void 0,En()?.handleDerivedCleared(this);for(const e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._delayedStore!==void 0&&(this._delayedStore.dispose(),this._delayedStore=void 0),this._handleLastObserverRemoved?.()}get(){if(this._observers.size===0){let e;try{this._isReaderValid=!0;let t;this._changeTracker&&(t=this._changeTracker.createChangeSummary(void 0),this._changeTracker.beforeUpdate?.(this,t)),e=this._computeFn(this,t)}finally{this._isReaderValid=!1}return this.onLastObserverRemoved(),e}else{do{if(this._state===jt.dependenciesMightHaveChanged){for(const e of this._dependencies)if(e.reportChanges(),this._state===jt.stale)break}this._state===jt.dependenciesMightHaveChanged&&(this._state=jt.upToDate),this._state!==jt.upToDate&&this._recompute()}while(this._state!==jt.upToDate);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;const t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{const i=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,i),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(i));const s=this._state!==jt.initial,r=this._value;this._state=jt.upToDate;const o=this._delayedStore;o!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,i)}finally{this._isReaderValid=!1;for(const a of this._dependenciesToBeRemoved)a.removeObserver(this);this._dependenciesToBeRemoved.clear(),o!==void 0&&o.dispose()}e=this._didReportChange||s&&!this._equalityComparator(r,this._value),En()?.handleObservableUpdated(this,{oldValue:r,newValue:this._value,change:void 0,didChange:e,hadValue:s})}catch(i){wp(i)}if(this._isComputing=!1,!this._didReportChange&&e)for(const i of this._observers)i.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new Un("Cyclic deriveds are not supported yet!");this._updateCount++,this._isUpdating=!0;try{const t=this._updateCount===1;if(this._state===jt.upToDate&&(this._state=jt.dependenciesMightHaveChanged,!t))for(const i of this._observers)i.handlePossibleChange(this);if(t)for(const i of this._observers)i.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){const t=[...this._observers];for(const i of t)i.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){const i=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(const s of i)s.endUpdate(this)}}z4(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===jt.upToDate&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=jt.dependenciesMightHaveChanged;for(const t of this._observers)t.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){En()?.handleDerivedDependencyChanged(this,e,t);let i=!1;try{i=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:r=>r===e},this._changeSummary):!0}catch(r){wp(r)}const s=this._state===jt.upToDate;if(i&&(this._state===jt.dependenciesMightHaveChanged||s)&&(this._state=jt.stale,s))for(const r of this._observers)r.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new Un("The reader object cannot be used outside its compute function!")}readObservable(e){this._ensureReaderValid(),e.addObserver(this);const t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(const t of this._observers)t.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new xe),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new xe),this._delayedStore}addObserver(e){const t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn&&this._removedObserverToCallEndUpdateOn.has(e)?this._removedObserverToCallEndUpdateOn.delete(e):e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||(this._removedObserverToCallEndUpdateOn=new Set),this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}setValue(e,t,i){this._value=e;const s=this._observers;t.updateObserver(this,this);for(const r of s)r.handleChange(this,i)}}function GL(n,e){return e!==void 0?new is(new So(n,void 0,e),e,void 0,void 0,Hd):new is(new So(void 0,void 0,n),n,void 0,void 0,Hd)}function gT(n,e){return new is(new So(n.owner,n.debugName,n.debugReferenceFn),e,void 0,n.onLastObserverRemoved,n.equalsFn??Hd)}VL(gT);function mT(n){return new dT(new So(void 0,void 0,n),n,void 0)}function R2(n){const e=new Error("BugIndicatingErrorRecovery: "+n);On(e),console.error("recovered from an error that indicates a bug",e)}function Bd(n,e){const t=new _T(n,e);try{n(t)}finally{t.finish()}}function KL(n,e,t){n?e(n):Bd(e,t)}class _T{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],En()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Vx(this._fn)}updateObserver(e,t){if(!this._updatingObservers){R2("Transaction already finished!"),Bd(i=>{i.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){const e=this._updatingObservers;if(!e){R2("transaction.finish() has already been called!");return}for(let t=0;t<e.length;t++){const{observer:i,observable:s}=e[t];i.endUpdate(s)}this._updatingObservers=null,En()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}}function s_(n,e){let t;return typeof n=="string"?t=new So(void 0,n,void 0):t=new So(n,void 0,void 0),new pw(t,e,Hd)}class pw extends i_{get debugName(){return this._debugNameData.getDebugName(this)??"ObservableValue"}constructor(e,t,i){super(),this._debugNameData=e,this._equalityComparator=i,this._value=t,En()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,i){if(i===void 0&&this._equalityComparator(this._value,e))return;let s;t||(t=s=new _T(()=>{},()=>`Setting ${this.debugName}`));try{const r=this._value;this._setValue(e),En()?.handleObservableUpdated(this,{oldValue:r,newValue:e,change:i,didChange:!0,hadValue:!0});for(const o of this._observers)t.updateObserver(o,this),o.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}}function gw(...n){let e,t,i;return n.length===3?[e,t,i]=n:[t,i]=n,new sa(new So(e,void 0,i),t,i,()=>sa.globalTransaction,Hd)}class sa extends i_{constructor(e,t,i,s,r){super(),this._debugNameData=e,this.event=t,this._getValue=i,this._getTransaction=s,this._equalityComparator=r,this._hasValue=!1,this.handleEvent=o=>{const a=this._getValue(o),l=this._value,c=!this._hasValue||!this._equalityComparator(l,a);let u=!1;c&&(this._value=a,this._hasValue&&(u=!0,KL(this._getTransaction(),d=>{En()?.handleObservableUpdated(this,{oldValue:l,newValue:a,change:void 0,didChange:c,hadValue:this._hasValue});for(const f of this._observers)d.updateObserver(f,this),f.handleChange(this,void 0)},()=>{const d=this.getDebugName();return"Event fired"+(d?`: ${d}`:"")})),this._hasValue=!0),u||En()?.handleObservableUpdated(this,{oldValue:l,newValue:a,change:void 0,didChange:c,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this._subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this._subscription.dispose(),this._subscription=void 0,this._hasValue=!1,this._value=void 0}get(){return this._subscription?(this._hasValue||this.handleEvent(void 0),this._value):this._getValue(void 0)}debugSetValue(e){this._value=e}}(function(n){n.Observer=sa;function e(t,i){let s=!1;sa.globalTransaction===void 0&&(sa.globalTransaction=t,s=!0);try{i()}finally{s&&(sa.globalTransaction=void 0)}}n.batchEventsGlobally=e})(gw||(gw={}));function QL(n){const e=new vT(!1,void 0);return n.addObserver(e),we(()=>{n.removeObserver(e)})}qL(QL);function JL(n,e){const t=new vT(!0,e);n.addObserver(t);try{t.beginUpdate(n)}finally{t.endUpdate(n)}return we(()=>{n.removeObserver(t)})}zL(JL);class vT{constructor(e,t){this._forceRecompute=e,this._handleValue=t,this._counter=0}beginUpdate(e){this._counter++}endUpdate(e){this._counter===1&&this._forceRecompute&&(this._handleValue?this._handleValue(e.get()):e.reportChanges()),this._counter--}handlePossibleChange(e){}handleChange(e,t){}}let kf;function XL(n){kf||(kf=new YL,uT(kf)),kf.addFilteredObj(n)}class YL{constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||(this._filteredObjects=new Set),this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return ZL([vl(n9("| ",this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[vl(" "),Ui(xr(e.oldValue,70),{color:"red",strikeThrough:!0}),vl(" "),Ui(xr(e.newValue,60),{color:"green"})]:[vl(" (unchanged)")]:[vl(" "),Ui(xr(e.newValue,60),{color:"green"}),vl(" (initial)")]}handleObservableCreated(e){if(e instanceof is){const t=e;this.changedObservablesSets.set(t,new Set)}}handleOnListenerCountChanged(e,t){}handleObservableUpdated(e,t){if(this._isIncluded(e)){if(e instanceof is){this._handleDerivedRecomputed(e,t);return}console.log(...this.textToConsoleArgs([wl("observable value changed"),Ui(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t)]))}}formatChanges(e){if(e.size!==0)return Ui(" (changed deps: "+[...e].map(t=>t.debugName).join(", ")+")",{color:"gray"})}handleDerivedDependencyChanged(e,t,i){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(t)}_handleDerivedRecomputed(e,t){if(!this._isIncluded(e))return;const i=this.changedObservablesSets.get(e);i&&(console.log(...this.textToConsoleArgs([wl("derived recomputed"),Ui(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),this.formatChanges(i),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),i.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("derived cleared"),Ui(e.debugName,{color:"BlueViolet"})]))}handleFromEventObservableTriggered(e,t){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("observable from event triggered"),Ui(e.debugName,{color:"BlueViolet"}),...this.formatInfo(t),{data:[{fn:e._getValue}]}]))}handleAutorunCreated(e){this._isIncluded(e)&&this.changedObservablesSets.set(e,new Set)}handleAutorunDisposed(e){}handleAutorunDependencyChanged(e,t,i){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(t)}handleAutorunStarted(e){const t=this.changedObservablesSets.get(e);t&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("autorun"),Ui(e.debugName,{color:"BlueViolet"}),this.formatChanges(t),{data:[{fn:e._debugNameData.referenceFn??e._runFn}]}])),t.clear(),this.indentation++)}handleAutorunFinished(e){this.indentation--}handleBeginTransaction(e){let t=e.getDebugName();t===void 0&&(t=""),this._isIncluded(e)&&console.log(...this.textToConsoleArgs([wl("transaction"),Ui(t,{color:"BlueViolet"}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}}function ZL(n){const e=new Array,t=[];let i="";function s(o){if("length"in o)for(const a of o)a&&s(a);else"text"in o?(i+=`%c${o.text}`,e.push(o.style),o.data&&t.push(...o.data)):"data"in o&&t.push(...o.data)}s(n);const r=[i,...e];return r.push(...t),r}function vl(n){return Ui(n,{color:"black"})}function wl(n){return Ui(i9(`${n}: `,10),{color:"black",bold:!0})}function Ui(n,e={color:"black"}){function t(s){return Object.entries(s).reduce((r,[o,a])=>`${r}${o}:${a};`,"")}const i={color:e.color};return e.strikeThrough&&(i["text-decoration"]="line-through"),e.bold&&(i["font-weight"]="bold"),{text:n,style:t(i)}}function xr(n,e){switch(typeof n){case"number":return""+n;case"string":return n.length+2<=e?`"${n}"`:`"${n.substr(0,e-7)}"+...`;case"boolean":return n?"true":"false";case"undefined":return"undefined";case"object":return n===null?"null":Array.isArray(n)?e9(n,e):t9(n,e);case"symbol":return n.toString();case"function":return`[[Function${n.name?" "+n.name:""}]]`;default:return""+n}}function e9(n,e){let t="[ ",i=!0;for(const s of n){if(i||(t+=", "),t.length-5>e){t+="...";break}i=!1,t+=`${xr(s,e-t.length)}`}return t+=" ]",t}function t9(n,e){if(typeof n.toString=="function"&&n.toString!==Object.prototype.toString){const r=n.toString();return r.length<=e?r:r.substring(0,e-3)+"..."}const t=hT(n);let i=t?t+"(":"{ ",s=!0;for(const[r,o]of Object.entries(n)){if(s||(i+=", "),i.length-5>e){i+="...";break}s=!1,i+=`${r}: ${xr(o,e-i.length)}`}return i+=t?")":" }",i}function n9(n,e){let t="";for(let i=1;i<=e;i++)t+=n;return t}function i9(n,e){for(;n.length<e;)n+=" ";return n}class Jp{static createHost(e,t){return new Jp(e,t)}static createClient(e,t){return new Jp(e,t)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:r=>{const o=r,a=this._getHandler().notifications[o[0]];if(!a)throw new Error(`Unknown notification "${o[0]}"!`);a(...o[1])},handleRequest:r=>{const o=r;try{return{type:"result",value:this._getHandler().requests[o[0]](...o[1])}}catch(a){return{type:"error",value:a}}}});const i=new Proxy({},{get:(r,o)=>async(...a)=>{const l=await this._channel.sendRequest([o,a]);if(l.type==="error")throw l.value;return l.value}}),s=new Proxy({},{get:(r,o)=>(...a)=>{this._channel.sendNotification([o,a])}});this.api={notifications:s,requests:i}}}function s9(n,e){const t=globalThis;let i=[],s;const{channel:r,handler:o}=r9({sendNotification:l=>{s?s.sendNotification(l):i.push(l)}});let a;return(t.$$debugValueEditor_debugChannels??(t.$$debugValueEditor_debugChannels={}))[n]=l=>{a=e(),s=l;for(const c of i)l.sendNotification(c);return i=[],o},Jp.createClient(r,()=>{if(!a)throw new Error("Not supported");return a})}function r9(n){let e;return{channel:i=>(e=i,{sendNotification:s=>{n.sendNotification(s)},sendRequest:s=>{throw new Error("not supported")}}),handler:{handleRequest:i=>i.type==="notification"?e?.handleNotification(i.data):e?.handleRequest(i.data)}}}function L2(n,e){const t=n.split(`
|
|
88
88
|
`);for(const i of t.slice(1)){if(e&&e.test(i))continue;const s=o9(i);if(s)return s}}function o9(n){const e=n.match(/\((.*):(\d+):(\d+)\)/);if(e)return{fileName:e[1],line:parseInt(e[2]),column:parseInt(e[3]),id:n};const t=n.match(/at ([^\(\)]*):(\d+):(\d+)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:n}}class a9{constructor(){this._timeout=void 0}throttle(e,t){this._timeout===void 0&&(this._timeout=setTimeout(()=>{this._timeout=void 0,e()},t))}dispose(){this._timeout!==void 0&&clearTimeout(this._timeout)}}function wT(n,e){for(const t in e)n[t]&&typeof n[t]=="object"&&e[t]&&typeof e[t]=="object"?wT(n[t],e[t]):n[t]=e[t]}function bT(n,e){for(const t in e)e[t]===null?delete n[t]:n[t]&&typeof n[t]=="object"&&e[t]&&typeof e[t]=="object"?bT(n[t],e[t]):n[t]=e[t]}const ea=class ea{static getInstance(){return ea._instance===void 0&&(ea._instance=new ea),ea._instance}getTransactionState(){const e=[],t=[...this._activeTransactions];if(t.length===0)return;const i=t.flatMap(r=>r.debugGetUpdatingObservers()??[]).map(r=>r.observer),s=new Set;for(;i.length>0;){const r=i.shift();if(s.has(r))continue;s.add(r);const o=this._getInfo(r,a=>{s.has(a)||i.push(a)});o&&e.push(o)}return{names:t.map(r=>r.getDebugName()??"tx"),affected:e}}_getObservableInfo(e){const t=this._instanceInfos.get(e);if(!t){On(new Un("No info found"));return}return t}_getAutorunInfo(e){const t=this._instanceInfos.get(e);if(!t){On(new Un("No info found"));return}return t}_getInfo(e,t){if(e instanceof is){const i=[...e.debugGetObservers()];for(const l of i)t(l);const s=this._getObservableInfo(e);if(!s)return;const r=e.debugGetState(),o={name:e.debugName,instanceId:s.instanceId,updateCount:r.updateCount},a=[...s.changedObservables].map(l=>this._instanceInfos.get(l)?.instanceId).filter(Ii);if(r.isComputing)return{...o,type:"observable/derived",state:"updating",changedDependencies:a,initialComputation:!1};switch(r.state){case jt.initial:return{...o,type:"observable/derived",state:"noValue"};case jt.upToDate:return{...o,type:"observable/derived",state:"upToDate"};case jt.stale:return{...o,type:"observable/derived",state:"stale",changedDependencies:a};case jt.dependenciesMightHaveChanged:return{...o,type:"observable/derived",state:"possiblyStale"}}}else if(e instanceof dT){const i=this._getAutorunInfo(e);if(!i)return;const s={name:e.debugName,instanceId:i.instanceId,updateCount:i.updateCount},r=[...i.changedObservables].map(o=>this._instanceInfos.get(o).instanceId);if(e.debugGetState().isRunning)return{...s,type:"autorun",state:"updating",changedDependencies:r};switch(e.debugGetState().state){case Cn.upToDate:return{...s,type:"autorun",state:"upToDate"};case Cn.stale:return{...s,type:"autorun",state:"stale",changedDependencies:r};case Cn.dependenciesMightHaveChanged:return{...s,type:"autorun",state:"possiblyStale"}}}}_formatObservable(e){const t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof is)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};const t=this._getAutorunInfo(e);if(t)return{name:e.toString(),instanceId:t.instanceId}}constructor(){this._declarationId=0,this._instanceId=0,this._declarations=new Map,this._instanceInfos=new WeakMap,this._aliveInstances=new Map,this._activeTransactions=new Set,this._channel=s9("observableDevTools",()=>({notifications:{setDeclarationIdFilter:e=>{},logObservableValue:e=>{console.log("logObservableValue",e)},flushUpdates:()=>{this._flushUpdates()},resetUpdates:()=>{this._pendingChanges=null,this._channel.api.notifications.handleChange(this._fullState,!0)}},requests:{getDeclarations:()=>{const e={};for(const t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(i=>this._formatObserver(i)).filter(Ii)}),getDerivedInfo:e=>{const t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(i=>this._formatObservable(i)).filter(Ii),observers:[...t.debugGetObservers()].map(i=>this._formatObserver(i)).filter(Ii)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(i=>this._formatObservable(i)).filter(Ii)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{const i=this._aliveInstances.get(e);if(i instanceof is)i.debugSetValue(t);else if(i instanceof pw)i.debugSetValue(t);else if(i instanceof sa)i.debugSetValue(t);else throw new Un("Observable is not supported");const s=[...i.debugGetObservers()];for(const r of s)r.beginUpdate(i);for(const r of s)r.handleChange(i,void 0);for(const r of s)r.endUpdate(i)},getValue:e=>{const t=this._aliveInstances.get(e);if(t instanceof is)return xr(t.debugGetState().value,200);if(t instanceof pw)return xr(t.debugGetState().value,200)}}})),this._pendingChanges=null,this._changeThrottler=new a9,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)}}_handleChange(e){bT(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:wT(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e){let t=!0,i;const s=Error;for(;;){const o=s.stackTraceLimit;s.stackTraceLimit=t?6:20;const a=new Error().stack;s.stackTraceLimit=o;let l=L2(a,/[/\\]observableInternal[/\\]|\.observe|[/\\]util(s)?\./);if(!t&&!l&&(l=L2(a,/[/\\]observableInternal[/\\]|\.observe/)),l){i=l;break}if(!t){console.error("Could not find location for declaration",new Error().stack),i={fileName:"unknown",line:0,column:0,id:"unknown"};break}t=!1}let r=this._declarations.get(i.id);return r===void 0&&(r={id:this._declarationId++,type:e,url:i.fileName,line:i.line,column:i.column},this._declarations.set(i.id,r),this._handleChange({decls:{[r.id]:r}})),r.id}handleObservableCreated(e){const i={declarationId:this._getDeclarationId("observable/value"),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i)}handleOnListenerCountChanged(e,t){const i=this._getObservableInfo(e);if(i){if(i.listenerCount===0&&t>0){const s=e instanceof is?"observable/derived":"observable/value";this._aliveInstances.set(i.instanceId,e),this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,formattedValue:i.lastValue,type:s,name:e.debugName}}})}else i.listenerCount>0&&t===0&&(this._handleChange({instances:{[i.instanceId]:null}}),this._aliveInstances.delete(i.instanceId));i.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof is){this._handleDerivedRecomputed(e,t);return}const i=this._getObservableInfo(e);i&&t.didChange&&(i.lastValue=xr(t.newValue,30),i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:i.lastValue}}}))}handleAutorunCreated(e){const i={declarationId:this._getDeclarationId("autorun"),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,i),this._aliveInstances.set(i.instanceId,e),i&&this._handleChange({instances:{[i.instanceId]:{instanceId:i.instanceId,declarationId:i.declarationId,runCount:0,type:"autorun",name:e.debugName}}})}handleAutorunDisposed(e){const t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,i){const s=this._getAutorunInfo(e);s&&s.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){const t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,i){const s=this._getObservableInfo(e);s&&s.changedObservables.add(t)}_handleDerivedRecomputed(e,t){const i=this._getObservableInfo(e);if(!i)return;const s=xr(t.newValue,30);i.updateCount++,i.changedObservables.clear(),i.lastValue=s,i.listenerCount>0&&this._handleChange({instances:{[i.instanceId]:{formattedValue:s,recomputationCount:i.updateCount}}})}handleDerivedCleared(e){const t=this._getObservableInfo(e);t&&(t.lastValue=void 0,t.changedObservables.clear(),t.listenerCount>0&&this._handleChange({instances:{[t.instanceId]:{formattedValue:void 0}}}))}handleBeginTransaction(e){this._activeTransactions.add(e)}handleEndTransaction(e){this._activeTransactions.delete(e)}};ea._instance=void 0;let mw=ea;ML(XL);Ld&&Ld.VSCODE_DEV_DEBUG&&uT(mw.getInstance());class Kt{static fromTo(e,t){return new Kt(e,t)}static addRange(e,t){let i=0;for(;i<t.length&&t[i].endExclusive<e.start;)i++;let s=i;for(;s<t.length&&t[s].start<=e.endExclusive;)s++;if(i===s)t.splice(i,0,e);else{const r=Math.min(e.start,t[i].start),o=Math.max(e.endExclusive,t[s-1].endExclusive);t.splice(i,s-i,new Kt(r,o))}}static tryCreate(e,t){if(!(e>t))return new Kt(e,t)}static ofLength(e){return new Kt(0,e)}static ofStartAndLength(e,t){return new Kt(e,e+t)}static emptyAt(e){return new Kt(e,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new Un(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new Kt(this.start+e,this.endExclusive+e)}deltaStart(e){return new Kt(this.start+e,this.endExclusive)}deltaEnd(e){return new Kt(this.start,this.endExclusive+e)}get length(){return this.endExclusive-this.start}toString(){return`[${this.start}, ${this.endExclusive})`}equals(e){return this.start===e.start&&this.endExclusive===e.endExclusive}containsRange(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive}contains(e){return this.start<=e&&e<this.endExclusive}join(e){return new Kt(Math.min(this.start,e.start),Math.max(this.endExclusive,e.endExclusive))}intersect(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);if(t<=i)return new Kt(t,i)}intersectionLength(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,i-t)}intersects(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return t<i}intersectsOrTouches(e){const t=Math.max(this.start,e.start),i=Math.min(this.endExclusive,e.endExclusive);return t<=i}isBefore(e){return this.endExclusive<=e.start}isAfter(e){return this.start>=e.endExclusive}slice(e){return e.slice(this.start,this.endExclusive)}substring(e){return e.substring(this.start,this.endExclusive)}clip(e){if(this.isEmpty)throw new Un(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new Un(`Invalid clipping range: ${this.toString()}`);return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e}map(e){const t=[];for(let i=this.start;i<this.endExclusive;i++)t.push(e(i));return t}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}joinRightTouching(e){if(this.endExclusive!==e.start)throw new Un(`Invalid join: ${this.toString()} and ${e.toString()}`);return new Kt(this.start,e.endExclusive)}}const ra="**",_w="/",Jf="[/\\\\]",Xf="[^/\\\\]",l9=/\//g;function N2(n,e){switch(n){case 0:return"";case 1:return`${Xf}*?`;default:return`(?:${Jf}|${Xf}+${Jf}${e?`|${Jf}${Xf}+`:""})*?`}}function vw(n,e){if(!n)return[];const t=[];let i=!1,s=!1,r="";for(const o of n){switch(o){case e:if(!i&&!s){t.push(r),r="";continue}break;case"{":i=!0;break;case"}":i=!1;break;case"[":s=!0;break;case"]":s=!1;break}r+=o}return r&&t.push(r),t}function yT(n){if(!n)return"";let e="";const t=vw(n,_w);if(t.every(i=>i===ra))e=".*";else{let i=!1;t.forEach((s,r)=>{if(s===ra){if(i)return;e+=N2(2,r===t.length-1)}else{let o=!1,a="",l=!1,c="";for(const u of s){if(u!=="}"&&o){a+=u;continue}if(l&&(u!=="]"||!c)){let d;u==="-"?d=u:(u==="^"||u==="!")&&!c?d="^":u===_w?d="":d=Wa(u),c+=d;continue}switch(u){case"{":o=!0;continue;case"[":l=!0;continue;case"}":{const f=`(?:${vw(a,",").map(p=>yT(p)).join("|")})`;e+=f,o=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=Xf;continue;case"*":e+=N2(1);continue;default:e+=Wa(u)}}r<t.length-1&&(t[r+1]!==ra||r+2<t.length)&&(e+=Jf)}i=s===ra})}return e}const c9=/^\*\*\/\*\.[\w\.-]+$/,u9=/^\*\*\/([\w\.-]+)\/?$/,d9=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,h9=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,f9=/^\*\*((\/[\w\.-]+)+)\/?$/,p9=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,O2=new vx(1e4),F2=function(){return!1},$s=function(){return null};function zx(n,e){if(!n)return $s;let t;typeof n!="string"?t=n.pattern:t=n,t=t.trim();const i=`${t}_${!!e.trimForExclusions}`;let s=O2.get(i);if(s)return M2(s,n);let r;return c9.test(t)?s=g9(t.substr(4),t):(r=u9.exec(iv(t,e)))?s=m9(r[1],t):(e.trimForExclusions?h9:d9).test(t)?s=_9(t,e):(r=f9.exec(iv(t,e)))?s=U2(r[1].substr(1),t,!0):(r=p9.exec(iv(t,e)))?s=U2(r[1],t,!1):s=v9(t),O2.set(i,s),M2(s,n)}function M2(n,e){if(typeof e=="string")return n;const t=function(i,s){return Rp(i,e.base,!yo)?n(eR(i.substr(e.base.length),cs),s):null};return t.allBasenames=n.allBasenames,t.allPaths=n.allPaths,t.basenames=n.basenames,t.patterns=n.patterns,t}function iv(n,e){return e.trimForExclusions&&n.endsWith("/**")?n.substr(0,n.length-2):n}function g9(n,e){return function(t,i){return typeof t=="string"&&t.endsWith(n)?e:null}}function m9(n,e){const t=`/${n}`,i=`\\${n}`,s=function(o,a){return typeof o!="string"?null:a?a===n?e:null:o===n||o.endsWith(t)||o.endsWith(i)?e:null},r=[n];return s.basenames=r,s.patterns=[e],s.allBasenames=r,s}function _9(n,e){const t=xT(n.slice(1,-1).split(",").map(a=>zx(a,e)).filter(a=>a!==$s),n),i=t.length;if(!i)return $s;if(i===1)return t[0];const s=function(a,l){for(let c=0,u=t.length;c<u;c++)if(t[c](a,l))return n;return null},r=t.find(a=>!!a.allBasenames);r&&(s.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function U2(n,e,t){const i=cs===ct.sep,s=i?n:n.replace(l9,cs),r=cs+s,o=ct.sep+n;let a;return t?a=function(l,c){return typeof l=="string"&&(l===s||l.endsWith(r)||!i&&(l===n||l.endsWith(o)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===s||!i&&l===n)?e:null},a.allPaths=[(t?"*/":"./")+n],a}function v9(n){try{const e=new RegExp(`^${yT(n)}$`);return function(t){return e.lastIndex=0,typeof t=="string"&&e.test(t)?n:null}}catch{return $s}}function sd(n,e,t){return!n||typeof e!="string"?!1:Uc(n)(e,void 0,t)}function Uc(n,e={}){if(!n)return F2;if(typeof n=="string"||w9(n)){const t=zx(n,e);if(t===$s)return F2;const i=function(s,r){return!!t(s,r)};return t.allBasenames&&(i.allBasenames=t.allBasenames),t.allPaths&&(i.allPaths=t.allPaths),i}return b9(n,e)}function w9(n){const e=n;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function b9(n,e){const t=xT(Object.getOwnPropertyNames(n).map(a=>y9(a,n[a],e)).filter(a=>a!==$s)),i=t.length;if(!i)return $s;if(!t.some(a=>!!a.requiresSiblings)){if(i===1)return t[0];const a=function(u,d){let f;for(let p=0,_=t.length;p<_;p++){const w=t[p](u,d);if(typeof w=="string")return w;xo(w)&&(f||(f=[]),f.push(w))}return f?(async()=>{for(const p of f){const _=await p;if(typeof _=="string")return _}return null})():null},l=t.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=t.reduce((u,d)=>d.allPaths?u.concat(d.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const s=function(a,l,c){let u,d;for(let f=0,p=t.length;f<p;f++){const _=t[f];_.requiresSiblings&&c&&(l||(l=hi(a)),u||(u=l.substr(0,l.length-Ip(a).length)));const w=_(a,l,u,c);if(typeof w=="string")return w;xo(w)&&(d||(d=[]),d.push(w))}return d?(async()=>{for(const f of d){const p=await f;if(typeof p=="string")return p}return null})():null},r=t.find(a=>!!a.allBasenames);r&&(s.allBasenames=r.allBasenames);const o=t.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(s.allPaths=o),s}function y9(n,e,t){if(e===!1)return $s;const i=zx(n,t);if(i===$s)return $s;if(typeof e=="boolean")return i;if(e){const s=e.when;if(typeof s=="string"){const r=(o,a,l,c)=>{if(!c||!i(o,a))return null;const u=s.replace("$(basename)",()=>l),d=c(u);return xo(d)?d.then(f=>f?n:null):d?n:null};return r.requiresSiblings=!0,r}}return i}function xT(n,e){const t=n.filter(a=>!!a.basenames);if(t.length<2)return n;const i=t.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let s;if(e){s=[];for(let a=0,l=i.length;a<l;a++)s.push(e)}else s=t.reduce((a,l)=>{const c=l.patterns;return c?a.concat(c):a},[]);const r=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const d=a.charCodeAt(u-1);if(d===R.Slash||d===R.Backslash)break}l=a.substr(u)}const c=i.indexOf(l);return c!==-1?s[c]:null};r.basenames=i,r.patterns=s,r.allBasenames=i;const o=n.filter(a=>!a.basenames);return o.push(r),o}const ww=["W","X","Y","Z","a","b","c","d","e","f"],x9=new RegExp(`^[${ww.join("")}]+`),ET=7;function ST(n){if(n.scheme!==le.vscodeNotebookCell)return;const e=n.fragment.indexOf("s");if(e<0)return;const t=parseInt(n.fragment.substring(0,e).replace(x9,""),ET),i=Pc(n.fragment.substring(e+1)).toString();if(!isNaN(t))return{handle:t,notebook:n.with({scheme:i,fragment:null})}}function E9(n,e){const t=e.toString(ET),s=`${t.length<ww.length?ww[t.length-1]:"z"}${t}s${j1(ue.fromString(n.scheme),!0,!0)}`;return n.with({scheme:le.vscodeNotebookCell,fragment:s})}function S9(n){if(n.scheme!==le.vscodeNotebookMetadata)return;const e=Pc(n.fragment).toString();return n.with({scheme:e,fragment:null})}function k9(n){const e=`${j1(ue.fromString(n.scheme),!0,!0)}`;return n.with({scheme:le.vscodeNotebookMetadata,fragment:e})}function D9(n){if(n.scheme!==le.vscodeNotebookCellOutput)return;const e=new URLSearchParams(n.query),t=e.get("openIn");if(!t)return;const i=e.get("outputId")??void 0,s=ST(n.with({scheme:le.vscodeNotebookCell,query:null})),r=e.get("outputIndex")?parseInt(e.get("outputIndex")||"",10):void 0,o=s?s.notebook:n.with({scheme:e.get("notebookScheme")||le.file,fragment:null,query:null}),a=e.get("cellIndex")?parseInt(e.get("cellIndex")||"",10):void 0;return{notebook:o,openIn:t,outputId:i,outputIndex:r,cellHandle:s?.handle,cellFragment:n.fragment,cellIndex:a}}var Ml;(function(n){n[n.Markup=1]="Markup",n[n.Code=2]="Code"})(Ml||(Ml={}));Us.latex,Us.markdown,Us.text;Us.latex,Us.markdown,Us.text;var $2;(function(n){n[n.Running=1]="Running",n[n.Idle=2]="Idle"})($2||($2={}));var H2;(function(n){n[n.Unconfirmed=1]="Unconfirmed",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing"})(H2||(H2={}));var B2;(function(n){n[n.Unconfirmed=1]="Unconfirmed",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing"})(B2||(B2={}));var W2;(function(n){n[n.WithHardKernelDependency=0]="WithHardKernelDependency",n[n.WithOptionalKernelDependency=1]="WithOptionalKernelDependency",n[n.Pure=2]="Pure",n[n.Never=3]="Never"})(W2||(W2={}));var V2;(function(n){n.Always="always",n.Never="never",n.Optional="optional"})(V2||(V2={}));var Gi;(function(n){n[n.ModelChange=1]="ModelChange",n[n.Move=2]="Move",n[n.ChangeCellLanguage=5]="ChangeCellLanguage",n[n.Initialize=6]="Initialize",n[n.ChangeCellMetadata=7]="ChangeCellMetadata",n[n.Output=8]="Output",n[n.OutputItem=9]="OutputItem",n[n.ChangeCellContent=10]="ChangeCellContent",n[n.ChangeDocumentMetadata=11]="ChangeDocumentMetadata",n[n.ChangeCellInternalMetadata=12]="ChangeCellInternalMetadata",n[n.ChangeCellMime=13]="ChangeCellMime",n[n.Unknown=100]="Unknown"})(Gi||(Gi={}));var z2;(function(n){n[n.Handle=0]="Handle",n[n.Index=1]="Index"})(z2||(z2={}));var _o;(function(n){n[n.Replace=1]="Replace",n[n.Output=2]="Output",n[n.Metadata=3]="Metadata",n[n.CellLanguage=4]="CellLanguage",n[n.DocumentMetadata=5]="DocumentMetadata",n[n.Move=6]="Move",n[n.OutputItems=7]="OutputItems",n[n.PartialMetadata=8]="PartialMetadata",n[n.PartialInternalMetadata=9]="PartialInternalMetadata"})(_o||(_o={}));var q2;(function(n){n.scheme=le.vscodeNotebookMetadata;function e(i){return k9(i)}n.generate=e;function t(i){return S9(i)}n.parse=t})(q2||(q2={}));var Xp;(function(n){n.scheme=le.vscodeNotebookCell;function e(c,u){return E9(c,u)}n.generate=e;function t(c){return ST(c)}n.parse=t;function i(c,u){return c.with({scheme:le.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"editor",outputId:u??"",notebookScheme:c.scheme!==le.file?c.scheme:""}).toString()})}n.generateCellOutputUriWithId=i;function s(c,u,d){return c.with({scheme:le.vscodeNotebookCellOutput,fragment:u.fragment,query:new URLSearchParams({openIn:"notebook",outputIndex:String(d)}).toString()})}n.generateCellOutputUriWithIndex=s;function r(c,u,d,f,p){return c.with({scheme:le.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:"notebookOutputEditor",notebook:c.toString(),cellIndex:String(d),outputId:f,outputIndex:String(p)}).toString()})}n.generateOutputEditorUri=r;function o(c){return D9(c)}n.parseCellOutputUri=o;function a(c,u,d){return n.generate(c,u).with({scheme:d})}n.generateCellPropertyUri=a;function l(c,u){if(c.scheme===u)return n.parse(c.with({scheme:n.scheme}))}n.parseCellPropertyUri=l})(Xp||(Xp={}));new P("notebookEditorCursorAtBoundary","none");new P("notebookEditorCursorAtLineBoundary","none");var j2;(function(n){n.default="default",n.option="option"})(j2||(j2={}));var G2;(function(n){n.Cells="cells",n.Text="text",n.None="none"})(G2||(G2={}));var Yp;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(Yp||(Yp={}));function kT(n){return["application/vnd.code.notebook.stdout","application/vnd.code.notebook.stderr"].includes(n)}const I9=new TextDecoder;function C9(n){const e=[];let t=!1;for(const o of n)(e.length===0||t)&&(e.push(o),t=!0);let i=P9(e);const s=ue.concat(e.map(o=>ue.wrap(o))),r=O9(s);return i=i||r.byteLength!==s.byteLength,{data:r,didCompression:i}}const Yf="\x1B[A",sv=Yf.split("").map(n=>n.charCodeAt(0)),T9=10;function P9(n){let e=!1;return n.forEach((t,i)=>{if(i===0||t.length<Yf.length)return;const s=n[i-1],r=t.subarray(0,Yf.length);if(r[0]===sv[0]&&r[1]===sv[1]&&r[2]===sv[2]){const o=s.lastIndexOf(T9);if(o===-1)return;e=!0,n[i-1]=s.subarray(0,o),n[i]=t.subarray(Yf.length)}}),e}function A9(n){let e=n;do n=e,e=n.replace(/[^\n]\x08/gm,"");while(e.length<n.length);return n}function R9(n){for(n=n.replace(/\r+\n/gm,`
|
|
89
89
|
`);n.search(/\r[^$]/g)>-1;){const e=n.match(/^(.*)\r+/m)[1];let t=n.match(/\r+(.*)$/m)[1];t=t+e.slice(t.length,e.length),n=n.replace(/\r+.*$/m,"\r").replace(/^.*\r/m,t)}return n}const L9=8,N9=13;function O9(n){return!n.buffer.includes(L9)&&!n.buffer.includes(N9)?n:ue.fromString(R9(A9(I9.decode(n.buffer))))}const r_=pe("contextKeyService"),F9=pe("productService");var Zt;(function(n){n[n.APPLICATION=1]="APPLICATION",n[n.USER=2]="USER",n[n.USER_LOCAL=3]="USER_LOCAL",n[n.USER_REMOTE=4]="USER_REMOTE",n[n.WORKSPACE=5]="WORKSPACE",n[n.WORKSPACE_FOLDER=6]="WORKSPACE_FOLDER",n[n.DEFAULT=7]="DEFAULT",n[n.MEMORY=8]="MEMORY"})(Zt||(Zt={}));function bw(n,e){const t=Object.create(null);for(const i in n)DT(t,i,n[i],e);return t}function DT(n,e,t,i){const s=e.split("."),r=s.pop();let o=n;for(let a=0;a<s.length;a++){const l=s[a];let c=o[l];switch(typeof c){case"undefined":c=o[l]=Object.create(null);break;case"object":if(c===null){i(`Ignoring ${e} as ${s.slice(0,a+1).join(".")} is null`);return}break;default:i(`Ignoring ${e} as ${s.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}o=c}if(typeof o=="object"&&o!==null)try{o[r]=t}catch{i(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(o)}`)}else i(`Ignoring ${e} as ${s.join(".")} is ${JSON.stringify(o)}`)}function M9(n,e){const t=e.split(".");IT(n,t)}function IT(n,e){if(!n)return;const t=e.shift();if(e.length===0){delete n[t];return}if(Object.keys(n).indexOf(t)!==-1){const i=n[t];typeof i=="object"&&!Array.isArray(i)&&(IT(i,e),Object.keys(i).length===0&&delete n[t])}}function Zp(n,e,t){function i(o,a){let l=o;for(const c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}const s=e.split("."),r=i(n,s);return typeof r>"u"?t:r}function U9(n){return n.replace(/[\[\]]/g,"")}function $9(n){let e=!1;const t=new Map,i=new Map;if(H9(n,u=>{if(n===u)return!0;const d=JSON.stringify(u);if(d.length<30)return!0;const f=t.get(d);if(!f){const p={schemas:[u]};return t.set(d,p),i.set(u,p),!0}return f.schemas.push(u),i.set(u,f),e=!0,!1}),t.clear(),!e)return JSON.stringify(n);let r="$defs";for(;n.hasOwnProperty(r);)r+="_";const o=[];function a(u){return JSON.stringify(u,(d,f)=>{if(f!==u){const p=i.get(f);if(p&&p.schemas.length>1)return p.id||(p.id=`_${o.length}`,o.push(p.schemas[0])),{$ref:`#/${r}/${p.id}`}}return f})}const l=a(n),c=[];for(let u=0;u<o.length;u++)c.push(`"_${u}":${a(o[u])}`);return c.length?`${l.substring(0,l.length-1)},"${r}":{${c.join(",")}}}`:l}function bl(n){return typeof n=="object"&&n!==null}function H9(n,e){if(!n||typeof n!="object")return;const t=(...l)=>{for(const c of l)bl(c)&&o.push(c)},i=(...l)=>{for(const c of l)if(bl(c))for(const u in c){const d=c[u];bl(d)&&o.push(d)}},s=(...l)=>{for(const c of l)if(Array.isArray(c))for(const u of c)bl(u)&&o.push(u)},r=l=>{if(Array.isArray(l))for(const c of l)bl(c)&&o.push(c);else bl(l)&&o.push(l)},o=[n];let a=o.pop();for(;a;)e(a)&&(t(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),i(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),s(a.anyOf,a.allOf,a.oneOf,a.prefixItems),r(a.items)),a=o.pop()}const o_={JSONContribution:"base.contributions.json"};function K2(n){return n.length>0&&n.charAt(n.length-1)==="#"?n.substring(0,n.length-1):n}class B9 extends Se{constructor(){super(...arguments),this.schemasById={},this.schemaAssociations={},this._onDidChangeSchema=this._register(new N),this.onDidChangeSchema=this._onDidChangeSchema.event,this._onDidChangeSchemaAssociations=this._register(new N),this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(e,t,i){const s=K2(e);this.schemasById[s]=t,this._onDidChangeSchema.fire(e),i&&i.add(we(()=>{delete this.schemasById[s],this._onDidChangeSchema.fire(e)}))}registerSchemaAssociation(e,t){const i=K2(e);return this.schemaAssociations[i]||(this.schemaAssociations[i]=[]),this.schemaAssociations[i].includes(t)||(this.schemaAssociations[i].push(t),this._onDidChangeSchemaAssociations.fire()),we(()=>{const s=this.schemaAssociations[i];if(s){const r=s.indexOf(t);r!==-1&&(s.splice(r,1),s.length===0&&delete this.schemaAssociations[i],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){const t=this.schemasById[e];return t?$9(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}getSchemaAssociations(){return this.schemaAssociations}}const W9=new B9;mn.add(o_.JSONContribution,W9);var Q2;(function(n){n.Multiline="multilineText",n.Singleline="singlelineText"})(Q2||(Q2={}));const ll={Configuration:"base.contributions.configuration"};var bt;(function(n){n[n.APPLICATION=1]="APPLICATION",n[n.MACHINE=2]="MACHINE",n[n.APPLICATION_MACHINE=3]="APPLICATION_MACHINE",n[n.WINDOW=4]="WINDOW",n[n.RESOURCE=5]="RESOURCE",n[n.LANGUAGE_OVERRIDABLE=6]="LANGUAGE_OVERRIDABLE",n[n.MACHINE_OVERRIDABLE=7]="MACHINE_OVERRIDABLE"})(bt||(bt={}));const yl="vscode://schemas/settings/resourceLanguage",Df=mn.as(o_.JSONContribution);class V9 extends Se{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new N),this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=this._register(new N),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:h(1713,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Df.registerSchema(yl,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){const i=new Set;this.doRegisterConfigurations(e,t,i),Df.registerSchema(yl,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}deregisterConfigurations(e){const t=new Set;this.doDeregisterConfigurations(e,t),Df.registerSchema(yl,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){const i=new Set;this.doDeregisterConfigurations(t,i),this.doRegisterConfigurations(e,!1,i),Df.registerSchema(yl,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i})}registerDefaultConfigurations(e){const t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);const i=[];for(const{overrides:s,source:r}of e)for(const o in s){t.add(o);const a=this.configurationDefaultsOverrides.get(o)??this.configurationDefaultsOverrides.set(o,{configurationDefaultOverrides:[]}).get(o),l=s[o];if(a.configurationDefaultOverrides.push({value:l,source:r}),Hs.test(o)){const c=this.mergeDefaultConfigurationsForOverrideIdentifier(o,l,r,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c,this.updateDefaultOverrideProperty(o,c,r),i.push(...Wd(o))}else{const c=this.mergeDefaultConfigurationsForConfigurationProperty(o,l,r,a.configurationDefaultOverrideValue);if(!c)continue;a.configurationDefaultOverrideValue=c;const u=this.configurationProperties[o];u&&(this.updatePropertyDefaultValue(o,u),this.updateSchema(o,u))}}this.doRegisterOverrideIdentifiers(i)}deregisterDefaultConfigurations(e){const t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(const i of e){const s=this.registeredConfigurationDefaults.indexOf(i);s!==-1&&this.registeredConfigurationDefaults.splice(s,1)}for(const{overrides:i,source:s}of e)for(const r in i){const o=this.configurationDefaultsOverrides.get(r);if(!o)continue;const a=o.configurationDefaultOverrides.findIndex(l=>s?l.source?.id===s.id:l.value===i[r]);if(a!==-1){if(o.configurationDefaultOverrides.splice(a,1),o.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(r),Hs.test(r)){let l;for(const c of o.configurationDefaultOverrides)l=this.mergeDefaultConfigurationsForOverrideIdentifier(r,c.value,c.source,l);l&&!j4(l.value)?(o.configurationDefaultOverrideValue=l,this.updateDefaultOverrideProperty(r,l,s)):(this.configurationDefaultsOverrides.delete(r),delete this.configurationProperties[r],delete this.defaultLanguageConfigurationOverridesNode.properties[r])}else{let l;for(const u of o.configurationDefaultOverrides)l=this.mergeDefaultConfigurationsForConfigurationProperty(r,u.value,u.source,l);o.configurationDefaultOverrideValue=l;const c=this.configurationProperties[r];c&&(this.updatePropertyDefaultValue(r,c),this.updateSchema(r,c))}t.add(r)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,t,i){const s={type:"object",default:t.value,description:h(1714,"Configure settings to be overridden for the {0} language.",U9(e)),$ref:yl,defaultDefaultValue:t.value,source:i,defaultValueSource:i};this.configurationProperties[e]=s,this.defaultLanguageConfigurationOverridesNode.properties[e]=s}mergeDefaultConfigurationsForOverrideIdentifier(e,t,i,s){const r=s?.value||{},o=s?.source??new Map;if(!(o instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const a of Object.keys(t)){const l=t[a];if(nn(l)&&(Mu(r[a])||nn(r[a]))){if(r[a]={...r[a]??{},...l},i)for(const u in l)o.set(`${a}.${u}`,i)}else r[a]=l,i?o.set(a,i):o.delete(a)}return{value:r,source:o}}mergeDefaultConfigurationsForConfigurationProperty(e,t,i,s){const r=this.configurationProperties[e],o=s?.value??r?.defaultDefaultValue;let a=i;if(nn(t)&&(r!==void 0&&r.type==="object"||r===void 0&&(Mu(o)||nn(o)))){if(a=s?.source??new Map,!(a instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const c in t)i&&a.set(`${e}.${c}`,i);t={...nn(o)?o:{},...t}}return{value:t,source:a}}deltaConfiguration(e){let t=!1;const i=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,i),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,i),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,i),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,i),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:i,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(const t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,i){e.forEach(s=>{this.validateAndRegisterProperties(s,t,s.extensionInfo,s.restrictedProperties,void 0,i),this.configurationContributors.push(s),this.registerJSONConfiguration(s)})}doDeregisterConfigurations(e,t){const i=s=>{if(s.properties)for(const r in s.properties){t.add(r);const o=this.configurationProperties[r];o?.policy?.name&&this.policyConfigurations.delete(o.policy.name),delete this.configurationProperties[r],this.removeFromSchema(r,s.properties[r])}s.allOf?.forEach(r=>i(r))};for(const s of e){i(s);const r=this.configurationContributors.indexOf(s);r!==-1&&this.configurationContributors.splice(r,1)}}validateAndRegisterProperties(e,t=!0,i,s,r=bt.WINDOW,o){r=tn(e.scope)?r:e.scope;const a=e.properties;if(a)for(const c in a){const u=a[c];if(t&&j9(c,u)){delete a[c];continue}u.source=i,u.defaultDefaultValue=a[c].default,this.updatePropertyDefaultValue(c,u),Hs.test(c)?u.scope=void 0:(u.scope=tn(u.scope)?r:u.scope,u.restricted=tn(u.restricted)?!!s?.includes(c):u.restricted);const d=a[c].hasOwnProperty("included")&&!a[c].included,f=a[c].policy?.name;d?(this.excludedConfigurationProperties[c]=a[c],f&&(this.policyConfigurations.set(f,c),o.add(c)),delete a[c]):(o.add(c),f&&this.policyConfigurations.set(f,c),this.configurationProperties[c]=a[c],!a[c].deprecationMessage&&a[c].markdownDeprecationMessage&&(a[c].deprecationMessage=a[c].markdownDeprecationMessage))}const l=e.allOf;if(l)for(const c of l)this.validateAndRegisterProperties(c,t,i,s,r,o)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){const e=new Map;for(const[t,i]of this.configurationDefaultsOverrides)i.configurationDefaultOverrideValue&&e.set(t,i.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){const t=i=>{const s=i.properties;if(s)for(const o in s)this.updateSchema(o,s[o]);i.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(t.scope){case bt.APPLICATION:break;case bt.MACHINE:break;case bt.APPLICATION_MACHINE:break;case bt.MACHINE_OVERRIDABLE:break;case bt.WINDOW:break;case bt.RESOURCE:break;case bt.LANGUAGE_OVERRIDABLE:this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(t.scope){case bt.APPLICATION:break;case bt.MACHINE:break;case bt.APPLICATION_MACHINE:break;case bt.MACHINE_OVERRIDABLE:break;case bt.WINDOW:break;case bt.RESOURCE:case bt.LANGUAGE_OVERRIDABLE:delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:h(1715,"Configure editor settings to be overridden for a language."),errorMessage:h(1716,"This setting does not support per-language configuration."),$ref:yl};this.updatePropertyDefaultValue(t,i)}}registerOverridePropertyPatternKey(){h(1715,"Configure editor settings to be overridden for a language."),h(1716,"This setting does not support per-language configuration."),this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue;let s,r;i&&(!t.disallowConfigurationDefault||!i.source)&&(s=i.value,r=i.source),Mu(s)&&(s=t.defaultDefaultValue,r=void 0),Mu(s)&&(s=q9(t.type)),t.default=s,t.defaultValueSource=r}}const CT="\\[([^\\]]+)\\]",J2=new RegExp(CT,"g"),z9=`^(${CT})+$`,Hs=new RegExp(z9);function Wd(n){const e=[];if(Hs.test(n)){let t=J2.exec(n);for(;t?.length;){const i=t[1].trim();i&&e.push(i),t=J2.exec(n)}}return Il(e)}function q9(n){switch(Array.isArray(n)?n[0]:n){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}const Zf=new V9;mn.add(ll.Configuration,Zf);function j9(n,e){return n.trim()?Hs.test(n)?h(1718,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",n):Zf.getConfigurationProperties()[n]!==void 0?h(1719,"Cannot register '{0}'. This property is already registered.",n):e.policy?.name&&Zf.getPolicyConfigurations().get(e.policy?.name)!==void 0?h(1720,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",n,e.policy?.name,Zf.getPolicyConfigurations().get(e.policy?.name)):null:h(1717,"Cannot register an empty property")}function G9(n){return n.res.statusCode&&n.res.statusCode>=200&&n.res.statusCode<300||n.res.statusCode===1223}function K9(n){return n.res.statusCode===204}async function Q9(n){if(!G9(n))throw new Error("Server returned "+n.res.statusCode);if(K9(n))return null;const t=(await eA(n.stream)).toString();try{return JSON.parse(t)}catch(i){throw i.message+=`:
|
|
90
|
-
`+t,i}}let rv=[],X2,Y2;function J9(n=!0,e=!0){if(X2===n&&Y2===e)return;X2=n,Y2=e;const t=mn.as(ll.Configuration),i=rv;rv=[{id:"http",order:15,title:h(1975,"HTTP"),type:"object",scope:bt.MACHINE,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:e,markdownDescription:h(1976,"Controls whether in the remote extension host the local proxy configuration should be used. This setting only applies as a remote setting during [remote development](https://aka.ms/vscode-remote)."),restricted:!0}}},{id:"http",order:15,title:h(1975,"HTTP"),type:"object",scope:bt.APPLICATION,properties:{"http.electronFetch":{type:"boolean",default:!1,description:h(1977,"Controls whether use of Electron's fetch implementation instead of Node.js' should be enabled. All local extensions will get Electron's fetch implementation for the global fetch API."),restricted:!0}}},{id:"http",order:15,title:h(1975,"HTTP"),type:"object",scope:n?bt.APPLICATION:bt.MACHINE,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:h(1978,"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:h(1979,"Controls whether the proxy server certificate should be verified against the list of supplied CAs. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:h(1980,"Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:h(1981,"Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:h(1982,"The value to send as the `Proxy-Authorization` header for every network request. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[h(1983,"Disable proxy support for extensions."),h(1984,"Enable proxy support for extensions."),h(1985,"Enable proxy support for extensions, fall back to request options, when no proxy found."),h(1986,"Enable proxy support for extensions, override request options.")],default:"override",markdownDescription:h(1987,"Use the proxy support for extensions. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:h(1988,"Controls whether CA certificates should be loaded from the OS. On Windows and macOS, a reload of the window is required after turning this off. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:h(1989,"Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implementation. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:h(1990,"Controls whether Node.js' fetch implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0}}}],t.updateConfigurations({add:rv,remove:i})}J9();const X9=pe("requestService");var rd;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(rd||(rd={}));var Ki;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Ki||(Ki={}));const m1=class m1 extends Se{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Ep),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Ki.None,this.cache=new Map,this.flushDelayer=this._register(new FR(m1.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Ki.Closed)return;let i=!1;tn(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===Ki.None&&(this.state=Ki.Initialized,this.options.hint!==rd.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return tn(i)?t:i}getBoolean(e,t){const i=this.get(e);return tn(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return tn(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return tn(i)?t:nT(i)}async set(e,t,i=!1){if(this.state===Ki.Closed)return;if(tn(t))return this.delete(e,i);const s=nn(t)||Array.isArray(t)?u7(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Ki.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}async optimize(){if(this.state!==Ki.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=Ki.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===Ki.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===rd.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===rd.STORAGE_IN_MEMORY}};m1.DEFAULT_FLUSH_DELAY=100;let Z2=m1;function Vd(n){return qx(n,0)}function qx(n,e){switch(typeof n){case"object":return n===null?Er(349,e):Array.isArray(n)?Z9(n,e):e6(n,e);case"string":return jx(n,e);case"boolean":return Y9(n,e);case"number":return Er(n,e);case"undefined":return Er(937,e);default:return Er(617,e)}}function Er(n,e){return(e<<5)-e+n|0}function Y9(n,e){return Er(n?433:863,e)}function jx(n,e){e=Er(149417,e);for(let t=0,i=n.length;t<i;t++)e=Er(n.charCodeAt(t),e);return e}function Z9(n,e){return e=Er(104579,e),n.reduce((t,i)=>qx(i,t),e)}function e6(n,e){return e=Er(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=jx(i,t),qx(n[i],t)),e)}var ek;(function(n){n[n.BLOCK_SIZE=64]="BLOCK_SIZE",n[n.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(ek||(ek={}));const t6=pe("environmentService"),TT=pe("fileService"),PT=pe("IUriIdentityService");var tk;(function(n){n.Settings="settings",n.Keybindings="keybindings",n.Snippets="snippets",n.Prompts="prompts",n.Tasks="tasks",n.Extensions="extensions",n.GlobalState="globalState"})(tk||(tk={}));function n6(n){const e=n;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&typeof e.isDefault=="boolean"&&typeof e.name=="string"&&x.isUri(e.location)&&x.isUri(e.globalStorageHome)&&x.isUri(e.settingsResource)&&x.isUri(e.keybindingsResource)&&x.isUri(e.tasksResource)&&x.isUri(e.snippetsHome)&&x.isUri(e.promptsHome)&&x.isUri(e.extensionsResource))}function If(n,e,t,i,s,r){return{id:n,name:e,location:t,isDefault:!1,icon:s?.icon,globalStorageHome:r&&s?.useDefaultFlags?.globalState?r.globalStorageHome:An(t,"globalStorage"),settingsResource:r&&s?.useDefaultFlags?.settings?r.settingsResource:An(t,"settings.json"),keybindingsResource:r&&s?.useDefaultFlags?.keybindings?r.keybindingsResource:An(t,"keybindings.json"),tasksResource:r&&s?.useDefaultFlags?.tasks?r.tasksResource:An(t,"tasks.json"),snippetsHome:r&&s?.useDefaultFlags?.snippets?r.snippetsHome:An(t,"snippets"),promptsHome:r&&s?.useDefaultFlags?.prompts?r.promptsHome:An(t,"prompts"),extensionsResource:r&&s?.useDefaultFlags?.extensions?r.extensionsResource:An(t,"extensions.json"),cacheHome:An(i,n),useDefaultFlags:s?.useDefaultFlags,isTransient:s?.transient,workspaces:s?.workspaces}}var Na;let nk=(Na=class extends Se{get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}constructor(e,t,i,s){super(),this.environmentService=e,this.fileService=t,this.uriIdentityService=i,this.logService=s,this._onDidChangeProfiles=this._register(new N),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this._onWillCreateProfile=this._register(new N),this.onWillCreateProfile=this._onWillCreateProfile.event,this._onWillRemoveProfile=this._register(new N),this.onWillRemoveProfile=this._onWillRemoveProfile.event,this._onDidResetWorkspaces=this._register(new N),this.onDidResetWorkspaces=this._onDidResetWorkspaces.event,this.profileCreationPromises=new Map,this.transientProfilesObject={profiles:[],emptyWindows:new Map},this.profilesHome=An(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=An(this.environmentService.cacheHome,"CachedProfilesData")}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){const e=this.createDefaultProfile(),t=[e];try{for(const s of this.getStoredProfiles()){if(!s.name||!it(s.name)||!s.location){this.logService.warn("Skipping the invalid stored profile",s.location||s.name);continue}t.push(If(Ks(s.location),s.name,s.location,this.profilesCacheHome,{icon:s.icon,useDefaultFlags:s.useDefaultFlags},e))}}catch(s){this.logService.error(s)}const i=new Map;if(t.length)try{const s=this.getStoredProfileAssociations();if(s.workspaces)for(const[r,o]of Object.entries(s.workspaces)){const a=x.parse(r),l=t.find(c=>c.id===o);if(l){const c=l.workspaces?l.workspaces.slice(0):[];c.push(a),l.workspaces=c}}if(s.emptyWindows)for(const[r,o]of Object.entries(s.emptyWindows)){const a=t.find(l=>l.id===o);a&&i.set(r,a)}}catch(s){this.logService.error(s)}this._profilesObject={profiles:t,emptyWindows:i}}return this._profilesObject}createDefaultProfile(){const e=If("__default__profile__",h(2368,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Wa(t)}\\s(\\d+)`);let s=0;for(const o of this.profiles){const a=i.exec(o.name),l=a?parseInt(a[1]):0;s=l>s?l:s}const r=`${t} ${s+1}`;return this.createProfile(Vd(Sn()).toString(16),r,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Vd(Sn()).toString(16),e,t,i)}async createProfile(e,t,i,s){return await this.doCreateProfile(e,t,i,s)}async doCreateProfile(e,t,i,s){if(!it(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let r=this.profileCreationPromises.get(t);return r||(r=(async()=>{try{if(this.profiles.find(u=>u.id===e||!u.isTransient&&!i?.transient&&u.name===t))throw new Error(`Profile with ${t} name already exists`);const a=s?this.getWorkspace(s):void 0;x.isUri(a)&&(i={...i,workspaces:[a]});const l=If(e,t,An(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(l.location);const c=[];return this._onWillCreateProfile.fire({profile:l,join(u){c.push(u)}}),await Lc.settled(c),a&&!x.isUri(a)&&this.updateEmptyWindowAssociation(a,l,!!l.isTransient),this.updateProfiles([l],[],[]),l}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,r)),r}async updateProfile(e,t){const i=[];for(const r of this.profiles){let o;if(e.id===r.id)r.isDefault?t.workspaces&&(o=r,o.workspaces=t.workspaces):o=If(r.id,t.name??r.name,r.location,this.profilesCacheHome,{icon:t.icon===null?void 0:t.icon??r.icon,transient:t.transient??r.isTransient,useDefaultFlags:t.useDefaultFlags??r.useDefaultFlags,workspaces:t.workspaces??r.workspaces},this.defaultProfile);else if(t.workspaces){const a=r.workspaces?.filter(l=>!t.workspaces?.some(c=>this.uriIdentityService.extUri.isEqual(l,c)));r.workspaces?.length!==a?.length&&(o=r,o.workspaces=a)}o&&i.push(o)}if(!i.length)throw e.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],i);const s=this.profiles.find(r=>r.id===e.id);if(!s)throw new Error(`Profile '${e.name}' was not updated`);return s}async removeProfile(e){if(e.isDefault)throw new Error("Cannot remove default profile");const t=this.profiles.find(s=>s.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(s){i.push(s)}});try{await Promise.allSettled(i)}catch(s){this.logService.error(s)}this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(s){l8(s)!==Si.FILE_NOT_FOUND&&this.logService.error(s)}}async setProfileForWorkspace(e,t){const i=this.profiles.find(r=>r.id===t.id);if(!i)throw new Error(`Profile '${t.name}' does not exist`);const s=this.getWorkspace(e);if(x.isUri(s)){const r=i.workspaces?[...i.workspaces]:[];r.some(o=>this.uriIdentityService.extUri.isEqual(o,s))||(r.push(s),await this.updateProfile(i,{workspaces:r}))}else this.updateEmptyWindowAssociation(s,i,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,t=!1){const i=this.getWorkspace(e);if(x.isUri(i)){const s=this.getProfileForWorkspace(e);s&&this.updateProfile(s,{workspaces:s.workspaces?.filter(r=>!this.uriIdentityService.extUri.isEqual(r,i))})}else this.updateEmptyWindowAssociation(i,void 0,t),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(const e of this.profiles)e.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){if(await this.fileService.exists(this.profilesHome)){const e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(t=>t.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,t.resource))).map(t=>this.fileService.del(t.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){const e=this.transientProfilesObject.profiles.filter(t=>!this.isProfileAssociatedToWorkspace(t));await Promise.allSettled(e.map(t=>this.removeProfile(t)))}getProfileForWorkspace(e){const t=this.getWorkspace(e);return x.isUri(t)?this.profiles.find(i=>i.workspaces?.some(s=>this.uriIdentityService.extUri.isEqual(s,t))):this.profilesObject.emptyWindows.get(t)??this.transientProfilesObject.emptyWindows.get(t)}getWorkspace(e){return u8(e)?e.uri:d8(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!(e.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const s=[...this.profiles,...e],r=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];const o=[];for(let a of s){if(t.some(l=>a.id===l.id)){for(const l of[...this.profilesObject.emptyWindows.keys()])a.id===this.profilesObject.emptyWindows.get(l)?.id&&this.profilesObject.emptyWindows.delete(l);continue}if(!a.isDefault){a=i.find(c=>a.id===c.id)??a;const l=r.find(c=>a.id===c.id);if(a.isTransient)this.transientProfilesObject.profiles.push(a);else if(l){for(const[c,u]of this.transientProfilesObject.emptyWindows.entries())if(a.id===u.id){this.transientProfilesObject.emptyWindows.delete(c),this.profilesObject.emptyWindows.set(c,a);break}}}a.workspaces?.length===0&&(a.workspaces=void 0),o.push(a)}this.updateStoredProfiles(o),this.triggerProfilesChanges(e,t,i)}triggerProfilesChanges(e,t,i){this._onDidChangeProfiles.fire({added:e,removed:t,updated:i,all:this.profiles})}updateEmptyWindowAssociation(e,t,i){i=t?.isTransient?!0:i,i?t?this.transientProfilesObject.emptyWindows.set(e,t):this.transientProfilesObject.emptyWindows.delete(e):(this.transientProfilesObject.emptyWindows.delete(e),t?this.profilesObject.emptyWindows.set(e,t):this.profilesObject.emptyWindows.delete(e))}updateStoredProfiles(e){const t=[],i={},s={};for(const r of e)if(!r.isTransient&&(r.isDefault||t.push({location:r.location,name:r.name,icon:r.icon,useDefaultFlags:r.useDefaultFlags}),r.workspaces))for(const o of r.workspaces)i[o.toString()]=r.id;for(const[r,o]of this.profilesObject.emptyWindows.entries())s[r.toString()]=o.id;this.saveStoredProfileAssociations({workspaces:i,emptyWindows:s}),this.saveStoredProfiles(t),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},Na.PROFILES_KEY="userDataProfiles",Na.PROFILE_ASSOCIATIONS_KEY="profileAssociations",Na);nk=V([L(0,t6),L(1,TT),L(2,PT),L(3,at)],nk);const i6="__$__isNewStorageMarker",ep="__$__targetStorageMarker";var Ul;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(Ul||(Ul={}));var Gt;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(Gt||(Gt={}));var yw;(function(n){n[n.USER=0]="USER",n[n.MACHINE=1]="MACHINE"})(yw||(yw={}));function s6(n){const e=n.get(ep);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const _1=class _1 extends Se{constructor(e={flushInterval:_1.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new Ep),this._onDidChangeTarget=this._register(new Ep),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new N),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new ao),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new tl(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,i){return Ut.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=DC(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){Ar([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{ri("code/willInitStorage");try{await this.doInitialize()}finally{ri("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===ep){switch(e){case Gt.APPLICATION:this._applicationKeyTargets=void 0;break;case Gt.PROFILE:this._profileKeyTargets=void 0;break;case Gt.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,i)}storeAll(e,t){this.withPausedEmitters(()=>{for(const i of e)this.store(i.key,i.value,i.scope,i.target,t)})}store(e,t,i,s,r=!1){if(tn(t)){this.remove(e,i,r);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,s),this.getStorage(i)?.set(e,t,r)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){const i=[],s=this.getKeyTargets(e);for(const r of Object.keys(s))s[r]===t&&i.push(r);return i}updateKeyTarget(e,t,i,s=!1){const r=this.getKeyTargets(t);typeof i=="number"?r[e]!==i&&(r[e]=i,this.getStorage(t)?.set(ep,JSON.stringify(r),s)):typeof r[e]=="number"&&(delete r[e],this.getStorage(t)?.set(ep,JSON.stringify(r),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(Gt.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(Gt.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(Gt.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case Gt.APPLICATION:return this.applicationKeyTargets;case Gt.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?s6(t):Object.create(null)}isNew(e){return this.getBoolean(i6,e)===!0}async flush(e=Ul.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(Gt.APPLICATION),i=this.getStorage(Gt.PROFILE),s=this.getStorage(Gt.WORKSPACE);switch(e){case Ul.NONE:await Lc.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case Ul.SHUTDOWN:await Lc.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(Gt.APPLICATION)?.items??new Map,t=this.getStorage(Gt.PROFILE)?.items??new Map,i=this.getStorage(Gt.WORKSPACE)?.items??new Map;return r6(e,t,i,this.getLogDetails(Gt.APPLICATION)??"",this.getLogDetails(Gt.PROFILE)??"",this.getLogDetails(Gt.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(Ul.NONE),n6(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||sk(t)&&sk(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const s=new Set;for(const[r,o]of e)s.add(r),t.get(r)!==o&&this.emitDidChangeValue(i,{key:r,external:!0});for(const[r]of t.items)s.has(r)||this.emitDidChangeValue(i,{key:r,external:!0})})}};_1.DEFAULT_FLUSH_INTERVAL=60*1e3;let ik=_1;function sk(n){return n.isDefault||!!n.useDefaultFlags?.globalState}async function r6(n,e,t,i,s,r){const o=w=>{try{return JSON.parse(w)}catch{return w}},a=new Map,l=new Map;n.forEach((w,v)=>{a.set(v,w),l.set(v,o(w))});const c=new Map,u=new Map;e.forEach((w,v)=>{c.set(v,w),u.set(v,o(w))});const d=new Map,f=new Map;t.forEach((w,v)=>{d.set(v,w),f.set(v,o(w))}),console.group(i!==s?`Storage: Application (path: ${i})`:`Storage: Application & Profile (path: ${i}, default profile)`);const p=[];if(a.forEach((w,v)=>{p.push({key:v,value:w})}),console.table(p),console.groupEnd(),console.log(l),i!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);const w=[];c.forEach((v,E)=>{w.push({key:E,value:v})}),console.table(w),console.groupEnd(),console.log(u)}console.group(`Storage: Workspace (path: ${r})`);const _=[];d.forEach((w,v)=>{_.push({key:v,value:w})}),console.table(_),console.groupEnd(),console.log(f)}const o6=pe("storageService");new P("isMac",Li,h(1733,"Whether the operating system is macOS"));new P("isLinux",yo,h(1734,"Whether the operating system is Linux"));new P("isWindows",Qn,h(1735,"Whether the operating system is Windows"));const a6=new P("isWeb",Qh,h(1736,"Whether the platform is a web browser"));new P("isMacNative",Li&&!Qh,h(1737,"Whether the operating system is macOS on a non-browser platform"));new P("isIOS",IA,h(1738,"Whether the operating system is iOS"));new P("isMobile",CA,h(1739,"Whether the platform is a mobile web browser"));new P("isDevelopment",!1,!0);new P("productQualityType","",h(1740,"Quality type of VS Code"));const l6="inputFocus";new P(l6,!1,h(1741,"Whether keyboard focus is inside an input box"));const c6=pe("languageService"),u6=pe("modelService");var zi;new P("workbenchState",void 0,{type:"string",description:h(3806,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")});new P("workspaceFolderCount",0,h(3807,"The number of root folders in the workspace"));new P("openFolderWorkspaceSupport",!0,!0);new P("enterMultiRootWorkspaceSupport",!0,!0);new P("emptyWorkspaceSupport",!0,!0);new P("dirtyWorkingCopies",!1,h(3808,"Whether there are any working copies with unsaved changes"));const d6=new P("remoteName","",h(3809,"The name of the remote the window is connected to or an empty string if not connected to any remote"));new P("virtualWorkspace","",h(3810,"The scheme of the current workspace is from a virtual file system or an empty string."));new P("temporaryWorkspace",!1,h(3811,"The scheme of the current workspace is from a temporary file system."));new P("hasWebFileSystemAccess",!1,!0);new P("embedderIdentifier",void 0,h(3812,"The identifier of the embedder according to the product service, if one is defined"));new P("isSandboxWorkspace",!1,!0);new P("isFullscreen",!1,h(3813,"Whether the main window is in fullscreen mode"));new P("isAuxiliaryWindowFocusedContext",!1,h(3814,"Whether an auxiliary window is focused"));new P("isAuxiliaryWindow",!1,h(3815,"Window is an auxiliary window"));new P("activeEditorIsDirty",!1,h(3816,"Whether the active editor has unsaved changes"));new P("activeEditorIsNotPreview",!1,h(3817,"Whether the active editor is not in preview mode"));new P("activeEditorIsFirstInGroup",!1,h(3818,"Whether the active editor is the first one in its group"));new P("activeEditorIsLastInGroup",!1,h(3819,"Whether the active editor is the last one in its group"));new P("activeEditorIsPinned",!1,h(3820,"Whether the active editor is pinned"));new P("activeEditorIsReadonly",!1,h(3821,"Whether the active editor is read-only"));new P("activeCompareEditorCanSwap",!1,h(3822,"Whether the active compare editor can swap sides"));new P("activeEditorCanToggleReadonly",!0,h(3823,"Whether the active editor can toggle between being read-only or writeable"));new P("activeEditorCanRevert",!1,h(3824,"Whether the active editor can revert"));new P("activeEditorCanSplitInGroup",!0);new P("activeEditor",null,{type:"string",description:h(3825,"The identifier of the active editor")});new P("activeEditorAvailableEditorIds","",h(3826,"The available editor identifiers that are usable for the active editor"));new P("textCompareEditorVisible",!1,h(3827,"Whether a text compare editor is visible"));new P("textCompareEditorActive",!1,h(3828,"Whether a text compare editor is active"));new P("sideBySideEditorActive",!1,h(3829,"Whether a side by side editor is active"));new P("groupEditorsCount",0,h(3830,"The number of opened editor groups"));new P("activeEditorGroupEmpty",!1,h(3831,"Whether the active editor group is empty"));new P("activeEditorGroupIndex",0,h(3832,"The index of the active editor group"));new P("activeEditorGroupLast",!1,h(3833,"Whether the active editor group is the last group"));new P("activeEditorGroupLocked",!1,h(3834,"Whether the active editor group is locked"));new P("multipleEditorGroups",!1,h(3835,"Whether there are multiple editor groups opened"));new P("multipleEditorsSelectedInGroup",!1,h(3836,"Whether multiple editors have been selected in an editor group"));new P("twoEditorsSelectedInGroup",!1,h(3837,"Whether exactly two editors have been selected in an editor group"));new P("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,h(3838,"Whether all selected editors in a group have a file or untitled resource associated"));new P("editorPartMultipleEditorGroups",!1,h(3839,"Whether there are multiple editor groups opened in an editor part"));new P("editorPartMaximizedEditorGroup",!1,h(3840,"Editor Part has a maximized group"));new P("editorIsOpen",!1,h(3841,"Whether an editor is open"));new P("inZenMode",!1,h(3842,"Whether Zen mode is enabled"));new P("isCenteredLayout",!1,h(3843,"Whether centered layout is enabled for the main editor"));new P("splitEditorsVertically",!1,h(3844,"Whether editors split vertically"));new P("mainEditorAreaVisible",!0,h(3845,"Whether the editor area in the main window is visible"));new P("editorTabsVisible",!0,h(3846,"Whether editor tabs are visible"));new P("sideBarVisible",!1,h(3847,"Whether the sidebar is visible"));new P("sideBarFocus",!1,h(3848,"Whether the sidebar has keyboard focus"));new P("activeViewlet","",h(3849,"The identifier of the active viewlet"));new P("statusBarFocused",!1,h(3850,"Whether the status bar has keyboard focus"));new P("titleBarStyle","custom",h(3851,"Style of the window title bar"));new P("titleBarVisible",!1,h(3852,"Whether the title bar is visible"));new P("isCompactTitleBar",!1,h(3853,"Title bar is in compact mode"));new P("bannerFocused",!1,h(3854,"Whether the banner has keyboard focus"));new P("notificationFocus",!0,h(3855,"Whether a notification has keyboard focus"));new P("notificationCenterVisible",!1,h(3856,"Whether the notifications center is visible"));new P("notificationToastsVisible",!1,h(3857,"Whether a notification toast is visible"));new P("activeAuxiliary","",h(3858,"The identifier of the active auxiliary panel"));new P("auxiliaryBarFocus",!1,h(3859,"Whether the auxiliary bar has keyboard focus"));new P("auxiliaryBarVisible",!1,h(3860,"Whether the auxiliary bar is visible"));new P("activePanel","",h(3861,"The identifier of the active panel"));new P("panelFocus",!1,h(3862,"Whether the panel has keyboard focus"));new P("panelPosition","bottom",h(3863,"The position of the panel, always 'bottom'"));new P("panelAlignment","center",h(3864,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'"));new P("panelVisible",!1,h(3865,"Whether the panel is visible"));new P("panelMaximized",!1,h(3866,"Whether the panel is maximized"));new P("focusedView","",h(3867,"The identifier of the view that has keyboard focus"));var ii;let rk=(ii=class{constructor(e,t,i,s){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=s,this._disposables=new xe,this._schemeKey=zi.Scheme.bindTo(this._contextKeyService),this._filenameKey=zi.Filename.bindTo(this._contextKeyService),this._dirnameKey=zi.Dirname.bindTo(this._contextKeyService),this._pathKey=zi.Path.bindTo(this._contextKeyService),this._langIdKey=zi.LangId.bindTo(this._contextKeyService),this._resourceKey=zi.Resource.bindTo(this._contextKeyService),this._extensionKey=zi.Extension.bindTo(this._contextKeyService),this._hasResource=zi.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=zi.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=>{tc(r.uri,this.get())&&this._setLangId()})),this._disposables.add(s.onModelLanguageChanged(r=>{tc(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,!tc(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?Ks(e):null),this._dirnameKey.set(e?this.uriToPath(K1(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?kR(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===le.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}},zi=ii,ii.Scheme=new P("resourceScheme",void 0,{type:"string",description:h(3868,"The scheme of the resource")}),ii.Filename=new P("resourceFilename",void 0,{type:"string",description:h(3869,"The file name of the resource")}),ii.Dirname=new P("resourceDirname",void 0,{type:"string",description:h(3870,"The folder name the resource is contained in")}),ii.Path=new P("resourcePath",void 0,{type:"string",description:h(3871,"The full path of the resource")}),ii.LangId=new P("resourceLangId",void 0,{type:"string",description:h(3872,"The language identifier of the resource")}),ii.Resource=new P("resource",void 0,{type:"URI",description:h(3873,"The full value of the resource including scheme and path")}),ii.Extension=new P("resourceExtname",void 0,{type:"string",description:h(3874,"The extension name of the resource")}),ii.HasResource=new P("resourceSet",void 0,{type:"boolean",description:h(3875,"Whether a resource is present or not")}),ii.IsFileSystemResource=new P("isFileSystemResource",void 0,{type:"boolean",description:h(3876,"Whether the resource is backed by a file system provider")}),ii);rk=zi=V([L(0,r_),L(1,TT),L(2,c6),L(3,u6)],rk);var ok;(function(n){n.UseFileStorage="chat.useFileStorage",n.AgentEnabled="chat.agent.enabled",n.Edits2Enabled="chat.edits2.enabled",n.ExtensionToolsEnabled="chat.extensionTools.enabled"})(ok||(ok={}));var Os;(function(n){n.Ask="ask",n.Edit="edit",n.Agent="agent"})(Os||(Os={}));var zn;(function(n){n.Panel="panel",n.Terminal="terminal",n.Notebook="notebook",n.Editor="editor"})(zn||(zn={}));(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})(zn||(zn={}));var Sr;(function(n){n.responseVote=new P("chatSessionResponseVote","",{type:"string",description:h(5108,"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 P("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:h(5109,"When the agent or command was automatically detected")}),n.responseSupportsIssueReporting=new P("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:h(5110,"True when the current chat response supports issue reporting.")}),n.responseIsFiltered=new P("chatSessionResponseFiltered",!1,{type:"boolean",description:h(5111,"True when the chat response was filtered out by the server.")}),n.responseHasError=new P("chatSessionResponseError",!1,{type:"boolean",description:h(5112,"True when the chat response resulted in an error.")}),n.requestInProgress=new P("chatSessionRequestInProgress",!1,{type:"boolean",description:h(5113,"True when the current request is still in progress.")}),n.isRequestPaused=new P("chatRequestIsPaused",!1,{type:"boolean",description:h(5114,"True when the current request is paused.")}),n.canRequestBePaused=new P("chatCanRequestBePaused",!1,{type:"boolean",description:h(5115,"True when the current request can be paused.")}),n.isResponse=new P("chatResponse",!1,{type:"boolean",description:h(5116,"The chat item is a response.")}),n.isRequest=new P("chatRequest",!1,{type:"boolean",description:h(5117,"The chat item is a request")}),n.itemId=new P("chatItemId","",{type:"string",description:h(5118,"The id of the chat item.")}),n.lastItemId=new P("chatLastItemId",[],{type:"string",description:h(5119,"The id of the last chat item.")}),n.editApplied=new P("chatEditApplied",!1,{type:"boolean",description:h(5120,"True when the chat text edits have been applied.")}),n.inputHasText=new P("chatInputHasText",!1,{type:"boolean",description:h(5121,"True when the chat input has text.")}),n.inputHasFocus=new P("chatInputHasFocus",!1,{type:"boolean",description:h(5122,"True when the chat input has focus.")}),n.inChatInput=new P("inChatInput",!1,{type:"boolean",description:h(5123,"True when focus is in the chat input, false otherwise.")}),n.inChatSession=new P("inChat",!1,{type:"boolean",description:h(5124,"True when focus is in the chat widget, false otherwise.")}),n.hasPromptFile=new P("chatPromptFileAttached",!1,{type:"boolean",description:h(5125,"True when the chat has a prompt file attached.")}),n.chatMode=new P("chatMode",Os.Ask,{type:"string",description:h(5126,"The current chat mode.")}),n.supported=Mt.or(a6.negate(),d6.notEqualsTo(""),Mt.has("config.chat.experimental.serverlessWebEnabled")),n.enabled=new P("chatIsEnabled",!1,{type:"boolean",description:h(5127,"True when chat is enabled because a default chat participant is activated with an implementation.")}),n.extensionParticipantRegistered=new P("chatPanelExtensionParticipantRegistered",!1,{type:"boolean",description:h(5128,"True when a default chat participant is registered for the panel from an extension.")}),n.panelParticipantRegistered=new P("chatPanelParticipantRegistered",!1,{type:"boolean",description:h(5129,"True when a default chat participant is registered for the panel.")}),n.editingParticipantRegistered=new P("chatEditingParticipantRegistered",!1,{type:"boolean",description:h(5130,"True when a default chat participant is registered for editing.")}),n.chatEditingCanUndo=new P("chatEditingCanUndo",!1,{type:"boolean",description:h(5131,"True when it is possible to undo an interaction in the editing panel.")}),n.chatEditingCanRedo=new P("chatEditingCanRedo",!1,{type:"boolean",description:h(5132,"True when it is possible to redo an interaction in the editing panel.")}),n.extensionInvalid=new P("chatExtensionInvalid",!1,{type:"boolean",description:h(5133,"True when the installed chat extension is invalid and needs to be updated.")}),n.inputCursorAtTop=new P("chatCursorAtTop",!1),n.inputHasAgent=new P("chatInputHasAgent",!1),n.location=new P("chatLocation",void 0),n.inQuickChat=new P("quickChatHasFocus",!1,{type:"boolean",description:h(5134,"True when the quick chat UI has focus, false otherwise.")}),n.hasFileAttachments=new P("chatHasFileAttachments",!1,{type:"boolean",description:h(5135,"True when the chat has file attachments.")}),n.languageModelsAreUserSelectable=new P("chatModelsAreUserSelectable",!1,{type:"boolean",description:h(5136,"True when the chat model can be selected manually by the user.")}),n.Setup={hidden:new P("chatSetupHidden",!1,!0),installed:new P("chatSetupInstalled",!1,!0),disabled:new P("chatSetupDisabled",!1,!0),later:new P("chatSetupLater",!1,!0)},n.Entitlement={signedOut:new P("chatEntitlementSignedOut",!1,!0),canSignUp:new P("chatPlanCanSignUp",!1,!0),free:new P("chatPlanFree",!1,!0),pro:new P("chatPlanPro",!1,!0),proPlus:new P("chatPlanProPlus",!1,!0),business:new P("chatPlanBusiness",!1,!0),enterprise:new P("chatPlanEnterprise",!1,!0)},n.chatQuotaExceeded=new P("chatQuotaExceeded",!1,!0),n.completionsQuotaExceeded=new P("completionsQuotaExceeded",!1,!0),n.Editing={agentModeDisallowed:new P("chatAgentModeDisallowed",void 0,{type:"boolean",description:h(5137,"True when agent mode is not allowed.")}),hasToolConfirmation:new P("chatHasToolConfirmation",!1,{type:"boolean",description:h(5138,"True when a tool confirmation is present.")})},n.Tools={toolsCount:new P("toolsCount",0,{type:"number",description:h(5139,"The count of tools available in the chat.")})},n.Modes={hasCustomChatModes:new P("chatHasCustomChatModes",!1,{type:"boolean",description:h(5140,"True when the chat has custom chat modes available.")})},n.panelLocation=new P("chatPanelLocation",void 0,{type:"number",description:h(5141,"The location of the chat panel.")})})(Sr||(Sr={}));var ak;(function(n){n.inEditingMode=Mt.or(Sr.chatMode.isEqualTo(Os.Edit),Sr.chatMode.isEqualTo(Os.Agent))})(ak||(ak={}));var Uu,bc;let lk=(bc=class extends Se{constructor(e){super(),this.contextKeyService=e,this._agents=new Map,this._onDidChangeAgents=new N,this.onDidChangeAgents=this._onDidChangeAgents.event,this._agentsContextKeys=new Set,this._hasToolsAgent=!1,this._chatParticipantDetectionProviders=new Map,this._agentCompletionProviders=new Map,this._hasDefaultAgent=Sr.enabled.bindTo(this.contextKeyService),this._extensionAgentRegistered=Sr.extensionParticipantRegistered.bindTo(this.contextKeyService),this._defaultAgentRegistered=Sr.panelParticipantRegistered.bindTo(this.contextKeyService),this._editingAgentRegistered=Sr.editingParticipantRegistered.bindTo(this.contextKeyService),this._register(e.onDidChangeContext(t=>{t.affectsSome(this._agentsContextKeys)&&this._updateContextKeys()}))}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const s=this,r=t.slashCommands;t={...t,get slashCommands(){return r.filter(a=>!a.when||s.contextKeyService.contextMatchesRules(Mt.deserialize(a.when)))}};const o={data:t};return this._agents.set(e,o),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0),we(()=>{this._agents.delete(e),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0)})}_updateAgentsContextKeys(){this._agentsContextKeys.clear();for(const e of this._agents.values())if(e.data.when){const t=Mt.deserialize(e.data.when);for(const i of t?.keys()||[])this._agentsContextKeys.add(i)}}_updateContextKeys(){let e=!1,t=!1,i=!1,s=!1;for(const r of this.getAgents())r.isDefault&&(r.isCore||(t=!0),r.modes.includes(Os.Agent)?s=!0:r.modes.includes(Os.Edit)?e=!0:i=!0);this._editingAgentRegistered.set(e),this._defaultAgentRegistered.set(i),this._extensionAgentRegistered.set(t),s!==this._hasToolsAgent&&(this._hasToolsAgent=s,this._onDidChangeAgents.fire(this.getDefaultAgent(zn.Panel,Os.Agent)))}registerAgentImplementation(e,t){const i=this._agents.get(e);if(!i)throw new Error(`Unknown agent: ${JSON.stringify(e)}`);if(i.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(e)}`);return i.data.isDefault&&this._hasDefaultAgent.set(!0),i.impl=t,this._onDidChangeAgents.fire(new Cf(i.data,t)),we(()=>{i.impl=void 0,this._onDidChangeAgents.fire(void 0),i.data.isDefault&&this._hasDefaultAgent.set(fn.some(this._agents.values(),s=>s.data.isDefault))})}registerDynamicAgent(e,t){e.isDynamic=!0;const i={data:e,impl:t};return this._agents.set(e.id,i),this._onDidChangeAgents.fire(new Cf(e,t)),we(()=>{this._agents.delete(e.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(e,t){return this._agentCompletionProviders.set(e,t),{dispose:()=>{this._agentCompletionProviders.delete(e)}}}async getAgentCompletionItems(e,t,i){return await this._agentCompletionProviders.get(e)?.(t,i)??[]}updateAgent(e,t){const i=this._agents.get(e);if(!i?.impl)throw new Error(`No activated agent with id ${JSON.stringify(e)} registered`);i.data.metadata={...i.data.metadata,...t},this._onDidChangeAgents.fire(new Cf(i.data,i.impl))}getDefaultAgent(e,t=Os.Ask){return this._preferExtensionAgent(this.getActivatedAgents().filter(i=>t&&!i.modes.includes(t)?!1:!!i.isDefault&&i.locations.includes(e)))}get hasToolsAgent(){return!!this._hasToolsAgent}getContributedDefaultAgent(e){return this._preferExtensionAgent(this.getAgents().filter(t=>!!t.isDefault&&t.locations.includes(e)))}_preferExtensionAgent(e){return S5(e,t=>!t.isCore)??e.at(-1)}getAgent(e,t=!1){if(!(!this._agentIsEnabled(e)&&!t))return this._agents.get(e)?.data}_agentIsEnabled(e){const t=typeof e=="string"?this._agents.get(e):e;return!t?.data.when||this.contextKeyService.contextMatchesRules(Mt.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=fn.find(this._agents.values(),i=>h6(i.data)===e)?.data;if(!(t&&!this._agentIsEnabled(t.id)))return t}getAgents(){return Array.from(this._agents.values()).map(e=>e.data).filter(e=>this._agentIsEnabled(e.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(e=>!!e.impl).filter(e=>this._agentIsEnabled(e.data.id)).map(e=>new Cf(e.data,e.impl))}getAgentsByName(e){return this._preferExtensionAgents(this.getAgents().filter(t=>t.name===e))}_preferExtensionAgents(e){const t=e.filter(i=>!i.isCore);return t.length>0?t:e}agentHasDupeName(e){const t=this.getAgent(e);return t?this.getAgentsByName(t.name).filter(i=>i.extensionId.value!==t.extensionId.value).length>0:!1}async invokeAgent(e,t,i,s,r){const o=this._agents.get(e);if(!o?.impl)throw new Error(`No activated agent with id "${e}"`);return await o.impl.invoke(t,i,s,r)}setRequestPaused(e,t,i){const s=this._agents.get(e);if(!s?.impl)throw new Error(`No activated agent with id "${e}"`);s.impl.setRequestPaused?.(t,i)}async getFollowups(e,t,i,s,r){const o=this._agents.get(e);return o?.impl?.provideFollowups?o.impl.provideFollowups(t,i,s,r):[]}async getChatTitle(e,t,i){const s=this._agents.get(e);if(s?.impl?.provideChatTitle)return s.impl.provideChatTitle(t,i)}registerChatParticipantDetectionProvider(e,t){return this._chatParticipantDetectionProviders.set(e,t),we(()=>{this._chatParticipantDetectionProviders.delete(e)})}hasChatParticipantDetectionProviders(){return this._chatParticipantDetectionProviders.size>0}async detectAgentOrCommand(e,t,i,s){const r=fn.first(this._chatParticipantDetectionProviders.values());if(!r)return;const o=this.getAgents().reduce((u,d)=>{if(d.locations.includes(i.location)){u.push({participant:d.id,disambiguation:d.disambiguation??[]});for(const f of d.slashCommands)u.push({participant:d.id,command:f.name,disambiguation:f.disambiguation??[]})}return u},[]),a=await r.provideParticipantDetection(e,t,{...i,participants:o},s);if(!a)return;const l=this.getAgent(a.participant);if(!l)return;if(!a.command)return{agent:l};const c=l?.slashCommands.find(u=>u.name===a.command);if(c)return{agent:l,command:c}}},bc.AGENT_LEADER="@",bc);lk=V([L(0,r_)],lk);class Cf{constructor(e,t){this.data=e,this.impl=t}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get isCore(){return this.data.isCore}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get locations(){return this.data.locations}get modes(){return this.data.modes}get disambiguation(){return this.data.disambiguation}async invoke(e,t,i,s){return this.impl.invoke(e,t,i,s)}setRequestPaused(e,t){this.impl.setRequestPaused&&this.impl.setRequestPaused(e,t)}async provideFollowups(e,t,i,s){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,s):[]}toJSON(){return this.data}}var Oa;let ck=(Oa=class{constructor(e,t,i,s){if(this.requestService=t,this.logService=i,this.storageService=s,this.registry=s_(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const r=s.get(Uu.StorageKey,Gt.APPLICATION);try{this.registry.set(JSON.parse(r??"{}"),void 0)}catch{s.remove(Uu.StorageKey,Gt.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>us(300*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},yt.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await Q9(e);if(!t||t.version!==1)throw new Error("Unexpected chat participant registry response.");const i=t.restrictedChatParticipants;this.registry.set(i,void 0),this.storageService.store(Uu.StorageKey,JSON.stringify(i),Gt.APPLICATION,yw.MACHINE)}getAgentNameRestriction(e){if(e.isCore)return!0;const t=this.checkAgentNameRestriction(e.name,e).get(),i=!e.fullName||this.checkAgentNameRestriction(e.fullName.replace(/\s/g,""),e).get();return t&&i}checkAgentNameRestriction(e,t){return this.registry.map(s=>s[e.toLowerCase()]).map(s=>s?s.some(r=>co(r,r.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},Uu=Oa,Oa.StorageKey="chat.participantNameRegistry",Oa);ck=Uu=V([L(0,F9),L(1,X9),L(2,at),L(3,o6)],ck);function h6(n){return`${n.extensionId.value}.${n.id}`}function AT(n){const e="name"in n?n:{...n,name:n.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new tt("")),an(e)}const f6=pe("chatAgentService");pe("chatAgentNameService");const p6=pe("chatEditingService"),v1=class v1{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=v1.Kind}get promptText(){return this.text}};v1.Kind="text";let zd=v1;const a_="#",g6="@",qd="/",w1=class w1{constructor(e,t,i,s,r){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=s,this.variableId=r,this.kind=w1.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${a_}${this.variableName}${e}`}get promptText(){return this.text}};w1.Kind="var";let eg=w1;const b1=class b1{constructor(e,t,i,s,r,o){this.range=e,this.editorRange=t,this.toolName=i,this.toolId=s,this.displayName=r,this.icon=o,this.kind=b1.Kind}get text(){return`${a_}${this.toolName}`}get promptText(){return this.text}toVariableEntry(){return{kind:"tool",id:this.toolId,name:this.toolName,range:this.range,value:void 0,icon:sn.isThemeIcon(this.icon)?this.icon:void 0,fullName:this.displayName}}};b1.Kind="tool";let tg=b1;const y1=class y1{constructor(e,t,i,s,r,o){this.range=e,this.editorRange=t,this.id=i,this.name=s,this.icon=r,this.tools=o,this.kind=y1.Kind}get text(){return`${a_}${this.name}`}get promptText(){return this.text}toVariableEntry(){return{kind:"toolset",id:this.id,name:this.name,range:this.range,icon:this.icon,value:this.tools}}};y1.Kind="toolset";let ng=y1;const x1=class x1{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=x1.Kind}get text(){return`${g6}${this.agent.name}`}get promptText(){return""}};x1.Kind="agent";let ig=x1;const E1=class E1{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=E1.Kind}get text(){return`${qd}${this.command.name}`}get promptText(){return""}};E1.Kind="subcommand";let sg=E1;const S1=class S1{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=S1.Kind}get text(){return`${qd}${this.slashCommand.command}`}get promptText(){return`${qd}${this.slashCommand.command}`}};S1.Kind="slash";let rg=S1;const k1=class k1{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashPromptCommand=i,this.kind=k1.Kind}get text(){return`${qd}${this.slashPromptCommand.command}`}get promptText(){return`${qd}${this.slashPromptCommand.command}`}};k1.Kind="prompt";let og=k1;const D1=class D1{constructor(e,t,i,s,r,o,a,l,c,u){this.range=e,this.editorRange=t,this.text=i,this.id=s,this.modelDescription=r,this.data=o,this.fullName=a,this.icon=l,this.isFile=c,this.isDirectory=u,this.kind=D1.Kind}get referenceText(){return this.text.replace(a_,"")}get promptText(){return this.text}toVariableEntry(){return this.id==="vscode.problems"?Ew.toEntry(this.data.filter):{kind:this.isDirectory?"directory":this.isFile?"file":"generic",id:this.id,name:this.referenceText,range:this.range,value:this.data,fullName:this.fullName,icon:this.icon}}};D1.Kind="dynamic";let ag=D1;function m6(n){return{text:n.text,parts:n.parts.map(e=>{if(e.kind===zd.Kind)return new zd(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===eg.Kind)return new eg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableId||"");if(e.kind===tg.Kind)return new tg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.toolName,e.toolId,e.displayName,e.icon);if(e.kind===ng.Kind)return new ng(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.id,e.name,e.icon,e.tools??[]);if(e.kind===ig.Kind){let t=e.agent;return t=AT(t),new ig(new Kt(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===sg.Kind)return new sg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===rg.Kind)return new rg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===og.Kind)return new og(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.slashPromptCommand);if(e.kind===ag.Kind)return new ag(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,an(e.data),e.fullName,e.icon,e.isFile,e.isDirectory);throw new Error(`Unknown chat request part: ${e.kind}`)}})}}var uk;(function(n){n[n.Info=0]="Info",n[n.Warning=1]="Warning",n[n.Error=2]="Error"})(uk||(uk={}));function _6(n){return!!n&&typeof n=="object"&&"uri"in n&&n.uri instanceof x&&"version"in n&&typeof n.version=="number"&&"ranges"in n&&Array.isArray(n.ranges)&&n.ranges.every(et.isIRange)}function v6(n){return!!n&&typeof n=="object"&&"documents"in n&&Array.isArray(n.documents)&&n.documents.every(_6)}var dk;(function(n){n[n.Complete=1]="Complete",n[n.Partial=2]="Partial",n[n.Omitted=3]="Omitted"})(dk||(dk={}));var lg;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(lg||(lg={}));var hk;(function(n){n.IncorrectCode="incorrectCode",n.DidNotFollowInstructions="didNotFollowInstructions",n.IncompleteCode="incompleteCode",n.MissingContext="missingContext",n.PoorlyWrittenOrFormatted="poorlyWrittenOrFormatted",n.RefusedAValidRequest="refusedAValidRequest",n.OffensiveOrUnsafe="offensiveOrUnsafe",n.Other="other",n.WillReportIssue="willReportIssue"})(hk||(hk={}));var fk;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(fk||(fk={}));function w6(n,e){return new b6(typeof n=="string"?n:new So(n,void 0,void 0),e)}class b6 extends i_{constructor(e,t){super(),this.event=t,this.handleEvent=()=>{Bd(i=>{for(const s of this._observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}class Gx{static fromFn(e){return new Gx(e())}constructor(e){this._value=s_(this,void 0),this.promiseResult=this._value,this.resolvedValue=GL(this,t=>{const i=this.promiseResult.read(t);if(i)return i.getDataOrThrow()}),this.promise=e.then(t=>(Bd(i=>{this._value.set(new pk(t,void 0),i)}),t),t=>{throw Bd(i=>{this._value.set(new pk(void 0,t),i)}),t})}}class pk{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}var xw,gk;(function(n){n[n.NotOmitted=0]="NotOmitted",n[n.Partial=1]="Partial",n[n.Full=2]="Full"})(gk||(gk={}));var Ew;(function(n){n.icon=_e.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=h(5153,"All Problems");return r.filterUri&&(a=h(5154,"Problems in {0}",Ks(r.filterUri))),a}n.label=s})(Ew||(Ew={}));var mk;(function(n){function e(t){return x.isUri(t.value)?t.value:IL(t.value)?t.value.uri:void 0}n.toUri=e})(mk||(mk={}));function y6(n){return n.kind==="image"}const li={reason:"other"};class _k{get session(){return this._session}get username(){return this.session.requesterUsername}get avatarIconUri(){return this.session.requesterAvatarIconUri}get attempt(){return this._attempt}get variableData(){return this._variableData}set variableData(e){this._variableData=e}get confirmation(){return this._confirmation}get locationData(){return this._locationData}get attachedContext(){return this._attachedContext}get editedFileEvents(){return this._editedFileEvents}constructor(e){this._session=e.session,this.message=e.message,this._variableData=e.variableData,this.timestamp=e.timestamp,this._attempt=e.attempt??0,this._confirmation=e.confirmation,this._locationData=e.locationData,this._attachedContext=e.attachedContext,this.isCompleteAddedRequest=e.isCompleteAddedRequest??!1,this.modelId=e.modelId,this.id=e.restoredId??"request_"+Sn(),this._editedFileEvents=e.editedFileEvents}adoptTo(e){this._session=e}}class RT{get value(){return this._responseParts}constructor(e){this._responseRepr="",this._markdownContent="",this._responseParts=e,this._updateRepr()}toString(){return this._responseRepr}getMarkdown(){return this._markdownContent}_updateRepr(){this._responseRepr=this.partsToRepr(this._responseParts),this._markdownContent=this._responseParts.map(e=>e.kind==="inlineReference"?this.inlineRefToRepr(e):e.kind==="markdownContent"||e.kind==="markdownVuln"?e.content.value:"").filter(e=>e.length>0).join("")}partsToRepr(e){const t=[];let i=[];for(const s of e){let r;switch(s.kind){case"treeData":case"progressMessage":case"codeblockUri":case"toolInvocation":case"toolInvocationSerialized":case"extensions":case"undoStop":case"prepareToolInvocation":continue;case"inlineReference":r={text:this.inlineRefToRepr(s)};break;case"command":r={text:s.command.title,isBlock:!0};break;case"textEditGroup":case"notebookEditGroup":r={text:h(5155,"Made changes."),isBlock:!0};break;case"confirmation":r={text:`${s.title}
|
|
90
|
+
`+t,i}}let rv=[],X2,Y2;function J9(n=!0,e=!0){if(X2===n&&Y2===e)return;X2=n,Y2=e;const t=mn.as(ll.Configuration),i=rv;rv=[{id:"http",order:15,title:h(1975,"HTTP"),type:"object",scope:bt.MACHINE,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:e,markdownDescription:h(1976,"Controls whether in the remote extension host the local proxy configuration should be used. This setting only applies as a remote setting during [remote development](https://aka.ms/vscode-remote)."),restricted:!0}}},{id:"http",order:15,title:h(1975,"HTTP"),type:"object",scope:bt.APPLICATION,properties:{"http.electronFetch":{type:"boolean",default:!1,description:h(1977,"Controls whether use of Electron's fetch implementation instead of Node.js' should be enabled. All local extensions will get Electron's fetch implementation for the global fetch API."),restricted:!0}}},{id:"http",order:15,title:h(1975,"HTTP"),type:"object",scope:n?bt.APPLICATION:bt.MACHINE,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:h(1978,"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:h(1979,"Controls whether the proxy server certificate should be verified against the list of supplied CAs. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:h(1980,"Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:h(1981,"Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:h(1982,"The value to send as the `Proxy-Authorization` header for every network request. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[h(1983,"Disable proxy support for extensions."),h(1984,"Enable proxy support for extensions."),h(1985,"Enable proxy support for extensions, fall back to request options, when no proxy found."),h(1986,"Enable proxy support for extensions, override request options.")],default:"override",markdownDescription:h(1987,"Use the proxy support for extensions. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:h(1988,"Controls whether CA certificates should be loaded from the OS. On Windows and macOS, a reload of the window is required after turning this off. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:h(1989,"Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implementation. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:h(1990,"Controls whether Node.js' fetch implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.","`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0}}}],t.updateConfigurations({add:rv,remove:i})}J9();const X9=pe("requestService");var rd;(function(n){n[n.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",n[n.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(rd||(rd={}));var Ki;(function(n){n[n.None=0]="None",n[n.Initialized=1]="Initialized",n[n.Closed=2]="Closed"})(Ki||(Ki={}));const m1=class m1 extends Se{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new Ep),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Ki.None,this.cache=new Map,this.flushDelayer=this._register(new FR(m1.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.pendingClose=void 0,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal(e=>this.onDidChangeItemsExternal(e)))}onDidChangeItemsExternal(e){this._onDidChangeStorage.pause();try{e.changed?.forEach((t,i)=>this.acceptExternal(i,t)),e.deleted?.forEach(t=>this.acceptExternal(t,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Ki.Closed)return;let i=!1;tn(t)?i=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0),i&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===Ki.None&&(this.state=Ki.Initialized,this.options.hint!==rd.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){const i=this.cache.get(e);return tn(i)?t:i}getBoolean(e,t){const i=this.get(e);return tn(i)?t:i==="true"}getNumber(e,t){const i=this.get(e);return tn(i)?t:parseInt(i,10)}getObject(e,t){const i=this.get(e);return tn(i)?t:nT(i)}async set(e,t,i=!1){if(this.state===Ki.Closed)return;if(tn(t))return this.delete(e,i);const s=nn(t)||Array.isArray(t)?u7(t):String(t);if(this.cache.get(e)!==s)return this.cache.set(e,s),this.pendingInserts.set(e,s),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()}async delete(e,t=!1){if(!(this.state===Ki.Closed||!this.cache.delete(e)))return this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()}async optimize(){if(this.state!==Ki.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||(this.pendingClose=this.doClose()),this.pendingClose}async doClose(){this.state=Ki.Closed;try{await this.doFlush(0)}catch{}await this.database.close(()=>this.cache)}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}async flushPending(){if(!this.hasPending)return;const e={insert:this.pendingInserts,delete:this.pendingDeletes};return this.pendingDeletes=new Set,this.pendingInserts=new Map,this.database.updateItems(e).finally(()=>{if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)this.whenFlushedCallbacks.pop()?.()})}async flush(e){if(!(this.state===Ki.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===rd.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger(()=>this.flushPending(),e)}async whenFlushed(){if(this.hasPending)return new Promise(e=>this.whenFlushedCallbacks.push(e))}isInMemory(){return this.options.hint===rd.STORAGE_IN_MEMORY}};m1.DEFAULT_FLUSH_DELAY=100;let Z2=m1;function Vd(n){return qx(n,0)}function qx(n,e){switch(typeof n){case"object":return n===null?Er(349,e):Array.isArray(n)?Z9(n,e):e6(n,e);case"string":return jx(n,e);case"boolean":return Y9(n,e);case"number":return Er(n,e);case"undefined":return Er(937,e);default:return Er(617,e)}}function Er(n,e){return(e<<5)-e+n|0}function Y9(n,e){return Er(n?433:863,e)}function jx(n,e){e=Er(149417,e);for(let t=0,i=n.length;t<i;t++)e=Er(n.charCodeAt(t),e);return e}function Z9(n,e){return e=Er(104579,e),n.reduce((t,i)=>qx(i,t),e)}function e6(n,e){return e=Er(181387,e),Object.keys(n).sort().reduce((t,i)=>(t=jx(i,t),qx(n[i],t)),e)}var ek;(function(n){n[n.BLOCK_SIZE=64]="BLOCK_SIZE",n[n.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(ek||(ek={}));const t6=pe("environmentService"),TT=pe("fileService"),PT=pe("IUriIdentityService");var tk;(function(n){n.Settings="settings",n.Keybindings="keybindings",n.Snippets="snippets",n.Prompts="prompts",n.Tasks="tasks",n.Extensions="extensions",n.GlobalState="globalState"})(tk||(tk={}));function n6(n){const e=n;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&typeof e.isDefault=="boolean"&&typeof e.name=="string"&&x.isUri(e.location)&&x.isUri(e.globalStorageHome)&&x.isUri(e.settingsResource)&&x.isUri(e.keybindingsResource)&&x.isUri(e.tasksResource)&&x.isUri(e.snippetsHome)&&x.isUri(e.promptsHome)&&x.isUri(e.extensionsResource))}function If(n,e,t,i,s,r){return{id:n,name:e,location:t,isDefault:!1,icon:s?.icon,globalStorageHome:r&&s?.useDefaultFlags?.globalState?r.globalStorageHome:An(t,"globalStorage"),settingsResource:r&&s?.useDefaultFlags?.settings?r.settingsResource:An(t,"settings.json"),keybindingsResource:r&&s?.useDefaultFlags?.keybindings?r.keybindingsResource:An(t,"keybindings.json"),tasksResource:r&&s?.useDefaultFlags?.tasks?r.tasksResource:An(t,"tasks.json"),snippetsHome:r&&s?.useDefaultFlags?.snippets?r.snippetsHome:An(t,"snippets"),promptsHome:r&&s?.useDefaultFlags?.prompts?r.promptsHome:An(t,"prompts"),extensionsResource:r&&s?.useDefaultFlags?.extensions?r.extensionsResource:An(t,"extensions.json"),cacheHome:An(i,n),useDefaultFlags:s?.useDefaultFlags,isTransient:s?.transient,workspaces:s?.workspaces}}var Na;let nk=(Na=class extends Se{get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}constructor(e,t,i,s){super(),this.environmentService=e,this.fileService=t,this.uriIdentityService=i,this.logService=s,this._onDidChangeProfiles=this._register(new N),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this._onWillCreateProfile=this._register(new N),this.onWillCreateProfile=this._onWillCreateProfile.event,this._onWillRemoveProfile=this._register(new N),this.onWillRemoveProfile=this._onWillRemoveProfile.event,this._onDidResetWorkspaces=this._register(new N),this.onDidResetWorkspaces=this._onDidResetWorkspaces.event,this.profileCreationPromises=new Map,this.transientProfilesObject={profiles:[],emptyWindows:new Map},this.profilesHome=An(this.environmentService.userRoamingDataHome,"profiles"),this.profilesCacheHome=An(this.environmentService.cacheHome,"CachedProfilesData")}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){const e=this.createDefaultProfile(),t=[e];try{for(const s of this.getStoredProfiles()){if(!s.name||!it(s.name)||!s.location){this.logService.warn("Skipping the invalid stored profile",s.location||s.name);continue}t.push(If(Ks(s.location),s.name,s.location,this.profilesCacheHome,{icon:s.icon,useDefaultFlags:s.useDefaultFlags},e))}}catch(s){this.logService.error(s)}const i=new Map;if(t.length)try{const s=this.getStoredProfileAssociations();if(s.workspaces)for(const[r,o]of Object.entries(s.workspaces)){const a=x.parse(r),l=t.find(c=>c.id===o);if(l){const c=l.workspaces?l.workspaces.slice(0):[];c.push(a),l.workspaces=c}}if(s.emptyWindows)for(const[r,o]of Object.entries(s.emptyWindows)){const a=t.find(l=>l.id===o);a&&i.set(r,a)}}catch(s){this.logService.error(s)}this._profilesObject={profiles:t,emptyWindows:i}}return this._profilesObject}createDefaultProfile(){const e=If("__default__profile__",h(2368,"Default"),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const t="Temp",i=new RegExp(`${Wa(t)}\\s(\\d+)`);let s=0;for(const o of this.profiles){const a=i.exec(o.name),l=a?parseInt(a[1]):0;s=l>s?l:s}const r=`${t} ${s+1}`;return this.createProfile(Vd(Sn()).toString(16),r,{transient:!0},e)}async createNamedProfile(e,t,i){return this.createProfile(Vd(Sn()).toString(16),e,t,i)}async createProfile(e,t,i,s){return await this.doCreateProfile(e,t,i,s)}async doCreateProfile(e,t,i,s){if(!it(t)||!t)throw new Error("Name of the profile is mandatory and must be of type `string`");let r=this.profileCreationPromises.get(t);return r||(r=(async()=>{try{if(this.profiles.find(u=>u.id===e||!u.isTransient&&!i?.transient&&u.name===t))throw new Error(`Profile with ${t} name already exists`);const a=s?this.getWorkspace(s):void 0;x.isUri(a)&&(i={...i,workspaces:[a]});const l=If(e,t,An(this.profilesHome,e),this.profilesCacheHome,i,this.defaultProfile);await this.fileService.createFolder(l.location);const c=[];return this._onWillCreateProfile.fire({profile:l,join(u){c.push(u)}}),await Lc.settled(c),a&&!x.isUri(a)&&this.updateEmptyWindowAssociation(a,l,!!l.isTransient),this.updateProfiles([l],[],[]),l}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,r)),r}async updateProfile(e,t){const i=[];for(const r of this.profiles){let o;if(e.id===r.id)r.isDefault?t.workspaces&&(o=r,o.workspaces=t.workspaces):o=If(r.id,t.name??r.name,r.location,this.profilesCacheHome,{icon:t.icon===null?void 0:t.icon??r.icon,transient:t.transient??r.isTransient,useDefaultFlags:t.useDefaultFlags??r.useDefaultFlags,workspaces:t.workspaces??r.workspaces},this.defaultProfile);else if(t.workspaces){const a=r.workspaces?.filter(l=>!t.workspaces?.some(c=>this.uriIdentityService.extUri.isEqual(l,c)));r.workspaces?.length!==a?.length&&(o=r,o.workspaces=a)}o&&i.push(o)}if(!i.length)throw e.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],i);const s=this.profiles.find(r=>r.id===e.id);if(!s)throw new Error(`Profile '${e.name}' was not updated`);return s}async removeProfile(e){if(e.isDefault)throw new Error("Cannot remove default profile");const t=this.profiles.find(s=>s.id===e.id);if(!t)throw new Error(`Profile '${e.name}' does not exist`);const i=[];this._onWillRemoveProfile.fire({profile:t,join(s){i.push(s)}});try{await Promise.allSettled(i)}catch(s){this.logService.error(s)}this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(s){l8(s)!==Si.FILE_NOT_FOUND&&this.logService.error(s)}}async setProfileForWorkspace(e,t){const i=this.profiles.find(r=>r.id===t.id);if(!i)throw new Error(`Profile '${t.name}' does not exist`);const s=this.getWorkspace(e);if(x.isUri(s)){const r=i.workspaces?[...i.workspaces]:[];r.some(o=>this.uriIdentityService.extUri.isEqual(o,s))||(r.push(s),await this.updateProfile(i,{workspaces:r}))}else this.updateEmptyWindowAssociation(s,i,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,t=!1){const i=this.getWorkspace(e);if(x.isUri(i)){const s=this.getProfileForWorkspace(e);s&&this.updateProfile(s,{workspaces:s.workspaces?.filter(r=>!this.uriIdentityService.extUri.isEqual(r,i))})}else this.updateEmptyWindowAssociation(i,void 0,t),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(const e of this.profiles)e.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){if(await this.fileService.exists(this.profilesHome)){const e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(t=>t.isDirectory&&this.profiles.every(i=>!this.uriIdentityService.extUri.isEqual(i.location,t.resource))).map(t=>this.fileService.del(t.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){const e=this.transientProfilesObject.profiles.filter(t=>!this.isProfileAssociatedToWorkspace(t));await Promise.allSettled(e.map(t=>this.removeProfile(t)))}getProfileForWorkspace(e){const t=this.getWorkspace(e);return x.isUri(t)?this.profiles.find(i=>i.workspaces?.some(s=>this.uriIdentityService.extUri.isEqual(s,t))):this.profilesObject.emptyWindows.get(t)??this.transientProfilesObject.emptyWindows.get(t)}getWorkspace(e){return u8(e)?e.uri:d8(e)?e.configPath:e.id}isProfileAssociatedToWorkspace(e){return!!(e.workspaces?.length||[...this.profilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location))||[...this.transientProfilesObject.emptyWindows.values()].some(t=>this.uriIdentityService.extUri.isEqual(t.location,e.location)))}updateProfiles(e,t,i){const s=[...this.profiles,...e],r=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];const o=[];for(let a of s){if(t.some(l=>a.id===l.id)){for(const l of[...this.profilesObject.emptyWindows.keys()])a.id===this.profilesObject.emptyWindows.get(l)?.id&&this.profilesObject.emptyWindows.delete(l);continue}if(!a.isDefault){a=i.find(c=>a.id===c.id)??a;const l=r.find(c=>a.id===c.id);if(a.isTransient)this.transientProfilesObject.profiles.push(a);else if(l){for(const[c,u]of this.transientProfilesObject.emptyWindows.entries())if(a.id===u.id){this.transientProfilesObject.emptyWindows.delete(c),this.profilesObject.emptyWindows.set(c,a);break}}}a.workspaces?.length===0&&(a.workspaces=void 0),o.push(a)}this.updateStoredProfiles(o),this.triggerProfilesChanges(e,t,i)}triggerProfilesChanges(e,t,i){this._onDidChangeProfiles.fire({added:e,removed:t,updated:i,all:this.profiles})}updateEmptyWindowAssociation(e,t,i){i=t?.isTransient?!0:i,i?t?this.transientProfilesObject.emptyWindows.set(e,t):this.transientProfilesObject.emptyWindows.delete(e):(this.transientProfilesObject.emptyWindows.delete(e),t?this.profilesObject.emptyWindows.set(e,t):this.profilesObject.emptyWindows.delete(e))}updateStoredProfiles(e){const t=[],i={},s={};for(const r of e)if(!r.isTransient&&(r.isDefault||t.push({location:r.location,name:r.name,icon:r.icon,useDefaultFlags:r.useDefaultFlags}),r.workspaces))for(const o of r.workspaces)i[o.toString()]=r.id;for(const[r,o]of this.profilesObject.emptyWindows.entries())s[r.toString()]=o.id;this.saveStoredProfileAssociations({workspaces:i,emptyWindows:s}),this.saveStoredProfiles(t),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw new Error("not implemented")}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw new Error("not implemented")}getDefaultProfileExtensionsLocation(){}},Na.PROFILES_KEY="userDataProfiles",Na.PROFILE_ASSOCIATIONS_KEY="profileAssociations",Na);nk=V([L(0,t6),L(1,TT),L(2,PT),L(3,at)],nk);const i6="__$__isNewStorageMarker",ep="__$__targetStorageMarker";var Ul;(function(n){n[n.NONE=0]="NONE",n[n.SHUTDOWN=1]="SHUTDOWN"})(Ul||(Ul={}));var Gt;(function(n){n[n.APPLICATION=-1]="APPLICATION",n[n.PROFILE=0]="PROFILE",n[n.WORKSPACE=1]="WORKSPACE"})(Gt||(Gt={}));var yw;(function(n){n[n.USER=0]="USER",n[n.MACHINE=1]="MACHINE"})(yw||(yw={}));function s6(n){const e=n.get(ep);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}const _1=class _1 extends Se{constructor(e={flushInterval:_1.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new Ep),this._onDidChangeTarget=this._register(new Ep),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new N),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new ao),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new tl(()=>this.doFlushWhenIdle(),e.flushInterval))}onDidChangeValue(e,t,i){return Ut.filter(this._onDidChangeValue.event,s=>s.scope===e&&(t===void 0||s.key===t),i)}doFlushWhenIdle(){this.runFlushWhenIdle.value=DC(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){Ar([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||(this.initializationPromise=(async()=>{ri("code/willInitStorage");try{await this.doInitialize()}finally{ri("code/didInitStorage")}this.flushWhenIdleScheduler.schedule()})()),this.initializationPromise}emitDidChangeValue(e,t){const{key:i,external:s}=t;if(i===ep){switch(e){case Gt.APPLICATION:this._applicationKeyTargets=void 0;break;case Gt.PROFILE:this._profileKeyTargets=void 0;break;case Gt.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:s})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,i){return this.getStorage(t)?.get(e,i)}getBoolean(e,t,i){return this.getStorage(t)?.getBoolean(e,i)}getNumber(e,t,i){return this.getStorage(t)?.getNumber(e,i)}getObject(e,t,i){return this.getStorage(t)?.getObject(e,i)}storeAll(e,t){this.withPausedEmitters(()=>{for(const i of e)this.store(i.key,i.value,i.scope,i.target,t)})}store(e,t,i,s,r=!1){if(tn(t)){this.remove(e,i,r);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,i,s),this.getStorage(i)?.set(e,t,r)})}remove(e,t,i=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,i)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){const i=[],s=this.getKeyTargets(e);for(const r of Object.keys(s))s[r]===t&&i.push(r);return i}updateKeyTarget(e,t,i,s=!1){const r=this.getKeyTargets(t);typeof i=="number"?r[e]!==i&&(r[e]=i,this.getStorage(t)?.set(ep,JSON.stringify(r),s)):typeof r[e]=="number"&&(delete r[e],this.getStorage(t)?.set(ep,JSON.stringify(r),s))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(Gt.WORKSPACE)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(Gt.PROFILE)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(Gt.APPLICATION)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case Gt.APPLICATION:return this.applicationKeyTargets;case Gt.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?s6(t):Object.create(null)}isNew(e){return this.getBoolean(i6,e)===!0}async flush(e=Ul.NONE){this._onWillSaveState.fire({reason:e});const t=this.getStorage(Gt.APPLICATION),i=this.getStorage(Gt.PROFILE),s=this.getStorage(Gt.WORKSPACE);switch(e){case Ul.NONE:await Lc.settled([t?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve()]);break;case Ul.SHUTDOWN:await Lc.settled([t?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.getStorage(Gt.APPLICATION)?.items??new Map,t=this.getStorage(Gt.PROFILE)?.items??new Map,i=this.getStorage(Gt.WORKSPACE)?.items??new Map;return r6(e,t,i,this.getLogDetails(Gt.APPLICATION)??"",this.getLogDetails(Gt.PROFILE)??"",this.getLogDetails(Gt.WORKSPACE)??"")}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(Ul.NONE),n6(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||sk(t)&&sk(e))}switchData(e,t,i){this.withPausedEmitters(()=>{const s=new Set;for(const[r,o]of e)s.add(r),t.get(r)!==o&&this.emitDidChangeValue(i,{key:r,external:!0});for(const[r]of t.items)s.has(r)||this.emitDidChangeValue(i,{key:r,external:!0})})}};_1.DEFAULT_FLUSH_INTERVAL=60*1e3;let ik=_1;function sk(n){return n.isDefault||!!n.useDefaultFlags?.globalState}async function r6(n,e,t,i,s,r){const o=w=>{try{return JSON.parse(w)}catch{return w}},a=new Map,l=new Map;n.forEach((w,v)=>{a.set(v,w),l.set(v,o(w))});const c=new Map,u=new Map;e.forEach((w,v)=>{c.set(v,w),u.set(v,o(w))});const d=new Map,f=new Map;t.forEach((w,v)=>{d.set(v,w),f.set(v,o(w))}),console.group(i!==s?`Storage: Application (path: ${i})`:`Storage: Application & Profile (path: ${i}, default profile)`);const p=[];if(a.forEach((w,v)=>{p.push({key:v,value:w})}),console.table(p),console.groupEnd(),console.log(l),i!==s){console.group(`Storage: Profile (path: ${s}, profile specific)`);const w=[];c.forEach((v,E)=>{w.push({key:E,value:v})}),console.table(w),console.groupEnd(),console.log(u)}console.group(`Storage: Workspace (path: ${r})`);const _=[];d.forEach((w,v)=>{_.push({key:v,value:w})}),console.table(_),console.groupEnd(),console.log(f)}const o6=pe("storageService");new P("isMac",Li,h(1733,"Whether the operating system is macOS"));new P("isLinux",yo,h(1734,"Whether the operating system is Linux"));new P("isWindows",Qn,h(1735,"Whether the operating system is Windows"));const a6=new P("isWeb",Qh,h(1736,"Whether the platform is a web browser"));new P("isMacNative",Li&&!Qh,h(1737,"Whether the operating system is macOS on a non-browser platform"));new P("isIOS",IA,h(1738,"Whether the operating system is iOS"));new P("isMobile",CA,h(1739,"Whether the platform is a mobile web browser"));new P("isDevelopment",!1,!0);new P("productQualityType","",h(1740,"Quality type of VS Code"));const l6="inputFocus";new P(l6,!1,h(1741,"Whether keyboard focus is inside an input box"));const c6=pe("languageService"),u6=pe("modelService");var zi;new P("workbenchState",void 0,{type:"string",description:h(3806,"The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)")});new P("workspaceFolderCount",0,h(3807,"The number of root folders in the workspace"));new P("openFolderWorkspaceSupport",!0,!0);new P("enterMultiRootWorkspaceSupport",!0,!0);new P("emptyWorkspaceSupport",!0,!0);new P("dirtyWorkingCopies",!1,h(3808,"Whether there are any working copies with unsaved changes"));const d6=new P("remoteName","",h(3809,"The name of the remote the window is connected to or an empty string if not connected to any remote"));new P("virtualWorkspace","",h(3810,"The scheme of the current workspace is from a virtual file system or an empty string."));new P("temporaryWorkspace",!1,h(3811,"The scheme of the current workspace is from a temporary file system."));new P("hasWebFileSystemAccess",!1,!0);new P("embedderIdentifier",void 0,h(3812,"The identifier of the embedder according to the product service, if one is defined"));new P("isSandboxWorkspace",!1,!0);new P("isFullscreen",!1,h(3813,"Whether the main window is in fullscreen mode"));new P("isAuxiliaryWindowFocusedContext",!1,h(3814,"Whether an auxiliary window is focused"));new P("isAuxiliaryWindow",!1,h(3815,"Window is an auxiliary window"));new P("activeEditorIsDirty",!1,h(3816,"Whether the active editor has unsaved changes"));new P("activeEditorIsNotPreview",!1,h(3817,"Whether the active editor is not in preview mode"));new P("activeEditorIsFirstInGroup",!1,h(3818,"Whether the active editor is the first one in its group"));new P("activeEditorIsLastInGroup",!1,h(3819,"Whether the active editor is the last one in its group"));new P("activeEditorIsPinned",!1,h(3820,"Whether the active editor is pinned"));new P("activeEditorIsReadonly",!1,h(3821,"Whether the active editor is read-only"));new P("activeCompareEditorCanSwap",!1,h(3822,"Whether the active compare editor can swap sides"));new P("activeEditorCanToggleReadonly",!0,h(3823,"Whether the active editor can toggle between being read-only or writeable"));new P("activeEditorCanRevert",!1,h(3824,"Whether the active editor can revert"));new P("activeEditorCanSplitInGroup",!0);new P("activeEditor",null,{type:"string",description:h(3825,"The identifier of the active editor")});new P("activeEditorAvailableEditorIds","",h(3826,"The available editor identifiers that are usable for the active editor"));new P("textCompareEditorVisible",!1,h(3827,"Whether a text compare editor is visible"));new P("textCompareEditorActive",!1,h(3828,"Whether a text compare editor is active"));new P("sideBySideEditorActive",!1,h(3829,"Whether a side by side editor is active"));new P("groupEditorsCount",0,h(3830,"The number of opened editor groups"));new P("activeEditorGroupEmpty",!1,h(3831,"Whether the active editor group is empty"));new P("activeEditorGroupIndex",0,h(3832,"The index of the active editor group"));new P("activeEditorGroupLast",!1,h(3833,"Whether the active editor group is the last group"));new P("activeEditorGroupLocked",!1,h(3834,"Whether the active editor group is locked"));new P("multipleEditorGroups",!1,h(3835,"Whether there are multiple editor groups opened"));new P("multipleEditorsSelectedInGroup",!1,h(3836,"Whether multiple editors have been selected in an editor group"));new P("twoEditorsSelectedInGroup",!1,h(3837,"Whether exactly two editors have been selected in an editor group"));new P("SelectedEditorsInGroupFileOrUntitledResourceContextKey",!0,h(3838,"Whether all selected editors in a group have a file or untitled resource associated"));new P("editorPartMultipleEditorGroups",!1,h(3839,"Whether there are multiple editor groups opened in an editor part"));new P("editorPartMaximizedEditorGroup",!1,h(3840,"Editor Part has a maximized group"));new P("editorIsOpen",!1,h(3841,"Whether an editor is open"));new P("inZenMode",!1,h(3842,"Whether Zen mode is enabled"));new P("isCenteredLayout",!1,h(3843,"Whether centered layout is enabled for the main editor"));new P("splitEditorsVertically",!1,h(3844,"Whether editors split vertically"));new P("mainEditorAreaVisible",!0,h(3845,"Whether the editor area in the main window is visible"));new P("editorTabsVisible",!0,h(3846,"Whether editor tabs are visible"));new P("sideBarVisible",!1,h(3847,"Whether the sidebar is visible"));new P("sideBarFocus",!1,h(3848,"Whether the sidebar has keyboard focus"));new P("activeViewlet","",h(3849,"The identifier of the active viewlet"));new P("statusBarFocused",!1,h(3850,"Whether the status bar has keyboard focus"));new P("titleBarStyle","custom",h(3851,"Style of the window title bar"));new P("titleBarVisible",!1,h(3852,"Whether the title bar is visible"));new P("isCompactTitleBar",!1,h(3853,"Title bar is in compact mode"));new P("bannerFocused",!1,h(3854,"Whether the banner has keyboard focus"));new P("notificationFocus",!0,h(3855,"Whether a notification has keyboard focus"));new P("notificationCenterVisible",!1,h(3856,"Whether the notifications center is visible"));new P("notificationToastsVisible",!1,h(3857,"Whether a notification toast is visible"));new P("activeAuxiliary","",h(3858,"The identifier of the active auxiliary panel"));new P("auxiliaryBarFocus",!1,h(3859,"Whether the auxiliary bar has keyboard focus"));new P("auxiliaryBarVisible",!1,h(3860,"Whether the auxiliary bar is visible"));new P("activePanel","",h(3861,"The identifier of the active panel"));new P("panelFocus",!1,h(3862,"Whether the panel has keyboard focus"));new P("panelPosition","bottom",h(3863,"The position of the panel, always 'bottom'"));new P("panelAlignment","center",h(3864,"The alignment of the panel, either 'center', 'left', 'right' or 'justify'"));new P("panelVisible",!1,h(3865,"Whether the panel is visible"));new P("panelMaximized",!1,h(3866,"Whether the panel is maximized"));new P("focusedView","",h(3867,"The identifier of the view that has keyboard focus"));var ii;let rk=(ii=class{constructor(e,t,i,s){this._contextKeyService=e,this._fileService=t,this._languageService=i,this._modelService=s,this._disposables=new xe,this._schemeKey=zi.Scheme.bindTo(this._contextKeyService),this._filenameKey=zi.Filename.bindTo(this._contextKeyService),this._dirnameKey=zi.Dirname.bindTo(this._contextKeyService),this._pathKey=zi.Path.bindTo(this._contextKeyService),this._langIdKey=zi.LangId.bindTo(this._contextKeyService),this._resourceKey=zi.Resource.bindTo(this._contextKeyService),this._extensionKey=zi.Extension.bindTo(this._contextKeyService),this._hasResource=zi.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=zi.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=>{tc(r.uri,this.get())&&this._setLangId()})),this._disposables.add(s.onModelLanguageChanged(r=>{tc(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,!tc(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?Ks(e):null),this._dirnameKey.set(e?this.uriToPath(K1(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?kR(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===le.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}},zi=ii,ii.Scheme=new P("resourceScheme",void 0,{type:"string",description:h(3868,"The scheme of the resource")}),ii.Filename=new P("resourceFilename",void 0,{type:"string",description:h(3869,"The file name of the resource")}),ii.Dirname=new P("resourceDirname",void 0,{type:"string",description:h(3870,"The folder name the resource is contained in")}),ii.Path=new P("resourcePath",void 0,{type:"string",description:h(3871,"The full path of the resource")}),ii.LangId=new P("resourceLangId",void 0,{type:"string",description:h(3872,"The language identifier of the resource")}),ii.Resource=new P("resource",void 0,{type:"URI",description:h(3873,"The full value of the resource including scheme and path")}),ii.Extension=new P("resourceExtname",void 0,{type:"string",description:h(3874,"The extension name of the resource")}),ii.HasResource=new P("resourceSet",void 0,{type:"boolean",description:h(3875,"Whether a resource is present or not")}),ii.IsFileSystemResource=new P("isFileSystemResource",void 0,{type:"boolean",description:h(3876,"Whether the resource is backed by a file system provider")}),ii);rk=zi=V([L(0,r_),L(1,TT),L(2,c6),L(3,u6)],rk);var ok;(function(n){n.UseFileStorage="chat.useFileStorage",n.AgentEnabled="chat.agent.enabled",n.Edits2Enabled="chat.edits2.enabled",n.ExtensionToolsEnabled="chat.extensionTools.enabled"})(ok||(ok={}));var Os;(function(n){n.Ask="ask",n.Edit="edit",n.Agent="agent"})(Os||(Os={}));var zn;(function(n){n.Panel="panel",n.Terminal="terminal",n.Notebook="notebook",n.Editor="editor"})(zn||(zn={}));(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})(zn||(zn={}));var Sr;(function(n){n.responseVote=new P("chatSessionResponseVote","",{type:"string",description:h(5108,"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 P("chatSessionResponseDetectedAgentOrCommand",!1,{type:"boolean",description:h(5109,"When the agent or command was automatically detected")}),n.responseSupportsIssueReporting=new P("chatResponseSupportsIssueReporting",!1,{type:"boolean",description:h(5110,"True when the current chat response supports issue reporting.")}),n.responseIsFiltered=new P("chatSessionResponseFiltered",!1,{type:"boolean",description:h(5111,"True when the chat response was filtered out by the server.")}),n.responseHasError=new P("chatSessionResponseError",!1,{type:"boolean",description:h(5112,"True when the chat response resulted in an error.")}),n.requestInProgress=new P("chatSessionRequestInProgress",!1,{type:"boolean",description:h(5113,"True when the current request is still in progress.")}),n.isRequestPaused=new P("chatRequestIsPaused",!1,{type:"boolean",description:h(5114,"True when the current request is paused.")}),n.canRequestBePaused=new P("chatCanRequestBePaused",!1,{type:"boolean",description:h(5115,"True when the current request can be paused.")}),n.isResponse=new P("chatResponse",!1,{type:"boolean",description:h(5116,"The chat item is a response.")}),n.isRequest=new P("chatRequest",!1,{type:"boolean",description:h(5117,"The chat item is a request")}),n.itemId=new P("chatItemId","",{type:"string",description:h(5118,"The id of the chat item.")}),n.lastItemId=new P("chatLastItemId",[],{type:"string",description:h(5119,"The id of the last chat item.")}),n.editApplied=new P("chatEditApplied",!1,{type:"boolean",description:h(5120,"True when the chat text edits have been applied.")}),n.inputHasText=new P("chatInputHasText",!1,{type:"boolean",description:h(5121,"True when the chat input has text.")}),n.inputHasFocus=new P("chatInputHasFocus",!1,{type:"boolean",description:h(5122,"True when the chat input has focus.")}),n.inChatInput=new P("inChatInput",!1,{type:"boolean",description:h(5123,"True when focus is in the chat input, false otherwise.")}),n.inChatSession=new P("inChat",!1,{type:"boolean",description:h(5124,"True when focus is in the chat widget, false otherwise.")}),n.hasPromptFile=new P("chatPromptFileAttached",!1,{type:"boolean",description:h(5125,"True when the chat has a prompt file attached.")}),n.chatMode=new P("chatMode",Os.Ask,{type:"string",description:h(5126,"The current chat mode.")}),n.supported=Mt.or(a6.negate(),d6.notEqualsTo(""),Mt.has("config.chat.experimental.serverlessWebEnabled")),n.enabled=new P("chatIsEnabled",!1,{type:"boolean",description:h(5127,"True when chat is enabled because a default chat participant is activated with an implementation.")}),n.extensionParticipantRegistered=new P("chatPanelExtensionParticipantRegistered",!1,{type:"boolean",description:h(5128,"True when a default chat participant is registered for the panel from an extension.")}),n.panelParticipantRegistered=new P("chatPanelParticipantRegistered",!1,{type:"boolean",description:h(5129,"True when a default chat participant is registered for the panel.")}),n.editingParticipantRegistered=new P("chatEditingParticipantRegistered",!1,{type:"boolean",description:h(5130,"True when a default chat participant is registered for editing.")}),n.chatEditingCanUndo=new P("chatEditingCanUndo",!1,{type:"boolean",description:h(5131,"True when it is possible to undo an interaction in the editing panel.")}),n.chatEditingCanRedo=new P("chatEditingCanRedo",!1,{type:"boolean",description:h(5132,"True when it is possible to redo an interaction in the editing panel.")}),n.extensionInvalid=new P("chatExtensionInvalid",!1,{type:"boolean",description:h(5133,"True when the installed chat extension is invalid and needs to be updated.")}),n.inputCursorAtTop=new P("chatCursorAtTop",!1),n.inputHasAgent=new P("chatInputHasAgent",!1),n.location=new P("chatLocation",void 0),n.inQuickChat=new P("quickChatHasFocus",!1,{type:"boolean",description:h(5134,"True when the quick chat UI has focus, false otherwise.")}),n.hasFileAttachments=new P("chatHasFileAttachments",!1,{type:"boolean",description:h(5135,"True when the chat has file attachments.")}),n.languageModelsAreUserSelectable=new P("chatModelsAreUserSelectable",!1,{type:"boolean",description:h(5136,"True when the chat model can be selected manually by the user.")}),n.Setup={hidden:new P("chatSetupHidden",!1,!0),installed:new P("chatSetupInstalled",!1,!0),disabled:new P("chatSetupDisabled",!1,!0),later:new P("chatSetupLater",!1,!0)},n.Entitlement={signedOut:new P("chatEntitlementSignedOut",!1,!0),canSignUp:new P("chatPlanCanSignUp",!1,!0),free:new P("chatPlanFree",!1,!0),pro:new P("chatPlanPro",!1,!0),proPlus:new P("chatPlanProPlus",!1,!0),business:new P("chatPlanBusiness",!1,!0),enterprise:new P("chatPlanEnterprise",!1,!0)},n.chatQuotaExceeded=new P("chatQuotaExceeded",!1,!0),n.completionsQuotaExceeded=new P("completionsQuotaExceeded",!1,!0),n.Editing={agentModeDisallowed:new P("chatAgentModeDisallowed",void 0,{type:"boolean",description:h(5137,"True when agent mode is not allowed.")}),hasToolConfirmation:new P("chatHasToolConfirmation",!1,{type:"boolean",description:h(5138,"True when a tool confirmation is present.")})},n.Tools={toolsCount:new P("toolsCount",0,{type:"number",description:h(5139,"The count of tools available in the chat.")})},n.Modes={hasCustomChatModes:new P("chatHasCustomChatModes",!1,{type:"boolean",description:h(5140,"True when the chat has custom chat modes available.")})},n.panelLocation=new P("chatPanelLocation",void 0,{type:"number",description:h(5141,"The location of the chat panel.")})})(Sr||(Sr={}));var ak;(function(n){n.inEditingMode=Mt.or(Sr.chatMode.isEqualTo(Os.Edit),Sr.chatMode.isEqualTo(Os.Agent))})(ak||(ak={}));var Uu,bc;let lk=(bc=class extends Se{constructor(e){super(),this.contextKeyService=e,this._agents=new Map,this._onDidChangeAgents=new N,this.onDidChangeAgents=this._onDidChangeAgents.event,this._agentsContextKeys=new Set,this._hasToolsAgent=!1,this._chatParticipantDetectionProviders=new Map,this._agentCompletionProviders=new Map,this._hasDefaultAgent=Sr.enabled.bindTo(this.contextKeyService),this._extensionAgentRegistered=Sr.extensionParticipantRegistered.bindTo(this.contextKeyService),this._defaultAgentRegistered=Sr.panelParticipantRegistered.bindTo(this.contextKeyService),this._editingAgentRegistered=Sr.editingParticipantRegistered.bindTo(this.contextKeyService),this._register(e.onDidChangeContext(t=>{t.affectsSome(this._agentsContextKeys)&&this._updateContextKeys()}))}registerAgent(e,t){if(this.getAgent(e))throw new Error(`Agent already registered: ${JSON.stringify(e)}`);const s=this,r=t.slashCommands;t={...t,get slashCommands(){return r.filter(a=>!a.when||s.contextKeyService.contextMatchesRules(Mt.deserialize(a.when)))}};const o={data:t};return this._agents.set(e,o),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0),we(()=>{this._agents.delete(e),this._updateAgentsContextKeys(),this._updateContextKeys(),this._onDidChangeAgents.fire(void 0)})}_updateAgentsContextKeys(){this._agentsContextKeys.clear();for(const e of this._agents.values())if(e.data.when){const t=Mt.deserialize(e.data.when);for(const i of t?.keys()||[])this._agentsContextKeys.add(i)}}_updateContextKeys(){let e=!1,t=!1,i=!1,s=!1;for(const r of this.getAgents())r.isDefault&&(r.isCore||(t=!0),r.modes.includes(Os.Agent)?s=!0:r.modes.includes(Os.Edit)?e=!0:i=!0);this._editingAgentRegistered.set(e),this._defaultAgentRegistered.set(i),this._extensionAgentRegistered.set(t),s!==this._hasToolsAgent&&(this._hasToolsAgent=s,this._onDidChangeAgents.fire(this.getDefaultAgent(zn.Panel,Os.Agent)))}registerAgentImplementation(e,t){const i=this._agents.get(e);if(!i)throw new Error(`Unknown agent: ${JSON.stringify(e)}`);if(i.impl)throw new Error(`Agent already has implementation: ${JSON.stringify(e)}`);return i.data.isDefault&&this._hasDefaultAgent.set(!0),i.impl=t,this._onDidChangeAgents.fire(new Cf(i.data,t)),we(()=>{i.impl=void 0,this._onDidChangeAgents.fire(void 0),i.data.isDefault&&this._hasDefaultAgent.set(fn.some(this._agents.values(),s=>s.data.isDefault))})}registerDynamicAgent(e,t){e.isDynamic=!0;const i={data:e,impl:t};return this._agents.set(e.id,i),this._onDidChangeAgents.fire(new Cf(e,t)),we(()=>{this._agents.delete(e.id),this._onDidChangeAgents.fire(void 0)})}registerAgentCompletionProvider(e,t){return this._agentCompletionProviders.set(e,t),{dispose:()=>{this._agentCompletionProviders.delete(e)}}}async getAgentCompletionItems(e,t,i){return await this._agentCompletionProviders.get(e)?.(t,i)??[]}updateAgent(e,t){const i=this._agents.get(e);if(!i?.impl)throw new Error(`No activated agent with id ${JSON.stringify(e)} registered`);i.data.metadata={...i.data.metadata,...t},this._onDidChangeAgents.fire(new Cf(i.data,i.impl))}getDefaultAgent(e,t=Os.Ask){return this._preferExtensionAgent(this.getActivatedAgents().filter(i=>t&&!i.modes.includes(t)?!1:!!i.isDefault&&i.locations.includes(e)))}get hasToolsAgent(){return!!this._hasToolsAgent}getContributedDefaultAgent(e){return this._preferExtensionAgent(this.getAgents().filter(t=>!!t.isDefault&&t.locations.includes(e)))}_preferExtensionAgent(e){return S5(e,t=>!t.isCore)??e.at(-1)}getAgent(e,t=!1){if(!(!this._agentIsEnabled(e)&&!t))return this._agents.get(e)?.data}_agentIsEnabled(e){const t=typeof e=="string"?this._agents.get(e):e;return!t?.data.when||this.contextKeyService.contextMatchesRules(Mt.deserialize(t.data.when))}getAgentByFullyQualifiedId(e){const t=fn.find(this._agents.values(),i=>h6(i.data)===e)?.data;if(!(t&&!this._agentIsEnabled(t.id)))return t}getAgents(){return Array.from(this._agents.values()).map(e=>e.data).filter(e=>this._agentIsEnabled(e.id))}getActivatedAgents(){return Array.from(this._agents.values()).filter(e=>!!e.impl).filter(e=>this._agentIsEnabled(e.data.id)).map(e=>new Cf(e.data,e.impl))}getAgentsByName(e){return this._preferExtensionAgents(this.getAgents().filter(t=>t.name===e))}_preferExtensionAgents(e){const t=e.filter(i=>!i.isCore);return t.length>0?t:e}agentHasDupeName(e){const t=this.getAgent(e);return t?this.getAgentsByName(t.name).filter(i=>i.extensionId.value!==t.extensionId.value).length>0:!1}async invokeAgent(e,t,i,s,r){const o=this._agents.get(e);if(!o?.impl)throw new Error(`No activated agent with id "${e}"`);return await o.impl.invoke(t,i,s,r)}setRequestPaused(e,t,i){const s=this._agents.get(e);if(!s?.impl)throw new Error(`No activated agent with id "${e}"`);s.impl.setRequestPaused?.(t,i)}async getFollowups(e,t,i,s,r){const o=this._agents.get(e);return o?.impl?.provideFollowups?o.impl.provideFollowups(t,i,s,r):[]}async getChatTitle(e,t,i){const s=this._agents.get(e);if(s?.impl?.provideChatTitle)return s.impl.provideChatTitle(t,i)}registerChatParticipantDetectionProvider(e,t){return this._chatParticipantDetectionProviders.set(e,t),we(()=>{this._chatParticipantDetectionProviders.delete(e)})}hasChatParticipantDetectionProviders(){return this._chatParticipantDetectionProviders.size>0}async detectAgentOrCommand(e,t,i,s){const r=fn.first(this._chatParticipantDetectionProviders.values());if(!r)return;const o=this.getAgents().reduce((u,d)=>{if(d.locations.includes(i.location)){u.push({participant:d.id,disambiguation:d.disambiguation??[]});for(const f of d.slashCommands)u.push({participant:d.id,command:f.name,disambiguation:f.disambiguation??[]})}return u},[]),a=await r.provideParticipantDetection(e,t,{...i,participants:o},s);if(!a)return;const l=this.getAgent(a.participant);if(!l)return;if(!a.command)return{agent:l};const c=l?.slashCommands.find(u=>u.name===a.command);if(c)return{agent:l,command:c}}},bc.AGENT_LEADER="@",bc);lk=V([L(0,r_)],lk);class Cf{constructor(e,t){this.data=e,this.impl=t}get id(){return this.data.id}get name(){return this.data.name??""}get fullName(){return this.data.fullName??""}get description(){return this.data.description??""}get extensionId(){return this.data.extensionId}get extensionPublisherId(){return this.data.extensionPublisherId}get extensionPublisherDisplayName(){return this.data.publisherDisplayName}get extensionDisplayName(){return this.data.extensionDisplayName}get isDefault(){return this.data.isDefault}get isCore(){return this.data.isCore}get metadata(){return this.data.metadata}get slashCommands(){return this.data.slashCommands}get locations(){return this.data.locations}get modes(){return this.data.modes}get disambiguation(){return this.data.disambiguation}async invoke(e,t,i,s){return this.impl.invoke(e,t,i,s)}setRequestPaused(e,t){this.impl.setRequestPaused&&this.impl.setRequestPaused(e,t)}async provideFollowups(e,t,i,s){return this.impl.provideFollowups?this.impl.provideFollowups(e,t,i,s):[]}toJSON(){return this.data}}var Oa;let ck=(Oa=class{constructor(e,t,i,s){if(this.requestService=t,this.logService=i,this.storageService=s,this.registry=s_(this,Object.create(null)),this.disposed=!1,!e.chatParticipantRegistry)return;this.url=e.chatParticipantRegistry;const r=s.get(Uu.StorageKey,Gt.APPLICATION);try{this.registry.set(JSON.parse(r??"{}"),void 0)}catch{s.remove(Uu.StorageKey,Gt.APPLICATION)}this.refresh()}refresh(){this.disposed||this.update().catch(e=>this.logService.warn("Failed to fetch chat participant registry",e)).then(()=>us(300*1e3)).then(()=>this.refresh())}async update(){const e=await this.requestService.request({type:"GET",url:this.url},yt.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const t=await Q9(e);if(!t||t.version!==1)throw new Error("Unexpected chat participant registry response.");const i=t.restrictedChatParticipants;this.registry.set(i,void 0),this.storageService.store(Uu.StorageKey,JSON.stringify(i),Gt.APPLICATION,yw.MACHINE)}getAgentNameRestriction(e){if(e.isCore)return!0;const t=this.checkAgentNameRestriction(e.name,e).get(),i=!e.fullName||this.checkAgentNameRestriction(e.fullName.replace(/\s/g,""),e).get();return t&&i}checkAgentNameRestriction(e,t){return this.registry.map(s=>s[e.toLowerCase()]).map(s=>s?s.some(r=>co(r,r.includes(".")?t.extensionId.value:t.extensionPublisherId)):!0)}dispose(){this.disposed=!0}},Uu=Oa,Oa.StorageKey="chat.participantNameRegistry",Oa);ck=Uu=V([L(0,F9),L(1,X9),L(2,at),L(3,o6)],ck);function h6(n){return`${n.extensionId.value}.${n.id}`}function AT(n){const e="name"in n?n:{...n,name:n.id};return"extensionPublisherId"in e||(e.extensionPublisherId=e.extensionPublisher??""),"extensionDisplayName"in e||(e.extensionDisplayName=""),"extensionId"in e||(e.extensionId=new tt("")),an(e)}const f6=pe("chatAgentService");pe("chatAgentNameService");const p6=pe("chatEditingService"),v1=class v1{constructor(e,t,i){this.range=e,this.editorRange=t,this.text=i,this.kind=v1.Kind}get promptText(){return this.text}};v1.Kind="text";let zd=v1;const a_="#",g6="@",qd="/",w1=class w1{constructor(e,t,i,s,r){this.range=e,this.editorRange=t,this.variableName=i,this.variableArg=s,this.variableId=r,this.kind=w1.Kind}get text(){const e=this.variableArg?`:${this.variableArg}`:"";return`${a_}${this.variableName}${e}`}get promptText(){return this.text}};w1.Kind="var";let eg=w1;const b1=class b1{constructor(e,t,i,s,r,o){this.range=e,this.editorRange=t,this.toolName=i,this.toolId=s,this.displayName=r,this.icon=o,this.kind=b1.Kind}get text(){return`${a_}${this.toolName}`}get promptText(){return this.text}toVariableEntry(){return{kind:"tool",id:this.toolId,name:this.toolName,range:this.range,value:void 0,icon:sn.isThemeIcon(this.icon)?this.icon:void 0,fullName:this.displayName}}};b1.Kind="tool";let tg=b1;const y1=class y1{constructor(e,t,i,s,r,o){this.range=e,this.editorRange=t,this.id=i,this.name=s,this.icon=r,this.tools=o,this.kind=y1.Kind}get text(){return`${a_}${this.name}`}get promptText(){return this.text}toVariableEntry(){return{kind:"toolset",id:this.id,name:this.name,range:this.range,icon:this.icon,value:this.tools}}};y1.Kind="toolset";let ng=y1;const x1=class x1{constructor(e,t,i){this.range=e,this.editorRange=t,this.agent=i,this.kind=x1.Kind}get text(){return`${g6}${this.agent.name}`}get promptText(){return""}};x1.Kind="agent";let ig=x1;const E1=class E1{constructor(e,t,i){this.range=e,this.editorRange=t,this.command=i,this.kind=E1.Kind}get text(){return`${qd}${this.command.name}`}get promptText(){return""}};E1.Kind="subcommand";let sg=E1;const S1=class S1{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashCommand=i,this.kind=S1.Kind}get text(){return`${qd}${this.slashCommand.command}`}get promptText(){return`${qd}${this.slashCommand.command}`}};S1.Kind="slash";let rg=S1;const k1=class k1{constructor(e,t,i){this.range=e,this.editorRange=t,this.slashPromptCommand=i,this.kind=k1.Kind}get text(){return`${qd}${this.slashPromptCommand.command}`}get promptText(){return`${qd}${this.slashPromptCommand.command}`}};k1.Kind="prompt";let og=k1;const D1=class D1{constructor(e,t,i,s,r,o,a,l,c,u){this.range=e,this.editorRange=t,this.text=i,this.id=s,this.modelDescription=r,this.data=o,this.fullName=a,this.icon=l,this.isFile=c,this.isDirectory=u,this.kind=D1.Kind}get referenceText(){return this.text.replace(a_,"")}get promptText(){return this.text}toVariableEntry(){return this.id==="vscode.problems"?Ew.toEntry(this.data.filter):{kind:this.isDirectory?"directory":this.isFile?"file":"generic",id:this.id,name:this.referenceText,range:this.range,value:this.data,fullName:this.fullName,icon:this.icon}}};D1.Kind="dynamic";let ag=D1;function m6(n){return{text:n.text,parts:n.parts.map(e=>{if(e.kind===zd.Kind)return new zd(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.text);if(e.kind===eg.Kind)return new eg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.variableName,e.variableArg,e.variableId||"");if(e.kind===tg.Kind)return new tg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.toolName,e.toolId,e.displayName,e.icon);if(e.kind===ng.Kind)return new ng(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.id,e.name,e.icon,e.tools??[]);if(e.kind===ig.Kind){let t=e.agent;return t=AT(t),new ig(new Kt(e.range.start,e.range.endExclusive),e.editorRange,t)}else{if(e.kind===sg.Kind)return new sg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.command);if(e.kind===rg.Kind)return new rg(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.slashCommand);if(e.kind===og.Kind)return new og(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.slashPromptCommand);if(e.kind===ag.Kind)return new ag(new Kt(e.range.start,e.range.endExclusive),e.editorRange,e.text,e.id,e.modelDescription,an(e.data),e.fullName,e.icon,e.isFile,e.isDirectory);throw new Error(`Unknown chat request part: ${e.kind}`)}})}}var uk;(function(n){n[n.Info=0]="Info",n[n.Warning=1]="Warning",n[n.Error=2]="Error"})(uk||(uk={}));function _6(n){return!!n&&typeof n=="object"&&"uri"in n&&n.uri instanceof x&&"version"in n&&typeof n.version=="number"&&"ranges"in n&&Array.isArray(n.ranges)&&n.ranges.every(et.isIRange)}function v6(n){return!!n&&typeof n=="object"&&"documents"in n&&Array.isArray(n.documents)&&n.documents.every(_6)}var dk;(function(n){n[n.Complete=1]="Complete",n[n.Partial=2]="Partial",n[n.Omitted=3]="Omitted"})(dk||(dk={}));var lg;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(lg||(lg={}));var hk;(function(n){n.IncorrectCode="incorrectCode",n.DidNotFollowInstructions="didNotFollowInstructions",n.IncompleteCode="incompleteCode",n.MissingContext="missingContext",n.PoorlyWrittenOrFormatted="poorlyWrittenOrFormatted",n.RefusedAValidRequest="refusedAValidRequest",n.OffensiveOrUnsafe="offensiveOrUnsafe",n.Other="other",n.WillReportIssue="willReportIssue"})(hk||(hk={}));var fk;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(fk||(fk={}));function w6(n,e){return new b6(typeof n=="string"?n:new So(n,void 0,void 0),e)}class b6 extends i_{constructor(e,t){super(),this.event=t,this.handleEvent=()=>{Bd(i=>{for(const s of this._observers)i.updateObserver(s,this),s.handleChange(this,void 0)},()=>this.debugName)},this.debugName=typeof e=="string"?e:e.getDebugName(this)??"Observable Signal From Event"}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}class Gx{static fromFn(e){return new Gx(e())}constructor(e){this._value=s_(this,void 0),this.promiseResult=this._value,this.resolvedValue=GL(this,t=>{const i=this.promiseResult.read(t);if(i)return i.getDataOrThrow()}),this.promise=e.then(t=>(Bd(i=>{this._value.set(new pk(t,void 0),i)}),t),t=>{throw Bd(i=>{this._value.set(new pk(void 0,t),i)}),t})}}class pk{constructor(e,t){this.data=e,this.error=t}getDataOrThrow(){if(this.error)throw this.error;return this.data}}var xw,gk;(function(n){n[n.NotOmitted=0]="NotOmitted",n[n.Partial=1]="Partial",n[n.Full=2]="Full"})(gk||(gk={}));var Ew;(function(n){n.icon=_e.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=h(5153,"All Problems");return r.filterUri&&(a=h(5154,"Problems in {0}",Ks(r.filterUri))),a}n.label=s})(Ew||(Ew={}));var mk;(function(n){function e(t){return x.isUri(t.value)?t.value:IL(t.value)?t.value.uri:void 0}n.toUri=e})(mk||(mk={}));function y6(n){return n.kind==="image"}const li={reason:"other"};class _k{get session(){return this._session}get username(){return this.session.requesterUsername}get avatarIconUri(){return this.session.requesterAvatarIconUri}get attempt(){return this._attempt}get variableData(){return this._variableData}set variableData(e){this._variableData=e}get confirmation(){return this._confirmation}get locationData(){return this._locationData}get attachedContext(){return this._attachedContext}get editedFileEvents(){return this._editedFileEvents}constructor(e){this._session=e.session,this.message=e.message,this._variableData=e.variableData,this.timestamp=e.timestamp,this._attempt=e.attempt??0,this._confirmation=e.confirmation,this._locationData=e.locationData,this._attachedContext=e.attachedContext,this.isCompleteAddedRequest=e.isCompleteAddedRequest??!1,this.modelId=e.modelId,this.id=e.restoredId??"request_"+Sn(),this._editedFileEvents=e.editedFileEvents}adoptTo(e){this._session=e}}class RT{get value(){return this._responseParts}constructor(e){this._responseRepr="",this._markdownContent="",this._responseParts=e,this._updateRepr()}toString(){return this._responseRepr}getMarkdown(){return this._markdownContent}_updateRepr(){this._responseRepr=this.partsToRepr(this._responseParts),this._markdownContent=this._responseParts.map(e=>e.kind==="inlineReference"?this.inlineRefToRepr(e):e.kind==="markdownContent"||e.kind==="markdownVuln"?e.content.value:"").filter(e=>e.length>0).join("")}partsToRepr(e){const t=[];let i=[];for(const s of e){let r;switch(s.kind){case"treeData":case"progressMessage":case"codeblockUri":case"toolInvocation":case"toolInvocationSerialized":case"extensions":case"undoStop":case"prepareToolInvocation":continue;case"inlineReference":r={text:this.inlineRefToRepr(s)};break;case"command":r={text:s.command.title,isBlock:!0};break;case"textEditGroup":case"notebookEditGroup":r={text:h(5155,"Made changes."),isBlock:!0};break;case"confirmation":r={text:`${s.title}
|
|
91
91
|
${s.message}`,isBlock:!0};break;default:r={text:s.content.value};break}r.isBlock?(i.length&&(t.push(i.join("")),i=[]),t.push(r.text)):i.push(r.text)}return i.length&&t.push(i.join("")),t.join(`
|
|
92
92
|
|
|
93
93
|
`)}inlineRefToRepr(e){return"uri"in e.inlineReference?this.uriToRepr(e.inlineReference.uri):"name"in e.inlineReference?"`"+e.inlineReference.name+"`":this.uriToRepr(e.inlineReference)}uriToRepr(e){return e.scheme===le.http||e.scheme===le.https?e.toString(!1):Ks(e)}}class x6 extends RT{constructor(e,t){let i=e.value.findIndex(s=>s.kind==="undoStop"&&s.id===t);e.value[i+1]?.kind==="codeblockUri"&&e.value[i-1]?.kind==="markdownContent"&&i--,super(i===-1?e.value.slice():e.value.slice(0,i)),this.undoStop=t}}class E6 extends RT{get onDidChangeValue(){return this._onDidChangeValue.event}constructor(e){super(Ri(e).map(t=>Fr(t)?{content:t,kind:"markdownContent"}:"kind"in t?t:{kind:"treeData",treeData:t})),this._onDidChangeValue=new N,this._citations=[]}dispose(){this._onDidChangeValue.dispose()}clear(){this._responseParts=[],this._updateRepr(!0)}updateContent(e,t){if(e.kind==="markdownContent"){const i=this._responseParts.filter(s=>s.kind!=="textEditGroup").at(-1);if(!i||i.kind!=="markdownContent"||!D6(i.content,e.content))this._responseParts.push(e);else{const s=this._responseParts.indexOf(i);this._responseParts[s]={...i,content:I6(i.content,e.content)}}this._updateRepr(t)}else if(e.kind==="textEdit"||e.kind==="notebookEdit"){const s=e.uri.scheme===le.vscodeNotebookCell&&!this._responseParts.find(c=>c.kind==="notebookEditGroup")?void 0:Xp.parse(e.uri)?.notebook,r=s??e.uri;let o=!1;const a=e.kind==="textEdit"&&!s?"textEditGroup":"notebookEditGroup",l=a==="textEditGroup"?e.edits:e.edits.map(c=>CL.isTextEdit(c)?{uri:e.uri,edit:c}:c);for(let c=0;!o&&c<this._responseParts.length;c++){const u=this._responseParts[c];u.kind===a&&!u.done&&tc(u.uri,r)&&(u.edits.push(l),u.done=e.done,o=!0)}o||this._responseParts.push({kind:a,uri:r,edits:a==="textEditGroup"?[l]:l,done:e.done}),this._updateRepr(t)}else if(e.kind==="progressTask"){const i=this._responseParts.push(e)-1;this._updateRepr(t);const s=e.onDidAddProgress(()=>{this._updateRepr(!1)});e.task?.().then(r=>{s.dispose(),typeof r=="string"&&(this._responseParts[i].content=new Mc(r)),this._updateRepr(!1)})}else e.kind==="toolInvocation"?(e.confirmationMessages&&e.confirmed.p.then(()=>{this._updateRepr(!1)}),e.isCompletePromise.then(()=>{this._updateRepr(!1)}),this._responseParts.push(e),this._updateRepr(t)):(this._responseParts.push(e),this._updateRepr(t))}addCitation(e){this._citations.push(e),this._updateRepr()}_updateRepr(e){super._updateRepr(),this._onDidChangeValue&&(this._responseRepr+=this._citations.length?`
|
|
@@ -97,7 +97,7 @@ ${s.message}`,isBlock:!0};break;default:r={text:s.content.value};break}r.isBlock
|
|
|
97
97
|
Its package.json#enabledApiProposals-property declares: ${n.enabledApiProposals?.join(", ")??"[]"} but NOT ${e}.
|
|
98
98
|
The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${n.identifier.value}`)}var kw;(function(n){n[n.Normal=0]="Normal",n[n.Immediate=1]="Immediate"})(kw||(kw={}));const B6=pe("extensionService"),W6="vscode://schemas/vscode-product",V6={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiSettingsSearch:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiSettingsSearch.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts",version:2},authIssuers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authIssuers.d.ts"},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatEditing:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatEditing.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts"},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:9},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts"},chatReferenceBinaryData:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts"},chatReferenceDiagnostic:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceDiagnostic.d.ts"},chatStatusItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatStatusItem.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDebugCreateConfiguration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribLanguageModelToolSets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLanguageModelToolSets.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlHistoryTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryTitleMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewContainerTitle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewContainerTitle.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts",version:4},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider2.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts",version:2},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles2.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},idToken:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},inlineEdit:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelCapabilities:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelCapabilities.d.ts"},languageModelDataPart:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelDataPart.d.ts",version:3},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},nativeWindowHandle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.nativeWindowHandle.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookReplDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickInputButtonLocation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},statusBarItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.statusBarItemTooltip.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},taskProblemMatcherStatus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskProblemMatcherStatus.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalCompletionProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellEnv:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textEditorDiffInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts"},textSearchComplete2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchComplete2.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider2.d.ts"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},toolProgress:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolProgress.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},valueSelectionInQuickPick:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.valueSelectionInQuickPick.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},ug=Object.freeze(V6),Qx=mn.as(o_.JSONContribution);class od{static _toSet(e){const t=new nl;for(let i=0,s=e.length;i<s;i++)t.add(e[i].description.identifier);return t}static compute(e,t){if(!e||!e.length)return new od(t,[]);if(!t||!t.length)return new od([],e);const i=this._toSet(e),s=this._toSet(t),r=t.filter(a=>!i.has(a.description.identifier)),o=e.filter(a=>!s.has(a.description.identifier));return new od(r,o)}constructor(e,t){this.added=e,this.removed=t}}class z6{constructor(e,t,i){this.name=e,this.defaultExtensionKind=t,this.canHandleResolver=i,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw new Error("Handler already set!");return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=od.compute(this._users,e),this._users=e,this._handle()}_handle(){if(!(this._handler===null||this._users===null||this._delta===null))try{this._handler(this._users,this._delta)}catch(e){On(e)}}}const q6={type:"string",enum:["ui","workspace"],enumDescriptions:[h(12587,"UI extension kind. In a remote window, such extensions are enabled only when available on the local machine."),h(12588,"Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.")]},LT="vscode://schemas/vscode-extensions",Dw={properties:{engines:{type:"object",description:h(12589,"Engine compatibility."),properties:{vscode:{type:"string",description:h(12590,"For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^0.10.5 indicates compatibility with a minimum VS Code version of 0.10.5."),default:"^1.22.0"}}},publisher:{description:h(12591,"The publisher of the VS Code extension."),type:"string"},displayName:{description:h(12592,"The display name for the extension used in the VS Code gallery."),type:"string"},categories:{description:h(12593,"The categories used by the VS Code gallery to categorize the extension."),type:"array",uniqueItems:!0,items:{oneOf:[{type:"string",enum:XR},{type:"string",const:"Languages",deprecationMessage:h(12594,"Use 'Programming Languages' instead")}]}},galleryBanner:{type:"object",description:h(12595,"Banner used in the VS Code marketplace."),properties:{color:{description:h(12596,"The banner color on the VS Code marketplace page header."),type:"string"},theme:{description:h(12597,"The color theme for the font used in the banner."),type:"string",enum:["dark","light"]}}},contributes:{description:h(12598,"All contributions of the VS Code extension represented by this package."),type:"object",properties:{},default:{}},preview:{type:"boolean",description:h(12599,"Sets the extension to be flagged as a Preview in the Marketplace.")},enableProposedApi:{type:"boolean",deprecationMessage:h(12600,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:h(12601,"Enable API proposals to try them out. Only valid **during development**. Extensions **cannot be published** with this property. For more details visit: https://code.visualstudio.com/api/advanced-topics/using-proposed-api"),type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(ug).map(n=>n),markdownEnumDescriptions:Object.values(ug).map(n=>n.proposal)}},api:{markdownDescription:h(12602,"Describe the API provided by this extension. For more details visit: https://code.visualstudio.com/api/advanced-topics/remote-extensions#handling-dependencies-with-remote-extensions"),type:"string",enum:["none"],enumDescriptions:[h(12603,"Give up entirely the ability to export any APIs. This allows other extensions that depend on this extension to run in a separate extension host process or in a remote machine.")]},activationEvents:{description:h(12604,"Activation events for the VS Code extension."),type:"array",items:{type:"string",defaultSnippets:[{label:"onWebviewPanel",description:h(12605,"An activation event emmited when a webview is loaded of a certain viewType"),body:"onWebviewPanel:viewType"},{label:"onLanguage",description:h(12606,"An activation event emitted whenever a file that resolves to the specified language gets opened."),body:"onLanguage:${1:languageId}"},{label:"onCommand",description:h(12607,"An activation event emitted whenever the specified command gets invoked."),body:"onCommand:${2:commandId}"},{label:"onDebug",description:h(12608,"An activation event emitted whenever a user is about to start debugging or about to setup debug configurations."),body:"onDebug"},{label:"onDebugInitialConfigurations",description:h(12609,'An activation event emitted whenever a "launch.json" needs to be created (and all provideDebugConfigurations methods need to be called).'),body:"onDebugInitialConfigurations"},{label:"onDebugDynamicConfigurations",description:h(12610,'An activation event emitted whenever a list of all debug configurations needs to be created (and all provideDebugConfigurations methods for the "dynamic" scope need to be called).'),body:"onDebugDynamicConfigurations"},{label:"onDebugResolve",description:h(12611,"An activation event emitted whenever a debug session with the specific type is about to be launched (and a corresponding resolveDebugConfiguration method needs to be called)."),body:"onDebugResolve:${6:type}"},{label:"onDebugAdapterProtocolTracker",description:h(12612,"An activation event emitted whenever a debug session with the specific type is about to be launched and a debug protocol tracker might be needed."),body:"onDebugAdapterProtocolTracker:${6:type}"},{label:"workspaceContains",description:h(12613,"An activation event emitted whenever a folder is opened that contains at least a file matching the specified glob pattern."),body:"workspaceContains:${4:filePattern}"},{label:"onStartupFinished",description:h(12614,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:"onStartupFinished"},{label:"onTaskType",description:h(12615,"An activation event emitted whenever tasks of a certain type need to be listed or resolved."),body:"onTaskType:${1:taskType}"},{label:"onFileSystem",description:h(12616,"An activation event emitted whenever a file or folder is accessed with the given scheme."),body:"onFileSystem:${1:scheme}"},{label:"onEditSession",description:h(12617,"An activation event emitted whenever an edit session is accessed with the given scheme."),body:"onEditSession:${1:scheme}"},{label:"onSearch",description:h(12618,"An activation event emitted whenever a search is started in the folder with the given scheme."),body:"onSearch:${7:scheme}"},{label:"onView",body:"onView:${5:viewId}",description:h(12619,"An activation event emitted whenever the specified view is expanded.")},{label:"onUri",body:"onUri",description:h(12620,"An activation event emitted whenever a system-wide Uri directed towards this extension is open.")},{label:"onOpenExternalUri",body:"onOpenExternalUri",description:h(12621,"An activation event emitted whenever a external uri (such as an http or https link) is being opened.")},{label:"onCustomEditor",body:"onCustomEditor:${9:viewType}",description:h(12622,"An activation event emitted whenever the specified custom editor becomes visible.")},{label:"onNotebook",body:"onNotebook:${1:type}",description:h(12623,"An activation event emitted whenever the specified notebook document is opened.")},{label:"onAuthenticationRequest",body:"onAuthenticationRequest:${11:authenticationProviderId}",description:h(12624,"An activation event emitted whenever sessions are requested from the specified authentication provider.")},{label:"onRenderer",description:h(12625,"An activation event emitted whenever a notebook output renderer is used."),body:"onRenderer:${11:rendererId}"},{label:"onTerminalProfile",body:"onTerminalProfile:${1:terminalId}",description:h(12626,"An activation event emitted when a specific terminal profile is launched.")},{label:"onTerminalQuickFixRequest",body:"onTerminalQuickFixRequest:${1:quickFixId}",description:h(12627,"An activation event emitted when a command matches the selector associated with this ID")},{label:"onWalkthrough",body:"onWalkthrough:${1:walkthroughID}",description:h(12628,"An activation event emitted when a specified walkthrough is opened.")},{label:"onIssueReporterOpened",body:"onIssueReporterOpened",description:h(12629,"An activation event emitted when the issue reporter is opened.")},{label:"onChatParticipant",body:"onChatParticipant:${1:participantId}",description:h(12630,"An activation event emitted when the specified chat participant is invoked.")},{label:"onLanguageModelTool",body:"onLanguageModelTool:${1:toolId}",description:h(12631,"An activation event emitted when the specified language model tool is invoked.")},{label:"onTerminalCompletionsRequested",body:"onTerminalCompletionsRequested",description:h(12632,"An activation event emitted when terminal completions are requested.")},{label:"onMcpCollection",description:h(12633,"An activation event emitted whenver a tool from the MCP server is requested."),body:"onMcpCollection:${2:collectionId}"},{label:"*",description:h(12634,"An activation event emitted on VS Code startup. To ensure a great end user experience, please use this activation event in your extension only when no other activation events combination works in your use-case."),body:"*"}]}},badges:{type:"array",description:h(12635,"Array of badges to display in the sidebar of the Marketplace's extension page."),items:{type:"object",required:["url","href","description"],properties:{url:{type:"string",description:h(12636,"Badge image URL.")},href:{type:"string",description:h(12637,"Badge link.")},description:{type:"string",description:h(12638,"Badge description.")}}}},markdown:{type:"string",description:h(12639,"Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard."),enum:["github","standard"],default:"github"},qna:{default:"marketplace",description:h(12640,"Controls the Q&A link in the Marketplace. Set to marketplace to enable the default Marketplace Q & A site. Set to a string to provide the URL of a custom Q & A site. Set to false to disable Q & A altogether."),anyOf:[{type:["string","boolean"],enum:["marketplace",!1]},{type:"string"}]},extensionDependencies:{description:h(12641,"Dependencies to other extensions. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:bk}},extensionPack:{description:h(12642,"A set of extensions that can be installed together. The identifier of an extension is always ${publisher}.${name}. For example: vscode.csharp."),type:"array",uniqueItems:!0,items:{type:"string",pattern:bk}},extensionKind:{description:h(12643,"Define the kind of an extension. `ui` extensions are installed and run on the local machine while `workspace` extensions run on the remote."),type:"array",items:q6,default:["workspace"],defaultSnippets:[{body:["ui"],description:h(12644,"Define an extension which can run only on the local machine when connected to remote window.")},{body:["workspace"],description:h(12645,"Define an extension which can run only on the remote machine when connected remote window.")},{body:["ui","workspace"],description:h(12646,"Define an extension which can run on either side, with a preference towards running on the local machine.")},{body:["workspace","ui"],description:h(12647,"Define an extension which can run on either side, with a preference towards running on the remote machine.")},{body:[],description:h(12648,"Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.")}]},capabilities:{description:h(12649,"Declare the set of supported capabilities by the extension."),type:"object",properties:{virtualWorkspaces:{description:h(12650,"Declares whether the extension should be enabled in virtual workspaces. A virtual workspace is a workspace which is not backed by any on-disk resources. When false, this extension will be automatically disabled in virtual workspaces. Default is true."),type:["boolean","object"],defaultSnippets:[{label:"limited",body:{supported:"${1:limited}",description:"${2}"}},{label:"false",body:{supported:!1,description:"${2}"}}],default:(!0).valueOf,properties:{supported:{markdownDescription:h(12651,"Declares the level of support for virtual workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[h(12652,"The extension will be enabled in virtual workspaces with some functionality disabled."),h(12653,"The extension will be enabled in virtual workspaces with all functionality enabled."),h(12654,"The extension will not be enabled in virtual workspaces.")]},description:{type:"string",markdownDescription:h(12655,"A description of how virtual workspaces affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}},untrustedWorkspaces:{description:h(12656,"Declares how the extension should be handled in untrusted workspaces."),type:"object",required:["supported"],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:h(12657,"Declares the level of support for untrusted workspaces by the extension."),type:["string","boolean"],enum:["limited",!0,!1],enumDescriptions:[h(12658,"The extension will be enabled in untrusted workspaces with some functionality disabled."),h(12659,"The extension will be enabled in untrusted workspaces with all functionality enabled."),h(12660,"The extension will not be enabled in untrusted workspaces.")]},restrictedConfigurations:{description:h(12661,"A list of configuration keys contributed by the extension that should not use workspace values in untrusted workspaces."),type:"array",items:{type:"string"}},description:{type:"string",markdownDescription:h(12662,"A description of how workspace trust affects the extensions behavior and why it is needed. This only applies when `supported` is not `true`.")}}}}},sponsor:{description:h(12663,"Specify the location from where users can sponsor your extension."),type:"object",defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:h(12664,"URL from where users can sponsor your extension. It must be a valid URL with a HTTP or HTTPS protocol. Example value: https://github.com/sponsors/nvaccess"),type:"string"}}},scripts:{type:"object",properties:{"vscode:prepublish":{description:h(12665,"Script executed before the package is published as a VS Code extension."),type:"string"},"vscode:uninstall":{description:h(12666,"Uninstall hook for VS Code extension. Script that gets executed when the extension is completely uninstalled from VS Code which is when VS Code is restarted (shutdown and start) after the extension is uninstalled. Only Node scripts are supported."),type:"string"}}},icon:{type:"string",description:h(12667,"The path to a 128x128 pixel icon.")},l10n:{type:"string",description:h(12668,"The relative path to a folder containing localization (bundle.l10n.*.json) files. Must be specified if you are using the vscode.l10n API.")},pricing:{type:"string",markdownDescription:h(12669,"The pricing information for the extension. Can be Free (default) or Trial. For more details visit: https://code.visualstudio.com/api/working-with-extensions/publishing-extension#extension-pricing-label"),enum:["Free","Trial"],default:"Free"}}};class j6{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw new Error("Duplicate extension point: "+e.extensionPoint);const t=new z6(e.extensionPoint,e.defaultExtensionKind,e.canHandleResolver);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&$6.register(e.extensionPoint,e.activationEventsGenerator),Dw.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,Qx.registerSchema(LT,Dw),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}}const NT={ExtensionsRegistry:"ExtensionsRegistry"};mn.add(NT.ExtensionsRegistry,new j6);const OT=mn.as(NT.ExtensionsRegistry);Qx.registerSchema(LT,Dw);Qx.registerSchema(W6,{properties:{extensionEnabledApiProposals:{description:h(12670,"API proposals that the respective extensions can freely use."),type:"object",properties:{},additionalProperties:{anyOf:[{type:"array",uniqueItems:!0,items:{type:"string",enum:Object.keys(ug),markdownEnumDescriptions:Object.values(ug).map(n=>n.proposal)}}]}}}});var ur;(function(n){n[n.System=0]="System",n[n.User=1]="User",n[n.Assistant=2]="Assistant"})(ur||(ur={}));var Lk;(function(n){n.PNG="image/png",n.JPEG="image/jpeg",n.GIF="image/gif",n.WEBP="image/webp",n.BMP="image/bmp"})(Lk||(Lk={}));var Nk;(function(n){n.Low="low",n.High="high"})(Nk||(Nk={}));const Ok={type:"object",properties:{vendor:{type:"string",description:h(5173,"A globally unique vendor of language models.")}}},G6=OT.registerExtensionPoint({extensionPoint:"languageModels",jsonSchema:{description:h(5174,"Contribute language models of a specific vendor."),oneOf:[Ok,{type:"array",items:Ok}]},activationEventsGenerator:(n,e)=>{for(const t of n)e.push(`onLanguageModelChat:${t.vendor}`)}});let Fk=class{constructor(e,t,i){this._extensionService=e,this._logService=t,this._contextKeyService=i,this._store=new xe,this._providers=new Map,this._vendors=new Set,this._onDidChangeProviders=this._store.add(new N),this.onDidChangeLanguageModels=this._onDidChangeProviders.event,this._hasUserSelectableModels=Sr.languageModelsAreUserSelectable.bindTo(this._contextKeyService),this._store.add(G6.setHandler(s=>{this._vendors.clear();for(const o of s){if(!dt(o.description,"chatProvider")){o.collector.error(h(5175,"This contribution point requires the 'chatProvider' proposal."));continue}for(const a of fn.wrap(o.value)){if(this._vendors.has(a.vendor)){o.collector.error(h(5176,"The vendor '{0}' is already registered and cannot be registered twice",a.vendor));continue}if(Od(a.vendor)){o.collector.error(h(5177,"The vendor field cannot be empty."));continue}if(a.vendor.trim()!==a.vendor){o.collector.error(h(5178,"The vendor field cannot start or end with whitespace."));continue}this._vendors.add(a.vendor)}}const r=[];for(const[o,a]of this._providers)this._vendors.has(a.metadata.vendor)||(this._providers.delete(o),r.push(o));r.length>0&&this._onDidChangeProviders.fire({removed:r})}))}dispose(){this._store.dispose(),this._providers.clear()}getLanguageModelIds(){return Array.from(this._providers.keys())}lookupLanguageModel(e){return this._providers.get(e)?.metadata}async selectLanguageModels(e){if(e.vendor)await this._extensionService.activateByEvent(`onLanguageModelChat:${e.vendor}}`);else{const i=Array.from(this._vendors).map(s=>this._extensionService.activateByEvent(`onLanguageModelChat:${s}`));await Promise.all(i)}const t=[];for(const[i,s]of this._providers)(e.vendor===void 0||s.metadata.vendor===e.vendor)&&(e.family===void 0||s.metadata.family===e.family)&&(e.version===void 0||s.metadata.version===e.version)&&(e.id===void 0||s.metadata.id===e.id)&&(!s.metadata.targetExtensions||s.metadata.targetExtensions.some(r=>tt.equals(r,e.extension)))&&t.push(i);return this._logService.trace("[LM] selected language models",e,t),t}registerLanguageModelChat(e,t){if(this._logService.trace("[LM] registering language model chat",e,t.metadata),!this._vendors.has(t.metadata.vendor))throw new Error(`Chat response provider uses UNKNOWN vendor ${t.metadata.vendor}.`);if(this._providers.has(e))throw new Error(`Chat response provider with identifier ${e} is already registered.`);return this._providers.set(e,t),this._onDidChangeProviders.fire({added:[{identifier:e,metadata:t.metadata}]}),this.updateUserSelectableModelsContext(),we(()=>{this.updateUserSelectableModelsContext(),this._providers.delete(e)&&(this._onDidChangeProviders.fire({removed:[e]}),this._logService.trace("[LM] UNregistered language model chat",e,t.metadata))})}updateUserSelectableModelsContext(){const e=Array.from(this._providers.values()).some(i=>i.metadata.isUserSelectable&&!i.metadata.isDefault),t=Array.from(this._providers.values()).some(i=>i.metadata.isDefault);this._hasUserSelectableModels.set(e&&t)}async sendChatRequest(e,t,i,s,r){const o=this._providers.get(e);if(!o)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return o.sendChatRequest(i,t,s,r)}computeTokenLength(e,t,i){const s=this._providers.get(e);if(!s)throw new Error(`Chat response provider with identifier ${e} is not registered.`);return s.provideTokenCount(t,i)}};Fk=V([L(0,B6),L(1,at),L(2,r_)],Fk);new P("debugType",void 0,{type:"string",description:h(6109,"Debug type of the active debug session. For example 'python'.")});new P("debugConfigurationType",void 0,{type:"string",description:h(6110,"Debug type of the selected launch configuration. For example 'python'.")});new P("debugState","inactive",{type:"string",description:h(6111,"State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.")});const K6="debugUx";new P(K6,"default",{type:"string",description:h(6112,"Debug UX state. When there are no debug configurations it is 'simple', otherwise 'default'. Used to decide when to show welcome views in the debug viewlet.")});new P("hasDebugged",!1,{type:"boolean",description:h(6113,"True when a debug session has been started at least once, false otherwise.")});new P("inDebugMode",!1,{type:"boolean",description:h(6114,"True when debugging, false otherwise.")});new P("inDebugRepl",!1,{type:"boolean",description:h(6115,"True when focus is in the debug console, false otherwise.")});new P("breakpointWidgetVisible",!1,{type:"boolean",description:h(6116,"True when breakpoint editor zone widget is visible, false otherwise.")});new P("inBreakpointWidget",!1,{type:"boolean",description:h(6117,"True when focus is in the breakpoint editor zone widget, false otherwise.")});new P("breakpointsFocused",!0,{type:"boolean",description:h(6118,"True when the BREAKPOINTS view is focused, false otherwise.")});new P("watchExpressionsFocused",!0,{type:"boolean",description:h(6119,"True when the WATCH view is focused, false otherwise.")});new P("watchExpressionsExist",!1,{type:"boolean",description:h(6120,"True when at least one watch expression exists, false otherwise.")});new P("variablesFocused",!0,{type:"boolean",description:h(6121,"True when the VARIABLES views is focused, false otherwise")});new P("expressionSelected",!1,{type:"boolean",description:h(6122,"True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.")});new P("breakpointInputFocused",!1,{type:"boolean",description:h(6123,"True when the input box has focus in the BREAKPOINTS view.")});new P("callStackItemType",void 0,{type:"string",description:h(6124,"Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'")});new P("callStackSessionIsAttach",!1,{type:"boolean",description:h(6125,"True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.")});new P("callStackItemStopped",!1,{type:"boolean",description:h(6126,"True when the focused item in the CALL STACK is stopped. Used internaly for inline menus in the CALL STACK view.")});new P("callStackSessionHasOneThread",!1,{type:"boolean",description:h(6127,"True when the focused session in the CALL STACK view has exactly one thread. Used internally for inline menus in the CALL STACK view.")});new P("callStackFocused",!0,{type:"boolean",description:h(6128,"True when the CALLSTACK view is focused, false otherwise.")});new P("watchItemType",void 0,{type:"string",description:h(6129,"Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'")});new P("canViewMemory",void 0,{type:"boolean",description:h(6130,"Indicates whether the item in the view has an associated memory refrence.")});new P("breakpointItemType",void 0,{type:"string",description:h(6131,"Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakppint', 'functionBreakpoint', 'dataBreakpoint'")});new P("breakpointItemBytes",void 0,{type:"boolean",description:h(6132,"Whether the breakpoint item is a data breakpoint on a byte range.")});new P("breakpointHasModes",!1,{type:"boolean",description:h(6133,"Whether the breakpoint has multiple modes it can switch to.")});new P("breakpointSupportsCondition",!1,{type:"boolean",description:h(6134,"True when the focused breakpoint supports conditions.")});new P("loadedScriptsSupported",!1,{type:"boolean",description:h(6135,"True when the focused sessions supports the LOADED SCRIPTS view")});new P("loadedScriptsItemType",void 0,{type:"string",description:h(6136,"Represents the item type of the focused element in the LOADED SCRIPTS view.")});new P("focusedSessionIsAttach",!1,{type:"boolean",description:h(6137,"True when the focused session is 'attach'.")});new P("focusedSessionIsNoDebug",!1,{type:"boolean",description:h(6138,"True when the focused session is run without debugging.")});new P("stepBackSupported",!1,{type:"boolean",description:h(6139,"True when the focused session supports 'stepBack' requests.")});new P("restartFrameSupported",!1,{type:"boolean",description:h(6140,"True when the focused session supports 'restartFrame' requests.")});new P("stackFrameSupportsRestart",!1,{type:"boolean",description:h(6141,"True when the focused stack frame supports 'restartFrame'.")});new P("jumpToCursorSupported",!1,{type:"boolean",description:h(6142,"True when the focused session supports 'jumpToCursor' request.")});new P("stepIntoTargetsSupported",!1,{type:"boolean",description:h(6143,"True when the focused session supports 'stepIntoTargets' request.")});new P("breakpointsExist",!1,{type:"boolean",description:h(6144,"True when at least one breakpoint exists.")});new P("debuggersAvailable",!1,{type:"boolean",description:h(6145,"True when there is at least one debug extensions active.")});new P("debugExtensionAvailable",!0,{type:"boolean",description:h(6146,"True when there is at least one debug extension installed and enabled.")});new P("debugProtocolVariableMenuContext",void 0,{type:"string",description:h(6147,"Represents the context the debug adapter sets on the focused variable in the VARIABLES view.")});new P("debugSetVariableSupported",!1,{type:"boolean",description:h(6148,"True when the focused session supports 'setVariable' request.")});new P("debugSetDataBreakpointAddressSupported",!1,{type:"boolean",description:h(6149,"True when the focused session supports 'getBreakpointInfo' request on an address.")});new P("debugSetExpressionSupported",!1,{type:"boolean",description:h(6150,"True when the focused session supports 'setExpression' request.")});new P("breakWhenValueChangesSupported",!1,{type:"boolean",description:h(6151,"True when the focused session supports to break when value changes.")});new P("breakWhenValueIsAccessedSupported",!1,{type:"boolean",description:h(6152,"True when the focused breakpoint supports to break when value is accessed.")});new P("breakWhenValueIsReadSupported",!1,{type:"boolean",description:h(6153,"True when the focused breakpoint supports to break when value is read.")});new P("terminateDebuggeeSupported",!1,{type:"boolean",description:h(6154,"True when the focused session supports the terminate debuggee capability.")});new P("suspendDebuggeeSupported",!1,{type:"boolean",description:h(6155,"True when the focused session supports the suspend debuggee capability.")});new P("variableEvaluateNamePresent",!1,{type:"boolean",description:h(6156,"True when the focused variable has an 'evalauteName' field set.")});new P("variableIsReadonly",!1,{type:"boolean",description:h(6157,"True when the focused variable is read-only.")});new P("variableValue",!1,{type:"string",description:h(6158,"Value of the variable, present for debug visualization clauses.")});new P("variableType",!1,{type:"string",description:h(6159,"Type of the variable, present for debug visualization clauses.")});new P("variableInterfaces",!1,{type:"array",description:h(6160,"Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.")});new P("variableName",!1,{type:"string",description:h(6161,"Name of the variable, present for debug visualization clauses.")});new P("variableLanguage",!1,{type:"string",description:h(6162,"Language of the variable source, present for debug visualization clauses.")});new P("variableExtensionId",!1,{type:"string",description:h(6163,"Extension ID of the variable source, present for debug visualization clauses.")});new P("exceptionWidgetVisible",!1,{type:"boolean",description:h(6164,"True when the exception widget is visible.")});new P("multiSessionRepl",!1,{type:"boolean",description:h(6165,"True when there is more than 1 debug console.")});new P("multiSessionDebug",!1,{type:"boolean",description:h(6166,"True when there is more than 1 active debug session.")});new P("disassembleRequestSupported",!1,{type:"boolean",description:h(6167,"True when the focused sessions supports disassemble request.")});new P("disassemblyViewFocus",!1,{type:"boolean",description:h(6168,"True when the Disassembly View is focused.")});new P("languageSupportsDisassembleRequest",!1,{type:"boolean",description:h(6169,"True when the language in the current editor supports disassemble request.")});new P("focusedStackFrameHasInstructionReference",!1,{type:"boolean",description:h(6170,"True when the focused stack frame has instruction pointer reference.")});h(6172,"Controls when the internal Debug Console should open.");var Mk;(function(n){n[n.Inactive=0]="Inactive",n[n.Initializing=1]="Initializing",n[n.Stopped=2]="Stopped",n[n.Running=3]="Running"})(Mk||(Mk={}));var Uk;(function(n){n[n.Valid=0]="Valid",n[n.Unreadable=1]="Unreadable",n[n.Error=2]="Error"})(Uk||(Uk={}));var $k;(function(n){n[n.Variable=0]="Variable",n[n.Address=1]="Address"})($k||($k={}));var dg;(function(n){n[n.Initial=1]="Initial",n[n.Dynamic=2]="Dynamic"})(dg||(dg={}));var Hk;(function(n){n.UnverifiedBreakpoints="unverifiedBreakpoints"})(Hk||(Hk={}));var Bk;(function(n){n[n.CONDITION=0]="CONDITION",n[n.HIT_COUNT=1]="HIT_COUNT",n[n.LOG_MESSAGE=2]="LOG_MESSAGE",n[n.TRIGGER_POINT=3]="TRIGGER_POINT"})(Bk||(Bk={}));var hg;(function(n){n[n.Command=0]="Command",n[n.Tree=1]="Tree"})(hg||(hg={}));var Iw;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(Iw||(Iw={}));var Wk;(function(n){n.deserialize=e=>e,n.serialize=e=>e})(Wk||(Wk={}));var Vk;(function(n){n.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:x.revive(e.iconPath.light),dark:x.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),n.serialize=e=>e})(Vk||(Vk={}));var xi;(function(n){n.Delimiter="\0"})(xi||(xi={}));var Ji;(function(n){n[n.IsSame=0]="IsSame",n[n.Disconnected=1]="Disconnected",n[n.IsChild=2]="IsChild",n[n.IsParent=3]="IsParent"})(Ji||(Ji={}));class Oe{static fromExtHostTestItem(e,t,i=e.parent){if(e._isRoot)return new Oe([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 Oe(s.reverse())}static isRoot(e){return!e.includes(xi.Delimiter)}static root(e){const t=e.indexOf(xi.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(e){return new Oe(e.split(xi.Delimiter))}static join(e,t){return new Oe([...e.path,t])}static split(e){return e.split(xi.Delimiter)}static joinToString(e,t){return e.toString()+xi.Delimiter+t}static parentId(e){const t=e.lastIndexOf(xi.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){const t=e.lastIndexOf(xi.Delimiter);return t===-1?e:e.slice(t+xi.Delimiter.length)}static isChild(e,t){return t[e.length]===xi.Delimiter&&t.startsWith(e)}static compare(e,t){return e===t?Ji.IsSame:Oe.isChild(e,t)?Ji.IsChild:Oe.isChild(t,e)?Ji.IsParent:Ji.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 Oe(this.path,1)}get parentId(){return this.viewEnd>1?new Oe(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 Oe(this.path,e)}*idsToRoot(){for(let e=this.viewEnd;e>0;e--)yield new Oe(this.path,e)}compare(e){if(typeof e=="string")return Oe.compare(this.toString(),e);for(let t=0;t<e.viewEnd&&t<this.viewEnd;t++)if(e.path[t]!==this.path[t])return Ji.Disconnected;return e.viewEnd>this.viewEnd?Ji.IsChild:e.viewEnd<this.viewEnd?Ji.IsParent:Ji.IsSame}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let e=1;e<this.viewEnd;e++)this.stringifed+=xi.Delimiter,this.stringifed+=this.path[e]}return this.stringifed}}var en;(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"})(en||(en={}));en.Unset+"",en.Queued+"",en.Running+"",en.Passed+"",en.Failed+"",en.Skipped+"",en.Errored+"";var zk;(function(n){n[n.Run=1]="Run",n[n.Debug=2]="Debug",n[n.Coverage=3]="Coverage"})(zk||(zk={}));var ad;(function(n){n[n.Refresh=2]="Refresh",n[n.CodeRelatedToTest=4]="CodeRelatedToTest",n[n.TestRelatedToCode=8]="TestRelatedToCode"})(ad||(ad={}));var Rn;(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"})(Rn||(Rn={}));Rn.Run+"",h(11325,"Run"),Rn.Debug+"",h(11326,"Debug"),Rn.Coverage+"",h(11327,"Coverage");Rn.Run,Rn.Debug,Rn.Coverage,Rn.HasNonDefaultProfile,Rn.HasConfigurable,Rn.SupportsContinuousRun;const Q6=n=>"runId"in n;var $c;(function(n){n.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),n.deserialize=(e,t)=>({range:et.lift(t.range),uri:e.asCanonicalUri(x.revive(t.uri))})})($c||($c={}));var ds;(function(n){n[n.Error=0]="Error",n[n.Output=1]="Output"})(ds||(ds={}));var fg;(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(x.revive(t.uri)):void 0,position:t.position?Ti.lift(t.position):void 0})})(fg||(fg={}));var pg;(function(n){n.serialize=e=>({message:e.message,type:ds.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&$c.serialize(e.location),stackTrace:e.stackTrace?.map(fg.serialize)}),n.deserialize=(e,t)=>({message:t.message,type:ds.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&$c.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(i=>fg.deserialize(e,i))})})(pg||(pg={}));var gg;(function(n){n.serialize=e=>({message:e.message,type:ds.Output,offset:e.offset,length:e.length,location:e.location&&$c.serialize(e.location)}),n.deserialize=(e,t)=>({message:t.message,type:ds.Output,offset:t.offset,length:t.length,location:t.location&&$c.deserialize(e,t.location)})})(gg||(gg={}));var mg;(function(n){n.serialize=e=>e.type===ds.Error?pg.serialize(e):gg.serialize(e),n.deserialize=(e,t)=>t.type===ds.Error?pg.deserialize(e,t):gg.deserialize(e,t),n.isDiffable=e=>e.type===ds.Error&&e.actual!==void 0&&e.expected!==void 0})(mg||(mg={}));var ld;(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(mg.serialize)}),n.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(i=>mg.deserialize(e,i))})})(ld||(ld={}));const FT="\0",tp=(n,e)=>n+FT+e,MT=n=>{const e=n.indexOf(FT);return{ctrlId:n.slice(0,e),tagId:n.slice(e+1)}};var _g;(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(x.revive(t.uri)):void 0,range:t.range?et.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(_g||(_g={}));var Tn;(function(n){n[n.NotExpandable=0]="NotExpandable",n[n.Expandable=1]="Expandable",n[n.BusyExpanding=2]="BusyExpanding",n[n.Expanded=3]="Expanded"})(Tn||(Tn={}));var vo;(function(n){n.serialize=e=>({expand:e.expand,item:_g.serialize(e.item)}),n.deserialize=(e,t)=>({controllerId:Oe.root(t.item.extId),expand:t.expand,item:_g.deserialize(e,t.item)})})(vo||(vo={}));var jd;(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?et.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}}})(jd||(jd={}));const Cw=(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 qk;(function(n){n.serializeWithoutMessages=e=>({...vo.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(ld.serializeWithoutMessages)}),n.serialize=e=>({...vo.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(ld.serialize)}),n.deserialize=(e,t)=>({...vo.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(i=>ld.deserialize(e,i)),retired:!0})})(qk||(qk={}));var Tw;(function(n){n.empty=()=>({covered:0,total:0}),n.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})(Tw||(Tw={}));var jk;(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(x.revive(t.uri))}),n.empty=(e,t)=>({id:e,uri:t,statement:Tw.empty()})})(jk||(jk={}));function Jx(n){return{...n,location:n.location?.toJSON()}}function Xx(n){return n.location=n.location?Ti.isIPosition(n.location)?Ti.lift(n.location):et.lift(n.location):void 0,n}var ya;(function(n){n[n.Declaration=0]="Declaration",n[n.Statement=1]="Statement",n[n.Branch=2]="Branch"})(ya||(ya={}));var Gk;(function(n){n.serialize=e=>e.type===ya.Declaration?wg.serialize(e):bg.serialize(e),n.deserialize=e=>e.type===ya.Declaration?wg.deserialize(e):bg.deserialize(e)})(Gk||(Gk={}));var vg;(function(n){n.serialize=Jx,n.deserialize=Xx})(vg||(vg={}));var wg;(function(n){n.serialize=Jx,n.deserialize=Xx})(wg||(wg={}));var bg;(function(n){n.serialize=e=>({...Jx(e),branches:e.branches?.map(vg.serialize)}),n.deserialize=e=>({...Xx(e),branches:e.branches?.map(vg.deserialize)})})(bg||(bg={}));var It;(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"})(It||(It={}));var yg;(function(n){n.deserialize=(e,t)=>t.op===It.Add?{op:t.op,item:vo.deserialize(e,t.item)}:t.op===It.Update?{op:t.op,item:jd.deserialize(t.item)}:t.op===It.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(x.revive(t.uri)),docv:t.docv}:t,n.serialize=e=>e.op===It.Add?{op:e.op,item:vo.serialize(e.item)}:e.op===It.Update?{op:e.op,item:jd.serialize(e.item)}:e})(yg||(yg={}));class J6{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 It.Add:this.add(vo.deserialize(this.uriIdentity,i.item),t);break;case It.Update:this.update(jd.deserialize(i.item),t);break;case It.Remove:this.remove(i.itemId,t);break;case It.Retire:this.retireTest(i.itemId);break;case It.IncrementPendingExtHosts:this.updatePendingRoots(i.amount);break;case It.AddTag:this._tags.set(i.tag.id,i.tag);break;case It.RemoveTag:this._tags.delete(i.id);break}t.complete?.()}add(e,t){const i=Oe.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===Tn.BusyExpanding&&this.busyControllerCount++,s}update(e,t){const i=this.items.get(e.extId);if(i)return e.expand!==void 0&&(i.expand===Tn.BusyExpanding&&this.busyControllerCount--,e.expand===Tn.BusyExpanding&&this.busyControllerCount++),Cw(i,e),t.update?.(i),i}remove(e,t){const i=this.items.get(e);if(!i)return;const s=Oe.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===Tn.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}}var Kk;(function(n){n[n.UP=0]="UP",n[n.DOWN=1]="DOWN",n[n.LEFT=2]="LEFT",n[n.RIGHT=3]="RIGHT"})(Kk||(Kk={}));var Qk;(function(n){n[n.HORIZONTAL=0]="HORIZONTAL",n[n.VERTICAL=1]="VERTICAL"})(Qk||(Qk={}));var Jk;(function(n){n[n.FIRST=0]="FIRST",n[n.LAST=1]="LAST",n[n.NEXT=2]="NEXT",n[n.PREVIOUS=3]="PREVIOUS"})(Jk||(Jk={}));var Xk;(function(n){n[n.MAXIMIZE=0]="MAXIMIZE",n[n.EXPAND=1]="EXPAND",n[n.EVEN=2]="EVEN"})(Xk||(Xk={}));var Yk;(function(n){n[n.COPY_EDITORS=0]="COPY_EDITORS",n[n.MOVE_EDITORS=1]="MOVE_EDITORS"})(Yk||(Yk={}));var Zk;(function(n){n[n.CREATION_TIME=0]="CREATION_TIME",n[n.MOST_RECENTLY_ACTIVE=1]="MOST_RECENTLY_ACTIVE",n[n.GRID_APPEARANCE=2]="GRID_APPEARANCE"})(Zk||(Zk={}));var eD;(function(n){n[n.NEW_EDITOR=1]="NEW_EDITOR",n[n.MOVE_EDITOR=2]="MOVE_EDITOR",n[n.COPY_EDITOR=3]="COPY_EDITOR"})(eD||(eD={}));const X6=-1,Y6=-2;var xn;(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"})(xn||(xn={}));const Cu=(n,e)=>n===e,Z6={range:(n,e)=>n===e?!0:!n||!e?!1:n.equalsRange(e),busy:Cu,label:Cu,description:Cu,error:Cu,sortText:Cu,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.includes(t)))},e3=Object.entries(Z6),t3=(n,e)=>{let t;for(const[i,s]of e3)s(n[i],e[i])||(t?t[i]=e[i]:t={[i]:e[i]});return t};class n3 extends Se{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new tl(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new N),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 It.DocumentSynced:{for(const t of this.diff)if(t.op===It.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break}case It.Update:{const t=this.diff[this.diff.length-1];if(t){if(t.op===It.Update&&t.item.extId===e.item.extId){Cw(t.item,e.item);return}if(t.op===It.Add&&t.item.item.extId===e.item.extId){Cw(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===Tn.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===Tn.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 xn.RemoveChild:this.removeItem(Oe.joinToString(e.fullId,t.id));break;case xn.Upsert:this.upsertItem(t.item,e);break;case xn.Bulk:for(const i of t.ops)this.onTestItemEvent(e,i);break;case xn.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case xn.UpdateCanResolveChildren:this.updateExpandability(e);break;case xn.SetProp:this.pushDiff({op:It.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case xn.DocumentSynced:this.documentSynced(e.actual.uri);break;default:Nv()}}documentSynced(e){e&&this.pushDiff({op:It.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){const i=Oe.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:Tn.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(r.fullId.toString(),r),this.setItemParent(e,t),this.pushDiff({op:It.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=t3(this.options.toITestItem(a),this.options.toITestItem(e));this.options.getApiFor(a).listener=void 0,r.actual=e,r.resolveBarrier=void 0,r.expand=Tn.NotExpandable,l&&(l.hasOwnProperty("tags")&&(this.diffTagRefs(e.tags,a.tags,i.toString()),delete l.tags),this.onTestItemEvent(r,{op:xn.SetProp,update:l})),this.connectItemAndChildren(e,r,t);for(const[u,d]of o)this.options.getChildren(e).get(d.id)||this.removeItem(Oe.joinToString(i,d.id));const c=r.expandLevels;c!==void 0&&queueMicrotask(()=>{r.expand===Tn.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:It.Update,item:{extId:i,item:{tags:e.map(r=>tp(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:It.AddTag,tag:{id:tp(this.options.controllerId,e.id)}}))}decrementTagRefs(e){const t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:It.RemoveTag,id:tp(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()?Tn.Expanded:Tn.BusyExpanding:t=e.actual.canResolveChildren?Tn.Expandable:Tn.NotExpandable:t=Tn.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:It.Update,item:{extId:e.fullId.toString(),expand:t}}),t===Tn.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(Oe.joinToString(e.fullId,r.id),t);xo(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 As;return r.open(),r}e.expand=Tn.BusyExpanding,this.pushExpandStateUpdate(e);const t=e.resolveBarrier=new As,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 xo(s)?s.catch(i).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:It.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:It.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(Oe.joinToString(s.fullId,o.id)))}}}flushDiff(){const e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}}class i3 extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}}class xg extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}}class s3 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 r3=(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:xn.Bulk,ops:[]};for(const l of s){if(!(l instanceof t))throw new xg(l.id);const c=e(l).controllerId;if(c!==n.controllerId)throw new s3(l.id,c,n.controllerId);if(r.has(l.id))throw new i3(l.id);r.set(l.id,l),o.delete(l.id),a.ops.push({op:xn.Upsert,item:l})}for(const l of o.keys())a.ops.push({op:xn.RemoveChild,id:l});n.listener?.(a),i=r},add(s){if(!(s instanceof t))throw new xg(s.id);i.set(s.id,s),n.listener?.({op:xn.Upsert,item:s})},delete(s){i.delete(s)&&n.listener?.({op:xn.RemoveChild,id:s})},get(s){return i.get(s)},toJSON(){return Array.from(i.values())}}},UT=new WeakMap,o3=(n,e)=>{const t={controllerId:e};return UT.set(n,t),t},l_=n=>{const e=UT.get(n);if(!e)throw new xg(n?.id||"<unknown>");return e};var tD;(function(n){n[n.ACTIVATE=1]="ACTIVATE",n[n.RESTORE=2]="RESTORE",n[n.PRESERVE=3]="PRESERVE"})(tD||(tD={}));var nD;(function(n){n[n.PICK=0]="PICK",n[n.EXCLUSIVE_ONLY=1]="EXCLUSIVE_ONLY"})(nD||(nD={}));var iD;(function(n){n[n.API=0]="API",n[n.USER=1]="USER"})(iD||(iD={}));var sD;(function(n){n[n.Center=0]="Center",n[n.CenterIfOutsideViewport=1]="CenterIfOutsideViewport",n[n.NearTop=2]="NearTop",n[n.NearTopIfOutsideViewport=3]="NearTopIfOutsideViewport"})(sD||(sD={}));var cd;(function(n){n.PROGRAMMATIC="api",n.NAVIGATION="code.navigation",n.JUMP="code.jump"})(cd||(cd={}));var Eg;(function(n){n[n.WebSocket=0]="WebSocket",n[n.Managed=1]="Managed"})(Eg||(Eg={}));class a3{constructor(e){this.id=e,this.type=Eg.Managed}toString(){return`Managed(${this.id})`}}class l3{constructor(e,t){this.host=e,this.port=t,this.type=Eg.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}}var kr;(function(n){n.Unknown="Unknown",n.NotAvailable="NotAvailable",n.TemporarilyNotAvailable="TemporarilyNotAvailable",n.NoResolverFound="NoResolverFound",n.InvalidAuthority="InvalidAuthority"})(kr||(kr={}));function rD(n){const e=n.indexOf("+");return e===-1?n:n.substring(0,e)}var Pw,$o,ir,Aw,Ho,Kr,Bo,Rw,Lw,np,$u,Nw,vs,ws,Ow,ei,Fw;function be(n){return Object.assign(n,{apply:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const i=t.length===1?[]:t[1];return Reflect.construct(n,i,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(n,[]);{const[i,...s]=t;return Reflect.construct(n,s,i.constructor)}}})}var Mw;(function(n){n[n.Top=0]="Top",n[n.Bottom=1]="Bottom"})(Mw||(Mw={}));var oD;(function(n){n[n.TerminalCommand=0]="TerminalCommand",n[n.Opener=1]="Opener",n[n.Command=3]="Command"})(oD||(oD={}));let je=Pw=class{static from(...e){let t=e;return new Pw(function(){if(t){for(const i of t)i&&typeof i.dispose=="function"&&i.dispose();t=void 0}})}#e;constructor(e){this.#e=e}dispose(){typeof this.#e=="function"&&(this.#e(),this.#e=void 0)}};je=Pw=V([be],je);let qe=$o=class{static Min(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let i=1;i<e.length;i++){const s=e[i];s.isBefore(t)&&(t=s)}return t}static Max(...e){if(e.length===0)throw new TypeError;let t=e[0];for(let i=1;i<e.length;i++){const s=e[i];s.isAfter(t)&&(t=s)}return t}static isPosition(e){if(!e)return!1;if(e instanceof $o)return!0;const{line:t,character:i}=e;return typeof t=="number"&&typeof i=="number"}static of(e){if(e instanceof $o)return e;if(this.isPosition(e))return new $o(e.line,e.character);throw new Error("Invalid argument, is NOT a position-like object")}get line(){return this._line}get character(){return this._character}constructor(e,t){if(e<0)throw Ve("line must be non-negative");if(t<0)throw Ve("character must be non-negative");this._line=e,this._character=t}isBefore(e){return this._line<e._line?!0:e._line<this._line?!1:this._character<e._character}isBeforeOrEqual(e){return this._line<e._line?!0:e._line<this._line?!1:this._character<=e._character}isAfter(e){return!this.isBeforeOrEqual(e)}isAfterOrEqual(e){return!this.isBefore(e)}isEqual(e){return this._line===e._line&&this._character===e._character}compareTo(e){return this._line<e._line?-1:this._line>e.line?1:this._character<e._character?-1:this._character>e._character?1:0}translate(e,t=0){if(e===null||t===null)throw Ve();let i;return typeof e>"u"?i=0:typeof e=="number"?i=e:(i=typeof e.lineDelta=="number"?e.lineDelta:0,t=typeof e.characterDelta=="number"?e.characterDelta:0),i===0&&t===0?this:new $o(this.line+i,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw Ve();let i;return typeof e>"u"?i=this.line:typeof e=="number"?i=e:(i=typeof e.line=="number"?e.line:this.line,t=typeof e.character=="number"?e.character:this.character),i===this.line&&t===this.character?this:new $o(i,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for("debug.description")](){return`(${this.line}:${this.character})`}};qe=$o=V([be],qe);let Me=ir=class{static isRange(e){return e instanceof ir?!0:e?qe.isPosition(e.start)&&qe.isPosition(e.end):!1}static of(e){if(e instanceof ir)return e;if(this.isRange(e))return new ir(e.start,e.end);throw new Error("Invalid argument, is NOT a range-like object")}get start(){return this._start}get end(){return this._end}constructor(e,t,i,s){let r,o;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(r=new qe(e,t),o=new qe(i,s)):qe.isPosition(e)&&qe.isPosition(t)&&(r=qe.of(e),o=qe.of(t)),!r||!o)throw new Error("Invalid arguments");r.isBefore(o)?(this._start=r,this._end=o):(this._start=o,this._end=r)}contains(e){return ir.isRange(e)?this.contains(e.start)&&this.contains(e.end):qe.isPosition(e)?!(qe.of(e).isBefore(this._start)||this._end.isBefore(e)):!1}isEqual(e){return this._start.isEqual(e._start)&&this._end.isEqual(e._end)}intersection(e){const t=qe.Max(e.start,this._start),i=qe.Min(e.end,this._end);if(!t.isAfter(i))return new ir(t,i)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;const t=qe.Min(e.start,this._start),i=qe.Max(e.end,this.end);return new ir(t,i)}get isEmpty(){return this._start.isEqual(this._end)}get isSingleLine(){return this._start.line===this._end.line}with(e,t=this.end){if(e===null||t===null)throw Ve();let i;return e?qe.isPosition(e)?i=e:(i=e.start||this.start,t=e.end||this.end):i=this.start,i.isEqual(this._start)&&t.isEqual(this.end)?this:new ir(i,t)}toJSON(){return[this.start,this.end]}[Symbol.for("debug.description")](){return $T(this)}};Me=ir=V([be],Me);let Nr=Aw=class extends Me{static isSelection(e){return e instanceof Aw?!0:e?Me.isRange(e)&&qe.isPosition(e.anchor)&&qe.isPosition(e.active)&&typeof e.isReversed=="boolean":!1}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,i,s){let r,o;if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"?(r=new qe(e,t),o=new qe(i,s)):qe.isPosition(e)&&qe.isPosition(t)&&(r=qe.of(e),o=qe.of(t)),!r||!o)throw new Error("Invalid arguments");super(r,o),this._anchor=r,this._active=o}get isReversed(){return this._anchor===this._end}toJSON(){return{start:this.start,end:this.end,active:this.active,anchor:this.anchor}}[Symbol.for("debug.description")](){return c3(this)}};Nr=Aw=V([be],Nr);function $T(n){return n.isEmpty?`[${n.start.line}:${n.start.character})`:`[${n.start.line}:${n.start.character} -> ${n.end.line}:${n.end.character})`}function c3(n){let e=$T(n);return n.isEmpty||(n.active.isEqual(n.start)?e=`|${e}`:e=`${e}|`),e}const HT=n=>{if(typeof n!="string"||n.length===0||!/^[0-9A-Za-z_\-]+$/.test(n))throw Ve("connectionToken")};class u3{static isResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.host=="string"&&typeof e.port=="number"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t,i){if(typeof e!="string"||e.length===0)throw Ve("host");if(typeof t!="number"||t===0||Math.round(t)!==t)throw Ve("port");typeof i<"u"&&HT(i),this.host=e,this.port=Math.round(t),this.connectionToken=i}}class ip{static isManagedResolvedAuthority(e){return e&&typeof e=="object"&&typeof e.makeConnection=="function"&&(e.connectionToken===void 0||typeof e.connectionToken=="string")}constructor(e,t){this.makeConnection=e,this.connectionToken=t,typeof t<"u"&&HT(t)}}class Ds extends Error{static NotAvailable(e,t){return new Ds(e,kr.NotAvailable,t)}static TemporarilyNotAvailable(e){return new Ds(e,kr.TemporarilyNotAvailable)}constructor(e,t=kr.Unknown,i){super(e),this._message=e,this._code=t,this._detail=i,Object.setPrototypeOf(this,Ds.prototype)}}var os;(function(n){n[n.LF=1]="LF",n[n.CRLF=2]="CRLF"})(os||(os={}));var ic;(function(n){n[n.Replace=1]="Replace",n[n.Append=2]="Append",n[n.Prepend=3]="Prepend"})(ic||(ic={}));let ko=Ho=class{static isTextEdit(e){return e instanceof Ho?!0:e?Me.isRange(e)&&typeof e.newText=="string":!1}static replace(e,t){return new Ho(e,t)}static insert(e,t){return Ho.replace(new Me(e,e),t)}static delete(e){return Ho.replace(e,"")}static setEndOfLine(e){const t=new Ho(new Me(new qe(0,0),new qe(0,0)),"");return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!Me.isRange(e))throw Ve("range");this._range=e}get newText(){return this._newText||""}set newText(e){if(e&&typeof e!="string")throw Ve("newText");this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!="number")throw Ve("newEol");this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};ko=Ho=V([be],ko);let Sg=Kr=class{static isNotebookCellEdit(e){return e instanceof Kr?!0:e?as.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new Kr(e,t)}static insertCells(e,t){return new Kr(new as(e,e),t)}static deleteCells(e){return new Kr(e,[])}static updateCellMetadata(e,t){const i=new Kr(new as(e,e),[]);return i.newCellMetadata=t,i}static updateNotebookMetadata(e){const t=new Kr(new as(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};Sg=Kr=V([be],Sg);class xa{static isSnippetTextEdit(e){return e instanceof xa?!0:e?Me.isRange(e.range)&&Ka.isSnippetString(e.snippet):!1}static replace(e,t){return new xa(e,t)}static insert(e,t){return xa.replace(new Me(e,e),t)}constructor(e,t){this.range=e,this.snippet=t}}var Wt;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.Cell=3]="Cell",n[n.CellReplace=5]="CellReplace",n[n.Snippet=6]="Snippet"})(Wt||(Wt={}));let Ga=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,i,s){this._edits.push({_type:Wt.File,from:e,to:t,options:i,metadata:s})}createFile(e,t,i){this._edits.push({_type:Wt.File,from:void 0,to:e,options:t,metadata:i})}deleteFile(e,t,i){this._edits.push({_type:Wt.File,from:e,to:void 0,options:t,metadata:i})}replaceNotebookMetadata(e,t,i){this._edits.push({_type:Wt.Cell,metadata:i,uri:e,edit:{editType:_o.DocumentMetadata,metadata:t}})}replaceNotebookCells(e,t,i,s){const r=t.start,o=t.end;(r!==o||i.length>0)&&this._edits.push({_type:Wt.CellReplace,uri:e,index:r,count:o-r,cells:i,metadata:s})}replaceNotebookCellMetadata(e,t,i,s){this._edits.push({_type:Wt.Cell,metadata:s,uri:e,edit:{editType:_o.Metadata,index:t,metadata:i}})}replace(e,t,i,s){this._edits.push({_type:Wt.Text,uri:e,edit:new ko(t,i),metadata:s})}insert(e,t,i,s){this.replace(e,new Me(t,t),i,s)}delete(e,t,i){this.replace(e,t,"",i)}has(e){return this._edits.some(t=>t._type===Wt.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(const i of t){if(!i)continue;let s,r;Array.isArray(i)?(s=i[0],r=i[1]):s=i,Sg.isNotebookCellEdit(s)?s.newCellMetadata?this.replaceNotebookCellMetadata(e,s.range.start,s.newCellMetadata,r):s.newNotebookMetadata?this.replaceNotebookMetadata(e,s.newNotebookMetadata,r):this.replaceNotebookCells(e,s.range,s.newCells,r):xa.isSnippetTextEdit(s)?this._edits.push({_type:Wt.Snippet,uri:e,range:s.range,edit:s.snippet,metadata:r,keepWhitespace:s.keepWhitespace}):this._edits.push({_type:Wt.Text,uri:e,edit:s,metadata:r})}else{for(let i=0;i<this._edits.length;i++){const s=this._edits[i];switch(s._type){case Wt.Text:case Wt.Snippet:case Wt.Cell:case Wt.CellReplace:s.uri.toString()===e.toString()&&(this._edits[i]=void 0);break}}C5(this._edits)}}get(e){const t=[];for(const i of this._edits)i._type===Wt.Text&&i.uri.toString()===e.toString()&&t.push(i.edit);return t}entries(){const e=new on;for(const t of this._edits)if(t._type===Wt.Text){let i=e.get(t.uri);i||(i=[t.uri,[]],e.set(t.uri,i)),i[1].push(t.edit)}return[...e.values()]}get size(){return this.entries().length}toJSON(){return this.entries()}};Ga=V([be],Ga);let Ka=Bo=class{static isSnippetString(e){return e instanceof Bo?!0:e?typeof e.value=="string":!1}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=Bo._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if(typeof e=="function"){const i=new Bo;i._tabstop=this._tabstop,e(i),this._tabstop=i._tabstop,e=i.value}else e=Bo._escape(e);return this.value+="${",this.value+=t,this.value+=":",this.value+=e,this.value+="}",this}appendChoice(e,t=this._tabstop++){const i=e.map(s=>s.replaceAll(/[|\\,]/g,"\\$&")).join(",");return this.value+="${",this.value+=t,this.value+="|",this.value+=i,this.value+="|}",this}appendVariable(e,t){if(typeof t=="function"){const i=new Bo;i._tabstop=this._tabstop,t(i),this._tabstop=i._tabstop,t=i.value}else typeof t=="string"&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}};Ka=Bo=V([be],Ka);var oa;(function(n){n[n.Unnecessary=1]="Unnecessary",n[n.Deprecated=2]="Deprecated"})(oa||(oa={}));var Pn;(function(n){n[n.Hint=3]="Hint",n[n.Information=2]="Information",n[n.Warning=1]="Warning",n[n.Error=0]="Error"})(Pn||(Pn={}));let Ni=Rw=class{static isLocation(e){return e instanceof Rw?!0:e?Me.isRange(e.range)&&x.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(Me.isRange(t))this.range=Me.of(t);else if(qe.isPosition(t))this.range=new Me(t,t);else throw new Error("Illegal argument")}toJSON(){return{uri:this.uri,range:this.range}}};Ni=Rw=V([be],Ni);let Gd=class{static is(e){return e?typeof e.message=="string"&&e.location&&Me.isRange(e.location.range)&&x.isUri(e.location.uri):!1}constructor(e,t){this.location=e,this.message=t}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.location.range.isEqual(t.location.range)&&e.location.uri.toString()===t.location.uri.toString()}};Gd=V([be],Gd);let kg=class{constructor(e,t,i=Pn.Error){if(!Me.isRange(e))throw new TypeError("range must be set");if(!t)throw new TypeError("message must be set");this.range=e,this.message=t,this.severity=i}toJSON(){return{severity:Pn[this.severity],message:this.message,range:this.range,source:this.source,code:this.code}}static isEqual(e,t){return e===t?!0:!e||!t?!1:e.message===t.message&&e.severity===t.severity&&e.code===t.code&&e.severity===t.severity&&e.source===t.source&&e.range.isEqual(t.range)&&Pi(e.tags,t.tags)&&Pi(e.relatedInformation,t.relatedInformation,Gd.isEqual)}};kg=V([be],kg);let Dg=class{constructor(e,t){if(!e)throw new Error("Illegal argument, contents must be defined");Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};Dg=V([be],Dg);let Ig=class extends Dg{constructor(e,t,i,s){super(e,t),this.canIncreaseVerbosity=i,this.canDecreaseVerbosity=s}};Ig=V([be],Ig);var Uw;(function(n){n[n.Increase=0]="Increase",n[n.Decrease=1]="Decrease"})(Uw||(Uw={}));var Kd;(function(n){n[n.Text=0]="Text",n[n.Read=1]="Read",n[n.Write=2]="Write"})(Kd||(Kd={}));let Cg=class{constructor(e,t=Kd.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:Kd[this.kind]}}};Cg=V([be],Cg);let Tg=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};Tg=V([be],Tg);var _t;(function(n){n[n.File=0]="File",n[n.Module=1]="Module",n[n.Namespace=2]="Namespace",n[n.Package=3]="Package",n[n.Class=4]="Class",n[n.Method=5]="Method",n[n.Property=6]="Property",n[n.Field=7]="Field",n[n.Constructor=8]="Constructor",n[n.Enum=9]="Enum",n[n.Interface=10]="Interface",n[n.Function=11]="Function",n[n.Variable=12]="Variable",n[n.Constant=13]="Constant",n[n.String=14]="String",n[n.Number=15]="Number",n[n.Boolean=16]="Boolean",n[n.Array=17]="Array",n[n.Object=18]="Object",n[n.Key=19]="Key",n[n.Null=20]="Null",n[n.EnumMember=21]="EnumMember",n[n.Struct=22]="Struct",n[n.Event=23]="Event",n[n.Operator=24]="Operator",n[n.TypeParameter=25]="TypeParameter"})(_t||(_t={}));var Qd;(function(n){n[n.Deprecated=1]="Deprecated"})(Qd||(Qd={}));let Jd=Lw=class{static validate(e){if(!e.name)throw new Error("name must not be falsy")}constructor(e,t,i,s,r){this.name=e,this.kind=t,this.containerName=r,typeof i=="string"&&(this.containerName=i),s instanceof Ni?this.location=s:i instanceof Me&&(this.location=new Ni(s,i)),Lw.validate(this)}toJSON(){return{name:this.name,kind:_t[this.kind],location:this.location,containerName:this.containerName}}};Jd=Lw=V([be],Jd);let Xd=np=class{static validate(e){if(!e.name)throw new Error("name must not be falsy");if(!e.range.contains(e.selectionRange))throw new Error("selectionRange must be contained in fullRange");e.children?.forEach(np.validate)}constructor(e,t,i,s,r){this.name=e,this.detail=t,this.kind=i,this.range=s,this.selectionRange=r,this.children=[],np.validate(this)}};Xd=np=V([be],Xd);var Yd;(function(n){n[n.Invoke=1]="Invoke",n[n.Automatic=2]="Automatic"})(Yd||(Yd={}));let Zd=class{constructor(e,t){this.title=e,this.kind=t}};Zd=V([be],Zd);var Fa;let At=(Fa=class{constructor(e){this.value=e}append(e){return new $u(this.value?this.value+$u.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+$u.sep)}},$u=Fa,Fa.sep=".",Fa);At=$u=V([be],At);At.Empty=new At("");At.QuickFix=At.Empty.append("quickfix");At.Refactor=At.Empty.append("refactor");At.RefactorExtract=At.Refactor.append("extract");At.RefactorInline=At.Refactor.append("inline");At.RefactorMove=At.Refactor.append("move");At.RefactorRewrite=At.Refactor.append("rewrite");At.Source=At.Empty.append("source");At.SourceOrganizeImports=At.Source.append("organizeImports");At.SourceFixAll=At.Source.append("fixAll");At.Notebook=At.Empty.append("notebook");let eh=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw new Error("Invalid argument: parent must contain this range")}};eh=V([be],eh);let Yx=class{constructor(e,t,i,s,r,o){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=r,this.selectionRange=o}},BT=class{constructor(e,t){this.fromRanges=t,this.from=e}},WT=class{constructor(e,t){this.fromRanges=t,this.to=e}};var sc;(function(n){n[n.Information=0]="Information",n[n.Warning=1]="Warning",n[n.Error=2]="Error"})(sc||(sc={}));let Pg=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};Pg=V([be],Pg);let mi=Nw=class{#e;static isMarkdownString(e){return e instanceof Nw?!0:e&&e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,t=!1){this.#e=new Mc(e,{supportThemeIcons:t})}get value(){return this.#e.value}set value(e){this.#e.value=e}get isTrusted(){return this.#e.isTrusted}set isTrusted(e){this.#e.isTrusted=e}get supportThemeIcons(){return this.#e.supportThemeIcons}set supportThemeIcons(e){this.#e.supportThemeIcons=e}get supportHtml(){return this.#e.supportHtml}set supportHtml(e){this.#e.supportHtml=e}get baseUri(){return this.#e.baseUri}set baseUri(e){this.#e.baseUri=e}appendText(e){return this.#e.appendText(e),this}appendMarkdown(e){return this.#e.appendMarkdown(e),this}appendCodeblock(e,t){return this.#e.appendCodeblock(t??"",e),this}};mi=Nw=V([be],mi);let $w=class{constructor(e,t){this.label=e,this.documentation=t}};$w=V([be],$w);let Hw=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};Hw=V([be],Hw);let Bw=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};Bw=V([be],Bw);var Ww;(function(n){n[n.Invoke=1]="Invoke",n[n.TriggerCharacter=2]="TriggerCharacter",n[n.ContentChange=3]="ContentChange"})(Ww||(Ww={}));var Vw;(function(n){n[n.Type=1]="Type",n[n.Parameter=2]="Parameter"})(Vw||(Vw={}));let Ag=class{constructor(e){this.value=e}};Ag=V([be],Ag);let Rg=class{constructor(e,t,i){this.position=e,this.label=t,this.kind=i}};Rg=V([be],Rg);var rc;(function(n){n[n.Invoke=0]="Invoke",n[n.TriggerCharacter=1]="TriggerCharacter",n[n.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"})(rc||(rc={}));var Ie;(function(n){n[n.Text=0]="Text",n[n.Method=1]="Method",n[n.Function=2]="Function",n[n.Constructor=3]="Constructor",n[n.Field=4]="Field",n[n.Variable=5]="Variable",n[n.Class=6]="Class",n[n.Interface=7]="Interface",n[n.Module=8]="Module",n[n.Property=9]="Property",n[n.Unit=10]="Unit",n[n.Value=11]="Value",n[n.Enum=12]="Enum",n[n.Keyword=13]="Keyword",n[n.Snippet=14]="Snippet",n[n.Color=15]="Color",n[n.File=16]="File",n[n.Reference=17]="Reference",n[n.Folder=18]="Folder",n[n.EnumMember=19]="EnumMember",n[n.Constant=20]="Constant",n[n.Struct=21]="Struct",n[n.Event=22]="Event",n[n.Operator=23]="Operator",n[n.TypeParameter=24]="TypeParameter",n[n.User=25]="User",n[n.Issue=26]="Issue"})(Ie||(Ie={}));var th;(function(n){n[n.Deprecated=1]="Deprecated"})(th||(th={}));let Lg=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&Ie[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};Lg=V([be],Lg);let Hc=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};Hc=V([be],Hc);let zw=class{constructor(e,t,i){this.insertText=e,this.range=t,this.command=i}};zw=V([be],zw);let qw=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};qw=V([be],qw);var aa;(function(n){n[n.Unknown=0]="Unknown",n[n.Word=1]="Word",n[n.Line=2]="Line",n[n.Suggest=3]="Suggest"})(aa||(aa={}));var oc;(function(n){n[n.Accepted=0]="Accepted",n[n.Rejected=1]="Rejected",n[n.Ignored=2]="Ignored"})(oc||(oc={}));var nh;(function(n){n[n.Active=-1]="Active",n[n.Beside=-2]="Beside",n[n.One=1]="One",n[n.Two=2]="Two",n[n.Three=3]="Three",n[n.Four=4]="Four",n[n.Five=5]="Five",n[n.Six=6]="Six",n[n.Seven=7]="Seven",n[n.Eight=8]="Eight",n[n.Nine=9]="Nine"})(nh||(nh={}));var uo;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(uo||(uo={}));function d3(n,e){return`${tt.toKey(n)}.${e}`}var Xi;(function(n){n[n.Off=0]="Off",n[n.On=1]="On",n[n.Relative=2]="Relative",n[n.Interval=3]="Interval"})(Xi||(Xi={}));var ac;(function(n){n[n.Manual=1]="Manual",n[n.AfterDelay=2]="AfterDelay",n[n.FocusOut=3]="FocusOut"})(ac||(ac={}));var Ng;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(Ng||(Ng={}));var Bc;(function(n){n[n.Keyboard=1]="Keyboard",n[n.Mouse=2]="Mouse",n[n.Command=3]="Command"})(Bc||(Bc={}));var lc;(function(n){n[n.Addition=1]="Addition",n[n.Deletion=2]="Deletion",n[n.Modification=3]="Modification"})(lc||(lc={}));var ih;(function(n){n[n.Undo=1]="Undo",n[n.Redo=2]="Redo"})(ih||(ih={}));var la;(function(n){n[n.OpenOpen=0]="OpenOpen",n[n.ClosedClosed=1]="ClosedClosed",n[n.OpenClosed=2]="OpenClosed",n[n.ClosedOpen=3]="ClosedOpen"})(la||(la={}));(function(n){function e(t){switch(t){case"keyboard":return n.Keyboard;case"mouse":return n.Mouse;case cd.PROGRAMMATIC:case cd.JUMP:case cd.NAVIGATION:return n.Command}}n.fromValue=e})(Bc||(Bc={}));var Wc;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(Wc||(Wc={}));(function(n){function e(t){switch(t){case n.Other:return"other";case n.Comment:return"comment";case n.String:return"string";case n.RegEx:return"regex"}return"other"}n.toString=e})(Wc||(Wc={}));let Og=class{constructor(e,t){if(t&&!x.isUri(t))throw Ve("target");if(!Me.isRange(e)||e.isEmpty)throw Ve("range");this.range=e,this.target=t}};Og=V([be],Og);let Vc=class{constructor(e,t,i,s){this.red=e,this.green=t,this.blue=i,this.alpha=s}};Vc=V([be],Vc);let Fg=class{constructor(e,t){if(t&&!(t instanceof Vc))throw Ve("color");if(!Me.isRange(e)||e.isEmpty)throw Ve("range");this.range=e,this.color=t}};Fg=V([be],Fg);let Mg=class{constructor(e){if(!e||typeof e!="string")throw Ve("label");this.label=e}};Mg=V([be],Mg);var aD;(function(n){n[n.RGB=0]="RGB",n[n.HEX=1]="HEX",n[n.HSL=2]="HSL"})(aD||(aD={}));var jw;(function(n){n[n.Error=0]="Error",n[n.Warning=1]="Warning",n[n.Information=2]="Information"})(jw||(jw={}));var Gw;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(Gw||(Gw={}));var sh;(function(n){n[n.Low=0]="Low",n[n.Medium=1]="Medium",n[n.High=2]="High"})(sh||(sh={}));var Kw;(function(n){n[n.Sh=1]="Sh",n[n.Bash=2]="Bash",n[n.Fish=3]="Fish",n[n.Csh=4]="Csh",n[n.Ksh=5]="Ksh",n[n.Zsh=6]="Zsh",n[n.CommandPrompt=7]="CommandPrompt",n[n.GitBash=8]="GitBash",n[n.PowerShell=9]="PowerShell",n[n.Python=10]="Python",n[n.Julia=11]="Julia",n[n.NuShell=12]="NuShell",n[n.Node=13]="Node"})(Kw||(Kw={}));class h3{constructor(e,t,i){if(this.startIndex=e,this.length=t,this.tooltip=i,typeof e!="number"||e<0)throw Ve("startIndex");if(typeof t!="number"||t<1)throw Ve("length");if(i!==void 0&&typeof i!="string")throw Ve("tooltip")}}class f3{constructor(e){this.uri=e}}class p3{constructor(e){this.terminalCommand=e}}var Qw;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(Qw||(Qw={}));class g3{constructor(e){if(this.options=e,typeof e!="object")throw Ve("options")}}var Jw;(function(n){n[n.File=0]="File",n[n.Folder=1]="Folder",n[n.Method=2]="Method",n[n.Alias=3]="Alias",n[n.Argument=4]="Argument",n[n.Option=5]="Option",n[n.OptionValue=6]="OptionValue",n[n.Flag=7]="Flag"})(Jw||(Jw={}));class m3{constructor(e,t,i,s,r,o,a,l,c){this.label=e,this.icon=t,this.detail=i,this.documentation=s,this.isFile=r,this.isDirectory=o,this.isKeyword=a,this.replacementIndex=l??0,this.replacementLength=c??0}}let _3=class{constructor(e,t){this.items=e??[],this.resourceRequestConfig=t}};var Xw;(function(n){n[n.Always=1]="Always",n[n.Silent=2]="Silent",n[n.Never=3]="Never"})(Xw||(Xw={}));var Yw;(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"})(Yw||(Yw={}));var Zw;(function(n){n[n.Shared=1]="Shared",n[n.Dedicated=2]="Dedicated",n[n.New=3]="New"})(Zw||(Zw={}));var Cs;let rh=(Cs=class{static from(e){switch(e){case"clean":return vs.Clean;case"build":return vs.Build;case"rebuild":return vs.Rebuild;case"test":return vs.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!="string"||typeof t!="string")throw Ve("name");this._id=e}get id(){return this._id}},vs=Cs,Cs.Clean=new vs("clean","Clean"),Cs.Build=new vs("build","Build"),Cs.Rebuild=new vs("rebuild","Rebuild"),Cs.Test=new vs("test","Test"),Cs);rh=vs=V([be],rh);function VT(n){let e="";for(let t=0;t<n.length;t++)e+=n[t].replace(/,/g,",,")+",";return e}let zc=class{constructor(e,t,i){if(typeof e!="string")throw Ve("process");this._args=[],this._process=e,t!==void 0&&(Array.isArray(t)?(this._args=t,this._options=i):this._options=t)}get process(){return this._process}set process(e){if(typeof e!="string")throw Ve("process");this._process=e}get args(){return this._args}set args(e){Array.isArray(e)||(e=[]),this._args=e}get options(){return this._options}set options(e){this._options=e}computeId(){const e=[];if(e.push("process"),this._process!==void 0&&e.push(this._process),this._args&&this._args.length>0)for(const t of this._args)e.push(t);return VT(e)}};zc=V([be],zc);let Qa=class{constructor(e,t,i){if(this._args=[],Array.isArray(t)){if(!e)throw Ve("command can't be undefined or null");if(typeof e!="string"&&typeof e.value!="string")throw Ve("command");this._command=e,t&&(this._args=t),this._options=i}else{if(typeof e!="string")throw Ve("commandLine");this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!="string")throw Ve("commandLine");this._commandLine=e}get command(){return this._command?this._command:""}set command(e){if(typeof e!="string"&&typeof e.value!="string")throw Ve("command");this._command=e}get args(){return this._args}set args(e){this._args=e||[]}get options(){return this._options}set options(e){this._options=e}computeId(){const e=[];if(e.push("shell"),this._commandLine!==void 0&&e.push(this._commandLine),this._command!==void 0&&e.push(typeof this._command=="string"?this._command:this._command.value),this._args&&this._args.length>0)for(const t of this._args)e.push(typeof t=="string"?t:t.value);return VT(e)}};Qa=V([be],Qa);var eb;(function(n){n[n.Escape=1]="Escape",n[n.Strong=2]="Strong",n[n.Weak=3]="Weak"})(eb||(eb={}));var Do;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace"})(Do||(Do={}));class Zx{constructor(e){this._callback=e}computeId(){return"customExecution"+Sn()}set callback(e){this._callback=e}get callback(){return this._callback}}var Ts;let Ug=(Ts=class{constructor(e,t,i,s,r,o){this.__deprecated=!1,this._definition=this.definition=e;let a;typeof t=="string"?(this._name=this.name=t,this._source=this.source=i,this.execution=s,a=r,this.__deprecated=!0):t===Do.Global||t===Do.Workspace?(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=r,a=o):(this.target=t,this._name=this.name=i,this._source=this.source=s,this.execution=r,a=o),typeof a=="string"?(this._problemMatchers=[a],this._hasDefinedMatchers=!0):Array.isArray(a)?(this._problemMatchers=a,this._hasDefinedMatchers=!0):(this._problemMatchers=[],this._hasDefinedMatchers=!1),this._isBackground=!1,this._presentationOptions=Object.create(null),this._runOptions=Object.create(null)}get _id(){return this.__id}set _id(e){this.__id=e}get _deprecated(){return this.__deprecated}clear(){this.__id!==void 0&&(this.__id=void 0,this._scope=void 0,this.computeDefinitionBasedOnExecution())}computeDefinitionBasedOnExecution(){this._execution instanceof zc?this._definition={type:ws.ProcessType,id:this._execution.computeId()}:this._execution instanceof Qa?this._definition={type:ws.ShellType,id:this._execution.computeId()}:this._execution instanceof Zx?this._definition={type:ws.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:ws.EmptyType,id:Sn()}}get definition(){return this._definition}set definition(e){if(e==null)throw Ve("Kind can't be undefined or null");this.clear(),this._definition=e}get scope(){return this._scope}set target(e){this.clear(),this._scope=e}get name(){return this._name}set name(e){if(typeof e!="string")throw Ve("name");this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;const t=this._definition.type;(ws.EmptyType===t||ws.ProcessType===t||ws.ShellType===t||ws.ExtensionCallbackType===t)&&this.computeDefinitionBasedOnExecution()}get problemMatchers(){return this._problemMatchers}set problemMatchers(e){if(Array.isArray(e))this.clear(),this._problemMatchers=e,this._hasDefinedMatchers=!0;else{this.clear(),this._problemMatchers=[],this._hasDefinedMatchers=!1;return}}get hasDefinedMatchers(){return this._hasDefinedMatchers}get isBackground(){return this._isBackground}set isBackground(e){e!==!0&&e!==!1&&(e=!1),this.clear(),this._isBackground=e}get source(){return this._source}set source(e){if(typeof e!="string"||e.length===0)throw Ve("source must be a string of length > 0");this.clear(),this._source=e}get group(){return this._group}set group(e){e===null&&(e=void 0),this.clear(),this._group=e}get detail(){return this._detail}set detail(e){e===null&&(e=void 0),this._detail=e}get presentationOptions(){return this._presentationOptions}set presentationOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e==null&&(e=Object.create(null)),this.clear(),this._runOptions=e}},ws=Ts,Ts.ExtensionCallbackType="customExecution",Ts.ProcessType="process",Ts.ShellType="shell",Ts.EmptyType="$empty",Ts);Ug=ws=V([be],Ug);var wo;(function(n){n[n.SourceControl=1]="SourceControl",n[n.Window=10]="Window",n[n.Notification=15]="Notification"})(wo||(wo={}));var tb;(function(n){function e(t){const i=t;return ga(i.value)?i.tooltip&&!it(i.tooltip)?(console.log("INVALID view badge, invalid tooltip",i.tooltip),!1):!0:(console.log("INVALID view badge, invalid value",i.value),!1)}n.isViewBadge=e})(tb||(tb={}));let $g=Ow=class{static isTreeItem(e,t){const i=e;if(i.checkboxState!==void 0){const s=ga(i.checkboxState)?i.checkboxState:nn(i.checkboxState)&&ga(i.checkboxState.state)?i.checkboxState.state:void 0,r=!ga(i.checkboxState)&&nn(i.checkboxState)?i.checkboxState.tooltip:void 0;if(s===void 0||s!==Is.Checked&&s!==Is.Unchecked||r!==void 0&&!it(r))return console.log("INVALID tree item, invalid checkboxState",i.checkboxState),!1}if(e instanceof Ow)return!0;if(i.label!==void 0&&!it(i.label)&&!i.label?.label)return console.log("INVALID tree item, invalid label",i.label),!1;if(i.id!==void 0&&!it(i.id))return console.log("INVALID tree item, invalid id",i.id),!1;if(i.iconPath!==void 0&&!it(i.iconPath)&&!x.isUri(i.iconPath)&&(!i.iconPath||!it(i.iconPath.id))){const s=i.iconPath;if(!s||!it(s.light)&&!x.isUri(s.light)&&!it(s.dark)&&!x.isUri(s.dark))return console.log("INVALID tree item, invalid iconPath",i.iconPath),!1}return i.description!==void 0&&!it(i.description)&&typeof i.description!="boolean"?(console.log("INVALID tree item, invalid description",i.description),!1):i.resourceUri!==void 0&&!x.isUri(i.resourceUri)?(console.log("INVALID tree item, invalid resourceUri",i.resourceUri),!1):i.tooltip!==void 0&&!it(i.tooltip)&&!(i.tooltip instanceof mi)?(console.log("INVALID tree item, invalid tooltip",i.tooltip),!1):i.command!==void 0&&!i.command.command?(console.log("INVALID tree item, invalid command",i.command),!1):i.collapsibleState!==void 0&&i.collapsibleState<Ea.None&&i.collapsibleState>Ea.Expanded?(console.log("INVALID tree item, invalid collapsibleState",i.collapsibleState),!1):i.contextValue!==void 0&&!it(i.contextValue)?(console.log("INVALID tree item, invalid contextValue",i.contextValue),!1):i.accessibilityInformation!==void 0&&!i.accessibilityInformation?.label?(console.log("INVALID tree item, invalid accessibilityInformation",i.accessibilityInformation),!1):!0}constructor(e,t=Ea.None){this.collapsibleState=t,x.isUri(e)?this.resourceUri=e:this.label=e}};$g=Ow=V([be],$g);var Ea;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(Ea||(Ea={}));var Is;(function(n){n[n.Unchecked=0]="Unchecked",n[n.Checked=1]="Checked"})(Is||(Is={}));let Hg=class{async asString(){return typeof this.value=="string"?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};Hg=V([be],Hg);class Bg extends Hg{}class v3 extends Bg{#e;constructor(e){super(""),this.#e=e}asFile(){return this.#e}}class w3{constructor(e,t,i,s){this.name=e,this.uri=t,this._itemId=i,this._getData=s}data(){return this._getData()}}let qc=class{#e=new Map;constructor(e){for(const[t,i]of e??[]){const s=this.#e.get(this.#t(t));s?s.push(i):this.#e.set(this.#t(t),[i])}}get(e){return this.#e.get(this.#t(e))?.[0]}set(e,t){this.#e.set(this.#t(e),[t])}forEach(e,t){for(const[i,s]of this.#e)for(const r of s)e.call(t,r,i,this)}*[Symbol.iterator](){for(const[e,t]of this.#e)for(const i of t)yield[e,i]}#t(e){return e.toLowerCase()}};qc=V([be],qc);let nb=class{constructor(e,t,i){this.insertText=e,this.title=t,this.kind=i}};nb=V([be],nb);var ib;(function(n){n[n.Automatic=0]="Automatic",n[n.PasteAs=1]="PasteAs"})(ib||(ib={}));const Jl=class Jl{constructor(e){this.value=e}append(...e){return new Jl((this.value?[this.value,...e]:e).join(Jl.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+Jl.sep)}};Jl.sep=".";let js=Jl;js.Empty=new js("");js.Text=new js("text");js.TextUpdateImports=js.Text.append("updateImports");class b3{constructor(e,t,i){this.title=t,this.insertText=e,this.kind=i}}let Kn=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id!="string"?(console.log("INVALID ThemeIcon, invalid id",e.id),!1):!0}};Kn=V([be],Kn);Kn.File=new Kn("file");Kn.Folder=new Kn("folder");let oh=class{constructor(e){this.id=e}};oh=V([be],oh);var cc;(function(n){n[n.Global=1]="Global",n[n.Workspace=2]="Workspace",n[n.WorkspaceFolder=3]="WorkspaceFolder"})(cc||(cc={}));let uc=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=x.file(e)}get baseUri(){return this._baseUri}set baseUri(e){this._baseUri=e,this._base=e.fsPath}constructor(e,t){if(typeof e!="string"&&(!e||!x.isUri(e)&&!x.isUri(e.uri)))throw Ve("base");if(typeof t!="string")throw Ve("pattern");typeof e=="string"?this.baseUri=x.file(e):x.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};uc=V([be],uc);const zT=new WeakMap;function y3(n,e){zT.set(n,e)}let jc=class{constructor(e,t,i,s,r){this.enabled=typeof e=="boolean"?e:!0,typeof t=="string"&&(this.condition=t),typeof i=="string"&&(this.hitCondition=i),typeof s=="string"&&(this.logMessage=s),typeof r=="string"&&(this.mode=r)}get id(){return this._id||(this._id=zT.get(this)??Sn()),this._id}};jc=V([be],jc);let ca=class extends jc{constructor(e,t,i,s,r,o){if(super(t,i,s,r,o),e===null)throw Ve("location");this.location=e}};ca=V([be],ca);let ua=class extends jc{constructor(e,t,i,s,r,o){super(t,i,s,r,o),this.functionName=e}};ua=V([be],ua);let Wg=class extends jc{constructor(e,t,i,s,r,o,a,l){if(super(s,r,o,a,l),!t)throw Ve("dataId");this.label=e,this.dataId=t,this.canPersist=i}};Wg=V([be],Wg);let Vg=class{constructor(e,t,i){this.command=e,this.args=t||[],this.options=i}};Vg=V([be],Vg);let ah=class{constructor(e,t){this.port=e,this.host=t}};ah=V([be],ah);let zg=class{constructor(e){this.path=e}};zg=V([be],zg);let lh=class{constructor(e){this.implementation=e}};lh=V([be],lh);class qT{constructor(e,t,i){this.session=e,this.threadId=t,this.frameId=i}}class jT{constructor(e,t){this.session=e,this.threadId=t}}let qg=class{constructor(e,t){this.range=e,this.expression=t}};qg=V([be],qg);var ch;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(ch||(ch={}));let jg=class{constructor(e,t){this.range=e,this.text=t}};jg=V([be],jg);let Gg=class{constructor(e,t,i=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=i}};Gg=V([be],Gg);let Kg=class{constructor(e,t){this.range=e,this.expression=t}};Kg=V([be],Kg);let sb=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};sb=V([be],sb);var rb;(function(n){n[n.AIGenerated=1]="AIGenerated"})(rb||(rb={}));var uh;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(uh||(uh={}));class x3{constructor(e,t){this.newSymbolName=e,this.tags=t}}var dc;(function(n){n[n.Changed=1]="Changed",n[n.Created=2]="Created",n[n.Deleted=3]="Deleted"})(dc||(dc={}));let cn=ei=class extends Error{static FileExists(e){return new ei(e,Fe.FileExists,ei.FileExists)}static FileNotFound(e){return new ei(e,Fe.FileNotFound,ei.FileNotFound)}static FileNotADirectory(e){return new ei(e,Fe.FileNotADirectory,ei.FileNotADirectory)}static FileIsADirectory(e){return new ei(e,Fe.FileIsADirectory,ei.FileIsADirectory)}static NoPermissions(e){return new ei(e,Fe.NoPermissions,ei.NoPermissions)}static Unavailable(e){return new ei(e,Fe.Unavailable,ei.Unavailable)}constructor(e,t=Fe.Unknown,i){super(x.isUri(e)?e.toString(!0):e),this.code=i?.name??"Unknown",FC(this,t),Object.setPrototypeOf(this,ei.prototype),typeof Error.captureStackTrace=="function"&&typeof i=="function"&&Error.captureStackTrace(this,i)}};cn=ei=V([be],cn);let ob=class{constructor(e,t,i){this.start=e,this.end=t,this.kind=i}};ob=V([be],ob);var gr;(function(n){n[n.Comment=1]="Comment",n[n.Imports=2]="Imports",n[n.Region=3]="Region"})(gr||(gr={}));var dh;(function(n){n[n.Collapsed=0]="Collapsed",n[n.Expanded=1]="Expanded"})(dh||(dh={}));var ab;(function(n){n[n.Editing=0]="Editing",n[n.Preview=1]="Preview"})(ab||(ab={}));var lb;(function(n){n[n.Published=0]="Published",n[n.Draft=1]="Draft"})(lb||(lb={}));var hh;(function(n){n[n.Unresolved=0]="Unresolved",n[n.Resolved=1]="Resolved"})(hh||(hh={}));var fh;(function(n){n[n.Current=0]="Current",n[n.Outdated=1]="Outdated"})(fh||(fh={}));var ph;(function(n){n[n.Reply=1]="Reply",n[n.Comment=2]="Comment"})(ph||(ph={}));class cb{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}}function E3(n){return typeof n>"u"||M5(n)}class eE{constructor(e){if(this._prevLine=0,this._prevChar=0,this._dataIsSortedAndDeltaEncoded=!0,this._data=[],this._dataLen=0,this._tokenTypeStrToInt=new Map,this._tokenModifierStrToInt=new Map,this._hasLegend=!1,e){this._hasLegend=!0;for(let t=0,i=e.tokenTypes.length;t<i;t++)this._tokenTypeStrToInt.set(e.tokenTypes[t],t);for(let t=0,i=e.tokenModifiers.length;t<i;t++)this._tokenModifierStrToInt.set(e.tokenModifiers[t],t)}}push(e,t,i,s,r){if(typeof e=="number"&&typeof t=="number"&&typeof i=="number"&&typeof s=="number"&&(typeof r=="number"||typeof r>"u"))return typeof r>"u"&&(r=0),this._pushEncoded(e,t,i,s,r);if(Me.isRange(e)&&typeof t=="string"&&E3(i))return this._push(e,t,i);throw Ve()}_push(e,t,i){if(!this._hasLegend)throw new Error("Legend must be provided in constructor");if(e.start.line!==e.end.line)throw new Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw new Error("`tokenType` is not in the provided legend");const s=e.start.line,r=e.start.character,o=e.end.character-e.start.character,a=this._tokenTypeStrToInt.get(t);let l=0;if(i)for(const c of i){if(!this._tokenModifierStrToInt.has(c))throw new Error("`tokenModifier` is not in the provided legend");const u=this._tokenModifierStrToInt.get(c);l|=1<<u>>>0}this._pushEncoded(s,r,o,a,l)}_pushEncoded(e,t,i,s,r){if(this._dataIsSortedAndDeltaEncoded&&(e<this._prevLine||e===this._prevLine&&t<this._prevChar)){this._dataIsSortedAndDeltaEncoded=!1;const l=this._data.length/5|0;let c=0,u=0;for(let d=0;d<l;d++){let f=this._data[5*d],p=this._data[5*d+1];f===0?(f=c,p+=u):f+=c,this._data[5*d]=f,this._data[5*d+1]=p,c=f,u=p}}let o=e,a=t;this._dataIsSortedAndDeltaEncoded&&this._dataLen>0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=r,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){const t=[],i=e.length/5|0;for(let a=0;a<i;a++)t[a]=a;t.sort((a,l)=>{const c=e[5*a],u=e[5*l];if(c===u){const d=e[5*a+1],f=e[5*l+1];return d-f}return c-u});const s=new Uint32Array(e.length);let r=0,o=0;for(let a=0;a<i;a++){const l=5*t[a],c=e[l+0],u=e[l+1],d=e[l+2],f=e[l+3],p=e[l+4],_=c-r,w=_===0?u-o:u,v=5*a;s[v+0]=_,s[v+1]=w,s[v+2]=d,s[v+3]=f,s[v+4]=p,r=c,o=u}return s}build(e){return this._dataIsSortedAndDeltaEncoded?new Gc(new Uint32Array(this._data),e):new Gc(eE._sortAndDeltaEncode(this._data),e)}}class Gc{constructor(e,t){this.resultId=t,this.data=e}}class GT{constructor(e,t,i){this.start=e,this.deleteCount=t,this.data=i}}class sp{constructor(e,t){this.resultId=t,this.edits=e}}var Qg;(function(n){n[n.Separate=0]="Separate",n[n.MergeWithParent=1]="MergeWithParent"})(Qg||(Qg={}));class S3{constructor(e){this.name=e}}var ub;(function(n){n[n.Title=1]="Title",n[n.Inline=2]="Inline"})(ub||(ub={}));var yc;let gh=(yc=class{constructor(){}},yc.Back={iconPath:new Kn("arrow-left")},yc);gh=V([be],gh);var mh;(function(n){n[n.Separator=-1]="Separator",n[n.Default=0]="Default"})(mh||(mh={}));var hc;(function(n){n[n.Info=1]="Info",n[n.Warning=2]="Warning",n[n.Error=3]="Error"})(hc||(hc={}));var Sa;(function(n){n[n.UI=1]="UI",n[n.Workspace=2]="Workspace"})(Sa||(Sa={}));class db{static validate(e){if(typeof e.badge=="string"){let t=lS(e.badge,0);if(t<e.badge.length&&(t+=lS(e.badge,t)),e.badge.length>t)throw new Error("The 'badge'-property must be undefined or a short character")}else if(e.badge&&!Kn.isThemeIcon(e.badge))throw new Error("The 'badge'-property is not a valid ThemeIcon");if(!e.color&&!e.badge&&!e.tooltip)throw new Error("The decoration is empty");return!0}constructor(e,t,i){this.badge=e,this.tooltip=t,this.color=i}}let Jg=class{constructor(e){this.kind=e}};Jg=V([be],Jg);var oo;(function(n){n[n.Light=1]="Light",n[n.Dark=2]="Dark",n[n.HighContrast=3]="HighContrast",n[n.HighContrastLight=4]="HighContrastLight"})(oo||(oo={}));let as=class hb{static isNotebookRange(e){return e instanceof hb?!0:e?typeof e.start=="number"&&typeof e.end=="number":!1}get start(){return this._start}get end(){return this._end}get isEmpty(){return this._start===this._end}constructor(e,t){if(e<0)throw Ve("start must be positive");if(t<0)throw Ve("end must be positive");e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(e){let t=this._start,i=this._end;return e.start!==void 0&&(t=e.start),e.end!==void 0&&(i=e.end),t===this._start&&i===this._end?this:new hb(t,i)}},c_=class fb{static validate(e){if(typeof e.kind!="number")throw new Error("NotebookCellData MUST have 'kind' property");if(typeof e.value!="string")throw new Error("NotebookCellData MUST have 'value' property");if(typeof e.languageId!="string")throw new Error("NotebookCellData MUST have 'languageId' property")}static isNotebookCellDataArray(e){return Array.isArray(e)&&e.every(t=>fb.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(e,t,i,s,r,o,a){this.kind=e,this.value=t,this.languageId=i,this.mime=s,this.outputs=r??[],this.metadata=o,this.executionSummary=a,fb.validate(this)}},KT=class{constructor(e){this.cells=e}},QT=class sr{static isNotebookCellOutputItem(e){return e instanceof sr?!0:e?typeof e.mime=="string"&&e.data instanceof Uint8Array:!1}static error(e){const t={name:e.name,message:e.message,stack:e.stack};return sr.json(t,"application/vnd.code.notebook.error")}static stdout(e){return sr.text(e,"application/vnd.code.notebook.stdout")}static stderr(e){return sr.text(e,"application/vnd.code.notebook.stderr")}static bytes(e,t="application/octet-stream"){return new sr(e,t)}static#e=new TextEncoder;static text(e,t=Us.text){const i=sr.#e.encode(String(e));return new sr(i,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return sr.text(i,t)}constructor(e,t){this.data=e,this.mime=t;const i=iT(t,!0);if(!i)throw new Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=i}},Xg=class pb{static isNotebookCellOutput(e){return e instanceof pb?!0:!e||typeof e!="object"?!1:typeof e.id=="string"&&Array.isArray(e.items)}static ensureUniqueMimeTypes(e,t=!1){const i=new Set,s=new Set;for(let r=0;r<e.length;r++){const o=e[r],a=iT(o.mime);if(!i.has(a)||kT(a)){i.add(a);continue}s.add(r),t&&console.warn(`DUPLICATED mime type '${o.mime}' will be dropped`)}return s.size===0?e:e.filter((r,o)=>!s.has(o))}constructor(e,t,i){this.items=pb.ensureUniqueMimeTypes(e,!0),typeof t=="string"?(this.id=t,this.metadata=i):(this.id=Sn(),this.metadata=t??i)}};class k3{constructor(e,t,i){this.label=e,this.uri=t,this.position=i}}var da;(function(n){n[n.Markup=1]="Markup",n[n.Code=2]="Code"})(da||(da={}));var gb;(function(n){n[n.Idle=1]="Idle",n[n.Pending=2]="Pending",n[n.Executing=3]="Executing"})(gb||(gb={}));var Yg;(function(n){n[n.Left=1]="Left",n[n.Right=2]="Right"})(Yg||(Yg={}));var Zg;(function(n){n[n.Default=0]="Default",n[n.InCenter=1]="InCenter",n[n.InCenterIfOutsideViewport=2]="InCenterIfOutsideViewport",n[n.AtTop=3]="AtTop"})(Zg||(Zg={}));class D3{constructor(e,t){this.text=e,this.alignment=t}}var mb;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred"})(mb||(mb={}));var em;(function(n){n[n.Default=1]="Default",n[n.Preferred=2]="Preferred",n[n.Hidden=-1]="Hidden"})(em||(em={}));let JT=class{constructor(e,t=[]){this.uri=e,this.provides=Ri(t)}},I3=class{constructor(e){this.label=e}};var _h;(function(n){n[n.Named=1]="Named",n[n.Indexed=2]="Indexed"})(_h||(_h={}));let _b=class{constructor(e,t){this.label=e,this.timestamp=t}};_b=V([be],_b);var fc;(function(n){n[n.Production=1]="Production",n[n.Development=2]="Development",n[n.Test=3]="Test"})(fc||(fc={}));var tm;(function(n){n[n.Node=1]="Node",n[n.Webworker=2]="Webworker"})(tm||(tm={}));var ho;(function(n){n[n.Other=0]="Other",n[n.Comment=1]="Comment",n[n.String=2]="String",n[n.RegEx=3]="RegEx"})(ho||(ho={}));class C3{constructor(e,t){this.ranges=e,this.wordPattern=t}}class T3{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}}var vb;(function(n){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"})(vb||(vb={}));var pc;(function(n){n[n.Run=1]="Run",n[n.Debug=2]="Debug",n[n.Coverage=3]="Coverage"})(pc||(pc={}));class XT{constructor(e,t,i){this.controllerId=e,this.profileId=t,this.kind=i}}let nm=class{constructor(e=void 0,t=void 0,i=void 0,s=!1,r=!0){this.include=e,this.exclude=t,this.profile=i,this.continuous=s,this.preserveFocus=r}};nm=V([be],nm);let im=Fw=class{static diff(e,t,i){const s=new Fw(e);return s.expectedOutput=t,s.actualOutput=i,s}constructor(e){this.message=e}};im=Fw=V([be],im);let vh=class{constructor(e){this.id=e}};vh=V([be],vh);class P3{constructor(e,t,i){this.label=e,this.uri=t,this.position=i}}class rp{constructor(e,t){this.covered=e,this.total=t,op(this)}}function op(n){if(n){if(n.covered>n.total)throw new Error(`The total number of covered items (${n.covered}) cannot be greater than the total (${n.total})`);if(n.total<0)throw new Error(`The number of covered items (${n.total}) cannot be negative`)}}class Kc{static fromDetails(e,t){const i=new rp(0,0),s=new rp(0,0),r=new rp(0,0);for(const a of t)if("branches"in a){i.total+=1,i.covered+=a.executed?1:0;for(const l of a.branches)s.total+=1,s.covered+=l.executed?1:0}else r.total+=1,r.covered+=a.executed?1:0;const o=new Kc(e,i,s.total>0?s:void 0,r.total>0?r:void 0);return o.detailedCoverage=t,o}constructor(e,t,i,s,r=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=i,this.declarationCoverage=s,this.includesTests=r}}class YT{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i=[]){this.executed=e,this.location=t,this.branches=i}}class ZT{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.executed=e,this.location=t,this.label=i}}class eP{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,i){this.name=e,this.executed=t,this.location=i}}var wb;(function(n){n[n.None=0]="None",n[n.Option=1]="Option",n[n.Default=2]="Default",n[n.Preferred=3]="Preferred"})(wb||(wb={}));var bb;(function(n){n[n.Untrusted=0]="Untrusted",n[n.Trusted=1]="Trusted",n[n.Unspecified=2]="Unspecified"})(bb||(bb={}));var yb;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(yb||(yb={}));let tE=class{constructor(e,t,i,s,r,o){this.kind=e,this.name=t,this.detail=i,this.uri=s,this.range=r,this.selectionRange=o}};class nE{constructor(e){this.uri=e}}class sm{constructor(e,t){this.original=e,this.modified=t}}class tP{constructor(e,t,i,s){this.base=e,this.input1=t,this.input2=i,this.result=s}}class iE{constructor(e,t){this.uri=e,this.viewType=t}}class nP{constructor(e){this.viewType=e}}class sE{constructor(e,t){this.uri=e,this.notebookType=t}}class rE{constructor(e,t,i){this.original=e,this.modified=t,this.notebookType=i}}class iP{constructor(){}}class sP{constructor(e,t){this.uri=e,this.inputBoxUri=t}}class rP{constructor(){}}class oP{constructor(e){this.textDiffs=e}}var xb;(function(n){n[n.Down=0]="Down",n[n.Up=1]="Up"})(xb||(xb={}));var Eb;(function(n){n[n.Action=1]="Action",n[n.Toolbar=2]="Toolbar"})(Eb||(Eb={}));var Sb;(function(n){n[n.Short=1]="Short",n[n.Medium=2]="Medium",n[n.Full=3]="Full"})(Sb||(Sb={}));class A3{constructor(e,t,i){this.id=e,this.label=t,this.values=i}}var ha;(function(n){n[n.Accepted=1]="Accepted",n[n.Rejected=2]="Rejected",n[n.Saved=3]="Saved"})(ha||(ha={}));var kb;(function(n){n[n.Keep=1]="Keep",n[n.Undo=2]="Undo",n[n.UserModification=3]="UserModification"})(kb||(kb={}));var Db;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful",n[n.Undone=2]="Undone",n[n.Accepted=3]="Accepted",n[n.Bug=4]="Bug"})(Db||(Db={}));var wh;(function(n){n[n.Unhelpful=0]="Unhelpful",n[n.Helpful=1]="Helpful"})(wh||(wh={}));let u_=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new mi(e):e}},bh=class{constructor(e,t){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new mi(e):e,this.vulnerabilities=t}},rm=class{constructor(e,t,i,s){this.title=e,this.message=t,this.data=i,this.buttons=s}};class d_{constructor(e,t){this.value=e,this.baseUri=t}}let yh=class{constructor(e,t){this.value=e,this.value2=e,this.title=t}},oE=class{constructor(e){this.value=e}};class ap{constructor(e,t){this.value=e,this.task=t}}let xh=class{constructor(e){if(typeof e!="string"&&e.isTrusted===!0)throw new Error("The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.");this.value=typeof e=="string"?new mi(e):e}},h_=class{constructor(e){this.value=e}},ka=class{constructor(e,t,i){this.value=e,this.iconPath=t,this.options=i}},f_=class{constructor(e,t){this.value=e,this.isEdit=t}},om=class{constructor(e,t,i){this.value=e,this.license=t,this.snippet=i}},p_=class{constructor(e,t){this.uri=e,this.range=t}},aE=class{constructor(e){this.extensions=e}},Eh=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},am=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},Sh=class{constructor(e){this.toolName=e}};class Ib{constructor(e,t,i,s,r,o){this.prompt=e,this.command=t,this.references=i,this.participant=s,this.toolReferences=r,this.editedFileEvents=o}}class aP{constructor(e,t,i,s){this.response=e,this.result=t,this.participant=i,this.command=s}}var Yi;(function(n){n[n.Panel=1]="Panel",n[n.Terminal=2]="Terminal",n[n.Notebook=3]="Notebook",n[n.Editor=4]="Editor"})(Yi||(Yi={}));var Cb;(function(n){n[n.Complete=1]="Complete",n[n.Partial=2]="Partial",n[n.Omitted=3]="Omitted"})(Cb||(Cb={}));class lP{constructor(e,t,i){this.document=e,this.selection=t,this.wholeRange=i}}class cP{constructor(e){this.cell=e}}class uP{constructor(e,t,i){this.mimeType=e,this.data=t,this.reference=i}}class dP{constructor(e){this.diagnostics=e}}var fi;(function(n){n[n.User=1]="User",n[n.Assistant=2]="Assistant",n[n.System=3]="System"})(fi||(fi={}));class lm{constructor(e,t,i){this.callId=e,this.content=t,this.isError=i??!1}}class Tb{constructor(e,t,i){this.callId=e,this.content=t,this.isError=i??!1}}class R3{constructor(e,t,i,s){this.command=e,this.language=t,this.confirmationMessages=i,this.presentation=s}}var Pb;(function(n){n[n.Info=0]="Info",n[n.Warning=1]="Warning",n[n.Error=2]="Error"})(Pb||(Pb={}));let hP=class Ab{static User(e,t){return new Ab(fi.User,e,t)}static Assistant(e,t){return new Ab(fi.Assistant,e,t)}set content(e){typeof e=="string"?this._content=[new zt(e)]:this._content=e}get content(){return this._content}constructor(e,t,i){this._content=[],this.role=e,this.content=t,this.name=i}},fP=class Rb{static User(e,t){return new Rb(fi.User,e,t)}static Assistant(e,t){return new Rb(fi.Assistant,e,t)}set content(e){typeof e=="string"?this._content=[new zt(e)]:this._content=e}get content(){return this._content}set content2(e){e&&(this.content=e.map(t=>typeof t=="string"?new zt(t):t))}get content2(){return this.content.map(e=>e instanceof zt?e.value:e)}constructor(e,t,i){this._content=[],this.role=e,this.content=t,this.name=i}};class Ja{constructor(e,t,i){this.callId=e,this.name=t,this.input=i}}class zt{constructor(e){this.value=e}toJSON(){return{$mid:st.LanguageModelTextPart,value:this.value}}}class Ci{constructor(e,t){this.mimeType=t,this.data=e}static image(e,t){return new Ci(e,t)}static json(e,t="text/x-json"){const i=JSON.stringify(e,void 0," ");return new Ci(ue.fromString(i).buffer,t)}static text(e,t=Us.text){return new Ci(ue.fromString(e).buffer,t)}toJSON(){return{$mid:st.LanguageModelDataPart,mimeType:this.mimeType,data:this.data}}}var br;(function(n){n.PNG="image/png",n.JPEG="image/jpeg",n.GIF="image/gif",n.WEBP="image/webp",n.BMP="image/bmp"})(br||(br={}));class Gs{constructor(e){this.value=e}toJSON(){return{$mid:st.LanguageModelPromptTsxPart,value:this.value}}}class yn extends Error{static#e="LanguageModelError";static NotFound(e){return new yn(e,yn.NotFound.name)}static NoPermissions(e){return new yn(e,yn.NoPermissions.name)}static Blocked(e){return new yn(e,yn.Blocked.name)}static tryDeserialize(e){if(e.name===yn.#e)return new yn(e.message,e.code,e.cause)}constructor(e,t,i){super(e,{cause:i}),this.name=yn.#e,this.code=t??""}}let g_=class{constructor(e){this.content=e}toJSON(){return{$mid:st.LanguageModelToolResult,content:this.content}}},pP=class{constructor(e){this.content=e}toJSON(){return{$mid:st.LanguageModelToolResult,content:this.content}}};class L3 extends g_{}var Lb;(function(n){n[n.Auto=1]="Auto",n[n.Required=2]="Required"})(Lb||(Lb={}));var Nb;(function(n){n[n.SymbolInformation=1]="SymbolInformation",n[n.CommandInformation=2]="CommandInformation",n[n.SearchInformation=3]="SearchInformation",n[n.SettingInformation=4]="SettingInformation"})(Nb||(Nb={}));var Ob;(function(n){n[n.EMBEDDED=1]="EMBEDDED",n[n.LLM_RANKED=2]="LLM_RANKED",n[n.CANCELED=3]="CANCELED"})(Ob||(Ob={}));var Fb;(function(n){n[n.Started=1]="Started",n[n.Recognizing=2]="Recognizing",n[n.Recognized=3]="Recognized",n[n.Stopped=4]="Stopped",n[n.Error=5]="Error"})(Fb||(Fb={}));var Mb;(function(n){n[n.Started=1]="Started",n[n.Stopped=2]="Stopped",n[n.Error=3]="Error"})(Mb||(Mb={}));var Ub;(function(n){n[n.Recognized=1]="Recognized",n[n.Stopped=2]="Stopped"})(Ub||(Ub={}));class N3{constructor(e,t){this.text=e,this.range=t}}var kh;(function(n){n[n.Invoke=0]="Invoke",n[n.Automatic=1]="Automatic"})(kh||(kh={}));class O3{constructor(e,t,i,s={},r){this.label=e,this.command=t,this.args=i,this.env=s,this.version=r}}class F3{constructor(e,t,i={},s){this.label=e,this.uri=t,this.headers=i,this.version=s}}var Jr;(function(n){n[n.EMBEDDED=1]="EMBEDDED",n[n.LLM_RANKED=2]="LLM_RANKED",n[n.CANCELED=3]="CANCELED"})(Jr||(Jr={}));const M3={IconContribution:"base.contributions.icons"};var lD;(function(n){function e(t,i){let s=t.defaults;for(;sn.isThemeIcon(s);){const r=mu.getIcon(s.id);if(!r)return;s=r.defaults}return s}n.getDefinition=e})(lD||(lD={}));var cD;(function(n){function e(i){return{weight:i.weight,style:i.style,src:i.src.map(s=>({format:s.format,location:s.location.toString()}))}}n.toJSONObject=e;function t(i){const s=r=>it(r)?r:void 0;if(i&&Array.isArray(i.src)&&i.src.every(r=>it(r.format)&&it(r.location)))return{weight:s(i.weight),style:s(i.style),src:i.src.map(r=>({format:r.format,location:x.parse(r.location)}))}}n.fromJSONObject=t})(cD||(cD={}));const U3=/^([\w_-]+)$/,$3=h(2292,"The font ID must only contain letters, numbers, underscores and dashes.");class H3 extends Se{constructor(){super(),this._onDidChange=this._register(new N),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:h(2293,"The id of the font to use. If not set, the font that is defined first is used."),pattern:U3.source,patternErrorMessage:$3},fontCharacter:{type:"string",description:h(2294,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${sn.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,s){const r=this.iconsById[e];if(r){if(i&&!r.description){r.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const l=this.iconReferenceSchema.enum.indexOf(e);l!==-1&&(this.iconReferenceSchema.enumDescriptions[l]=i),this._onDidChange.fire()}return r}const o={id:e,description:i,defaults:t,deprecationMessage:s};this.iconsById[e]=o;const a={$ref:"#/definitions/icons"};return s&&(a.deprecationMessage=s),i&&(a.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=a,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}deregisterIcon(e){delete this.iconsById[e],delete this.iconSchema.properties[e];const t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enum.splice(t,1),this.iconReferenceSchema.enumDescriptions.splice(t,1)),this._onDidChange.fire()}getIcons(){return Object.keys(this.iconsById).map(e=>this.iconsById[e])}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}getIconReferenceSchema(){return this.iconReferenceSchema}registerIconFont(e,t){const i=this.iconFontsById[e];return i||(this.iconFontsById[e]=t,this._onDidChange.fire(),t)}deregisterIconFont(e){delete this.iconFontsById[e]}getIconFont(e){return this.iconFontsById[e]}toString(){const e=(r,o)=>r.id.localeCompare(o.id),t=r=>{for(;sn.isThemeIcon(r.defaults);)r=this.iconsById[r.defaults.id];return`codicon codicon-${r?r.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const s=Object.keys(this.iconsById).map(r=>this.iconsById[r]);for(const r of s.filter(o=>!!o.description).sort(e))i.push(`|<i class="${t(r)}"></i>|${r.id}|${sn.isThemeIcon(r.defaults)?r.defaults.id:r.id}|${r.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const r of s.filter(o=>!sn.isThemeIcon(o.defaults)).sort(e))i.push(`|<i class="${t(r)}"></i>|${r.id}|`);return i.join(`
|
|
99
99
|
`)}}const mu=new H3;mn.add(M3.IconContribution,mu);function af(n,e,t,i){return mu.registerIcon(n,e,t,i)}function B3(){const n=E8();for(const e in n){const t="\\"+n[e].toString(16);mu.registerIcon(e,{fontCharacter:t})}}B3();const gP="vscode://schemas/icons",mP=mn.as(o_.JSONContribution);mP.registerSchema(gP,mu.getIconSchema());const uD=new tl(()=>mP.notifySchemaChanged(gP),200);mu.onDidChange(()=>{uD.isScheduled()||uD.schedule()});af("widget-close",_e.close,h(2295,"Icon for the close action in widgets."));af("goto-previous-location",_e.arrowUp,h(2296,"Icon for goto previous editor location."));af("goto-next-location",_e.arrowDown,h(2297,"Icon for goto next editor location."));sn.modify(_e.sync,"spin");sn.modify(_e.loading,"spin");pe("IMcpService");const W3=pe("IMcpWorkbenchService");pe("IMcpServerSampling");var ud;(function(n){n.LATEST_PROTOCOL_VERSION="2025-03-26",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})(ud||(ud={}));function V3(n,e){return tt.toKey(n)+"/"+e}var dD;(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"})(dD||(dD={}));var hD;(function(n){function e(t,i){return t.id===i.id&&t.remoteAuthority===i.remoteAuthority&&t.label===i.label&&t.isTrustedByDefault===i.isTrustedByDefault}n.equals=e})(hD||(hD={}));var fD;(function(n){function e(s){return s}n.toSerialized=e;function t(s){return{id:s.id,label:s.label,cacheNonce:s.cacheNonce,launch:Dh.fromSerialized(s.launch),variableReplacement:s.variableReplacement?$b.fromSerialized(s.variableReplacement):void 0}}n.fromSerialized=t;function i(s,r){return s.id===r.id&&s.label===r.label&&Pi(s.roots,r.roots,(o,a)=>o.toString()===a.toString())&&Gn(s.launch,r.launch)&&Gn(s.presentation,r.presentation)&&Gn(s.variableReplacement,r.variableReplacement)&&Gn(s.devMode,r.devMode)}n.equals=i})(fD||(fD={}));var $b;(function(n){function e(i){return i}n.toSerialized=e;function t(i){return{section:i.section,folder:i.folder?{...i.folder,uri:x.revive(i.folder.uri)}:void 0,target:i.target}}n.fromSerialized=t})($b||($b={}));var pD;(function(n){n[n.HasUnknown=0]="HasUnknown",n[n.LoadingUnknown=1]="LoadingUnknown",n[n.AllKnown=2]="AllKnown"})(pD||(pD={}));var gD;(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"})(gD||(gD={}));var Xa;(function(n){n[n.Stdio=1]="Stdio",n[n.HTTP=2]="HTTP"})(Xa||(Xa={}));var Dh;(function(n){function e(i){return i}n.toSerialized=e;function t(i){switch(i.type){case Xa.HTTP:return{type:i.type,uri:x.revive(i.uri),headers:i.headers};case Xa.Stdio:return{type:i.type,cwd:i.cwd,command:i.command,args:i.args,env:i.env,envFile:i.envFile}}}n.fromSerialized=t})(Dh||(Dh={}));var mr;(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 h(7986,"Stopped");case e.Starting:return h(7987,"Starting");case e.Running:return h(7988,"Running");case e.Error:return h(7989,"Error {0}",t.message);default:Nv()}},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:Nv()}},n.canBeStarted=t=>t===e.Error||t===e.Stopped,n.isRunning=t=>!n.canBeStarted(t.state)})(mr||(mr={}));let mD=class extends Se{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.name===t.mcpServer.name&&(t.mcpServer=e):t.update()}};mD=V([L(1,W3)],mD);new P("mcpServersGalleryEnabled",!1);new P("hasInstalledMcpServers",!1);af("mcp-server",_e.mcp,h(7990,"Icon used for the MCP server."));var _D;(function(n){n.scheme="mcp-resource";function e(i,s){return typeof s=="string"&&(s=x.parse(s)),s.with({scheme:n.scheme,authority:sA(ue.fromString(i.id)),path:["",s.scheme,s.authority].join("/")+s.path})}n.fromServer=e;function t(i){if(typeof i=="string"&&(i=x.parse(i)),i.scheme!==n.scheme)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);const s=i.path.split("/");if(s.length<3)throw new Error(`Invalid MCP resource URI: ${i.toString()}`);const[,r,o,...a]=s;return{definitionId:rA(i.authority).toString(),resourceURI:i.with({scheme:r,authority:o,path:"/"+a.join("/")})}}n.toServer=t})(_D||(_D={}));var vD;(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"})(vD||(vD={}));var wD;(function(n){n.Prefix="mcp_",n[n.MaxPrefixLen=18]="MaxPrefixLen",n[n.MaxLength=64]="MaxLength"})(wD||(wD={}));var hs;(function(n){function e(i){const{selectionStartLineNumber:s,selectionStartColumn:r,positionLineNumber:o,positionColumn:a}=i,l=new qe(s-1,r-1),c=new qe(o-1,a-1);return new Nr(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})(hs||(hs={}));var z;(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 Me(s-1,r-1,o-1,a-1)}n.to=t})(z||(z={}));var Bs;(function(n){function e(i){return{uri:i.uri,range:z.from(i.range)}}n.from=e;function t(i){return new Ni(x.revive(i.uri),z.to(i.range))}n.to=t})(Bs||(Bs={}));var Hb;(function(n){function e(t){switch(t){case Al.Comment:return ho.Comment;case Al.Other:return ho.Other;case Al.RegEx:return ho.RegEx;case Al.String:return ho.String}}n.to=e})(Hb||(Hb={}));var ot;(function(n){function e(i){return new qe(i.lineNumber-1,i.column-1)}n.to=e;function t(i){return{lineNumber:i.line+1,column:i.character+1}}n.from=t})(ot||(ot={}));var Qc;(function(n){function e(s,r,o){return rn(Ri(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:pi.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}})(Qc||(Qc={}));var cm;(function(n){function e(i){switch(i){case oa.Unnecessary:return Ol.Unnecessary;case oa.Deprecated:return Ol.Deprecated}}n.from=e;function t(i){switch(i){case Ol.Unnecessary:return oa.Unnecessary;case Ol.Deprecated:return oa.Deprecated;default:return}}n.to=t})(cm||(cm={}));var Jc;(function(n){function e(i){let s;return i.code&&(it(i.code)||ga(i.code)?s=String(i.code):s={value:String(i.code.value),target:i.code.target}),{...z.from(i.range),message:i.message,source:i.source,code:s,severity:Ih.from(i.severity),relatedInformation:i.relatedInformation&&i.relatedInformation.map(um.from),tags:Array.isArray(i.tags)?rn(i.tags.map(cm.from)):void 0}}n.from=e;function t(i){const s=new kg(z.to(i),i.message,Ih.to(i.severity));return s.source=i.source,s.code=it(i.code)?i.code:i.code?.value,s.relatedInformation=i.relatedInformation&&i.relatedInformation.map(um.to),s.tags=i.tags&&rn(i.tags.map(cm.to)),s}n.to=t})(Jc||(Jc={}));var um;(function(n){function e(i){return{...z.from(i.location.range),message:i.message,resource:i.location.uri}}n.from=e;function t(i){return new Gd(new Ni(i.resource,z.to(i)),i.message)}n.to=t})(um||(um={}));var Ih;(function(n){function e(i){switch(i){case Pn.Error:return si.Error;case Pn.Warning:return si.Warning;case Pn.Information:return si.Info;case Pn.Hint:return si.Hint}return si.Error}n.from=e;function t(i){switch(i){case si.Info:return Pn.Information;case si.Warning:return Pn.Warning;case si.Error:return Pn.Error;case si.Hint:return Pn.Hint;default:return Pn.Error}}n.to=t})(Ih||(Ih={}));var hn;(function(n){function e(i){return typeof i=="number"&&i>=nh.One?i-1:i===nh.Beside?Y6:X6}n.from=e;function t(i){if(typeof i=="number"&&i>=0)return i+1;throw new Error("invalid 'EditorGroupColumn'")}n.to=t})(hn||(hn={}));function z3(n){return typeof n.range<"u"}function _P(n){return n.length===0?!0:!!z3(n[0])}var Re;(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:d,value:f}=a;l={value:"```"+d+`
|
|
100
|
-
`+f+"\n```\n"}}else mi.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 u=({href:d})=>{try{let f=x.parse(d,!0);f=f.with({query:s(f.query,c)}),c[d]=f}catch{}return""};return xt.walkTokens(xt.lexer(l.value),d=>{d.type==="link"?u({href:d.href}):d.type==="image"&&typeof d.href=="string"&&u(P8(d.href))}),l}n.from=i;function s(a,l){if(!a)return a;let c;try{c=nT(a)}catch{}if(!c)return a;let u=!1;return c=Nc(c,d=>{if(x.isUri(d)){const f=`__uri_${Math.random().toString(16).slice(2,8)}`;return l[f]=d,u=!0,f}else return}),u?JSON.stringify(c):a}function r(a){const l=new mi(a.value,a.supportThemeIcons);return l.isTrusted=a.isTrusted,l.supportHtml=a.supportHtml,l.baseUri=a.baseUri?x.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})(Re||(Re={}));function q3(n){return _P(n)?n.map(e=>({range:z.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Re.fromMany(e.hoverMessage):e.hoverMessage?Re.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):n.map(e=>({range:z.from(e)}))}function m_(n){return typeof n>"u"?n:typeof n=="string"?x.file(n):n}var Xc;(function(n){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?m_(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})(Xc||(Xc={}));var dm;(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?m_(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?Xc.from(t.before):void 0,after:t.after?Xc.from(t.after):void 0}}n.from=e})(dm||(dm={}));var Bb;(function(n){function e(t){if(typeof t>"u")return t;switch(t){case la.OpenOpen:return Nl.AlwaysGrowsWhenTypingAtEdges;case la.ClosedClosed:return Nl.NeverGrowsWhenTypingAtEdges;case la.OpenClosed:return Nl.GrowsOnlyWhenTypingBefore;case la.ClosedOpen:return Nl.GrowsOnlyWhenTypingAfter}}n.from=e})(Bb||(Bb={}));var Wb;(function(n){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?Bb.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?dm.from(t.light):void 0,dark:t.dark?dm.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?m_(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?Xc.from(t.before):void 0,after:t.after?Xc.from(t.after):void 0}}n.from=e})(Wb||(Wb={}));var pn;(function(n){function e(i){return{text:i.newText,eol:i.newEol&&eu.from(i.newEol),range:z.from(i.range)}}n.from=e;function t(i){const s=new ko(z.to(i.range),i.text);return s.newEol=typeof i.eol>"u"?void 0:eu.to(i.eol),s}n.to=t})(pn||(pn={}));var _i;(function(n){function e(i,s){const r={edits:[]};if(i instanceof Ga){const o=new V4;for(const a of i._allEntries())a._type===Wt.File&&x.isUri(a.to)&&a.from===void 0&&o.add(a.to);for(const a of i._allEntries())if(a._type===Wt.File){let l;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?l={type:"base64",value:j1(ue.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===Wt.Text?r.edits.push({resource:a.uri,textEdit:pn.from(a.edit),versionId:o.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===Wt.Snippet?r.edits.push({resource:a.uri,textEdit:{range:z.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===Wt.Cell?r.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookVersionId:s?.getNotebookDocumentVersion(a.uri)}):a._type===Wt.CellReplace&&r.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:s?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:_o.Replace,index:a.index,count:a.count,cells:a.cells.map(nu.from)}})}return r}n.from=e;function t(i){const s=new Ga,r=new on;for(const o of i.edits)if(o.textEdit){const a=o,l=x.revive(a.resource),c=z.to(a.textEdit.range),u=a.textEdit.text,d=a.textEdit.insertAsSnippet;let f;d?f=xa.replace(c,new Ka(u)):f=ko.replace(c,u);const p=r.get(l);p?p.push(f):r.set(l,[f])}else s.renameFile(x.revive(o.oldResource),x.revive(o.newResource),o.options);for(const[o,a]of r)s.set(o,a);return s}n.to=t})(_i||(_i={}));var Hi;(function(n){const e=Object.create(null);e[_t.File]=K.File,e[_t.Module]=K.Module,e[_t.Namespace]=K.Namespace,e[_t.Package]=K.Package,e[_t.Class]=K.Class,e[_t.Method]=K.Method,e[_t.Property]=K.Property,e[_t.Field]=K.Field,e[_t.Constructor]=K.Constructor,e[_t.Enum]=K.Enum,e[_t.Interface]=K.Interface,e[_t.Function]=K.Function,e[_t.Variable]=K.Variable,e[_t.Constant]=K.Constant,e[_t.String]=K.String,e[_t.Number]=K.Number,e[_t.Boolean]=K.Boolean,e[_t.Array]=K.Array,e[_t.Object]=K.Object,e[_t.Key]=K.Key,e[_t.Null]=K.Null,e[_t.EnumMember]=K.EnumMember,e[_t.Struct]=K.Struct,e[_t.Event]=K.Event,e[_t.Operator]=K.Operator,e[_t.TypeParameter]=K.TypeParameter;function t(s){return typeof e[s]=="number"?e[s]:K.Property}n.from=t;function i(s){for(const r in e)if(e[r]===s)return Number(r);return _t.Property}n.to=i})(Hi||(Hi={}));var Or;(function(n){function e(i){switch(i){case Qd.Deprecated:return Gp.Deprecated}}n.from=e;function t(i){switch(i){case Gp.Deprecated:return Qd.Deprecated}}n.to=t})(Or||(Or={}));var Ya;(function(n){function e(i){return{name:i.name,kind:Hi.from(i.kind),tags:i.tags&&i.tags.map(Or.from),containerName:i.containerName,location:oi.from(i.location)}}n.from=e;function t(i){const s=new Jd(i.name,Hi.to(i.kind),i.containerName,oi.to(i.location));return s.tags=i.tags&&i.tags.map(Or.to),s}n.to=t})(Ya||(Ya={}));var Vb;(function(n){function e(i){const s={name:i.name||"!!MISSING: name!!",detail:i.detail,range:z.from(i.range),selectionRange:z.from(i.selectionRange),kind:Hi.from(i.kind),tags:i.tags?.map(Or.from)??[]};return i.children&&(s.children=i.children.map(e)),s}n.from=e;function t(i){const s=new Xd(i.name,i.detail,Hi.to(i.kind),z.to(i.range),z.to(i.selectionRange));return Kh(i.tags)&&(s.tags=i.tags.map(Or.to)),i.children&&(s.children=i.children.map(t)),s}n.to=t})(Vb||(Vb={}));var Za;(function(n){function e(i){const s=new Yx(Hi.to(i.kind),i.name,i.detail||"",x.revive(i.uri),z.to(i.range),z.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:Hi.from(i.kind),uri:i.uri,range:z.from(i.range),selectionRange:z.from(i.selectionRange),tags:i.tags?.map(Or.from)}}n.from=t})(Za||(Za={}));var zb;(function(n){function e(t){return new BT(Za.to(t.from),t.fromRanges.map(i=>z.to(i)))}n.to=e})(zb||(zb={}));var qb;(function(n){function e(t){return new WT(Za.to(t.to),t.fromRanges.map(i=>z.to(i)))}n.to=e})(qb||(qb={}));var oi;(function(n){function e(i){return{range:i.range&&z.from(i.range),uri:i.uri}}n.from=e;function t(i){return new Ni(x.revive(i.uri),z.to(i.range))}n.to=t})(oi||(oi={}));var Ch;(function(n){function e(i){const s=i,r=i;return{originSelectionRange:s.originSelectionRange?z.from(s.originSelectionRange):void 0,uri:s.targetUri?s.targetUri:r.uri,range:z.from(s.targetRange?s.targetRange:r.range),targetSelectionRange:s.targetSelectionRange?z.from(s.targetSelectionRange):void 0}}n.from=e;function t(i){return{targetUri:x.revive(i.uri),targetRange:z.to(i.range),targetSelectionRange:i.targetSelectionRange?z.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?z.to(i.originSelectionRange):void 0}}n.to=t})(Ch||(Ch={}));var Th;(function(n){function e(i){return{range:z.from(i.range),contents:Re.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}n.from=e;function t(i){const s=i.contents.map(Re.to),r=z.to(i.range),o=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new Ig(s,r,o,a)}n.to=t})(Th||(Th={}));var jb;(function(n){function e(i){return{range:z.from(i.range),expression:i.expression}}n.from=e;function t(i){return new qg(z.to(i.range),i.expression)}n.to=t})(jb||(jb={}));var hm;(function(n){function e(i){if(i instanceof jg)return{type:"text",range:z.from(i.range),text:i.text};if(i instanceof Gg)return{type:"variable",range:z.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof Kg)return{type:"expression",range:z.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:z.to(i.range),text:i.text};case"variable":return{range:z.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:z.to(i.range),expression:i.expression}}}n.to=t})(hm||(hm={}));var fm;(function(n){function e(i){return{frameId:i.frameId,stoppedLocation:z.from(i.stoppedLocation)}}n.from=e;function t(i){return new sb(i.frameId,z.to(i.stoppedLocation))}n.to=t})(fm||(fm={}));var Yc;(function(n){function e(i){return{range:z.from(i.range),kind:i.kind}}n.from=e;function t(i){return new Cg(z.to(i.range),i.kind)}n.to=t})(Yc||(Yc={}));var Gb;(function(n){function e(i){return{uri:i.uri,highlights:i.highlights.map(Yc.from)}}n.from=e;function t(i){return new Tg(x.revive(i.uri),i.highlights.map(Yc.to))}n.to=t})(Gb||(Gb={}));var Kb;(function(n){function e(t){switch(t){case ed.TriggerCharacter:return rc.TriggerCharacter;case ed.TriggerForIncompleteCompletions:return rc.TriggerForIncompleteCompletions;case ed.Invoke:default:return rc.Invoke}}n.to=e})(Kb||(Kb={}));var Qb;(function(n){function e(t){return{triggerKind:Kb.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}n.to=e})(Qb||(Qb={}));var pm;(function(n){function e(i){switch(i){case th.Deprecated:return Vp.Deprecated}}n.from=e;function t(i){switch(i){case Vp.Deprecated:return th.Deprecated}}n.to=t})(pm||(pm={}));var gm;(function(n){const e=new Map([[Ie.Method,F.Method],[Ie.Function,F.Function],[Ie.Constructor,F.Constructor],[Ie.Field,F.Field],[Ie.Variable,F.Variable],[Ie.Class,F.Class],[Ie.Interface,F.Interface],[Ie.Struct,F.Struct],[Ie.Module,F.Module],[Ie.Property,F.Property],[Ie.Unit,F.Unit],[Ie.Value,F.Value],[Ie.Constant,F.Constant],[Ie.Enum,F.Enum],[Ie.EnumMember,F.EnumMember],[Ie.Keyword,F.Keyword],[Ie.Snippet,F.Snippet],[Ie.Text,F.Text],[Ie.Color,F.Color],[Ie.File,F.File],[Ie.Reference,F.Reference],[Ie.Folder,F.Folder],[Ie.Event,F.Event],[Ie.Operator,F.Operator],[Ie.TypeParameter,F.TypeParameter],[Ie.Issue,F.Issue],[Ie.User,F.User]]);function t(r){return e.get(r)??F.Property}n.from=t;const i=new Map([[F.Method,Ie.Method],[F.Function,Ie.Function],[F.Constructor,Ie.Constructor],[F.Field,Ie.Field],[F.Variable,Ie.Variable],[F.Class,Ie.Class],[F.Interface,Ie.Interface],[F.Struct,Ie.Struct],[F.Module,Ie.Module],[F.Property,Ie.Property],[F.Unit,Ie.Unit],[F.Value,Ie.Value],[F.Constant,Ie.Constant],[F.Enum,Ie.Enum],[F.EnumMember,Ie.EnumMember],[F.Keyword,Ie.Keyword],[F.Snippet,Ie.Snippet],[F.Text,Ie.Text],[F.Color,Ie.Color],[F.File,Ie.File],[F.Reference,Ie.Reference],[F.Folder,Ie.Folder],[F.Event,Ie.Event],[F.Operator,Ie.Operator],[F.TypeParameter,Ie.TypeParameter],[F.User,Ie.User],[F.Issue,Ie.Issue]]);function s(r){return i.get(r)??Ie.Property}n.to=s})(gm||(gm={}));var Jb;(function(n){function e(t,i){const s=new Lg(t.label);return s.insertText=t.insertText,s.kind=gm.to(t.kind),s.tags=t.tags?.map(pm.to),s.detail=t.detail,s.documentation=Fr(t.documentation)?Re.to(t.documentation):t.documentation,s.sortText=t.sortText,s.filterText=t.filterText,s.preselect=t.preselect,s.commitCharacters=t.commitCharacters,et.isIRange(t.range)?s.range=z.to(t.range):typeof t.range=="object"&&(s.range={inserting:z.to(t.range.insert),replacing:z.to(t.range.replace)}),s.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&ba.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&ba.InsertAsSnippet?s.insertText=new Ka(t.insertText):(s.insertText=t.insertText,s.textEdit=s.range instanceof Me?new ko(s.range,s.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(s.additionalTextEdits=t.additionalTextEdits.map(r=>pn.to(r))),s.command=i&&t.command?i.fromInternal(t.command):void 0,s}n.to=e})(Jb||(Jb={}));var mm;(function(n){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Re.fromStrict(i.documentation)}}n.from=e;function t(i){return{label:i.label,documentation:Fr(i.documentation)?Re.to(i.documentation):i.documentation}}n.to=t})(mm||(mm={}));var _m;(function(n){function e(i){return{label:i.label,documentation:Re.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(mm.from):[],activeParameter:i.activeParameter}}n.from=e;function t(i){return{label:i.label,documentation:Fr(i.documentation)?Re.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(mm.to):[],activeParameter:i.activeParameter}}n.to=t})(_m||(_m={}));var Ph;(function(n){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(_m.from):[]}}n.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(_m.to):[]}}n.to=t})(Ph||(Ph={}));var Xb;(function(n){function e(t,i){const s=new Rg(ot.to(i.position),typeof i.label=="string"?i.label:i.label.map(Yb.to.bind(void 0,t)),i.kind&&vm.to(i.kind));return s.textEdits=i.textEdits&&i.textEdits.map(pn.to),s.tooltip=Fr(i.tooltip)?Re.to(i.tooltip):i.tooltip,s.paddingLeft=i.paddingLeft,s.paddingRight=i.paddingRight,s}n.to=e})(Xb||(Xb={}));var Yb;(function(n){function e(t,i){const s=new Ag(i.label);return s.tooltip=Fr(i.tooltip)?Re.to(i.tooltip):i.tooltip,aw.is(i.command)&&(s.command=t.fromInternal(i.command)),i.location&&(s.location=oi.to(i.location)),s}n.to=e})(Yb||(Yb={}));var vm;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(vm||(vm={}));var Da;(function(n){function e(i){return{range:z.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"?x.parse(i.url,!0):x.revive(i.url)}catch{}const r=new Og(z.to(i.range),s);return r.tooltip=i.tooltip,r}n.to=t})(Da||(Da={}));var wm;(function(n){function e(i){const s=new Mg(i.label);return i.textEdit&&(s.textEdit=pn.to(i.textEdit)),i.additionalTextEdits&&(s.additionalTextEdits=i.additionalTextEdits.map(r=>pn.to(r))),s}n.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?pn.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(s=>pn.from(s)):void 0}}n.from=t})(wm||(wm={}));var Zc;(function(n){function e(i){return new Vc(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})(Zc||(Zc={}));var Zb;(function(n){function e(i){return{range:z.from(i.range)}}n.from=e;function t(i){return new eh(z.to(i.range))}n.to=t})(Zb||(Zb={}));var bm;(function(n){function e(t){switch(t){case Fl.AUTO:return ac.AfterDelay;case Fl.EXPLICIT:return ac.Manual;case Fl.FOCUS_CHANGE:case Fl.WINDOW_CHANGE:return ac.FocusOut}}n.to=e})(bm||(bm={}));var gc;(function(n){function e(i){switch(i){case Xi.Off:return Fn.Off;case Xi.Relative:return Fn.Relative;case Xi.Interval:return Fn.Interval;case Xi.On:default:return Fn.On}}n.from=e;function t(i){switch(i){case Fn.Off:return Xi.Off;case Fn.Relative:return Xi.Relative;case Fn.Interval:return Xi.Interval;case Fn.On:default:return Xi.On}}n.to=t})(gc||(gc={}));var eu;(function(n){function e(i){if(i===os.CRLF)return Ll.CRLF;if(i===os.LF)return Ll.LF}n.from=e;function t(i){if(i===Ll.CRLF)return os.CRLF;if(i===Ll.LF)return os.LF}n.to=t})(eu||(eu={}));var ym;(function(n){function e(t){if(typeof t=="object")return t.viewId;switch(t){case wo.SourceControl:return id.Scm;case wo.Window:return id.Window;case wo.Notification:return id.Notification}throw new Error("Unknown 'ProgressLocation'")}n.from=e})(ym||(ym={}));var xm;(function(n){function e(i){const s={start:i.start+1,end:i.end+1};return i.kind&&(s.kind=Em.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=Em.to(i.kind)),s}n.to=t})(xm||(xm={}));var Em;(function(n){function e(i){if(i)switch(i){case gr.Comment:return _l.Comment;case gr.Imports:return _l.Imports;case gr.Region:return _l.Region}}n.from=e;function t(i){if(i)switch(i.value){case _l.Comment.value:return gr.Comment;case _l.Imports.value:return gr.Imports;case _l.Region.value:return gr.Region}}n.to=t})(Em||(Em={}));var dd;(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"?z.from(t.selection):void 0,override:typeof t.override=="boolean"?OL.id:void 0}}n.from=e})(dd||(dd={}));var pi;(function(n){function e(r){return r instanceof uc?r.toJSON():typeof r=="string"?r:t(r)||i(r)?new uc(r.baseUri??r.base,r.pattern).toJSON():r}n.from=e;function t(r){const o=r;return o?x.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 uc(x.revive(r.baseUri),r.pattern)}n.to=s})(pi||(pi={}));var ey;(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:pi.from(i.pattern)??void 0,exclusive:i.exclusive,notebookType:i.notebookType}}}else return}n.from=e})(ey||(ey={}));var Ws;(function(n){function e(i){return{start:i.start,end:i.end}}n.from=e;function t(i){return new as(i.start,i.end)}n.to=t})(Ws||(Ws={}));var tu;(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})(tu||(tu={}));var Ah;(function(n){function e(i){switch(i){case da.Markup:return Ml.Markup;case da.Code:default:return Ml.Code}}n.from=e;function t(i){switch(i){case Ml.Markup:return da.Markup;case Ml.Code:default:return da.Code}}n.to=t})(Ah||(Ah={}));var Xr;(function(n){function e(i){const s={metadata:i.metadata??Object.create(null),cells:[]};for(const r of i.cells)c_.validate(r),s.cells.push(nu.from(r));return s}n.from=e;function t(i){const s=new KT(i.cells.map(nu.to));return j4(i.metadata)||(s.metadata=i.metadata),s}n.to=t})(Xr||(Xr={}));var nu;(function(n){function e(i){return{cellKind:Ah.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:tu.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(Io.from):[]}}n.from=e;function t(i){return new c_(Ah.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(Io.to):void 0,i.metadata,i.internalMetadata?tu.to(i.internalMetadata):void 0)}n.to=t})(nu||(nu={}));var iu;(function(n){function e(i){return{mime:i.mime,valueBytes:ue.wrap(i.data)}}n.from=e;function t(i){return new QT(i.valueBytes.buffer,i.mime)}n.to=t})(iu||(iu={}));var Io;(function(n){function e(i){return{outputId:i.id,items:i.items.map(iu.from),metadata:i.metadata}}n.from=e;function t(i){const s=i.items.map(iu.to);return new Xg(s,i.outputId,i.metadata)}n.to=t})(Io||(Io={}));var Sm;(function(n){function e(s){return i(s)?{include:pi.from(s.include)??void 0,exclude:pi.from(s.exclude)??void 0}:pi.from(s)??void 0}n.from=e;function t(s){return i(s)?{include:pi.to(s.include),exclude:pi.to(s.exclude)}:pi.to(s)}n.to=t;function i(s){const r=s;return r?!tn(r.include)&&!tn(r.exclude):!1}})(Sm||(Sm={}));var ty;(function(n){function e(t,i,s){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===Yg.Left?Yp.Left:Yp.Right,command:i.toInternal(r,s),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}n.from=e})(ty||(ty={}));var ny;(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})(ny||(ny={}));var iy;(function(n){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}n.from=e})(iy||(iy={}));var km;(function(n){function e(i){return{uri:i.uri,provides:i.provides}}n.from=e;function t(i){return new JT(x.revive(i.uri),i.provides)}n.to=t})(km||(km={}));var su;(function(n){function e(i){return{message:Re.fromStrict(i.message)||"",type:ds.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:z.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(s=>({label:s.label,position:s.position&&ot.from(s.position),uri:s.uri&&x.revive(s.uri).toJSON()}))}}n.from=e;function t(i){const s=new im(typeof i.message=="string"?i.message:Re.to(i.message));return s.actualOutput=i.actual,s.expectedOutput=i.expected,s.contextValue=i.contextValue,s.location=i.location?oi.to(i.location):void 0,s}n.to=t})(su||(su={}));var fs;(function(n){n.namespace=tp,n.denamespace=MT})(fs||(fs={}));var sy;(function(n){function e(t){return{controllerId:t.controllerId,profileId:t.profileId,group:ru.from(t.kind)}}n.from=e})(sy||(sy={}));var ru;(function(n){const e={[pc.Coverage]:Rn.Coverage,[pc.Debug]:Rn.Debug,[pc.Run]:Rn.Run};function t(i){return e.hasOwnProperty(i)?e[i]:Rn.Run}n.from=t})(ru||(ru={}));var Co;(function(n){function e(i){const s=l_(i).controllerId;return{extId:Oe.fromExtHostTestItem(i,s).toString(),label:i.label,uri:x.revive(i.uri),busy:i.busy,tags:i.tags.map(r=>fs.namespace(s,r.id)),range:et.lift(z.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Re.fromStrict(i.error)||null}}n.from=e;function t(i){return{parent:void 0,error:void 0,id:Oe.fromString(i.extId).localId,label:i.label,uri:x.revive(i.uri),tags:(i.tags||[]).map(s=>{const{tagId:r}=fs.denamespace(s);return new vh(r)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:z.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}n.toPlain=t})(Co||(Co={}));(function(n){function e(i){return{id:i.id}}n.from=e;function t(i){return new vh(i.id)}n.to=t})(fs||(fs={}));var ry;(function(n){const e=(i,s)=>{const r=i.value;if(!r)return;const o={...Co.toPlain(r.item),parent:s,taskStates:r.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(l=>l.type===ds.Error).map(su.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 f7;for(const a of i.items)s.insert(Oe.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(Ii)}}n.to=t})(ry||(ry={}));var Rh;(function(n){function e(a){return{covered:a.covered,total:a.total}}function t(a){return"line"in a?ot.from(a):z.from(a)}function i(a){if(a)return"endLineNumber"in a?z.to(a):ot.to(a)}function s(a){if(a.type===ya.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 YT(a.count,i(a.location),a.branches?.map(c=>new ZT(c.count,i(c.location),c.label)))}else return new eP(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:ya.Statement,branches:a.branches.length?a.branches.map(l=>({count:l.executed,location:l.location&&t(l.location),label:l.label})):void 0}:{type:ya.Declaration,name:a.name,count:a.executed,location:t(a.location)}}n.fromDetails=r;function o(a,l,c){return op(c.statementCoverage),op(c.branchCoverage),op(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 Kc&&c.includesTests.length?c.includesTests.map(u=>Oe.fromExtHostTestItem(u,a).toString()):void 0}}n.fromFile=o})(Rh||(Rh={}));var oy;(function(n){function e(t){switch(t){case jp.Invoke:return Yd.Invoke;case jp.Auto:return Yd.Automatic}}n.to=e})(oy||(oy={}));var Ia;(function(n){function e(i){const s=new tE(Hi.to(i.kind),i.name,i.detail||"",x.revive(i.uri),z.to(i.range),z.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:Hi.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:z.from(i.range),selectionRange:z.from(i.selectionRange),tags:i.tags?.map(Or.from)}}n.from=t})(Ia||(Ia={}));var Dm;(function(n){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}n.from=e})(Dm||(Dm={}));var Ca;(function(n){function e(r,o,a){const l=o.fileData;return l?new v3(new w3(l.name,x.revive(l.uri),l.id,wx(()=>a(l.id)))):r===Us.uriList&&o.uriListData?new Bg(s(o.uriListData)):new Bg(o.asString)}n.to=e;async function t(r,o,a=Sn()){const l=await o.asString();if(r===Us.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 Zv.split(r).map(o=>{if(o.startsWith("#"))return o;try{return x.parse(o)}catch{}return o})}function s(r){return Zv.create(r.map(o=>typeof o=="string"?o:x.revive(o)))}})(Ca||(Ca={}));var ou;(function(n){function e(s,r){const o=s.items.map(([a,l])=>[a,Ca.to(a,l,r)]);return new qc(o)}n.toDataTransfer=e;async function t(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await Ca.from(o,a)]))}}n.from=t;async function i(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await Ca.from(o,a,a.id)]))}}n.fromList=i})(ou||(ou={}));var Im;(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})(Im||(Im={}));var au;(function(n){function e(i){switch(i){case ur.System:return fi.System;case ur.User:return fi.User;case ur.Assistant:return fi.Assistant}}n.to=e;function t(i){switch(i){case fi.System:return ur.System;case fi.User:return ur.User;case fi.Assistant:return ur.Assistant}return ur.User}n.from=t})(au||(au={}));var bD;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new zt(a.value);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new zt(c.value):new Gs(c.value));return new lm(a.toolCallId,l,a.isError)}else{if(a.type==="image_url")return;if(a.type==="tool_use")return new Ja(a.toolCallId,a.name,a.parameters)}}).filter(a=>a!==void 0),r=au.to(i.role);return new hP(r,s,i.name)}n.to=e;function t(i){const s=au.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new zt(o)]);const a=o.map(l=>{if(l instanceof lm)return{type:"tool_result",toolCallId:l.callId,value:rn(l.content.map(c=>c instanceof zt?{type:"text",value:c.value}:c instanceof Gs?{type:"prompt_tsx",value:c.value}:void 0)),isError:l.isError};if(l instanceof Ja)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof zt)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})(bD||(bD={}));var hd;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new zt(a.value);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new zt(c.value):c.type==="data"?new Ci(c.value.data.buffer,c.value.mimeType):new Gs(c.value));return new Tb(a.toolCallId,l,a.isError)}else return a.type==="image_url"?new Ci(a.value.data.buffer,a.value.mimeType):a.type==="data"?new Ci(a.data.buffer,a.mimeType):new Ja(a.toolCallId,a.name,a.parameters)}),r=au.to(i.role);return new fP(r,s,i.name)}n.to=e;function t(i){const s=au.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new zt(o)]);const a=o.map(l=>{if(l instanceof Tb||l instanceof lm)return{type:"tool_result",toolCallId:l.callId,value:rn(l.content.map(c=>c instanceof zt?{type:"text",value:c.value}:c instanceof Gs?{type:"prompt_tsx",value:c.value}:c instanceof Ci?{type:"data",value:{mimeType:c.mimeType,data:ue.wrap(c.data)}}:void 0)),isError:l.isError};if(l instanceof Ci)return j3(l)?{type:"image_url",value:{mimeType:l.mimeType,data:ue.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:ue.wrap(l.data)};if(l instanceof Ja)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof zt)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})(hd||(hd={}));function j3(n){switch(n.mimeType){case br.PNG:case br.JPEG:case br.GIF:case br.WEBP:case br.BMP:return!0;default:return!1}}var Lh;(function(n){function e(i){return{kind:"markdownContent",content:Re.from(i.value)}}n.from=e;function t(i){return new u_(Re.to(i.content))}n.to=t})(Lh||(Lh={}));var Cm;(function(n){function e(i){return{kind:"codeblockUri",uri:i.value,isEdit:i.isEdit}}n.from=e;function t(i){return new f_(x.revive(i.uri),i.isEdit)}n.to=t})(Cm||(Cm={}));var Tm;(function(n){function e(i){return{kind:"markdownVuln",content:Re.from(i.value),vulnerabilities:i.vulnerabilities}}n.from=e;function t(i){return new bh(Re.to(i.content),i.vulnerabilities)}n.to=t})(Tm||(Tm={}));var Pm;(function(n){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data,buttons:t.buttons}}n.from=e})(Pm||(Pm={}));var Nh;(function(n){function e(i){const{value:s,baseUri:r}=i;function o(a,l){return a.map(c=>{const u=x.joinPath(l,c.name);return{label:c.name,uri:u,children:c.children&&o(c.children,u)}})}return{kind:"treeData",treeData:{label:Ks(r),uri:r,children:o(s,r)}}}n.from=e;function t(i){const s=an(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 d_(a,o)}n.to=t})(Nh||(Nh={}));var lu;(function(n){function e(i){const s=o=>x.isUri(o),r=o=>"name"in o;return{kind:"inlineReference",name:i.title,inlineReference:s(i.value)?i.value:r(i.value)?Ya.from(i.value):Bs.from(i.value)}}n.from=e;function t(i){const s=an(i);return new yh(x.isUri(s.inlineReference)?s.inlineReference:"location"in s.inlineReference?Ya.to(s.inlineReference):Bs.to(s.inlineReference),i.name)}n.to=t})(lu||(lu={}));var Oh;(function(n){function e(i){return{kind:"progressMessage",content:Re.from(i.value)}}n.from=e;function t(i){return new oE(i.content.value)}n.to=t})(Oh||(Oh={}));var Fh;(function(n){function e(i){return{kind:"warning",content:Re.from(i.value)}}n.from=e;function t(i){return new xh(i.content.value)}n.to=t})(Fh||(Fh={}));var ay;(function(n){function e(t){return{kind:"extensions",extensions:t.extensions}}n.from=e})(ay||(ay={}));var ly;(function(n){function e(i){return{kind:"move",uri:i.uri,range:z.from(i.range)}}n.from=e;function t(i){return new p_(x.revive(i.uri),z.to(i.range))}n.to=t})(ly||(ly={}));var Mh;(function(n){function e(i){return{kind:"prepareToolInvocation",toolName:i.toolName}}n.from=e;function t(i){return new Sh(i.toolName)}n.to=t})(Mh||(Mh={}));var Am;(function(n){function e(t){return{kind:"progressTask",content:Re.from(t.value)}}n.from=e})(Am||(Am={}));var cy;(function(n){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Re.from(t):void 0}}n.from=e})(cy||(cy={}));var Uh;(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 h_(s.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}n.to=t})(Uh||(Uh={}));var Rm;(function(n){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(s=>pn.from(s)),done:i.isDone}}n.from=e;function t(i){const s=new Eh(x.revive(i.uri),i.edits.map(r=>pn.to(r)));return s.isDone=i.done,s}n.to=t})(Rm||(Rm={}));var Lm;(function(n){function e(t){return t.newCellMetadata?{editType:_o.Metadata,index:t.range.start,metadata:t.newCellMetadata}:t.newNotebookMetadata?{editType:_o.DocumentMetadata,metadata:t.newNotebookMetadata}:{editType:_o.Replace,index:t.range.start,count:t.range.end-t.range.start,cells:t.newCells.map(nu.from)}}n.from=e})(Lm||(Lm={}));var Nm;(function(n){function e(t){return{kind:"notebookEdit",uri:t.uri,edits:t.edits.map(Lm.from),done:t.isDone}}n.from=e})(Nm||(Nm={}));var Ta;(function(n){function e(i){const s=sn.isThemeIcon(i.iconPath)?i.iconPath:x.isUri(i.iconPath)?{light:x.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&x.isUri(i.iconPath.light)&&x.isUri(i.iconPath.dark)?{light:x.revive(i.iconPath.light),dark:x.revive(i.iconPath.dark)}:void 0;return typeof i.value=="object"&&"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:x.isUri(i.value.value)||!i.value.value?i.value.value:Bs.from(i.value.value)},iconPath:s,options:i.options}:{kind:"reference",reference:x.isUri(i.value)||typeof i.value=="string"?i.value:Bs.from(i.value),iconPath:s,options:i.options}}n.from=e;function t(i){const s=an(i),r=o=>x.isUri(o)?o:Bs.to(o);return new ka(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})(Ta||(Ta={}));var Om;(function(n){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}n.from=e})(Om||(Om={}));var Fm;(function(n){function e(s,r,o){return s instanceof u_?Lh.from(s):s instanceof yh?lu.from(s):s instanceof ka?Ta.from(s):s instanceof oE?Oh.from(s):s instanceof d_?Nh.from(s):s instanceof h_?Uh.from(s,r,o):s instanceof Eh?Rm.from(s):s instanceof am?Nm.from(s):s instanceof bh?Tm.from(s):s instanceof f_?Cm.from(s):s instanceof xh?Fh.from(s):s instanceof rm?Pm.from(s):s instanceof om?Om.from(s):s instanceof p_?ly.from(s):s instanceof aE?ay.from(s):s instanceof Sh?Mh.from(s):{kind:"markdownContent",content:Re.from("")}}n.from=e;function t(s,r){switch(s.kind){case"reference":return Ta.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 Lh.to(s);case"inlineReference":return lu.to(s);case"progressMessage":return;case"treeData":return Nh.to(s);case"command":return Uh.to(s,r)}}n.toContent=i})(Fm||(Fm={}));var Mm;(function(n){function e(t,i,s,r,o,a,l){const c=[],u=[];for(const f of t.variables.variables)f.kind==="tool"?c.push(f):f.kind==="toolset"?c.push(...f.value):u.push(f);const d={id:t.requestId,prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,isParticipantDetected:t.isParticipantDetected??!1,references:u.map(f=>$m.to(f,r,l)).filter(Ii),toolReferences:c.map($h.to),location:Um.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 dt(a,"chatParticipantPrivate")||(delete d.id,delete d.attempt,delete d.enableCommandDetection,delete d.isParticipantDetected,delete d.location,delete d.location2,delete d.editedFileEvents),dt(a,"chatParticipantAdditions")||(delete d.acceptedConfirmationData,delete d.rejectedConfirmationData,delete d.tools),d}n.to=e})(Mm||(Mm={}));var uy;(function(n){function e(t){return{prompt:t.prompt,files:t.files.map(i=>x.revive(i))}}n.to=e})(uy||(uy={}));var Um;(function(n){function e(i){switch(i){case zn.Notebook:return Yi.Notebook;case zn.Terminal:return Yi.Terminal;case zn.Panel:return Yi.Panel;case zn.Editor:return Yi.Editor}}n.to=e;function t(i){switch(i){case Yi.Notebook:return zn.Notebook;case Yi.Terminal:return zn.Terminal;case Yi.Panel:return zn.Panel;case Yi.Editor:return zn.Editor}}n.from=t})(Um||(Um={}));var $m;(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(Cp(r))r=x.revive(r);else if(r&&typeof r=="object"&&"uri"in r&&"range"in r&&Cp(r.uri))r=Bs.to(an(r));else if(y6(t)){const o=t.references?.[0]?.reference;r=new uP(t.mimeType??"image/png",()=>Promise.resolve(new Uint8Array(Object.values(t.value))),o&&x.isUri(o)?o:void 0)}else if(t.kind==="diagnostic"){const o=t.filterSeverity&&Ih.to(t.filterSeverity),a=t.filterUri&&x.revive(t.filterUri).toString();r=new dP(i.map(([l,c])=>t.filterUri&&l.toString()!==a?[l,[]]:[l,c.filter(u=>!(o&&u.severity>o||t.filterRange&&!et.areIntersectingOrTouching(t.filterRange,z.from(u.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})($m||($m={}));var $h;(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})($h||($h={}));var dy;(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})(dy||(dy={}));var mc;(function(n){function e(s){return{errorDetails:s.errorDetails,metadata:i(s.metadata),nextQuestion:s.nextQuestion}}n.to=e;function t(s){return{errorDetails:s.errorDetails,metadata:s.metadata,nextQuestion:s.nextQuestion}}n.from=t;function i(s){return Nc(s,r=>{if(r.$mid===st.LanguageModelToolResult)return new g_(Nc(r.content,i));if(r.$mid===st.LanguageModelTextPart)return new zt(r.value);if(r.$mid===st.LanguageModelPromptTsxPart)return new Gs(r.value)})}})(mc||(mc={}));var hy;(function(n){function e(t,i,s){if(i.action.kind==="vote")return;const r=mc.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:Im.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",ha.Accepted],["rejected",ha.Rejected],["saved",ha.Saved]]).get(i.action.outcome)??ha.Rejected,uri:x.revive(i.action.uri),hasRemainingEdits:i.action.hasRemainingEdits},result:r}:{action:i.action,result:r}}n.to=e})(hy||(hy={}));var Hm;(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})(Hm||(Hm={}));var Bm;(function(n){function e(t){return{...t,documentation:Re.fromStrict(t.documentation)}}n.from=e})(Bm||(Bm={}));var fy;(function(n){function e(t){return Array.isArray(t)?{items:t.map(i=>Bm.from(i))}:{items:t.items.map(i=>Bm.from(i)),resourceRequestConfig:t.resourceRequestConfig?py.from(t.resourceRequestConfig):void 0}}n.from=e})(fy||(fy={}));var py;(function(n){function e(t){return{...t,pathSeparator:Qn?"\\":"/",cwd:t.cwd?x.revive(t.cwd):void 0}}n.from=e})(py||(py={}));var gy;(function(n){function e(t){return{kind:my.to(t.kind),acceptedLength:t.acceptedLength}}n.to=e})(gy||(gy={}));var my;(function(n){function e(t){switch(t){case Zu.Word:return aa.Word;case Zu.Line:return aa.Line;case Zu.Suggest:return aa.Suggest;default:return aa.Unknown}}n.to=e})(my||(my={}));var _y;(function(n){function e(t,i){if(t.kind===qp.Ignored){const s=t.supersededBy?i(t.supersededBy):void 0;return{kind:oc.Ignored,supersededBy:s,userTypingDisagreed:t.userTypingDisagreed}}else if(t.kind===qp.Accepted)return{kind:oc.Accepted};return{kind:oc.Rejected}}n.to=e})(_y||(_y={}));var vy;(function(n){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||Iw.None,contextValue:t.contextValue}}n.from=e})(vy||(vy={}));var yD;(function(n){function e(t){return{name:t.id,description:t.modelDescription,inputSchema:t.inputSchema,tags:t.tags??[]}}n.to=e})(yD||(yD={}));var xD;(function(n){function e(i){return new g_(i.content.map(s=>s.kind==="text"?new zt(s.value):new Gs(s.value)))}n.to=e;function t(i,s){return i.toolResultMessage&&$(s,"chatParticipantPrivate"),{content:i.content.map(r=>{if(r instanceof zt)return{kind:"text",value:r.value};if(r instanceof Gs)return{kind:"promptTsx",value:r.value};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Re.fromStrict(i.toolResultMessage),toolResultDetails:i.toolResultDetails?.map(r=>x.isUri(r)?r:Bs.from(r))}}n.from=t})(xD||(xD={}));var Wm;(function(n){function e(i){return new pP(i.content.map(s=>{if(s.kind==="text")return new zt(s.value);if(s.kind==="data"){const r=Object.values(br).includes(s.value.mimeType)?s.value.mimeType:void 0;if(!r)throw new Error("Invalid MIME type");return new Ci(s.value.data.buffer,r)}else return new Gs(s.value)}))}n.to=e;function t(i,s){i.toolResultMessage&&$(s,"chatParticipantPrivate");let r=!1;const o={content:i.content.map(a=>{if(a instanceof zt)return{kind:"text",value:a.value};if(a instanceof Gs)return{kind:"promptTsx",value:a.value};if(a instanceof Ci)return r=!0,{kind:"data",value:{mimeType:a.mimeType,data:ue.wrap(a.data)}};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Re.fromStrict(i.toolResultMessage),toolResultDetails:i.toolResultDetails?.map(a=>x.isUri(a)?a:Bs.from(a))};return r?new jn(o):o}n.from=t})(Wm||(Wm={}));var wy;(function(n){function e(t){return t}n.fromThemeIcon=e})(wy||(wy={}));var by;(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 Jr.EMBEDDED:return Jr.EMBEDDED;case Jr.LLM_RANKED:return Jr.LLM_RANKED;case Jr.CANCELED:return Jr.CANCELED;default:throw new Error("Unknown AiSettingsSearchResultKind")}}})(by||(by={}));var fd;(function(n){function e(i){return!!i.uri}function t(i){return Dh.toSerialized(e(i)?{type:Xa.HTTP,uri:i.uri,headers:Object.entries(i.headers)}:{type:Xa.Stdio,cwd:i.cwd?.fsPath,args:i.args,command:i.command,env:i.env,envFile:void 0})}n.from=t})(fd||(fd={}));class fo{constructor(e,t,i){this.uri=e,this.ranges=t,this.previewText=i}}class lE{constructor(e,t,i){this.uri=e,this.text=t,this.lineNumber=i}}class yy{constructor(e){this.keyword=e}}var _r;(function(n){n[n.None=1]="None",n[n.FilesExclude=2]="FilesExclude",n[n.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(_r||(_r={}));var Vm;(function(n){n[n.Information=1]="Information",n[n.Warning=2]="Warning"})(Vm||(Vm={}));const vP=2e4,wP="⟪ ",bP=" characters skipped ⟫",G3=(wP.length+bP.length+5)*2;var ED;(function(n){n[n.file=0]="file",n[n.text=1]="text",n[n.aiText=2]="aiText"})(ED||(ED={}));var Pa;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.aiText=3]="aiText"})(Pa||(Pa={}));function SD(n){return!!n.rangeLocations&&!!n.previewText}var kD;(function(n){n[n.Normal=0]="Normal",n[n.NewSearchStarted=1]="NewSearchStarted"})(kD||(kD={}));class K3{constructor(e,t,i,s){this.rangeLocations=[],this.webviewIndex=s;const r=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&Q3(r)){e=fR(e,i.matchLines);let o="",a=0,l=0;const c=Math.floor(i.charsPerLine/5);for(const u of r){const d=Math.max(u.startColumn-c,0),f=u.startColumn+i.charsPerLine;if(d>l+c+G3){const p=wP+(d-l)+bP;o+=p+e.slice(d,f),a+=d-(l+p.length)}else o+=e.slice(l,f);l=f,this.rangeLocations.push({source:u,preview:new J3(0,u.startColumn-a,u.endColumn-a)})}this.previewText=o}else{const o=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber,a=Rv(t,l=>({preview:new yP(l.startLineNumber-o,l.startColumn,l.endLineNumber-o,l.endColumn),source:l}));this.rangeLocations=Array.isArray(a)?a:[a],this.previewText=e}}}function Q3(n){const e=n[0].startLineNumber;for(const t of n)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class yP{constructor(e,t,i,s){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s}}class J3 extends yP{constructor(e,t,i){super(e,t,e,i)}}var DD;(function(n){n.List="list",n.Tree="tree"})(DD||(DD={}));var ID;(function(n){n.Default="default",n.FileNames="fileNames",n.Type="type",n.Modified="modified",n.CountDescending="countDescending",n.CountAscending="countAscending"})(ID||(ID={}));var CD;(function(n){n.Auto="auto",n.Manual="manual",n.RunOnEmpty="runOnEmpty"})(CD||(CD={}));function X3(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=qa(s,wt(t)),s=qa(s,wt(i),!0),s}function TD(n,e){return n.excludePattern&&sd(n.excludePattern,e)?!1:n.includePattern||n.usingSearchPaths?n.includePattern&&sd(n.includePattern,e)?!0:n.usingSearchPaths?!!n.folderQueries&&n.folderQueries.some(t=>{const i=t.folder.fsPath;if(Rp(e,i)){const s=Nd(i,e);return!t.includePattern||!!sd(t.includePattern,s)}else return!1}):!1:!0}var PD;(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"})(PD||(PD={}));function _c(n,e){const t={...n||{},...e||{}};return Object.keys(t).filter(i=>{const s=t[i];return typeof s=="boolean"&&s})}class xP{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=>Uc(s));let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=Uc(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 xo(o)?o.then(a=>a?!1:s()):s()})).then(r=>r.some(o=>!!o))}hasSiblingExcludeClauses(){return this._excludeExpression.reduce((e,t)=>Y3(t)||e,!1)}}function Y3(n){for(const e in n)if(typeof n[e]!="boolean")return!0;return!1}function Z3(n){if(!n)return;let e;return t=>(e||(e=(n()||Promise.resolve([])).then(i=>i?EP(i):{})),e.then(i=>!!i[t]))}function eN(n){if(!n)return;let e;return t=>{if(!e){const i=n();e=i?EP(i):{}}return!!e[t]}}function EP(n){const e={};for(const t of n)e[t]=!0;return e}function SP(n){return n.flatMap(e=>e.patterns.map(t=>e.baseUri?{baseUri:e.baseUri,pattern:t}:t))}const xy={matchLines:100,charsPerLine:1e4},__="utf8",cE="utf8bom",zm="utf16be",qm="utf16le",lp=[254,255],Ey=[255,254],Hu=[239,187,191],tN=512,nN=512,iN=512*8,sN=512*128;var Sy;(function(n){n[n.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(Sy||(Sy={}));class rN extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class uE{static async create(e){let t;if(e!==__)t=(await import("./iconv-lite-umd-DYWd8cEa.js").then(function(s){return s.i}).then(s=>s.default??s)).getDecoder(kP(e));else{const i=new TextDecoder;t={write(s){return i.decode(s,{stream:!0})},end(){return i.decode()}}}return new uE(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function oN(n,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?iN:nN;return new Promise((i,s)=>{const r=J4(d=>d.join("")),o=[];let a=0,l;const c=new Nt,u=async()=>{try{const d=await gN({buffer:ue.concat(o),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(d.seemsBinary&&e.acceptTextOnly)throw new rN("Stream is binary but only text is accepted for decoding",Sy.STREAM_IS_BINARY);d.encoding=await e.overwriteEncoding(d.encoding),l=await uE.create(d.encoding);const f=l.write(ue.concat(o).buffer);r.write(f),o.length=0,a=0,i({stream:r,detected:d})}catch(d){c.cancel(),r.destroy(),s(d)}};Y4(n,{onData:async d=>{l?r.write(l.write(d.buffer)):(o.push(d),a+=d.byteLength,a>=t&&(n.pause(),await u(),setTimeout(()=>n.resume())))},onError:d=>r.error(d),onEnd:async()=>{l||await u(),r.end(l?.end())}},c.token)})}async function aN(n,e,t){const s=(await import("./iconv-lite-umd-DYWd8cEa.js").then(function(a){return a.i}).then(a=>a.default??a)).getEncoder(kP(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 __:case cE:return ue.wrap(Uint8Array.from(Hu));case zm:return ue.wrap(Uint8Array.from(lp));case qm:return ue.wrap(Uint8Array.from(Ey))}const l=s.end();return l&&l.length>0?(r=!0,ue.wrap(l)):null}return r=!0,ue.wrap(s.write(a))}}}function kP(n){return n===cE||n===null?__:n}function lN(n,e){if(!n||e<lp.length)return null;const t=n.readUInt8(0),i=n.readUInt8(1);if(t===lp[0]&&i===lp[1])return zm;if(t===Ey[0]&&i===Ey[1])return qm;if(e<Hu.length)return null;const s=n.readUInt8(2);return t===Hu[0]&&i===Hu[1]&&s===Hu[2]?cE:null}const cN=["ascii","utf-16","utf-32"];async function uN(n,e){const t=await import("./index-B132pG6E.js").then(function(a){return a.i}).then(a=>a.default??a),i=n.slice(0,sN),s=pN(i.buffer);e&&(e=rn(e.map(a=>fN(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<=cN.indexOf(o)?null:hN(r.encoding)}const dN={ibm866:"cp866",big5:"cp950"};function DP(n){return n.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function hN(n){const e=DP(n);return dN[e]||e}function fN(n){const e=DP(n),t=mN[e];return t?t.guessableName:void 0}function pN(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}function gN({buffer:n,bytesRead:e},t,i){let s=lN(n,e),r=!1;if(s!==zm&&s!==qm&&n){let o=!0,a=!0,l=!1;for(let c=0;c<e&&c<tN;c++){const u=c%2===1,d=n.readUInt8(c)===0;if(d&&(l=!0),o&&(u&&!d||!u&&d)&&(o=!1),a&&(u&&d||!u&&!d)&&(a=!1),d&&!o&&!a)break}l&&(o?s=qm:a?s=zm:r=!0)}return t&&!r&&!s&&n?uN(n.slice(0,e),i).then(o=>({seemsBinary:!1,encoding:o})):{seemsBinary:r,encoding:s}}const ov={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}},mN=(()=>{const n={};for(const e in ov)ov[e].guessableName&&(n[e]=ov[e]);return n})();var AD;(function(n){n[n.FILE_IS_BINARY=0]="FILE_IS_BINARY"})(AD||(AD={}));var RD;(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"})(RD||(RD={}));var LD;(function(n){n[n.EDITOR=1]="EDITOR",n[n.REFERENCE=2]="REFERENCE",n[n.OTHER=3]="OTHER"})(LD||(LD={}));var ND;(function(n){n[n.Encode=0]="Encode",n[n.Decode=1]="Decode"})(ND||(ND={}));function _N(n){let e=!1;return{read(){return e?null:(e=!0,n)}}}function Hh(n,e,t){return new Xh(i=>dE(i,t)).isEqual(n,e)}function vN(n,e,t){return Hh(n.uri,e.uri,t)?0:Va(n.uri.toString(),e.uri.toString())}function wN(n,e,t){return n.index!==e.index?n.index<e.index?-1:1:Hh(n.uri,e.uri,t)?Va(n.name,e.name):Va(n.uri.toString(),e.uri.toString())}function IP(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 I5(s,r,(o,a)=>t(o,a,i))}function dE(n,e){const t=e.getCapabilities(n.scheme);return!(t&&t&ks.PathCaseSensitive)}class vc extends h8{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:u}=e,d=[],f=t;t?a.forEach((v,E)=>{const S=x.revive(v.uri),A=vc._findFolder(i||t,S,s);A?(A.name=v.name,A.index=v.index,d.push(A)):d.push({uri:S,name:v.name,index:E})}):d.push(...a.map(({uri:v,name:E,index:S})=>({uri:x.revive(v),name:E,index:S}))),d.sort((v,E)=>v.index<E.index?-1:1);const p=new vc(r,o,d,!!c,l?x.revive(l):null,!!u,v=>dE(v,s)),{added:_,removed:w}=IP(f?f.workspaceFolders:[],p.workspaceFolders,vN,s);return{workspace:p,added:_,removed:w}}static _findFolder(e,t,i){for(let s=0;s<e.folders.length;s++){const r=e.workspaceFolders[s];if(Hh(r.uri,t,i))return r}}constructor(e,t,i,s,r,o,a){super(e,i.map(l=>new MC(l)),s,r,a),this._name=t,this._isUntitled=o,this._workspaceFolders=[],this._structure=Rs.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=K1(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let ky=class{constructor(e,t,i,s,r){this._onDidChangeWorkspace=new N,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new N,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new qu,this._canonicalUriProviders=new Map,this._logService=s,this._extHostFileSystemInfo=i,this._uriTransformerService=r,this._requestIdProvider=new a8,this._barrier=new As,this._proxy=e.getProxy(ee.MainThreadWorkspace),this._messageService=e.getProxy(ee.MainThreadMessageService);const o=t.workspace;this._confirmedWorkspace=o?new vc(o.id,o.name,[],!!o.transient,o.configuration?x.revive(o.configuration):null,!!o.isUntitled,a=>dE(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?x.from({scheme:le.untitled,path:Ks(K1(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(u=>{x.isUri(u.uri)&&!r.some(d=>Hh(d.uri,u.uri,this._extHostFileSystemInfo))&&r.push({uri:u.uri,name:u.name||jv(u.uri)})}),this._unconfirmedWorkspace||[t,i].some(u=>typeof u!="number"||u<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(u=>({uri:u.uri,name:u.name||jv(u.uri),index:void 0})));for(let u=0;u<a.length;u++){const d=a[u];if(a.some((f,p)=>p!==u&&Hh(d.uri,f.uri,this._extHostFileSystemInfo)))return!1}a.forEach((u,d)=>u.index=d);const{added:l,removed:c}=IP(o,a,wN,this._extHostFileSystemInfo);if(l.length===0&&c.length===0)return!1;if(this._proxy){const u=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(u,t,i,r).then(void 0,d=>{this._unconfirmedWorkspace=void 0;const f={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(Qt.Error,h(2597,"Extension '{0}' failed to update workspace folders: {1}",u,d.toString()),f,[])})}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=x.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=kC(r.uri,i);return t&&r.name&&(o=`${r.name}/${o}`),o}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=vc.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}=vc.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=yt.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?_r.FilesExclude:_r.None,useIgnoreFiles:{local:!1}},r)}findFiles2(e,t={},i,s=yt.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=OD(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===_r.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==_r.SearchAndFilesExclude,maxResults:t.maxResults,excludePattern:a.length>0?a:void 0,_reason:"startFileSearch",shouldGlobSearch:e.type==="include"?void 0:!0},c=cp(pi.from(o)),u=c?.folder;return e.type==="include"?l.includePattern=c?.pattern:l.filePattern=c?.pattern,{folder:u,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=>x.revive(o)):[]))??[])).flat()}findTextInFiles2(e,t,i,s=yt.None){this._logService.trace(`extHostWorkspace#findTextInFiles2: textSearch, extension: ${i.value}, entryPoint: findTextInFiles2`);const r=f=>{if(!t)return{folder:void 0,options:{}};const p=f?cp(pi.from(f)):void 0,_=t.exclude?OD(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===_r.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==_r.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:p?.pattern,excludePattern:_},folder:p?.folder}},a=(t?.include?.map(f=>r(f))??[r(void 0)]).filter(f=>!!f),l=new xe,c=l.add(new N),u=this.findTextInFilesBase(e,a,(f,p)=>c.fire({result:f,uri:p}),s);return{results:new za(async f=>{l.add(c.event(p=>{const _=p.result,w=p.uri;SD(_)?f.emitOne(new fo(w,_.rangeLocations.map(v=>({previewRange:new Me(v.preview.startLineNumber,v.preview.startColumn,v.preview.endLineNumber,v.preview.endColumn),sourceRange:new Me(v.source.startLineNumber,v.source.startColumn,v.source.endLineNumber,v.source.endColumn)})),_.previewText)):f.emitOne(new lE(w,_.text,_.lineNumber))})),await u}),complete:u.then(f=>(l.dispose(),{limitHit:f?.limitHit??!1}))}}async findTextInFilesBase(e,t,i,s=yt.None){const r=this._requestIdProvider.getNext();let o=!1;if(s.onCancellationRequested(a=>{o=!0}),this._activeSearchCallbacks[r]=a=>{if(o)return;const l=x.revive(a.resource);a.results.forEach(c=>{const u=an(c);i(u,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=yt.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=cp(pi.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},u=(d,f)=>{SD(d)?i({uri:f,preview:{text:d.previewText,matches:Rv(d.rangeLocations,p=>new Me(p.preview.startLineNumber,p.preview.startColumn,p.preview.endLineNumber,p.preview.endColumn))},ranges:Rv(d.rangeLocations,p=>new Me(p.source.startLineNumber,p.source.startColumn,p.source.endLineNumber,p.source.endColumn))}):i({uri:f,text:d.text,lineNumber:d.lineNumber})};return this.findTextInFilesBase(e,[{options:c,folder:a?.folder}],u,r)}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return x.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return x.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),we(()=>{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(x.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(x.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(x.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),we(()=>{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?.(x.revive(e),t,i);if(r)return r}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(x.revive(e),{targetScheme:t},i)}async decode(e,t){const[i,s]=this.toEncodeDecodeParameters(t),r=await this._proxy.$resolveDecoding(i,s),o=(await oN(tA(ue.wrap(e)),{...r,acceptTextOnly:!0,overwriteEncoding:a=>a===null||a===r.preferredEncoding?Promise.resolve(r.preferredEncoding):this._proxy.$validateDetectedEncoding(i,a,s)})).stream;return X4(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===__&&!o)return ue.fromString(e).buffer;const a=await aN(_N(e),r,{addBOM:o});return Z5(a).buffer}toEncodeDecodeParameters(e){const t=Cp(e?.uri)?e.uri:void 0,i=typeof e?.encoding=="string"?e.encoding:void 0;return[t,i?{encoding:i}:void 0]}};ky=V([L(0,nt),L(1,gn),L(2,hu),L(3,at),L(4,Q1)],ky);const Mr=pe("IExtHostWorkspace");function cp(n){let e,t;if(n)return typeof n=="string"?e=n:(e=n.pattern,t=x.revive(n.baseUri)),{pattern:e,folder:t}}function OD(n){return(n?.map(e=>{if(typeof e=="string")return e===""?void 0:{pattern:e,uri:void 0};{const t=cp(e);return t?{pattern:t.pattern,uri:t.folder}:void 0}})??[]).filter(e=>!!e)}var vn;(function(n){n[n.None=0]="None",n[n.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=2]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",n[n.InvalidUnicode=4]="InvalidUnicode",n[n.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",n[n.InvalidCharacter=6]="InvalidCharacter"})(vn||(vn={}));var ye;(function(n){n[n.OpenBraceToken=1]="OpenBraceToken",n[n.CloseBraceToken=2]="CloseBraceToken",n[n.OpenBracketToken=3]="OpenBracketToken",n[n.CloseBracketToken=4]="CloseBracketToken",n[n.CommaToken=5]="CommaToken",n[n.ColonToken=6]="ColonToken",n[n.NullKeyword=7]="NullKeyword",n[n.TrueKeyword=8]="TrueKeyword",n[n.FalseKeyword=9]="FalseKeyword",n[n.StringLiteral=10]="StringLiteral",n[n.NumericLiteral=11]="NumericLiteral",n[n.LineCommentTrivia=12]="LineCommentTrivia",n[n.BlockCommentTrivia=13]="BlockCommentTrivia",n[n.LineBreakTrivia=14]="LineBreakTrivia",n[n.Trivia=15]="Trivia",n[n.Unknown=16]="Unknown",n[n.EOF=17]="EOF"})(ye||(ye={}));var Rt;(function(n){n[n.InvalidSymbol=1]="InvalidSymbol",n[n.InvalidNumberFormat=2]="InvalidNumberFormat",n[n.PropertyNameExpected=3]="PropertyNameExpected",n[n.ValueExpected=4]="ValueExpected",n[n.ColonExpected=5]="ColonExpected",n[n.CommaExpected=6]="CommaExpected",n[n.CloseBraceExpected=7]="CloseBraceExpected",n[n.CloseBracketExpected=8]="CloseBracketExpected",n[n.EndOfFileExpected=9]="EndOfFileExpected",n[n.InvalidCommentToken=10]="InvalidCommentToken",n[n.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=12]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",n[n.InvalidUnicode=14]="InvalidUnicode",n[n.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",n[n.InvalidCharacter=16]="InvalidCharacter"})(Rt||(Rt={}));var Dy;(function(n){n.DEFAULT={allowTrailingComma:!0}})(Dy||(Dy={}));function bN(n,e=!1){let t=0;const i=n.length;let s="",r=0,o=ye.Unknown,a=vn.None;function l(w){let v=0,E=0;for(;v<w;){const S=n.charCodeAt(t);if(S>=ae._0&&S<=ae._9)E=E*16+S-ae._0;else if(S>=ae.A&&S<=ae.F)E=E*16+S-ae.A+10;else if(S>=ae.a&&S<=ae.f)E=E*16+S-ae.a+10;else break;t++,v++}return v<w&&(E=-1),E}function c(w){t=w,s="",r=0,o=ye.Unknown,a=vn.None}function u(){const w=t;if(n.charCodeAt(t)===ae._0)t++;else for(t++;t<n.length&&xl(n.charCodeAt(t));)t++;if(t<n.length&&n.charCodeAt(t)===ae.dot)if(t++,t<n.length&&xl(n.charCodeAt(t)))for(t++;t<n.length&&xl(n.charCodeAt(t));)t++;else return a=vn.UnexpectedEndOfNumber,n.substring(w,t);let v=t;if(t<n.length&&(n.charCodeAt(t)===ae.E||n.charCodeAt(t)===ae.e))if(t++,(t<n.length&&n.charCodeAt(t)===ae.plus||n.charCodeAt(t)===ae.minus)&&t++,t<n.length&&xl(n.charCodeAt(t))){for(t++;t<n.length&&xl(n.charCodeAt(t));)t++;v=t}else a=vn.UnexpectedEndOfNumber;return n.substring(w,v)}function d(){let w="",v=t;for(;;){if(t>=i){w+=n.substring(v,t),a=vn.UnexpectedEndOfString;break}const E=n.charCodeAt(t);if(E===ae.doubleQuote){w+=n.substring(v,t),t++;break}if(E===ae.backslash){if(w+=n.substring(v,t),t++,t>=i){a=vn.UnexpectedEndOfString;break}switch(n.charCodeAt(t++)){case ae.doubleQuote:w+='"';break;case ae.backslash:w+="\\";break;case ae.slash:w+="/";break;case ae.b:w+="\b";break;case ae.f:w+="\f";break;case ae.n:w+=`
|
|
100
|
+
`+f+"\n```\n"}}else mi.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 u=({href:d})=>{try{let f=x.parse(d,!0);f=f.with({query:s(f.query,c)}),c[d]=f}catch{}return""};return xt.walkTokens(xt.lexer(l.value),d=>{d.type==="link"?u({href:d.href}):d.type==="image"&&typeof d.href=="string"&&u(P8(d.href))}),l}n.from=i;function s(a,l){if(!a)return a;let c;try{c=nT(a)}catch{}if(!c)return a;let u=!1;return c=Nc(c,d=>{if(x.isUri(d)){const f=`__uri_${Math.random().toString(16).slice(2,8)}`;return l[f]=d,u=!0,f}else return}),u?JSON.stringify(c):a}function r(a){const l=new mi(a.value,a.supportThemeIcons);return l.isTrusted=a.isTrusted,l.supportHtml=a.supportHtml,l.baseUri=a.baseUri?x.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})(Re||(Re={}));function q3(n){return _P(n)?n.map(e=>({range:z.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Re.fromMany(e.hoverMessage):e.hoverMessage?Re.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):n.map(e=>({range:z.from(e)}))}function m_(n){return typeof n>"u"?n:typeof n=="string"?x.file(n):n}var Xc;(function(n){function e(t){return typeof t>"u"?t:{contentText:t.contentText,contentIconPath:t.contentIconPath?m_(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})(Xc||(Xc={}));var dm;(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?m_(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?Xc.from(t.before):void 0,after:t.after?Xc.from(t.after):void 0}}n.from=e})(dm||(dm={}));var Bb;(function(n){function e(t){if(typeof t>"u")return t;switch(t){case la.OpenOpen:return Nl.AlwaysGrowsWhenTypingAtEdges;case la.ClosedClosed:return Nl.NeverGrowsWhenTypingAtEdges;case la.OpenClosed:return Nl.GrowsOnlyWhenTypingBefore;case la.ClosedOpen:return Nl.GrowsOnlyWhenTypingAfter}}n.from=e})(Bb||(Bb={}));var Wb;(function(n){function e(t){return{isWholeLine:t.isWholeLine,rangeBehavior:t.rangeBehavior?Bb.from(t.rangeBehavior):void 0,overviewRulerLane:t.overviewRulerLane,light:t.light?dm.from(t.light):void 0,dark:t.dark?dm.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?m_(t.gutterIconPath):void 0,gutterIconSize:t.gutterIconSize,overviewRulerColor:t.overviewRulerColor,before:t.before?Xc.from(t.before):void 0,after:t.after?Xc.from(t.after):void 0}}n.from=e})(Wb||(Wb={}));var pn;(function(n){function e(i){return{text:i.newText,eol:i.newEol&&eu.from(i.newEol),range:z.from(i.range)}}n.from=e;function t(i){const s=new ko(z.to(i.range),i.text);return s.newEol=typeof i.eol>"u"?void 0:eu.to(i.eol),s}n.to=t})(pn||(pn={}));var _i;(function(n){function e(i,s){const r={edits:[]};if(i instanceof Ga){const o=new V4;for(const a of i._allEntries())a._type===Wt.File&&x.isUri(a.to)&&a.from===void 0&&o.add(a.to);for(const a of i._allEntries())if(a._type===Wt.File){let l;a.options?.contents&&(ArrayBuffer.isView(a.options.contents)?l={type:"base64",value:j1(ue.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===Wt.Text?r.edits.push({resource:a.uri,textEdit:pn.from(a.edit),versionId:o.has(a.uri)?void 0:s?.getTextDocumentVersion(a.uri),metadata:a.metadata}):a._type===Wt.Snippet?r.edits.push({resource:a.uri,textEdit:{range:z.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===Wt.Cell?r.edits.push({metadata:a.metadata,resource:a.uri,cellEdit:a.edit,notebookVersionId:s?.getNotebookDocumentVersion(a.uri)}):a._type===Wt.CellReplace&&r.edits.push({metadata:a.metadata,resource:a.uri,notebookVersionId:s?.getNotebookDocumentVersion(a.uri),cellEdit:{editType:_o.Replace,index:a.index,count:a.count,cells:a.cells.map(nu.from)}})}return r}n.from=e;function t(i){const s=new Ga,r=new on;for(const o of i.edits)if(o.textEdit){const a=o,l=x.revive(a.resource),c=z.to(a.textEdit.range),u=a.textEdit.text,d=a.textEdit.insertAsSnippet;let f;d?f=xa.replace(c,new Ka(u)):f=ko.replace(c,u);const p=r.get(l);p?p.push(f):r.set(l,[f])}else s.renameFile(x.revive(o.oldResource),x.revive(o.newResource),o.options);for(const[o,a]of r)s.set(o,a);return s}n.to=t})(_i||(_i={}));var Hi;(function(n){const e=Object.create(null);e[_t.File]=K.File,e[_t.Module]=K.Module,e[_t.Namespace]=K.Namespace,e[_t.Package]=K.Package,e[_t.Class]=K.Class,e[_t.Method]=K.Method,e[_t.Property]=K.Property,e[_t.Field]=K.Field,e[_t.Constructor]=K.Constructor,e[_t.Enum]=K.Enum,e[_t.Interface]=K.Interface,e[_t.Function]=K.Function,e[_t.Variable]=K.Variable,e[_t.Constant]=K.Constant,e[_t.String]=K.String,e[_t.Number]=K.Number,e[_t.Boolean]=K.Boolean,e[_t.Array]=K.Array,e[_t.Object]=K.Object,e[_t.Key]=K.Key,e[_t.Null]=K.Null,e[_t.EnumMember]=K.EnumMember,e[_t.Struct]=K.Struct,e[_t.Event]=K.Event,e[_t.Operator]=K.Operator,e[_t.TypeParameter]=K.TypeParameter;function t(s){return typeof e[s]=="number"?e[s]:K.Property}n.from=t;function i(s){for(const r in e)if(e[r]===s)return Number(r);return _t.Property}n.to=i})(Hi||(Hi={}));var Or;(function(n){function e(i){if(i===Qd.Deprecated)return Gp.Deprecated}n.from=e;function t(i){if(i===Gp.Deprecated)return Qd.Deprecated}n.to=t})(Or||(Or={}));var Ya;(function(n){function e(i){return{name:i.name,kind:Hi.from(i.kind),tags:i.tags&&i.tags.map(Or.from),containerName:i.containerName,location:oi.from(i.location)}}n.from=e;function t(i){const s=new Jd(i.name,Hi.to(i.kind),i.containerName,oi.to(i.location));return s.tags=i.tags&&i.tags.map(Or.to),s}n.to=t})(Ya||(Ya={}));var Vb;(function(n){function e(i){const s={name:i.name||"!!MISSING: name!!",detail:i.detail,range:z.from(i.range),selectionRange:z.from(i.selectionRange),kind:Hi.from(i.kind),tags:i.tags?.map(Or.from)??[]};return i.children&&(s.children=i.children.map(e)),s}n.from=e;function t(i){const s=new Xd(i.name,i.detail,Hi.to(i.kind),z.to(i.range),z.to(i.selectionRange));return Kh(i.tags)&&(s.tags=i.tags.map(Or.to)),i.children&&(s.children=i.children.map(t)),s}n.to=t})(Vb||(Vb={}));var Za;(function(n){function e(i){const s=new Yx(Hi.to(i.kind),i.name,i.detail||"",x.revive(i.uri),z.to(i.range),z.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:Hi.from(i.kind),uri:i.uri,range:z.from(i.range),selectionRange:z.from(i.selectionRange),tags:i.tags?.map(Or.from)}}n.from=t})(Za||(Za={}));var zb;(function(n){function e(t){return new BT(Za.to(t.from),t.fromRanges.map(i=>z.to(i)))}n.to=e})(zb||(zb={}));var qb;(function(n){function e(t){return new WT(Za.to(t.to),t.fromRanges.map(i=>z.to(i)))}n.to=e})(qb||(qb={}));var oi;(function(n){function e(i){return{range:i.range&&z.from(i.range),uri:i.uri}}n.from=e;function t(i){return new Ni(x.revive(i.uri),z.to(i.range))}n.to=t})(oi||(oi={}));var Ch;(function(n){function e(i){const s=i,r=i;return{originSelectionRange:s.originSelectionRange?z.from(s.originSelectionRange):void 0,uri:s.targetUri?s.targetUri:r.uri,range:z.from(s.targetRange?s.targetRange:r.range),targetSelectionRange:s.targetSelectionRange?z.from(s.targetSelectionRange):void 0}}n.from=e;function t(i){return{targetUri:x.revive(i.uri),targetRange:z.to(i.range),targetSelectionRange:i.targetSelectionRange?z.to(i.targetSelectionRange):void 0,originSelectionRange:i.originSelectionRange?z.to(i.originSelectionRange):void 0}}n.to=t})(Ch||(Ch={}));var Th;(function(n){function e(i){return{range:z.from(i.range),contents:Re.fromMany(i.contents),canIncreaseVerbosity:i.canIncreaseVerbosity,canDecreaseVerbosity:i.canDecreaseVerbosity}}n.from=e;function t(i){const s=i.contents.map(Re.to),r=z.to(i.range),o=i.canIncreaseVerbosity,a=i.canDecreaseVerbosity;return new Ig(s,r,o,a)}n.to=t})(Th||(Th={}));var jb;(function(n){function e(i){return{range:z.from(i.range),expression:i.expression}}n.from=e;function t(i){return new qg(z.to(i.range),i.expression)}n.to=t})(jb||(jb={}));var hm;(function(n){function e(i){if(i instanceof jg)return{type:"text",range:z.from(i.range),text:i.text};if(i instanceof Gg)return{type:"variable",range:z.from(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};if(i instanceof Kg)return{type:"expression",range:z.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:z.to(i.range),text:i.text};case"variable":return{range:z.to(i.range),variableName:i.variableName,caseSensitiveLookup:i.caseSensitiveLookup};case"expression":return{range:z.to(i.range),expression:i.expression}}}n.to=t})(hm||(hm={}));var fm;(function(n){function e(i){return{frameId:i.frameId,stoppedLocation:z.from(i.stoppedLocation)}}n.from=e;function t(i){return new sb(i.frameId,z.to(i.stoppedLocation))}n.to=t})(fm||(fm={}));var Yc;(function(n){function e(i){return{range:z.from(i.range),kind:i.kind}}n.from=e;function t(i){return new Cg(z.to(i.range),i.kind)}n.to=t})(Yc||(Yc={}));var Gb;(function(n){function e(i){return{uri:i.uri,highlights:i.highlights.map(Yc.from)}}n.from=e;function t(i){return new Tg(x.revive(i.uri),i.highlights.map(Yc.to))}n.to=t})(Gb||(Gb={}));var Kb;(function(n){function e(t){switch(t){case ed.TriggerCharacter:return rc.TriggerCharacter;case ed.TriggerForIncompleteCompletions:return rc.TriggerForIncompleteCompletions;case ed.Invoke:default:return rc.Invoke}}n.to=e})(Kb||(Kb={}));var Qb;(function(n){function e(t){return{triggerKind:Kb.to(t.triggerKind),triggerCharacter:t.triggerCharacter}}n.to=e})(Qb||(Qb={}));var pm;(function(n){function e(i){if(i===th.Deprecated)return Vp.Deprecated}n.from=e;function t(i){if(i===Vp.Deprecated)return th.Deprecated}n.to=t})(pm||(pm={}));var gm;(function(n){const e=new Map([[Ie.Method,F.Method],[Ie.Function,F.Function],[Ie.Constructor,F.Constructor],[Ie.Field,F.Field],[Ie.Variable,F.Variable],[Ie.Class,F.Class],[Ie.Interface,F.Interface],[Ie.Struct,F.Struct],[Ie.Module,F.Module],[Ie.Property,F.Property],[Ie.Unit,F.Unit],[Ie.Value,F.Value],[Ie.Constant,F.Constant],[Ie.Enum,F.Enum],[Ie.EnumMember,F.EnumMember],[Ie.Keyword,F.Keyword],[Ie.Snippet,F.Snippet],[Ie.Text,F.Text],[Ie.Color,F.Color],[Ie.File,F.File],[Ie.Reference,F.Reference],[Ie.Folder,F.Folder],[Ie.Event,F.Event],[Ie.Operator,F.Operator],[Ie.TypeParameter,F.TypeParameter],[Ie.Issue,F.Issue],[Ie.User,F.User]]);function t(r){return e.get(r)??F.Property}n.from=t;const i=new Map([[F.Method,Ie.Method],[F.Function,Ie.Function],[F.Constructor,Ie.Constructor],[F.Field,Ie.Field],[F.Variable,Ie.Variable],[F.Class,Ie.Class],[F.Interface,Ie.Interface],[F.Struct,Ie.Struct],[F.Module,Ie.Module],[F.Property,Ie.Property],[F.Unit,Ie.Unit],[F.Value,Ie.Value],[F.Constant,Ie.Constant],[F.Enum,Ie.Enum],[F.EnumMember,Ie.EnumMember],[F.Keyword,Ie.Keyword],[F.Snippet,Ie.Snippet],[F.Text,Ie.Text],[F.Color,Ie.Color],[F.File,Ie.File],[F.Reference,Ie.Reference],[F.Folder,Ie.Folder],[F.Event,Ie.Event],[F.Operator,Ie.Operator],[F.TypeParameter,Ie.TypeParameter],[F.User,Ie.User],[F.Issue,Ie.Issue]]);function s(r){return i.get(r)??Ie.Property}n.to=s})(gm||(gm={}));var Jb;(function(n){function e(t,i){const s=new Lg(t.label);return s.insertText=t.insertText,s.kind=gm.to(t.kind),s.tags=t.tags?.map(pm.to),s.detail=t.detail,s.documentation=Fr(t.documentation)?Re.to(t.documentation):t.documentation,s.sortText=t.sortText,s.filterText=t.filterText,s.preselect=t.preselect,s.commitCharacters=t.commitCharacters,et.isIRange(t.range)?s.range=z.to(t.range):typeof t.range=="object"&&(s.range={inserting:z.to(t.range.insert),replacing:z.to(t.range.replace)}),s.keepWhitespace=typeof t.insertTextRules>"u"?!1:!!(t.insertTextRules&ba.KeepWhitespace),typeof t.insertTextRules<"u"&&t.insertTextRules&ba.InsertAsSnippet?s.insertText=new Ka(t.insertText):(s.insertText=t.insertText,s.textEdit=s.range instanceof Me?new ko(s.range,s.insertText):void 0),t.additionalTextEdits&&t.additionalTextEdits.length>0&&(s.additionalTextEdits=t.additionalTextEdits.map(r=>pn.to(r))),s.command=i&&t.command?i.fromInternal(t.command):void 0,s}n.to=e})(Jb||(Jb={}));var mm;(function(n){function e(i){if(typeof i.label!="string"&&!Array.isArray(i.label))throw new TypeError("Invalid label");return{label:i.label,documentation:Re.fromStrict(i.documentation)}}n.from=e;function t(i){return{label:i.label,documentation:Fr(i.documentation)?Re.to(i.documentation):i.documentation}}n.to=t})(mm||(mm={}));var _m;(function(n){function e(i){return{label:i.label,documentation:Re.fromStrict(i.documentation),parameters:Array.isArray(i.parameters)?i.parameters.map(mm.from):[],activeParameter:i.activeParameter}}n.from=e;function t(i){return{label:i.label,documentation:Fr(i.documentation)?Re.to(i.documentation):i.documentation,parameters:Array.isArray(i.parameters)?i.parameters.map(mm.to):[],activeParameter:i.activeParameter}}n.to=t})(_m||(_m={}));var Ph;(function(n){function e(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(_m.from):[]}}n.from=e;function t(i){return{activeSignature:i.activeSignature,activeParameter:i.activeParameter,signatures:Array.isArray(i.signatures)?i.signatures.map(_m.to):[]}}n.to=t})(Ph||(Ph={}));var Xb;(function(n){function e(t,i){const s=new Rg(ot.to(i.position),typeof i.label=="string"?i.label:i.label.map(Yb.to.bind(void 0,t)),i.kind&&vm.to(i.kind));return s.textEdits=i.textEdits&&i.textEdits.map(pn.to),s.tooltip=Fr(i.tooltip)?Re.to(i.tooltip):i.tooltip,s.paddingLeft=i.paddingLeft,s.paddingRight=i.paddingRight,s}n.to=e})(Xb||(Xb={}));var Yb;(function(n){function e(t,i){const s=new Ag(i.label);return s.tooltip=Fr(i.tooltip)?Re.to(i.tooltip):i.tooltip,aw.is(i.command)&&(s.command=t.fromInternal(i.command)),i.location&&(s.location=oi.to(i.location)),s}n.to=e})(Yb||(Yb={}));var vm;(function(n){function e(i){return i}n.from=e;function t(i){return i}n.to=t})(vm||(vm={}));var Da;(function(n){function e(i){return{range:z.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"?x.parse(i.url,!0):x.revive(i.url)}catch{}const r=new Og(z.to(i.range),s);return r.tooltip=i.tooltip,r}n.to=t})(Da||(Da={}));var wm;(function(n){function e(i){const s=new Mg(i.label);return i.textEdit&&(s.textEdit=pn.to(i.textEdit)),i.additionalTextEdits&&(s.additionalTextEdits=i.additionalTextEdits.map(r=>pn.to(r))),s}n.to=e;function t(i){return{label:i.label,textEdit:i.textEdit?pn.from(i.textEdit):void 0,additionalTextEdits:i.additionalTextEdits?i.additionalTextEdits.map(s=>pn.from(s)):void 0}}n.from=t})(wm||(wm={}));var Zc;(function(n){function e(i){return new Vc(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})(Zc||(Zc={}));var Zb;(function(n){function e(i){return{range:z.from(i.range)}}n.from=e;function t(i){return new eh(z.to(i.range))}n.to=t})(Zb||(Zb={}));var bm;(function(n){function e(t){switch(t){case Fl.AUTO:return ac.AfterDelay;case Fl.EXPLICIT:return ac.Manual;case Fl.FOCUS_CHANGE:case Fl.WINDOW_CHANGE:return ac.FocusOut}}n.to=e})(bm||(bm={}));var gc;(function(n){function e(i){switch(i){case Xi.Off:return Fn.Off;case Xi.Relative:return Fn.Relative;case Xi.Interval:return Fn.Interval;case Xi.On:default:return Fn.On}}n.from=e;function t(i){switch(i){case Fn.Off:return Xi.Off;case Fn.Relative:return Xi.Relative;case Fn.Interval:return Xi.Interval;case Fn.On:default:return Xi.On}}n.to=t})(gc||(gc={}));var eu;(function(n){function e(i){if(i===os.CRLF)return Ll.CRLF;if(i===os.LF)return Ll.LF}n.from=e;function t(i){if(i===Ll.CRLF)return os.CRLF;if(i===Ll.LF)return os.LF}n.to=t})(eu||(eu={}));var ym;(function(n){function e(t){if(typeof t=="object")return t.viewId;switch(t){case wo.SourceControl:return id.Scm;case wo.Window:return id.Window;case wo.Notification:return id.Notification}throw new Error("Unknown 'ProgressLocation'")}n.from=e})(ym||(ym={}));var xm;(function(n){function e(i){const s={start:i.start+1,end:i.end+1};return i.kind&&(s.kind=Em.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=Em.to(i.kind)),s}n.to=t})(xm||(xm={}));var Em;(function(n){function e(i){if(i)switch(i){case gr.Comment:return _l.Comment;case gr.Imports:return _l.Imports;case gr.Region:return _l.Region}}n.from=e;function t(i){if(i)switch(i.value){case _l.Comment.value:return gr.Comment;case _l.Imports.value:return gr.Imports;case _l.Region.value:return gr.Region}}n.to=t})(Em||(Em={}));var dd;(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"?z.from(t.selection):void 0,override:typeof t.override=="boolean"?OL.id:void 0}}n.from=e})(dd||(dd={}));var pi;(function(n){function e(r){return r instanceof uc?r.toJSON():typeof r=="string"?r:t(r)||i(r)?new uc(r.baseUri??r.base,r.pattern).toJSON():r}n.from=e;function t(r){const o=r;return o?x.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 uc(x.revive(r.baseUri),r.pattern)}n.to=s})(pi||(pi={}));var ey;(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:pi.from(i.pattern)??void 0,exclusive:i.exclusive,notebookType:i.notebookType}}}else return}n.from=e})(ey||(ey={}));var Ws;(function(n){function e(i){return{start:i.start,end:i.end}}n.from=e;function t(i){return new as(i.start,i.end)}n.to=t})(Ws||(Ws={}));var tu;(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})(tu||(tu={}));var Ah;(function(n){function e(i){switch(i){case da.Markup:return Ml.Markup;case da.Code:default:return Ml.Code}}n.from=e;function t(i){switch(i){case Ml.Markup:return da.Markup;case Ml.Code:default:return da.Code}}n.to=t})(Ah||(Ah={}));var Xr;(function(n){function e(i){const s={metadata:i.metadata??Object.create(null),cells:[]};for(const r of i.cells)c_.validate(r),s.cells.push(nu.from(r));return s}n.from=e;function t(i){const s=new KT(i.cells.map(nu.to));return j4(i.metadata)||(s.metadata=i.metadata),s}n.to=t})(Xr||(Xr={}));var nu;(function(n){function e(i){return{cellKind:Ah.from(i.kind),language:i.languageId,mime:i.mime,source:i.value,metadata:i.metadata,internalMetadata:tu.from(i.executionSummary??{}),outputs:i.outputs?i.outputs.map(Io.from):[]}}n.from=e;function t(i){return new c_(Ah.to(i.cellKind),i.source,i.language,i.mime,i.outputs?i.outputs.map(Io.to):void 0,i.metadata,i.internalMetadata?tu.to(i.internalMetadata):void 0)}n.to=t})(nu||(nu={}));var iu;(function(n){function e(i){return{mime:i.mime,valueBytes:ue.wrap(i.data)}}n.from=e;function t(i){return new QT(i.valueBytes.buffer,i.mime)}n.to=t})(iu||(iu={}));var Io;(function(n){function e(i){return{outputId:i.id,items:i.items.map(iu.from),metadata:i.metadata}}n.from=e;function t(i){const s=i.items.map(iu.to);return new Xg(s,i.outputId,i.metadata)}n.to=t})(Io||(Io={}));var Sm;(function(n){function e(s){return i(s)?{include:pi.from(s.include)??void 0,exclude:pi.from(s.exclude)??void 0}:pi.from(s)??void 0}n.from=e;function t(s){return i(s)?{include:pi.to(s.include),exclude:pi.to(s.exclude)}:pi.to(s)}n.to=t;function i(s){const r=s;return r?!tn(r.include)&&!tn(r.exclude):!1}})(Sm||(Sm={}));var ty;(function(n){function e(t,i,s){const r=typeof t.command=="string"?{title:"",command:t.command}:t.command;return{alignment:t.alignment===Yg.Left?Yp.Left:Yp.Right,command:i.toInternal(r,s),text:t.text,tooltip:t.tooltip,accessibilityInformation:t.accessibilityInformation,priority:t.priority}}n.from=e})(ty||(ty={}));var ny;(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})(ny||(ny={}));var iy;(function(n){function e(t){return{transientOutputs:t?.transientOutputs??!1,transientCellMetadata:t?.transientCellMetadata??{},transientDocumentMetadata:t?.transientDocumentMetadata??{},cellContentMetadata:t?.cellContentMetadata??{}}}n.from=e})(iy||(iy={}));var km;(function(n){function e(i){return{uri:i.uri,provides:i.provides}}n.from=e;function t(i){return new JT(x.revive(i.uri),i.provides)}n.to=t})(km||(km={}));var su;(function(n){function e(i){return{message:Re.fromStrict(i.message)||"",type:ds.Error,expected:i.expectedOutput,actual:i.actualOutput,contextValue:i.contextValue,location:i.location&&{range:z.from(i.location.range),uri:i.location.uri},stackTrace:i.stackTrace?.map(s=>({label:s.label,position:s.position&&ot.from(s.position),uri:s.uri&&x.revive(s.uri).toJSON()}))}}n.from=e;function t(i){const s=new im(typeof i.message=="string"?i.message:Re.to(i.message));return s.actualOutput=i.actual,s.expectedOutput=i.expected,s.contextValue=i.contextValue,s.location=i.location?oi.to(i.location):void 0,s}n.to=t})(su||(su={}));var fs;(function(n){n.namespace=tp,n.denamespace=MT})(fs||(fs={}));var sy;(function(n){function e(t){return{controllerId:t.controllerId,profileId:t.profileId,group:ru.from(t.kind)}}n.from=e})(sy||(sy={}));var ru;(function(n){const e={[pc.Coverage]:Rn.Coverage,[pc.Debug]:Rn.Debug,[pc.Run]:Rn.Run};function t(i){return e.hasOwnProperty(i)?e[i]:Rn.Run}n.from=t})(ru||(ru={}));var Co;(function(n){function e(i){const s=l_(i).controllerId;return{extId:Oe.fromExtHostTestItem(i,s).toString(),label:i.label,uri:x.revive(i.uri),busy:i.busy,tags:i.tags.map(r=>fs.namespace(s,r.id)),range:et.lift(z.from(i.range)),description:i.description||null,sortText:i.sortText||null,error:i.error&&Re.fromStrict(i.error)||null}}n.from=e;function t(i){return{parent:void 0,error:void 0,id:Oe.fromString(i.extId).localId,label:i.label,uri:x.revive(i.uri),tags:(i.tags||[]).map(s=>{const{tagId:r}=fs.denamespace(s);return new vh(r)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>{},replace:()=>{},size:0},range:z.to(i.range||void 0),canResolveChildren:!1,busy:i.busy,description:i.description||void 0,sortText:i.sortText||void 0}}n.toPlain=t})(Co||(Co={}));(function(n){function e(i){return{id:i.id}}n.from=e;function t(i){return new vh(i.id)}n.to=t})(fs||(fs={}));var ry;(function(n){const e=(i,s)=>{const r=i.value;if(!r)return;const o={...Co.toPlain(r.item),parent:s,taskStates:r.tasks.map(a=>({state:a.state,duration:a.duration,messages:a.messages.filter(l=>l.type===ds.Error).map(su.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 f7;for(const a of i.items)s.insert(Oe.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(Ii)}}n.to=t})(ry||(ry={}));var Rh;(function(n){function e(a){return{covered:a.covered,total:a.total}}function t(a){return"line"in a?ot.from(a):z.from(a)}function i(a){if(a)return"endLineNumber"in a?z.to(a):ot.to(a)}function s(a){if(a.type===ya.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 YT(a.count,i(a.location),a.branches?.map(c=>new ZT(c.count,i(c.location),c.label)))}else return new eP(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:ya.Statement,branches:a.branches.length?a.branches.map(l=>({count:l.executed,location:l.location&&t(l.location),label:l.label})):void 0}:{type:ya.Declaration,name:a.name,count:a.executed,location:t(a.location)}}n.fromDetails=r;function o(a,l,c){return op(c.statementCoverage),op(c.branchCoverage),op(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 Kc&&c.includesTests.length?c.includesTests.map(u=>Oe.fromExtHostTestItem(u,a).toString()):void 0}}n.fromFile=o})(Rh||(Rh={}));var oy;(function(n){function e(t){switch(t){case jp.Invoke:return Yd.Invoke;case jp.Auto:return Yd.Automatic}}n.to=e})(oy||(oy={}));var Ia;(function(n){function e(i){const s=new tE(Hi.to(i.kind),i.name,i.detail||"",x.revive(i.uri),z.to(i.range),z.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:Hi.from(i.kind),name:i.name,detail:i.detail??"",uri:i.uri,range:z.from(i.range),selectionRange:z.from(i.selectionRange),tags:i.tags?.map(Or.from)}}n.from=t})(Ia||(Ia={}));var Dm;(function(n){function e(t){if(t)return{value:t.value,tooltip:t.tooltip}}n.from=e})(Dm||(Dm={}));var Ca;(function(n){function e(r,o,a){const l=o.fileData;return l?new v3(new w3(l.name,x.revive(l.uri),l.id,wx(()=>a(l.id)))):r===Us.uriList&&o.uriListData?new Bg(s(o.uriListData)):new Bg(o.asString)}n.to=e;async function t(r,o,a=Sn()){const l=await o.asString();if(r===Us.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 Zv.split(r).map(o=>{if(o.startsWith("#"))return o;try{return x.parse(o)}catch{}return o})}function s(r){return Zv.create(r.map(o=>typeof o=="string"?o:x.revive(o)))}})(Ca||(Ca={}));var ou;(function(n){function e(s,r){const o=s.items.map(([a,l])=>[a,Ca.to(a,l,r)]);return new qc(o)}n.toDataTransfer=e;async function t(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await Ca.from(o,a)]))}}n.from=t;async function i(s){return{items:await Promise.all(Array.from(s,async([o,a])=>[o,await Ca.from(o,a,a.id)]))}}n.fromList=i})(ou||(ou={}));var Im;(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})(Im||(Im={}));var au;(function(n){function e(i){switch(i){case ur.System:return fi.System;case ur.User:return fi.User;case ur.Assistant:return fi.Assistant}}n.to=e;function t(i){switch(i){case fi.System:return ur.System;case fi.User:return ur.User;case fi.Assistant:return ur.Assistant}return ur.User}n.from=t})(au||(au={}));var bD;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new zt(a.value);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new zt(c.value):new Gs(c.value));return new lm(a.toolCallId,l,a.isError)}else{if(a.type==="image_url")return;if(a.type==="tool_use")return new Ja(a.toolCallId,a.name,a.parameters)}}).filter(a=>a!==void 0),r=au.to(i.role);return new hP(r,s,i.name)}n.to=e;function t(i){const s=au.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new zt(o)]);const a=o.map(l=>{if(l instanceof lm)return{type:"tool_result",toolCallId:l.callId,value:rn(l.content.map(c=>c instanceof zt?{type:"text",value:c.value}:c instanceof Gs?{type:"prompt_tsx",value:c.value}:void 0)),isError:l.isError};if(l instanceof Ja)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof zt)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})(bD||(bD={}));var hd;(function(n){function e(i){const s=i.content.map(a=>{if(a.type==="text")return new zt(a.value);if(a.type==="tool_result"){const l=a.value.map(c=>c.type==="text"?new zt(c.value):c.type==="data"?new Ci(c.value.data.buffer,c.value.mimeType):new Gs(c.value));return new Tb(a.toolCallId,l,a.isError)}else return a.type==="image_url"?new Ci(a.value.data.buffer,a.value.mimeType):a.type==="data"?new Ci(a.data.buffer,a.mimeType):new Ja(a.toolCallId,a.name,a.parameters)}),r=au.to(i.role);return new fP(r,s,i.name)}n.to=e;function t(i){const s=au.from(i.role),r=i.name;let o=i.content;typeof o=="string"&&(o=[new zt(o)]);const a=o.map(l=>{if(l instanceof Tb||l instanceof lm)return{type:"tool_result",toolCallId:l.callId,value:rn(l.content.map(c=>c instanceof zt?{type:"text",value:c.value}:c instanceof Gs?{type:"prompt_tsx",value:c.value}:c instanceof Ci?{type:"data",value:{mimeType:c.mimeType,data:ue.wrap(c.data)}}:void 0)),isError:l.isError};if(l instanceof Ci)return j3(l)?{type:"image_url",value:{mimeType:l.mimeType,data:ue.wrap(l.data)}}:{type:"data",mimeType:l.mimeType,data:ue.wrap(l.data)};if(l instanceof Ja)return{type:"tool_use",toolCallId:l.callId,name:l.name,parameters:l.input};if(l instanceof zt)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})(hd||(hd={}));function j3(n){switch(n.mimeType){case br.PNG:case br.JPEG:case br.GIF:case br.WEBP:case br.BMP:return!0;default:return!1}}var Lh;(function(n){function e(i){return{kind:"markdownContent",content:Re.from(i.value)}}n.from=e;function t(i){return new u_(Re.to(i.content))}n.to=t})(Lh||(Lh={}));var Cm;(function(n){function e(i){return{kind:"codeblockUri",uri:i.value,isEdit:i.isEdit}}n.from=e;function t(i){return new f_(x.revive(i.uri),i.isEdit)}n.to=t})(Cm||(Cm={}));var Tm;(function(n){function e(i){return{kind:"markdownVuln",content:Re.from(i.value),vulnerabilities:i.vulnerabilities}}n.from=e;function t(i){return new bh(Re.to(i.content),i.vulnerabilities)}n.to=t})(Tm||(Tm={}));var Pm;(function(n){function e(t){return{kind:"confirmation",title:t.title,message:t.message,data:t.data,buttons:t.buttons}}n.from=e})(Pm||(Pm={}));var Nh;(function(n){function e(i){const{value:s,baseUri:r}=i;function o(a,l){return a.map(c=>{const u=x.joinPath(l,c.name);return{label:c.name,uri:u,children:c.children&&o(c.children,u)}})}return{kind:"treeData",treeData:{label:Ks(r),uri:r,children:o(s,r)}}}n.from=e;function t(i){const s=an(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 d_(a,o)}n.to=t})(Nh||(Nh={}));var lu;(function(n){function e(i){const s=o=>x.isUri(o),r=o=>"name"in o;return{kind:"inlineReference",name:i.title,inlineReference:s(i.value)?i.value:r(i.value)?Ya.from(i.value):Bs.from(i.value)}}n.from=e;function t(i){const s=an(i);return new yh(x.isUri(s.inlineReference)?s.inlineReference:"location"in s.inlineReference?Ya.to(s.inlineReference):Bs.to(s.inlineReference),i.name)}n.to=t})(lu||(lu={}));var Oh;(function(n){function e(i){return{kind:"progressMessage",content:Re.from(i.value)}}n.from=e;function t(i){return new oE(i.content.value)}n.to=t})(Oh||(Oh={}));var Fh;(function(n){function e(i){return{kind:"warning",content:Re.from(i.value)}}n.from=e;function t(i){return new xh(i.content.value)}n.to=t})(Fh||(Fh={}));var ay;(function(n){function e(t){return{kind:"extensions",extensions:t.extensions}}n.from=e})(ay||(ay={}));var ly;(function(n){function e(i){return{kind:"move",uri:i.uri,range:z.from(i.range)}}n.from=e;function t(i){return new p_(x.revive(i.uri),z.to(i.range))}n.to=t})(ly||(ly={}));var Mh;(function(n){function e(i){return{kind:"prepareToolInvocation",toolName:i.toolName}}n.from=e;function t(i){return new Sh(i.toolName)}n.to=t})(Mh||(Mh={}));var Am;(function(n){function e(t){return{kind:"progressTask",content:Re.from(t.value)}}n.from=e})(Am||(Am={}));var cy;(function(n){function e(t){return{kind:"progressTaskResult",content:typeof t=="string"?Re.from(t):void 0}}n.from=e})(cy||(cy={}));var Uh;(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 h_(s.fromInternal(i.command)??{command:i.command.id,title:i.command.title})}n.to=t})(Uh||(Uh={}));var Rm;(function(n){function e(i){return{kind:"textEdit",uri:i.uri,edits:i.edits.map(s=>pn.from(s)),done:i.isDone}}n.from=e;function t(i){const s=new Eh(x.revive(i.uri),i.edits.map(r=>pn.to(r)));return s.isDone=i.done,s}n.to=t})(Rm||(Rm={}));var Lm;(function(n){function e(t){return t.newCellMetadata?{editType:_o.Metadata,index:t.range.start,metadata:t.newCellMetadata}:t.newNotebookMetadata?{editType:_o.DocumentMetadata,metadata:t.newNotebookMetadata}:{editType:_o.Replace,index:t.range.start,count:t.range.end-t.range.start,cells:t.newCells.map(nu.from)}}n.from=e})(Lm||(Lm={}));var Nm;(function(n){function e(t){return{kind:"notebookEdit",uri:t.uri,edits:t.edits.map(Lm.from),done:t.isDone}}n.from=e})(Nm||(Nm={}));var Ta;(function(n){function e(i){const s=sn.isThemeIcon(i.iconPath)?i.iconPath:x.isUri(i.iconPath)?{light:x.revive(i.iconPath)}:i.iconPath&&"light"in i.iconPath&&"dark"in i.iconPath&&x.isUri(i.iconPath.light)&&x.isUri(i.iconPath.dark)?{light:x.revive(i.iconPath.light),dark:x.revive(i.iconPath.dark)}:void 0;return typeof i.value=="object"&&"variableName"in i.value?{kind:"reference",reference:{variableName:i.value.variableName,value:x.isUri(i.value.value)||!i.value.value?i.value.value:Bs.from(i.value.value)},iconPath:s,options:i.options}:{kind:"reference",reference:x.isUri(i.value)||typeof i.value=="string"?i.value:Bs.from(i.value),iconPath:s,options:i.options}}n.from=e;function t(i){const s=an(i),r=o=>x.isUri(o)?o:Bs.to(o);return new ka(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})(Ta||(Ta={}));var Om;(function(n){function e(t){return{kind:"codeCitation",value:t.value,license:t.license,snippet:t.snippet}}n.from=e})(Om||(Om={}));var Fm;(function(n){function e(s,r,o){return s instanceof u_?Lh.from(s):s instanceof yh?lu.from(s):s instanceof ka?Ta.from(s):s instanceof oE?Oh.from(s):s instanceof d_?Nh.from(s):s instanceof h_?Uh.from(s,r,o):s instanceof Eh?Rm.from(s):s instanceof am?Nm.from(s):s instanceof bh?Tm.from(s):s instanceof f_?Cm.from(s):s instanceof xh?Fh.from(s):s instanceof rm?Pm.from(s):s instanceof om?Om.from(s):s instanceof p_?ly.from(s):s instanceof aE?ay.from(s):s instanceof Sh?Mh.from(s):{kind:"markdownContent",content:Re.from("")}}n.from=e;function t(s,r){switch(s.kind){case"reference":return Ta.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 Lh.to(s);case"inlineReference":return lu.to(s);case"progressMessage":return;case"treeData":return Nh.to(s);case"command":return Uh.to(s,r)}}n.toContent=i})(Fm||(Fm={}));var Mm;(function(n){function e(t,i,s,r,o,a,l){const c=[],u=[];for(const f of t.variables.variables)f.kind==="tool"?c.push(f):f.kind==="toolset"?c.push(...f.value):u.push(f);const d={id:t.requestId,prompt:t.message,command:t.command,attempt:t.attempt??0,enableCommandDetection:t.enableCommandDetection??!0,isParticipantDetected:t.isParticipantDetected??!1,references:u.map(f=>$m.to(f,r,l)).filter(Ii),toolReferences:c.map($h.to),location:Um.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 dt(a,"chatParticipantPrivate")||(delete d.id,delete d.attempt,delete d.enableCommandDetection,delete d.isParticipantDetected,delete d.location,delete d.location2,delete d.editedFileEvents),dt(a,"chatParticipantAdditions")||(delete d.acceptedConfirmationData,delete d.rejectedConfirmationData,delete d.tools),d}n.to=e})(Mm||(Mm={}));var uy;(function(n){function e(t){return{prompt:t.prompt,files:t.files.map(i=>x.revive(i))}}n.to=e})(uy||(uy={}));var Um;(function(n){function e(i){switch(i){case zn.Notebook:return Yi.Notebook;case zn.Terminal:return Yi.Terminal;case zn.Panel:return Yi.Panel;case zn.Editor:return Yi.Editor}}n.to=e;function t(i){switch(i){case Yi.Notebook:return zn.Notebook;case Yi.Terminal:return zn.Terminal;case Yi.Panel:return zn.Panel;case Yi.Editor:return zn.Editor}}n.from=t})(Um||(Um={}));var $m;(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(Cp(r))r=x.revive(r);else if(r&&typeof r=="object"&&"uri"in r&&"range"in r&&Cp(r.uri))r=Bs.to(an(r));else if(y6(t)){const o=t.references?.[0]?.reference;r=new uP(t.mimeType??"image/png",()=>Promise.resolve(new Uint8Array(Object.values(t.value))),o&&x.isUri(o)?o:void 0)}else if(t.kind==="diagnostic"){const o=t.filterSeverity&&Ih.to(t.filterSeverity),a=t.filterUri&&x.revive(t.filterUri).toString();r=new dP(i.map(([l,c])=>t.filterUri&&l.toString()!==a?[l,[]]:[l,c.filter(u=>!(o&&u.severity>o||t.filterRange&&!et.areIntersectingOrTouching(t.filterRange,z.from(u.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})($m||($m={}));var $h;(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})($h||($h={}));var dy;(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})(dy||(dy={}));var mc;(function(n){function e(s){return{errorDetails:s.errorDetails,metadata:i(s.metadata),nextQuestion:s.nextQuestion}}n.to=e;function t(s){return{errorDetails:s.errorDetails,metadata:s.metadata,nextQuestion:s.nextQuestion}}n.from=t;function i(s){return Nc(s,r=>{if(r.$mid===st.LanguageModelToolResult)return new g_(Nc(r.content,i));if(r.$mid===st.LanguageModelTextPart)return new zt(r.value);if(r.$mid===st.LanguageModelPromptTsxPart)return new Gs(r.value)})}})(mc||(mc={}));var hy;(function(n){function e(t,i,s){if(i.action.kind==="vote")return;const r=mc.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:Im.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",ha.Accepted],["rejected",ha.Rejected],["saved",ha.Saved]]).get(i.action.outcome)??ha.Rejected,uri:x.revive(i.action.uri),hasRemainingEdits:i.action.hasRemainingEdits},result:r}:{action:i.action,result:r}}n.to=e})(hy||(hy={}));var Hm;(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})(Hm||(Hm={}));var Bm;(function(n){function e(t){return{...t,documentation:Re.fromStrict(t.documentation)}}n.from=e})(Bm||(Bm={}));var fy;(function(n){function e(t){return Array.isArray(t)?{items:t.map(i=>Bm.from(i))}:{items:t.items.map(i=>Bm.from(i)),resourceRequestConfig:t.resourceRequestConfig?py.from(t.resourceRequestConfig):void 0}}n.from=e})(fy||(fy={}));var py;(function(n){function e(t){return{...t,pathSeparator:Qn?"\\":"/",cwd:t.cwd?x.revive(t.cwd):void 0}}n.from=e})(py||(py={}));var gy;(function(n){function e(t){return{kind:my.to(t.kind),acceptedLength:t.acceptedLength}}n.to=e})(gy||(gy={}));var my;(function(n){function e(t){switch(t){case Zu.Word:return aa.Word;case Zu.Line:return aa.Line;case Zu.Suggest:return aa.Suggest;default:return aa.Unknown}}n.to=e})(my||(my={}));var _y;(function(n){function e(t,i){if(t.kind===qp.Ignored){const s=t.supersededBy?i(t.supersededBy):void 0;return{kind:oc.Ignored,supersededBy:s,userTypingDisagreed:t.userTypingDisagreed}}else if(t.kind===qp.Accepted)return{kind:oc.Accepted};return{kind:oc.Rejected}}n.to=e})(_y||(_y={}));var vy;(function(n){function e(t,i){return{id:i,label:t.label,description:t.description,canEdit:t.canEdit,collapsibleState:t.collapsibleState||Iw.None,contextValue:t.contextValue}}n.from=e})(vy||(vy={}));var yD;(function(n){function e(t){return{name:t.id,description:t.modelDescription,inputSchema:t.inputSchema,tags:t.tags??[]}}n.to=e})(yD||(yD={}));var xD;(function(n){function e(i){return new g_(i.content.map(s=>s.kind==="text"?new zt(s.value):new Gs(s.value)))}n.to=e;function t(i,s){return i.toolResultMessage&&$(s,"chatParticipantPrivate"),{content:i.content.map(r=>{if(r instanceof zt)return{kind:"text",value:r.value};if(r instanceof Gs)return{kind:"promptTsx",value:r.value};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Re.fromStrict(i.toolResultMessage),toolResultDetails:i.toolResultDetails?.map(r=>x.isUri(r)?r:Bs.from(r))}}n.from=t})(xD||(xD={}));var Wm;(function(n){function e(i){return new pP(i.content.map(s=>{if(s.kind==="text")return new zt(s.value);if(s.kind==="data"){const r=Object.values(br).includes(s.value.mimeType)?s.value.mimeType:void 0;if(!r)throw new Error("Invalid MIME type");return new Ci(s.value.data.buffer,r)}else return new Gs(s.value)}))}n.to=e;function t(i,s){i.toolResultMessage&&$(s,"chatParticipantPrivate");let r=!1;const o={content:i.content.map(a=>{if(a instanceof zt)return{kind:"text",value:a.value};if(a instanceof Gs)return{kind:"promptTsx",value:a.value};if(a instanceof Ci)return r=!0,{kind:"data",value:{mimeType:a.mimeType,data:ue.wrap(a.data)}};throw new Error("Unknown LanguageModelToolResult part type")}),toolResultMessage:Re.fromStrict(i.toolResultMessage),toolResultDetails:i.toolResultDetails?.map(a=>x.isUri(a)?a:Bs.from(a))};return r?new jn(o):o}n.from=t})(Wm||(Wm={}));var wy;(function(n){function e(t){return t}n.fromThemeIcon=e})(wy||(wy={}));var by;(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 Jr.EMBEDDED:return Jr.EMBEDDED;case Jr.LLM_RANKED:return Jr.LLM_RANKED;case Jr.CANCELED:return Jr.CANCELED;default:throw new Error("Unknown AiSettingsSearchResultKind")}}})(by||(by={}));var fd;(function(n){function e(i){return!!i.uri}function t(i){return Dh.toSerialized(e(i)?{type:Xa.HTTP,uri:i.uri,headers:Object.entries(i.headers)}:{type:Xa.Stdio,cwd:i.cwd?.fsPath,args:i.args,command:i.command,env:i.env,envFile:void 0})}n.from=t})(fd||(fd={}));class fo{constructor(e,t,i){this.uri=e,this.ranges=t,this.previewText=i}}class lE{constructor(e,t,i){this.uri=e,this.text=t,this.lineNumber=i}}class yy{constructor(e){this.keyword=e}}var _r;(function(n){n[n.None=1]="None",n[n.FilesExclude=2]="FilesExclude",n[n.SearchAndFilesExclude=3]="SearchAndFilesExclude"})(_r||(_r={}));var Vm;(function(n){n[n.Information=1]="Information",n[n.Warning=2]="Warning"})(Vm||(Vm={}));const vP=2e4,wP="⟪ ",bP=" characters skipped ⟫",G3=(wP.length+bP.length+5)*2;var ED;(function(n){n[n.file=0]="file",n[n.text=1]="text",n[n.aiText=2]="aiText"})(ED||(ED={}));var Pa;(function(n){n[n.File=1]="File",n[n.Text=2]="Text",n[n.aiText=3]="aiText"})(Pa||(Pa={}));function SD(n){return!!n.rangeLocations&&!!n.previewText}var kD;(function(n){n[n.Normal=0]="Normal",n[n.NewSearchStarted=1]="NewSearchStarted"})(kD||(kD={}));class K3{constructor(e,t,i,s){this.rangeLocations=[],this.webviewIndex=s;const r=Array.isArray(t)?t:[t];if(i&&i.matchLines===1&&Q3(r)){e=fR(e,i.matchLines);let o="",a=0,l=0;const c=Math.floor(i.charsPerLine/5);for(const u of r){const d=Math.max(u.startColumn-c,0),f=u.startColumn+i.charsPerLine;if(d>l+c+G3){const p=wP+(d-l)+bP;o+=p+e.slice(d,f),a+=d-(l+p.length)}else o+=e.slice(l,f);l=f,this.rangeLocations.push({source:u,preview:new J3(0,u.startColumn-a,u.endColumn-a)})}this.previewText=o}else{const o=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber,a=Rv(t,l=>({preview:new yP(l.startLineNumber-o,l.startColumn,l.endLineNumber-o,l.endColumn),source:l}));this.rangeLocations=Array.isArray(a)?a:[a],this.previewText=e}}}function Q3(n){const e=n[0].startLineNumber;for(const t of n)if(t.startLineNumber!==e||t.endLineNumber!==e)return!1;return!0}class yP{constructor(e,t,i,s){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=i,this.endColumn=s}}class J3 extends yP{constructor(e,t,i){super(e,t,e,i)}}var DD;(function(n){n.List="list",n.Tree="tree"})(DD||(DD={}));var ID;(function(n){n.Default="default",n.FileNames="fileNames",n.Type="type",n.Modified="modified",n.CountDescending="countDescending",n.CountAscending="countAscending"})(ID||(ID={}));var CD;(function(n){n.Auto="auto",n.Manual="manual",n.RunOnEmpty="runOnEmpty"})(CD||(CD={}));function X3(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=qa(s,wt(t)),s=qa(s,wt(i),!0),s}function TD(n,e){return n.excludePattern&&sd(n.excludePattern,e)?!1:n.includePattern||n.usingSearchPaths?n.includePattern&&sd(n.includePattern,e)?!0:n.usingSearchPaths?!!n.folderQueries&&n.folderQueries.some(t=>{const i=t.folder.fsPath;if(Rp(e,i)){const s=Nd(i,e);return!t.includePattern||!!sd(t.includePattern,s)}else return!1}):!1:!0}var PD;(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"})(PD||(PD={}));function _c(n,e){const t={...n||{},...e||{}};return Object.keys(t).filter(i=>{const s=t[i];return typeof s=="boolean"&&s})}class xP{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=>Uc(s));let i=e.includePattern;t.includePattern&&(i?i={...i,...t.includePattern}:i=t.includePattern),i&&(this._parsedIncludeExpression=Uc(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 xo(o)?o.then(a=>a?!1:s()):s()})).then(r=>r.some(o=>!!o))}hasSiblingExcludeClauses(){return this._excludeExpression.reduce((e,t)=>Y3(t)||e,!1)}}function Y3(n){for(const e in n)if(typeof n[e]!="boolean")return!0;return!1}function Z3(n){if(!n)return;let e;return t=>(e||(e=(n()||Promise.resolve([])).then(i=>i?EP(i):{})),e.then(i=>!!i[t]))}function eN(n){if(!n)return;let e;return t=>{if(!e){const i=n();e=i?EP(i):{}}return!!e[t]}}function EP(n){const e={};for(const t of n)e[t]=!0;return e}function SP(n){return n.flatMap(e=>e.patterns.map(t=>e.baseUri?{baseUri:e.baseUri,pattern:t}:t))}const xy={matchLines:100,charsPerLine:1e4},__="utf8",cE="utf8bom",zm="utf16be",qm="utf16le",lp=[254,255],Ey=[255,254],Hu=[239,187,191],tN=512,nN=512,iN=512*8,sN=512*128;var Sy;(function(n){n[n.STREAM_IS_BINARY=1]="STREAM_IS_BINARY"})(Sy||(Sy={}));class rN extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}}class uE{static async create(e){let t;if(e!==__)t=(await import("./iconv-lite-umd-BGIeO9cR.js").then(function(s){return s.i}).then(s=>s.default??s)).getDecoder(kP(e));else{const i=new TextDecoder;t={write(s){return i.decode(s,{stream:!0})},end(){return i.decode()}}}return new uE(t)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}}function oN(n,e){const t=e.minBytesRequiredForDetection??e.guessEncoding?iN:nN;return new Promise((i,s)=>{const r=J4(d=>d.join("")),o=[];let a=0,l;const c=new Nt,u=async()=>{try{const d=await gN({buffer:ue.concat(o),bytesRead:a},e.guessEncoding,e.candidateGuessEncodings);if(d.seemsBinary&&e.acceptTextOnly)throw new rN("Stream is binary but only text is accepted for decoding",Sy.STREAM_IS_BINARY);d.encoding=await e.overwriteEncoding(d.encoding),l=await uE.create(d.encoding);const f=l.write(ue.concat(o).buffer);r.write(f),o.length=0,a=0,i({stream:r,detected:d})}catch(d){c.cancel(),r.destroy(),s(d)}};Y4(n,{onData:async d=>{l?r.write(l.write(d.buffer)):(o.push(d),a+=d.byteLength,a>=t&&(n.pause(),await u(),setTimeout(()=>n.resume())))},onError:d=>r.error(d),onEnd:async()=>{l||await u(),r.end(l?.end())}},c.token)})}async function aN(n,e,t){const s=(await import("./iconv-lite-umd-BGIeO9cR.js").then(function(a){return a.i}).then(a=>a.default??a)).getEncoder(kP(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 __:case cE:return ue.wrap(Uint8Array.from(Hu));case zm:return ue.wrap(Uint8Array.from(lp));case qm:return ue.wrap(Uint8Array.from(Ey))}const l=s.end();return l&&l.length>0?(r=!0,ue.wrap(l)):null}return r=!0,ue.wrap(s.write(a))}}}function kP(n){return n===cE||n===null?__:n}function lN(n,e){if(!n||e<lp.length)return null;const t=n.readUInt8(0),i=n.readUInt8(1);if(t===lp[0]&&i===lp[1])return zm;if(t===Ey[0]&&i===Ey[1])return qm;if(e<Hu.length)return null;const s=n.readUInt8(2);return t===Hu[0]&&i===Hu[1]&&s===Hu[2]?cE:null}const cN=["ascii","utf-16","utf-32"];async function uN(n,e){const t=await import("./index-DoXiLhIy.js").then(function(a){return a.i}).then(a=>a.default??a),i=n.slice(0,sN),s=pN(i.buffer);e&&(e=rn(e.map(a=>fN(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<=cN.indexOf(o)?null:hN(r.encoding)}const dN={ibm866:"cp866",big5:"cp950"};function DP(n){return n.replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}function hN(n){const e=DP(n);return dN[e]||e}function fN(n){const e=DP(n),t=mN[e];return t?t.guessableName:void 0}function pN(n){let e="";for(let t=0;t<n.length;t++)e+=String.fromCharCode(n[t]);return e}function gN({buffer:n,bytesRead:e},t,i){let s=lN(n,e),r=!1;if(s!==zm&&s!==qm&&n){let o=!0,a=!0,l=!1;for(let c=0;c<e&&c<tN;c++){const u=c%2===1,d=n.readUInt8(c)===0;if(d&&(l=!0),o&&(u&&!d||!u&&d)&&(o=!1),a&&(u&&d||!u&&!d)&&(a=!1),d&&!o&&!a)break}l&&(o?s=qm:a?s=zm:r=!0)}return t&&!r&&!s&&n?uN(n.slice(0,e),i).then(o=>({seemsBinary:!1,encoding:o})):{seemsBinary:r,encoding:s}}const ov={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}},mN=(()=>{const n={};for(const e in ov)ov[e].guessableName&&(n[e]=ov[e]);return n})();var AD;(function(n){n[n.FILE_IS_BINARY=0]="FILE_IS_BINARY"})(AD||(AD={}));var RD;(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"})(RD||(RD={}));var LD;(function(n){n[n.EDITOR=1]="EDITOR",n[n.REFERENCE=2]="REFERENCE",n[n.OTHER=3]="OTHER"})(LD||(LD={}));var ND;(function(n){n[n.Encode=0]="Encode",n[n.Decode=1]="Decode"})(ND||(ND={}));function _N(n){let e=!1;return{read(){return e?null:(e=!0,n)}}}function Hh(n,e,t){return new Xh(i=>dE(i,t)).isEqual(n,e)}function vN(n,e,t){return Hh(n.uri,e.uri,t)?0:Va(n.uri.toString(),e.uri.toString())}function wN(n,e,t){return n.index!==e.index?n.index<e.index?-1:1:Hh(n.uri,e.uri,t)?Va(n.name,e.name):Va(n.uri.toString(),e.uri.toString())}function IP(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 I5(s,r,(o,a)=>t(o,a,i))}function dE(n,e){const t=e.getCapabilities(n.scheme);return!(t&&t&ks.PathCaseSensitive)}class vc extends h8{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:u}=e,d=[],f=t;t?a.forEach((v,E)=>{const S=x.revive(v.uri),A=vc._findFolder(i||t,S,s);A?(A.name=v.name,A.index=v.index,d.push(A)):d.push({uri:S,name:v.name,index:E})}):d.push(...a.map(({uri:v,name:E,index:S})=>({uri:x.revive(v),name:E,index:S}))),d.sort((v,E)=>v.index<E.index?-1:1);const p=new vc(r,o,d,!!c,l?x.revive(l):null,!!u,v=>dE(v,s)),{added:_,removed:w}=IP(f?f.workspaceFolders:[],p.workspaceFolders,vN,s);return{workspace:p,added:_,removed:w}}static _findFolder(e,t,i){for(let s=0;s<e.folders.length;s++){const r=e.workspaceFolders[s];if(Hh(r.uri,t,i))return r}}constructor(e,t,i,s,r,o,a){super(e,i.map(l=>new MC(l)),s,r,a),this._name=t,this._isUntitled=o,this._workspaceFolders=[],this._structure=Rs.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=K1(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}}let ky=class{constructor(e,t,i,s,r){this._onDidChangeWorkspace=new N,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new N,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new qu,this._canonicalUriProviders=new Map,this._logService=s,this._extHostFileSystemInfo=i,this._uriTransformerService=r,this._requestIdProvider=new a8,this._barrier=new As,this._proxy=e.getProxy(ee.MainThreadWorkspace),this._messageService=e.getProxy(ee.MainThreadMessageService);const o=t.workspace;this._confirmedWorkspace=o?new vc(o.id,o.name,[],!!o.transient,o.configuration?x.revive(o.configuration):null,!!o.isUntitled,a=>dE(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?x.from({scheme:le.untitled,path:Ks(K1(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(u=>{x.isUri(u.uri)&&!r.some(d=>Hh(d.uri,u.uri,this._extHostFileSystemInfo))&&r.push({uri:u.uri,name:u.name||jv(u.uri)})}),this._unconfirmedWorkspace||[t,i].some(u=>typeof u!="number"||u<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(u=>({uri:u.uri,name:u.name||jv(u.uri),index:void 0})));for(let u=0;u<a.length;u++){const d=a[u];if(a.some((f,p)=>p!==u&&Hh(d.uri,f.uri,this._extHostFileSystemInfo)))return!1}a.forEach((u,d)=>u.index=d);const{added:l,removed:c}=IP(o,a,wN,this._extHostFileSystemInfo);if(l.length===0&&c.length===0)return!1;if(this._proxy){const u=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(u,t,i,r).then(void 0,d=>{this._unconfirmedWorkspace=void 0;const f={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(Qt.Error,h(2597,"Extension '{0}' failed to update workspace folders: {1}",u,d.toString()),f,[])})}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=x.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=kC(r.uri,i);return t&&r.name&&(o=`${r.name}/${o}`),o}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=vc.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}=vc.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=yt.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?_r.FilesExclude:_r.None,useIgnoreFiles:{local:!1}},r)}findFiles2(e,t={},i,s=yt.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=OD(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===_r.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==_r.SearchAndFilesExclude,maxResults:t.maxResults,excludePattern:a.length>0?a:void 0,_reason:"startFileSearch",shouldGlobSearch:e.type==="include"?void 0:!0},c=cp(pi.from(o)),u=c?.folder;return e.type==="include"?l.includePattern=c?.pattern:l.filePattern=c?.pattern,{folder:u,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=>x.revive(o)):[]))??[])).flat()}findTextInFiles2(e,t,i,s=yt.None){this._logService.trace(`extHostWorkspace#findTextInFiles2: textSearch, extension: ${i.value}, entryPoint: findTextInFiles2`);const r=f=>{if(!t)return{folder:void 0,options:{}};const p=f?cp(pi.from(f)):void 0,_=t.exclude?OD(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===_r.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==_r.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:p?.pattern,excludePattern:_},folder:p?.folder}},a=(t?.include?.map(f=>r(f))??[r(void 0)]).filter(f=>!!f),l=new xe,c=l.add(new N),u=this.findTextInFilesBase(e,a,(f,p)=>c.fire({result:f,uri:p}),s);return{results:new za(async f=>{l.add(c.event(p=>{const _=p.result,w=p.uri;SD(_)?f.emitOne(new fo(w,_.rangeLocations.map(v=>({previewRange:new Me(v.preview.startLineNumber,v.preview.startColumn,v.preview.endLineNumber,v.preview.endColumn),sourceRange:new Me(v.source.startLineNumber,v.source.startColumn,v.source.endLineNumber,v.source.endColumn)})),_.previewText)):f.emitOne(new lE(w,_.text,_.lineNumber))})),await u}),complete:u.then(f=>(l.dispose(),{limitHit:f?.limitHit??!1}))}}async findTextInFilesBase(e,t,i,s=yt.None){const r=this._requestIdProvider.getNext();let o=!1;if(s.onCancellationRequested(a=>{o=!0}),this._activeSearchCallbacks[r]=a=>{if(o)return;const l=x.revive(a.resource);a.results.forEach(c=>{const u=an(c);i(u,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=yt.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=cp(pi.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},u=(d,f)=>{SD(d)?i({uri:f,preview:{text:d.previewText,matches:Rv(d.rangeLocations,p=>new Me(p.preview.startLineNumber,p.preview.startColumn,p.preview.endLineNumber,p.preview.endColumn))},ranges:Rv(d.rangeLocations,p=>new Me(p.source.startLineNumber,p.source.startColumn,p.source.endLineNumber,p.source.endColumn))}):i({uri:f,text:d.text,lineNumber:d.lineNumber})};return this.findTextInFilesBase(e,[{options:c,folder:a?.folder}],u,r)}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){const t=await this._proxy.$save(e,{saveAs:!1});return x.revive(t)}async saveAs(e){const t=await this._proxy.$save(e,{saveAs:!0});return x.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),we(()=>{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(x.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(x.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(x.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),we(()=>{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?.(x.revive(e),t,i);if(r)return r}async $provideCanonicalUri(e,t,i){return this.provideCanonicalUri(x.revive(e),{targetScheme:t},i)}async decode(e,t){const[i,s]=this.toEncodeDecodeParameters(t),r=await this._proxy.$resolveDecoding(i,s),o=(await oN(tA(ue.wrap(e)),{...r,acceptTextOnly:!0,overwriteEncoding:a=>a===null||a===r.preferredEncoding?Promise.resolve(r.preferredEncoding):this._proxy.$validateDetectedEncoding(i,a,s)})).stream;return X4(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===__&&!o)return ue.fromString(e).buffer;const a=await aN(_N(e),r,{addBOM:o});return Z5(a).buffer}toEncodeDecodeParameters(e){const t=Cp(e?.uri)?e.uri:void 0,i=typeof e?.encoding=="string"?e.encoding:void 0;return[t,i?{encoding:i}:void 0]}};ky=V([L(0,nt),L(1,gn),L(2,hu),L(3,at),L(4,Q1)],ky);const Mr=pe("IExtHostWorkspace");function cp(n){let e,t;if(n)return typeof n=="string"?e=n:(e=n.pattern,t=x.revive(n.baseUri)),{pattern:e,folder:t}}function OD(n){return(n?.map(e=>{if(typeof e=="string")return e===""?void 0:{pattern:e,uri:void 0};{const t=cp(e);return t?{pattern:t.pattern,uri:t.folder}:void 0}})??[]).filter(e=>!!e)}var vn;(function(n){n[n.None=0]="None",n[n.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=2]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",n[n.InvalidUnicode=4]="InvalidUnicode",n[n.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",n[n.InvalidCharacter=6]="InvalidCharacter"})(vn||(vn={}));var ye;(function(n){n[n.OpenBraceToken=1]="OpenBraceToken",n[n.CloseBraceToken=2]="CloseBraceToken",n[n.OpenBracketToken=3]="OpenBracketToken",n[n.CloseBracketToken=4]="CloseBracketToken",n[n.CommaToken=5]="CommaToken",n[n.ColonToken=6]="ColonToken",n[n.NullKeyword=7]="NullKeyword",n[n.TrueKeyword=8]="TrueKeyword",n[n.FalseKeyword=9]="FalseKeyword",n[n.StringLiteral=10]="StringLiteral",n[n.NumericLiteral=11]="NumericLiteral",n[n.LineCommentTrivia=12]="LineCommentTrivia",n[n.BlockCommentTrivia=13]="BlockCommentTrivia",n[n.LineBreakTrivia=14]="LineBreakTrivia",n[n.Trivia=15]="Trivia",n[n.Unknown=16]="Unknown",n[n.EOF=17]="EOF"})(ye||(ye={}));var Rt;(function(n){n[n.InvalidSymbol=1]="InvalidSymbol",n[n.InvalidNumberFormat=2]="InvalidNumberFormat",n[n.PropertyNameExpected=3]="PropertyNameExpected",n[n.ValueExpected=4]="ValueExpected",n[n.ColonExpected=5]="ColonExpected",n[n.CommaExpected=6]="CommaExpected",n[n.CloseBraceExpected=7]="CloseBraceExpected",n[n.CloseBracketExpected=8]="CloseBracketExpected",n[n.EndOfFileExpected=9]="EndOfFileExpected",n[n.InvalidCommentToken=10]="InvalidCommentToken",n[n.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",n[n.UnexpectedEndOfString=12]="UnexpectedEndOfString",n[n.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",n[n.InvalidUnicode=14]="InvalidUnicode",n[n.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",n[n.InvalidCharacter=16]="InvalidCharacter"})(Rt||(Rt={}));var Dy;(function(n){n.DEFAULT={allowTrailingComma:!0}})(Dy||(Dy={}));function bN(n,e=!1){let t=0;const i=n.length;let s="",r=0,o=ye.Unknown,a=vn.None;function l(w){let v=0,E=0;for(;v<w;){const S=n.charCodeAt(t);if(S>=ae._0&&S<=ae._9)E=E*16+S-ae._0;else if(S>=ae.A&&S<=ae.F)E=E*16+S-ae.A+10;else if(S>=ae.a&&S<=ae.f)E=E*16+S-ae.a+10;else break;t++,v++}return v<w&&(E=-1),E}function c(w){t=w,s="",r=0,o=ye.Unknown,a=vn.None}function u(){const w=t;if(n.charCodeAt(t)===ae._0)t++;else for(t++;t<n.length&&xl(n.charCodeAt(t));)t++;if(t<n.length&&n.charCodeAt(t)===ae.dot)if(t++,t<n.length&&xl(n.charCodeAt(t)))for(t++;t<n.length&&xl(n.charCodeAt(t));)t++;else return a=vn.UnexpectedEndOfNumber,n.substring(w,t);let v=t;if(t<n.length&&(n.charCodeAt(t)===ae.E||n.charCodeAt(t)===ae.e))if(t++,(t<n.length&&n.charCodeAt(t)===ae.plus||n.charCodeAt(t)===ae.minus)&&t++,t<n.length&&xl(n.charCodeAt(t))){for(t++;t<n.length&&xl(n.charCodeAt(t));)t++;v=t}else a=vn.UnexpectedEndOfNumber;return n.substring(w,v)}function d(){let w="",v=t;for(;;){if(t>=i){w+=n.substring(v,t),a=vn.UnexpectedEndOfString;break}const E=n.charCodeAt(t);if(E===ae.doubleQuote){w+=n.substring(v,t),t++;break}if(E===ae.backslash){if(w+=n.substring(v,t),t++,t>=i){a=vn.UnexpectedEndOfString;break}switch(n.charCodeAt(t++)){case ae.doubleQuote:w+='"';break;case ae.backslash:w+="\\";break;case ae.slash:w+="/";break;case ae.b:w+="\b";break;case ae.f:w+="\f";break;case ae.n:w+=`
|
|
101
101
|
`;break;case ae.r:w+="\r";break;case ae.t:w+=" ";break;case ae.u:{const A=l(4);A>=0?w+=String.fromCharCode(A):a=vn.InvalidUnicode;break}default:a=vn.InvalidEscapeCharacter}v=t;continue}if(E>=0&&E<=31)if(Pf(E)){w+=n.substring(v,t),a=vn.UnexpectedEndOfString;break}else a=vn.InvalidCharacter;t++}return w}function f(){if(s="",a=vn.None,r=t,t>=i)return r=i,o=ye.EOF;let w=n.charCodeAt(t);if(av(w)){do t++,s+=String.fromCharCode(w),w=n.charCodeAt(t);while(av(w));return o=ye.Trivia}if(Pf(w))return t++,s+=String.fromCharCode(w),w===ae.carriageReturn&&n.charCodeAt(t)===ae.lineFeed&&(t++,s+=`
|
|
102
102
|
`),o=ye.LineBreakTrivia;switch(w){case ae.openBrace:return t++,o=ye.OpenBraceToken;case ae.closeBrace:return t++,o=ye.CloseBraceToken;case ae.openBracket:return t++,o=ye.OpenBracketToken;case ae.closeBracket:return t++,o=ye.CloseBracketToken;case ae.colon:return t++,o=ye.ColonToken;case ae.comma:return t++,o=ye.CommaToken;case ae.doubleQuote:return t++,s=d(),o=ye.StringLiteral;case ae.slash:{const v=t-1;if(n.charCodeAt(t+1)===ae.slash){for(t+=2;t<i&&!Pf(n.charCodeAt(t));)t++;return s=n.substring(v,t),o=ye.LineCommentTrivia}if(n.charCodeAt(t+1)===ae.asterisk){t+=2;const E=i-1;let S=!1;for(;t<E;){if(n.charCodeAt(t)===ae.asterisk&&n.charCodeAt(t+1)===ae.slash){t+=2,S=!0;break}t++}return S||(t++,a=vn.UnexpectedEndOfComment),s=n.substring(v,t),o=ye.BlockCommentTrivia}return s+=String.fromCharCode(w),t++,o=ye.Unknown}case ae.minus:if(s+=String.fromCharCode(w),t++,t===i||!xl(n.charCodeAt(t)))return o=ye.Unknown;case ae._0:case ae._1:case ae._2:case ae._3:case ae._4:case ae._5:case ae._6:case ae._7:case ae._8:case ae._9:return s+=u(),o=ye.NumericLiteral;default:for(;t<i&&p(w);)t++,w=n.charCodeAt(t);if(r!==t){switch(s=n.substring(r,t),s){case"true":return o=ye.TrueKeyword;case"false":return o=ye.FalseKeyword;case"null":return o=ye.NullKeyword}return o=ye.Unknown}return s+=String.fromCharCode(w),t++,o=ye.Unknown}}function p(w){if(av(w)||Pf(w))return!1;switch(w){case ae.closeBrace:case ae.closeBracket:case ae.openBrace:case ae.openBracket:case ae.doubleQuote:case ae.colon:case ae.comma:case ae.slash:return!1}return!0}function _(){let w;do w=f();while(w>=ye.LineCommentTrivia&&w<=ye.Trivia);return w}return{setPosition:c,getPosition:()=>t,scan:e?_:f,getToken:()=>o,getTokenValue:()=>s,getTokenOffset:()=>r,getTokenLength:()=>t-r,getTokenError:()=>a}}function av(n){return n===ae.space||n===ae.tab||n===ae.verticalTab||n===ae.formFeed||n===ae.nonBreakingSpace||n===ae.ogham||n>=ae.enQuad&&n<=ae.zeroWidthSpace||n===ae.narrowNoBreakSpace||n===ae.mathematicalSpace||n===ae.ideographicSpace||n===ae.byteOrderMark}function Pf(n){return n===ae.lineFeed||n===ae.carriageReturn||n===ae.lineSeparator||n===ae.paragraphSeparator}function xl(n){return n>=ae._0&&n<=ae._9}var ae;(function(n){n[n.nullCharacter=0]="nullCharacter",n[n.maxAsciiCharacter=127]="maxAsciiCharacter",n[n.lineFeed=10]="lineFeed",n[n.carriageReturn=13]="carriageReturn",n[n.lineSeparator=8232]="lineSeparator",n[n.paragraphSeparator=8233]="paragraphSeparator",n[n.nextLine=133]="nextLine",n[n.space=32]="space",n[n.nonBreakingSpace=160]="nonBreakingSpace",n[n.enQuad=8192]="enQuad",n[n.emQuad=8193]="emQuad",n[n.enSpace=8194]="enSpace",n[n.emSpace=8195]="emSpace",n[n.threePerEmSpace=8196]="threePerEmSpace",n[n.fourPerEmSpace=8197]="fourPerEmSpace",n[n.sixPerEmSpace=8198]="sixPerEmSpace",n[n.figureSpace=8199]="figureSpace",n[n.punctuationSpace=8200]="punctuationSpace",n[n.thinSpace=8201]="thinSpace",n[n.hairSpace=8202]="hairSpace",n[n.zeroWidthSpace=8203]="zeroWidthSpace",n[n.narrowNoBreakSpace=8239]="narrowNoBreakSpace",n[n.ideographicSpace=12288]="ideographicSpace",n[n.mathematicalSpace=8287]="mathematicalSpace",n[n.ogham=5760]="ogham",n[n._=95]="_",n[n.$=36]="$",n[n._0=48]="_0",n[n._1=49]="_1",n[n._2=50]="_2",n[n._3=51]="_3",n[n._4=52]="_4",n[n._5=53]="_5",n[n._6=54]="_6",n[n._7=55]="_7",n[n._8=56]="_8",n[n._9=57]="_9",n[n.a=97]="a",n[n.b=98]="b",n[n.c=99]="c",n[n.d=100]="d",n[n.e=101]="e",n[n.f=102]="f",n[n.g=103]="g",n[n.h=104]="h",n[n.i=105]="i",n[n.j=106]="j",n[n.k=107]="k",n[n.l=108]="l",n[n.m=109]="m",n[n.n=110]="n",n[n.o=111]="o",n[n.p=112]="p",n[n.q=113]="q",n[n.r=114]="r",n[n.s=115]="s",n[n.t=116]="t",n[n.u=117]="u",n[n.v=118]="v",n[n.w=119]="w",n[n.x=120]="x",n[n.y=121]="y",n[n.z=122]="z",n[n.A=65]="A",n[n.B=66]="B",n[n.C=67]="C",n[n.D=68]="D",n[n.E=69]="E",n[n.F=70]="F",n[n.G=71]="G",n[n.H=72]="H",n[n.I=73]="I",n[n.J=74]="J",n[n.K=75]="K",n[n.L=76]="L",n[n.M=77]="M",n[n.N=78]="N",n[n.O=79]="O",n[n.P=80]="P",n[n.Q=81]="Q",n[n.R=82]="R",n[n.S=83]="S",n[n.T=84]="T",n[n.U=85]="U",n[n.V=86]="V",n[n.W=87]="W",n[n.X=88]="X",n[n.Y=89]="Y",n[n.Z=90]="Z",n[n.ampersand=38]="ampersand",n[n.asterisk=42]="asterisk",n[n.at=64]="at",n[n.backslash=92]="backslash",n[n.bar=124]="bar",n[n.caret=94]="caret",n[n.closeBrace=125]="closeBrace",n[n.closeBracket=93]="closeBracket",n[n.closeParen=41]="closeParen",n[n.colon=58]="colon",n[n.comma=44]="comma",n[n.dot=46]="dot",n[n.doubleQuote=34]="doubleQuote",n[n.equals=61]="equals",n[n.exclamation=33]="exclamation",n[n.greaterThan=62]="greaterThan",n[n.lessThan=60]="lessThan",n[n.minus=45]="minus",n[n.openBrace=123]="openBrace",n[n.openBracket=91]="openBracket",n[n.openParen=40]="openParen",n[n.percent=37]="percent",n[n.plus=43]="plus",n[n.question=63]="question",n[n.semicolon=59]="semicolon",n[n.singleQuote=39]="singleQuote",n[n.slash=47]="slash",n[n.tilde=126]="tilde",n[n.backspace=8]="backspace",n[n.formFeed=12]="formFeed",n[n.byteOrderMark=65279]="byteOrderMark",n[n.tab=9]="tab",n[n.verticalTab=11]="verticalTab"})(ae||(ae={}));function yN(n,e,t=Dy.DEFAULT){const i=bN(n,!1);function s(J){return J?()=>J(i.getTokenOffset(),i.getTokenLength()):()=>!0}function r(J){return J?de=>J(de,i.getTokenOffset(),i.getTokenLength()):()=>!0}const o=s(e.onObjectBegin),a=r(e.onObjectProperty),l=s(e.onObjectEnd),c=s(e.onArrayBegin),u=s(e.onArrayEnd),d=r(e.onLiteralValue),f=r(e.onSeparator),p=s(e.onComment),_=r(e.onError),w=t&&t.disallowComments,v=t&&t.allowTrailingComma;function E(){for(;;){const J=i.scan();switch(i.getTokenError()){case vn.InvalidUnicode:S(Rt.InvalidUnicode);break;case vn.InvalidEscapeCharacter:S(Rt.InvalidEscapeCharacter);break;case vn.UnexpectedEndOfNumber:S(Rt.UnexpectedEndOfNumber);break;case vn.UnexpectedEndOfComment:w||S(Rt.UnexpectedEndOfComment);break;case vn.UnexpectedEndOfString:S(Rt.UnexpectedEndOfString);break;case vn.InvalidCharacter:S(Rt.InvalidCharacter);break}switch(J){case ye.LineCommentTrivia:case ye.BlockCommentTrivia:w?S(Rt.InvalidCommentToken):p();break;case ye.Unknown:S(Rt.InvalidSymbol);break;case ye.Trivia:case ye.LineBreakTrivia:break;default:return J}}}function S(J,de=[],Ce=[]){if(_(J),de.length+Ce.length>0){let Ae=i.getToken();for(;Ae!==ye.EOF;){if(de.indexOf(Ae)!==-1){E();break}else if(Ce.indexOf(Ae)!==-1)break;Ae=E()}}}function A(J){const de=i.getTokenValue();return J?d(de):a(de),E(),!0}function G(){switch(i.getToken()){case ye.NumericLiteral:{let J=0;try{J=JSON.parse(i.getTokenValue()),typeof J!="number"&&(S(Rt.InvalidNumberFormat),J=0)}catch{S(Rt.InvalidNumberFormat)}d(J);break}case ye.NullKeyword:d(null);break;case ye.TrueKeyword:d(!0);break;case ye.FalseKeyword:d(!1);break;default:return!1}return E(),!0}function W(){return i.getToken()!==ye.StringLiteral?(S(Rt.PropertyNameExpected,[],[ye.CloseBraceToken,ye.CommaToken]),!1):(A(!1),i.getToken()===ye.ColonToken?(f(":"),E(),ne()||S(Rt.ValueExpected,[],[ye.CloseBraceToken,ye.CommaToken])):S(Rt.ColonExpected,[],[ye.CloseBraceToken,ye.CommaToken]),!0)}function ce(){o(),E();let J=!1;for(;i.getToken()!==ye.CloseBraceToken&&i.getToken()!==ye.EOF;){if(i.getToken()===ye.CommaToken){if(J||S(Rt.ValueExpected,[],[]),f(","),E(),i.getToken()===ye.CloseBraceToken&&v)break}else J&&S(Rt.CommaExpected,[],[]);W()||S(Rt.ValueExpected,[],[ye.CloseBraceToken,ye.CommaToken]),J=!0}return l(),i.getToken()!==ye.CloseBraceToken?S(Rt.CloseBraceExpected,[ye.CloseBraceToken],[]):E(),!0}function Q(){c(),E();let J=!1;for(;i.getToken()!==ye.CloseBracketToken&&i.getToken()!==ye.EOF;){if(i.getToken()===ye.CommaToken){if(J||S(Rt.ValueExpected,[],[]),f(","),E(),i.getToken()===ye.CloseBracketToken&&v)break}else J&&S(Rt.CommaExpected,[],[]);ne()||S(Rt.ValueExpected,[],[ye.CloseBracketToken,ye.CommaToken]),J=!0}return u(),i.getToken()!==ye.CloseBracketToken?S(Rt.CloseBracketExpected,[ye.CloseBracketToken],[]):E(),!0}function ne(){switch(i.getToken()){case ye.OpenBracketToken:return Q();case ye.OpenBraceToken:return ce();case ye.StringLiteral:return A(!0);default:return G()}}return E(),i.getToken()===ye.EOF?t.allowEmptyContent?!0:(S(Rt.ValueExpected,[],[]),!1):ne()?(i.getToken()!==ye.EOF&&S(Rt.EndOfFileExpected,[],[]),!0):(S(Rt.ValueExpected,[],[]),!1)}function Bu(n){return Object.isFrozen(n)?n:NC(n)}class Di{static createEmptyModel(e){return new Di({},[],[],void 0,e)}constructor(e,t,i,s,r){this._contents=e,this._keys=t,this._overrides=i,this.raw=s,this.logService=r,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(t=>{if(t instanceof Di)return t;const i=new xN("",this.logService);return i.parseRaw(t),i.configurationModel});this._rawConfiguration=e.reduce((t,i)=>i===t?i:t.merge(i),e[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?Zp(this.contents,e):this.contents}inspect(e,t){const i=this;return{get value(){return Bu(i.rawConfiguration.getValue(e))},get override(){return t?Bu(i.rawConfiguration.getOverrideValue(e,t)):void 0},get merged(){return Bu(t?i.rawConfiguration.override(t).getValue(e):i.rawConfiguration.getValue(e))},get overrides(){const s=[];for(const{contents:r,identifiers:o,keys:a}of i.rawConfiguration.overrides){const l=new Di(r,a,[],void 0,i.logService).getValue(e);l!==void 0&&s.push({identifiers:o,value:l})}return s.length?Bu(s):void 0}}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?Zp(i,e):i:void 0}getKeysForOverrideIdentifier(e){const t=[];for(const i of this.overrides)i.identifiers.includes(e)&&t.push(...i.keys);return Il(t)}getAllOverrideIdentifiers(){const e=[];for(const t of this.overrides)e.push(...t.identifiers);return Il(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){const t=wt(this.contents),i=wt(this.overrides),s=[...this.keys],r=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const o of e)if(r.push(...o.raw?Array.isArray(o.raw)?o.raw:[o.raw]:[o]),!o.isEmpty()){this.mergeContents(t,o.contents);for(const a of o.overrides){const[l]=i.filter(c=>Pi(c.identifiers,a.identifiers));l?(this.mergeContents(l.contents,a.contents),l.keys.push(...a.keys),l.keys=Il(l.keys)):i.push(wt(a))}for(const a of o.keys)s.indexOf(a)===-1&&s.push(a)}return new Di(t,s,i,!r.length||r.every(o=>o instanceof Di)?void 0:r,this.logService)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||typeof t!="object"||!Object.keys(t).length)return this;const i={};for(const s of Il([...Object.keys(this.contents),...Object.keys(t)])){let r=this.contents[s];const o=t[s];o&&(typeof r=="object"&&typeof o=="object"?(r=wt(r),this.mergeContents(r,o)):r=o),i[s]=r}return new Di(i,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(const i of Object.keys(t)){if(i in e&&nn(e[i])&&nn(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=wt(t[i])}}getContentsForOverrideIdentifer(e){let t=null,i=null;const s=r=>{r&&(i?this.mergeContents(i,r):i=wt(r))};for(const r of this.overrides)r.identifiers.length===1&&r.identifiers[0]===e?t=r.contents:r.identifiers.includes(e)&&s(r.contents);return s(t),i}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,t){this.updateValue(e,t,!0)}setValue(e,t){this.updateValue(e,t,!1)}removeValue(e){const t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),M9(this.contents,e),Hs.test(e)&&this.overrides.splice(this.overrides.findIndex(i=>Pi(i.identifiers,Wd(e))),1))}updateValue(e,t,i){if(DT(this.contents,e,t,s=>this.logService.error(s)),i=i||this.keys.indexOf(e)===-1,i&&this.keys.push(e),Hs.test(e)){const s=Wd(e),r={identifiers:s,keys:Object.keys(this.contents[e]),contents:bw(this.contents[e],a=>this.logService.error(a))},o=this.overrides.findIndex(a=>Pi(a.identifiers,s));o!==-1?this.overrides[o]=r:this.overrides.push(r)}}}class xN{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||Di.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!tn(e)){const i=this.doParseContent(e);this.parseRaw(i,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;const{contents:i,keys:s,overrides:r,restricted:o,hasExcludedProperties:a}=this.doParseRaw(e,t);this._configurationModel=new Di(i,s,r,a?[e]:void 0,this.logService),this._restrictedConfigurations=o||[]}doParseContent(e){let t={},i=null,s=[];const r=[];function o(l){Array.isArray(s)?s.push(l):i!==null&&(s[i]=l)}const a={onObjectBegin:()=>{const l={};o(l),r.push(s),s=l,i=null},onObjectProperty:l=>{i=l},onObjectEnd:()=>{s=r.pop()},onArrayBegin:()=>{const l=[];o(l),r.push(s),s=l,i=null},onArrayEnd:()=>{s=r.pop()},onLiteralValue:o,onError:(l,c,u)=>{}};if(e)try{yN(e,a),t=s[0]||{}}catch(l){this.logService.error(`Error while parsing settings file ${this._name}: ${l}`),this._parseErrors=[l]}return t}doParseRaw(e,t){const i=mn.as(ll.Configuration).getConfigurationProperties(),s=this.filter(e,i,!0,t);e=s.raw;const r=bw(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`)),o=Object.keys(e),a=this.toOverrides(e,l=>this.logService.error(`Conflict in settings file ${this._name}: ${l}`));return{contents:r,keys:o,overrides:a,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}filter(e,t,i,s){let r=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:r};const o={},a=[];for(const l in e)if(Hs.test(l)&&i){const c=this.filter(e[l],t,!1,s);o[l]=c.raw,r=r||c.hasExcludedProperties,a.push(...c.restricted)}else{const c=t[l];c?.restricted&&a.push(l),this.shouldInclude(l,c,s)?o[l]=e[l]:r=!0}return{raw:o,restricted:a,hasExcludedProperties:r}}shouldInclude(e,t,i){if(i.exclude?.includes(e))return!1;if(i.include?.includes(e))return!0;if(i.skipRestricted&&t?.restricted||i.skipUnregistered&&!t)return!1;const s=t?typeof t.scope<"u"?t.scope:bt.WINDOW:void 0;return s===void 0||i.scopes===void 0?!0:i.scopes.includes(s)}toOverrides(e,t){const i=[];for(const s of Object.keys(e))if(Hs.test(s)){const r={};for(const o in e[s])r[o]=e[s][o];i.push({identifiers:Wd(s),keys:Object.keys(r),contents:bw(r,t)})}return i}}class EN{constructor(e,t,i,s,r,o,a,l,c,u,d,f,p){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=s,this.defaultConfiguration=r,this.policyConfiguration=o,this.applicationConfiguration=a,this.userConfiguration=l,this.localUserConfiguration=c,this.remoteUserConfiguration=u,this.workspaceConfiguration=d,this.folderConfigurationModel=f,this.memoryConfigurationModel=p}get value(){return Bu(this._value)}toInspectValue(e){return e?.value!==void 0||e?.override!==void 0||e?.overrides!==void 0?e:void 0}get defaultInspectValue(){return this._defaultInspectValue||(this._defaultInspectValue=this.defaultConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._defaultInspectValue}get defaultValue(){return this.defaultInspectValue.merged}get default(){return this.toInspectValue(this.defaultInspectValue)}get policyInspectValue(){return this._policyInspectValue===void 0&&(this._policyInspectValue=this.policyConfiguration?this.policyConfiguration.inspect(this.key):null),this._policyInspectValue}get policyValue(){return this.policyInspectValue?.merged}get policy(){return this.policyInspectValue?.value!==void 0?{value:this.policyInspectValue.value}:void 0}get applicationInspectValue(){return this._applicationInspectValue===void 0&&(this._applicationInspectValue=this.applicationConfiguration?this.applicationConfiguration.inspect(this.key):null),this._applicationInspectValue}get applicationValue(){return this.applicationInspectValue?.merged}get application(){return this.toInspectValue(this.applicationInspectValue)}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.userConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get userValue(){return this.userInspectValue.merged}get user(){return this.toInspectValue(this.userInspectValue)}get userLocalInspectValue(){return this._userLocalInspectValue||(this._userLocalInspectValue=this.localUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userLocalInspectValue}get userLocalValue(){return this.userLocalInspectValue.merged}get userLocal(){return this.toInspectValue(this.userLocalInspectValue)}get userRemoteInspectValue(){return this._userRemoteInspectValue||(this._userRemoteInspectValue=this.remoteUserConfiguration.inspect(this.key,this.overrides.overrideIdentifier)),this._userRemoteInspectValue}get userRemoteValue(){return this.userRemoteInspectValue.merged}get userRemote(){return this.toInspectValue(this.userRemoteInspectValue)}get workspaceInspectValue(){return this._workspaceInspectValue===void 0&&(this._workspaceInspectValue=this.workspaceConfiguration?this.workspaceConfiguration.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceInspectValue}get workspaceValue(){return this.workspaceInspectValue?.merged}get workspace(){return this.toInspectValue(this.workspaceInspectValue)}get workspaceFolderInspectValue(){return this._workspaceFolderInspectValue===void 0&&(this._workspaceFolderInspectValue=this.folderConfigurationModel?this.folderConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier):null),this._workspaceFolderInspectValue}get workspaceFolderValue(){return this.workspaceFolderInspectValue?.merged}get workspaceFolder(){return this.toInspectValue(this.workspaceFolderInspectValue)}get memoryInspectValue(){return this._memoryInspectValue===void 0&&(this._memoryInspectValue=this.memoryConfigurationModel.inspect(this.key,this.overrides.overrideIdentifier)),this._memoryInspectValue}get memoryValue(){return this.memoryInspectValue.merged}get memory(){return this.toInspectValue(this.memoryInspectValue)}}let Iy=class CP{constructor(e,t,i,s,r,o,a,l,c,u){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=s,this._remoteUserConfiguration=r,this._workspaceConfiguration=o,this._folderConfigurations=a,this._memoryConfiguration=l,this._memoryConfigurationByResource=c,this.logService=u,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new on,this._userConfiguration=null}getValue(e,t,i){return this.getConsolidatedConfigurationModel(e,t,i).getValue(e)}updateValue(e,t,i={}){let s;i.resource?(s=this._memoryConfigurationByResource.get(i.resource),s||(s=Di.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(i.resource,s))):s=this._memoryConfiguration,t===void 0?s.removeValue(e):s.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const s=this.getConsolidatedConfigurationModel(e,t,i),r=this.getFolderConfigurationModelForResource(t.resource,i),o=t.resource?this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration:this._memoryConfiguration,a=new Set;for(const l of s.overrides)for(const c of l.identifiers)s.getOverrideValue(e,c)!==void 0&&a.add(c);return new EN(e,t,s.getValue(e),a.size?[...a]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,i?this._workspaceConfiguration:void 0,r||void 0,o)}keys(e){const t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this._workspaceConfiguration.keys.slice(0),workspaceFolder:t?t.keys.slice(0):[]}}updateDefaultConfiguration(e){this._defaultConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updatePolicyConfiguration(e){this._policyConfiguration=e}updateApplicationConfiguration(e){this._applicationConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateLocalUserConfiguration(e){this._localUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateRemoteUserConfiguration(e){this._remoteUserConfiguration=e,this._userConfiguration=null,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateWorkspaceConfiguration(e){this._workspaceConfiguration=e,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations.clear()}updateFolderConfiguration(e,t){this._folderConfigurations.set(e,t),this._foldersConsolidatedConfigurations.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this._foldersConsolidatedConfigurations.delete(e)}compareAndUpdateDefaultConfiguration(e,t){const i=[];if(!t){const{added:s,updated:r,removed:o}=zr(this._defaultConfiguration,e);t=[...s,...r,...o]}for(const s of t)for(const r of Wd(s)){const o=this._defaultConfiguration.getKeysForOverrideIdentifier(r),a=e.getKeysForOverrideIdentifier(r),l=[...a.filter(c=>o.indexOf(c)===-1),...o.filter(c=>a.indexOf(c)===-1),...o.filter(c=>!Gn(this._defaultConfiguration.override(r).getValue(c),e.override(r).getValue(c)))];i.push([r,l])}return this.updateDefaultConfiguration(e),{keys:t,overrides:i}}compareAndUpdatePolicyConfiguration(e){const{added:t,updated:i,removed:s}=zr(this._policyConfiguration,e),r=[...t,...i,...s];return r.length&&this.updatePolicyConfiguration(e),{keys:r,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:t,updated:i,removed:s,overrides:r}=zr(this.applicationConfiguration,e),o=[...t,...i,...s];return o.length&&this.updateApplicationConfiguration(e),{keys:o,overrides:r}}compareAndUpdateLocalUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:r}=zr(this.localUserConfiguration,e),o=[...t,...i,...s];return o.length&&this.updateLocalUserConfiguration(e),{keys:o,overrides:r}}compareAndUpdateRemoteUserConfiguration(e){const{added:t,updated:i,removed:s,overrides:r}=zr(this.remoteUserConfiguration,e),o=[...t,...i,...s];return o.length&&this.updateRemoteUserConfiguration(e),{keys:o,overrides:r}}compareAndUpdateWorkspaceConfiguration(e){const{added:t,updated:i,removed:s,overrides:r}=zr(this.workspaceConfiguration,e),o=[...t,...i,...s];return o.length&&this.updateWorkspaceConfiguration(e),{keys:o,overrides:r}}compareAndUpdateFolderConfiguration(e,t){const i=this.folderConfigurations.get(e),{added:s,updated:r,removed:o,overrides:a}=zr(i,t),l=[...s,...r,...o];return(l.length||!i)&&this.updateFolderConfiguration(e,t),{keys:l,overrides:a}}compareAndDeleteFolderConfiguration(e){const t=this.folderConfigurations.get(e);if(!t)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);const{added:i,updated:s,removed:r,overrides:o}=zr(t,void 0);return{keys:[...i,...s,...r],overrides:o}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{const e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new Di(e.contents,e.keys,e.overrides,void 0,this.logService)}return this._userConfiguration}get localUserConfiguration(){return this._localUserConfiguration}get remoteUserConfiguration(){return this._remoteUserConfiguration}get workspaceConfiguration(){return this._workspaceConfiguration}get folderConfigurations(){return this._folderConfigurations}getConsolidatedConfigurationModel(e,t,i){let s=this.getConsolidatedConfigurationModelForResource(t,i);if(t.overrideIdentifier&&(s=s.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){s=s.merge();for(const r of this._policyConfiguration.keys)s.setValue(r,this._policyConfiguration.getValue(r))}return s}getConsolidatedConfigurationModelForResource({resource:e},t){let i=this.getWorkspaceConsolidatedConfiguration();if(t&&e){const s=t.getFolder(e);s&&(i=this.getFolderConsolidatedConfiguration(s.uri)||i);const r=this._memoryConfigurationByResource.get(e);r&&(i=i.merge(r))}return i}getWorkspaceConsolidatedConfiguration(){return this._workspaceConsolidatedConfiguration||(this._workspaceConsolidatedConfiguration=this._defaultConfiguration.merge(this.applicationConfiguration,this.userConfiguration,this._workspaceConfiguration,this._memoryConfiguration)),this._workspaceConsolidatedConfiguration}getFolderConsolidatedConfiguration(e){let t=this._foldersConsolidatedConfigurations.get(e);if(!t){const i=this.getWorkspaceConsolidatedConfiguration(),s=this._folderConfigurations.get(e);s?(t=i.merge(s),this._foldersConsolidatedConfigurations.set(e,t)):t=i}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){const i=t.getFolder(e);if(i)return this._folderConfigurations.get(i.uri)}}toData(){return{defaults:{contents:this._defaultConfiguration.contents,overrides:this._defaultConfiguration.overrides,keys:this._defaultConfiguration.keys},policy:{contents:this._policyConfiguration.contents,overrides:this._policyConfiguration.overrides,keys:this._policyConfiguration.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this._workspaceConfiguration.contents,overrides:this._workspaceConfiguration.overrides,keys:this._workspaceConfiguration.keys},folders:[...this._folderConfigurations.keys()].reduce((e,t)=>{const{contents:i,overrides:s,keys:r}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:s,keys:r}]),e},[])}}allKeys(){const e=new Set;return this._defaultConfiguration.keys.forEach(t=>e.add(t)),this.userConfiguration.keys.forEach(t=>e.add(t)),this._workspaceConfiguration.keys.forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.keys.forEach(i=>e.add(i))),[...e.values()]}allOverrideIdentifiers(){const e=new Set;return this._defaultConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this.userConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._workspaceConfiguration.getAllOverrideIdentifiers().forEach(t=>e.add(t)),this._folderConfigurations.forEach(t=>t.getAllOverrideIdentifiers().forEach(i=>e.add(i))),[...e.values()]}getAllKeysForOverrideIdentifier(e){const t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(i=>t.add(i)),this._folderConfigurations.forEach(i=>i.getKeysForOverrideIdentifier(e).forEach(s=>t.add(s))),[...t.values()]}static parse(e,t){const i=this.parseConfigurationModel(e.defaults,t),s=this.parseConfigurationModel(e.policy,t),r=this.parseConfigurationModel(e.application,t),o=this.parseConfigurationModel(e.userLocal,t),a=this.parseConfigurationModel(e.userRemote,t),l=this.parseConfigurationModel(e.workspace,t),c=e.folders.reduce((u,d)=>(u.set(x.revive(d[0]),this.parseConfigurationModel(d[1],t)),u),new on);return new CP(i,s,r,o,a,l,c,Di.createEmptyModel(t),new on,t)}static parseConfigurationModel(e,t){return new Di(e.contents,e.keys,e.overrides,e.raw,t)}};class SN{constructor(e,t,i,s,r){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=s,this.logService=r,this._marker=`
|
|
103
103
|
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const o of e.keys)this.affectedKeys.add(o);for(const[,o]of e.overrides)for(const a of o)this.affectedKeys.add(a);this._affectsConfigStr=this._marker;for(const o of this.affectedKeys)this._affectsConfigStr+=o+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=Iy.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){const i=this._marker+e,s=this._affectsConfigStr.indexOf(i);if(s<0)return!1;const r=s+i.length;if(r>=this._affectsConfigStr.length)return!1;const o=this._affectsConfigStr.charCodeAt(r);if(o!==this._markerCode1&&o!==this._markerCode2)return!1;if(t){const a=this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,l=this.currentConfiguraiton.getValue(e,t,this.currentWorkspace);return!Gn(a,l)}return!0}}function zr(n,e){const{added:t,removed:i,updated:s}=FD(e?.rawConfiguration,n?.rawConfiguration),r=[],o=n?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const l=a.filter(c=>!o.includes(c));for(const c of l)r.push([c,e.getKeysForOverrideIdentifier(c)])}if(n){const l=o.filter(c=>!a.includes(c));for(const c of l)r.push([c,n.getKeysForOverrideIdentifier(c)])}if(e&&n){for(const l of o)if(a.includes(l)){const c=FD({contents:n.getOverrideValue(void 0,l)||{},keys:n.getKeysForOverrideIdentifier(l)},{contents:e.getOverrideValue(void 0,l)||{},keys:e.getKeysForOverrideIdentifier(l)});r.push([l,[...c.added,...c.removed,...c.updated]])}}return{added:t,removed:i,updated:s,overrides:r}}function FD(n,e){const t=n?e?n.keys.filter(r=>e.keys.indexOf(r)===-1):[...n.keys]:[],i=e?n?e.keys.filter(r=>n.keys.indexOf(r)===-1):[...e.keys]:[],s=[];if(n&&e){for(const r of e.keys)if(n.keys.indexOf(r)!==-1){const o=Zp(e.contents,r),a=Zp(n.contents,r);Gn(o,a)||s.push(r)}}return{added:t,removed:i,updated:s}}function Af(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 kN(n){return n instanceof x}function DN(n){return n&&n.uri instanceof x&&n.languageId&&typeof n.languageId=="string"}function IN(n){return n&&!n.uri&&n.languageId&&typeof n.languageId=="string"}function CN(n){return n&&n.uri instanceof x&&(!n.name||typeof n.name=="string")&&(!n.index||typeof n.index=="number")}function MD(n){if(kN(n))return{resource:n};if(DN(n))return{resource:n.uri,overrideIdentifier:n.languageId};if(IN(n))return{overrideIdentifier:n.languageId};if(CN(n))return{resource:n.uri};if(n===null)return{resource:null}}let Cy=class{constructor(e,t,i){this._proxy=e.getProxy(ee.MainThreadConfiguration),this._extHostWorkspace=t,this._logService=i,this._barrier=new As,this._actual=null}getConfigProvider(){return this._barrier.wait().then(e=>this._actual)}$initializeConfiguration(e){this._actual=new TN(this._proxy,this._extHostWorkspace,e,this._logService),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(i=>i.$acceptConfigurationChanged(e,t))}};Cy=V([L(0,nt),L(1,Mr),L(2,at)],Cy);class TN{constructor(e,t,i,s){this._onDidChangeConfiguration=new N,this._proxy=e,this._logService=s,this._extHostWorkspace=t,this._configuration=Iy.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=Iy.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,i))}getConfiguration(e,t,i){const s=MD(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?Zt.USER:Zt.WORKSPACE;switch(l){case cc.Global:return Zt.USER;case cc.Workspace:return Zt.WORKSPACE;case cc.WorkspaceFolder:return Zt.WORKSPACE_FOLDER}}const a={has(l){return typeof Af(r,l)<"u"},get:(l,c)=>{this._validateConfigurationAccess(e?`${e}.${l}`:l,s,i?.identifier);let u=Af(r,l);if(typeof u>"u")u=c;else{let d;const f=(p,_)=>{if(nn(p)){let w;const v=()=>{d=d||wt(r),w=w||Af(d,_)};return new Proxy(p,{get:(E,S)=>{if(typeof S=="string"&&S.toLowerCase()==="tojson")return v(),()=>w;if(d)return w=w||Af(d,_),w[S];const A=E[S];return typeof S=="string"?f(A,`${_}.${S}`):A},set:(E,S,A)=>(v(),w&&(w[S]=A),!0),deleteProperty:(E,S)=>(v(),w&&delete w[S],!0),defineProperty:(E,S,A)=>(v(),w&&Object.defineProperty(w,S,A),!0)})}return Array.isArray(p)?wt(p):p};u=f(u,l)}return u},update:(l,c,u,d)=>{l=e?`${e}.${l}`:l;const f=o(u);return c!==void 0?this._proxy.$updateConfigurationOption(f,l,c,s,d):this._proxy.$removeConfigurationOption(f,l,s,d)},inspect:l=>{l=e?`${e}.${l}`:l;const c=this._configuration.inspect(l,s,this._extHostWorkspace.workspace);if(c)return{key:l,defaultValue:wt(c.policy?.value??c.default?.value),globalLocalValue:wt(c.userLocal?.value),globalRemoteValue:wt(c.userRemote?.value),globalValue:wt(c.user?.value??c.application?.value),workspaceValue:wt(c.workspace?.value),workspaceFolderValue:wt(c.workspaceFolder?.value),defaultLanguageValue:wt(c.default?.override),globalLocalLanguageValue:wt(c.userLocal?.override),globalRemoteLanguageValue:wt(c.userRemote?.override),globalLanguageValue:wt(c.user?.override??c.application?.override),workspaceLanguageValue:wt(c.workspace?.override),workspaceFolderLanguageValue:wt(c.workspaceFolder?.override),languageIds:wt(c.overrideIdentifiers)}}};return typeof r=="object"&&qa(a,r,!1),Object.freeze(a)}_toReadonlyValue(e){const t=i=>nn(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=Hs.test(e)?bt.RESOURCE:this._configurationScopes.get(e),r=i?`[${i.value}] `:"";if(bt.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(bt.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 SN(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(s,r)=>i.affectsConfiguration(s,MD(r))})}_toMap(e){return e.reduce((t,i)=>(t.set(i[0],i[1]),t),new Map)}}const Ur=pe("IExtHostConfiguration");class PN{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}}class Aa extends Se{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 N),this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(RN),this._extensionsMap=new Lr,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=UD(this._extensionDescriptions,t),this._extensionDescriptions=this._extensionDescriptions.concat(e);const i=Aa._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=UD(this._extensionDescriptions,i.map(s=>s.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new PN(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 u=0;u<c.length;u++)if(!l.has(c[u]))return!1;return!0}getNodes(){return this._nodesArr}},i=new Lr;for(const a of e)if(i.set(a.identifier,a),a.extensionDependencies)for(const l of a.extensionDependencies)t.addArc(tt.toKey(a.identifier),tt.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 AN(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 AN{constructor(e,t){this.versionId=e,this.extensions=t}}var Yr;(function(n){n[n.Builtin=0]="Builtin",n[n.User=1]="User",n[n.Dev=2]="Dev"})(Yr||(Yr={}));function RN(n,e){const t=n.isBuiltin?Yr.Builtin:n.isUnderDevelopment?Yr.Dev:Yr.User,i=e.isBuiltin?Yr.Builtin:e.isUnderDevelopment?Yr.Dev:Yr.User;if(t!==i)return t-i;const s=ct.basename(n.extensionLocation.path),r=ct.basename(e.extensionLocation.path);return s<r?-1:s>r?1:0}function UD(n,e){const t=new nl(e);return n.filter(i=>!t.has(i.identifier))}const I1=class I1{constructor(e,t,i,s){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=i,this.activateResolvedTime=s}};I1.NONE=new I1(!1,-1,-1,-1);let cu=I1;class lv{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 cu(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 v_{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 LN extends v_{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,Se.None)}}class NN extends v_{constructor(){super(!1,null,cu.NONE,{activate:void 0,deactivate:void 0},void 0,Se.None)}}class jm extends v_{constructor(e){super(!0,e,cu.NONE,{activate:void 0,deactivate:void 0},void 0,Se.None)}}let Ty=class{constructor(e,t,i,s){this._logService=s,this._registry=e,this._globalRegistry=t,this._host=i,this._operations=new Lr,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 jm(r));return this._host.onExtensionActivationError(e.id,r,new Ak(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}'`),u=this._createAndSaveOperation(e,t.displayName,[],new jm(c));return this._host.onExtensionActivationError(t.identifier,c,new Ak(r)),u}return this._createAndSaveOperation(e,t.displayName,i,null)}_createAndSaveOperation(e,t,i,s){const r=new Py(e.id,t,e.reason,i,s,this._host,this._logService);return this._operations.set(e.id,r),r}_isHostExtension(e){return Aa.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){const t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};Ty=V([L(3,at)],Ty);let Py=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 As,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 jm(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 jm(t),this._isDisposed&&Vs(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)}}};Py=V([L(6,at)],Py);class TP{constructor(e,t){this._logService=t,this._onDidChangeStorage=new N,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(ee.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 hE=pe("IExtHostStorage");class PP{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 tl(()=>{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 Eo;return this._deferredPromises.set(e,s),this._scheduler.isScheduled()||this._scheduler.schedule(),s.p}dispose(){this._storageListener.dispose()}}class ON extends PP{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}}var bs;let Ay=bs=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new HR,this._proxy=e.getProxy(ee.MainThreadFileSystem);const i=this;this.value=Object.freeze({async stat(s){try{let r;const o=i._fileSystemProvider.get(s.scheme);return o?(await i._proxy.$ensureActivation(s.scheme),r=await o.impl.stat(s)):r=await i._proxy.$stat(s),{type:r.type,ctime:r.ctime,mtime:r.mtime,size:r.size,permissions:r.permissions===Oc.Readonly?1:void 0}}catch(r){bs._handleError(r)}},async readDirectory(s){try{const r=i._fileSystemProvider.get(s.scheme);return r?(await i._proxy.$ensureActivation(s.scheme),(await r.impl.readDirectory(s)).slice()):await i._proxy.$readdir(s)}catch(r){return bs._handleError(r)}},async createDirectory(s){try{const r=i._fileSystemProvider.get(s.scheme);return r&&!r.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(r.impl,r.extUri,s)):await i._proxy.$mkdir(s)}catch(r){return bs._handleError(r)}},async readFile(s){try{const r=i._fileSystemProvider.get(s.scheme);return r?(await i._proxy.$ensureActivation(s.scheme),(await r.impl.readFile(s)).slice()):(await i._proxy.$readFile(s)).buffer}catch(r){return bs._handleError(r)}},async writeFile(s,r){try{const o=i._fileSystemProvider.get(s.scheme);return o&&!o.isReadonly?(await i._proxy.$ensureActivation(s.scheme),await i.mkdirp(o.impl,o.extUri,o.extUri.dirname(s)),await i._writeQueue.queueFor(s,()=>Promise.resolve(o.impl.writeFile(s,r,{create:!0,overwrite:!0})))):await i._proxy.$writeFile(s,ue.wrap(r))}catch(o){return bs._handleError(o)}},async delete(s,r){try{const o=i._fileSystemProvider.get(s.scheme);return o&&!o.isReadonly&&!r?.useTrash?(await i._proxy.$ensureActivation(s.scheme),await o.impl.delete(s,{recursive:!1,...r})):await i._proxy.$delete(s,{recursive:!1,useTrash:!1,atomic:!1,...r})}catch(o){return bs._handleError(o)}},async rename(s,r,o){try{return await i._proxy.$rename(s,r,{overwrite:!1,...o})}catch(a){return bs._handleError(a)}},async copy(s,r,o){try{return await i._proxy.$copy(s,r,{overwrite:!1,...o})}catch(a){return bs._handleError(a)}},isWritableFileSystem(s){const r=t.getCapabilities(s);if(typeof r=="number")return!(r&ks.Readonly)}})}async mkdirp(e,t,i){const s=[];for(;!t.isEqual(i,t.dirname(i));)try{if(((await e.stat(i)).type&va.Directory)===0)throw cn.FileExists(`Unable to create folder '${i.scheme===le.file?i.fsPath:i.toString(!0)}' that already exists but is not a directory`);break}catch(r){if(Np(r)!==Fe.FileNotFound)throw r;s.push(t.basename(i)),i=t.dirname(i)}for(let r=s.length-1;r>=0;r--){i=t.joinPath(i,s[r]);try{await e.createDirectory(i)}catch(o){if(Np(o)!==Fe.FileExists)throw o}}}static _handleError(e){if(e instanceof cn)throw e;if(e instanceof J1)switch(e.code){case Fe.FileExists:throw cn.FileExists(e.message);case Fe.FileNotFound:throw cn.FileNotFound(e.message);case Fe.FileNotADirectory:throw cn.FileNotADirectory(e.message);case Fe.FileIsADirectory:throw cn.FileIsADirectory(e.message);case Fe.NoPermissions:throw cn.NoPermissions(e.message);case Fe.Unavailable:throw cn.Unavailable(e.message);default:throw new cn(e.message,e.name)}if(!(e instanceof Error))throw new cn(String(e));if(e.name==="ENOPRO"||e.message.includes("ENOPRO"))throw cn.Unavailable(e.message);switch(e.name){case Fe.FileExists:throw cn.FileExists(e.message);case Fe.FileNotFound:throw cn.FileNotFound(e.message);case Fe.FileNotADirectory:throw cn.FileNotADirectory(e.message);case Fe.FileIsADirectory:throw cn.FileIsADirectory(e.message);case Fe.NoPermissions:throw cn.NoPermissions(e.message);case Fe.Unavailable:throw cn.Unavailable(e.message);default:throw new cn(e.message,e.name)}}addFileSystemProvider(e,t,i){return this._fileSystemProvider.set(e,{impl:t,extUri:i?.isCaseSensitive?rt:SR,isReadonly:!!i?.isReadonly}),we(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??rt}};Ay=bs=V([L(0,nt),L(1,hu)],Ay);const w_=pe("IExtHostConsumerFileSystem"),fE=pe("IExtensionStoragePaths");let Ry=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 x.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(x.joinPath(t,"meta.json"),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:x.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 x.joinPath(this._value,e.identifier.value)}globalValue(e){return x.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};Ry=V([L(0,gn),L(1,at),L(2,w_)],Ry);const b_=pe("configurationService");var $D;(function(n){n.Http="http",n.Https="https"})($D||($D={}));var fa;(function(n){n.ConstantPrivate="constantPrivate",n.Private="private",n.Public="public"})(fa||(fa={}));var HD;(function(n){n[n.Notify=1]="Notify",n[n.OpenBrowser=2]="OpenBrowser",n[n.OpenPreview=3]="OpenPreview",n[n.Silent=4]="Silent",n[n.Ignore=5]="Ignore",n[n.OpenBrowserOnce=6]="OpenBrowserOnce"})(HD||(HD={}));function FN(n){if(n.scheme!=="http"&&n.scheme!=="https")return;const e=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(n.authority);if(e)return{address:e[1],port:+e[2]}}const Ly=["localhost","127.0.0.1","0:0:0:0:0:0:0:1","::1"];function BD(n){return Ly.indexOf(n)>=0}const Ny=["0.0.0.0","0:0:0:0:0:0:0:0","::"];function WD(n){return Ny.indexOf(n)>=0}class MN{constructor(e,t,i){this.remoteAddress=e,this.localAddress=t,this._dispose=i,this._onDispose=new N,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._dispose()}}let VD=class extends Se{constructor(e,t){super(),this.logService=e,this.configurationService=t,this._onTunnelOpened=new N,this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=new N,this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=new N,this.onAddedTunnelProvider=this._onAddedTunnelProvider.event,this._tunnels=new Map,this._canElevate=!1,this._canChangeProtocol=!0,this._privacyOptions=[],this._factoryInProgress=new Set}get hasTunnelProvider(){return!!this._tunnelProvider}get defaultTunnelHost(){const e=this.configurationService.getValue("remote.localPortHost");return!e||e==="localhost"?"127.0.0.1":"0.0.0.0"}setTunnelProvider(e){return this._tunnelProvider=e,e?(this._onAddedTunnelProvider.fire(),{dispose:()=>{this._tunnelProvider=void 0,this._canElevate=!1,this._privacyOptions=[]}}):(this._canElevate=!1,this._privacyOptions=[],this._onAddedTunnelProvider.fire(),{dispose:()=>{}})}setTunnelFeatures(e){this._canElevate=e.elevation,this._privacyOptions=e.privacyOptions,this._canChangeProtocol=e.protocol}get canChangeProtocol(){return this._canChangeProtocol}get canElevate(){return this._canElevate}get canChangePrivacy(){return this._privacyOptions.length>0}get privacyOptions(){return this._privacyOptions}get tunnels(){return this.getTunnels()}async getTunnels(){const e=[],t=Array.from(this._tunnels.values());for(const i of t){const s=Array.from(i.values());for(const r of s){const o=await r.value;o&&typeof o!="string"&&e.push(o)}}return e}async dispose(){super.dispose();for(const e of this._tunnels.values()){for(const{value:t}of e.values())await t.then(i=>typeof i!="string"?i?.dispose():void 0);e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,i,s,r){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:i,privacy:s,protocol:r,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(WD(e)||BD(e))&&(e=Ly[0]);const i=this.getTunnelFromMap(e,t);if(i)return++i.refcount,i.value}openTunnel(e,t,i,s,r,o=!1,a,l){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${i} on local port ${r}.`);const c=this._tunnelProvider??e;if(!c)return;if(t||(t="localhost"),s||(s=this.defaultTunnelHost),this._tunnelProvider&&this._factoryInProgress.has(i)){this.logService.debug("ForwardedPorts: (TunnelService) Another call to create a tunnel with the same address has occurred before the last one completed. This call will be ignored.");return}const u=this.retainOrCreateTunnel(c,t,i,s,r,o,a,l);return u?u.then(d=>{if(d){if(typeof d=="string")return this.logService.trace("ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel."),this.removeEmptyOrErrorTunnelFromMap(t,i),d}else{this.logService.trace("ForwardedPorts: (TunnelService) New tunnel is undefined."),this.removeEmptyOrErrorTunnelFromMap(t,i);return}this.logService.trace("ForwardedPorts: (TunnelService) New tunnel established.");const f=this.makeTunnel(d);return(d.tunnelRemoteHost!==t||d.tunnelRemotePort!==i)&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch."),a&&d.privacy!==a&&this.logService.warn("ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch."),this._onTunnelOpened.fire(f),f}):(this.logService.trace("ForwardedPorts: (TunnelService) Tunnel was not created."),u)}makeTunnel(e){return{tunnelRemotePort:e.tunnelRemotePort,tunnelRemoteHost:e.tunnelRemoteHost,tunnelLocalPort:e.tunnelLocalPort,localAddress:e.localAddress,privacy:e.privacy,protocol:e.protocol,dispose:async()=>{this.logService.trace(`ForwardedPorts: (TunnelService) dispose request for ${e.tunnelRemoteHost}:${e.tunnelRemotePort} `);const t=this._tunnels.get(e.tunnelRemoteHost);if(t){const i=t.get(e.tunnelRemotePort);i&&(i.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,i))}}}}async tryDisposeTunnel(e,t,i){if(i.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);const s=i.value.then(async r=>{r&&typeof r!="string"&&(await r.dispose(!0),this._onTunnelClosed.fire({host:r.tunnelRemoteHost,port:r.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),s}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);const i=this._tunnels.get(e);if(i&&i.has(t)){const s=i.get(t);s.refcount=0,await this.tryDisposeTunnel(e,t,s)}}addTunnelToMap(e,t,i){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:i})}async removeEmptyOrErrorTunnelFromMap(e,t){const i=this._tunnels.get(e);if(i){const s=i.get(t),r=s?await s.value:void 0;(!r||typeof r=="string")&&i.delete(t),i.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){const i=[e];BD(e)?(i.push(...Ly),i.push(...Ny)):WD(e)&&i.push(...Ny);const s=i.map(r=>this._tunnels.get(r));for(const r of s){const o=r?.get(t);if(o)return o}}canTunnel(e){return!!FN(e)}createWithProvider(e,t,i,s,r,o,a){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${i} on local port ${s}.`);const l=i;this._factoryInProgress.add(l);const c=s===void 0?i:s,u={elevationRequired:r?this.isPortPrivileged(c):!1},d={remoteAddress:{host:t,port:i},localAddressPort:s,privacy:o,public:o?o!==fa.Private:void 0,protocol:a},f=e.forwardPort(d,u);return f?(this.addTunnelToMap(t,i,f),f.finally(()=>{this.logService.trace("ForwardedPorts: (TunnelService) Tunnel created by provider."),this._factoryInProgress.delete(l)})):this._factoryInProgress.delete(l),f}};VD=V([L(0,at),L(1,b_)],VD);class UN extends MN{}var Oy;(function(n){function e(i){return{remoteAddress:i.remoteAddress,localAddress:i.localAddress,public:!!i.public,privacy:i.privacy??(i.public?fa.Public:fa.Private),protocol:i.protocol}}n.fromApiTunnel=e;function t(i){return{remoteAddress:{host:i.tunnelRemoteHost,port:i.tunnelRemotePort},localAddress:i.localAddress,public:i.privacy!==fa.ConstantPrivate&&i.privacy!==fa.ConstantPrivate,privacy:i.privacy,protocol:i.protocol}}n.fromServiceTunnel=t})(Oy||(Oy={}));const pE=pe("IExtHostTunnelService");let Fy=class extends Se{constructor(e,t,i){super(),this.logService=i,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=new N,this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(ee.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 UN(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 je(()=>{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 u=>{let d;try{d=await c.provider.providePortAttributes({port:u,pid:i,commandLine:s},r)}catch{d=await c.provider.providePortAttributes(u,i,s,r)}return{providedAttributes:d,port:u}})))}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,yt.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(we(()=>{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:h(2595,"Private"),themeIcon:"lock"},{id:"public",label:h(2596,"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 we(()=>{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}),Oy.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}};Fy=V([L(0,nt),L(1,gn),L(2,at)],Fy);function $N(n){return[...n.entries()]}function HN(n){return n?[...n.entries()]:[]}var zD;(function(n){n.AutomationProfile="terminal.integrated.automationProfile.",n.DefaultProfile="terminal.integrated.defaultProfile.",n.Profiles="terminal.integrated.profiles."})(zD||(zD={}));var qD;(function(n){n.SendKeybindingsToShell="terminal.integrated.sendKeybindingsToShell",n.AutomationProfileLinux="terminal.integrated.automationProfile.linux",n.AutomationProfileMacOs="terminal.integrated.automationProfile.osx",n.AutomationProfileWindows="terminal.integrated.automationProfile.windows",n.ProfilesWindows="terminal.integrated.profiles.windows",n.ProfilesMacOs="terminal.integrated.profiles.osx",n.ProfilesLinux="terminal.integrated.profiles.linux",n.DefaultProfileLinux="terminal.integrated.defaultProfile.linux",n.DefaultProfileMacOs="terminal.integrated.defaultProfile.osx",n.DefaultProfileWindows="terminal.integrated.defaultProfile.windows",n.UseWslProfiles="terminal.integrated.useWslProfiles",n.TabsDefaultColor="terminal.integrated.tabs.defaultColor",n.TabsDefaultIcon="terminal.integrated.tabs.defaultIcon",n.TabsEnabled="terminal.integrated.tabs.enabled",n.TabsEnableAnimation="terminal.integrated.tabs.enableAnimation",n.TabsHideCondition="terminal.integrated.tabs.hideCondition",n.TabsShowActiveTerminal="terminal.integrated.tabs.showActiveTerminal",n.TabsShowActions="terminal.integrated.tabs.showActions",n.TabsLocation="terminal.integrated.tabs.location",n.TabsFocusMode="terminal.integrated.tabs.focusMode",n.MacOptionIsMeta="terminal.integrated.macOptionIsMeta",n.MacOptionClickForcesSelection="terminal.integrated.macOptionClickForcesSelection",n.AltClickMovesCursor="terminal.integrated.altClickMovesCursor",n.CopyOnSelection="terminal.integrated.copyOnSelection",n.EnableMultiLinePasteWarning="terminal.integrated.enableMultiLinePasteWarning",n.DrawBoldTextInBrightColors="terminal.integrated.drawBoldTextInBrightColors",n.FontFamily="terminal.integrated.fontFamily",n.FontSize="terminal.integrated.fontSize",n.LetterSpacing="terminal.integrated.letterSpacing",n.LineHeight="terminal.integrated.lineHeight",n.MinimumContrastRatio="terminal.integrated.minimumContrastRatio",n.TabStopWidth="terminal.integrated.tabStopWidth",n.FastScrollSensitivity="terminal.integrated.fastScrollSensitivity",n.MouseWheelScrollSensitivity="terminal.integrated.mouseWheelScrollSensitivity",n.BellDuration="terminal.integrated.bellDuration",n.FontWeight="terminal.integrated.fontWeight",n.FontWeightBold="terminal.integrated.fontWeightBold",n.CursorBlinking="terminal.integrated.cursorBlinking",n.CursorStyle="terminal.integrated.cursorStyle",n.CursorStyleInactive="terminal.integrated.cursorStyleInactive",n.CursorWidth="terminal.integrated.cursorWidth",n.Scrollback="terminal.integrated.scrollback",n.DetectLocale="terminal.integrated.detectLocale",n.DefaultLocation="terminal.integrated.defaultLocation",n.GpuAcceleration="terminal.integrated.gpuAcceleration",n.TerminalTitleSeparator="terminal.integrated.tabs.separator",n.TerminalTitle="terminal.integrated.tabs.title",n.TerminalDescription="terminal.integrated.tabs.description",n.RightClickBehavior="terminal.integrated.rightClickBehavior",n.MiddleClickBehavior="terminal.integrated.middleClickBehavior",n.Cwd="terminal.integrated.cwd",n.ConfirmOnExit="terminal.integrated.confirmOnExit",n.ConfirmOnKill="terminal.integrated.confirmOnKill",n.EnableBell="terminal.integrated.enableBell",n.EnableVisualBell="terminal.integrated.enableVisualBell",n.CommandsToSkipShell="terminal.integrated.commandsToSkipShell",n.AllowChords="terminal.integrated.allowChords",n.AllowMnemonics="terminal.integrated.allowMnemonics",n.TabFocusMode="terminal.integrated.tabFocusMode",n.EnvMacOs="terminal.integrated.env.osx",n.EnvLinux="terminal.integrated.env.linux",n.EnvWindows="terminal.integrated.env.windows",n.EnvironmentChangesIndicator="terminal.integrated.environmentChangesIndicator",n.EnvironmentChangesRelaunch="terminal.integrated.environmentChangesRelaunch",n.ShowExitAlert="terminal.integrated.showExitAlert",n.SplitCwd="terminal.integrated.splitCwd",n.WindowsEnableConpty="terminal.integrated.windowsEnableConpty",n.WindowsUseConptyDll="terminal.integrated.windowsUseConptyDll",n.WordSeparators="terminal.integrated.wordSeparators",n.EnableFileLinks="terminal.integrated.enableFileLinks",n.AllowedLinkSchemes="terminal.integrated.allowedLinkSchemes",n.UnicodeVersion="terminal.integrated.unicodeVersion",n.EnablePersistentSessions="terminal.integrated.enablePersistentSessions",n.PersistentSessionReviveProcess="terminal.integrated.persistentSessionReviveProcess",n.HideOnStartup="terminal.integrated.hideOnStartup",n.HideOnLastClosed="terminal.integrated.hideOnLastClosed",n.CustomGlyphs="terminal.integrated.customGlyphs",n.RescaleOverlappingGlyphs="terminal.integrated.rescaleOverlappingGlyphs",n.PersistentSessionScrollback="terminal.integrated.persistentSessionScrollback",n.InheritEnv="terminal.integrated.inheritEnv",n.ShowLinkHover="terminal.integrated.showLinkHover",n.IgnoreProcessNames="terminal.integrated.ignoreProcessNames",n.ShellIntegrationEnabled="terminal.integrated.shellIntegration.enabled",n.ShellIntegrationShowWelcome="terminal.integrated.shellIntegration.showWelcome",n.ShellIntegrationDecorationsEnabled="terminal.integrated.shellIntegration.decorationsEnabled",n.ShellIntegrationEnvironmentReporting="terminal.integrated.shellIntegration.environmentReporting",n.EnableImages="terminal.integrated.enableImages",n.SmoothScrolling="terminal.integrated.smoothScrolling",n.IgnoreBracketedPasteMode="terminal.integrated.ignoreBracketedPasteMode",n.FocusAfterRun="terminal.integrated.focusAfterRun",n.FontLigaturesEnabled="terminal.integrated.fontLigatures.enabled",n.FontLigaturesFeatureSettings="terminal.integrated.fontLigatures.featureSettings",n.FontLigaturesFallbackLigatures="terminal.integrated.fontLigatures.fallbackLigatures",n.DeveloperPtyHostLatency="terminal.integrated.developer.ptyHost.latency",n.DeveloperPtyHostStartupDelay="terminal.integrated.developer.ptyHost.startupDelay",n.DevMode="terminal.integrated.developer.devMode"})(qD||(qD={}));var jD;(function(n){n.Bash="bash",n.Fish="fish",n.Sh="sh",n.Csh="csh",n.Ksh="ksh",n.Zsh="zsh"})(jD||(jD={}));var GD;(function(n){n.CommandPrompt="cmd",n.Wsl="wsl",n.GitBash="gitbash"})(GD||(GD={}));var KD;(function(n){n.PowerShell="pwsh",n.Python="python",n.Julia="julia",n.NuShell="nu",n.Node="node"})(KD||(KD={}));var QD;(function(n){n[n.Api=0]="Api",n[n.Process=1]="Process",n[n.Sequence=2]="Sequence",n[n.Config=3]="Config"})(QD||(QD={}));var JD;(function(n){n.LocalPty="localPty",n.PtyHost="ptyHost",n.PtyHostWindow="ptyHostWindow",n.Logger="logger",n.Heartbeat="heartbeat"})(JD||(JD={}));var uu;(function(n){n.Cwd="cwd",n.InitialCwd="initialCwd",n.FixedDimensions="fixedDimensions",n.Title="title",n.ShellType="shellType",n.HasChildProcesses="hasChildProcesses",n.ResolvedShellLaunchConfig="resolvedShellLaunchConfig",n.OverrideDimensions="overrideDimensions",n.FailedShellIntegrationActivation="failedShellIntegrationActivation",n.UsedShellIntegrationInjection="usedShellIntegrationInjection",n.ShellIntegrationInjectionFailureReason="shellIntegrationInjectionFailureReason"})(uu||(uu={}));var XD;(function(n){n[n.BeatInterval=5e3]="BeatInterval",n[n.ConnectingBeatInterval=2e4]="ConnectingBeatInterval",n[n.FirstWaitMultiplier=1.2]="FirstWaitMultiplier",n[n.SecondWaitMultiplier=1]="SecondWaitMultiplier",n[n.CreateProcessTimeout=5e3]="CreateProcessTimeout"})(XD||(XD={}));var YD;(function(n){n[n.Panel=1]="Panel",n[n.Editor=2]="Editor"})(YD||(YD={}));var ZD;(function(n){n.TerminalView="view",n.Editor="editor"})(ZD||(ZD={}));var eI;(function(n){n[n.GraceTime=6e4]="GraceTime",n[n.ShortGraceTime=6e3]="ShortGraceTime"})(eI||(eI={}));var tI;(function(n){n[n.HighWatermarkChars=1e5]="HighWatermarkChars",n[n.LowWatermarkChars=5e3]="LowWatermarkChars",n[n.CharCountAckSize=5e3]="CharCountAckSize"})(tI||(tI={}));var nI;(function(n){n.GitBash="Git Bash",n.Pwsh="PowerShell"})(nI||(nI={}));var iI;(function(n){n[n.Off=0]="Off",n[n.FinalTerm=1]="FinalTerm",n[n.VSCode=2]="VSCode"})(iI||(iI={}));var sI;(function(n){n.InjectionSettingDisabled="injectionSettingDisabled",n.NoExecutable="noExecutable",n.FeatureTerminal="featureTerminal",n.IgnoreShellIntegrationFlag="ignoreShellIntegrationFlag",n.Winpty="winpty",n.UnsupportedArgs="unsupportedArgs",n.UnsupportedShell="unsupportedShell",n.FailedToSetStickyBit="failedToSetStickyBit",n.FailedToCreateTmpDir="failedToCreateTmpDir"})(sI||(sI={}));var rI;(function(n){n[n.Unknown=0]="Unknown",n[n.Shutdown=1]="Shutdown",n[n.Process=2]="Process",n[n.User=3]="User",n[n.Extension=4]="Extension"})(rI||(rI={}));const BN={Backend:"workbench.contributions.terminal.processBackend"};function My(n){return n?.toLowerCase()??""}class WN{constructor(e){this.remoteAuthority=e}affects(e){return My(e)===this.remoteAuthority}}class VN{constructor(){this._backends=new Map,this._onDidChangeBackends=new N,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){const t=My(e.remoteAuthority);if(this._backends.has(t))throw new Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e),this._onDidChangeBackends.fire(new WN(t))}getTerminalBackend(e){return this._backends.get(My(e))}}mn.add(BN.Backend,new VN);class zN{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 Fo=(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))}}}},El=(n,e)=>n===e,qr={range:(n,e)=>n===e?!0:!n||!e?!1:n.isEqual(e),label:El,description:El,sortText:El,busy:El,error:El,canResolveChildren:El,tags:(n,e)=>!(n.length!==e.length||n.some(t=>!e.find(i=>t.id===i.id)))},Sl=n=>e=>({op:xn.SetProp,update:n(e)}),qN=(n,e)=>({range:(()=>{let t;const i=Sl(s=>({range:et.lift(z.from(s))}));return{enumerable:!0,configurable:!1,get(){return t},set(s){n.listener?.({op:xn.DocumentSynced}),qr.range(t,s)||(t=s,n.listener?.(i(s)))}}})(),label:Fo(n,e,qr.label,Sl(t=>({label:t}))),description:Fo(n,void 0,qr.description,Sl(t=>({description:t}))),sortText:Fo(n,void 0,qr.sortText,Sl(t=>({sortText:t}))),canResolveChildren:Fo(n,!1,qr.canResolveChildren,t=>({op:xn.UpdateCanResolveChildren,state:t})),busy:Fo(n,!1,qr.busy,Sl(t=>({busy:t}))),error:Fo(n,void 0,qr.error,Sl(t=>({error:Re.fromStrict(t)||null}))),tags:Fo(n,[],qr.tags,(t,i)=>({op:xn.SetTags,new:t.map(fs.from),old:i.map(fs.from)}))}),jN=n=>{const e=Oe.fromString(n.extId),t=new cl(e.controllerId,e.localId,n.label,x.revive(n.uri)||void 0);return t.range=z.to(n.range||void 0),t.description=n.description||void 0,t.sortText=n.sortText||void 0,t.tags=n.tags.map(i=>fs.to({id:MT(i).tagId})),t},oI=n=>{let e;for(const t of n.tests){const i=jN(t.item);l_(i).parent=e,e=i}return e};class cl{constructor(e,t,i,s){if(t.includes(xi.Delimiter))throw new Error(`Test IDs may not include the ${JSON.stringify(t)} symbol`);const r=o3(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 gE?void 0:r.parent}},children:{value:r3(r,l_,cl),enumerable:!0,writable:!1},...qN(r,i)})}}class gE extends cl{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}}class GN extends n3{constructor(e,t,i){super({controllerId:e,getDocumentVersion:s=>s&&i.getDocument(s)?.version,getApiFor:l_,getChildren:s=>s.children,root:new gE(e,t),toITestItem:Co.from})}}let Uy=class extends Se{constructor(e,t,i){super(),this.initData=t,this._onDidChangeTelemetryEnabled=this._register(new N),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new N),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=ro.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:h(2592,"Extension Telemetry{0}",this._inLoggingOnlyMode?" (Not Sent)":""),hidden:!0,group:R6}))}getTelemetryConfiguration(){return this._level===ro.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=ro.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=ro.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=ro.USAGE:!1}}instantiateLogger(e,t,i){const s=this.getTelemetryDetails(),r=new AP(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.isnewappinstall"]=RP(this.initData.telemetryInfo.firstSessionDate),t["common.product"]=this.initData.environment.appHost,this.initData.uiKind){case Td.Web:t["common.uikind"]="web";break;case Td.Desktop:t["common.uikind"]="desktop";break;default:t["common.uikind"]="unknown"}return t["common.remotename"]=Px(N6(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}};Uy=V([L(1,gn),L(2,Po)],Uy);class AP{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 N,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=Pk(t,[]),this._additionalCommonProperties&&(t=qa(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=qa(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=Pk(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 RP(n){const e=Date.now()-new Date(n).getTime();return isNaN(e)?!1:e<1e3*60*60*24}const y_=pe("IExtHostTelemetry");let $y=class{#e;#t;#n;constructor(e,t,i){this._commands=new Map,this._apiCommands=new Map,this.#e=e.getProxy(ee.MainThreadCommands),this._logService=t,this.#n=i,this.#t=e.getProxy(ee.MainThreadTelemetry),this.converter=new KN(this,s=>{const r=this._apiCommands.get(s);return r?.result===ke.Void?r:void 0},t),this._argumentProcessors=[{processArgument(s){return an(s)}},{processArgument(s){return Nc(s,function(r){if(et.isIRange(r))return z.to(r);if(Ti.isIPosition(r))return ot.to(r);if(et.isIRange(r.range)&&x.isUri(r.uri))return oi.to(r);if(r instanceof ue)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 je(()=>{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 je(()=>{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=Nc(t,function(o){if(o instanceof qe)return ot.from(o);if(o instanceof Me)return z.from(o);if(o instanceof Ni)return oi.from(o);if(as.isNotebookRange(o))return Ws.from(o);if(o instanceof ArrayBuffer)return s=!0,ue.wrap(new Uint8Array(o));if(o instanceof Uint8Array)return s=!0,ue.wrap(o);if(o instanceof ue)return s=!0,o;if(!Array.isArray(o))return o});try{const o=await this.#e.$executeCommand(e,s?new jn(r):r,i);return an(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{K4(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=Rr.create();try{return await r.apply(o,t)}catch(c){if(e===this.converter.delegatingCommandId){const u=this.converter.getActualCommand(...t);u&&(e=u.command)}if(Vs(c)||this._logService.error(c,e,s.extension?.identifier),!i)throw c;if(s.extension?.identifier){const u=this.#n.onExtensionError(s.extension.identifier,c);this._logService.trace("forwarded error to extension?",u,s.extension?.identifier)}throw new class extends Error{constructor(){super(gu(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&&this.#t.$publicLog2("Extension:ActionExecuted",{extensionId:e.extension.identifier.value,id:new Kx(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)}};$y=V([L(0,nt),L(1,at),L(2,y_)],$y);const ul=pe("IExtHostCommands");class KN{constructor(e,t,i){this._commands=e,this._lookupApiCommand=t,this._logService=i,this.delegatingCommandId=`__vsc${Sn()}`,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(Kh(e.arguments)){const r=`${e.command} /${++this._cachIdPool}`;this._cache.set(r,e),t.add(we(()=>{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 Ot=class Ot{static Arr(e){return new Ot(`${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 Ot(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 Ot(e??this.name,t??this.description,this.validate,this.convert)}};Ot.Uri=new Ot("uri","Uri of a text document",e=>x.isUri(e),e=>e),Ot.Position=new Ot("position","A position in a text document",e=>qe.isPosition(e),ot.from),Ot.Range=new Ot("range","A range in a text document",e=>Me.isRange(e),z.from),Ot.Selection=new Ot("selection","A selection in a text document",e=>Nr.isSelection(e),hs.from),Ot.Number=new Ot("number","",e=>typeof e=="number",e=>e),Ot.String=new Ot("string","",e=>typeof e=="string",e=>e),Ot.CallHierarchyItem=new Ot("item","A call hierarchy item",e=>e instanceof Yx,Za.from),Ot.TypeHierarchyItem=new Ot("item","A type hierarchy item",e=>e instanceof tE,Ia.from),Ot.TestItem=new Ot("testItem","A VS Code TestItem",e=>e instanceof cl,Co.from),Ot.TestProfile=new Ot("testProfile","A VS Code test profile",e=>e instanceof XT,sy.from);let j=Ot;const C1=class C1{constructor(e,t){this.description=e,this.convert=t}};C1.Void=new C1("no result",e=>e);let ke=C1;class Te{constructor(e,t,i,s,r){this.id=e,this.internalId=t,this.description=i,this.args=s,this.result=r}}const _u=pe("IExtHostTerminalService");class aI extends Se{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 N),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:LP(e.iconPath)??void 0,color:Fc.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:Fc.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:hn.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 cv{get onProcessReady(){return this._onProcessReady.event}constructor(e){this._pty=e,this.id=0,this.shouldPersist=!1,this._onProcessData=new N,this.onProcessData=this._onProcessData.event,this._onProcessReady=new N,this._onDidChangeProperty=new N,this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=new N,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)}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:uu.OverrideDimensions,value:{cols:t.columns,rows:t.rows}})}),this._pty.onDidChangeName?.(t=>{this._onDidChangeProperty.fire({type:uu.Title,value:t})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:"",windowsPty:void 0})}}let QN=1,Hy=class extends Se{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 ao),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 N,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this._onDidOpenTerminal=new N,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this._onDidChangeActiveTerminal=new N,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this._onDidChangeTerminalDimensions=new N,this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event,this._onDidChangeTerminalState=new N,this.onDidChangeTerminalState=this._onDidChangeTerminalState.event,this._onDidChangeShell=new N,this.onDidChangeShell=this._onDidChangeShell.event,this._onDidWriteTerminalData=new N({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()}),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidExecuteCommand=new N({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()}),this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event,this._proxy=i.getProxy(ee.MainThreadTerminalService),this._bufferer=new zN(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 st.TerminalContext:return r(s);default:{if(Array.isArray(s))for(let o=0;o<s.length&&s[o].$mid===st.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 aI(this._proxy,Sn(),e,e.name),s=new cv(e.pty);return i.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,LP(e.iconPath),XN(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 cv(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:x.revive(s.cwd),env:s.env,hideFromUser:s.hideFromUser},o=new aI(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:h(2593,"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 xe;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 cv&&(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:uu.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:uu.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 je(()=>{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 je(()=>{this._completionProviders.delete(t.id),this._proxy.$unregisterCompletionProvider(t.id)})}async $provideTerminalCompletions(e,t){const i=new Nt().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 fy.from(r)}$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 je(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){const i=new Nt().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 xe;if(this._lastQuickFixCommands.value=o,!Array.isArray(r))return r?Hm.from(r,this._extHostCommands.converter,o):void 0;const a=[];for(const l of r){const c=Hm.from(l,this._extHostCommands.converter,o);c&&a.push(c)}return a}async $createContributedProfileTerminal(e,t){const i=new Nt().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 je(()=>{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 Nt;this._terminalLinkCancellationSource.set(e,r);const o=[],a={terminal:i.value,line:t},l=[];for(const d of this._linkProviders)l.push(Lc.withAsyncBody(async f=>{r.token.onCancellationRequested(()=>f({provider:d,links:[]}));const p=await d.provideTerminalLinks(a,r.token)||[];r.token.isCancellationRequested||f({provider:d,links:p})}));const c=await Promise.all(l);if(r.token.isCancellationRequested)return[];const u=new Map;for(const d of c)d&&d.links.length>0&&o.push(...d.links.map(f=>{const p={id:QN++,startIndex:f.startIndex,length:f.length,label:f.tooltip};return u.set(p.id,{provider:d.provider,link:f}),p}));return this._terminalLinkCache.set(e,u),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 lI),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){const i=$N(t.map),s=HN(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 lI(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)}))}};Hy=V([L(1,ul),L(2,nt)],Hy);class lI extends Se{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 N,this.map=new Map(e)}getScopedEnvironmentVariableCollection(e){const t=this.getScopeKey(e);let i=this.scopedCollections.get(t);return i||(i=new JN(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:ic.Replace,options:i??{applyAtProcessCreation:!0},scope:s})}append(e,t,i,s){this._setIfDiffers(e,{value:t,type:ic.Append,options:i??{applyAtProcessCreation:!0},scope:s})}prepend(e,t,i,s){this._setIfDiffers(e,{value:t,type:ic.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?cI(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,cI(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(`
|
|
@@ -112,7 +112,7 @@ Its package.json#enabledApiProposals-property declares: ${n.enabledApiProposals?
|
|
|
112
112
|
`)}})}}class OF{constructor(e){this.trackers=e}onWillStartSession(){this.trackers.forEach(e=>e.onWillStartSession?e.onWillStartSession():void 0)}onWillReceiveMessage(e){this.trackers.forEach(t=>t.onWillReceiveMessage?t.onWillReceiveMessage(e):void 0)}onDidSendMessage(e){this.trackers.forEach(t=>t.onDidSendMessage?t.onDidSendMessage(e):void 0)}onWillStopSession(){this.trackers.forEach(e=>e.onWillStopSession?e.onWillStopSession():void 0)}onError(e){this.trackers.forEach(t=>t.onError?t.onError(e):void 0)}onExit(e,t){this.trackers.forEach(i=>i.onExit?i.onExit(e,t):void 0)}}class FF extends hF{constructor(e){super(),this.implementation=e,e.onDidSendMessage(t=>{this.acceptMessage(t)})}startSession(){return Promise.resolve(void 0)}sendMessage(e){this.implementation.handleMessage(e)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}}let x0=class extends y0{constructor(e,t,i,s,r,o,a,l){super(e,t,i,s,r,o,a,l)}};x0=V([L(0,nt),L(1,Mr),L(2,Ao),L(3,Ur),L(4,cf),L(5,EE),L(6,ul),L(7,D_)],x0);function MF(n){return"uri"in n&&"ranges"in n&&"preview"in n}function UF(n){return n.folderOptions.map(e=>({folder:e.folder,excludes:e.excludes.map(t=>typeof t=="string"?t:t.pattern),includes:e.includes,useGlobalIgnoreFiles:e.useIgnoreFiles.global,useIgnoreFiles:e.useIgnoreFiles.local,useParentIgnoreFiles:e.useIgnoreFiles.parent,followSymlinks:e.followSymlinks,maxResults:n.maxResults,session:n.session}))}class e5{constructor(e){this.provider=e}provideFileSearchResults(e,t,i){return(async()=>{const r=UF(t);return Promise.all(r.map(o=>this.provider.provideFileSearchResults({pattern:e},o,i)))})().then(r=>rn(r).flat())}}function $F(n){return n.folderOptions.map(e=>({folder:e.folder,excludes:e.excludes.map(t=>typeof t=="string"?t:t.pattern),includes:e.includes,useGlobalIgnoreFiles:e.useIgnoreFiles.global,useIgnoreFiles:e.useIgnoreFiles.local,useParentIgnoreFiles:e.useIgnoreFiles.parent,followSymlinks:e.followSymlinks,maxResults:n.maxResults,previewOptions:HF(n.previewOptions),maxFileSize:n.maxFileSize,encoding:e.encoding,afterContext:n.surroundingContext,beforeContext:n.surroundingContext}))}function HF(n){return{matchLines:n?.matchLines??xy.matchLines,charsPerLine:n?.charsPerLine??xy.charsPerLine}}function BF(n){if(MF(n)){const e=Ri(n.ranges).map((t,i)=>{const r=Ri(n.preview.matches)[i];return{sourceRange:t,previewRange:r}});return new fo(n.uri,e,n.preview.text)}else return new lE(n.uri,n.text,n.lineNumber)}class WF{constructor(e){this.provider=e}provideTextSearchResults(e,t,i,s){const r=l=>{VF(l)&&i.report(BF(l))};return(async()=>rn(await Promise.all($F(t).map(l=>this.provider.provideTextSearchResults(e,l,{report:c=>r(c)},s)))).reduce((l,c)=>({limitHit:l.limitHit||c.limitHit}),{limitHit:!1}))().then(l=>({limitHit:l.limitHit,message:rn(Ri(l.message))}))}}function VF(n){if(zF(n)){if(Array.isArray(n.ranges)){if(!Array.isArray(n.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(n.preview.matches.length!==n.ranges.length)return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}else if(Array.isArray(n.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same length."),!1}return!0}function zF(n){return!!n.preview}class t5 extends Rs{constructor(e,t,i=()=>!1){const s=new LC(i,()=>!1);super(s);const r=new on;e.forEach((o,a)=>{const l=o.folder.with({query:"",fragment:""});r.has(l)?r.get(l).push({fq:o,i:a}):r.set(l,[{fq:o,i:a}])}),r.forEach((o,a)=>{const l=new Map;for(const c of o){const u=t(c.fq,c.i);l.set(this.encodeKey(c.fq.folder),u)}super.set(a,l)})}findQueryFragmentAwareSubstr(e){const t=super.findSubstr(e.with({query:"",fragment:""}));if(!t)return;const i=this.encodeKey(e);return t.get(i)}forEachFolderQueryInfo(e){return this.forEach(t=>t.forEach(i=>e(i)))}encodeKey(e){let t="";return e.query&&(t+=e.query),e.fragment&&(t+="#"+e.fragment),t}}class qF{constructor(e,t,i){this.config=e,this.provider=t,this.sessionLifecycle=i,this.isLimitHit=!1,this.resultCount=0,this.isCanceled=!1,this.filePattern=e.filePattern,this.includePattern=e.includePattern&&Uc(e.includePattern),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&Uc(e.excludePattern)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){const t=this.config.folderQueries||[];return new Promise((i,s)=>{const r=o=>{this.resultCount++,e(o)};if(this.isCanceled)return i({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(o=>{const a=o.toString(),l=hi(a);this.globalExcludePattern&&this.globalExcludePattern(a,l)||this.matchFile(r,{base:o,basename:l})}),this.doSearch(t,r).then(o=>{i({limitHit:this.isLimitHit,stats:o||void 0})},o=>{s(new Error(gu(o)))})})}async doSearch(e,t){const i=new Nt,s=e.map(u=>this.getSearchOptionsForFolder(u)),r=this.provider instanceof e5?this.sessionLifecycle?.tokenSource.token:this.sessionLifecycle?.obj,o={folderOptions:s,maxResults:this.config.maxResults??vP,session:r},a=u=>{const d=new xP(this.config,u),f=!d.hasSiblingExcludeClauses();return{queryTester:d,noSiblingsClauses:f,folder:u.folder,tree:this.initDirectoryTree()}},l=new t5(e,a);let c;try{this.activeCancellationTokens.add(i),c=Rr.create();const u=await this.provider.provideFileSearchResults(this.config.filePattern||"",o,i.token),d=c.elapsed(),f=Rr.create();return this.isCanceled&&!this.isLimitHit||(u&&u.forEach(p=>{const _=l.findQueryFragmentAwareSubstr(p),w=ct.relative(_.folder.path,p.path);if(_.noSiblingsClauses){const v=hi(p.path);this.matchFile(t,{base:_.folder,relativePath:w,basename:v});return}this.addDirectoryEntries(_.tree,_.folder,w,t)}),this.isCanceled&&!this.isLimitHit)?null:(l.forEachFolderQueryInfo(p=>{this.matchDirectoryTree(p.tree,p.queryTester,t)}),{providerTime:d,postProcessTime:f.elapsed()})}finally{i.dispose(),this.activeCancellationTokens.delete(i)}}getSearchOptionsForFolder(e){const t=_c(this.config.includePattern,e.includePattern);let i=e.excludePattern?.map(r=>({folder:r.folder,patterns:_c(this.config.excludePattern,r.pattern)}));i?.length||(i=[{folder:void 0,patterns:_c(this.config.excludePattern,void 0)}]);const s=SP(i);return{folder:e.folder,excludes:s,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks}}initDirectoryTree(){const e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries["."]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,i,s){if(i===this.filePattern){const o=hi(this.filePattern);this.matchFile(s,{base:t,relativePath:this.filePattern,basename:o})}function r(o){const a=hi(o),l=ec(o);let c=e[l];c||(c=e[l]=[],r(l)),c.push({base:t,relativePath:o,basename:a})}r(i)}matchDirectoryTree({rootEntries:e,pathToEntries:t},i,s){const r=this,o=this.filePattern;function a(l){const c=eN(()=>l.map(u=>u.basename));for(let u=0,d=l.length;u<d;u++){const f=l[u],{relativePath:p,basename:_}=f;if(i.matchesExcludesSync(p,_,o!==_?c:void 0))continue;const w=t[p];if(w)a(w);else{if(p===o)continue;r.matchFile(s,f)}if(r.isLimitHit)break}}a(e)}matchFile(e,t){(!this.includePattern||t.relativePath&&this.includePattern(t.relativePath,t.basename))&&((this.exists||this.maxResults&&this.resultCount>=this.maxResults)&&(this.isLimitHit=!0,this.cancel()),this.isLimitHit||e(t))}}class jF{constructor(){this._obj=new Object,this.tokenSource=new Nt}get obj(){if(this._obj)return this._obj;throw new Error("Session object has been dereferenced.")}cancel(){this.tokenSource.cancel(),this._obj=void 0}}const P1=class P1{constructor(){this.sessions=new Map}fileSearch(e,t,i,s){const r=this.getSessionTokenSource(e.cacheKey),o=new qF(e,t,r);let a=0;const l=c=>{a+=c.length,i(c.map(u=>this.rawMatchToSearchItem(u)))};return this.doSearch(o,P1.BATCH_SIZE,l,s).then(c=>({limitHit:c.limitHit,stats:c.stats?{fromCache:!1,type:"fileSearchProvider",resultCount:a,detailStats:c.stats}:void 0,messages:[]}))}clearCache(e){this.sessions.get(e)?.cancel(),this.sessions.delete(e)}getSessionTokenSource(e){if(e)return this.sessions.has(e)||this.sessions.set(e,new jF),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:An(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,i,s){const r=s.onCancellationRequested(()=>{e.cancel()}),o=l=>{l&&(a.push(l),t>0&&a.length>=t&&(i(a),a=[]))};let a=[];return e.search(o).then(l=>(a.length&&i(a),r.dispose(),l),l=>(a.length&&i(a),r.dispose(),Promise.reject(l)))}};P1.BATCH_SIZE=512;let E0=P1;class VI{constructor(e,t,i){this.queryProviderPair=e,this.fileUtils=t,this.processType=i,this.collector=null,this.isLimitHit=!1,this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t,i){const s=this.query.folderQueries||[],r=new Nt(t);return new Promise((o,a)=>{this.collector=new KF(e);let l=!1;const c=(u,d)=>{if(!(u instanceof yy)&&!l&&!this.isLimitHit){const f=this.resultSize(u);u instanceof fo&&typeof this.query.maxResults=="number"&&this.resultCount+f>this.query.maxResults&&(this.isLimitHit=!0,l=!0,r.cancel(),u=this.trimResultToSize(u,this.query.maxResults-this.resultCount));const p=this.resultSize(u);this.resultCount+=p;const _=u instanceof fo;(p>0||!_)&&this.collector.add(u,d)}};this.doSearch(s,c,r.token,i).then(u=>{r.dispose(),this.collector.flush(),o({limitHit:this.isLimitHit||u?.limitHit,messages:this.getMessagesFromResults(u),stats:{type:this.processType}})},u=>{r.dispose();const d=gu(u);a(new Error(d))})})}getMessagesFromResults(e){return e?.message?Array.isArray(e.message)?e.message:[e.message]:[]}resultSize(e){return e instanceof fo?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){return new fo(e.uri,e.ranges.slice(0,t),e.previewText)}async doSearch(e,t,i,s){const r=new t5(e,(d,f)=>({queryTester:new xP(this.query,d),folder:d.folder,folderIdx:f}),()=>!0),o=[],a={report:d=>{if(d instanceof yy)s?.(d);else{if(d.uri===void 0)throw Error("Text search result URI is undefined. Please check provider implementation.");const f=r.findQueryFragmentAwareSubstr(d.uri),p=f.folder.scheme===le.file?Z3(()=>this.fileUtils.readdir(K1(d.uri))):void 0,_=kC(f.folder,d.uri);if(_){const w=f.queryTester.includedInQuery(_,hi(_),p);xo(w)?o.push(w.then(v=>{v&&t(d,f.folderIdx)})):w&&t(d,f.folderIdx)}}}},c={folderOptions:e.map(d=>this.getSearchOptionsForFolder(d)),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??vP,previewOptions:this.query.previewOptions??xy,surroundingContext:this.query.surroundingContext??0};"usePCRE2"in this.query&&(c.usePCRE2=this.query.usePCRE2);let u;return this.queryProviderPair.query.type===Pa.aiText?u=await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,c,a,i):u=await this.queryProviderPair.provider.provideTextSearchResults(GF(this.queryProviderPair.query.contentPattern),c,a,i),o.length&&await Promise.all(o),u}getSearchOptionsForFolder(e){const t=_c(this.query.includePattern,e.includePattern);let i=e.excludePattern?.map(o=>({folder:o.folder,patterns:_c(this.query.excludePattern,o.pattern)}));(!i||i.length===0)&&(i=[{folder:void 0,patterns:_c(this.query.excludePattern,void 0)}]);const s=SP(i);return{folder:x.from(e.folder),excludes:s,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks,encoding:(e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding))??""}}}function GF(n){return{isCaseSensitive:n.isCaseSensitive||!1,isRegExp:n.isRegExp||!1,isWordMatch:n.isWordMatch||!1,isMultiline:n.isMultiline||!1,pattern:n.pattern}}class KF{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new S0(512,t=>this.sendItems(t))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!tc(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||(this._currentFolderIdx=t,this._currentFileMatch={resource:e.uri,results:[]}),this._currentFileMatch.results.push(QF(e))}pushToCollector(){const e=this._currentFileMatch&&this._currentFileMatch.results?this._currentFileMatch.results.length:0;this._batchedCollector.addItem(this._currentFileMatch,e)}flush(){this.pushToCollector(),this._batchedCollector.flush()}sendItems(e){this._onResult(e)}}function QF(n){return n instanceof fo?{previewText:n.previewText,rangeLocations:n.ranges.map(e=>({preview:{startLineNumber:e.previewRange.start.line,startColumn:e.previewRange.start.character,endLineNumber:e.previewRange.end.line,endColumn:e.previewRange.end.character},source:{startLineNumber:e.sourceRange.start.line,startColumn:e.sourceRange.start.character,endLineNumber:e.sourceRange.end.line,endColumn:e.sourceRange.end.character}}))}:{text:n.text,lineNumber:n.lineNumber}}const Xl=class Xl{constructor(e,t){this.maxBatchSize=e,this.cb=t,this.totalNumberCompleted=0,this.batch=[],this.batchSize=0}addItem(e,t){e&&this.addItemToBatch(e,t)}addItems(e,t){e&&this.addItemsToBatch(e,t)}addItemToBatch(e,t){this.batch.push(e),this.batchSize+=t,this.onUpdate()}addItemsToBatch(e,t){this.batch=this.batch.concat(e),this.batchSize+=t,this.onUpdate()}onUpdate(){this.totalNumberCompleted<Xl.START_BATCH_AFTER_COUNT?this.flush():this.batchSize>=this.maxBatchSize?this.flush():this.timeoutHandle||(this.timeoutHandle=setTimeout(()=>{this.flush()},Xl.TIMEOUT))}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=void 0))}};Xl.TIMEOUT=4e3,Xl.START_BATCH_AFTER_COUNT=50;let S0=Xl;const n5=pe("IExtHostSearch");let k0=class{constructor(e,t,i){this.extHostRpc=e,this._uriTransformer=t,this._logService=i,this._proxy=this.extHostRpc.getProxy(ee.MainThreadSearch),this._handlePool=0,this._textSearchProvider=new Map,this._textSearchUsedSchemes=new Set,this._aiTextSearchProvider=new Map,this._aiTextSearchUsedSchemes=new Set,this._fileSearchProvider=new Map,this._fileSearchUsedSchemes=new Set,this._fileSearchManager=new E0}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProviderOld(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);const i=this._handlePool++;return this._textSearchProvider.set(i,new WF(t)),this._proxy.$registerTextSearchProvider(i,this._transformScheme(e)),we(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw new Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);const i=this._handlePool++;return this._textSearchProvider.set(i,t),this._proxy.$registerTextSearchProvider(i,this._transformScheme(e)),we(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw new Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);const i=this._handlePool++;return this._aiTextSearchProvider.set(i,t),this._proxy.$registerAITextSearchProvider(i,this._transformScheme(e)),we(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerFileSearchProviderOld(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);const i=this._handlePool++;return this._fileSearchProvider.set(i,new e5(t)),this._proxy.$registerFileSearchProvider(i,this._transformScheme(e)),we(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw new Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);const i=this._handlePool++;return this._fileSearchProvider.set(i,t),this._proxy.$registerFileSearchProvider(i,this._transformScheme(e)),we(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(i),this._proxy.$unregisterProvider(i)})}$provideFileSearchResults(e,t,i,s){const r=fv(i),o=this._fileSearchProvider.get(e);if(o)return this._fileSearchManager.fileSearch(r,o,a=>{this._proxy.$handleFileMatch(e,t,a.map(l=>l.resource))},s);throw new Error("unknown provider: "+e)}async doInternalFileSearchWithCustomCallback(e,t,i){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,i,s){const r=this._textSearchProvider.get(e);if(!r||!r.provideTextSearchResults)throw new Error(`Unknown Text Search Provider ${e}`);const o=fv(i);return this.createTextSearchManager(o,r).search(l=>this._proxy.$handleTextMatch(e,t,l),s)}$provideAITextSearchResults(e,t,i,s){const r=this._aiTextSearchProvider.get(e);if(!r||!r.provideAITextSearchResults)throw new Error(`Unknown AI Text Search Provider ${e}`);const o=fv(i);return this.createAITextSearchManager(o,r).search(l=>this._proxy.$handleTextMatch(e,t,l),s,l=>this._proxy.$handleKeywordResult(e,t,l))}$enableExtensionHostSearch(){}async $getAIName(e){const t=this._aiTextSearchProvider.get(e);if(!(!t||!t.provideAITextSearchResults))return t.name??"AI"}createTextSearchManager(e,t){return new VI({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"textSearchProvider")}createAITextSearchManager(e,t){return new VI({query:e,provider:t},{readdir:i=>Promise.resolve([]),toCanonicalName:i=>i},"aiTextSearchProvider")}};k0=V([L(0,nt),L(1,Q1),L(2,at)],k0);function fv(n){return{...n,folderQueries:n.folderQueries&&n.folderQueries.map(JF),extraFileResources:n.extraFileResources&&n.extraFileResources.map(e=>x.revive(e))}}function JF(n){return an(n)}const i5=pe("IExtHostTerminalShellIntegration");let D0=class extends Se{constructor(e,t){super(),this._extHostTerminalService=t,this._activeShellIntegrations=new Map,this._onDidChangeTerminalShellIntegration=new N,this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidStartTerminalShellExecution=new N,this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event,this._onDidEndTerminalShellExecution=new N,this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._proxy=e.getProxy(ee.MainThreadTerminalShellIntegration),this._register(we(()=>{for(const[i,s]of this._activeShellIntegrations)s.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e){const t=this._extHostTerminalService.getTerminalById(e);if(!t)return;const i=t.value;let s=this._activeShellIntegrations.get(e);s||(s=new XF(t.value,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,s),s.store.add(t.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),s.store.add(s.onDidRequestShellExecution(r=>this._proxy.$executeCommand(e,r))),s.store.add(s.onDidRequestEndExecution(r=>this._onDidEndTerminalShellExecution.fire(r))),s.store.add(s.onDidRequestChangeShellIntegration(r=>this._onDidChangeTerminalShellIntegration.fire(r))),t.shellIntegration=s.value),this._onDidChangeTerminalShellIntegration.fire({terminal:i,shellIntegration:s.value})}$shellExecutionStart(e,t,i,s,r){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e);const o={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.startShellExecution(o,x.revive(r))}$shellExecutionEnd(e,t,i,s,r){const o={value:t,confidence:i,isTrusted:s};this._activeShellIntegrations.get(e)?.endShellExecution(o,r)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$shellEnvChange(e,t,i,s){this._activeShellIntegrations.get(e)?.setEnv(t,i,s)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(x.revive(t))}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}};D0=V([L(0,nt),L(1,_u)],D0);class XF extends Se{get currentExecution(){return this._currentExecution}constructor(e,t){super(),this._terminal=e,this._onDidStartTerminalShellExecution=t,this._pendingExecutions=[],this.store=this._register(new xe),this._onDidRequestChangeShellIntegration=this._register(new N),this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event,this._onDidRequestShellExecution=this._register(new N),this.onDidRequestShellExecution=this._onDidRequestShellExecution.event,this._onDidRequestEndExecution=this._register(new N),this.onDidRequestEndExecution=this._onDidRequestEndExecution.event,this._onDidRequestNewExecution=this._register(new N),this.onDidRequestNewExecution=this._onDidRequestNewExecution.event;const i=this;this.value={get cwd(){return i._cwd},get env(){if(i._env)return Object.freeze({isTrusted:i._env.isTrusted,value:Object.freeze({...i._env.value})})},executeCommand(s,r){let o=s;if(r)for(const c of r)!c.match(/["'`]/)&&c.match(/\s/)?o+=` "${c}"`:o+=` ${c}`;i._onDidRequestShellExecution.fire(o);const a={value:o,confidence:sh.High,isTrusted:!0};return i.requestNewShellExecution(a,i._cwd).value}}}requestNewShellExecution(e,t){const i=new zI(e,t??this._cwd);return hp(e.value).length>1&&(this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:hp(e.value)}),this._pendingExecutions.push(i),this._onDidRequestNewExecution.fire(e.value),i}startShellExecution(e,t){if(this._pendingEndingExecution&&(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._pendingEndingExecution.value,exitCode:void 0}),this._pendingEndingExecution=void 0),this._currentExecution){if(this._currentExecutionProperties?.isMultiLine&&this._currentExecutionProperties.unresolvedCommandLines){const s=qI(this._currentExecutionProperties.unresolvedCommandLines,e);if(s){this._currentExecutionProperties.unresolvedCommandLines=s.unresolvedCommandLines;return}}this._currentExecution.endExecution(void 0),this._currentExecution.flush(),this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value,exitCode:void 0})}let i;if(e.confidence===sh.High)for(const[s,r]of this._pendingExecutions.entries())if(r.value.commandLine.value===e.value){i=r,this._currentExecutionProperties={isMultiLine:!1,unresolvedCommandLines:void 0},i=r,this._pendingExecutions.splice(s,1);break}else{const o=qI(hp(r.value.commandLine.value),e);if(o){this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:o.unresolvedCommandLines},i=r,this._pendingExecutions.splice(s,1);break}}else i=this._pendingExecutions.shift();i||(i=new zI(e,t??this._cwd)),this._currentExecution=i,this._onDidStartTerminalShellExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._currentExecution.value})}emitData(e){this.currentExecution?.emitData(e)}endShellExecution(e,t){if(!(this._currentExecutionProperties?.isMultiLine&&this._currentExecutionProperties.unresolvedCommandLines&&this._currentExecutionProperties.unresolvedCommandLines.length>0)&&this._currentExecution){const i=this._currentExecutionProperties?.isMultiLine?this._currentExecution.value.commandLine:e;this._currentExecution.endExecution(i);const s=this._currentExecution;this._pendingEndingExecution=s,this._currentExecution=void 0,s.flush().then(()=>{this._pendingEndingExecution===s&&(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:s.value,exitCode:t}),this._pendingEndingExecution=void 0)})}}setEnv(e,t,i){const s={};for(let r=0;r<e.length;r++)s[e[r]]=t[r];this._env={value:s,isTrusted:i},this._fireChangeEvent()}setCwd(e){let t=!1;x.isUri(this._cwd)?t=!x.isUri(e)||this._cwd.toString()!==e.toString():this._cwd!==e&&(t=!0),t&&(this._cwd=e,this._fireChangeEvent())}_fireChangeEvent(){this._onDidRequestChangeShellIntegration.fire({terminal:this._terminal,shellIntegration:this.value})}}class zI{constructor(e,t){this._commandLine=e,this.cwd=t,this._isEnded=!1;const i=this;this.value={get commandLine(){return i._commandLine},get cwd(){return i.cwd},read(){return i._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._isEnded)return za.EMPTY;this._dataStream=new YF}return this._dataStream.createIterable()}emitData(e){this._isEnded||this._dataStream?.emitData(e)}endExecution(e){e&&(this._commandLine=e),this._dataStream?.endExecution(),this._isEnded=!0}async flush(){this._dataStream&&(await this._dataStream.flush(),this._dataStream.dispose(),this._dataStream=void 0)}}class YF extends Se{constructor(){super(...arguments),this._iterables=[],this._emitters=[]}createIterable(){this._barrier||(this._barrier=new As);const e=this._barrier,t=new za(async i=>{this._emitters.push(i),await e.wait()});return this._iterables.push(t),t}emitData(e){for(const t of this._emitters)t.emitOne(e)}endExecution(){this._barrier?.open()}async flush(){await Promise.all(this._iterables.map(e=>e.toPromise()))}}function hp(n){return n.split(`
|
|
113
113
|
`).map(e=>e.trim()).filter(e=>e.length>0)}function qI(n,e){if(n.length===0)return!1;const t=[...n],i=hp(e.value);if(t&&t.length>0){for(;t.length>0&&t[0]===i[0];)t.shift(),i.shift();if(i.length===0)return{unresolvedCommandLines:t}}return!1}var eo;(function(n){n[n.CR=13]="CR",n[n.LF=10]="LF",n[n.COLON=58]="COLON",n[n.SPACE=32]="SPACE"})(eo||(eo={}));class pv{constructor(e){this.dataBuffer="",this.eventTypeBuffer="",this.buffer=[],this.endedOnCR=!1,this.onEventHandler=e,this.decoder=new TextDecoder("utf-8")}getLastEventId(){return this.lastEventIdBuffer}getReconnectionTime(){return this.reconnectionTime}feed(e){if(e.length===0)return;let t=0;for(this.endedOnCR&&e[0]===eo.LF&&t++,this.endedOnCR=!1;t<e.length;){const i=e.indexOf(eo.CR,t),s=e.indexOf(eo.LF,t),r=i===-1?s:s===-1?i:Math.min(i,s);if(r===-1)break;let o="";for(const a of this.buffer)o+=this.decoder.decode(a,{stream:!0});o+=this.decoder.decode(e.subarray(t,r)),this.processLine(o),this.buffer.length=0,t=r+(e[r]===eo.CR&&e[r+1]===eo.LF?2:1)}t<e.length?this.buffer.push(e.subarray(t)):this.endedOnCR=e[e.length-1]===eo.CR}processLine(e){if(!e.length){this.dispatchEvent();return}if(e.startsWith(":"))return;let t,i;const s=e.indexOf(":");s===-1?(t=e,i=""):(t=e.substring(0,s),i=e.substring(s+1),i.startsWith(" ")&&(i=i.substring(1))),this.processField(t,i)}processField(e,t){switch(e){case"event":this.eventTypeBuffer=t;break;case"data":this.dataBuffer+=t,this.dataBuffer+=`
|
|
114
114
|
`;break;case"id":t.includes("\0")?this.currentEventId=void 0:this.currentEventId=this.lastEventIdBuffer=t;break;case"retry":/^\d+$/.test(t)&&(this.reconnectionTime=parseInt(t,10));break}}dispatchEvent(){if(this.dataBuffer===""){this.dataBuffer="",this.eventTypeBuffer="";return}this.dataBuffer.endsWith(`
|
|
115
|
-
`)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));const e={type:this.eventTypeBuffer||"message",data:this.dataBuffer};this.currentEventId!==void 0&&(e.id=this.currentEventId),this.reconnectionTime!==void 0&&(e.retry=this.reconnectionTime),this.onEventHandler(e),this.reset()}reset(){this.dataBuffer="",this.eventTypeBuffer="",this.currentEventId=void 0}}const I0=pe("IExtHostMpcService");let C0=class extends Se{constructor(e,t){super(),this._extHostInitData=t,this._initialProviderPromises=new Set,this._sseEventSources=this._register(new xp),this._unresolvedMcpServers=new Map,this._proxy=e.getProxy(ee.MainThreadMcp)}$startMcp(e,t){this._startMcp(e,Dh.fromSerialized(t))}_startMcp(e,t){if(t.type===Xa.HTTP){this._sseEventSources.set(e,new ZF(e,t,this._proxy));return}throw new Error("not implemented")}$stopMcp(e){this._sseEventSources.has(e)&&(this._sseEventSources.deleteAndDispose(e),this._proxy.$onDidChangeState(e,{state:mr.Kind.Stopped}))}$sendMessage(e,t){this._sseEventSources.get(e)?.send(t)}async $waitForInitialCollectionProviders(){await Promise.all(this._initialProviderPromises)}async $resolveMcpLaunch(e,t){const i=this._unresolvedMcpServers.get(e);if(!i)return;const s=i.servers.find(o=>o.label===t);if(!s)return;if(!i.provider.resolveMcpServerDefinition)return fd.from(s);const r=await i.provider.resolveMcpServerDefinition(s,yt.None);return r?fd.from(r):void 0}registerMcpConfigurationProvider(e,t,i){const s=new xe,r=e.contributes?.mcpServerDefinitionProviders?.find(c=>c.id===t);if(!r)throw new Error(`MCP configuration providers must be registered in the contributes.mcpServerDefinitionProviders array within your package.json, but "${t}" was not`);const o={id:V3(e.identifier,t),isTrustedByDefault:!0,label:r?.label??e.displayName??e.name,scope:Gt.WORKSPACE,canResolveLaunch:typeof i.resolveMcpServerDefinition=="function",extensionId:e.identifier.value,configTarget:this._extHostInitData.remote.isRemote?Zt.USER_REMOTE:Zt.USER},a=async()=>{const c=await i.provideMcpServerDefinitions(yt.None);this._unresolvedMcpServers.set(o.id,{servers:c??[],provider:i});const u=[];for(const d of c??[]){let f=tt.toKey(e.identifier)+"/"+d.label;if(u.some(p=>p.id===f)){let p=2;for(;u.some(_=>_.id===f+p);)p++;f=f+p}u.push({id:f,label:d.label,cacheNonce:d.version,launch:fd.from(d)})}this._proxy.$upsertMcpCollection(o,u)};s.add(we(()=>{this._unresolvedMcpServers.delete(o.id),this._proxy.$deleteMcpCollection(o.id)})),i.onDidChangeMcpServerDefinitions&&s.add(i.onDidChangeMcpServerDefinitions(a)),i.onDidChangeServerDefinitions&&s.add(i.onDidChangeServerDefinitions(a)),i.onDidChange&&s.add(i.onDidChange(a));const l=new Promise(c=>{setTimeout(()=>a().finally(()=>{this._initialProviderPromises.delete(l),c()}),0)});return this._initialProviderPromises.add(l),s}};C0=V([L(0,nt),L(1,gn)],C0);var bi;(function(n){n[n.Unknown=0]="Unknown",n[n.Http=1]="Http",n[n.SSE=2]="SSE"})(bi||(bi={}));class ZF extends Se{constructor(e,t,i){super(),this._id=e,this._launch=t,this._proxy=i,this._requestSequencer=new RR,this._postEndpoint=new Eo,this._mode={value:bi.Unknown},this._cts=new Nt,this._abortCtrl=new AbortController,this._register(we(()=>{this._abortCtrl.abort(),this._cts.dispose(!0)})),this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Running})}async send(e){try{await this._requestSequencer.queue(()=>this._mode.value===bi.SSE?this._sendLegacySSE(this._mode.endpoint,e):this._sendStreamableHttp(e,this._mode.value===bi.Http?this._mode.sessionId:void 0))}catch(t){const i=`Error sending message to ${this._launch.uri}: ${String(t)}`;this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:i})}}async _sendStreamableHttp(e,t){const i=new TextEncoder().encode(e),s={...Object.fromEntries(this._launch.headers),"Content-Type":"application/json","Content-Length":String(i.length),Accept:"text/event-stream, application/json"};t&&(s["Mcp-Session-Id"]=t),await this._addAuthHeader(s);const r=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"POST",signal:this._abortCtrl.signal,headers:s,body:i},s),o=this._mode.value===bi.Unknown,a=r.headers.get("Mcp-Session-Id");if(a&&(this._mode={value:bi.Http,sessionId:a}),this._mode.value===bi.Unknown&&r.status>=400&&r.status<500&&r.status!==401&&r.status!==403){this._log(Be.Info,`${r.status} status sending message to ${this._launch.uri}, will attempt to fall back to legacy SSE`),this._sseFallbackWithMessage(e);return}if(r.status>=300){const l=this._mode.value===bi.Http&&!!this._mode.sessionId&&(r.status===400||r.status===404);this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`${r.status} status sending message to ${this._launch.uri}: ${await this._getErrText(r)}`+l?"; will retry with new session ID":"",shouldRetry:l});return}this._mode.value===bi.Unknown&&(this._mode={value:bi.Http,sessionId:void 0}),o&&this._attachStreamableBackchannel(),this._handleSuccessfulStreamableHttp(r,e)}async _sseFallbackWithMessage(e){const t=await this._attachSSE();t&&(this._mode={value:bi.SSE,endpoint:t},await this._sendLegacySSE(t,e))}async _populateAuthMetadata(e){let t;if(e.headers.has("WWW-Authenticate")){const c=e.headers.get("WWW-Authenticate"),{scheme:u,params:d}=oO(c);u==="Bearer"&&d.resource_metadata&&(t=d.resource_metadata)}let i,s,r;if(t){const c=await this._getResourceMetadata(t);i=c.authorization_servers?.[0],s=c.scopes_supported,r=c}const o=new URL(e.url).origin;let a={};i||(i=o,a={...Object.fromEntries(this._launch.headers)});try{const c=await this._getAuthorizationServerMetadata(i,a),u=sO(c);this._authMetadata={authorizationServer:x.parse(i),serverMetadata:u,resourceMetadata:r};return}catch(c){this._log(Be.Warning,`Error populating auth metadata: ${String(c)}`)}const l=iO(new URL(o));l.scopes_supported=s??l.scopes_supported??[],this._authMetadata={authorizationServer:x.parse(i),serverMetadata:l,resourceMetadata:r}}async _getResourceMetadata(e){const t=new URL(e),i=new URL(this._launch.uri.toString(!0));let s={};t.origin===i.origin&&(s={...Object.fromEntries(this._launch.headers)});const r=await fetch(e,{method:"GET",signal:this._abortCtrl.signal,headers:{...s,Accept:"application/json","MCP-Protocol-Version":ud.LATEST_PROTOCOL_VERSION}});if(r.status!==200)throw new Error(`Failed to fetch resource metadata: ${r.status} ${await this._getErrText(r)}`);const o=await r.json();if(eO(o))return o;throw new Error(`Invalid resource metadata: ${JSON.stringify(o)}`)}async _getAuthorizationServerMetadata(e,t){const i=new URL(e),s=i.pathname==="/"?"":i.pathname,r=new URL(ZN,e).toString()+s;let o=await fetch(r,{method:"GET",signal:this._abortCtrl.signal,headers:{...t,Accept:"application/json","MCP-Protocol-Version":ud.LATEST_PROTOCOL_VERSION}});if(o.status!==200&&(o=await fetch(x.joinPath(x.parse(e),".well-known","openid-configuration").toString(!0),{method:"GET",signal:this._abortCtrl.signal,headers:{...t,Accept:"application/json","MCP-Protocol-Version":ud.LATEST_PROTOCOL_VERSION}}),o.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${o.status} ${await this._getErrText(o)}`);const a=await o.json();if(tO(a))return a;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(a)}`)}async _handleSuccessfulStreamableHttp(e,t){if(e.status!==202)switch(e.headers.get("Content-Type")?.toLowerCase()){case"text/event-stream":{const i=new pv(s=>{if(s.type==="message")this._proxy.$onDidReceiveMessage(this._id,s.data);else if(s.type==="endpoint")throw this._log(Be.Warning,`Received SSE endpoint from a POST to ${this._launch.uri}, will fall back to legacy SSE`),this._sseFallbackWithMessage(t),new Ai});try{await this._doSSE(i,e)}catch(s){this._log(Be.Warning,`Error reading SSE stream: ${String(s)}`)}break}case"application/json":this._proxy.$onDidReceiveMessage(this._id,await e.text());break;default:{const i=await e.text();eM(i)?this._proxy.$onDidReceiveMessage(this._id,i):this._log(Be.Warning,`Unexpected ${e.status} response for request: ${i}`)}}}async _attachStreamableBackchannel(){let e;for(let t=0;!this._store.isDisposed;t++){await us(Math.min(t*1e3,3e4),this._cts.token);let i;try{const r={...Object.fromEntries(this._launch.headers),Accept:"text/event-stream"};await this._addAuthHeader(r),this._mode.value===bi.Http&&this._mode.sessionId!==void 0&&(r["Mcp-Session-Id"]=this._mode.sessionId),e&&(r["Last-Event-ID"]=e),i=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"GET",signal:this._abortCtrl.signal,headers:r},r)}catch{this._log(Be.Info,`Error connecting to ${this._launch.uri} for async notifications, will retry`);continue}if(i.status>=400){this._log(Be.Debug,`${i.status} status connecting to ${this._launch.uri} for async notifications; they will be disabled: ${await this._getErrText(i)}`);return}t=0;const s=new pv(r=>{r.type==="message"&&this._proxy.$onDidReceiveMessage(this._id,r.data),r.id&&(e=r.id)});try{await this._doSSE(s,i)}catch(r){this._log(Be.Info,`Error reading from async stream, we will reconnect: ${r}`)}}}async _attachSSE(){const e=new Eo,t={...Object.fromEntries(this._launch.headers),Accept:"text/event-stream"};await this._addAuthHeader(t);let i;try{if(i=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"GET",signal:this._abortCtrl.signal,headers:t},t),i.status>=300){this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`${i.status} status connecting to ${this._launch.uri} as SSE: ${await this._getErrText(i)}`});return}}catch(r){this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`Error connecting to ${this._launch.uri} as SSE: ${r}`});return}const s=new pv(r=>{r.type==="message"?this._proxy.$onDidReceiveMessage(this._id,r.data):r.type==="endpoint"&&e.complete(new URL(r.data,this._launch.uri.toString(!0)).toString())});return this._register(we(()=>e.cancel())),this._doSSE(s,i).catch(r=>{this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`Error reading SSE stream: ${String(r)}`})}),e.p}async _sendLegacySSE(e,t){const i=new TextEncoder().encode(t),s={...Object.fromEntries(this._launch.headers),"Content-Type":"application/json","Content-Length":String(i.length)};await this._addAuthHeader(s);const r=await fetch(e,{method:"POST",signal:this._abortCtrl.signal,headers:s,body:i});r.status>=300&&this._log(Be.Warning,`${r.status} status sending message to ${this._postEndpoint}: ${await this._getErrText(r)}`)}async _doSSE(e,t){if(!t.body)return;const i=t.body.getReader();let s;do{try{s=await Cx(i.read(),this._cts.token)}catch(r){if(i.cancel(),this._store.isDisposed)return;throw r}s.value&&e.feed(s.value)}while(!s.done)}async _addAuthHeader(e){if(this._authMetadata)try{const t=await this._proxy.$getTokenFromServerMetadata(this._id,this._authMetadata.authorizationServer,this._authMetadata.serverMetadata,this._authMetadata.resourceMetadata);t&&(e.Authorization=`Bearer ${t}`)}catch(t){this._log(Be.Warning,`Error getting token from server metadata: ${String(t)}`)}return e}_log(e,t){this._store.isDisposed||this._proxy.$onDidPublishLog(this._id,e,t)}async _getErrText(e){try{return await e.text()}catch{return e.statusText}}async _fetchWithAuthRetry(e,t,i){const s=()=>fetch(e,t);let r=await s();return r.status===401&&(this._authMetadata||(await this._populateAuthMetadata(r),await this._addAuthHeader(i),i.Authorization&&(t.headers=i,r=await s()))),r}}function eM(n){try{return JSON.parse(n),!0}catch{return!1}}gt(wE,Xy,ht.Delayed);gt(Po,Gm,ht.Delayed);gt(lf,t0,ht.Delayed);gt(ul,$y,ht.Eager);gt(S_,jy,ht.Eager);gt(_E,Jy,ht.Eager);gt(Ur,Cy,ht.Eager);gt(w_,Ay,ht.Eager);gt(D_,w0,ht.Eager);gt(ZP,x0,ht.Eager);gt(KP,s0,ht.Eager);gt(vu,a0,ht.Eager);gt(bE,Yy,ht.Eager);gt(hu,p8,ht.Eager);gt(GP,i0,ht.Delayed);gt(n5,k0,ht.Eager);gt(hE,TP,ht.Eager);gt(QP,m0,ht.Eager);gt(_u,By,ht.Eager);gt(i5,D0,ht.Eager);gt(pE,Fy,ht.Eager);gt(x_,Vy,ht.Eager);gt(E_,qy,ht.Eager);gt(Mr,ky,ht.Eager);gt(vE,BP,ht.Eager);gt(cf,_0,ht.Eager);gt(EE,b0,ht.Eager);gt(I0,C0,ht.Eager);function s5(n,e,t,i,s,r){if(Array.isArray(n)){let o=0;for(const a of n){const l=s5(a,e,t,i,s,r);if(l===10)return l;l>o&&(o=l)}return o}else{if(typeof n=="string")return n==="*"?5:n===t?10:0;if(n){const{language:o,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=n;u&&s&&(e=s);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(o)if(o===t)d=10;else if(o==="*")d=Math.max(d,5);else return 0;if(u)if(u===r)d=10;else if(u==="*"&&r!==void 0)d=Math.max(d,5);else return 0;if(a){let f;if(typeof a=="string"?f=a:f={...a,base:Rc(a.base)},f===e.fsPath||sd(f,e.fsPath))d=10;else return 0}return d}else return 0}}function r5(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(r5):!!n.notebookType}var T0;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(T0||(T0={}));var P0;(function(n){n[n.Complete=100]="Complete",n[n.Partial=50]="Partial",n[n.None=0]="None"})(P0||(P0={}));class tM{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(ee.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const s=this._relatedInformationProviders.get(e);if(!s)throw new Error("related information provider not found");return await s.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(s,i),this._proxy.$registerAiRelatedInformationProvider(s,t),new je(()=>{this._proxy.$unregisterAiRelatedInformationProvider(s),this._relatedInformationProviders.delete(s)})}}var qh;(function(n){n[n.Full=1]="Full",n[n.Delta=2]="Delta"})(qh||(qh={}));function o5(n){for(let e=0,t=n.length;e<t;e+=4){const i=n[e+0],s=n[e+1],r=n[e+2],o=n[e+3];n[e+0]=o,n[e+1]=r,n[e+2]=s,n[e+3]=i}}function nM(n){const e=new Uint8Array(n.buffer,n.byteOffset,n.length*4);return aC()||o5(e),ue.wrap(e)}function iM(n){const e=n.buffer;if(aC()||o5(e),e.byteOffset%4===0)return new Uint32Array(e.buffer,e.byteOffset,e.length/4);{const t=new Uint8Array(e.byteLength);return t.set(e),new Uint32Array(t.buffer,t.byteOffset,t.length/4)}}function A0(n){const e=new Uint32Array(sM(n));let t=0;if(e[t++]=n.id,n.type==="full")e[t++]=qh.Full,e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length;else{e[t++]=qh.Delta,e[t++]=n.deltas.length;for(const i of n.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return nM(e)}function sM(n){let e=0;if(e+=2,n.type==="full")e+=1+n.data.length;else{e+=1,e+=3*n.deltas.length;for(const t of n.deltas)t.data&&(e+=t.data.length)}return e}function jI(n){const e=iM(n);let t=0;const i=e[t++];if(e[t++]===qh.Full){const a=e[t++],l=e.subarray(t,t+a);return t+=a,{id:i,type:"full",data:l}}const r=e[t++],o=[];for(let a=0;a<r;a++){const l=e[t++],c=e[t++],u=e[t++];let d;u>0&&(d=e.subarray(t,t+u),t+=u),o[a]={start:l,deleteCount:c,data:d}}return{id:i,type:"delta",deltas:o}}const rM=[new Te("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[j.Uri,j.Position],new ke("A promise that resolves to an array of DocumentHighlight-instances.",Vi(Yc.to))),new Te("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[j.Uri],new ke("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(n,e)=>{if(_x(n))return;class t extends Jd{constructor(){super(...arguments),this.containerName=""}static to(s){const r=new t(s.name,Hi.to(s.kind),s.containerName||"",new Ni(e[0],z.to(s.range)));return r.detail=s.detail,r.range=r.location.range,r.selectionRange=z.to(s.selectionRange),r.children=s.children?s.children.map(t.to):[],r}}return n.map(t.to)})),new Te("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[j.Uri,new j("options","Formatting options",n=>!0,n=>n)],new ke("A promise that resolves to an array of TextEdits.",Vi(pn.to))),new Te("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[j.Uri,j.Range,new j("options","Formatting options",n=>!0,n=>n)],new ke("A promise that resolves to an array of TextEdits.",Vi(pn.to))),new Te("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[j.Uri,j.Position,new j("ch","Trigger character",n=>typeof n=="string",n=>n),new j("options","Formatting options",n=>!0,n=>n)],new ke("A promise that resolves to an array of TextEdits.",Vi(pn.to))),new Te("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location-instances.",Vi(oi.to))),new Te("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location-instances.",Vi(oi.to))),new Te("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Hover-instances.",Vi(Th.to))),new Te("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Hover-instances.",Vi(Th.to))),new Te("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[j.Uri,new j("position","A position in a text document",n=>Array.isArray(n)&&n.every(e=>qe.isPosition(e)),n=>n.map(ot.from))],new ke("A promise that resolves to an array of ranges.",n=>n.map(e=>{let t;for(const i of e.reverse())t=new eh(z.to(i),t);return t}))),new Te("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[j.String.with("query","Search string")],new ke("A promise that resolves to an array of SymbolInformation-instances.",n=>n.map(Ya.to))),new Te("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[j.Uri,j.Position],new ke("A promise that resolves to an array of CallHierarchyItem-instances",n=>n.map(Za.to))),new Te("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[j.CallHierarchyItem],new ke("A promise that resolves to an array of CallHierarchyIncomingCall-instances",n=>n.map(zb.to))),new Te("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[j.CallHierarchyItem],new ke("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",n=>n.map(qb.to))),new Te("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[j.Uri,j.Position],new ke("A promise that resolves to a range and placeholder text.",n=>{if(n)return{range:z.to(n.range),placeholder:n.text}})),new Te("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[j.Uri,j.Position,j.String.with("newName","The new symbol name")],new ke("A promise that resolves to a WorkspaceEdit.",n=>{if(n){if(n.rejectReason)throw new Error(n.rejectReason);return _i.to(n)}})),new Te("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[j.Uri,j.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new ke("A promise that resolves to an array of DocumentLink-instances.",n=>n.map(Da.to))),new Te("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[j.Uri],new ke("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new cb(n.tokenTypes,n.tokenModifiers)})),new Te("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[j.Uri],new ke("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=jI(n);if(e.type==="full")return new Gc(e.data,void 0)})),new Te("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[j.Uri,j.Range.optional()],new ke("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new cb(n.tokenTypes,n.tokenModifiers)})),new Te("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[j.Uri,j.Range],new ke("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=jI(n);if(e.type==="full")return new Gc(e.data,void 0)})),new Te("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[j.Uri,j.Position,j.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),j.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new ke("A promise that resolves to a CompletionList-instance.",(n,e,t)=>{if(!n)return new Hc([]);const i=n.suggestions.map(s=>Jb.to(s,t));return new Hc(i,n.incomplete)})),new Te("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[j.Uri,j.Position,j.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new ke("A promise that resolves to SignatureHelp.",n=>{if(n)return Ph.to(n)})),new Te("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[j.Uri,j.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new ke("A promise that resolves to an array of CodeLens-instances.",(n,e,t)=>Vi(i=>new Pg(z.to(i.range),i.command&&t.fromInternal(i.command)))(n))),new Te("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[j.Uri,new j("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",n=>Me.isRange(n),n=>Nr.isSelection(n)?hs.from(n):z.from(n)),j.String.with("kind","Code action kind to return code actions for").optional(),j.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new ke("A promise that resolves to an array of Command-instances.",(n,e,t)=>Vi(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const s=new Zd(i.title,i.kind?new At(i.kind):void 0);return i.edit&&(s.edit=_i.to(i.edit)),i.command&&(s.command=t.fromInternal(i.command)),s.isPreferred=i.isPreferred,s}})(n))),new Te("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[j.Uri],new ke("A promise that resolves to an array of ColorInformation objects.",n=>n?n.map(e=>new Fg(z.to(e.range),Zc.to(e.color))):[])),new Te("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new j("color","The color to show and insert",n=>n instanceof Vc,Zc.from),new j("context","Context object with uri and range",n=>!0,n=>({uri:n.uri,range:z.from(n.range)}))],new ke("A promise that resolves to an array of ColorPresentation objects.",n=>n?n.map(wm.to):[])),new Te("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[j.Uri,j.Range],new ke("A promise that resolves to an array of Inlay objects",(n,e,t)=>n.map(Xb.to.bind(void 0,t)))),new Te("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[j.Uri],new ke("A promise that resolves to an array of FoldingRange objects",(n,e)=>{if(n)return n.map(xm.to)})),new Te("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new ke("A promise that resolves to an array of NotebookContentProvider static info objects.",Vi(n=>({viewType:n.viewType,displayName:n.displayName,options:{transientOutputs:n.options.transientOutputs,transientCellMetadata:n.options.transientCellMetadata,transientDocumentMetadata:n.options.transientDocumentMetadata},filenamePattern:n.filenamePattern.map(e=>Sm.to(e))})))),new Te("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[j.Uri,j.Range,new j("context","An InlineValueContext",n=>n&&typeof n.frameId=="number"&&n.stoppedLocation instanceof Me,n=>fm.from(n))],new ke("A promise that resolves to an array of InlineValue objects",n=>n.map(hm.to))),new Te("vscode.open","_workbench.open","Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.",[new j("uriOrString","Uri-instance or string (only http/https)",n=>x.isUri(n)||typeof n=="string"&&_R(n,le.http,le.https),n=>n),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[hn.from(n),void 0]:[hn.from(n.viewColumn),dd.from(n)])).optional(),j.String.with("label","").optional()],ke.Void),new Te("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[j.Uri.with("resource","Resource to open"),j.String.with("viewId","Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor"),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[hn.from(n),void 0]:[hn.from(n.viewColumn),dd.from(n)])).optional()],ke.Void),new Te("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[j.Uri.with("left","Left-hand side resource of the diff editor"),j.Uri.with("right","Right-hand side resource of the diff editor"),j.String.with("title","Human readable title for the diff editor").optional(),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="object",n=>n&&[hn.from(n.viewColumn),dd.from(n)]).optional()],ke.Void),new Te("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[j.String.with("title","Human readable title for the changes editor"),new j("resourceList","List of resources to compare",n=>{for(const e of n){if(e.length!==3)return!1;const[t,i,s]=e;if(!x.isUri(t)||!x.isUri(i)&&i!==void 0&&i!==null||!x.isUri(s)&&s!==void 0&&s!==null)return!1}return!0},n=>n)],ke.Void),new Te("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[j.Uri,j.Position],new ke("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map(Ia.to))),new Te("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[j.TypeHierarchyItem],new ke("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map(Ia.to))),new Te("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[j.TypeHierarchyItem],new ke("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map(Ia.to))),new Te("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[j.TestItem],ke.Void),new Te("vscode.startContinuousTestRun","testing.startContinuousRunFromExtension","Starts running the given tests with continuous run mode.",[j.TestProfile,j.Arr(j.TestItem)],ke.Void),new Te("vscode.stopContinuousTestRun","testing.stopContinuousRunFromExtension","Stops running the given tests with continuous run mode.",[j.Arr(j.TestItem)],ke.Void),new Te("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[j.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],ke.Void),new Te("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[j.String.with("name","The context key name"),new j("value","The context key value",()=>!0,n=>n)],ke.Void),new Te("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new j("Run arguments","",n=>!0,n=>{if(n)return{initialRange:n.initialRange?z.from(n.initialRange):void 0,initialSelection:Nr.isSelection(n.initialSelection)?hs.from(n.initialSelection):void 0,message:n.message,attachments:n.attachments,autoSend:n.autoSend,position:n.position?ot.from(n.position):void 0}})],ke.Void)];class oM{static register(e){rM.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",C7)}}function Vi(n){return e=>{if(Array.isArray(e))return e.map(n)}}function jr(n){if(!Array.isArray(n))return;const e=[];for(const t of n)DL(t)?e.push(Ch.to(t)):e.push(oi.to(t));return e}let R0=class{constructor(e,t){this._proxy=e.getProxy(ee.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const s=new jn(_i.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(s,void 0,i?.isRefactoring??!1)}};R0=V([L(0,nt)],R0);function aM(n){return!!n&&typeof n.sessionId=="string"&&n.$mid===st.ChatViewContext}class lM{constructor(e,t,i,s,r){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=s,this._sessionDisposables=r,this._stopWatch=Rr.create(!1),this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let i=function(l){if(e._isClosed){const c=new Error("Response stream has been closed");throw Error.captureStackTrace(c,l),c}},o=function(l,c){if(s.push(c!==void 0?[l,c]:l)===1&&queueMicrotask(()=>{e._proxy.$handleProgressChunk(e._request.requestId,s).finally(()=>{r.forEach(d=>d()),r.length=0}),s.length=0}),c!==void 0)return new Promise(d=>{r.push(d)})};const e=this;this._stopWatch.reset();let t=0;const s=[],r=[],a=(l,c)=>{if(typeof this._firstProgress>"u"&&(l.kind==="markdownContent"||l.kind==="markdownVuln"||l.kind==="prepareToolInvocation")&&(this._firstProgress=this._stopWatch.elapsed()),c){const u=t++,d=o(l,u),f={report:p=>{d.then(()=>{mi.isMarkdownString(p.value)?o(Fh.from(p),u):o(Ta.from(p),u)})}};Promise.all([d,c(f)]).then(([p,_])=>{o(cy.from(_),u)})}else o(l)};this._apiObject=Object.freeze({markdown(l){i(this.markdown);const c=new u_(l),u=Lh.from(c);return a(u),this},markdownWithVulnerabilities(l,c){i(this.markdown),c&&$(e._extension,"chatParticipantAdditions");const u=new bh(l,c),d=Tm.from(u);return a(d),this},codeblockUri(l,c){i(this.codeblockUri),$(e._extension,"chatParticipantAdditions");const u=new f_(l,c),d=Cm.from(u);return a(d),this},filetree(l,c){i(this.filetree);const u=new d_(l,c),d=Nh.from(u);return a(d),this},anchor(l,c){const u=new yh(l,c);return this.push(u)},button(l){i(this.anchor);const c=new h_(l),u=Uh.from(c,e._commandsConverter,e._sessionDisposables);return a(u),this},progress(l,c){i(this.progress);const u=new ap(l,c),d=c?Am.from(u):Oh.from(u);return a(d,c),this},warning(l){i(this.progress),$(e._extension,"chatParticipantAdditions");const c=new xh(l),u=Fh.from(c);return a(u),this},reference(l,c){return this.reference2(l,c)},reference2(l,c,u){if(i(this.reference),typeof l=="object"&&"variableName"in l&&$(e._extension,"chatParticipantAdditions"),typeof l=="object"&&"variableName"in l&&!l.value){const d=e._request.variables.variables.find(f=>f.name===l.variableName);if(d){let f;if(d.references?.length)f=d.references.map(p=>({kind:"reference",reference:{variableName:l.variableName,value:p.reference}}));else{const p=new ka(l,c,u);f=[Ta.from(p)]}return f.forEach(p=>a(p)),this}}else{const d=new ka(l,c,u),f=Ta.from(d);a(f)}return this},codeCitation(l,c,u){i(this.codeCitation),$(e._extension,"chatParticipantAdditions");const d=new om(l,c,u),f=Om.from(d);a(f)},textEdit(l,c){i(this.textEdit),$(e._extension,"chatParticipantAdditions");const u=new Eh(l,c);u.isDone=c===!0?!0:void 0;const d=Rm.from(u);return a(d),this},notebookEdit(l,c){i(this.notebookEdit),$(e._extension,"chatParticipantAdditions");const u=new am(l,c),d=Nm.from(u);return a(d),this},confirmation(l,c,u,d){i(this.confirmation),$(e._extension,"chatParticipantAdditions");const f=new rm(l,c,u,d),p=Pm.from(f);return a(p),this},prepareToolInvocation(l){i(this.prepareToolInvocation),$(e._extension,"chatParticipantAdditions");const c=new Sh(l),u=Mh.from(c);return a(u),this},push(l){if(i(this.push),(l instanceof Eh||l instanceof am||l instanceof bh||l instanceof xh||l instanceof rm||l instanceof om||l instanceof p_||l instanceof aE||l instanceof ap)&&$(e._extension,"chatParticipantAdditions"),l instanceof ka)this.reference2(l.value,l.iconPath,l.options);else if(l instanceof ap){const c=l.task?Am.from(l):Oh.from(l);a(c,l.task)}else if(l instanceof yh){const c=lu.from(l);if(l.resolve){$(e._extension,"chatParticipantAdditions"),c.resolveId=Sn();const u=new Nt;l.resolve(u.token).then(()=>{const d=lu.from(l);e._proxy.$handleAnchorResolve(e._request.requestId,c.resolveId,d)}).then(()=>u.dispose(),()=>u.dispose()),e._sessionDisposables.add(we(()=>u.dispose(!0)))}a(c)}else if(l instanceof Sh){$(e._extension,"chatParticipantAdditions");const c=Mh.from(l);return a(c),this}else{const c=Fm.from(l,e._commandsConverter,e._sessionDisposables);a(c)}return this}})}return this._apiObject}}const pr=class pr extends Se{constructor(e,t,i,s,r,o,a){super(),this._logService=t,this._commands=i,this._documents=s,this._languageModels=r,this._diagnostics=o,this._tools=a,this._agents=new Map,this._participantDetectionProviders=new Map,this._relatedFilesProviders=new Map,this._sessionDisposables=this._register(new xp),this._completionDisposables=this._register(new xp),this._inFlightRequests=new Set,this._onDidDisposeChatSession=this._register(new N),this.onDidDisposeChatSession=this._onDidDisposeChatSession.event,this._proxy=e.getProxy(ee.MainThreadChatAgents2),i.registerArgumentProcessor({processArgument:l=>aM(l)?null:l})}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const s=pr._idPool++,r=new GI(e,t,this._proxy,s,i);return this._agents.set(s,r),this._proxy.$registerAgent(s,e.identifier,t,{},void 0),r.apiAgent}createDynamicChatAgent(e,t,i,s){const r=pr._idPool++,o=new GI(e,t,this._proxy,r,s);return this._agents.set(r,o),this._proxy.$registerAgent(r,e.identifier,t,{isSticky:!0},i),o.apiAgent}registerChatParticipantDetectionProvider(e,t){const i=pr._participantDetectionProviderIdPool++;return this._participantDetectionProviders.set(i,new cM(e,t)),this._proxy.$registerChatParticipantDetectionProvider(i),we(()=>{this._participantDetectionProviders.delete(i),this._proxy.$unregisterChatParticipantDetectionProvider(i)})}registerRelatedFilesProvider(e,t,i){const s=pr._relatedFilesProviderIdPool++;return this._relatedFilesProviders.set(s,new uM(e,t)),this._proxy.$registerRelatedFilesProvider(s,i),we(()=>{this._relatedFilesProviders.delete(s),this._proxy.$unregisterRelatedFilesProvider(s)})}async $provideRelatedFiles(e,t,i){const s=this._relatedFilesProviders.get(e);if(!s)return Promise.resolve([]);const r=uy.to(t);return await s.provider.provideRelatedFiles(r,i)??void 0}async $detectChatParticipant(e,t,i,s,r){const o=this._participantDetectionProviders.get(e);if(!o)return;const{request:a,location:l,history:c}=await this._createRequest(t,i,o.extension),u=await this.getModelForRequest(a,o.extension),d=Mm.to(a,l,u,this.getDiagnosticsWhenEnabled(o.extension),this.getToolsForRequest(o.extension,a),o.extension,this._logService);return o.provider.provideParticipantDetection(d,{history:c},{participants:s.participants,location:Um.to(s.location)},r)}async _createRequest(e,t,i){const s=an(e),r=await this.prepareHistoryTurns(i,s.agentId,t);let o;if(s.locationData?.type===zn.Editor){const a=this._documents.getDocument(s.locationData.document);o=new lP(a,hs.to(s.locationData.selection),z.to(s.locationData.wholeRange))}else if(s.locationData?.type===zn.Notebook){const a=this._documents.getDocument(s.locationData.sessionInputUri);o=new cP(a)}return{request:s,location:o,history:r}}async getModelForRequest(e,t){let i;if(e.userSelectedModelId&&(i=await this._languageModels.getLanguageModelByIdentifier(t,e.userSelectedModelId)),!i&&(i=await this._languageModels.getDefaultLanguageModel(t),!i))throw new Error("Language model unavailable");return i}async $setRequestPaused(e,t,i){const s=this._agents.get(e);if(!s)return;const r=fn.find(this._inFlightRequests,o=>o.requestId===t);r&&s.setChatRequestPauseState({request:r.extRequest,isPaused:i})}async $invokeAgent(e,t,i,s){const r=this._agents.get(e);if(!r)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);let o,a;try{const{request:l,location:c,history:u}=await this._createRequest(t,i,r.extension);let d=this._sessionDisposables.get(l.sessionId);d||(d=new xe,this._sessionDisposables.set(l.sessionId,d)),o=new lM(r.extension,l,this._proxy,this._commands.converter,d);const f=await this.getModelForRequest(l,r.extension),p=Mm.to(l,c,f,this.getDiagnosticsWhenEnabled(r.extension),this.getToolsForRequest(r.extension,l),r.extension,this._logService);a={requestId:t.requestId,extRequest:p},this._inFlightRequests.add(a);const _=r.invoke(p,{history:u},o.apiObject,s);return await dM(1e3,Promise.resolve(_).then(w=>{if(w?.metadata)try{JSON.stringify(w.metadata)}catch(E){const S=`result.metadata MUST be JSON.stringify-able. Got error: ${E.message}`;return this._logService.error(`[${r.extension.identifier.value}] [@${r.id}] ${S}`,r.extension),{errorDetails:{message:S},timings:o?.timings,nextQuestion:w.nextQuestion}}let v;return w?.errorDetails&&(v={...w.errorDetails,responseIsIncomplete:!0}),(v?.responseIsRedacted||v?.isQuotaExceeded||v?.confirmationButtons)&&$(r.extension,"chatParticipantPrivate"),{errorDetails:v,timings:o?.timings,metadata:w?.metadata,nextQuestion:w?.nextQuestion}}),s)}catch(l){this._logService.error(l,r.extension),l instanceof yn&&l.cause&&(l=l.cause);const c=l instanceof Error&&l.name==="ChatQuotaExceeded";return{errorDetails:{message:gu(l),responseIsIncomplete:!0,isQuotaExceeded:c}}}finally{a&&this._inFlightRequests.delete(a),o?.close()}}getDiagnosticsWhenEnabled(e){return dt(e,"chatReferenceDiagnostic")?this._diagnostics.getDiagnostics():[]}getToolsForRequest(e,t){if(!t.userSelectedTools)return new Map;const i=new Map;for(const s of this._tools.getTools(e))typeof t.userSelectedTools[s.name]=="boolean"&&i.set(s.name,t.userSelectedTools[s.name]);return i}async prepareHistoryTurns(e,t,i){const s=[];for(const r of i.history){const o=mc.to(r.result),a=t===r.request.agentId?o:{...o,metadata:void 0},l=[],c=[];for(const p of r.request.variables.variables)if(p.kind==="tool")c.push($h.to(p));else if(p.kind==="toolset")c.push(...p.value.map($h.to));else{const _=$m.to(p,this.getDiagnosticsWhenEnabled(e),this._logService);_&&l.push(_)}const u=dt(e,"chatParticipantPrivate")?r.request.editedFileEvents:void 0,d=new Ib(r.request.message,r.request.command,l,r.request.agentId,c,u);s.push(d);const f=rn(r.response.map(p=>Fm.toContent(p,this._commands.converter)));s.push(new aP(f,a,r.request.agentId,r.request.command))}return s}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e),this._onDidDisposeChatSession.fire(e)}async $provideFollowups(e,t,i,s,r){const o=this._agents.get(t);if(!o)return Promise.resolve([]);const a=an(e),l=await this.prepareHistoryTurns(o.extension,o.id,s),c=mc.to(i);return(await o.provideFollowups(c,{history:l},r)).filter(u=>{const d=!u.participant||fn.some(this._agents.values(),f=>f.id===u.participant&&tt.equals(f.extension.identifier,o.extension.identifier));return d||this._logService.warn(`[@${o.id}] ChatFollowup refers to an unknown participant: ${u.participant}`),d}).map(u=>Im.from(u,a))}$acceptFeedback(e,t,i){const s=this._agents.get(e);if(!s)return;const r=mc.to(t);let o;switch(i.direction){case lg.Down:o=wh.Unhelpful;break;case lg.Up:o=wh.Helpful;break}const a={result:r,kind:o,unhelpfulReason:dt(s.extension,"chatParticipantAdditions")?i.reason:void 0};s.acceptFeedback(Object.freeze(a))}$acceptAction(e,t,i){const s=this._agents.get(e);if(!s||i.action.kind==="vote")return;const r=hy.to(t,i,this._commands.converter);r&&s.acceptAction(Object.freeze(r))}async $invokeCompletionProvider(e,t,i){const s=this._agents.get(e);if(!s)return[];let r=this._completionDisposables.get(e);return r?r.clear():(r=new xe,this._completionDisposables.set(e,r)),(await s.invokeCompletionProvider(t,i)).map(a=>dy.from(a,this._commands.converter,r))}async $provideChatTitle(e,t,i){const s=this._agents.get(e);if(!s)return;const r=await this.prepareHistoryTurns(s.extension,s.id,{history:t});return await s.provideTitle({history:r},i)}};pr._idPool=0,pr._participantDetectionProviderIdPool=0,pr._relatedFilesProviderIdPool=0;let L0=pr;class cM{constructor(e,t){this.extension=e,this.provider=t}}class uM{constructor(e,t){this.extension=e,this.provider=t}}class GI{constructor(e,t,i,s,r){this.extension=e,this.id=t,this._proxy=i,this._handle=s,this._requestHandler=r,this._onDidReceiveFeedback=new N,this._onDidPerformAction=new N,this._pauseStateEmitter=new N}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}setChatRequestPauseState(e){this._pauseStateEmitter.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const s=await this._followupProvider.provideFollowups(e,t,i);return s?s.filter(r=>!(r&&"commandId"in r)).filter(r=>!(r&&"message"in r)):[]}async provideTitle(e,t){if(this._titleProvider)return await this._titleProvider.provideChatTitle(e,t)??void 0}get apiAgent(){let e=!1,t=!1;const i=()=>{e||t||(t=!0,queueMicrotask(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof x?this._iconPath:"light"in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&"dark"in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof Kn?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Re.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Re.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Re.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,additionalWelcomeMessage:!this._additionalWelcomeMessage||typeof this._additionalWelcomeMessage=="string"?this._additionalWelcomeMessage:Re.from(this._additionalWelcomeMessage)}),t=!1}))},s=this;return{get id(){return s.id},get iconPath(){return s._iconPath},set iconPath(r){s._iconPath=r,i()},get requestHandler(){return s._requestHandler},set requestHandler(r){q4(typeof r=="function","Invalid request handler"),s._requestHandler=r},get followupProvider(){return s._followupProvider},set followupProvider(r){s._followupProvider=r,i()},get helpTextPrefix(){return $(s.extension,"defaultChatParticipant"),s._helpTextPrefix},set helpTextPrefix(r){$(s.extension,"defaultChatParticipant"),s._helpTextPrefix=r,i()},get helpTextVariablesPrefix(){return $(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix},set helpTextVariablesPrefix(r){$(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix=r,i()},get helpTextPostfix(){return $(s.extension,"defaultChatParticipant"),s._helpTextPostfix},set helpTextPostfix(r){$(s.extension,"defaultChatParticipant"),s._helpTextPostfix=r,i()},get supportIssueReporting(){return $(s.extension,"chatParticipantPrivate"),s._supportIssueReporting},set supportIssueReporting(r){$(s.extension,"chatParticipantPrivate"),s._supportIssueReporting=r,i()},get onDidReceiveFeedback(){return s._onDidReceiveFeedback.event},set participantVariableProvider(r){if($(s.extension,"chatParticipantAdditions"),s._agentVariableProvider=r,r){if(!r.triggerCharacters.length)throw new Error("triggerCharacters are required");s._proxy.$registerAgentCompletionsProvider(s._handle,s.id,r.triggerCharacters)}else s._proxy.$unregisterAgentCompletionsProvider(s._handle,s.id)},get participantVariableProvider(){return $(s.extension,"chatParticipantAdditions"),s._agentVariableProvider},set additionalWelcomeMessage(r){$(s.extension,"defaultChatParticipant"),s._additionalWelcomeMessage=r,i()},get additionalWelcomeMessage(){return $(s.extension,"defaultChatParticipant"),s._additionalWelcomeMessage},set titleProvider(r){$(s.extension,"defaultChatParticipant"),s._titleProvider=r,i()},get titleProvider(){return $(s.extension,"defaultChatParticipant"),s._titleProvider},get onDidChangePauseState(){return $(s.extension,"chatParticipantAdditions"),s._pauseStateEmitter.event},onDidPerformAction:dt(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(r){s._requester=r,i()},get requester(){return s._requester},dispose(){e=!0,s._followupProvider=void 0,s._onDidReceiveFeedback.dispose(),s._proxy.$unregisterAgent(s._handle)}}}invoke(e,t,i,s){return this._requestHandler(e,t,i,s)}}function dM(n,e,t){return new Promise((i,s)=>{const r=t.onCancellationRequested(async()=>{r.dispose(),await us(n),i(void 0)});e.then(i,s).finally(()=>r.dispose())})}class hM{constructor(e){this._items=new Map,this._proxy=e.getProxy(ee.MainThreadChatStatus)}createChatStatusItem(e,t){const i=fM(e.identifier,t);if(this._items.has(i))throw new Error(`Chat status item '${t}' already exists`);const s={id:i,title:"",description:"",detail:""};let r=!1,o=!1;const a=()=>{if(r)throw new Error("Chat status item is disposed");o&&this._proxy.$setEntry(t,s)},l=Object.freeze({id:t,get title(){return s.title},set title(c){s.title=c,a()},get description(){return s.description},set description(c){s.description=c,a()},get detail(){return s.detail},set detail(c){s.detail=c,a()},show:()=>{o=!0,a()},hide:()=>{o=!1,this._proxy.$disposeEntry(t)},dispose:()=>{r=!0,this._proxy.$disposeEntry(t),this._items.delete(i)}});return this._items.set(i,l),l}}function fM(n,e){return`${tt.toKey(n)}.${e}`}class pM{constructor(e){const t=e.getProxy(ee.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const a5="vscode-cdn.net",gM=`vscode-resource.${a5}`,N0=`'self' https://*.${a5}`;function _d(n,e){return n.scheme===le.http||n.scheme===le.https?n:(e&&e.authority&&e.isRemote&&n.scheme===le.file&&(n=x.from({scheme:le.vscodeRemote,authority:e.authority,path:n.path})),x.from({scheme:le.https,authority:`${n.scheme}+${mM(n.authority)}.${gM}`,path:n.path,fragment:n.fragment,query:n.query}))}function mM(n){return n.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=R.a&&t<=R.z||t>=R.A&&t<=R.Z||t>=R.Digit0&&t<=R.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class _M{constructor(e,t,i){this._proxy=e,this._editors=t,this._remoteInfo=i,this._handlePool=0,this._disposables=new xe,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{const s=t.getVisibleTextEditors();for(const r of this._insets.values())s.indexOf(r.editor)<0&&r.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,s,r){let o;for(const p of this._editors.getVisibleTextEditors(!0))if(p.value===e){o=p;break}if(!o)throw new Error("not a visible editor");const a=this,l=this._handlePool++,c=new N,u=new N,d=new class{constructor(){this._html="",this._options=Object.create(null)}asWebviewUri(p){return _d(p,a._remoteInfo)}get cspSource(){return N0}set options(p){this._options=p,a._proxy.$setOptions(l,p)}get options(){return this._options}set html(p){this._html=p,a._proxy.$setHtml(l,p)}get html(){return this._html}get onDidReceiveMessage(){return c.event}postMessage(p){return a._proxy.$postMessage(l,p)}},f=new class{constructor(){this.editor=e,this.line=t,this.height=i,this.webview=d,this.onDidDispose=u.event}dispose(){a._insets.has(l)&&(a._insets.delete(l),a._proxy.$disposeEditorInset(l),u.fire(),u.dispose(),c.dispose())}};return this._proxy.$createEditorInset(l,o.id,o.value.document.uri,t+1,i,s||{},r.identifier,r.extensionLocation),this._insets.set(l,{editor:e,inset:f,onDidReceiveMessage:c}),f}$onDidDispose(e){const t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}}const A1=class A1{constructor(e){this.providers=new Map,this._proxy=e.getProxy(ee.MainThreadCodeMapper)}async $mapCode(e,t,i){const s=this.providers.get(e);if(!s)throw new Error(`Received request to map code for unknown provider handle ${e}`);const r={textEdit:(l,c)=>{c=Ri(c),this._proxy.$handleProgress(t.requestId,{uri:l,edits:c.map(pn.from)})},notebookEdit:(l,c)=>{c=Ri(c),this._proxy.$handleProgress(t.requestId,{uri:l,edits:c.map(Lm.from)})}},o={location:t.location,chatRequestId:t.chatRequestId,chatRequestModel:t.chatRequestModel,chatSessionId:t.chatSessionId,codeBlocks:t.codeBlocks.map(l=>({code:l.code,resource:x.revive(l.resource),markdownBeforeBlock:l.markdownBeforeBlock}))};return await s.provideMappedEdits(o,r,i)??null}registerMappedEditsProvider(e,t){const i=A1._providerHandlePool++;return this._proxy.$registerCodeMapperProvider(i,e.displayName??e.name),this.providers.set(i,t),{dispose:()=>this._proxy.$unregisterCodeMapperProvider(i)}}};A1._providerHandlePool=0;let O0=A1;function vM(n,e,t){const i=n.getProxy(ee.MainThreadComments),p=class p{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new Lr,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===st.CommentController){const E=this._commentControllers.get(v.handle);return E?E.value:v}else if(v&&v.$mid===st.CommentThread){const E=v,S=this._commentControllers.get(E.commentControlHandle);if(!S)return E;const A=S.getCommentThread(E.commentThreadHandle);return A?A.value:E}else if(v&&(v.$mid===st.CommentThreadReply||v.$mid===st.CommentThreadInstance)){const E=this._commentControllers.get(v.thread.commentControlHandle);if(!E)return v;const S=E.getCommentThread(v.thread.commentThreadHandle);return S?v.$mid===st.CommentThreadInstance?S.value:{thread:S.value,text:v.text}:v}else if(v&&v.$mid===st.CommentNode){const E=this._commentControllers.get(v.thread.commentControlHandle);if(!E)return v;const S=E.getCommentThread(v.thread.commentThreadHandle);if(!S)return v;const A=v.commentUniqueId,G=S.getCommentByUniqueId(A);return G||v}else if(v&&v.$mid===st.CommentThreadNode){const E=this._commentControllers.get(v.thread.commentControlHandle);if(!E)return v;const S=E.getCommentThread(v.thread.commentThreadHandle);if(!S)return v;const A=v.text,G=v.commentUniqueId,W=S.getCommentByUniqueId(G);return W?(typeof W.body=="string"?W.body=A:W.body=new mi(A),W):v}return v}})}createCommentController(v,E,S){const A=p.handlePool++,G=new o(v,A,E,S);this._commentControllers.set(G.handle,G);const W=this._commentControllersByExtension.get(v.identifier)||[];return W.push(G),this._commentControllersByExtension.set(v.identifier,W),G.value}async $createCommentThreadTemplate(v,E,S,A){const G=this._commentControllers.get(v);G&&G.$createCommentThreadTemplate(E,S,A)}async $setActiveComment(v,E){const S=this._commentControllers.get(v);S&&S.$setActiveComment(E??void 0)}async $updateCommentThreadTemplate(v,E,S){const A=this._commentControllers.get(v);A&&A.$updateCommentThreadTemplate(E,S)}$deleteCommentThread(v,E){this._commentControllers.get(v)?.$deleteCommentThread(E)}async $updateCommentThread(v,E,S){this._commentControllers.get(v)?.$updateCommentThread(E,S)}async $provideCommentingRanges(v,E,S){const A=this._commentControllers.get(v);if(!A||!A.commentingRangeProvider)return Promise.resolve(void 0);const G=await t.ensureDocumentData(x.revive(E));return Ln(async()=>{const W=await A.commentingRangeProvider?.provideCommentingRanges(G.document,S);let ce;return Array.isArray(W)?ce={ranges:W,fileComments:!1}:W?ce={ranges:W.ranges||[],fileComments:W.enableFileComments||!1}:ce=W??void 0,ce}).then(W=>{let ce;return W&&(ce={ranges:W.ranges.map(Q=>z.from(Q)),fileComments:W.fileComments}),ce})}$toggleReaction(v,E,S,A,G){const W=this._commentControllers.get(v);return!W||!W.reactionHandler?Promise.resolve(void 0):Ln(()=>{const ce=W.getCommentThread(E);if(ce){const Q=ce.getCommentByUniqueId(A.uniqueIdInThread);if(W!==void 0&&Q&&W.reactionHandler)return W.reactionHandler(Q,c(G))}return Promise.resolve(void 0)})}};p.handlePool=0;let s=p;const _=class _{set threadId(v){this._id=v}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(v){(v===void 0!=(this._range===void 0)||!v||!this._range||!v.isEqual(this._range))&&(this._range=v,this.modifications.range=v,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(v){this._canReply!==v&&(this._canReply=v,this.modifications.canReply=v,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(v){this._label=v,this.modifications.label=v,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(v){this._contextValue=v,this.modifications.contextValue=v,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(v){this._comments=v,this.modifications.comments=v,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(v){this._collapseState!==v&&(this._collapseState=v,this.modifications.collapsibleState=v,this._onDidUpdateCommentThread.fire())}get state(){return this._state}set state(v){this._state=v,typeof v=="object"?($(this.extensionDescription,"commentThreadApplicability"),this.modifications.state=v.resolved,this.modifications.applicability=v.applicability):this.modifications.state=v,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(v,E,S,A,G,W,ce,Q,ne){this._commentControllerHandle=E,this._id=S,this._uri=A,this._range=G,this._comments=W,this.extensionDescription=ce,this._isTemplate=Q,this.handle=_._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new N,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new ao,this._acceptInputDisposables.value=new xe,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(E,this.handle,this._id,this._uri,z.from(this._range),this._comments.map(de=>a(this,de,this._commentsMap,this.extensionDescription)),ce.identifier,this._isTemplate,ne),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(E,this.handle)}});const J=this;this.value={get uri(){return J.uri},get range(){return J.range},set range(de){J.range=de},get comments(){return J.comments},set comments(de){J.comments=de},get collapsibleState(){return J.collapsibleState},set collapsibleState(de){J.collapsibleState=de},get canReply(){return J.canReply},set canReply(de){J.canReply=de},get contextValue(){return J.contextValue},set contextValue(de){J.contextValue=de},get label(){return J.label},set label(de){J.label=de},get state(){return J.state},set state(de){J.state=de},reveal:(de,Ce)=>J.reveal(de,Ce),hide:()=>J.hide(),dispose:()=>{J.dispose()}}}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new xe);const v=S=>Object.prototype.hasOwnProperty.call(this.modifications,S),E={};v("range")&&(E.range=z.from(this._range)),v("label")&&(E.label=this.label),v("contextValue")&&(E.contextValue=this.contextValue??null),v("comments")&&(E.comments=this._comments.map(S=>a(this,S,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(E.collapseState=u(this._collapseState)),v("canReply")&&(E.canReply=this.canReply),v("state")&&(E.state=d(this._state)),v("applicability")&&(E.applicability=f(this._state)),v("isTemplate")&&(E.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,E)}getCommentByUniqueId(v){for(const E of this._commentsMap){const S=E[0],A=E[1];if(v===A)return S}}async reveal(v,E){$(this.extensionDescription,"commentReveal");let S;v&&v.body!==void 0?S=v:E=E??v;let A=S?this._commentsMap.get(S):void 0;A??=this._commentsMap.get(this._comments[0]);let G=!0,W=!1;return E?.focus===ph.Reply?(W=!0,G=!1):E?.focus===ph.Comment&&(G=!1),i.$revealCommentThread(this._commentControllerHandle,this.handle,A,{preserveFocus:G,focusReply:W})}async hide(){return i.$hideCommentThread(this._commentControllerHandle,this.handle)}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._localDisposables.forEach(v=>v.dispose())}};_._handlePool=0;let r=_;class o{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(v){this._commentingRangeProvider=v,v?.resourceHints&&$(this._extension,"commentingRangeHint"),i.$updateCommentingRanges(this.handle,v?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(v){this._reactionHandler=v,i.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!v})}get options(){return this._options}set options(v){this._options=v,i.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return $(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return $(this._extension,"activeComment"),this._activeThread?.value}constructor(v,E,S,A){this._extension=v,this._handle=E,this._id=S,this._label=A,this._threads=new Map,i.$registerCommentController(this.handle,S,A,this._extension.identifier.value);const G=this;this.value=Object.freeze({id:G.id,label:G.label,get options(){return G.options},set options(W){G.options=W},get commentingRangeProvider(){return G.commentingRangeProvider},set commentingRangeProvider(W){G.commentingRangeProvider=W},get reactionHandler(){return G.reactionHandler},set reactionHandler(W){G.reactionHandler=W},get activeCommentThread(){return G.activeCommentThread},createCommentThread(W,ce,Q){return G.createCommentThread(W,ce,Q).value},dispose:()=>{G.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,E,S){const A=new r(this.id,this.handle,void 0,v,E,S,this._extension,!1);return this._threads.set(A.handle,A),A}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const E=this._threads.get(v.commentThreadHandle);E&&(this._activeComment=v.uniqueIdInThread?E.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=E)}$createCommentThreadTemplate(v,E,S){const A=new r(this.id,this.handle,void 0,x.revive(v),z.to(E),[],this._extension,!0,S);return A.collapsibleState=Rl.Expanded,this._threads.set(A.handle,A),A}$updateCommentThreadTemplate(v,E){const S=this._threads.get(v);S&&(S.range=z.to(E))}$updateCommentThread(v,E){const S=this._threads.get(v);if(!S)return;(G=>Object.prototype.hasOwnProperty.call(E,G))("collapseState")&&(S.collapsibleState=u(E.collapseState))}$deleteCommentThread(v){this._threads.get(v)?.dispose(),this._threads.delete(v)}getCommentThread(v){return this._threads.get(v)}dispose(){this._threads.forEach(v=>{v.dispose()}),this._localDisposables.forEach(v=>v.dispose())}}function a(w,v,E,S){let A=E.get(v);return A||(A=++w.commentHandle,E.set(v,A)),v.state!==void 0&&$(S,"commentsDraftState"),v.reactions?.some(G=>G.reactors!==void 0)&&$(S,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:A,body:typeof v.body=="string"?v.body:Re.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(G=>l(G)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function l(w){return{label:w.label,iconPath:w.iconPath?m_(w.iconPath):void 0,count:w.count,hasReacted:w.authorHasReacted,reactors:w.reactors&&w.reactors.length>0&&typeof w.reactors[0]!="string"?w.reactors.map(v=>v.name):w.reactors}}function c(w){return{label:w.label||"",count:w.count||0,iconPath:w.iconPath?x.revive(w.iconPath):"",authorHasReacted:w.hasReacted||!1,reactors:w.reactors?.map(v=>({name:v}))}}function u(w){if(w!==void 0)switch(w){case dh.Expanded:return Rl.Expanded;case dh.Collapsed:return Rl.Collapsed}return Rl.Collapsed}function d(w){let v;if(typeof w=="object"?v=w.resolved:v=w,v!==void 0)switch(v){case hh.Unresolved:return td.Unresolved;case hh.Resolved:return td.Resolved}return td.Unresolved}function f(w){let v;if(typeof w=="object"&&(v=w.applicability),v!==void 0)switch(v){case fh.Current:return nd.Current;case fh.Outdated:return nd.Outdated}return nd.Current}return new s}var Rf={exports:{}},gv={},KI;function wM(){return KI||(KI=1,function(n,e){e=n.exports=Xe;var t;typeof process=="object"&&gv&&gv.NODE_DEBUG&&/\bsemver\b/i.test(gv.NODE_DEBUG)?t=function(){var k=Array.prototype.slice.call(arguments,0);k.unshift("SEMVER"),console.log.apply(console,k)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=e.re=[],a=e.src=[],l=0,c=l++;a[c]="0|[1-9]\\d*";var u=l++;a[u]="[0-9]+";var d=l++;a[d]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var f=l++;a[f]="("+a[c]+")\\.("+a[c]+")\\.("+a[c]+")";var p=l++;a[p]="("+a[u]+")\\.("+a[u]+")\\.("+a[u]+")";var _=l++;a[_]="(?:"+a[c]+"|"+a[d]+")";var w=l++;a[w]="(?:"+a[u]+"|"+a[d]+")";var v=l++;a[v]="(?:-("+a[_]+"(?:\\."+a[_]+")*))";var E=l++;a[E]="(?:-?("+a[w]+"(?:\\."+a[w]+")*))";var S=l++;a[S]="[0-9A-Za-z-]+";var A=l++;a[A]="(?:\\+("+a[S]+"(?:\\."+a[S]+")*))";var G=l++,W="v?"+a[f]+a[v]+"?"+a[A]+"?";a[G]="^"+W+"$";var ce="[v=\\s]*"+a[p]+a[E]+"?"+a[A]+"?",Q=l++;a[Q]="^"+ce+"$";var ne=l++;a[ne]="((?:<|>)?=?)";var J=l++;a[J]=a[u]+"|x|X|\\*";var de=l++;a[de]=a[c]+"|x|X|\\*";var Ce=l++;a[Ce]="[v=\\s]*("+a[de]+")(?:\\.("+a[de]+")(?:\\.("+a[de]+")(?:"+a[v]+")?"+a[A]+"?)?)?";var Ae=l++;a[Ae]="[v=\\s]*("+a[J]+")(?:\\.("+a[J]+")(?:\\.("+a[J]+")(?:"+a[E]+")?"+a[A]+"?)?)?";var se=l++;a[se]="^"+a[ne]+"\\s*"+a[Ce]+"$";var q=l++;a[q]="^"+a[ne]+"\\s*"+a[Ae]+"$";var re=l++;a[re]="(?:^|[^\\d])(\\d{1,"+r+"})(?:\\.(\\d{1,"+r+"}))?(?:\\.(\\d{1,"+r+"}))?(?:$|[^\\d])";var Y=l++;a[Y]="(?:~>?)";var ve=l++;a[ve]="(\\s*)"+a[Y]+"\\s+",o[ve]=new RegExp(a[ve],"g");var Le="$1~",Pe=l++;a[Pe]="^"+a[Y]+a[Ce]+"$";var Et=l++;a[Et]="^"+a[Y]+a[Ae]+"$";var St=l++;a[St]="(?:\\^)";var Ke=l++;a[Ke]="(\\s*)"+a[St]+"\\s+",o[Ke]=new RegExp(a[Ke],"g");var Hn="$1^",$t=l++;a[$t]="^"+a[St]+a[Ce]+"$";var Xn=l++;a[Xn]="^"+a[St]+a[Ae]+"$";var Dn=l++;a[Dn]="^"+a[ne]+"\\s*("+ce+")$|^$";var gs=l++;a[gs]="^"+a[ne]+"\\s*("+W+")$|^$";var Ht=l++;a[Ht]="(\\s*)"+a[ne]+"\\s*("+ce+"|"+a[Ce]+")",o[Ht]=new RegExp(a[Ht],"g");var uf="$1$2$3",df=l++;a[df]="^\\s*("+a[Ce]+")\\s+-\\s+("+a[Ce]+")\\s*$";var $r=l++;a[$r]="^\\s*("+a[Ae]+")\\s+-\\s+("+a[Ae]+")\\s*$";var Ro=l++;a[Ro]="(<|>)?=?\\s*\\*";for(var We=0;We<l;We++)t(We,a[We]),o[We]||(o[We]=new RegExp(a[We]));e.parse=Qs;function Qs(k,M){if(k instanceof Xe)return k;if(typeof k!="string"||k.length>i)return null;var H=M?o[Q]:o[G];if(!H.test(k))return null;try{return new Xe(k,M)}catch{return null}}e.valid=C_;function C_(k,M){var H=Qs(k,M);return H?H.version:null}e.clean=Js;function Js(k,M){var H=Qs(k.trim().replace(/^[=v]+/,""),M);return H?H.version:null}e.SemVer=Xe;function Xe(k,M){if(k instanceof Xe){if(k.loose===M)return k;k=k.version}else if(typeof k!="string")throw new TypeError("Invalid Version: "+k);if(k.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Xe))return new Xe(k,M);t("SemVer",k,M),this.loose=M;var H=k.trim().match(M?o[Q]:o[G]);if(!H)throw new TypeError("Invalid Version: "+k);if(this.raw=k,this.major=+H[1],this.minor=+H[2],this.patch=+H[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");H[4]?this.prerelease=H[4].split(".").map(function(oe){if(/^[0-9]+$/.test(oe)){var X=+oe;if(X>=0&&X<s)return X}return oe}):this.prerelease=[],this.build=H[5]?H[5].split("."):[],this.format()}Xe.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},Xe.prototype.toString=function(){return this.version},Xe.prototype.compare=function(k){return t("SemVer.compare",this.version,this.loose,k),k instanceof Xe||(k=new Xe(k,this.loose)),this.compareMain(k)||this.comparePre(k)},Xe.prototype.compareMain=function(k){return k instanceof Xe||(k=new Xe(k,this.loose)),Hr(this.major,k.major)||Hr(this.minor,k.minor)||Hr(this.patch,k.patch)},Xe.prototype.comparePre=function(k){if(k instanceof Xe||(k=new Xe(k,this.loose)),this.prerelease.length&&!k.prerelease.length)return-1;if(!this.prerelease.length&&k.prerelease.length)return 1;if(!this.prerelease.length&&!k.prerelease.length)return 0;var M=0;do{var H=this.prerelease[M],oe=k.prerelease[M];if(t("prerelease compare",M,H,oe),H===void 0&&oe===void 0)return 0;if(oe===void 0)return 1;if(H===void 0)return-1;if(H===oe)continue;return Hr(H,oe)}while(++M)},Xe.prototype.inc=function(k,M){switch(k){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",M);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",M);break;case"prepatch":this.prerelease.length=0,this.inc("patch",M),this.inc("pre",M);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",M),this.inc("pre",M);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var H=this.prerelease.length;--H>=0;)typeof this.prerelease[H]=="number"&&(this.prerelease[H]++,H=-2);H===-1&&this.prerelease.push(0)}M&&(this.prerelease[0]===M?isNaN(this.prerelease[1])&&(this.prerelease=[M,0]):this.prerelease=[M,0]);break;default:throw new Error("invalid increment argument: "+k)}return this.format(),this.raw=this.version,this},e.inc=hf;function hf(k,M,H,oe){typeof H=="string"&&(oe=H,H=void 0);try{return new Xe(k,H).inc(M,oe).version}catch{return null}}e.diff=T_;function T_(k,M){if(ms(k,M))return null;var H=Qs(k),oe=Qs(M);if(H.prerelease.length||oe.prerelease.length){for(var X in H)if((X==="major"||X==="minor"||X==="patch")&&H[X]!==oe[X])return"pre"+X;return"prerelease"}for(var X in H)if((X==="major"||X==="minor"||X==="patch")&&H[X]!==oe[X])return X}e.compareIdentifiers=Hr;var ff=/^[0-9]+$/;function Hr(k,M){var H=ff.test(k),oe=ff.test(M);return H&&oe&&(k=+k,M=+M),H&&!oe?-1:oe&&!H?1:k<M?-1:k>M?1:0}e.rcompareIdentifiers=P_;function P_(k,M){return Hr(M,k)}e.major=pf;function pf(k,M){return new Xe(k,M).major}e.minor=A_;function A_(k,M){return new Xe(k,M).minor}e.patch=wu;function wu(k,M){return new Xe(k,M).patch}e.compare=vi;function vi(k,M,H){return new Xe(k,H).compare(new Xe(M,H))}e.compareLoose=R_;function R_(k,M){return vi(k,M,!0)}e.rcompare=L_;function L_(k,M,H){return vi(M,k,H)}e.sort=Br;function Br(k,M){return k.sort(function(H,oe){return e.compare(H,oe,M)})}e.rsort=N_;function N_(k,M){return k.sort(function(H,oe){return e.rcompare(H,oe,M)})}e.gt=dl;function dl(k,M,H){return vi(k,M,H)>0}e.lt=Xs;function Xs(k,M,H){return vi(k,M,H)<0}e.eq=ms;function ms(k,M,H){return vi(k,M,H)===0}e.neq=bu;function bu(k,M,H){return vi(k,M,H)!==0}e.gte=yu;function yu(k,M,H){return vi(k,M,H)>=0}e.lte=xu;function xu(k,M,H){return vi(k,M,H)<=0}e.cmp=Lo;function Lo(k,M,H,oe){var X;switch(M){case"===":typeof k=="object"&&(k=k.version),typeof H=="object"&&(H=H.version),X=k===H;break;case"!==":typeof k=="object"&&(k=k.version),typeof H=="object"&&(H=H.version),X=k!==H;break;case"":case"=":case"==":X=ms(k,H,oe);break;case"!=":X=bu(k,H,oe);break;case">":X=dl(k,H,oe);break;case">=":X=yu(k,H,oe);break;case"<":X=Xs(k,H,oe);break;case"<=":X=xu(k,H,oe);break;default:throw new TypeError("Invalid operator: "+M)}return X}e.Comparator=ai;function ai(k,M){if(k instanceof ai){if(k.loose===M)return k;k=k.value}if(!(this instanceof ai))return new ai(k,M);t("comparator",k,M),this.loose=M,this.parse(k),this.semver===Bi?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var Bi={};ai.prototype.parse=function(k){var M=this.loose?o[Dn]:o[gs],H=k.match(M);if(!H)throw new TypeError("Invalid comparator: "+k);this.operator=H[1],this.operator==="="&&(this.operator=""),H[2]?this.semver=new Xe(H[2],this.loose):this.semver=Bi},ai.prototype.toString=function(){return this.value},ai.prototype.test=function(k){return t("Comparator.test",k,this.loose),this.semver===Bi?!0:(typeof k=="string"&&(k=new Xe(k,this.loose)),Lo(k,this.operator,this.semver,this.loose))},ai.prototype.intersects=function(k,M){if(!(k instanceof ai))throw new TypeError("a Comparator is required");var H;if(this.operator==="")return H=new Bt(k.value,M),hl(this.value,H,M);if(k.operator==="")return H=new Bt(this.value,M),hl(k.semver,H,M);var oe=(this.operator===">="||this.operator===">")&&(k.operator===">="||k.operator===">"),X=(this.operator==="<="||this.operator==="<")&&(k.operator==="<="||k.operator==="<"),De=this.semver.version===k.semver.version,He=(this.operator===">="||this.operator==="<=")&&(k.operator===">="||k.operator==="<="),Qe=Lo(this.semver,"<",k.semver,M)&&(this.operator===">="||this.operator===">")&&(k.operator==="<="||k.operator==="<"),m=Lo(this.semver,">",k.semver,M)&&(this.operator==="<="||this.operator==="<")&&(k.operator===">="||k.operator===">");return oe||X||De&&He||Qe||m},e.Range=Bt;function Bt(k,M){if(k instanceof Bt)return k.loose===M?k:new Bt(k.raw,M);if(k instanceof ai)return new Bt(k.value,M);if(!(this instanceof Bt))return new Bt(k,M);if(this.loose=M,this.raw=k,this.set=k.split(/\s*\|\|\s*/).map(function(H){return this.parseRange(H.trim())},this).filter(function(H){return H.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+k);this.format()}Bt.prototype.format=function(){return this.range=this.set.map(function(k){return k.join(" ").trim()}).join("||").trim(),this.range},Bt.prototype.toString=function(){return this.range},Bt.prototype.parseRange=function(k){var M=this.loose;k=k.trim(),t("range",k,M);var H=M?o[$r]:o[df];k=k.replace(H,U_),t("hyphen replace",k),k=k.replace(o[Ht],uf),t("comparator trim",k,o[Ht]),k=k.replace(o[ve],Le),k=k.replace(o[Ke],Hn),k=k.split(/\s+/).join(" ");var oe=M?o[Dn]:o[gs],X=k.split(" ").map(function(De){return F_(De,M)}).join(" ").split(/\s+/);return this.loose&&(X=X.filter(function(De){return!!De.match(oe)})),X=X.map(function(De){return new ai(De,M)}),X},Bt.prototype.intersects=function(k,M){if(!(k instanceof Bt))throw new TypeError("a Range is required");return this.set.some(function(H){return H.every(function(oe){return k.set.some(function(X){return X.every(function(De){return oe.intersects(De,M)})})})})},e.toComparators=O_;function O_(k,M){return new Bt(k,M).set.map(function(H){return H.map(function(oe){return oe.value}).join(" ").trim().split(" ")})}function F_(k,M){return t("comp",k),k=C(k,M),t("caret",k),k=gf(k,M),t("tildes",k),k=Eu(k,M),t("xrange",k),k=lt(k,M),t("stars",k),k}function wn(k){return!k||k.toLowerCase()==="x"||k==="*"}function gf(k,M){return k.trim().split(/\s+/).map(function(H){return M_(H,M)}).join(" ")}function M_(k,M){var H=M?o[Et]:o[Pe];return k.replace(H,function(oe,X,De,He,Qe){t("tilde",k,oe,X,De,He,Qe);var m;return wn(X)?m="":wn(De)?m=">="+X+".0.0 <"+(+X+1)+".0.0":wn(He)?m=">="+X+"."+De+".0 <"+X+"."+(+De+1)+".0":Qe?(t("replaceTilde pr",Qe),Qe.charAt(0)!=="-"&&(Qe="-"+Qe),m=">="+X+"."+De+"."+He+Qe+" <"+X+"."+(+De+1)+".0"):m=">="+X+"."+De+"."+He+" <"+X+"."+(+De+1)+".0",t("tilde return",m),m})}function C(k,M){return k.trim().split(/\s+/).map(function(H){return _s(H,M)}).join(" ")}function _s(k,M){t("caret",k,M);var H=M?o[Xn]:o[$t];return k.replace(H,function(oe,X,De,He,Qe){t("caret",k,oe,X,De,He,Qe);var m;return wn(X)?m="":wn(De)?m=">="+X+".0.0 <"+(+X+1)+".0.0":wn(He)?X==="0"?m=">="+X+"."+De+".0 <"+X+"."+(+De+1)+".0":m=">="+X+"."+De+".0 <"+(+X+1)+".0.0":Qe?(t("replaceCaret pr",Qe),Qe.charAt(0)!=="-"&&(Qe="-"+Qe),X==="0"?De==="0"?m=">="+X+"."+De+"."+He+Qe+" <"+X+"."+De+"."+(+He+1):m=">="+X+"."+De+"."+He+Qe+" <"+X+"."+(+De+1)+".0":m=">="+X+"."+De+"."+He+Qe+" <"+(+X+1)+".0.0"):(t("no pr"),X==="0"?De==="0"?m=">="+X+"."+De+"."+He+" <"+X+"."+De+"."+(+He+1):m=">="+X+"."+De+"."+He+" <"+X+"."+(+De+1)+".0":m=">="+X+"."+De+"."+He+" <"+(+X+1)+".0.0"),t("caret return",m),m})}function Eu(k,M){return t("replaceXRanges",k,M),k.split(/\s+/).map(function(H){return ge(H,M)}).join(" ")}function ge(k,M){k=k.trim();var H=M?o[q]:o[se];return k.replace(H,function(oe,X,De,He,Qe,m){t("xRange",k,oe,X,De,He,Qe,m);var b=wn(De),I=b||wn(He),fe=I||wn(Qe),ze=fe;return X==="="&&ze&&(X=""),b?X===">"||X==="<"?oe="<0.0.0":oe="*":X&&ze?(I&&(He=0),fe&&(Qe=0),X===">"?(X=">=",I?(De=+De+1,He=0,Qe=0):fe&&(He=+He+1,Qe=0)):X==="<="&&(X="<",I?De=+De+1:He=+He+1),oe=X+De+"."+He+"."+Qe):I?oe=">="+De+".0.0 <"+(+De+1)+".0.0":fe&&(oe=">="+De+"."+He+".0 <"+De+"."+(+He+1)+".0"),t("xRange return",oe),oe})}function lt(k,M){return t("replaceStars",k,M),k.trim().replace(o[Ro],"")}function U_(k,M,H,oe,X,De,He,Qe,m,b,I,fe,ze){return wn(H)?M="":wn(oe)?M=">="+H+".0.0":wn(X)?M=">="+H+"."+oe+".0":M=">="+M,wn(m)?Qe="":wn(b)?Qe="<"+(+m+1)+".0.0":wn(I)?Qe="<"+m+"."+(+b+1)+".0":fe?Qe="<="+m+"."+b+"."+I+"-"+fe:Qe="<="+Qe,(M+" "+Qe).trim()}Bt.prototype.test=function(k){if(!k)return!1;typeof k=="string"&&(k=new Xe(k,this.loose));for(var M=0;M<this.set.length;M++)if($_(this.set[M],k))return!0;return!1};function $_(k,M){for(var H=0;H<k.length;H++)if(!k[H].test(M))return!1;if(M.prerelease.length){for(var H=0;H<k.length;H++)if(t(k[H].semver),k[H].semver!==Bi&&k[H].semver.prerelease.length>0){var oe=k[H].semver;if(oe.major===M.major&&oe.minor===M.minor&&oe.patch===M.patch)return!0}return!1}return!0}e.satisfies=hl;function hl(k,M,H){try{M=new Bt(M,H)}catch{return!1}return M.test(k)}e.maxSatisfying=H_;function H_(k,M,H){var oe=null,X=null;try{var De=new Bt(M,H)}catch{return null}return k.forEach(function(He){De.test(He)&&(!oe||X.compare(He)===-1)&&(oe=He,X=new Xe(oe,H))}),oe}e.minSatisfying=fl;function fl(k,M,H){var oe=null,X=null;try{var De=new Bt(M,H)}catch{return null}return k.forEach(function(He){De.test(He)&&(!oe||X.compare(He)===1)&&(oe=He,X=new Xe(oe,H))}),oe}e.validRange=B_;function B_(k,M){try{return new Bt(k,M).range||"*"}catch{return null}}e.ltr=W_;function W_(k,M,H){return pl(k,M,"<",H)}e.gtr=V_;function V_(k,M,H){return pl(k,M,">",H)}e.outside=pl;function pl(k,M,H,oe){k=new Xe(k,oe),M=new Bt(M,oe);var X,De,He,Qe,m;switch(H){case">":X=dl,De=xu,He=Xs,Qe=">",m=">=";break;case"<":X=Xs,De=yu,He=dl,Qe="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(hl(k,M,oe))return!1;for(var b=0;b<M.set.length;++b){var I=M.set[b],fe=null,ze=null;if(I.forEach(function(kt){kt.semver===Bi&&(kt=new ai(">=0.0.0")),fe=fe||kt,ze=ze||kt,X(kt.semver,fe.semver,oe)?fe=kt:He(kt.semver,ze.semver,oe)&&(ze=kt)}),fe.operator===Qe||fe.operator===m||(!ze.operator||ze.operator===Qe)&&De(k,ze.semver))return!1;if(ze.operator===m&&He(k,ze.semver))return!1}return!0}e.prerelease=z_;function z_(k,M){var H=Qs(k,M);return H&&H.prerelease.length?H.prerelease:null}e.intersects=q_;function q_(k,M,H){return k=new Bt(k,H),M=new Bt(M,H),k.intersects(M)}e.coerce=j_;function j_(k){if(k instanceof Xe)return k;if(typeof k!="string")return null;var M=k.match(o[re]);return M==null?null:Qs((M[1]||"0")+"."+(M[2]||"0")+"."+(M[3]||"0"))}}(Rf,Rf.exports)),Rf.exports}wM();const l5=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,bM=/^-(\d{4})(\d{2})(\d{2})$/;function yM(n){return n=n.trim(),n==="*"||l5.test(n)}function c5(n){if(!yM(n))return null;if(n=n.trim(),n==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=n.match(l5);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function u5(n){if(!n)return null;const e=n.majorBase,t=n.majorMustEqual,i=n.minorBase;let s=n.minorMustEqual;const r=n.patchBase;let o=n.patchMustEqual;n.hasCaret&&(e===0||(s=!1),o=!1);let a=0;if(n.preRelease){const l=bM.exec(n.preRelease);if(l){const[,c,u,d]=l;a=Date.UTC(Number(c),Number(u)-1,Number(d))}}return{majorBase:e,majorMustEqual:t,minorBase:i,minorMustEqual:s,patchBase:r,patchMustEqual:o,isMinimum:n.hasGreaterEquals,notBefore:a}}class xM{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function EM(n,e){if(e.serializeBuffersForPostMessage){const t=new xM,s=JSON.stringify(n,(o,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const l=SM(a);if(l)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a.buffer),view:{type:l,byteLength:a.byteLength,byteOffset:a.byteOffset}}}return a}),r=t.buffers.map(o=>{const a=new Uint8Array(o);return ue.wrap(a)});return{message:s,buffers:r}}else return{message:JSON.stringify(n),buffers:[]}}function SM(n){switch(n.constructor.name){case"Int8Array":return Vt.Int8Array;case"Uint8Array":return Vt.Uint8Array;case"Uint8ClampedArray":return Vt.Uint8ClampedArray;case"Int16Array":return Vt.Int16Array;case"Uint16Array":return Vt.Uint16Array;case"Int32Array":return Vt.Int32Array;case"Uint32Array":return Vt.Uint32Array;case"Float32Array":return Vt.Float32Array;case"Float64Array":return Vt.Float64Array;case"BigInt64Array":return Vt.BigInt64Array;case"BigUint64Array":return Vt.BigUint64Array}}function kM(n,e){const t=e.map(r=>{const o=new ArrayBuffer(r.byteLength);return new Uint8Array(o).set(r.buffer),o}),i=e.length?(r,o)=>{if(o&&typeof o=="object"&&o.$$vscode_array_buffer_reference$$){const a=o,{index:l}=a,c=t[l];if(a.view)switch(a.view.type){case Vt.Int8Array:return new Int8Array(c,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case Vt.Uint8Array:return new Uint8Array(c,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case Vt.Uint8ClampedArray:return new Uint8ClampedArray(c,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case Vt.Int16Array:return new Int16Array(c,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case Vt.Uint16Array:return new Uint16Array(c,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case Vt.Int32Array:return new Int32Array(c,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case Vt.Uint32Array:return new Uint32Array(c,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case Vt.Float32Array:return new Float32Array(c,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case Vt.Float64Array:return new Float64Array(c,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case Vt.BigInt64Array:return new BigInt64Array(c,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case Vt.BigUint64Array:return new BigUint64Array(c,a.view.byteOffset,a.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw new Error("Unknown array buffer view type")}return c}return o}:void 0;return{message:JSON.parse(n,i),arrayBuffers:t}}class DM{#e;#t;#n;#i;#r;#s;#a;#o;#l;#c;#u;#h;constructor(e,t,i,s,r,o,a){this.#a="",this.#l=!1,this.#c=!1,this._onMessageEmitter=new N,this.onDidReceiveMessage=this._onMessageEmitter.event,this.#d=new N,this._onDidDispose=this.#d.event,this.#e=e,this.#t=t,this.#o=i,this.#i=s,this.#r=r,this.#s=o,this.#u=du(o),this.#h=IM(o),this.#n=a}#d;dispose(){this.#l=!0,this.#d.fire(),this.#d.dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return this.#c=!0,_d(e,this.#i)}get cspSource(){const e=this.#s.extensionLocation;if(e.scheme===le.https||e.scheme===le.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+N0}return N0}get html(){return this.assertNotDisposed(),this.#a}set html(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#h&&!this.#c&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(this.#c=!0,this.#n.report("Webview vscode-resource: uris",this.#s,"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),this.#t.$setHtml(this.#e,this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),this.#o}set options(e){this.assertNotDisposed(),Gn(this.#o,e)||this.#t.$setOptions(this.#e,d5(this.#s,this.#r,e)),this.#o=e}async postMessage(e){if(this.#l)return!1;const t=EM(e,{serializeBuffersForPostMessage:this.#u});return this.#t.$postMessage(this.#e,t.message,...t.buffers)}assertNotDisposed(){if(this.#l)throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!this.#h)return e;const t=this.#s.extensionLocation?.scheme===le.vscodeRemote,i=this.#s.extensionLocation.scheme===le.vscodeRemote?this.#s.extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,r,o,a,l,c)=>{const u=x.from({scheme:a||"file",path:decodeURIComponent(l)}),d=_d(u,{isRemote:t,authority:i}).toString();return`${r}${d}${c}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,r,o,a,l,c)=>{const u=x.from({scheme:a||"file",path:decodeURIComponent(l)}),d=_d(u,{isRemote:t,authority:i}).toString();return`${r}${d}${c}`})}}function du(n){try{const e=u5(c5(n.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function IM(n){try{const e=u5(c5(n.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class CM extends Se{constructor(e,t,i,s,r){super(),this.remoteInfo=t,this.workspace=i,this._logService=s,this._deprecationService=r,this._webviews=new Map,this._webviewProxy=e.getProxy(ee.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const s=this.getWebview(e);if(s){const{message:r}=kM(t,i.value);s._onMessageEmitter.fire(r)}}$onMissingCsp(e,t){this._logService.warn(`${t} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(e,t,i){const s=new DM(e,this._webviewProxy,TM(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,s);const r=s._onDidDispose(()=>{r.dispose(),this.deleteWebview(e)});return s}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function n1(n){return{id:n.identifier,location:n.extensionLocation}}function d5(n,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||PM(n,e)}}function TM(n){return{enableCommandUris:n.enableCommandUris,enableScripts:n.enableScripts,enableForms:n.enableForms,portMapping:n.portMapping,localResourceRoots:n.localResourceRoots?.map(e=>x.from(e))}}function PM(n,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),n.extensionLocation]}const R1=class R1{constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){const t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){R1.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};R1.enableDebugLogging=!1;let Oi=R1;class AM{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new Oi("custom documents")}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(const t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw new Error("Backup requires a valid storage path");const e=MM(this.document.uri)+this._backupCounter++;return An(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){const t=this._edits.get(e,0);if(!t)throw new Error("No edit found");return t}}class RM{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const s=this.key(e,t.uri);if(this._documents.has(s))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const r=new AM(t,i);return this._documents.set(s,r),r}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var go;(function(n){n[n.Text=0]="Text",n[n.Custom=1]="Custom"})(go||(go={}));class LM{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:go.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:go.Custom,extension:t,provider:i})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw new Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new je(()=>this._providers.delete(e))}}class NM{constructor(e,t,i,s,r){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=s,this._extHostWebviewPanels=r,this._editorProviders=new LM,this._documents=new RM,this._proxy=e.getProxy(ee.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,s){const r=new xe;return OM(i)?(r.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(n1(e),t,s.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},du(e))):(r.add(this._editorProviders.addCustomProvider(t,e,i)),Lf(i)&&r.add(i.onDidChangeCustomDocument(o=>{const a=this.getCustomDocumentEntry(t,o.document.uri);if(FM(o)){const l=a.addEdit(o);this._proxy.$onDidEdit(o.document.uri,t,l,o.label)}else this._proxy.$onContentChange(o.document.uri,t)})),this._proxy.$registerCustomEditorProvider(n1(e),t,s.webviewOptions||{},!!s.supportsMultipleEditorsPerDocument,du(e))),je.from(r,new je(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,s,r){const o=this._editorProviders.get(t);if(!o)throw new Error(`No provider found for '${t}'`);if(o.type!==go.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=x.revive(e),l=await o.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:s?.buffer},r);let c;return Lf(o.provider)&&this._extensionStoragePaths&&(c=this._extensionStoragePaths.workspaceValue(o.extension)??this._extensionStoragePaths.globalValue(o.extension)),this._documents.add(t,l,c),{editable:Lf(o.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==go.Custom)throw new Error(`Invalid provider type for '${t}'`);const s=x.revive(e),{document:r}=this.getCustomDocumentEntry(t,s);this._documents.delete(t,r),r.dispose()}async $resolveCustomEditor(e,t,i,s,r,o){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const l=hn.to(r),c=this._extHostWebview.createNewWebview(t,s.contentOptions,a.extension),u=this._extHostWebviewPanels.createNewWebviewPanel(t,i,s.title,l,s.options,c,s.active),d=x.revive(e);switch(a.type){case go.Custom:{const{document:f}=this.getCustomDocumentEntry(i,d);return a.provider.resolveCustomEditor(f,u,o)}case go.Text:{const f=this._extHostDocuments.getDocument(d);return a.provider.resolveCustomTextEditor(f,u,o)}default:throw new Error("Unknown webview provider type")}}$disposeEdits(e,t,i){this.getCustomDocumentEntry(t,e).disposeEdits(i)}async $onMoveCustomEditor(e,t,i){const s=this._editorProviders.get(i);if(!s)throw new Error(`No provider found for '${i}'`);if(!s.provider.moveCustomTextEditor)throw new Error(`Provider does not implement move '${i}'`);const r=this._extHostWebviewPanels.getWebviewPanel(e);if(!r)throw new Error("No webview found");const o=x.revive(t),a=this._extHostDocuments.getDocument(o);await s.provider.moveCustomTextEditor(a,r,yt.None)}async $undo(e,t,i,s){return this.getCustomDocumentEntry(t,e).undo(i,s)}async $redo(e,t,i,s){return this.getCustomDocumentEntry(t,e).redo(i,s)}async $revert(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(s.document,i),s.disposeBackup()}async $onSave(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(s.document,i),s.disposeBackup()}async $onSaveAs(e,t,i,s){const r=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(r.document,x.revive(i),s)}async $backup(e,t,i){const s=this.getCustomDocumentEntry(t,e),o=await this.getCustomEditorProvider(t).backupCustomDocument(s.document,{destination:s.getNewBackupUri()},i);return s.updateBackup(o),o.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,x.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!Lf(i))throw new Error("Custom document is not editable");return i}}function Lf(n){return!!n.onDidChangeCustomDocument}function OM(n){return typeof n.resolveCustomTextEditor=="function"}function FM(n){return typeof n.undo=="function"&&typeof n.redo=="function"}function MM(n){const e=n.scheme===le.file||n.scheme===le.untitled?n.fsPath:n.toString();return Vd(e)+""}var Wo;class i1{#e;#t;#n;constructor(e,t,i,s,r,o,a,l){this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=s,this._modelVersionIdProvider=r,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(s,i),this.#n=new on(c=>o.getComparisonKey(c)),this.#e=a,this.#t=l}dispose(){this._isDisposed||(this.#t.fire([...this.#n.keys()]),this.#e?.$clear(this._owner),this.#n.clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(x.isUri(e)){if(!t){this.delete(e);return}this.#n.set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let o;e=[...e].sort(i1._compareIndexedTuplesByUri);for(const a of e){const[l,c]=a;if((!o||l.toString()!==o.toString())&&(o&&this.#n.get(o).length===0&&this.#n.delete(o),o=l,i.push(l),this.#n.set(l,[])),c)this.#n.get(l)?.push(...c);else{const u=this.#n.get(l);u&&(u.length=0)}}}if(this.#t.fire(i),!this.#e)return;const s=[];let r=0;for(const o of i){let a=[];const l=this.#n.get(o);if(l)if(l.length>this._maxDiagnosticsPerFile){a=[];const c=[Pn.Error,Pn.Warning,Pn.Information,Pn.Hint];e:for(let u=0;u<4;u++)for(const d of l)if(d.severity===c[u]&&a.push({...Jc.from(d),modelVersionId:this._modelVersionIdProvider(o)})===this._maxDiagnosticsPerFile)break e;a.push({severity:si.Info,message:h(2579,"Not showing {0} further errors and warnings.",l.length-this._maxDiagnosticsPerFile),startLineNumber:a[a.length-1].startLineNumber,startColumn:a[a.length-1].startColumn,endLineNumber:a[a.length-1].endLineNumber,endColumn:a[a.length-1].endColumn})}else a=l.map(c=>({...Jc.from(c),modelVersionId:this._modelVersionIdProvider(o)}));if(s.push([o,a]),r+=a.length,r>this._maxDiagnosticsTotal)break}this.#e.$changeMany(this._owner,s)}delete(e){this._checkDisposed(),this.#t.fire([e]),this.#n.delete(e),this.#e?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),this.#t.fire([...this.#n.keys()]),this.#n.clear(),this.#e?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,s]of this)e.call(t,i,s,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of this.#n.keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=this.#n.get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(this.#n.get(e))}_checkDisposed(){if(this._isDisposed)throw new Error("illegal state - object is disposed")}static _compareIndexedTuplesByUri(e,t){return e[0].toString()<t[0].toString()?-1:e[0].toString()>t[0].toString()?1:0}}var Ps;let F0=(Ps=class{static _mapper(e){const t=new on;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,s){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=s,this._collections=new Map,this._onDidChangeDiagnostics=new pA({merge:r=>r.flat(),delay:50}),this.onDidChangeDiagnostics=Ut.map(this._onDidChangeDiagnostics.event,Wo._mapper),this._proxy=e.getProxy(ee.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:s,_onDidChangeDiagnostics:r,_logService:o,_fileSystemInfoService:a,_extHostDocumentsAndEditors:l}=this,c=new class{$changeMany(f,p){s.$changeMany(f,p),o.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,f,p.length===0?"CLEARING":p)}$clear(f){s.$clear(f),o.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,f)}dispose(){s.dispose()}};let u;if(!t)t="_generated_diagnostic_collection_name_#"+Wo._idPool++,u=t;else if(!i.has(t))u=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do u=t+Wo._idPool++;while(i.has(u))}return new class extends i1{constructor(){super(t,u,Wo._maxDiagnosticsTotal,Wo._maxDiagnosticsPerFile,f=>l.getDocument(f)?.version,a.extUri,c,r),i.set(u,this)}dispose(){super.dispose(),i.delete(u)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{const t=new Map,i=[];for(const s of this._collections.values())s.forEach((r,o)=>{let a=t.get(r.toString());typeof a>"u"&&(a=i.length,t.set(r.toString(),a),i.push([r,[]])),i[a][1]=i[a][1].concat(...o)});return i}}_getDiagnostics(e){let t=[];for(const i of this._collections.values())i.has(e)&&(t=t.concat(i.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){const t="_generated_mirror",i=new i1(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,s=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(x.revive(t),i.map(Jc.to))}},Wo=Ps,Ps._idPool=0,Ps._maxDiagnosticsPerFile=1e3,Ps._maxDiagnosticsTotal=1.1*Ps._maxDiagnosticsPerFile,Ps);F0=Wo=V([L(1,at),L(2,hu)],F0);class UM{constructor(e){this._proxy=e.getProxy(ee.MainThreadDialogs)}showOpenDialog(e){return this._proxy.$showOpenDialog(e).then(t=>t?t.map(i=>x.revive(i)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?x.revive(t):void 0)}}const L1=class L1{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(ee.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(le).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=L1._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let s;if(typeof t.onDidChange=="function"){let r;s=t.onDidChange(async o=>{if(o.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${o.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(o))return;r&&await r;const a=this.$provideTextDocumentContent(i,o).then(async l=>{if(!l&&typeof l!="string")return;const c=this._documentsAndEditors.getDocument(o);if(!c)return;const u=_C(l);if(!c.equalLines(u))return this._proxy.$onVirtualDocumentChange(o,l)}).catch(On).finally(()=>{r===a&&(r=void 0)});r=a})}return new je(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),s&&(s.dispose(),s=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(x.revive(t),yt.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};L1._handlePool=0;let M0=L1;class $M{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._callbacks=new To,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,s)=>{const o={dispose:this._callbacks.push([t,i,e])};return Array.isArray(s)&&s.push(o),o}}async $participateInSave(e,t){const i=x.revive(e);let s=!1;const r=setTimeout(()=>s=!0,this._thresholds.timeout),o=[];try{for(const a of[...this._callbacks]){if(s)break;const l=this._documents.getDocument(i),c=await this._deliverEventAsyncAndBlameBadListeners(a,{document:l,reason:bm.to(t)});o.push(c)}}finally{clearTimeout(r)}return o}_deliverEventAsyncAndBlameBadListeners([e,t,i],s){const r=this._badListeners.get(e);return typeof r=="number"&&r>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,s).then(()=>!0,o=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(o),!(o instanceof Error)||o.message!=="concurrent_edits"){const a=this._badListeners.get(e);this._badListeners.set(e,a?a+1:1),typeof a=="number"&&a>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,i,s){const r=[],o=Date.now(),{document:a,reason:l}=s,{version:c}=a,u=Object.freeze({document:a,reason:l,waitUntil(d){if(Object.isFrozen(r))throw mx("waitUntil can not be called async");r.push(Promise.resolve(d))}});try{t.apply(i,[u])}catch(d){return Promise.reject(d)}return new Promise((d,f)=>{const p=setTimeout(()=>f(new Error("timeout")),this._thresholds.timeout);return Promise.all(r).then(_=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-o}ms`),clearTimeout(p),d(_)}).catch(_=>{clearTimeout(p),f(_)})}).then(d=>{const f={edits:[]};for(const p of d)if(Array.isArray(p)&&p.every(_=>_ instanceof ko))for(const{newText:_,newEol:w,range:v}of p)f.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&z.from(v),text:_,eol:w&&eu.from(w)}});if(f.edits.length!==0)return c===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jn(f)):Promise.reject(new Error("concurrent_edits"))})}}class HM{constructor(e,t){this._onDidAddDocument=new N,this._onDidRemoveDocument=new N,this._onDidChangeDocument=new N,this._onDidSaveDocument=new N,this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._toDispose=new xe,this._documentLoader=new Map,this._proxy=e.getProxy(ee.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const s of i)this._onDidRemoveDocument.fire(s.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const s of i)this._onDidAddDocument.fire(s.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;const t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){const t=this.getDocumentData(e);if(!t?.document)throw new Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e,t){const i=this._documentsAndEditors.getDocument(e);if(i&&(!t?.encoding||i.document.encoding===t.encoding))return Promise.resolve(i);let s=this._documentLoader.get(e.toString());return s?t?.encoding&&(s=s.then(r=>r.document.encoding!==t.encoding?this.ensureDocumentData(e,t):r)):(s=this._proxy.$tryOpenDocument(e,t).then(r=>{this._documentLoader.delete(e.toString());const o=x.revive(r);return Tc(this._documentsAndEditors.getDocument(o))},r=>(this._documentLoader.delete(e.toString()),Promise.reject(r))),this._documentLoader.set(e.toString(),s)),s}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>x.revive(t))}$acceptModelLanguageChanged(e,t){const i=x.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");this._onDidRemoveDocument.fire(s.document),s._acceptLanguageId(t),this._onDidAddDocument.fire(s.document)}$acceptModelSaved(e){const t=x.revive(e),i=this._documentsAndEditors.getDocument(t);if(!i)throw new Error("unknown document");this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(i.document)}$acceptDirtyStateChanged(e,t){const i=x.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");s._acceptIsDirty(t),this._onDidChangeDocument.fire({document:s.document,contentChanges:[],reason:void 0})}$acceptEncodingChanged(e,t){const i=x.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");s._acceptEncoding(t),this._onDidChangeDocument.fire({document:s.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const s=x.revive(e),r=this._documentsAndEditors.getDocument(s);if(!r)throw new Error("unknown document");r._acceptIsDirty(i),r.onEvents(t);let o;t.isUndoing?o=ih.Undo:t.isRedoing&&(o=ih.Redo),this._onDidChangeDocument.fire(NC({document:r.document,contentChanges:t.changes.map(a=>({range:z.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:o}))}setWordDefinitionFor(e,t){ZO(e,t)}}class BM{constructor(e){this._provider=new Map,this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(ee.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const s=this._handlePool++;return this._proxy.$registerEmbeddingProvider(s,t),this._provider.set(s,{id:t,provider:i}),we(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(s),this._provider.delete(s)})}async computeEmbeddings(e,t,i){i??=yt.None;let s=!1;typeof t=="string"&&(t=[t],s=!0);const r=await this._proxy.$computeEmbeddings(e,t,i);if(r.length!==t.length)throw new Error;if(s){if(r.length!==1)throw new Error;return r[0]}return r}async $provideEmbeddings(e,t,i){const s=this._provider.get(e);if(!s)return[];const r=await s.provider.provideEmbeddings(t,i);return r||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class WM{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(ee.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const s=this._AiEmbeddingVectorProviders.get(e);if(!s)throw new Error("Embedding vector provider not found");const r=await s.provideEmbeddingVector(t,i);if(!r)throw new Error("Embedding vector provider returned undefined");return r}registerEmbeddingVectorProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(s,i),this._proxy.$registerAiEmbeddingVectorProvider(t,s),new je(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(s),this._AiEmbeddingVectorProviders.delete(s)})}}var Ee;(function(n){n[n.Invalid=0]="Invalid",n[n.Start=1]="Start",n[n.H=2]="H",n[n.HT=3]="HT",n[n.HTT=4]="HTT",n[n.HTTP=5]="HTTP",n[n.F=6]="F",n[n.FI=7]="FI",n[n.FIL=8]="FIL",n[n.BeforeColon=9]="BeforeColon",n[n.AfterColon=10]="AfterColon",n[n.AlmostThere=11]="AlmostThere",n[n.End=12]="End",n[n.Accept=13]="Accept",n[n.LastKnownState=14]="LastKnownState"})(Ee||(Ee={}));class VM{constructor(e,t,i){const s=new Uint8Array(e*t);for(let r=0,o=e*t;r<o;r++)s[r]=i;this._data=s,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class h5{constructor(e){let t=0,i=Ee.Invalid;for(let r=0,o=e.length;r<o;r++){const[a,l,c]=e[r];l>t&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const s=new VM(i,t,Ee.Invalid);for(let r=0,o=e.length;r<o;r++){const[a,l,c]=e[r];s.set(a,l,c)}this._states=s,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?Ee.Invalid:this._states.get(e,t)}}let mv=null;function zM(){return mv===null&&(mv=new h5([[Ee.Start,R.h,Ee.H],[Ee.Start,R.H,Ee.H],[Ee.Start,R.f,Ee.F],[Ee.Start,R.F,Ee.F],[Ee.H,R.t,Ee.HT],[Ee.H,R.T,Ee.HT],[Ee.HT,R.t,Ee.HTT],[Ee.HT,R.T,Ee.HTT],[Ee.HTT,R.p,Ee.HTTP],[Ee.HTT,R.P,Ee.HTTP],[Ee.HTTP,R.s,Ee.BeforeColon],[Ee.HTTP,R.S,Ee.BeforeColon],[Ee.HTTP,R.Colon,Ee.AfterColon],[Ee.F,R.i,Ee.FI],[Ee.F,R.I,Ee.FI],[Ee.FI,R.l,Ee.FIL],[Ee.FI,R.L,Ee.FIL],[Ee.FIL,R.e,Ee.BeforeColon],[Ee.FIL,R.E,Ee.BeforeColon],[Ee.BeforeColon,R.Colon,Ee.AfterColon],[Ee.AfterColon,R.Slash,Ee.AlmostThere],[Ee.AlmostThere,R.Slash,Ee.End]])),mv}var Pt;(function(n){n[n.None=0]="None",n[n.ForceTermination=1]="ForceTermination",n[n.CannotEndIn=2]="CannotEndIn"})(Pt||(Pt={}));let Au=null;function qM(){if(Au===null){Au=new k_(Pt.None);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<n.length;t++)Au.set(n.charCodeAt(t),Pt.ForceTermination);const e=".,;:";for(let t=0;t<e.length;t++)Au.set(e.charCodeAt(t),Pt.CannotEndIn)}return Au}class s1{static _createLink(e,t,i,s,r){let o=r-1;do{const a=t.charCodeAt(o);if(e.get(a)!==Pt.CannotEndIn)break;o--}while(o>s);if(s>0){const a=t.charCodeAt(s-1),l=t.charCodeAt(o);(a===R.OpenParen&&l===R.CloseParen||a===R.OpenSquareBracket&&l===R.CloseSquareBracket||a===R.OpenCurlyBrace&&l===R.CloseCurlyBrace)&&o--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:o+2},url:t.substring(s,o+1)}}static computeLinks(e,t=zM()){const i=qM(),s=[];for(let r=1,o=e.getLineCount();r<=o;r++){const a=e.getLineContent(r),l=a.length;let c=0,u=0,d=0,f=Ee.Start,p=!1,_=!1,w=!1,v=!1;for(;c<l;){let E=!1;const S=a.charCodeAt(c);if(f===Ee.Accept){let A;switch(S){case R.OpenParen:p=!0,A=Pt.None;break;case R.CloseParen:A=p?Pt.None:Pt.ForceTermination;break;case R.OpenSquareBracket:w=!0,_=!0,A=Pt.None;break;case R.CloseSquareBracket:w=!1,A=_?Pt.None:Pt.ForceTermination;break;case R.OpenCurlyBrace:v=!0,A=Pt.None;break;case R.CloseCurlyBrace:A=v?Pt.None:Pt.ForceTermination;break;case R.SingleQuote:case R.DoubleQuote:case R.BackTick:d===S?A=Pt.ForceTermination:d===R.SingleQuote||d===R.DoubleQuote||d===R.BackTick?A=Pt.None:A=Pt.ForceTermination;break;case R.Asterisk:A=d===R.Asterisk?Pt.ForceTermination:Pt.None;break;case R.Pipe:A=d===R.Pipe?Pt.ForceTermination:Pt.None;break;case R.Space:A=w?Pt.None:Pt.ForceTermination;break;default:A=i.get(S)}A===Pt.ForceTermination&&(s.push(s1._createLink(i,a,r,u,c)),E=!0)}else if(f===Ee.End){let A;S===R.OpenSquareBracket?(_=!0,A=Pt.None):A=i.get(S),A===Pt.ForceTermination?E=!0:f=Ee.Accept}else f=t.nextState(f,S),f===Ee.Invalid&&(E=!0);E&&(f=Ee.Start,p=!1,_=!1,v=!1,u=c+1,d=S),c++}f===Ee.Accept&&s.push(s1._createLink(i,a,r,u,l))}return s}}class jM{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){const t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){const e=this._schemes.sort(),t=[];let i,s,r=Ee.LastKnownState,o=Ee.LastKnownState;for(const a of e){let l=i?iR(i,a):0;for(l===0?s=Ee.Start:s=o;l<a.length;l++)l+1===a.length?(r=o,o=Ee.BeforeColon):o+=1,t.push([s,a.toUpperCase().charCodeAt(l),o]),t.push([s,a.toLowerCase().charCodeAt(l),o]),s=o;i=a,o=r}t.push([Ee.BeforeColon,R.Colon,Ee.AfterColon]),t.push([Ee.AfterColon,R.Slash,Ee.End]),this._stateMachine=new h5(t)}}provideDocumentLinks(e){this._initStateMachine();const t=[],i=s1.computeLinks({getLineContent(s){return e.lineAt(s-1).text},getLineCount(){return e.lineCount}},this._stateMachine);for(const s of i){const r=Da.to(s);r.target&&t.push(r)}return t}}class r1{constructor(e,t){this._extHostLanguageFeatures=t,this._linkProvider=new jM,this._fsProvider=new Map,this._registeredSchemes=new Set,this._watches=new Map,this._handlePool=0,this._proxy=e.getProxy(ee.MainThreadFileSystem)}dispose(){this._linkProviderRegistration?.dispose()}registerFileSystemProvider(e,t,i,s={}){if(r1._validateFileSystemProvider(i),this._registeredSchemes.has(t))throw new Error(`a provider for the scheme '${t}' is already registered`);this._linkProviderRegistration||(this._linkProviderRegistration=this._extHostLanguageFeatures.registerDocumentLinkProvider(e,"*",this._linkProvider));const r=this._handlePool++;this._linkProvider.add(t),this._registeredSchemes.add(t),this._fsProvider.set(r,i);let o=ks.FileReadWrite;s.isCaseSensitive&&(o+=ks.PathCaseSensitive),s.isReadonly&&(o+=ks.Readonly),typeof i.copy=="function"&&(o+=ks.FileFolderCopy),typeof i.open=="function"&&typeof i.close=="function"&&typeof i.read=="function"&&typeof i.write=="function"&&($(e,"fsChunks"),o+=ks.FileOpenReadWriteClose);let a;s.isReadonly&&Fr(s.isReadonly)&&s.isReadonly.value!==""&&(a={value:s.isReadonly.value,isTrusted:s.isReadonly.isTrusted,supportThemeIcons:s.isReadonly.supportThemeIcons,supportHtml:s.isReadonly.supportHtml,baseUri:s.isReadonly.baseUri,uris:s.isReadonly.uris}),this._proxy.$registerFileSystemProvider(r,t,o,a).catch(c=>{console.error(`FAILED to register filesystem provider of ${e.identifier.value}-extension for the scheme ${t}`),console.error(c)});const l=i.onDidChangeFile(c=>{const u=[];for(const d of c){const{uri:f,type:p}=d;if(f.scheme!==t)continue;let _;switch(p){case dc.Changed:_=Qu.UPDATED;break;case dc.Created:_=Qu.ADDED;break;case dc.Deleted:_=Qu.DELETED;break;default:throw new Error("Unknown FileChangeType")}u.push({resource:f,type:_})}this._proxy.$onFileSystemChange(r,u)});return we(()=>{l.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(r),this._proxy.$unregisterProvider(r)})}static _validateFileSystemProvider(e){if(!e)throw new Error("MISSING provider");if(typeof e.watch!="function")throw new Error("Provider does NOT implement watch");if(typeof e.stat!="function")throw new Error("Provider does NOT implement stat");if(typeof e.readDirectory!="function")throw new Error("Provider does NOT implement readDirectory");if(typeof e.createDirectory!="function")throw new Error("Provider does NOT implement createDirectory");if(typeof e.readFile!="function")throw new Error("Provider does NOT implement readFile");if(typeof e.writeFile!="function")throw new Error("Provider does NOT implement writeFile");if(typeof e.delete!="function")throw new Error("Provider does NOT implement delete");if(typeof e.rename!="function")throw new Error("Provider does NOT implement rename")}static _asIStat(e){const{type:t,ctime:i,mtime:s,size:r,permissions:o}=e;return{type:t,ctime:i,mtime:s,size:r,permissions:o}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(x.revive(t))).then(i=>r1._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(x.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(x.revive(t))).then(i=>ue.wrap(i))}$writeFile(e,t,i,s){return Promise.resolve(this._getFsProvider(e).writeFile(x.revive(t),i.buffer,s))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(x.revive(t),i))}$rename(e,t,i,s){return Promise.resolve(this._getFsProvider(e).rename(x.revive(t),x.revive(i),s))}$copy(e,t,i,s){const r=this._getFsProvider(e);if(!r.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(r.copy(x.revive(t),x.revive(i),s))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(x.revive(t)))}$watch(e,t,i,s){const r=this._getFsProvider(e).watch(x.revive(i),s);this._watches.set(t,r)}$unwatch(e,t){const i=this._watches.get(t);i&&(i.dispose(),this._watches.delete(t))}$open(e,t,i){const s=this._getFsProvider(e);if(!s.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(s.open(x.revive(t),i))}$close(e,t){const i=this._getFsProvider(e);if(!i.close)throw new Error('FileSystemProvider does not implement "close"');return Promise.resolve(i.close(t))}$read(e,t,i,s){const r=this._getFsProvider(e);if(!r.read)throw new Error('FileSystemProvider does not implement "read"');const o=ue.alloc(s);return Promise.resolve(r.read(t,i,o.buffer,0,s)).then(a=>o.slice(0,a))}$write(e,t,i,s){const r=this._getFsProvider(e);if(!r.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(r.write(t,i,s.buffer,0,s.byteLength))}_getFsProvider(e){const t=this._fsProvider.get(e);if(!t){const i=new Error;throw i.name="ENOPRO",i.message="no provider",i}return t}}const N1=class N1 extends Se{constructor(e,t,i,s){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=s,this.watcherDisposables=this._register(new ao),this.requests=void 0,this.restartCounter=0}init(){const e=new xe;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(t=>this.onFileChanges(t))),e.add(this.watcher.onDidLogMessage(t=>this.onLogMessage(t))),e.add(this.watcher.onDidError(t=>this.onError(t.error,t.request)))}onError(e,t){this.canRestart(e,t)?this.restartCounter<N1.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${e}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${e}`):this.error(e)}canRestart(e,t){return!(!this.options.restartOnError||t||e.indexOf("No space left on device")!==-1||e.indexOf("EMFILE")!==-1)}restart(e){this.restartCounter++,this.init(),this.watch(e)}async watch(e){this.requests=e,await this.watcher?.watch(e)}async setVerboseLogging(e){this.verboseLogging=e,await this.watcher?.setVerboseLogging(e)}error(e){this.onLogMessage({type:"error",message:`[File Watcher (${this.options.type})] ${e}`})}trace(e){this.onLogMessage({type:"trace",message:`[File Watcher (${this.options.type})] ${e}`})}dispose(){return this.watcher=void 0,super.dispose()}};N1.MAX_RESTARTS=5;let QI=N1;function GM(n,e){return typeof e=="string"&&!e.startsWith(ra)&&!Dp(e)?{base:n,pattern:e}:e}class KM{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,s,r,o,a){this.session=Math.random(),this._onDidCreate=new N,this._onDidChange=new N,this._onDidDelete=new N,this._config=0,a.ignoreCreateEvents&&(this._config+=1),a.ignoreChangeEvents&&(this._config+=2),a.ignoreDeleteEvents&&(this._config+=4);const l=Uc(o),c=typeof o=="string",u=r(d=>{if(!(typeof d.session=="number"&&d.session!==this.session)){if(!a.ignoreCreateEvents)for(const f of d.created){const p=x.revive(f);l(p.fsPath)&&(!c||i.getWorkspaceFolder(p))&&this._onDidCreate.fire(p)}if(!a.ignoreChangeEvents)for(const f of d.changed){const p=x.revive(f);l(p.fsPath)&&(!c||i.getWorkspaceFolder(p))&&this._onDidChange.fire(p)}if(!a.ignoreDeleteEvents)for(const f of d.deleted){const p=x.revive(f);l(p.fsPath)&&(!c||i.getWorkspaceFolder(p))&&this._onDidDelete.fire(p)}}});this._disposable=je.from(this.ensureWatching(e,i,t,s,o,a,!1),this._onDidCreate,this._onDidChange,this._onDidDelete,u)}ensureWatching(e,t,i,s,r,o,a){const l=je.from();if(typeof r=="string"||o.ignoreChangeEvents&&o.ignoreCreateEvents&&o.ignoreDeleteEvents)return l;const c=e.getProxy(ee.MainThreadFileSystemEventService);let u=!1;(r.pattern.includes(ra)||r.pattern.includes(_w))&&(u=!0);const d=[];let f,p;if(a)(o.ignoreChangeEvents||o.ignoreCreateEvents||o.ignoreDeleteEvents)&&(p=Qr.UPDATED|Qr.ADDED|Qr.DELETED,o.ignoreChangeEvents&&(p&=~Qr.UPDATED),o.ignoreCreateEvents&&(p&=~Qr.ADDED),o.ignoreDeleteEvents&&(p&=~Qr.DELETED));else if(u&&d.length===0){const _=t.getWorkspaceFolder(x.revive(r.baseUri)),w=i.getConfiguration("files",_).get("watcherExclude");if(w)for(const v in w)v&&w[v]===!0&&d.push(v)}else if(!u){const _=t.getWorkspaceFolder(x.revive(r.baseUri));if(_){const w=i.getConfiguration("files",_).get("watcherExclude");if(w){for(const v in w)if(v&&w[v]===!0){const E=`${Wv(v,"/")}/${ra}`;f||(f=[]),f.push(GM(_.uri.fsPath,E))}}if(!f||f.length===0)return l}}return c.$watch(s.identifier.value,this.session,r.baseUri,{recursive:u,excludes:d,includes:f,filter:p},!!a),je.from({dispose:()=>c.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}}class QM{get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}constructor(e){this._events=e,this._created=new gi(()=>this._events.created.map(x.revive)),this._changed=new gi(()=>this._events.changed.map(x.revive)),this._deleted=new gi(()=>this._events.deleted.map(x.revive)),this.session=this._events.session}}class JM{constructor(e,t,i){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=i,this._onFileSystemEvent=new N,this._onDidRenameFile=new N,this._onDidCreateFile=new N,this._onDidDeleteFile=new N,this._onWillRenameFile=new qu,this._onWillCreateFile=new qu,this._onWillDeleteFile=new qu,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,s,r){return new KM(this._mainContext,t,e,i,this._onFileSystemEvent.event,pi.from(s),r)}$onFileEvent(e){this._onFileSystemEvent.fire(new QM(e))}$onDidRunFileOperation(e,t){switch(e){case ys.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:x.revive(i.source),newUri:x.revive(i.target)}))}));break;case ys.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>x.revive(i.target))}));break;case ys.CREATE:case ys.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>x.revive(i.target))}));break}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(i,s,r)=>{const o=function(l){i.call(s,l)};return o.extension=e,t.event(o,void 0,r)}}async $onWillRunFileOperation(e,t,i,s){switch(e){case ys.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(r=>({oldUri:x.revive(r.source),newUri:x.revive(r.target)}))},i,s);case ys.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(r=>x.revive(r.target))},i,s);case ys.CREATE:case ys.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(r=>x.revive(r.target))},i,s)}}async _fireWillEvent(e,t,i,s){const r=new Set,o=[];if(await e.fireAsync(t,s,async(l,c)=>{const u=Date.now(),d=await Promise.resolve(l);d instanceof Ga&&(o.push([c.extension,d]),r.add(c.extension.displayName??c.extension.identifier.value)),Date.now()-u>i&&this._logService.warn("SLOW file-participant",c.extension.identifier)}),s.isCancellationRequested||o.length===0)return;const a={edits:[]};for(const[,l]of o){const{edits:c}=_i.from(l,{getTextDocumentVersion:u=>this._extHostDocumentsAndEditors.getDocument(u)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(c)}return{edit:a,extensionNames:Array.from(r)}}}class XM{constructor(e,t,i,s,r){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=s;const o=new Te("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new j("showOptions","Show Options",a=>!0,a=>a),new j("resource","Interactive resource Uri",a=>!0,a=>a),new j("controllerId","Notebook controller Id",a=>!0,a=>a),new j("title","Interactive editor title",a=>!0,a=>a)],new ke("Notebook and input URI",a=>{if(r.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const l=this._extHostNotebooks.getEditorById(a.notebookEditorId);return r.debug("[ExtHostInteractive] notebook editor found",l.id),{notebookUri:x.revive(a.notebookUri),inputUri:x.revive(a.inputUri),notebookEditor:l.apiEditor}}return r.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:x.revive(a.notebookUri),inputUri:x.revive(a.inputUri)}}));this._commands.registerApiCommand(o)}$willAddInteractiveDocument(e,t,i,s){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1,encoding:"utf8"}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class YM{constructor(e){this._handlePool=0,this._proxy=e.getProxy(ee.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),we(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}var to;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(to||(to={}));class yi extends et{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return yi.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?to.LTR:to.RTL}setEndPosition(e,t){return this.getDirection()===to.LTR?new yi(this.startLineNumber,this.startColumn,e,t):new yi(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Ti(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Ti(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===to.LTR?new yi(e,t,this.endLineNumber,this.endColumn):new yi(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new yi(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===to.LTR?new yi(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new yi(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new yi(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i<s;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,i,s,r){return r===to.LTR?new yi(e,t,i,s):new yi(i,s,e,t)}}class o1{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentSymbols(i,t);if(!_x(s))return s[0]instanceof Xd?s.map(Vb.from):o1._asDocumentSymbolTree(s)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((s,r)=>{let o=s.location.range.start.compareTo(r.location.range.start);return o===0&&(o=r.location.range.end.compareTo(s.location.range.end)),o});const t=[],i=[];for(const s of e){const r={name:s.name||"!!MISSING: name!!",kind:Hi.from(s.kind),tags:s.tags?.map(Or.from)||[],detail:"",containerName:s.containerName,range:z.from(s.location.range),selectionRange:z.from(s.location.range),children:[]};for(;;){if(i.length===0){i.push(r),t.push(r);break}const o=i[i.length-1];if(et.containsRange(o.range,r.range)&&!et.equalsRange(o.range,r.range)){o.children?.push(r),i.push(r);break}i.pop()}}return t}}class Nf{constructor(e,t,i,s,r,o){this._documents=e,this._commands=t,this._provider=i,this._extension=s,this._extTelemetry=r,this._logService=o,this._cache=new Oi("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideCodeLenses(i,t);if(!s||t.isCancellationRequested)return;const r=this._cache.add(s),o=new xe;this._disposables.set(r,o);const a={cacheId:r,lenses:[]};for(let l=0;l<s.length;l++){if(!Me.isRange(s[l].range)){console.warn("INVALID code lens, range is not defined",this._extension.identifier.value);continue}a.lenses.push({cacheId:[r,l],range:z.from(s[l].range),command:this._commands.toInternal(s[l].command,o)})}return a}async resolveCodeLens(e,t){const i=e.cacheId&&this._cache.get(...e.cacheId);if(!i)return;let s;if(typeof this._provider.resolveCodeLens!="function"||i.isResolved?s=i:s=await this._provider.resolveCodeLens(i,t),s||(s=i),t.isCancellationRequested)return;const r=e.cacheId&&this._disposables.get(e.cacheId[0]);if(r){if(!s.command){const o=new Error("INVALID code lens resolved, lacks command: "+this._extension.identifier.value);this._extTelemetry.onExtensionError(this._extension.identifier,o),this._logService.error(o);return}return e.command=this._commands.toInternal(s.command,r),e}}releaseCodeLenses(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}}function I_(n){return Array.isArray(n)?n.map(Ch.from):n?[Ch.from(n)]:[]}class JI{constructor(e,t){this._documents=e,this._provider=t}async provideDefinition(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideDefinition(s,r,i);return I_(o)}}class XI{constructor(e,t){this._documents=e,this._provider=t}async provideDeclaration(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideDeclaration(s,r,i);return I_(o)}}class YI{constructor(e,t){this._documents=e,this._provider=t}async provideImplementation(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideImplementation(s,r,i);return I_(o)}}class ZI{constructor(e,t){this._documents=e,this._provider=t}async provideTypeDefinition(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideTypeDefinition(s,r,i);return I_(o)}}const O1=class O1{constructor(e,t){this._documents=e,this._provider=t,this._hoverCounter=0,this._hoverMap=new Map}async provideHover(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t);let a;if(i&&i.verbosityRequest){const d=i.verbosityRequest.previousHover.id,f=this._hoverMap.get(d);if(!f)throw new Error(`Hover with id ${d} not found`);const p={verbosityDelta:i.verbosityRequest.verbosityDelta,previousHover:f};a=await this._provider.provideHover(r,o,s,p)}else a=await this._provider.provideHover(r,o,s);if(!a||_x(a.contents))return;a.range||(a.range=r.getWordRangeAtPosition(o)),a.range||(a.range=new Me(o,o));const l=Th.from(a),c=this._hoverCounter;if(this._hoverMap.size===O1.HOVER_MAP_MAX_SIZE){const d=Math.min(...this._hoverMap.keys());this._hoverMap.delete(d)}return this._hoverMap.set(c,a),this._hoverCounter+=1,{...l,id:c}}releaseHover(e){this._hoverMap.delete(e)}};O1.HOVER_MAP_MAX_SIZE=10;let vd=O1;class e4{constructor(e,t){this._documents=e,this._provider=t}async provideEvaluatableExpression(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideEvaluatableExpression(s,r,i);if(o)return jb.from(o)}}class t4{constructor(e,t){this._documents=e,this._provider=t}async provideInlineValues(e,t,i,s){const r=this._documents.getDocument(e),o=await this._provider.provideInlineValues(r,z.to(t),fm.to(i),s);if(Array.isArray(o))return o.map(a=>hm.from(a))}}class n4{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideDocumentHighlights(s,r,i);if(Array.isArray(o))return o.map(Yc.from)}}class i4{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideMultiDocumentHighlights(e,t,i,s){const r=this._documents.getDocument(e),o=i.map(c=>{try{return this._documents.getDocument(c)}catch(u){this._logService.error("Error: Unable to retrieve document from URI: "+c+". Error message: "+u);return}}).filter(c=>c!==void 0),a=ot.to(t),l=await this._provider.provideMultiDocumentHighlights(r,a,o,s);if(Array.isArray(l))return l.map(Gb.from)}}class s4{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideLinkedEditingRanges(s,r,i);if(o&&Array.isArray(o.ranges))return{ranges:rn(o.ranges.map(z.from)),wordPattern:o.wordPattern}}}class r4{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=await this._provider.provideReferences(r,o,i,s);if(Array.isArray(a))return a.map(oi.from)}}const Yl=class Yl{constructor(e,t,i,s,r,o,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=s,this._logService=r,this._extension=o,this._apiDeprecation=a,this._cache=new Oi("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,s){const r=this._documents.getDocument(e),o=yi.isISelection(t)?hs.to(t):z.to(t),a=[];for(const p of this._diagnostics.getDiagnostics(e))if(o.intersection(p.range)&&a.push(p)>Yl._maxCodeActionsPerFile)break;const l={diagnostics:a,only:i.only?new At(i.only):void 0,triggerKind:oy.to(i.trigger)},c=await this._provider.provideCodeActions(r,o,l,s);if(!Kh(c)||s.isCancellationRequested)return;const u=this._cache.add(c),d=new xe;this._disposables.set(u,d);const f=[];for(let p=0;p<c.length;p++){const _=c[p];if(_)if(Yl._isCommand(_)&&!(_ instanceof Zd))this._apiDeprecation.report("CodeActionProvider.provideCodeActions - return commands",this._extension,"Return 'CodeAction' instances instead."),f.push({_isSynthetic:!0,title:_.title,command:this._commands.toInternal(_,d)});else{const w=_;l.only&&(w.kind?l.only.contains(w.kind)||this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${l.only.value}' requested but returned code action is of kind '${w.kind.value}'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.`):this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${l.only.value}' requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.`));const v=w.ranges??[];f.push({cacheId:[u,p],title:w.title,command:w.command&&this._commands.toInternal(w.command,d),diagnostics:w.diagnostics&&w.diagnostics.map(Jc.from),edit:w.edit&&_i.from(w.edit,void 0),kind:w.kind&&w.kind.value,isPreferred:w.isPreferred,isAI:dt(this._extension,"codeActionAI")?w.isAI:!1,ranges:dt(this._extension,"codeActionRanges")?rn(v.map(z.from)):void 0,disabled:w.disabled?.reason})}}return{cacheId:u,actions:f}}async resolveCodeAction(e,t){const[i,s]=e,r=this._cache.get(i,s);if(!r||Yl._isCommand(r))return{};if(!this._provider.resolveCodeAction)return{};const o=await this._provider.resolveCodeAction(r,t)??r;let a;o.edit&&(a=_i.from(o.edit,void 0));let l;if(o.command){const c=this._disposables.get(i);c&&(l=this._commands.toInternal(o.command,c))}return{edit:a,command:l}}releaseCodeActions(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}static _isCommand(e){return typeof e.command=="string"&&typeof e.title=="string"}};Yl._maxCodeActionsPerFile=1e3;let Bl=Yl;class Ru{constructor(e,t,i,s,r){this._proxy=e,this._documents=t,this._provider=i,this._handle=s,this._extension=r,this._editsCache=new Oi("DocumentPasteEdit.edits")}async prepareDocumentPaste(e,t,i,s){if(!this._provider.prepareDocumentPaste)return;this._cachedPrepare=void 0;const r=this._documents.getDocument(e),o=t.map(d=>z.to(d)),a=ou.toDataTransfer(i,()=>{throw new E5});if(await this._provider.prepareDocumentPaste(r,o,a,s),s.isCancellationRequested)return;const l=Array.from(a).filter(([,d])=>!(d instanceof Bg)),c=new Map,u=await Promise.all(Array.from(l,async([d,f])=>{const p=Sn();return c.set(p,f),[d,await Ca.from(d,f,p)]}));return this._cachedPrepare=c,{items:u}}async providePasteEdits(e,t,i,s,r,o){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),l=i.map(p=>z.to(p)),c=s.items.map(([p,_])=>{const w=this._cachedPrepare?.get(_.id);return w?[p,w]:[p,Ca.to(p,_,async v=>(await this._proxy.$resolvePasteFileData(this._handle,e,v)).buffer)]}),u=new qc(c),d=await this._provider.provideDocumentPasteEdits(a,l,u,{only:r.only?new js(r.only):void 0,triggerKind:r.triggerKind},o);if(!d||o.isCancellationRequested)return[];const f=this._editsCache.add(d);return d.map((p,_)=>({_cacheId:[f,_],title:p.title??h(2582,"Paste using '{0}' extension",this._extension.displayName||this._extension.name),kind:p.kind,yieldTo:p.yieldTo?.map(w=>w.value),insertText:typeof p.insertText=="string"?p.insertText:{snippet:p.insertText.value},additionalEdit:p.additionalEdit?_i.from(p.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,s]=e,r=this._editsCache.get(i,s);if(!r||!this._provider.resolveDocumentPasteEdit)return{};const o=await this._provider.resolveDocumentPasteEdit(r,t)??r;return{insertText:o.insertText,additionalEdit:o.additionalEdit?_i.from(o.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._editsCache.delete(e)}}class o4{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideDocumentFormattingEdits(s,t,i);if(Array.isArray(r))return r.map(pn.from)}}class _v{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,s){const r=this._documents.getDocument(e),o=z.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(r,o,i,s);if(Array.isArray(a))return a.map(pn.from)}async provideDocumentRangesFormattingEdits(e,t,i,s){q4(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const r=this._documents.getDocument(e),o=t.map(z.to),a=await this._provider.provideDocumentRangesFormattingEdits(r,o,i,s);if(Array.isArray(a))return a.map(pn.from)}}class a4{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,s,r){const o=this._documents.getDocument(e),a=ot.to(t),l=await this._provider.provideOnTypeFormattingEdits(o,a,i,s,r);if(Array.isArray(l))return l.map(pn.from)}}class Of{constructor(e,t){this._provider=e,this._logService=t,this._cache=new Oi("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!Kh(i))return{symbols:[]};const s=this._cache.add(i),r={cacheId:s,symbols:[]};for(let o=0;o<i.length;o++){const a=i[o];if(!a||!a.name){this._logService.warn("INVALID SymbolInformation",a);continue}r.symbols.push({...Ya.from(a),cacheId:[s,o]})}return r}async resolveWorkspaceSymbol(e,t){if(typeof this._provider.resolveWorkspaceSymbol!="function"||!e.cacheId)return e;const i=this._cache.get(...e.cacheId);if(i){const s=await this._provider.resolveWorkspaceSymbol(i,t);return s&&qa(e,Ya.from(s),!0)}}releaseWorkspaceSymbols(e){this._cache.delete(e)}}class pa{static supportsResolving(e){return typeof e.prepareRename=="function"}constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideRenameEdits(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t);try{const a=await this._provider.provideRenameEdits(r,o,i,s);return a?_i.from(a):void 0}catch(a){const l=pa._asMessage(a);return l?{rejectReason:l,edits:void 0}:Promise.reject(a)}}async resolveRenameLocation(e,t,i){if(typeof this._provider.prepareRename!="function")return Promise.resolve(void 0);const s=this._documents.getDocument(e),r=ot.to(t);try{const o=await this._provider.prepareRename(s,r,i);let a,l;if(Me.isRange(o)?(a=o,l=s.getText(o)):nn(o)&&(a=o.range,l=o.placeholder),!a||!l)return;if(a.start.line>r.line||a.end.line<r.line){this._logService.warn("INVALID rename location: position line must be within range start/end lines");return}return{range:z.from(a),text:l}}catch(o){const a=pa._asMessage(o);return a?{rejectReason:a,range:void 0,text:void 0}:Promise.reject(o)}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}}const Id=class Id{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async supportsAutomaticNewSymbolNamesTriggerKind(){return this._provider.supportsAutomaticTriggerKind}async provideNewSymbolNames(e,t,i,s){const r=this._documents.getDocument(e),o=z.to(t);try{const a=Id.languageTriggerKindToVSCodeTriggerKind[i],l=await this._provider.provideNewSymbolNames(r,o,a,s);return l?l.map(c=>typeof c=="string"?{newSymbolName:c}:{newSymbolName:c.newSymbolName,tags:c.tags}):void 0}catch(a){this._logService.error(Id._asMessage(a)??JSON.stringify(a,null," "));return}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}};Id.languageTriggerKindToVSCodeTriggerKind={[Kp.Invoke]:uh.Invoke,[Kp.Automatic]:uh.Automatic};let wd=Id;class vv{constructor(e,t){this.resultId=e,this.tokens=t}}class di{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const s=this._documents.getDocument(e),r=t!==0?this._previousResults.get(t):null;let o=typeof r?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(s,r.resultId,i):await this._provider.provideDocumentSemanticTokens(s,i);return r&&this._previousResults.delete(t),o?(o=di._fixProvidedSemanticTokens(o),this._send(di._convertToEdits(r,o),o)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return di._isSemanticTokens(e)?di._isCorrectSemanticTokens(e)?e:new Gc(new Uint32Array(e.data),e.resultId):di._isSemanticTokensEdits(e)?di._isCorrectSemanticTokensEdits(e)?e:new sp(e.edits.map(t=>new GT(t.start,t.deleteCount,t.data?new Uint32Array(t.data):t.data)),e.resultId):e}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(const t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(e,t){if(!di._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,s=i.length,r=t.data,o=r.length;let a=0;const l=Math.min(s,o);for(;a<l&&i[a]===r[a];)a++;if(a===s&&a===o)return new sp([],t.resultId);let c=0;const u=l-a;for(;c<u&&i[s-c-1]===r[o-c-1];)c++;return new sp([{start:a,deleteCount:s-a-c,data:r.subarray(a,o-c)}],t.resultId)}_send(e,t){if(di._isSemanticTokens(e)){const i=this._nextResultId++;return this._previousResults.set(i,new vv(e.resultId,e.data)),A0({id:i,type:"full",data:e.data})}if(di._isSemanticTokensEdits(e)){const i=this._nextResultId++;return di._isSemanticTokens(t)?this._previousResults.set(i,new vv(t.resultId,t.data)):this._previousResults.set(i,new vv(e.resultId)),A0({id:i,type:"delta",deltas:(e.edits||[]).map(s=>({start:s.start,deleteCount:s.deleteCount,data:s.data}))})}return null}}class l4{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideDocumentRangeSemanticTokens(s,z.to(t),i);return r?this._send(r):null}_send(e){return A0({id:0,type:"full",data:e.data})}}class Go{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,s,r){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=s,this._extension=r,this._cache=new Oi("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=r.getWordRangeAtPosition(o)||new Me(o,o),l=a.with({end:o}),c=new Rr,u=await this._provider.provideCompletionItems(r,o,s,Qb.to(i));if(!u||s.isCancellationRequested)return;const d=Array.isArray(u)?new Hc(u):u,f=Go.supportsResolving(this._provider)?this._cache.add(d.items):this._cache.add([]),p=new xe;this._disposables.set(f,p);const _=[],w={x:f,[Cl.completions]:_,[Cl.defaultRanges]:{replace:z.from(a),insert:z.from(l)},[Cl.isIncomplete]:d.isIncomplete||void 0,[Cl.duration]:c.elapsed()};for(let v=0;v<d.items.length;v++){const E=d.items[v],S=this._convertCompletionItem(E,[f,v],l,a);_.push(S)}return w}async resolveCompletionItem(e,t){if(typeof this._provider.resolveCompletionItem!="function")return;const i=this._cache.get(...e);if(!i)return;const s=this._convertCompletionItem(i,e),r=await this._provider.resolveCompletionItem(i,t);if(!r)return;const o=this._convertCompletionItem(r,e);return(s[Ue.insertText]!==o[Ue.insertText]||s[Ue.insertTextRules]!==o[Ue.insertTextRules])&&this._apiDeprecation.report("CompletionItem.insertText",this._extension,"extension MAY NOT change 'insertText' of a CompletionItem during resolve"),(s[Ue.commandIdent]!==o[Ue.commandIdent]||s[Ue.commandId]!==o[Ue.commandId]||!Gn(s[Ue.commandArguments],o[Ue.commandArguments]))&&this._apiDeprecation.report("CompletionItem.command",this._extension,"extension MAY NOT change 'command' of a CompletionItem during resolve"),{...s,[Ue.documentation]:o[Ue.documentation],[Ue.detail]:o[Ue.detail],[Ue.additionalTextEdits]:o[Ue.additionalTextEdits],[Ue.insertText]:o[Ue.insertText],[Ue.insertTextRules]:o[Ue.insertTextRules],[Ue.commandIdent]:o[Ue.commandIdent],[Ue.commandId]:o[Ue.commandId],[Ue.commandArguments]:o[Ue.commandArguments]}}releaseCompletionItems(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_convertCompletionItem(e,t,i,s){const r=this._disposables.get(t[0]);if(!r)throw Error("DisposableStore is missing...");const o=this._commands.toInternal(e.command,r),a={x:t,[Ue.label]:e.label,[Ue.kind]:e.kind!==void 0?gm.from(e.kind):void 0,[Ue.kindModifier]:e.tags&&e.tags.map(pm.from),[Ue.detail]:e.detail,[Ue.documentation]:typeof e.documentation>"u"?void 0:Re.fromStrict(e.documentation),[Ue.sortText]:e.sortText!==e.label?e.sortText:void 0,[Ue.filterText]:e.filterText!==e.label?e.filterText:void 0,[Ue.preselect]:e.preselect||void 0,[Ue.insertTextRules]:e.keepWhitespace?ba.KeepWhitespace:ba.None,[Ue.commitCharacters]:e.commitCharacters?.join(""),[Ue.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(pn.from),[Ue.commandIdent]:o?.$ident,[Ue.commandId]:o?.id,[Ue.commandArguments]:o?.$ident?void 0:o?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Ue.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Ue.insertText]=e.insertText:e.insertText instanceof Ka&&(a[Ue.insertText]=e.insertText.value,a[Ue.insertTextRules]|=ba.InsertAsSnippet);let l;return e.textEdit?l=e.textEdit.range:e.range&&(l=e.range),Me.isRange(l)?a[Ue.range]=z.from(l):l&&(!i?.isEqual(l.inserting)||!s?.isEqual(l.replacing))&&(a[Ue.range]={insert:z.from(l.inserting),replace:z.from(l.replacing)}),a}}class Gr{constructor(e,t,i,s){this._extension=e,this._documents=t,this._provider=i,this._commands=s,this._references=new f5,this.languageTriggerKindToVSCodeTriggerKind={[zp.Automatic]:ch.Automatic,[zp.Explicit]:ch.Invoke},this._isAdditionsProposedApiEnabled=dt(this._extension,"inlineCompletionsAdditions")}get supportsHandleEvents(){return dt(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function"||typeof this._provider.handleDidRejectCompletionItem=="function"||typeof this._provider.handleEndOfLifetime=="function")}async provideInlineCompletions(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=await this._provider.provideInlineCompletionItems(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:z.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind],requestUuid:i.requestUuid},s);if(!a||s.isCancellationRequested)return;const l=Array.isArray(a)?a:a.items,c=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],u=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let d;return{pid:this._references.createReferenceId({dispose(){d?.dispose()},items:l}),items:l.map((p,_)=>{let w;p.command&&(d||(d=new xe),w=this._commands.toInternal(p.command,d));let v;p.action&&(d||(d=new xe),v=this._commands.toInternal(p.action,d));const E=p.insertText;return{insertText:typeof E=="string"?E:{snippet:E.value},filterText:p.filterText,range:p.range?z.from(p.range):void 0,showRange:this._isAdditionsProposedApiEnabled&&p.showRange?z.from(p.showRange):void 0,command:w,action:v,idx:_,completeBracketPairs:this._isAdditionsProposedApiEnabled?p.completeBracketPairs:!1,isInlineEdit:this._isAdditionsProposedApiEnabled?p.isInlineEdit:!1,showInlineEditMenu:this._isAdditionsProposedApiEnabled?p.showInlineEditMenu:!1,displayLocation:p.displayLocation&&this._isAdditionsProposedApiEnabled?{range:z.from(p.displayLocation.range),label:p.displayLocation.label}:void 0,warning:p.warning&&this._isAdditionsProposedApiEnabled?{message:Re.from(p.warning.message),icon:p.warning.icon?wy.fromThemeIcon(p.warning.icon):void 0}:void 0}}),commands:c.map(p=>(d||(d=new xe),this._commands.toInternal(p,d))),suppressSuggestions:!1,enableForwardStability:u}}async provideInlineEditsForRange(e,t,i,s){if(!this._provider.provideInlineEditsForRange)return;$(this._extension,"inlineCompletionsAdditions");const r=this._documents.getDocument(e),o=z.to(t),a=await this._provider.provideInlineEditsForRange(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:z.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind],userPrompt:i.userPrompt,requestUuid:i.requestUuid},s);if(!a||s.isCancellationRequested)return;const l=Array.isArray(a)?a:a.items,c=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],u=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let d;return{pid:this._references.createReferenceId({dispose(){d?.dispose()},items:l}),items:l.map((p,_)=>{let w;p.command&&(d||(d=new xe),w=this._commands.toInternal(p.command,d));let v;p.action&&(d||(d=new xe),v=this._commands.toInternal(p.action,d));const E=p.insertText;return{insertText:typeof E=="string"?E:{snippet:E.value},filterText:p.filterText,range:p.range?z.from(p.range):void 0,command:w,action:v,idx:_,completeBracketPairs:this._isAdditionsProposedApiEnabled?p.completeBracketPairs:!1}}),commands:c.map(p=>(d||(d=new xe),this._commands.toInternal(p,d))),suppressSuggestions:!1,enableForwardStability:u}}disposeCompletions(e){this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,i){const s=this._references.get(e)?.items[t];s&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(s,i)}handlePartialAccept(e,t,i,s){const r=this._references.get(e)?.items[t];r&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(r,i),this._provider.handleDidPartiallyAcceptCompletionItem(r,gy.to(s)))}handleEndOfLifetime(e,t,i){const s=this._references.get(e)?.items[t];if(s&&this._provider.handleEndOfLifetime&&this._isAdditionsProposedApiEnabled){const r=_y.to(i,o=>this._references.get(o.pid)?.items[o.idx]);this._provider.handleEndOfLifetime(s,r)}}handleRejection(e,t){const i=this._references.get(e)?.items[t];i&&this._provider.handleDidRejectCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidRejectCompletionItem(i)}}class wv{async provideInlineEdits(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideInlineEdit(s,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind],requestUuid:t.requestUuid},i);if(!r||i.isCancellationRequested)return;let o;const a=this._references.createReferenceId({dispose(){o?.dispose()},item:r});let l;r.accepted&&(o||(o=new xe),l=this._commands.toInternal(r.accepted,o));let c;r.rejected&&(o||(o=new xe),c=this._commands.toInternal(r.rejected,o));let u;r.shown&&(o||(o=new xe),u=this._commands.toInternal(r.shown,o));let d;return r.action&&(o||(o=new xe),d=this._commands.toInternal(r.action,o)),o||(o=new xe),{pid:a,text:r.text,range:z.from(r.range),showRange:z.from(r.showRange),accepted:l,rejected:c,shown:u,action:d,commands:r.commands?.map(p=>this._commands.toInternal(p,o))}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,s){this._documents=t,this._provider=i,this._commands=s,this._references=new f5,this.languageTriggerKindToVSCodeTriggerKind={[Qp.Automatic]:kh.Automatic,[Qp.Invoke]:kh.Invoke}}}class f5{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){const t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){const t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}}class bv{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Oi("SignatureHelp")}async provideSignatureHelp(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=this.reviveContext(i),l=await this._provider.provideSignatureHelp(r,o,s,a);if(l){const c=this._cache.add([l]);return{...Ph.from(l),id:c}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=Ph.to(e.activeSignatureHelp),s=this._cache.get(e.activeSignatureHelp.id,0);s?(t=s,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class Ff{constructor(e,t,i,s,r){this._documents=e,this._commands=t,this._provider=i,this._logService=s,this._extension=r,this._cache=new Oi("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const s=this._documents.getDocument(e),r=z.to(t),o=await this._provider.provideInlayHints(s,r,i);if(!Array.isArray(o)||o.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(i.isCancellationRequested)return;const a=this._cache.add(o);this._disposables.set(a,new xe);const l={hints:[],cacheId:a};for(let c=0;c<o.length;c++)this._isValidInlayHint(o[c],r)&&l.hints.push(this._convertInlayHint(o[c],[a,c]));return this._logService.trace(`[InlayHints] ${l.hints.length} inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`),l}async resolveInlayHint(e,t){if(typeof this._provider.resolveInlayHint!="function")return;const i=this._cache.get(...e);if(!i)return;const s=await this._provider.resolveInlayHint(i,t);if(s&&this._isValidInlayHint(s))return this._convertInlayHint(s,e)}releaseHints(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_isValidInlayHint(e,t){return e.label.length===0||Array.isArray(e.label)&&e.label.every(i=>i.value.length===0)?(console.log("INVALID inlay hint, empty label",e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){const i=this._disposables.get(t[0]);if(!i)throw Error("DisposableStore is missing...");const s={label:"",cacheId:t,tooltip:Re.fromStrict(e.tooltip),position:ot.from(e.position),textEdits:e.textEdits&&e.textEdits.map(pn.from),kind:e.kind&&vm.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")s.label=e.label;else{const r=[];s.label=r;for(const o of e.label){if(!o.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:o.value,tooltip:Re.fromStrict(o.tooltip)};Ni.isLocation(o.location)&&(a.location=oi.from(o.location)),o.command&&(a.command=this._commands.toInternal(o.command,i)),r.push(a)}}return s}}class mo{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Oi("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(s)||s.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:s.filter(mo._validateLink).map(Da.from)};{const r=this._cache.add(s),o={links:[],cacheId:r};for(let a=0;a<s.length;a++){if(!mo._validateLink(s[a]))continue;const l=Da.from(s[a]);l.cacheId=[r,a],o.links.push(l)}return o}}}static _validateLink(e){return e.target&&e.target.path.length>5e4?(console.warn("DROPPING link because it is too long"),!1):!0}async resolveLink(e,t){if(typeof this._provider.resolveDocumentLink!="function")return;const i=this._cache.get(...e);if(!i)return;const s=await this._provider.resolveDocumentLink(i,t);if(!(!s||!mo._validateLink(s)))return Da.from(s)}releaseLinks(e){this._cache.delete(e)}}class yv{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentColors(i,t);return Array.isArray(s)?s.map(o=>({color:Zc.from(o.color),range:z.from(o.range)})):[]}async provideColorPresentations(e,t,i){const s=this._documents.getDocument(e),r=z.to(t.range),o=Zc.to(t.color),a=await this._provider.provideColorPresentations(o,{document:s,range:r},i);if(Array.isArray(a))return a.map(wm.from)}}class c4{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideFoldingRanges(s,t,i);if(Array.isArray(r))return r.map(xm.from)}}class u4{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const s=this._documents.getDocument(e),r=t.map(ot.to),o=await this._provider.provideSelectionRanges(s,r,i);if(!Kh(o))return[];if(o.length!==r.length)return this._logService.warn("BAD selection ranges, provider must return ranges for each position"),[];const a=[];for(let l=0;l<r.length;l++){const c=[];a.push(c);let u=r[l],d=o[l];for(;;){if(!d.range.contains(u))throw new Error("INVALID selection range, must contain the previous range");if(c.push(Zb.from(d)),!d.parent)break;u=d.range,d=d.parent}}return a}}class Lu{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new xE(""),this._cache=new Map}async prepareSession(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.prepareCallHierarchy(s,r,i);if(!o)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(o)?o.map(l=>this._cacheAndConvertItem(a,l)):[this._cacheAndConvertItem(a,o)]}async provideCallsTo(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyIncomingCalls(s,i);if(r)return r.map(o=>({from:this._cacheAndConvertItem(e,o.from),fromRanges:o.fromRanges.map(a=>z.from(a))}))}async provideCallsFrom(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyOutgoingCalls(s,i);if(r)return r.map(o=>({to:this._cacheAndConvertItem(e,o.to),fromRanges:o.fromRanges.map(a=>z.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=Za.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class Nu{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new xE(""),this._cache=new Map}async prepareSession(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.prepareTypeHierarchy(s,r,i);if(!o)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(o)?o.map(l=>this._cacheAndConvertItem(a,l)):[this._cacheAndConvertItem(a,o)]}async provideSupertypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySupertypes(s,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}async provideSubtypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySubtypes(s,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=Ia.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class Mf{constructor(e,t,i,s,r){this._proxy=e,this._documents=t,this._provider=i,this._handle=s,this._extension=r,this._cache=new Oi("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,s,r){const o=this._documents.getDocument(t),a=ot.to(i),l=ou.toDataTransfer(s,async f=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,f)).buffer),c=await this._provider.provideDocumentDropEdits(o,a,l,r);if(!c)return;const u=Ri(c),d=this._cache.add(u);return u.map((f,p)=>({_cacheId:[d,p],title:f.title??h(2583,"Drop using '{0}' extension",this._extension.displayName||this._extension.name),kind:f.kind?.value,yieldTo:f.yieldTo?.map(_=>_.value),insertText:typeof f.insertText=="string"?f.insertText:{snippet:f.insertText.value},additionalEdit:f.additionalEdit?_i.from(f.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,s]=e,r=this._cache.get(i,s);if(!r||!this._provider.resolveDocumentDropEdit)return{};const o=await this._provider.resolveDocumentDropEdit(r,t)??r;return{additionalEdit:o.additionalEdit?_i.from(o.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class Ou{constructor(e,t){this.adapter=e,this.extension=t}}const Xt=class Xt{constructor(e,t,i,s,r,o,a,l){this._uriTransformer=t,this._documents=i,this._commands=s,this._diagnostics=r,this._logService=o,this._apiDeprecation=a,this._extensionTelemetry=l,this._adapter=new Map,this._proxy=e.getProxy(ee.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return Qc.from(e,this._uriTransformer,t)}_createDisposable(e){return new je(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Xt._handlePool++}async _withAdapter(e,t,i,s,r,o=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return s;const l=Date.now();o||this._logService.trace(`[${a.extension.identifier.value}] INVOKE provider '${i.toString().replace(/[\r\n]/g,"")}'`);const c=i(a.adapter,a.extension);return Promise.resolve(c).catch(u=>{Vs(u)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(u),this._extensionTelemetry.onExtensionError(a.extension.identifier,u))}).finally(()=>{o||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-l}ms`)}),yt.isCancellationToken(r)?Cx(c,r):c}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new Ou(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,s){const r=this._addNewAdapter(new o1(this._documents,i),e),o=s&&s.label||Xt._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,o1,s=>s.provideDocumentSymbols(x.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const s=this._nextHandle(),r=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(s,new Ou(new Nf(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(s,this._transformDocumentSelector(t,e),r);let o=this._createDisposable(s);if(r!==void 0){const a=i.onDidChangeCodeLenses(l=>this._proxy.$emitCodeLensEvent(r));o=je.from(o,a)}return o}$provideCodeLenses(e,t,i){return this._withAdapter(e,Nf,s=>s.provideCodeLenses(x.revive(t),i),void 0,i,t.scheme==="output")}$resolveCodeLens(e,t,i){return this._withAdapter(e,Nf,s=>s.resolveCodeLens(t,i),void 0,void 0,!0)}$releaseCodeLenses(e,t){this._withAdapter(e,Nf,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0,!0)}registerDefinitionProvider(e,t,i){const s=this._addNewAdapter(new JI(this._documents,i),e);return this._proxy.$registerDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDefinition(e,t,i,s){return this._withAdapter(e,JI,r=>r.provideDefinition(x.revive(t),i,s),[],s)}registerDeclarationProvider(e,t,i){const s=this._addNewAdapter(new XI(this._documents,i),e);return this._proxy.$registerDeclarationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDeclaration(e,t,i,s){return this._withAdapter(e,XI,r=>r.provideDeclaration(x.revive(t),i,s),[],s)}registerImplementationProvider(e,t,i){const s=this._addNewAdapter(new YI(this._documents,i),e);return this._proxy.$registerImplementationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideImplementation(e,t,i,s){return this._withAdapter(e,YI,r=>r.provideImplementation(x.revive(t),i,s),[],s)}registerTypeDefinitionProvider(e,t,i){const s=this._addNewAdapter(new ZI(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideTypeDefinition(e,t,i,s){return this._withAdapter(e,ZI,r=>r.provideTypeDefinition(x.revive(t),i,s),[],s)}registerHoverProvider(e,t,i,s){const r=this._addNewAdapter(new vd(this._documents,i),e);return this._proxy.$registerHoverProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideHover(e,t,i,s,r){return this._withAdapter(e,vd,o=>o.provideHover(x.revive(t),i,s,r),void 0,r)}$releaseHover(e,t){this._withAdapter(e,vd,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,s){const r=this._addNewAdapter(new e4(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideEvaluatableExpression(e,t,i,s){return this._withAdapter(e,e4,r=>r.provideEvaluatableExpression(x.revive(t),i,s),void 0,s)}registerInlineValuesProvider(e,t,i,s){const r=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new t4(this._documents,i),e);this._proxy.$registerInlineValuesProvider(o,this._transformDocumentSelector(t,e),r);let a=this._createDisposable(o);if(r!==void 0){const l=i.onDidChangeInlineValues(c=>this._proxy.$emitInlineValuesEvent(r));a=je.from(a,l)}return a}$provideInlineValues(e,t,i,s,r){return this._withAdapter(e,t4,o=>o.provideInlineValues(x.revive(t),i,s,r),void 0,r)}registerDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new n4(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}registerMultiDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new i4(this._documents,i,this._logService),e);return this._proxy.$registerMultiDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentHighlights(e,t,i,s){return this._withAdapter(e,n4,r=>r.provideDocumentHighlights(x.revive(t),i,s),void 0,s)}$provideMultiDocumentHighlights(e,t,i,s,r){return this._withAdapter(e,i4,o=>o.provideMultiDocumentHighlights(x.revive(t),i,s.map(a=>x.revive(a)),r),void 0,r)}registerLinkedEditingRangeProvider(e,t,i){const s=this._addNewAdapter(new s4(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideLinkedEditingRanges(e,t,i,s){return this._withAdapter(e,s4,async r=>{const o=await r.provideLinkedEditingRanges(x.revive(t),i,s);if(o)return{ranges:o.ranges,wordPattern:o.wordPattern?Xt._serializeRegExp(o.wordPattern):void 0}},void 0,s)}registerReferenceProvider(e,t,i){const s=this._addNewAdapter(new r4(this._documents,i),e);return this._proxy.$registerReferenceSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideReferences(e,t,i,s,r){return this._withAdapter(e,r4,o=>o.provideReferences(x.revive(t),i,s,r),void 0,r)}registerCodeActionProvider(e,t,i,s){const r=new xe,o=this._addNewAdapter(new Bl(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(o,this._transformDocumentSelector(t,e),{providedKinds:s?.providedCodeActionKinds?.map(a=>a.value),documentation:s?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,r)}))},Xt._extLabel(e),Xt._extId(e),!!i.resolveCodeAction),r.add(this._createDisposable(o)),r}$provideCodeActions(e,t,i,s,r){return this._withAdapter(e,Bl,o=>o.provideCodeActions(x.revive(t),i,s,r),void 0,r)}$resolveCodeAction(e,t,i){return this._withAdapter(e,Bl,s=>s.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,Bl,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const s=this._addNewAdapter(new o4(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(s,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(s)}$provideDocumentFormattingEdits(e,t,i,s){return this._withAdapter(e,o4,r=>r.provideDocumentFormattingEdits(x.revive(t),i,s),void 0,s)}registerDocumentRangeFormattingEditProvider(e,t,i){const s=typeof i.provideDocumentRangesFormattingEdits=="function",r=this._addNewAdapter(new _v(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(r,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,s),this._createDisposable(r)}$provideDocumentRangeFormattingEdits(e,t,i,s,r){return this._withAdapter(e,_v,o=>o.provideDocumentRangeFormattingEdits(x.revive(t),i,s,r),void 0,r)}$provideDocumentRangesFormattingEdits(e,t,i,s,r){return this._withAdapter(e,_v,o=>o.provideDocumentRangesFormattingEdits(x.revive(t),i,s,r),void 0,r)}registerOnTypeFormattingEditProvider(e,t,i,s){const r=this._addNewAdapter(new a4(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(r,this._transformDocumentSelector(t,e),s,e.identifier),this._createDisposable(r)}$provideOnTypeFormattingEdits(e,t,i,s,r,o){return this._withAdapter(e,a4,a=>a.provideOnTypeFormattingEdits(x.revive(t),i,s,r,o),void 0,o)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new Of(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,Of,s=>s.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,Of,s=>s.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,Of,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const s=this._addNewAdapter(new pa(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(s,this._transformDocumentSelector(t,e),pa.supportsResolving(i)),this._createDisposable(s)}$provideRenameEdits(e,t,i,s,r){return this._withAdapter(e,pa,o=>o.provideRenameEdits(x.revive(t),i,s,r),void 0,r)}$resolveRenameLocation(e,t,i,s){return this._withAdapter(e,pa,r=>r.resolveRenameLocation(x.revive(t),i,s),void 0,s)}registerNewSymbolNamesProvider(e,t,i){const s=this._addNewAdapter(new wd(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,wd,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,s,r){return this._withAdapter(e,wd,o=>o.provideNewSymbolNames(x.revive(t),i,s,r),void 0,r)}registerDocumentSemanticTokensProvider(e,t,i,s){const r=this._addNewAdapter(new di(this._documents,i),e),o=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(r,this._transformDocumentSelector(t,e),s,o);let a=this._createDisposable(r);if(o){const l=i.onDidChangeSemanticTokens(c=>this._proxy.$emitDocumentSemanticTokensEvent(o));a=je.from(a,l)}return a}$provideDocumentSemanticTokens(e,t,i,s){return this._withAdapter(e,di,r=>r.provideDocumentSemanticTokens(x.revive(t),i,s),null,s)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,di,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,s){const r=this._addNewAdapter(new l4(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(r,this._transformDocumentSelector(t,e),s),this._createDisposable(r)}$provideDocumentRangeSemanticTokens(e,t,i,s){return this._withAdapter(e,l4,r=>r.provideDocumentRangeSemanticTokens(x.revive(t),i,s),null,s)}registerCompletionItemProvider(e,t,i,s){const r=this._addNewAdapter(new Go(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(r,this._transformDocumentSelector(t,e),s,Go.supportsResolving(i),e.identifier),this._createDisposable(r)}$provideCompletionItems(e,t,i,s,r){return this._withAdapter(e,Go,o=>o.provideCompletionItems(x.revive(t),i,s,r),void 0,r)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,Go,s=>s.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,Go,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,s){const r=typeof i.onDidChange=="function"&&dt(e,"inlineCompletionsAdditions")?this._nextHandle():void 0,o=new Gr(e,this._documents,i,this._commands.converter),a=this._addNewAdapter(o,e);let l=this._createDisposable(a);if(r!==void 0){const c=i.onDidChange(u=>this._proxy.$emitInlineCompletionsChange(r));l=je.from(l,c)}return this._proxy.$registerInlineCompletionsSupport(a,this._transformDocumentSelector(t,e),o.supportsHandleEvents,tt.toKey(e.identifier.value),s?.yieldTo?.map(c=>tt.toKey(c))||[],s?.displayName,s?.debounceDelayMs,r),l}$provideInlineCompletions(e,t,i,s,r){return this._withAdapter(e,Gr,o=>o.provideInlineCompletions(x.revive(t),i,s,r),void 0,r)}$provideInlineEditsForRange(e,t,i,s,r){return this._withAdapter(e,Gr,o=>o.provideInlineEditsForRange(x.revive(t),i,s,r),void 0,r)}$handleInlineCompletionDidShow(e,t,i,s){this._withAdapter(e,Gr,async r=>{r.handleDidShowCompletionItem(t,i,s)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,s,r){this._withAdapter(e,Gr,async o=>{o.handlePartialAccept(t,i,s,r)},void 0,void 0)}$handleInlineCompletionEndOfLifetime(e,t,i,s){this._withAdapter(e,Gr,async r=>{r.handleEndOfLifetime(t,i,s)},void 0,void 0)}$handleInlineCompletionRejection(e,t,i){this._withAdapter(e,Gr,async s=>{s.handleRejection(t,i)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,Gr,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const s=new wv(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(s,e);return this._proxy.$registerInlineEditProvider(r,this._transformDocumentSelector(t,e),e.identifier,i.displayName||e.name),this._createDisposable(r)}$provideInlineEdit(e,t,i,s){return this._withAdapter(e,wv,r=>r.provideInlineEdits(x.revive(t),i,s),void 0,s)}$freeInlineEdit(e,t){this._withAdapter(e,wv,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,s){const r=Array.isArray(s)?{triggerCharacters:s,retriggerCharacters:[]}:s,o=this._addNewAdapter(new bv(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideSignatureHelp(e,t,i,s,r){return this._withAdapter(e,bv,o=>o.provideSignatureHelp(x.revive(t),i,s,r),void 0,r)}$releaseSignatureHelp(e,t){this._withAdapter(e,bv,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const s=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new Ff(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(r,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",s,Xt._extLabel(e));let o=this._createDisposable(r);if(s!==void 0){const a=i.onDidChangeInlayHints(l=>this._proxy.$emitInlayHintsEvent(s));o=je.from(o,a)}return o}$provideInlayHints(e,t,i,s){return this._withAdapter(e,Ff,r=>r.provideInlayHints(x.revive(t),i,s),void 0,s)}$resolveInlayHint(e,t,i){return this._withAdapter(e,Ff,s=>s.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,Ff,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const s=this._addNewAdapter(new mo(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(s,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(s)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,mo,s=>s.provideLinks(x.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,mo,s=>s.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,mo,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const s=this._addNewAdapter(new yv(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentColors(e,t,i){return this._withAdapter(e,yv,s=>s.provideColors(x.revive(t),i),[],i)}$provideColorPresentations(e,t,i,s){return this._withAdapter(e,yv,r=>r.provideColorPresentations(x.revive(t),i,s),void 0,s)}registerFoldingRangeProvider(e,t,i){const s=this._nextHandle(),r=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(s,new Ou(new c4(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(s,this._transformDocumentSelector(t,e),e.identifier,r);let o=this._createDisposable(s);if(r!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(r));o=je.from(o,a)}return o}$provideFoldingRanges(e,t,i,s){return this._withAdapter(e,c4,r=>r.provideFoldingRanges(x.revive(t),i,s),void 0,s)}registerSelectionRangeProvider(e,t,i){const s=this._addNewAdapter(new u4(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideSelectionRanges(e,t,i,s){return this._withAdapter(e,u4,r=>r.provideSelectionRanges(x.revive(t),i,s),[],s)}registerCallHierarchyProvider(e,t,i){const s=this._addNewAdapter(new Lu(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareCallHierarchy(e,t,i,s){return this._withAdapter(e,Lu,r=>Promise.resolve(r.prepareSession(x.revive(t),i,s)),void 0,s)}$provideCallHierarchyIncomingCalls(e,t,i,s){return this._withAdapter(e,Lu,r=>r.provideCallsTo(t,i,s),void 0,s)}$provideCallHierarchyOutgoingCalls(e,t,i,s){return this._withAdapter(e,Lu,r=>r.provideCallsFrom(t,i,s),void 0,s)}$releaseCallHierarchy(e,t){this._withAdapter(e,Lu,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const s=this._addNewAdapter(new Nu(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareTypeHierarchy(e,t,i,s){return this._withAdapter(e,Nu,r=>Promise.resolve(r.prepareSession(x.revive(t),i,s)),void 0,s)}$provideTypeHierarchySupertypes(e,t,i,s){return this._withAdapter(e,Nu,r=>r.provideSupertypes(t,i,s),void 0,s)}$provideTypeHierarchySubtypes(e,t,i,s){return this._withAdapter(e,Nu,r=>r.provideSubtypes(t,i,s),void 0,s)}$releaseTypeHierarchy(e,t){this._withAdapter(e,Nu,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,s){const r=this._nextHandle();return this._adapter.set(r,new Ou(new Mf(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerDocumentOnDropEditProvider(r,this._transformDocumentSelector(t,e),s?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:s.dropMimeTypes,providedDropKinds:s.providedDropEditKinds?.map(o=>o.value)}:void 0),this._createDisposable(r)}$provideDocumentOnDropEdits(e,t,i,s,r,o){return this._withAdapter(e,Mf,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,x.revive(i),s,r,o)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,Mf,s=>s.resolveDropEdit(t,i),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,Mf,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerDocumentPasteEditProvider(e,t,i,s){const r=this._nextHandle();return this._adapter.set(r,new Ou(new Ru(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerPasteEditProvider(r,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:s.providedPasteEditKinds?.map(o=>o.value),copyMimeTypes:s.copyMimeTypes,pasteMimeTypes:s.pasteMimeTypes}),this._createDisposable(r)}$prepareDocumentPaste(e,t,i,s,r){return this._withAdapter(e,Ru,o=>o.prepareDocumentPaste(x.revive(t),i,s,r),void 0,r)}$providePasteEdits(e,t,i,s,r,o,a){return this._withAdapter(e,Ru,l=>l.providePasteEdits(t,x.revive(i),s,r,o,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,Ru,s=>s.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,Ru,i=>Promise.resolve(i.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(e){return{decreaseIndentPattern:Xt._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Xt._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Xt._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Xt._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Xt._serializeRegExp(e.beforeText),afterText:e.afterText?Xt._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Xt._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Xt._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>Wc.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Xt._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:s}=i;if(s&&mC(s))throw new Error(`Invalid language configuration: wordPattern '${s}' is not allowed to match the empty string.`);s?this._documents.setWordDefinitionFor(t,s):this._documents.setWordDefinitionFor(t,void 0),i.__electricCharacterSupport&&this._apiDeprecation.report("LanguageConfiguration.__electricCharacterSupport",e,"Do not use."),i.__characterPairSupport&&this._apiDeprecation.report("LanguageConfiguration.__characterPairSupport",e,"Do not use.");const r=this._nextHandle(),o={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Xt._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Xt._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Xt._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Xt._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(r,t,o),this._createDisposable(r)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Xt._handlePool=0;let U0=Xt;var a1;(function(n){n.Internal={type:"internal",label:"Built-In"};function e(s){switch(s.type){case"extension":return`extension:${s.extensionId.value}`;case"mcp":return`mcp:${s.collectionId}:${s.definitionId}`;case"user":return`user:${s.file.toString()}`;case"internal":return"internal"}}n.toKey=e;function t(s,r){return e(s)===e(r)}n.equals=t;function i(s){return s.type==="internal"?{ordinal:1,label:h(5169,"Built-In")}:s.type==="mcp"?{ordinal:2,label:h(5170,"MCP Server: {0}",s.label)}:s.type==="user"?{ordinal:0,label:h(5171,"User Defined")}:{ordinal:3,label:h(5172,"Extension: {0}",s.label)}}n.classify=i})(a1||(a1={}));function ZM(n){return typeof n=="object"&&typeof n.sessionId=="string"}const eU=pe("notebookService"),tU=pe("codeMapperService"),nU=pe("IChatService"),d4="vscode_editFile",$0="vscode_editFile_internal",h4={id:$0,displayName:"",modelDescription:"",source:a1.Internal};let H0=class{constructor(e,t,i){this.chatService=e,this.codeMapperService=t,this.notebookService=i}async invoke(e,t,i,s){if(!e.context)throw new Error("toolInvocationToken is required for this tool");const r=e.parameters,o=x.revive(r.uri),a=Xp.parse(o)?.notebook||o,l=this.chatService.getSession(e.context?.sessionId),c=l.getRequests().at(-1);l.acceptResponseProgress(c,{kind:"markdownContent",content:new Mc("\n````\n")}),l.acceptResponseProgress(c,{kind:"codeblockUri",uri:a,isEdit:!0}),l.acceptResponseProgress(c,{kind:"markdownContent",content:new Mc("\n````\n")}),this.notebookService.hasSupportedNotebooks(a)&&this.notebookService.getNotebookTextModel(a)?l.acceptResponseProgress(c,{kind:"notebookEdit",edits:[],uri:a}):l.acceptResponseProgress(c,{kind:"textEdit",edits:[],uri:a});const u=l.editingSession;if(!u)throw new Error("This tool must be called from within an editing session");const d=await this.codeMapperService.mapCode({codeBlocks:[{code:r.code,resource:a,markdownBeforeBlock:r.explanation}],location:"tool",chatRequestId:e.chatRequestId,chatRequestModel:e.modelId,chatSessionId:e.context.sessionId},{textEdit:(p,_)=>{l.acceptResponseProgress(c,{kind:"textEdit",uri:p,edits:_})},notebookEdit(p,_){l.acceptResponseProgress(c,{kind:"notebookEdit",uri:p,edits:_})}},s);if(this.notebookService.hasSupportedNotebooks(a)&&this.notebookService.getNotebookTextModel(a)?l.acceptResponseProgress(c,{kind:"notebookEdit",uri:a,edits:[],done:!0}):l.acceptResponseProgress(c,{kind:"textEdit",uri:a,edits:[],done:!0}),d?.errorMessage)throw new Error(d.errorMessage);let f;return await new Promise(p=>{let _=!1;f=mT(w=>{const E=u.entries.read(w)?.find(S=>S.modifiedURI.toString()===a.toString());E&&(E.isCurrentlyBeingModifiedBy.read(w)?_=!0:_&&p(!0))})}).finally(()=>{f.dispose()}),{content:[{kind:"text",value:"The file was edited successfully"}]}}async prepareToolInvocation(e,t){return{presentation:"hidden"}}};H0=V([L(0,nU),L(1,tU),L(2,eU)],H0);const iU=pe("ILanguageModelToolsService");var xc;let f4=(xc=class extends Se{constructor(e,t){super();const i=t.createInstance(H0);this._register(e.registerToolData(h4)),this._register(e.registerToolImplementation(h4.id,i))}},xc.ID="chat.builtinTools",xc);f4=V([L(0,iU),L(1,Yh)],f4);const sU="vscode_fetchWebPage_internal",p5=pe("commandService"),SE=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new N,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.metadata&&Array.isArray(n.metadata.args)){const o=[];for(const l of n.metadata.args)o.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return B5(c,o),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new To,this._commands.set(t,i));const s=i.unshift(n),r=we(()=>{s(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(n,e){return SE.registerCommand(n,(t,...i)=>t.get(p5).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return fn.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};SE.registerCommand("noop",()=>{});var D;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(D||(D={}));var T;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.None=0]="None",n[n.Hyper=1]="Hyper",n[n.Super=2]="Super",n[n.Fn=3]="Fn",n[n.FnLock=4]="FnLock",n[n.Suspend=5]="Suspend",n[n.Resume=6]="Resume",n[n.Turbo=7]="Turbo",n[n.Sleep=8]="Sleep",n[n.WakeUp=9]="WakeUp",n[n.KeyA=10]="KeyA",n[n.KeyB=11]="KeyB",n[n.KeyC=12]="KeyC",n[n.KeyD=13]="KeyD",n[n.KeyE=14]="KeyE",n[n.KeyF=15]="KeyF",n[n.KeyG=16]="KeyG",n[n.KeyH=17]="KeyH",n[n.KeyI=18]="KeyI",n[n.KeyJ=19]="KeyJ",n[n.KeyK=20]="KeyK",n[n.KeyL=21]="KeyL",n[n.KeyM=22]="KeyM",n[n.KeyN=23]="KeyN",n[n.KeyO=24]="KeyO",n[n.KeyP=25]="KeyP",n[n.KeyQ=26]="KeyQ",n[n.KeyR=27]="KeyR",n[n.KeyS=28]="KeyS",n[n.KeyT=29]="KeyT",n[n.KeyU=30]="KeyU",n[n.KeyV=31]="KeyV",n[n.KeyW=32]="KeyW",n[n.KeyX=33]="KeyX",n[n.KeyY=34]="KeyY",n[n.KeyZ=35]="KeyZ",n[n.Digit1=36]="Digit1",n[n.Digit2=37]="Digit2",n[n.Digit3=38]="Digit3",n[n.Digit4=39]="Digit4",n[n.Digit5=40]="Digit5",n[n.Digit6=41]="Digit6",n[n.Digit7=42]="Digit7",n[n.Digit8=43]="Digit8",n[n.Digit9=44]="Digit9",n[n.Digit0=45]="Digit0",n[n.Enter=46]="Enter",n[n.Escape=47]="Escape",n[n.Backspace=48]="Backspace",n[n.Tab=49]="Tab",n[n.Space=50]="Space",n[n.Minus=51]="Minus",n[n.Equal=52]="Equal",n[n.BracketLeft=53]="BracketLeft",n[n.BracketRight=54]="BracketRight",n[n.Backslash=55]="Backslash",n[n.IntlHash=56]="IntlHash",n[n.Semicolon=57]="Semicolon",n[n.Quote=58]="Quote",n[n.Backquote=59]="Backquote",n[n.Comma=60]="Comma",n[n.Period=61]="Period",n[n.Slash=62]="Slash",n[n.CapsLock=63]="CapsLock",n[n.F1=64]="F1",n[n.F2=65]="F2",n[n.F3=66]="F3",n[n.F4=67]="F4",n[n.F5=68]="F5",n[n.F6=69]="F6",n[n.F7=70]="F7",n[n.F8=71]="F8",n[n.F9=72]="F9",n[n.F10=73]="F10",n[n.F11=74]="F11",n[n.F12=75]="F12",n[n.PrintScreen=76]="PrintScreen",n[n.ScrollLock=77]="ScrollLock",n[n.Pause=78]="Pause",n[n.Insert=79]="Insert",n[n.Home=80]="Home",n[n.PageUp=81]="PageUp",n[n.Delete=82]="Delete",n[n.End=83]="End",n[n.PageDown=84]="PageDown",n[n.ArrowRight=85]="ArrowRight",n[n.ArrowLeft=86]="ArrowLeft",n[n.ArrowDown=87]="ArrowDown",n[n.ArrowUp=88]="ArrowUp",n[n.NumLock=89]="NumLock",n[n.NumpadDivide=90]="NumpadDivide",n[n.NumpadMultiply=91]="NumpadMultiply",n[n.NumpadSubtract=92]="NumpadSubtract",n[n.NumpadAdd=93]="NumpadAdd",n[n.NumpadEnter=94]="NumpadEnter",n[n.Numpad1=95]="Numpad1",n[n.Numpad2=96]="Numpad2",n[n.Numpad3=97]="Numpad3",n[n.Numpad4=98]="Numpad4",n[n.Numpad5=99]="Numpad5",n[n.Numpad6=100]="Numpad6",n[n.Numpad7=101]="Numpad7",n[n.Numpad8=102]="Numpad8",n[n.Numpad9=103]="Numpad9",n[n.Numpad0=104]="Numpad0",n[n.NumpadDecimal=105]="NumpadDecimal",n[n.IntlBackslash=106]="IntlBackslash",n[n.ContextMenu=107]="ContextMenu",n[n.Power=108]="Power",n[n.NumpadEqual=109]="NumpadEqual",n[n.F13=110]="F13",n[n.F14=111]="F14",n[n.F15=112]="F15",n[n.F16=113]="F16",n[n.F17=114]="F17",n[n.F18=115]="F18",n[n.F19=116]="F19",n[n.F20=117]="F20",n[n.F21=118]="F21",n[n.F22=119]="F22",n[n.F23=120]="F23",n[n.F24=121]="F24",n[n.Open=122]="Open",n[n.Help=123]="Help",n[n.Select=124]="Select",n[n.Again=125]="Again",n[n.Undo=126]="Undo",n[n.Cut=127]="Cut",n[n.Copy=128]="Copy",n[n.Paste=129]="Paste",n[n.Find=130]="Find",n[n.AudioVolumeMute=131]="AudioVolumeMute",n[n.AudioVolumeUp=132]="AudioVolumeUp",n[n.AudioVolumeDown=133]="AudioVolumeDown",n[n.NumpadComma=134]="NumpadComma",n[n.IntlRo=135]="IntlRo",n[n.KanaMode=136]="KanaMode",n[n.IntlYen=137]="IntlYen",n[n.Convert=138]="Convert",n[n.NonConvert=139]="NonConvert",n[n.Lang1=140]="Lang1",n[n.Lang2=141]="Lang2",n[n.Lang3=142]="Lang3",n[n.Lang4=143]="Lang4",n[n.Lang5=144]="Lang5",n[n.Abort=145]="Abort",n[n.Props=146]="Props",n[n.NumpadParenLeft=147]="NumpadParenLeft",n[n.NumpadParenRight=148]="NumpadParenRight",n[n.NumpadBackspace=149]="NumpadBackspace",n[n.NumpadMemoryStore=150]="NumpadMemoryStore",n[n.NumpadMemoryRecall=151]="NumpadMemoryRecall",n[n.NumpadMemoryClear=152]="NumpadMemoryClear",n[n.NumpadMemoryAdd=153]="NumpadMemoryAdd",n[n.NumpadMemorySubtract=154]="NumpadMemorySubtract",n[n.NumpadClear=155]="NumpadClear",n[n.NumpadClearEntry=156]="NumpadClearEntry",n[n.ControlLeft=157]="ControlLeft",n[n.ShiftLeft=158]="ShiftLeft",n[n.AltLeft=159]="AltLeft",n[n.MetaLeft=160]="MetaLeft",n[n.ControlRight=161]="ControlRight",n[n.ShiftRight=162]="ShiftRight",n[n.AltRight=163]="AltRight",n[n.MetaRight=164]="MetaRight",n[n.BrightnessUp=165]="BrightnessUp",n[n.BrightnessDown=166]="BrightnessDown",n[n.MediaPlay=167]="MediaPlay",n[n.MediaRecord=168]="MediaRecord",n[n.MediaFastForward=169]="MediaFastForward",n[n.MediaRewind=170]="MediaRewind",n[n.MediaTrackNext=171]="MediaTrackNext",n[n.MediaTrackPrevious=172]="MediaTrackPrevious",n[n.MediaStop=173]="MediaStop",n[n.Eject=174]="Eject",n[n.MediaPlayPause=175]="MediaPlayPause",n[n.MediaSelect=176]="MediaSelect",n[n.LaunchMail=177]="LaunchMail",n[n.LaunchApp2=178]="LaunchApp2",n[n.LaunchApp1=179]="LaunchApp1",n[n.SelectTask=180]="SelectTask",n[n.LaunchScreenSaver=181]="LaunchScreenSaver",n[n.BrowserSearch=182]="BrowserSearch",n[n.BrowserHome=183]="BrowserHome",n[n.BrowserBack=184]="BrowserBack",n[n.BrowserForward=185]="BrowserForward",n[n.BrowserStop=186]="BrowserStop",n[n.BrowserRefresh=187]="BrowserRefresh",n[n.BrowserFavorites=188]="BrowserFavorites",n[n.ZoomToggle=189]="ZoomToggle",n[n.MailReply=190]="MailReply",n[n.MailForward=191]="MailForward",n[n.MailSend=192]="MailSend",n[n.MAX_VALUE=193]="MAX_VALUE"})(T||(T={}));class kE{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||D.Unknown}}const fp=new kE,B0=new kE,W0=new kE,rU=new Array(230),oU=Object.create(null),aU=Object.create(null),V0=[];for(let n=0;n<=T.MAX_VALUE;n++)D.DependsOnKbLayout;for(let n=0;n<=D.MAX_VALUE;n++)V0[n]=T.DependsOnKbLayout;(function(){const e=[[1,T.None,"None",D.Unknown,"unknown",0,"VK_UNKNOWN","",""],[1,T.Hyper,"Hyper",D.Unknown,"",0,"","",""],[1,T.Super,"Super",D.Unknown,"",0,"","",""],[1,T.Fn,"Fn",D.Unknown,"",0,"","",""],[1,T.FnLock,"FnLock",D.Unknown,"",0,"","",""],[1,T.Suspend,"Suspend",D.Unknown,"",0,"","",""],[1,T.Resume,"Resume",D.Unknown,"",0,"","",""],[1,T.Turbo,"Turbo",D.Unknown,"",0,"","",""],[1,T.Sleep,"Sleep",D.Unknown,"",0,"VK_SLEEP","",""],[1,T.WakeUp,"WakeUp",D.Unknown,"",0,"","",""],[0,T.KeyA,"KeyA",D.KeyA,"A",65,"VK_A","",""],[0,T.KeyB,"KeyB",D.KeyB,"B",66,"VK_B","",""],[0,T.KeyC,"KeyC",D.KeyC,"C",67,"VK_C","",""],[0,T.KeyD,"KeyD",D.KeyD,"D",68,"VK_D","",""],[0,T.KeyE,"KeyE",D.KeyE,"E",69,"VK_E","",""],[0,T.KeyF,"KeyF",D.KeyF,"F",70,"VK_F","",""],[0,T.KeyG,"KeyG",D.KeyG,"G",71,"VK_G","",""],[0,T.KeyH,"KeyH",D.KeyH,"H",72,"VK_H","",""],[0,T.KeyI,"KeyI",D.KeyI,"I",73,"VK_I","",""],[0,T.KeyJ,"KeyJ",D.KeyJ,"J",74,"VK_J","",""],[0,T.KeyK,"KeyK",D.KeyK,"K",75,"VK_K","",""],[0,T.KeyL,"KeyL",D.KeyL,"L",76,"VK_L","",""],[0,T.KeyM,"KeyM",D.KeyM,"M",77,"VK_M","",""],[0,T.KeyN,"KeyN",D.KeyN,"N",78,"VK_N","",""],[0,T.KeyO,"KeyO",D.KeyO,"O",79,"VK_O","",""],[0,T.KeyP,"KeyP",D.KeyP,"P",80,"VK_P","",""],[0,T.KeyQ,"KeyQ",D.KeyQ,"Q",81,"VK_Q","",""],[0,T.KeyR,"KeyR",D.KeyR,"R",82,"VK_R","",""],[0,T.KeyS,"KeyS",D.KeyS,"S",83,"VK_S","",""],[0,T.KeyT,"KeyT",D.KeyT,"T",84,"VK_T","",""],[0,T.KeyU,"KeyU",D.KeyU,"U",85,"VK_U","",""],[0,T.KeyV,"KeyV",D.KeyV,"V",86,"VK_V","",""],[0,T.KeyW,"KeyW",D.KeyW,"W",87,"VK_W","",""],[0,T.KeyX,"KeyX",D.KeyX,"X",88,"VK_X","",""],[0,T.KeyY,"KeyY",D.KeyY,"Y",89,"VK_Y","",""],[0,T.KeyZ,"KeyZ",D.KeyZ,"Z",90,"VK_Z","",""],[0,T.Digit1,"Digit1",D.Digit1,"1",49,"VK_1","",""],[0,T.Digit2,"Digit2",D.Digit2,"2",50,"VK_2","",""],[0,T.Digit3,"Digit3",D.Digit3,"3",51,"VK_3","",""],[0,T.Digit4,"Digit4",D.Digit4,"4",52,"VK_4","",""],[0,T.Digit5,"Digit5",D.Digit5,"5",53,"VK_5","",""],[0,T.Digit6,"Digit6",D.Digit6,"6",54,"VK_6","",""],[0,T.Digit7,"Digit7",D.Digit7,"7",55,"VK_7","",""],[0,T.Digit8,"Digit8",D.Digit8,"8",56,"VK_8","",""],[0,T.Digit9,"Digit9",D.Digit9,"9",57,"VK_9","",""],[0,T.Digit0,"Digit0",D.Digit0,"0",48,"VK_0","",""],[1,T.Enter,"Enter",D.Enter,"Enter",13,"VK_RETURN","",""],[1,T.Escape,"Escape",D.Escape,"Escape",27,"VK_ESCAPE","",""],[1,T.Backspace,"Backspace",D.Backspace,"Backspace",8,"VK_BACK","",""],[1,T.Tab,"Tab",D.Tab,"Tab",9,"VK_TAB","",""],[1,T.Space,"Space",D.Space,"Space",32,"VK_SPACE","",""],[0,T.Minus,"Minus",D.Minus,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,T.Equal,"Equal",D.Equal,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,T.BracketLeft,"BracketLeft",D.BracketLeft,"[",219,"VK_OEM_4","[","OEM_4"],[0,T.BracketRight,"BracketRight",D.BracketRight,"]",221,"VK_OEM_6","]","OEM_6"],[0,T.Backslash,"Backslash",D.Backslash,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,T.IntlHash,"IntlHash",D.Unknown,"",0,"","",""],[0,T.Semicolon,"Semicolon",D.Semicolon,";",186,"VK_OEM_1",";","OEM_1"],[0,T.Quote,"Quote",D.Quote,"'",222,"VK_OEM_7","'","OEM_7"],[0,T.Backquote,"Backquote",D.Backquote,"`",192,"VK_OEM_3","`","OEM_3"],[0,T.Comma,"Comma",D.Comma,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,T.Period,"Period",D.Period,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,T.Slash,"Slash",D.Slash,"/",191,"VK_OEM_2","/","OEM_2"],[1,T.CapsLock,"CapsLock",D.CapsLock,"CapsLock",20,"VK_CAPITAL","",""],[1,T.F1,"F1",D.F1,"F1",112,"VK_F1","",""],[1,T.F2,"F2",D.F2,"F2",113,"VK_F2","",""],[1,T.F3,"F3",D.F3,"F3",114,"VK_F3","",""],[1,T.F4,"F4",D.F4,"F4",115,"VK_F4","",""],[1,T.F5,"F5",D.F5,"F5",116,"VK_F5","",""],[1,T.F6,"F6",D.F6,"F6",117,"VK_F6","",""],[1,T.F7,"F7",D.F7,"F7",118,"VK_F7","",""],[1,T.F8,"F8",D.F8,"F8",119,"VK_F8","",""],[1,T.F9,"F9",D.F9,"F9",120,"VK_F9","",""],[1,T.F10,"F10",D.F10,"F10",121,"VK_F10","",""],[1,T.F11,"F11",D.F11,"F11",122,"VK_F11","",""],[1,T.F12,"F12",D.F12,"F12",123,"VK_F12","",""],[1,T.PrintScreen,"PrintScreen",D.Unknown,"",0,"","",""],[1,T.ScrollLock,"ScrollLock",D.ScrollLock,"ScrollLock",145,"VK_SCROLL","",""],[1,T.Pause,"Pause",D.PauseBreak,"PauseBreak",19,"VK_PAUSE","",""],[1,T.Insert,"Insert",D.Insert,"Insert",45,"VK_INSERT","",""],[1,T.Home,"Home",D.Home,"Home",36,"VK_HOME","",""],[1,T.PageUp,"PageUp",D.PageUp,"PageUp",33,"VK_PRIOR","",""],[1,T.Delete,"Delete",D.Delete,"Delete",46,"VK_DELETE","",""],[1,T.End,"End",D.End,"End",35,"VK_END","",""],[1,T.PageDown,"PageDown",D.PageDown,"PageDown",34,"VK_NEXT","",""],[1,T.ArrowRight,"ArrowRight",D.RightArrow,"RightArrow",39,"VK_RIGHT","Right",""],[1,T.ArrowLeft,"ArrowLeft",D.LeftArrow,"LeftArrow",37,"VK_LEFT","Left",""],[1,T.ArrowDown,"ArrowDown",D.DownArrow,"DownArrow",40,"VK_DOWN","Down",""],[1,T.ArrowUp,"ArrowUp",D.UpArrow,"UpArrow",38,"VK_UP","Up",""],[1,T.NumLock,"NumLock",D.NumLock,"NumLock",144,"VK_NUMLOCK","",""],[1,T.NumpadDivide,"NumpadDivide",D.NumpadDivide,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,T.NumpadMultiply,"NumpadMultiply",D.NumpadMultiply,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,T.NumpadSubtract,"NumpadSubtract",D.NumpadSubtract,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,T.NumpadAdd,"NumpadAdd",D.NumpadAdd,"NumPad_Add",107,"VK_ADD","",""],[1,T.NumpadEnter,"NumpadEnter",D.Enter,"",0,"","",""],[1,T.Numpad1,"Numpad1",D.Numpad1,"NumPad1",97,"VK_NUMPAD1","",""],[1,T.Numpad2,"Numpad2",D.Numpad2,"NumPad2",98,"VK_NUMPAD2","",""],[1,T.Numpad3,"Numpad3",D.Numpad3,"NumPad3",99,"VK_NUMPAD3","",""],[1,T.Numpad4,"Numpad4",D.Numpad4,"NumPad4",100,"VK_NUMPAD4","",""],[1,T.Numpad5,"Numpad5",D.Numpad5,"NumPad5",101,"VK_NUMPAD5","",""],[1,T.Numpad6,"Numpad6",D.Numpad6,"NumPad6",102,"VK_NUMPAD6","",""],[1,T.Numpad7,"Numpad7",D.Numpad7,"NumPad7",103,"VK_NUMPAD7","",""],[1,T.Numpad8,"Numpad8",D.Numpad8,"NumPad8",104,"VK_NUMPAD8","",""],[1,T.Numpad9,"Numpad9",D.Numpad9,"NumPad9",105,"VK_NUMPAD9","",""],[1,T.Numpad0,"Numpad0",D.Numpad0,"NumPad0",96,"VK_NUMPAD0","",""],[1,T.NumpadDecimal,"NumpadDecimal",D.NumpadDecimal,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,T.IntlBackslash,"IntlBackslash",D.IntlBackslash,"OEM_102",226,"VK_OEM_102","",""],[1,T.ContextMenu,"ContextMenu",D.ContextMenu,"ContextMenu",93,"","",""],[1,T.Power,"Power",D.Unknown,"",0,"","",""],[1,T.NumpadEqual,"NumpadEqual",D.Unknown,"",0,"","",""],[1,T.F13,"F13",D.F13,"F13",124,"VK_F13","",""],[1,T.F14,"F14",D.F14,"F14",125,"VK_F14","",""],[1,T.F15,"F15",D.F15,"F15",126,"VK_F15","",""],[1,T.F16,"F16",D.F16,"F16",127,"VK_F16","",""],[1,T.F17,"F17",D.F17,"F17",128,"VK_F17","",""],[1,T.F18,"F18",D.F18,"F18",129,"VK_F18","",""],[1,T.F19,"F19",D.F19,"F19",130,"VK_F19","",""],[1,T.F20,"F20",D.F20,"F20",131,"VK_F20","",""],[1,T.F21,"F21",D.F21,"F21",132,"VK_F21","",""],[1,T.F22,"F22",D.F22,"F22",133,"VK_F22","",""],[1,T.F23,"F23",D.F23,"F23",134,"VK_F23","",""],[1,T.F24,"F24",D.F24,"F24",135,"VK_F24","",""],[1,T.Open,"Open",D.Unknown,"",0,"","",""],[1,T.Help,"Help",D.Unknown,"",0,"","",""],[1,T.Select,"Select",D.Unknown,"",0,"","",""],[1,T.Again,"Again",D.Unknown,"",0,"","",""],[1,T.Undo,"Undo",D.Unknown,"",0,"","",""],[1,T.Cut,"Cut",D.Unknown,"",0,"","",""],[1,T.Copy,"Copy",D.Unknown,"",0,"","",""],[1,T.Paste,"Paste",D.Unknown,"",0,"","",""],[1,T.Find,"Find",D.Unknown,"",0,"","",""],[1,T.AudioVolumeMute,"AudioVolumeMute",D.AudioVolumeMute,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,T.AudioVolumeUp,"AudioVolumeUp",D.AudioVolumeUp,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,T.AudioVolumeDown,"AudioVolumeDown",D.AudioVolumeDown,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,T.NumpadComma,"NumpadComma",D.NUMPAD_SEPARATOR,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,T.IntlRo,"IntlRo",D.ABNT_C1,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,T.KanaMode,"KanaMode",D.Unknown,"",0,"","",""],[0,T.IntlYen,"IntlYen",D.Unknown,"",0,"","",""],[1,T.Convert,"Convert",D.Unknown,"",0,"","",""],[1,T.NonConvert,"NonConvert",D.Unknown,"",0,"","",""],[1,T.Lang1,"Lang1",D.Unknown,"",0,"","",""],[1,T.Lang2,"Lang2",D.Unknown,"",0,"","",""],[1,T.Lang3,"Lang3",D.Unknown,"",0,"","",""],[1,T.Lang4,"Lang4",D.Unknown,"",0,"","",""],[1,T.Lang5,"Lang5",D.Unknown,"",0,"","",""],[1,T.Abort,"Abort",D.Unknown,"",0,"","",""],[1,T.Props,"Props",D.Unknown,"",0,"","",""],[1,T.NumpadParenLeft,"NumpadParenLeft",D.Unknown,"",0,"","",""],[1,T.NumpadParenRight,"NumpadParenRight",D.Unknown,"",0,"","",""],[1,T.NumpadBackspace,"NumpadBackspace",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryStore,"NumpadMemoryStore",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryRecall,"NumpadMemoryRecall",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryClear,"NumpadMemoryClear",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryAdd,"NumpadMemoryAdd",D.Unknown,"",0,"","",""],[1,T.NumpadMemorySubtract,"NumpadMemorySubtract",D.Unknown,"",0,"","",""],[1,T.NumpadClear,"NumpadClear",D.Clear,"Clear",12,"VK_CLEAR","",""],[1,T.NumpadClearEntry,"NumpadClearEntry",D.Unknown,"",0,"","",""],[1,T.None,"",D.Ctrl,"Ctrl",17,"VK_CONTROL","",""],[1,T.None,"",D.Shift,"Shift",16,"VK_SHIFT","",""],[1,T.None,"",D.Alt,"Alt",18,"VK_MENU","",""],[1,T.None,"",D.Meta,"Meta",91,"VK_COMMAND","",""],[1,T.ControlLeft,"ControlLeft",D.Ctrl,"",0,"VK_LCONTROL","",""],[1,T.ShiftLeft,"ShiftLeft",D.Shift,"",0,"VK_LSHIFT","",""],[1,T.AltLeft,"AltLeft",D.Alt,"",0,"VK_LMENU","",""],[1,T.MetaLeft,"MetaLeft",D.Meta,"",0,"VK_LWIN","",""],[1,T.ControlRight,"ControlRight",D.Ctrl,"",0,"VK_RCONTROL","",""],[1,T.ShiftRight,"ShiftRight",D.Shift,"",0,"VK_RSHIFT","",""],[1,T.AltRight,"AltRight",D.Alt,"",0,"VK_RMENU","",""],[1,T.MetaRight,"MetaRight",D.Meta,"",0,"VK_RWIN","",""],[1,T.BrightnessUp,"BrightnessUp",D.Unknown,"",0,"","",""],[1,T.BrightnessDown,"BrightnessDown",D.Unknown,"",0,"","",""],[1,T.MediaPlay,"MediaPlay",D.Unknown,"",0,"","",""],[1,T.MediaRecord,"MediaRecord",D.Unknown,"",0,"","",""],[1,T.MediaFastForward,"MediaFastForward",D.Unknown,"",0,"","",""],[1,T.MediaRewind,"MediaRewind",D.Unknown,"",0,"","",""],[1,T.MediaTrackNext,"MediaTrackNext",D.MediaTrackNext,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,T.MediaTrackPrevious,"MediaTrackPrevious",D.MediaTrackPrevious,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,T.MediaStop,"MediaStop",D.MediaStop,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,T.Eject,"Eject",D.Unknown,"",0,"","",""],[1,T.MediaPlayPause,"MediaPlayPause",D.MediaPlayPause,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,T.MediaSelect,"MediaSelect",D.LaunchMediaPlayer,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,T.LaunchMail,"LaunchMail",D.LaunchMail,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,T.LaunchApp2,"LaunchApp2",D.LaunchApp2,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,T.LaunchApp1,"LaunchApp1",D.Unknown,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,T.SelectTask,"SelectTask",D.Unknown,"",0,"","",""],[1,T.LaunchScreenSaver,"LaunchScreenSaver",D.Unknown,"",0,"","",""],[1,T.BrowserSearch,"BrowserSearch",D.BrowserSearch,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,T.BrowserHome,"BrowserHome",D.BrowserHome,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,T.BrowserBack,"BrowserBack",D.BrowserBack,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,T.BrowserForward,"BrowserForward",D.BrowserForward,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,T.BrowserStop,"BrowserStop",D.Unknown,"",0,"VK_BROWSER_STOP","",""],[1,T.BrowserRefresh,"BrowserRefresh",D.Unknown,"",0,"VK_BROWSER_REFRESH","",""],[1,T.BrowserFavorites,"BrowserFavorites",D.Unknown,"",0,"VK_BROWSER_FAVORITES","",""],[1,T.ZoomToggle,"ZoomToggle",D.Unknown,"",0,"","",""],[1,T.MailReply,"MailReply",D.Unknown,"",0,"","",""],[1,T.MailForward,"MailForward",D.Unknown,"",0,"","",""],[1,T.MailSend,"MailSend",D.Unknown,"",0,"","",""],[1,T.None,"",D.KEY_IN_COMPOSITION,"KeyInComposition",229,"","",""],[1,T.None,"",D.ABNT_C2,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,T.None,"",D.OEM_8,"OEM_8",223,"VK_OEM_8","",""],[1,T.None,"",D.Unknown,"",0,"VK_KANA","",""],[1,T.None,"",D.Unknown,"",0,"VK_HANGUL","",""],[1,T.None,"",D.Unknown,"",0,"VK_JUNJA","",""],[1,T.None,"",D.Unknown,"",0,"VK_FINAL","",""],[1,T.None,"",D.Unknown,"",0,"VK_HANJA","",""],[1,T.None,"",D.Unknown,"",0,"VK_KANJI","",""],[1,T.None,"",D.Unknown,"",0,"VK_CONVERT","",""],[1,T.None,"",D.Unknown,"",0,"VK_NONCONVERT","",""],[1,T.None,"",D.Unknown,"",0,"VK_ACCEPT","",""],[1,T.None,"",D.Unknown,"",0,"VK_MODECHANGE","",""],[1,T.None,"",D.Unknown,"",0,"VK_SELECT","",""],[1,T.None,"",D.Unknown,"",0,"VK_PRINT","",""],[1,T.None,"",D.Unknown,"",0,"VK_EXECUTE","",""],[1,T.None,"",D.Unknown,"",0,"VK_SNAPSHOT","",""],[1,T.None,"",D.Unknown,"",0,"VK_HELP","",""],[1,T.None,"",D.Unknown,"",0,"VK_APPS","",""],[1,T.None,"",D.Unknown,"",0,"VK_PROCESSKEY","",""],[1,T.None,"",D.Unknown,"",0,"VK_PACKET","",""],[1,T.None,"",D.Unknown,"",0,"VK_DBE_SBCSCHAR","",""],[1,T.None,"",D.Unknown,"",0,"VK_DBE_DBCSCHAR","",""],[1,T.None,"",D.Unknown,"",0,"VK_ATTN","",""],[1,T.None,"",D.Unknown,"",0,"VK_CRSEL","",""],[1,T.None,"",D.Unknown,"",0,"VK_EXSEL","",""],[1,T.None,"",D.Unknown,"",0,"VK_EREOF","",""],[1,T.None,"",D.Unknown,"",0,"VK_PLAY","",""],[1,T.None,"",D.Unknown,"",0,"VK_ZOOM","",""],[1,T.None,"",D.Unknown,"",0,"VK_NONAME","",""],[1,T.None,"",D.Unknown,"",0,"VK_PA1","",""],[1,T.None,"",D.Unknown,"",0,"VK_OEM_CLEAR","",""]],t=[],i=[];for(const s of e){const[r,o,a,l,c,u,d,f,p]=s;if(i[o]||(i[o]=!0,oU[a]=o,aU[a.toLowerCase()]=o,r&&l!==D.Unknown&&l!==D.Enter&&l!==D.Ctrl&&l!==D.Shift&&l!==D.Alt&&l!==D.Meta&&(V0[l]=o)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);fp.define(l,c),B0.define(l,f||c),W0.define(l,p||f||c)}u&&(rU[u]=l)}V0[D.Enter]=T.Enter})();var p4;(function(n){function e(a){return fp.keyCodeToStr(a)}n.toString=e;function t(a){return fp.strToKeyCode(a)}n.fromString=t;function i(a){return B0.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return W0.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function r(a){return B0.strToKeyCode(a)||W0.strToKeyCode(a)}n.fromUserSettings=r;function o(a){if(a>=D.Numpad0&&a<=D.NumpadDivide)return null;switch(a){case D.UpArrow:return"Up";case D.DownArrow:return"Down";case D.LeftArrow:return"Left";case D.RightArrow:return"Right"}return fp.keyCodeToStr(a)}n.toElectronAccelerator=o})(p4||(p4={}));var g4;(function(n){n[n.CtrlCmd=2048]="CtrlCmd",n[n.Shift=1024]="Shift",n[n.Alt=512]="Alt",n[n.WinCtrl=256]="WinCtrl"})(g4||(g4={}));var Ko;(function(n){n[n.CtrlCmd=2048]="CtrlCmd",n[n.Shift=1024]="Shift",n[n.Alt=512]="Alt",n[n.WinCtrl=256]="WinCtrl",n[n.KeyCode=255]="KeyCode"})(Ko||(Ko={}));function m4(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new pp([Uf(t,e),Uf(i,e)]):new pp([Uf(t,e)])}else{const t=[];for(let i=0;i<n.length;i++)t.push(Uf(n[i],e));return new pp(t)}}function Uf(n,e){const t=!!(n&Ko.CtrlCmd),i=!!(n&Ko.WinCtrl),s=e===Ms.Macintosh?i:t,r=!!(n&Ko.Shift),o=!!(n&Ko.Alt),a=e===Ms.Macintosh?t:i,l=n&Ko.KeyCode;return new DE(s,r,o,a,l)}class DE{constructor(e,t,i,s,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyCode=r}equals(e){return e instanceof DE&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){const e=this.ctrlKey?"1":"0",t=this.shiftKey?"1":"0",i=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${e}${t}${i}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===D.Unknown||this.keyCode===D.Ctrl||this.keyCode===D.Meta||this.keyCode===D.Alt||this.keyCode===D.Shift}toKeybinding(){return new pp([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===D.Ctrl||this.shiftKey&&this.keyCode===D.Shift||this.altKey&&this.keyCode===D.Alt||this.metaKey&&this.keyCode===D.Meta}}class pp{constructor(e){if(e.length===0)throw Ve("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}}var _4;(function(n){n[n.EditorCore=0]="EditorCore",n[n.EditorContrib=100]="EditorContrib",n[n.WorkbenchContrib=200]="WorkbenchContrib",n[n.BuiltinExtension=300]="BuiltinExtension",n[n.ExternalExtension=400]="ExternalExtension"})(_4||(_4={}));class IE{constructor(){this._coreKeybindings=new To,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(bf===Ms.Windows){if(e&&e.win)return e.win}else if(bf===Ms.Macintosh){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=IE.bindToCurrentPlatform(e),i=new xe;if(t&&t.primary){const s=m4(t.primary,bf);s&&i.add(this._registerDefaultKeybinding(s,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let s=0,r=t.secondary.length;s<r;s++){const o=t.secondary[s],a=m4(o,bf);a&&i.add(this._registerDefaultKeybinding(a,e.id,e.args,e.weight,-s-1,e.when))}return i}setExtensionKeybindings(e){const t=[];let i=0;for(const s of e)s.keybinding&&(t[i++]={keybinding:s.keybinding,command:s.id,commandArgs:s.args,when:s.when,weight1:s.weight,weight2:0,extensionId:s.extensionId||null,isBuiltinExtension:s.isBuiltinExtension||!1});this._extensionKeybindings=t,this._cachedMergedKeybindings=null}registerCommandAndKeybindingRule(e){return bx(this.registerKeybindingRule(e),SE.registerCommand(e))}_registerDefaultKeybinding(e,t,i,s,r,o){const a=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:o,weight1:s,weight2:r,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,we(()=>{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(uU)),this._cachedMergedKeybindings.slice(0)}}const lU=new IE,cU={EditorModes:"platform.keybindingsRegistry"};mn.add(cU.EditorModes,lU);function uU(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.command<e.command)return-1;if(n.command>e.command)return 1}return n.weight2-e.weight2}var gp;function dU(n){return n.command!==void 0}const y=class y{static for(e){return y._instances.get(e)??new y(e)}constructor(e){if(y._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);y._instances.set(e,this),this.id=e}};y._instances=new Map,y.CommandPalette=new y("CommandPalette"),y.DebugBreakpointsContext=new y("DebugBreakpointsContext"),y.DebugCallStackContext=new y("DebugCallStackContext"),y.DebugConsoleContext=new y("DebugConsoleContext"),y.DebugVariablesContext=new y("DebugVariablesContext"),y.NotebookVariablesContext=new y("NotebookVariablesContext"),y.DebugHoverContext=new y("DebugHoverContext"),y.DebugWatchContext=new y("DebugWatchContext"),y.DebugToolBar=new y("DebugToolBar"),y.DebugToolBarStop=new y("DebugToolBarStop"),y.DebugDisassemblyContext=new y("DebugDisassemblyContext"),y.DebugCallStackToolbar=new y("DebugCallStackToolbar"),y.DebugCreateConfiguration=new y("DebugCreateConfiguration"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContent=new y("EditorContent"),y.EditorLineNumberContext=new y("EditorLineNumberContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.EditorContextShare=new y("EditorContextShare"),y.EditorTitle=new y("EditorTitle"),y.CompactWindowEditorTitle=new y("CompactWindowEditorTitle"),y.EditorTitleRun=new y("EditorTitleRun"),y.EditorTitleContext=new y("EditorTitleContext"),y.EditorTitleContextShare=new y("EditorTitleContextShare"),y.EmptyEditorGroup=new y("EmptyEditorGroup"),y.EmptyEditorGroupContext=new y("EmptyEditorGroupContext"),y.EditorTabsBarContext=new y("EditorTabsBarContext"),y.EditorTabsBarShowTabsSubmenu=new y("EditorTabsBarShowTabsSubmenu"),y.EditorTabsBarShowTabsZenModeSubmenu=new y("EditorTabsBarShowTabsZenModeSubmenu"),y.EditorActionsPositionSubmenu=new y("EditorActionsPositionSubmenu"),y.ExplorerContext=new y("ExplorerContext"),y.ExplorerContextShare=new y("ExplorerContextShare"),y.ExtensionContext=new y("ExtensionContext"),y.ExtensionEditorContextMenu=new y("ExtensionEditorContextMenu"),y.GlobalActivity=new y("GlobalActivity"),y.CommandCenter=new y("CommandCenter"),y.CommandCenterCenter=new y("CommandCenterCenter"),y.LayoutControlMenuSubmenu=new y("LayoutControlMenuSubmenu"),y.LayoutControlMenu=new y("LayoutControlMenu"),y.MenubarMainMenu=new y("MenubarMainMenu"),y.MenubarAppearanceMenu=new y("MenubarAppearanceMenu"),y.MenubarDebugMenu=new y("MenubarDebugMenu"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarFileMenu=new y("MenubarFileMenu"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarHelpMenu=new y("MenubarHelpMenu"),y.MenubarLayoutMenu=new y("MenubarLayoutMenu"),y.MenubarNewBreakpointMenu=new y("MenubarNewBreakpointMenu"),y.PanelAlignmentMenu=new y("PanelAlignmentMenu"),y.PanelPositionMenu=new y("PanelPositionMenu"),y.ActivityBarPositionMenu=new y("ActivityBarPositionMenu"),y.MenubarPreferencesMenu=new y("MenubarPreferencesMenu"),y.MenubarRecentMenu=new y("MenubarRecentMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.MenubarShare=new y("MenubarShare"),y.MenubarSwitchEditorMenu=new y("MenubarSwitchEditorMenu"),y.MenubarSwitchGroupMenu=new y("MenubarSwitchGroupMenu"),y.MenubarTerminalMenu=new y("MenubarTerminalMenu"),y.MenubarTerminalSuggestStatusMenu=new y("MenubarTerminalSuggestStatusMenu"),y.MenubarViewMenu=new y("MenubarViewMenu"),y.MenubarHomeMenu=new y("MenubarHomeMenu"),y.OpenEditorsContext=new y("OpenEditorsContext"),y.OpenEditorsContextShare=new y("OpenEditorsContextShare"),y.ProblemsPanelContext=new y("ProblemsPanelContext"),y.SCMInputBox=new y("SCMInputBox"),y.SCMChangeContext=new y("SCMChangeContext"),y.SCMResourceContext=new y("SCMResourceContext"),y.SCMResourceContextShare=new y("SCMResourceContextShare"),y.SCMResourceFolderContext=new y("SCMResourceFolderContext"),y.SCMResourceGroupContext=new y("SCMResourceGroupContext"),y.SCMSourceControl=new y("SCMSourceControl"),y.SCMSourceControlInline=new y("SCMSourceControlInline"),y.SCMSourceControlTitle=new y("SCMSourceControlTitle"),y.SCMHistoryTitle=new y("SCMHistoryTitle"),y.SCMHistoryItemContext=new y("SCMHistoryItemContext"),y.SCMHistoryItemChatContext=new y("SCMHistoryItemChatContext"),y.SCMHistoryItemChangeContext=new y("SCMHistoryItemChangeContext"),y.SCMHistoryItemHover=new y("SCMHistoryItemHover"),y.SCMHistoryItemRefContext=new y("SCMHistoryItemRefContext"),y.SCMQuickDiffDecorations=new y("SCMQuickDiffDecorations"),y.SCMTitle=new y("SCMTitle"),y.SearchContext=new y("SearchContext"),y.SearchActionMenu=new y("SearchActionContext"),y.StatusBarWindowIndicatorMenu=new y("StatusBarWindowIndicatorMenu"),y.StatusBarRemoteIndicatorMenu=new y("StatusBarRemoteIndicatorMenu"),y.StickyScrollContext=new y("StickyScrollContext"),y.TestItem=new y("TestItem"),y.TestItemGutter=new y("TestItemGutter"),y.TestProfilesContext=new y("TestProfilesContext"),y.TestMessageContext=new y("TestMessageContext"),y.TestMessageContent=new y("TestMessageContent"),y.TestPeekElement=new y("TestPeekElement"),y.TestPeekTitle=new y("TestPeekTitle"),y.TestCallStack=new y("TestCallStack"),y.TestCoverageFilterItem=new y("TestCoverageFilterItem"),y.TouchBarContext=new y("TouchBarContext"),y.TitleBar=new y("TitleBar"),y.TitleBarContext=new y("TitleBarContext"),y.TitleBarTitleContext=new y("TitleBarTitleContext"),y.TunnelContext=new y("TunnelContext"),y.TunnelPrivacy=new y("TunnelPrivacy"),y.TunnelProtocol=new y("TunnelProtocol"),y.TunnelPortInline=new y("TunnelInline"),y.TunnelTitle=new y("TunnelTitle"),y.TunnelLocalAddressInline=new y("TunnelLocalAddressInline"),y.TunnelOriginInline=new y("TunnelOriginInline"),y.ViewItemContext=new y("ViewItemContext"),y.ViewContainerTitle=new y("ViewContainerTitle"),y.ViewContainerTitleContext=new y("ViewContainerTitleContext"),y.ViewTitle=new y("ViewTitle"),y.ViewTitleContext=new y("ViewTitleContext"),y.CommentEditorActions=new y("CommentEditorActions"),y.CommentThreadTitle=new y("CommentThreadTitle"),y.CommentThreadActions=new y("CommentThreadActions"),y.CommentThreadAdditionalActions=new y("CommentThreadAdditionalActions"),y.CommentThreadTitleContext=new y("CommentThreadTitleContext"),y.CommentThreadCommentContext=new y("CommentThreadCommentContext"),y.CommentTitle=new y("CommentTitle"),y.CommentActions=new y("CommentActions"),y.CommentsViewThreadActions=new y("CommentsViewThreadActions"),y.InteractiveToolbar=new y("InteractiveToolbar"),y.InteractiveCellTitle=new y("InteractiveCellTitle"),y.InteractiveCellDelete=new y("InteractiveCellDelete"),y.InteractiveCellExecute=new y("InteractiveCellExecute"),y.InteractiveInputExecute=new y("InteractiveInputExecute"),y.InteractiveInputConfig=new y("InteractiveInputConfig"),y.ReplInputExecute=new y("ReplInputExecute"),y.IssueReporter=new y("IssueReporter"),y.NotebookToolbar=new y("NotebookToolbar"),y.NotebookToolbarContext=new y("NotebookToolbarContext"),y.NotebookStickyScrollContext=new y("NotebookStickyScrollContext"),y.NotebookCellTitle=new y("NotebookCellTitle"),y.NotebookCellDelete=new y("NotebookCellDelete"),y.NotebookCellInsert=new y("NotebookCellInsert"),y.NotebookCellBetween=new y("NotebookCellBetween"),y.NotebookCellListTop=new y("NotebookCellTop"),y.NotebookCellExecute=new y("NotebookCellExecute"),y.NotebookCellExecuteGoTo=new y("NotebookCellExecuteGoTo"),y.NotebookCellExecutePrimary=new y("NotebookCellExecutePrimary"),y.NotebookDiffCellInputTitle=new y("NotebookDiffCellInputTitle"),y.NotebookDiffDocumentMetadata=new y("NotebookDiffDocumentMetadata"),y.NotebookDiffCellMetadataTitle=new y("NotebookDiffCellMetadataTitle"),y.NotebookDiffCellOutputsTitle=new y("NotebookDiffCellOutputsTitle"),y.NotebookOutputToolbar=new y("NotebookOutputToolbar"),y.NotebookOutlineFilter=new y("NotebookOutlineFilter"),y.NotebookOutlineActionMenu=new y("NotebookOutlineActionMenu"),y.NotebookEditorLayoutConfigure=new y("NotebookEditorLayoutConfigure"),y.NotebookKernelSource=new y("NotebookKernelSource"),y.BulkEditTitle=new y("BulkEditTitle"),y.BulkEditContext=new y("BulkEditContext"),y.TimelineItemContext=new y("TimelineItemContext"),y.TimelineTitle=new y("TimelineTitle"),y.TimelineTitleContext=new y("TimelineTitleContext"),y.TimelineFilterSubMenu=new y("TimelineFilterSubMenu"),y.AccountsContext=new y("AccountsContext"),y.SidebarTitle=new y("SidebarTitle"),y.PanelTitle=new y("PanelTitle"),y.AuxiliaryBarTitle=new y("AuxiliaryBarTitle"),y.AuxiliaryBarHeader=new y("AuxiliaryBarHeader"),y.TerminalInstanceContext=new y("TerminalInstanceContext"),y.TerminalEditorInstanceContext=new y("TerminalEditorInstanceContext"),y.TerminalNewDropdownContext=new y("TerminalNewDropdownContext"),y.TerminalTabContext=new y("TerminalTabContext"),y.TerminalTabEmptyAreaContext=new y("TerminalTabEmptyAreaContext"),y.TerminalStickyScrollContext=new y("TerminalStickyScrollContext"),y.WebviewContext=new y("WebviewContext"),y.InlineCompletionsActions=new y("InlineCompletionsActions"),y.InlineEditsActions=new y("InlineEditsActions"),y.NewFile=new y("NewFile"),y.MergeInput1Toolbar=new y("MergeToolbar1Toolbar"),y.MergeInput2Toolbar=new y("MergeToolbar2Toolbar"),y.MergeBaseToolbar=new y("MergeBaseToolbar"),y.MergeInputResultToolbar=new y("MergeToolbarResultToolbar"),y.InlineSuggestionToolbar=new y("InlineSuggestionToolbar"),y.InlineEditToolbar=new y("InlineEditToolbar"),y.ChatContext=new y("ChatContext"),y.ChatCodeBlock=new y("ChatCodeblock"),y.ChatCompareBlock=new y("ChatCompareBlock"),y.ChatMessageTitle=new y("ChatMessageTitle"),y.ChatMessageFooter=new y("ChatMessageFooter"),y.ChatExecute=new y("ChatExecute"),y.ChatExecuteSecondary=new y("ChatExecuteSecondary"),y.ChatInput=new y("ChatInput"),y.ChatInputSide=new y("ChatInputSide"),y.ChatModelPicker=new y("ChatModelPicker"),y.ChatModePicker=new y("ChatModePicker"),y.ChatEditingWidgetToolbar=new y("ChatEditingWidgetToolbar"),y.ChatEditingEditorContent=new y("ChatEditingEditorContent"),y.ChatEditingEditorHunk=new y("ChatEditingEditorHunk"),y.ChatEditingDeletedNotebookCell=new y("ChatEditingDeletedNotebookCell"),y.ChatInputAttachmentToolbar=new y("ChatInputAttachmentToolbar"),y.ChatEditingWidgetModifiedFilesToolbar=new y("ChatEditingWidgetModifiedFilesToolbar"),y.ChatInputResourceAttachmentContext=new y("ChatInputResourceAttachmentContext"),y.ChatInputSymbolAttachmentContext=new y("ChatInputSymbolAttachmentContext"),y.ChatInlineResourceAnchorContext=new y("ChatInlineResourceAnchorContext"),y.ChatInlineSymbolAnchorContext=new y("ChatInlineSymbolAnchorContext"),y.ChatEditingCodeBlockContext=new y("ChatEditingCodeBlockContext"),y.ChatTitleBarMenu=new y("ChatTitleBarMenu"),y.ChatAttachmentsContext=new y("ChatAttachmentsContext"),y.ChatToolOutputResourceToolbar=new y("ChatToolOutputResourceToolbar"),y.ChatExplorerMenu=new y("ChatExplorerMenu"),y.ChatTextEditorMenu=new y("ChatTextEditorMenu"),y.ChatTerminalMenu=new y("ChatTerminalMenu"),y.ChatToolOutputResourceContext=new y("ChatToolOutputResourceContext"),y.AccessibleView=new y("AccessibleView"),y.MultiDiffEditorFileToolbar=new y("MultiDiffEditorFileToolbar"),y.DiffEditorHunkToolbar=new y("DiffEditorHunkToolbar"),y.DiffEditorSelectionToolbar=new y("DiffEditorSelectionToolbar");let Ra=y;const Cd=class Cd{static for(e){let t=this._all.get(e);return t||(t=new Cd(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Cd&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Cd._all=new Map;let Qo=Cd;new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new gA({merge:Qo.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Qo.for(Ra.CommandPalette)),we(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Qo.for(Ra.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new To,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(Qo.for(n)),we(()=>{i(),this._onDidChangeMenu.fire(Qo.for(n))})}appendMenuItems(n){const e=new xe;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===Ra.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)dU(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};let v4=gp=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,r,o,a){this.hideActions=s,this.menuKeybinding=r,this._commandService=a,this.id=e.id,this.label=gp.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let l;if(e.toggled){const c=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(c.condition),this.checked&&c.tooltip&&(this.tooltip=typeof c.tooltip=="string"?c.tooltip:c.tooltip.value),this.checked&&sn.isThemeIcon(c.icon)&&(l=c.icon),this.checked&&c.title&&(this.label=typeof c.title=="string"?c.title:c.title.value)}l||(l=sn.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new gp(t,void 0,i,s,void 0,o,a):void 0,this._options=i,this.class=l&&sn.asClassName(l)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};v4=gp=V([L(5,r_),L(6,p5)],v4);const g5=pe("extensionsWorkbenchService");G1(6919,"Extensions");var z0;(function(n){n[n.Installing=0]="Installing",n[n.Installed=1]="Installed",n[n.Uninstalling=2]="Uninstalling",n[n.Uninstalled=3]="Uninstalled"})(z0||(z0={}));var w4;(function(n){n.ReloadWindow="reloadWindow",n.RestartExtensions="restartExtensions",n.DownloadUpdate="downloadUpdate",n.ApplyUpdate="applyUpdate",n.QuitAndInstall="quitAndInstall"})(w4||(w4={}));var b4;(function(n){n.Readme="readme",n.Features="features",n.Changelog="changelog",n.Dependencies="dependencies",n.ExtensionPack="extensionPack"})(b4||(b4={}));let y4=class extends Se{constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set extension(e){this.containers.forEach(t=>t.extension=e)}update(e){for(const t of this.containers)e&&t.extension?M6(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};y4=V([L(1,g5)],y4);new P("defaultExtensionViews",!0);new P("hasOutdatedExtensions",!1);new P("hasGallery",!1);new P("extensionResultListFocused ",!0);new P("searchMcpServers",!1);new Ra("extensionsSearchActionsMenu");new Ra("extensionsFilterSubMenu");const hU="vscode_searchExtensions_internal";sn.fromId(_e.extensions.id),h(6932,"Search Extensions"),h(6933,"This is a tool for browsing Visual Studio Code Extensions Marketplace. It allows the model to search for extensions and retrieve detailed information about them. The model should use this tool whenever it needs to discover extensions or resolve information about known ones. To use the tool, the model has to provide the category of the extensions, relevant search keywords, or known extension IDs. Note that search results may include false positives, so reviewing and filtering is recommended."),h(6934,"Search for extensions in the Visual Studio Code Extensions Marketplace"),a1.Internal;let x4=class{constructor(e){this.extensionWorkbenchService=e}async invoke(e,t,i,s){const r=e.parameters;if(!r.keywords?.length&&!r.category&&!r.ids?.length)return{content:[{kind:"text",value:h(6935,"Please provide a category or keywords or ids to search for.")}]};const o=new Map,a=u=>{for(const d of u)d.deprecationInfo||d.isMalicious||o.set(d.identifier.id.toLowerCase(),{id:d.identifier.id,name:d.displayName,description:d.description,installed:d.state===z0.Installed,installCount:d.installCount??0,rating:d.rating??0,categories:d.categories??[],tags:d.gallery?.tags??[]})},l=async u=>{const d=await this.extensionWorkbenchService.queryGallery({text:u,pageSize:10,sortBy:Sw.InstallCount},s);d.firstPage.length&&a(d.firstPage)};if(r.ids?.length){const u=await this.extensionWorkbenchService.getExtensions(r.ids.map(d=>({id:d})),s);a(u)}if(r.keywords?.length)for(const u of r.keywords??[])if(u==="featured")await l("featured");else{let d=r.category?`category:"${r.category}"`:"";d=u?`${d} ${u}`.trim():d,await l(d)}else await l(`category:"${r.category}"`);const c=Array.from(o.values());return{content:[{kind:"text",value:`Here are the list of extensions:
|
|
115
|
+
`)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));const e={type:this.eventTypeBuffer||"message",data:this.dataBuffer};this.currentEventId!==void 0&&(e.id=this.currentEventId),this.reconnectionTime!==void 0&&(e.retry=this.reconnectionTime),this.onEventHandler(e),this.reset()}reset(){this.dataBuffer="",this.eventTypeBuffer="",this.currentEventId=void 0}}const I0=pe("IExtHostMpcService");let C0=class extends Se{constructor(e,t){super(),this._extHostInitData=t,this._initialProviderPromises=new Set,this._sseEventSources=this._register(new xp),this._unresolvedMcpServers=new Map,this._proxy=e.getProxy(ee.MainThreadMcp)}$startMcp(e,t){this._startMcp(e,Dh.fromSerialized(t))}_startMcp(e,t){if(t.type===Xa.HTTP){this._sseEventSources.set(e,new ZF(e,t,this._proxy));return}throw new Error("not implemented")}$stopMcp(e){this._sseEventSources.has(e)&&(this._sseEventSources.deleteAndDispose(e),this._proxy.$onDidChangeState(e,{state:mr.Kind.Stopped}))}$sendMessage(e,t){this._sseEventSources.get(e)?.send(t)}async $waitForInitialCollectionProviders(){await Promise.all(this._initialProviderPromises)}async $resolveMcpLaunch(e,t){const i=this._unresolvedMcpServers.get(e);if(!i)return;const s=i.servers.find(o=>o.label===t);if(!s)return;if(!i.provider.resolveMcpServerDefinition)return fd.from(s);const r=await i.provider.resolveMcpServerDefinition(s,yt.None);return r?fd.from(r):void 0}registerMcpConfigurationProvider(e,t,i){const s=new xe,r=e.contributes?.mcpServerDefinitionProviders?.find(c=>c.id===t);if(!r)throw new Error(`MCP configuration providers must be registered in the contributes.mcpServerDefinitionProviders array within your package.json, but "${t}" was not`);const o={id:V3(e.identifier,t),isTrustedByDefault:!0,label:r?.label??e.displayName??e.name,scope:Gt.WORKSPACE,canResolveLaunch:typeof i.resolveMcpServerDefinition=="function",extensionId:e.identifier.value,configTarget:this._extHostInitData.remote.isRemote?Zt.USER_REMOTE:Zt.USER},a=async()=>{const c=await i.provideMcpServerDefinitions(yt.None);this._unresolvedMcpServers.set(o.id,{servers:c??[],provider:i});const u=[];for(const d of c??[]){let f=tt.toKey(e.identifier)+"/"+d.label;if(u.some(p=>p.id===f)){let p=2;for(;u.some(_=>_.id===f+p);)p++;f=f+p}u.push({id:f,label:d.label,cacheNonce:d.version,launch:fd.from(d)})}this._proxy.$upsertMcpCollection(o,u)};s.add(we(()=>{this._unresolvedMcpServers.delete(o.id),this._proxy.$deleteMcpCollection(o.id)})),i.onDidChangeMcpServerDefinitions&&s.add(i.onDidChangeMcpServerDefinitions(a)),i.onDidChangeServerDefinitions&&s.add(i.onDidChangeServerDefinitions(a)),i.onDidChange&&s.add(i.onDidChange(a));const l=new Promise(c=>{setTimeout(()=>a().finally(()=>{this._initialProviderPromises.delete(l),c()}),0)});return this._initialProviderPromises.add(l),s}};C0=V([L(0,nt),L(1,gn)],C0);var bi;(function(n){n[n.Unknown=0]="Unknown",n[n.Http=1]="Http",n[n.SSE=2]="SSE"})(bi||(bi={}));class ZF extends Se{constructor(e,t,i){super(),this._id=e,this._launch=t,this._proxy=i,this._requestSequencer=new RR,this._postEndpoint=new Eo,this._mode={value:bi.Unknown},this._cts=new Nt,this._abortCtrl=new AbortController,this._register(we(()=>{this._abortCtrl.abort(),this._cts.dispose(!0)})),this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Running})}async send(e){try{await this._requestSequencer.queue(()=>this._mode.value===bi.SSE?this._sendLegacySSE(this._mode.endpoint,e):this._sendStreamableHttp(e,this._mode.value===bi.Http?this._mode.sessionId:void 0))}catch(t){const i=`Error sending message to ${this._launch.uri}: ${String(t)}`;this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:i})}}async _sendStreamableHttp(e,t){const i=new TextEncoder().encode(e),s={...Object.fromEntries(this._launch.headers),"Content-Type":"application/json","Content-Length":String(i.length),Accept:"text/event-stream, application/json"};t&&(s["Mcp-Session-Id"]=t),await this._addAuthHeader(s);const r=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"POST",signal:this._abortCtrl.signal,headers:s,body:i},s),o=this._mode.value===bi.Unknown,a=r.headers.get("Mcp-Session-Id");if(a&&(this._mode={value:bi.Http,sessionId:a}),this._mode.value===bi.Unknown&&r.status>=400&&r.status<500&&r.status!==401&&r.status!==403){this._log(Be.Info,`${r.status} status sending message to ${this._launch.uri}, will attempt to fall back to legacy SSE`),this._sseFallbackWithMessage(e);return}if(r.status>=300){const l=this._mode.value===bi.Http&&!!this._mode.sessionId&&(r.status===400||r.status===404);this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`${r.status} status sending message to ${this._launch.uri}: ${await this._getErrText(r)}`+l?"; will retry with new session ID":"",shouldRetry:l});return}this._mode.value===bi.Unknown&&(this._mode={value:bi.Http,sessionId:void 0}),o&&this._attachStreamableBackchannel(),this._handleSuccessfulStreamableHttp(r,e)}async _sseFallbackWithMessage(e){const t=await this._attachSSE();t&&(this._mode={value:bi.SSE,endpoint:t},await this._sendLegacySSE(t,e))}async _populateAuthMetadata(e){let t;if(e.headers.has("WWW-Authenticate")){const c=e.headers.get("WWW-Authenticate"),{scheme:u,params:d}=oO(c);u==="Bearer"&&d.resource_metadata&&(t=d.resource_metadata)}let i,s,r;if(t){const c=await this._getResourceMetadata(t);i=c.authorization_servers?.[0],s=c.scopes_supported,r=c}const o=new URL(e.url).origin;let a={};i||(i=o,a={...Object.fromEntries(this._launch.headers)});try{const c=await this._getAuthorizationServerMetadata(i,a),u=sO(c);this._authMetadata={authorizationServer:x.parse(i),serverMetadata:u,resourceMetadata:r};return}catch(c){this._log(Be.Warning,`Error populating auth metadata: ${String(c)}`)}const l=iO(new URL(o));l.scopes_supported=s??l.scopes_supported??[],this._authMetadata={authorizationServer:x.parse(i),serverMetadata:l,resourceMetadata:r}}async _getResourceMetadata(e){const t=new URL(e),i=new URL(this._launch.uri.toString(!0));let s={};t.origin===i.origin&&(s={...Object.fromEntries(this._launch.headers)});const r=await fetch(e,{method:"GET",signal:this._abortCtrl.signal,headers:{...s,Accept:"application/json","MCP-Protocol-Version":ud.LATEST_PROTOCOL_VERSION}});if(r.status!==200)throw new Error(`Failed to fetch resource metadata: ${r.status} ${await this._getErrText(r)}`);const o=await r.json();if(eO(o))return o;throw new Error(`Invalid resource metadata: ${JSON.stringify(o)}`)}async _getAuthorizationServerMetadata(e,t){const i=new URL(e),s=i.pathname==="/"?"":i.pathname,r=new URL(ZN,e).toString()+s;let o=await fetch(r,{method:"GET",signal:this._abortCtrl.signal,headers:{...t,Accept:"application/json","MCP-Protocol-Version":ud.LATEST_PROTOCOL_VERSION}});if(o.status!==200&&(o=await fetch(x.joinPath(x.parse(e),".well-known","openid-configuration").toString(!0),{method:"GET",signal:this._abortCtrl.signal,headers:{...t,Accept:"application/json","MCP-Protocol-Version":ud.LATEST_PROTOCOL_VERSION}}),o.status!==200))throw new Error(`Failed to fetch authorization server metadata: ${o.status} ${await this._getErrText(o)}`);const a=await o.json();if(tO(a))return a;throw new Error(`Invalid authorization server metadata: ${JSON.stringify(a)}`)}async _handleSuccessfulStreamableHttp(e,t){if(e.status!==202)switch(e.headers.get("Content-Type")?.toLowerCase()){case"text/event-stream":{const i=new pv(s=>{if(s.type==="message")this._proxy.$onDidReceiveMessage(this._id,s.data);else if(s.type==="endpoint")throw this._log(Be.Warning,`Received SSE endpoint from a POST to ${this._launch.uri}, will fall back to legacy SSE`),this._sseFallbackWithMessage(t),new Ai});try{await this._doSSE(i,e)}catch(s){this._log(Be.Warning,`Error reading SSE stream: ${String(s)}`)}break}case"application/json":this._proxy.$onDidReceiveMessage(this._id,await e.text());break;default:{const i=await e.text();eM(i)?this._proxy.$onDidReceiveMessage(this._id,i):this._log(Be.Warning,`Unexpected ${e.status} response for request: ${i}`)}}}async _attachStreamableBackchannel(){let e;for(let t=0;!this._store.isDisposed;t++){await us(Math.min(t*1e3,3e4),this._cts.token);let i;try{const r={...Object.fromEntries(this._launch.headers),Accept:"text/event-stream"};await this._addAuthHeader(r),this._mode.value===bi.Http&&this._mode.sessionId!==void 0&&(r["Mcp-Session-Id"]=this._mode.sessionId),e&&(r["Last-Event-ID"]=e),i=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"GET",signal:this._abortCtrl.signal,headers:r},r)}catch{this._log(Be.Info,`Error connecting to ${this._launch.uri} for async notifications, will retry`);continue}if(i.status>=400){this._log(Be.Debug,`${i.status} status connecting to ${this._launch.uri} for async notifications; they will be disabled: ${await this._getErrText(i)}`);return}t=0;const s=new pv(r=>{r.type==="message"&&this._proxy.$onDidReceiveMessage(this._id,r.data),r.id&&(e=r.id)});try{await this._doSSE(s,i)}catch(r){this._log(Be.Info,`Error reading from async stream, we will reconnect: ${r}`)}}}async _attachSSE(){const e=new Eo,t={...Object.fromEntries(this._launch.headers),Accept:"text/event-stream"};await this._addAuthHeader(t);let i;try{if(i=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:"GET",signal:this._abortCtrl.signal,headers:t},t),i.status>=300){this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`${i.status} status connecting to ${this._launch.uri} as SSE: ${await this._getErrText(i)}`});return}}catch(r){this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`Error connecting to ${this._launch.uri} as SSE: ${r}`});return}const s=new pv(r=>{r.type==="message"?this._proxy.$onDidReceiveMessage(this._id,r.data):r.type==="endpoint"&&e.complete(new URL(r.data,this._launch.uri.toString(!0)).toString())});return this._register(we(()=>e.cancel())),this._doSSE(s,i).catch(r=>{this._proxy.$onDidChangeState(this._id,{state:mr.Kind.Error,message:`Error reading SSE stream: ${String(r)}`})}),e.p}async _sendLegacySSE(e,t){const i=new TextEncoder().encode(t),s={...Object.fromEntries(this._launch.headers),"Content-Type":"application/json","Content-Length":String(i.length)};await this._addAuthHeader(s);const r=await fetch(e,{method:"POST",signal:this._abortCtrl.signal,headers:s,body:i});r.status>=300&&this._log(Be.Warning,`${r.status} status sending message to ${this._postEndpoint}: ${await this._getErrText(r)}`)}async _doSSE(e,t){if(!t.body)return;const i=t.body.getReader();let s;do{try{s=await Cx(i.read(),this._cts.token)}catch(r){if(i.cancel(),this._store.isDisposed)return;throw r}s.value&&e.feed(s.value)}while(!s.done)}async _addAuthHeader(e){if(this._authMetadata)try{const t=await this._proxy.$getTokenFromServerMetadata(this._id,this._authMetadata.authorizationServer,this._authMetadata.serverMetadata,this._authMetadata.resourceMetadata);t&&(e.Authorization=`Bearer ${t}`)}catch(t){this._log(Be.Warning,`Error getting token from server metadata: ${String(t)}`)}return e}_log(e,t){this._store.isDisposed||this._proxy.$onDidPublishLog(this._id,e,t)}async _getErrText(e){try{return await e.text()}catch{return e.statusText}}async _fetchWithAuthRetry(e,t,i){const s=()=>fetch(e,t);let r=await s();return r.status===401&&(this._authMetadata||(await this._populateAuthMetadata(r),await this._addAuthHeader(i),i.Authorization&&(t.headers=i,r=await s()))),r}}function eM(n){try{return JSON.parse(n),!0}catch{return!1}}gt(wE,Xy,ht.Delayed);gt(Po,Gm,ht.Delayed);gt(lf,t0,ht.Delayed);gt(ul,$y,ht.Eager);gt(S_,jy,ht.Eager);gt(_E,Jy,ht.Eager);gt(Ur,Cy,ht.Eager);gt(w_,Ay,ht.Eager);gt(D_,w0,ht.Eager);gt(ZP,x0,ht.Eager);gt(KP,s0,ht.Eager);gt(vu,a0,ht.Eager);gt(bE,Yy,ht.Eager);gt(hu,p8,ht.Eager);gt(GP,i0,ht.Delayed);gt(n5,k0,ht.Eager);gt(hE,TP,ht.Eager);gt(QP,m0,ht.Eager);gt(_u,By,ht.Eager);gt(i5,D0,ht.Eager);gt(pE,Fy,ht.Eager);gt(x_,Vy,ht.Eager);gt(E_,qy,ht.Eager);gt(Mr,ky,ht.Eager);gt(vE,BP,ht.Eager);gt(cf,_0,ht.Eager);gt(EE,b0,ht.Eager);gt(I0,C0,ht.Eager);function s5(n,e,t,i,s,r){if(Array.isArray(n)){let o=0;for(const a of n){const l=s5(a,e,t,i,s,r);if(l===10)return l;l>o&&(o=l)}return o}else{if(typeof n=="string")return n==="*"?5:n===t?10:0;if(n){const{language:o,pattern:a,scheme:l,hasAccessToAllModels:c,notebookType:u}=n;u&&s&&(e=s);let d=0;if(l)if(l===e.scheme)d=10;else if(l==="*")d=5;else return 0;if(o)if(o===t)d=10;else if(o==="*")d=Math.max(d,5);else return 0;if(u)if(u===r)d=10;else if(u==="*"&&r!==void 0)d=Math.max(d,5);else return 0;if(a){let f;if(typeof a=="string"?f=a:f={...a,base:Rc(a.base)},f===e.fsPath||sd(f,e.fsPath))d=10;else return 0}return d}else return 0}}function r5(n){return typeof n=="string"?!1:Array.isArray(n)?n.some(r5):!!n.notebookType}var T0;(function(n){n[n.None=0]="None",n[n.Indent=1]="Indent",n[n.IndentOutdent=2]="IndentOutdent",n[n.Outdent=3]="Outdent"})(T0||(T0={}));var P0;(function(n){n[n.Complete=100]="Complete",n[n.Partial=50]="Partial",n[n.None=0]="None"})(P0||(P0={}));class tM{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(ee.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,i){if(this._relatedInformationProviders.size===0)throw new Error("No related information providers registered");const s=this._relatedInformationProviders.get(e);if(!s)throw new Error("related information provider not found");return await s.provideRelatedInformation(t,i)??[]}getRelatedInformation(e,t,i){return this._proxy.$getAiRelatedInformation(t,i)}registerRelatedInformationProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(s,i),this._proxy.$registerAiRelatedInformationProvider(s,t),new je(()=>{this._proxy.$unregisterAiRelatedInformationProvider(s),this._relatedInformationProviders.delete(s)})}}var qh;(function(n){n[n.Full=1]="Full",n[n.Delta=2]="Delta"})(qh||(qh={}));function o5(n){for(let e=0,t=n.length;e<t;e+=4){const i=n[e+0],s=n[e+1],r=n[e+2],o=n[e+3];n[e+0]=o,n[e+1]=r,n[e+2]=s,n[e+3]=i}}function nM(n){const e=new Uint8Array(n.buffer,n.byteOffset,n.length*4);return aC()||o5(e),ue.wrap(e)}function iM(n){const e=n.buffer;if(aC()||o5(e),e.byteOffset%4===0)return new Uint32Array(e.buffer,e.byteOffset,e.length/4);{const t=new Uint8Array(e.byteLength);return t.set(e),new Uint32Array(t.buffer,t.byteOffset,t.length/4)}}function A0(n){const e=new Uint32Array(sM(n));let t=0;if(e[t++]=n.id,n.type==="full")e[t++]=qh.Full,e[t++]=n.data.length,e.set(n.data,t),t+=n.data.length;else{e[t++]=qh.Delta,e[t++]=n.deltas.length;for(const i of n.deltas)e[t++]=i.start,e[t++]=i.deleteCount,i.data?(e[t++]=i.data.length,e.set(i.data,t),t+=i.data.length):e[t++]=0}return nM(e)}function sM(n){let e=0;if(e+=2,n.type==="full")e+=1+n.data.length;else{e+=1,e+=3*n.deltas.length;for(const t of n.deltas)t.data&&(e+=t.data.length)}return e}function jI(n){const e=iM(n);let t=0;const i=e[t++];if(e[t++]===qh.Full){const a=e[t++],l=e.subarray(t,t+a);return t+=a,{id:i,type:"full",data:l}}const r=e[t++],o=[];for(let a=0;a<r;a++){const l=e[t++],c=e[t++],u=e[t++];let d;u>0&&(d=e.subarray(t,t+u),t+=u),o[a]={start:l,deleteCount:c,data:d}}return{id:i,type:"delta",deltas:o}}const rM=[new Te("vscode.executeDocumentHighlights","_executeDocumentHighlights","Execute document highlight provider.",[j.Uri,j.Position],new ke("A promise that resolves to an array of DocumentHighlight-instances.",Vi(Yc.to))),new Te("vscode.executeDocumentSymbolProvider","_executeDocumentSymbolProvider","Execute document symbol provider.",[j.Uri],new ke("A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.",(n,e)=>{if(_x(n))return;class t extends Jd{constructor(){super(...arguments),this.containerName=""}static to(s){const r=new t(s.name,Hi.to(s.kind),s.containerName||"",new Ni(e[0],z.to(s.range)));return r.detail=s.detail,r.range=r.location.range,r.selectionRange=z.to(s.selectionRange),r.children=s.children?s.children.map(t.to):[],r}}return n.map(t.to)})),new Te("vscode.executeFormatDocumentProvider","_executeFormatDocumentProvider","Execute document format provider.",[j.Uri,new j("options","Formatting options",n=>!0,n=>n)],new ke("A promise that resolves to an array of TextEdits.",Vi(pn.to))),new Te("vscode.executeFormatRangeProvider","_executeFormatRangeProvider","Execute range format provider.",[j.Uri,j.Range,new j("options","Formatting options",n=>!0,n=>n)],new ke("A promise that resolves to an array of TextEdits.",Vi(pn.to))),new Te("vscode.executeFormatOnTypeProvider","_executeFormatOnTypeProvider","Execute format on type provider.",[j.Uri,j.Position,new j("ch","Trigger character",n=>typeof n=="string",n=>n),new j("options","Formatting options",n=>!0,n=>n)],new ke("A promise that resolves to an array of TextEdits.",Vi(pn.to))),new Te("vscode.executeDefinitionProvider","_executeDefinitionProvider","Execute all definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeDefinitionProvider_recursive","_executeDefinitionProvider_recursive","Execute all definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeTypeDefinitionProvider","_executeTypeDefinitionProvider","Execute all type definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeTypeDefinitionProvider_recursive","_executeTypeDefinitionProvider_recursive","Execute all type definition providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeDeclarationProvider","_executeDeclarationProvider","Execute all declaration providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeDeclarationProvider_recursive","_executeDeclarationProvider_recursive","Execute all declaration providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeImplementationProvider","_executeImplementationProvider","Execute all implementation providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.experimental.executeImplementationProvider_recursive","_executeImplementationProvider_recursive","Execute all implementation providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location or LocationLink instances.",jr)),new Te("vscode.executeReferenceProvider","_executeReferenceProvider","Execute all reference providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location-instances.",Vi(oi.to))),new Te("vscode.experimental.executeReferenceProvider","_executeReferenceProvider_recursive","Execute all reference providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Location-instances.",Vi(oi.to))),new Te("vscode.executeHoverProvider","_executeHoverProvider","Execute all hover providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Hover-instances.",Vi(Th.to))),new Te("vscode.experimental.executeHoverProvider_recursive","_executeHoverProvider_recursive","Execute all hover providers.",[j.Uri,j.Position],new ke("A promise that resolves to an array of Hover-instances.",Vi(Th.to))),new Te("vscode.executeSelectionRangeProvider","_executeSelectionRangeProvider","Execute selection range provider.",[j.Uri,new j("position","A position in a text document",n=>Array.isArray(n)&&n.every(e=>qe.isPosition(e)),n=>n.map(ot.from))],new ke("A promise that resolves to an array of ranges.",n=>n.map(e=>{let t;for(const i of e.reverse())t=new eh(z.to(i),t);return t}))),new Te("vscode.executeWorkspaceSymbolProvider","_executeWorkspaceSymbolProvider","Execute all workspace symbol providers.",[j.String.with("query","Search string")],new ke("A promise that resolves to an array of SymbolInformation-instances.",n=>n.map(Ya.to))),new Te("vscode.prepareCallHierarchy","_executePrepareCallHierarchy","Prepare call hierarchy at a position inside a document",[j.Uri,j.Position],new ke("A promise that resolves to an array of CallHierarchyItem-instances",n=>n.map(Za.to))),new Te("vscode.provideIncomingCalls","_executeProvideIncomingCalls","Compute incoming calls for an item",[j.CallHierarchyItem],new ke("A promise that resolves to an array of CallHierarchyIncomingCall-instances",n=>n.map(zb.to))),new Te("vscode.provideOutgoingCalls","_executeProvideOutgoingCalls","Compute outgoing calls for an item",[j.CallHierarchyItem],new ke("A promise that resolves to an array of CallHierarchyOutgoingCall-instances",n=>n.map(qb.to))),new Te("vscode.prepareRename","_executePrepareRename","Execute the prepareRename of rename provider.",[j.Uri,j.Position],new ke("A promise that resolves to a range and placeholder text.",n=>{if(n)return{range:z.to(n.range),placeholder:n.text}})),new Te("vscode.executeDocumentRenameProvider","_executeDocumentRenameProvider","Execute rename provider.",[j.Uri,j.Position,j.String.with("newName","The new symbol name")],new ke("A promise that resolves to a WorkspaceEdit.",n=>{if(n){if(n.rejectReason)throw new Error(n.rejectReason);return _i.to(n)}})),new Te("vscode.executeLinkProvider","_executeLinkProvider","Execute document link provider.",[j.Uri,j.Number.with("linkResolveCount","Number of links that should be resolved, only when links are unresolved.").optional()],new ke("A promise that resolves to an array of DocumentLink-instances.",n=>n.map(Da.to))),new Te("vscode.provideDocumentSemanticTokensLegend","_provideDocumentSemanticTokensLegend","Provide semantic tokens legend for a document",[j.Uri],new ke("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new cb(n.tokenTypes,n.tokenModifiers)})),new Te("vscode.provideDocumentSemanticTokens","_provideDocumentSemanticTokens","Provide semantic tokens for a document",[j.Uri],new ke("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=jI(n);if(e.type==="full")return new Gc(e.data,void 0)})),new Te("vscode.provideDocumentRangeSemanticTokensLegend","_provideDocumentRangeSemanticTokensLegend","Provide semantic tokens legend for a document range",[j.Uri,j.Range.optional()],new ke("A promise that resolves to SemanticTokensLegend.",n=>{if(n)return new cb(n.tokenTypes,n.tokenModifiers)})),new Te("vscode.provideDocumentRangeSemanticTokens","_provideDocumentRangeSemanticTokens","Provide semantic tokens for a document range",[j.Uri,j.Range],new ke("A promise that resolves to SemanticTokens.",n=>{if(!n)return;const e=jI(n);if(e.type==="full")return new Gc(e.data,void 0)})),new Te("vscode.executeCompletionItemProvider","_executeCompletionItemProvider","Execute completion item provider.",[j.Uri,j.Position,j.String.with("triggerCharacter","Trigger completion when the user types the character, like `,` or `(`").optional(),j.Number.with("itemResolveCount","Number of completions to resolve (too large numbers slow down completions)").optional()],new ke("A promise that resolves to a CompletionList-instance.",(n,e,t)=>{if(!n)return new Hc([]);const i=n.suggestions.map(s=>Jb.to(s,t));return new Hc(i,n.incomplete)})),new Te("vscode.executeSignatureHelpProvider","_executeSignatureHelpProvider","Execute signature help provider.",[j.Uri,j.Position,j.String.with("triggerCharacter","Trigger signature help when the user types the character, like `,` or `(`").optional()],new ke("A promise that resolves to SignatureHelp.",n=>{if(n)return Ph.to(n)})),new Te("vscode.executeCodeLensProvider","_executeCodeLensProvider","Execute code lens provider.",[j.Uri,j.Number.with("itemResolveCount","Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)").optional()],new ke("A promise that resolves to an array of CodeLens-instances.",(n,e,t)=>Vi(i=>new Pg(z.to(i.range),i.command&&t.fromInternal(i.command)))(n))),new Te("vscode.executeCodeActionProvider","_executeCodeActionProvider","Execute code action provider.",[j.Uri,new j("rangeOrSelection","Range in a text document. Some refactoring provider requires Selection object.",n=>Me.isRange(n),n=>Nr.isSelection(n)?hs.from(n):z.from(n)),j.String.with("kind","Code action kind to return code actions for").optional(),j.Number.with("itemResolveCount","Number of code actions to resolve (too large numbers slow down code actions)").optional()],new ke("A promise that resolves to an array of Command-instances.",(n,e,t)=>Vi(i=>{if(i._isSynthetic){if(!i.command)throw new Error("Synthetic code actions must have a command");return t.fromInternal(i.command)}else{const s=new Zd(i.title,i.kind?new At(i.kind):void 0);return i.edit&&(s.edit=_i.to(i.edit)),i.command&&(s.command=t.fromInternal(i.command)),s.isPreferred=i.isPreferred,s}})(n))),new Te("vscode.executeDocumentColorProvider","_executeDocumentColorProvider","Execute document color provider.",[j.Uri],new ke("A promise that resolves to an array of ColorInformation objects.",n=>n?n.map(e=>new Fg(z.to(e.range),Zc.to(e.color))):[])),new Te("vscode.executeColorPresentationProvider","_executeColorPresentationProvider","Execute color presentation provider.",[new j("color","The color to show and insert",n=>n instanceof Vc,Zc.from),new j("context","Context object with uri and range",n=>!0,n=>({uri:n.uri,range:z.from(n.range)}))],new ke("A promise that resolves to an array of ColorPresentation objects.",n=>n?n.map(wm.to):[])),new Te("vscode.executeInlayHintProvider","_executeInlayHintProvider","Execute inlay hints provider",[j.Uri,j.Range],new ke("A promise that resolves to an array of Inlay objects",(n,e,t)=>n.map(Xb.to.bind(void 0,t)))),new Te("vscode.executeFoldingRangeProvider","_executeFoldingRangeProvider","Execute folding range provider",[j.Uri],new ke("A promise that resolves to an array of FoldingRange objects",(n,e)=>{if(n)return n.map(xm.to)})),new Te("vscode.resolveNotebookContentProviders","_resolveNotebookContentProvider","Resolve Notebook Content Providers",[],new ke("A promise that resolves to an array of NotebookContentProvider static info objects.",Vi(n=>({viewType:n.viewType,displayName:n.displayName,options:{transientOutputs:n.options.transientOutputs,transientCellMetadata:n.options.transientCellMetadata,transientDocumentMetadata:n.options.transientDocumentMetadata},filenamePattern:n.filenamePattern.map(e=>Sm.to(e))})))),new Te("vscode.executeInlineValueProvider","_executeInlineValueProvider","Execute inline value provider",[j.Uri,j.Range,new j("context","An InlineValueContext",n=>n&&typeof n.frameId=="number"&&n.stoppedLocation instanceof Me,n=>fm.from(n))],new ke("A promise that resolves to an array of InlineValue objects",n=>n.map(hm.to))),new Te("vscode.open","_workbench.open","Opens the provided resource in the editor. Can be a text or binary file, or an http(s) URL. If you need more control over the options for opening a text file, use vscode.window.showTextDocument instead.",[new j("uriOrString","Uri-instance or string (only http/https)",n=>x.isUri(n)||typeof n=="string"&&_R(n,le.http,le.https),n=>n),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[hn.from(n),void 0]:[hn.from(n.viewColumn),dd.from(n)])).optional(),j.String.with("label","").optional()],ke.Void),new Te("vscode.openWith","_workbench.openWith","Opens the provided resource with a specific editor.",[j.Uri.with("resource","Resource to open"),j.String.with("viewId","Custom editor view id. This should be the viewType string for custom editors or the notebookType string for notebooks. Use 'default' to use VS Code's default text editor"),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="number"||typeof n=="object",n=>n&&(typeof n=="number"?[hn.from(n),void 0]:[hn.from(n.viewColumn),dd.from(n)])).optional()],ke.Void),new Te("vscode.diff","_workbench.diff","Opens the provided resources in the diff editor to compare their contents.",[j.Uri.with("left","Left-hand side resource of the diff editor"),j.Uri.with("right","Right-hand side resource of the diff editor"),j.String.with("title","Human readable title for the diff editor").optional(),new j("columnOrOptions","Either the column in which to open or editor options, see vscode.TextDocumentShowOptions",n=>n===void 0||typeof n=="object",n=>n&&[hn.from(n.viewColumn),dd.from(n)]).optional()],ke.Void),new Te("vscode.changes","_workbench.changes","Opens a list of resources in the changes editor to compare their contents.",[j.String.with("title","Human readable title for the changes editor"),new j("resourceList","List of resources to compare",n=>{for(const e of n){if(e.length!==3)return!1;const[t,i,s]=e;if(!x.isUri(t)||!x.isUri(i)&&i!==void 0&&i!==null||!x.isUri(s)&&s!==void 0&&s!==null)return!1}return!0},n=>n)],ke.Void),new Te("vscode.prepareTypeHierarchy","_executePrepareTypeHierarchy","Prepare type hierarchy at a position inside a document",[j.Uri,j.Position],new ke("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map(Ia.to))),new Te("vscode.provideSupertypes","_executeProvideSupertypes","Compute supertypes for an item",[j.TypeHierarchyItem],new ke("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map(Ia.to))),new Te("vscode.provideSubtypes","_executeProvideSubtypes","Compute subtypes for an item",[j.TypeHierarchyItem],new ke("A promise that resolves to an array of TypeHierarchyItem-instances",n=>n.map(Ia.to))),new Te("vscode.revealTestInExplorer","_revealTestInExplorer","Reveals a test instance in the explorer",[j.TestItem],ke.Void),new Te("vscode.startContinuousTestRun","testing.startContinuousRunFromExtension","Starts running the given tests with continuous run mode.",[j.TestProfile,j.Arr(j.TestItem)],ke.Void),new Te("vscode.stopContinuousTestRun","testing.stopContinuousRunFromExtension","Stops running the given tests with continuous run mode.",[j.Arr(j.TestItem)],ke.Void),new Te("vscode.experimental.editSession.continue","_workbench.editSessions.actions.continueEditSession","Continue the current edit session in a different workspace",[j.Uri.with("workspaceUri","The target workspace to continue the current edit session in")],ke.Void),new Te("setContext","_setContext","Set a custom context key value that can be used in when clauses.",[j.String.with("name","The context key name"),new j("value","The context key value",()=>!0,n=>n)],ke.Void),new Te("vscode.editorChat.start","inlineChat.start","Invoke a new editor chat session",[new j("Run arguments","",n=>!0,n=>{if(n)return{initialRange:n.initialRange?z.from(n.initialRange):void 0,initialSelection:Nr.isSelection(n.initialSelection)?hs.from(n.initialSelection):void 0,message:n.message,attachments:n.attachments,autoSend:n.autoSend,position:n.position?ot.from(n.position):void 0}})],ke.Void)];class oM{static register(e){rM.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,"_validateWhenClauses",C7)}}function Vi(n){return e=>{if(Array.isArray(e))return e.map(n)}}function jr(n){if(!Array.isArray(n))return;const e=[];for(const t of n)DL(t)?e.push(Ch.to(t)):e.push(oi.to(t));return e}let R0=class{constructor(e,t){this._proxy=e.getProxy(ee.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:i=>t.getDocument(i)?.version,getNotebookDocumentVersion:()=>{}}}applyWorkspaceEdit(e,t,i){const s=new jn(_i.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(s,void 0,i?.isRefactoring??!1)}};R0=V([L(0,nt)],R0);function aM(n){return!!n&&typeof n.sessionId=="string"&&n.$mid===st.ChatViewContext}class lM{constructor(e,t,i,s,r){this._extension=e,this._request=t,this._proxy=i,this._commandsConverter=s,this._sessionDisposables=r,this._stopWatch=Rr.create(!1),this._isClosed=!1}close(){this._isClosed=!0}get timings(){return{firstProgress:this._firstProgress,totalElapsed:this._stopWatch.elapsed()}}get apiObject(){if(!this._apiObject){let i=function(l){if(e._isClosed){const c=new Error("Response stream has been closed");throw Error.captureStackTrace(c,l),c}},o=function(l,c){if(s.push(c!==void 0?[l,c]:l)===1&&queueMicrotask(()=>{e._proxy.$handleProgressChunk(e._request.requestId,s).finally(()=>{r.forEach(d=>d()),r.length=0}),s.length=0}),c!==void 0)return new Promise(d=>{r.push(d)})};const e=this;this._stopWatch.reset();let t=0;const s=[],r=[],a=(l,c)=>{if(typeof this._firstProgress>"u"&&(l.kind==="markdownContent"||l.kind==="markdownVuln"||l.kind==="prepareToolInvocation")&&(this._firstProgress=this._stopWatch.elapsed()),c){const u=t++,d=o(l,u),f={report:p=>{d.then(()=>{mi.isMarkdownString(p.value)?o(Fh.from(p),u):o(Ta.from(p),u)})}};Promise.all([d,c(f)]).then(([p,_])=>{o(cy.from(_),u)})}else o(l)};this._apiObject=Object.freeze({markdown(l){i(this.markdown);const c=new u_(l),u=Lh.from(c);return a(u),this},markdownWithVulnerabilities(l,c){i(this.markdown),c&&$(e._extension,"chatParticipantAdditions");const u=new bh(l,c),d=Tm.from(u);return a(d),this},codeblockUri(l,c){i(this.codeblockUri),$(e._extension,"chatParticipantAdditions");const u=new f_(l,c),d=Cm.from(u);return a(d),this},filetree(l,c){i(this.filetree);const u=new d_(l,c),d=Nh.from(u);return a(d),this},anchor(l,c){const u=new yh(l,c);return this.push(u)},button(l){i(this.anchor);const c=new h_(l),u=Uh.from(c,e._commandsConverter,e._sessionDisposables);return a(u),this},progress(l,c){i(this.progress);const u=new ap(l,c),d=c?Am.from(u):Oh.from(u);return a(d,c),this},warning(l){i(this.progress),$(e._extension,"chatParticipantAdditions");const c=new xh(l),u=Fh.from(c);return a(u),this},reference(l,c){return this.reference2(l,c)},reference2(l,c,u){if(i(this.reference),typeof l=="object"&&"variableName"in l&&$(e._extension,"chatParticipantAdditions"),typeof l=="object"&&"variableName"in l&&!l.value){const d=e._request.variables.variables.find(f=>f.name===l.variableName);if(d){let f;if(d.references?.length)f=d.references.map(p=>({kind:"reference",reference:{variableName:l.variableName,value:p.reference}}));else{const p=new ka(l,c,u);f=[Ta.from(p)]}return f.forEach(p=>a(p)),this}}else{const d=new ka(l,c,u),f=Ta.from(d);a(f)}return this},codeCitation(l,c,u){i(this.codeCitation),$(e._extension,"chatParticipantAdditions");const d=new om(l,c,u),f=Om.from(d);a(f)},textEdit(l,c){i(this.textEdit),$(e._extension,"chatParticipantAdditions");const u=new Eh(l,c);u.isDone=c===!0?!0:void 0;const d=Rm.from(u);return a(d),this},notebookEdit(l,c){i(this.notebookEdit),$(e._extension,"chatParticipantAdditions");const u=new am(l,c),d=Nm.from(u);return a(d),this},confirmation(l,c,u,d){i(this.confirmation),$(e._extension,"chatParticipantAdditions");const f=new rm(l,c,u,d),p=Pm.from(f);return a(p),this},prepareToolInvocation(l){i(this.prepareToolInvocation),$(e._extension,"chatParticipantAdditions");const c=new Sh(l),u=Mh.from(c);return a(u),this},push(l){if(i(this.push),(l instanceof Eh||l instanceof am||l instanceof bh||l instanceof xh||l instanceof rm||l instanceof om||l instanceof p_||l instanceof aE||l instanceof ap)&&$(e._extension,"chatParticipantAdditions"),l instanceof ka)this.reference2(l.value,l.iconPath,l.options);else if(l instanceof ap){const c=l.task?Am.from(l):Oh.from(l);a(c,l.task)}else if(l instanceof yh){const c=lu.from(l);if(l.resolve){$(e._extension,"chatParticipantAdditions"),c.resolveId=Sn();const u=new Nt;l.resolve(u.token).then(()=>{const d=lu.from(l);e._proxy.$handleAnchorResolve(e._request.requestId,c.resolveId,d)}).then(()=>u.dispose(),()=>u.dispose()),e._sessionDisposables.add(we(()=>u.dispose(!0)))}a(c)}else if(l instanceof Sh){$(e._extension,"chatParticipantAdditions");const c=Mh.from(l);return a(c),this}else{const c=Fm.from(l,e._commandsConverter,e._sessionDisposables);a(c)}return this}})}return this._apiObject}}const pr=class pr extends Se{constructor(e,t,i,s,r,o,a){super(),this._logService=t,this._commands=i,this._documents=s,this._languageModels=r,this._diagnostics=o,this._tools=a,this._agents=new Map,this._participantDetectionProviders=new Map,this._relatedFilesProviders=new Map,this._sessionDisposables=this._register(new xp),this._completionDisposables=this._register(new xp),this._inFlightRequests=new Set,this._onDidDisposeChatSession=this._register(new N),this.onDidDisposeChatSession=this._onDidDisposeChatSession.event,this._proxy=e.getProxy(ee.MainThreadChatAgents2),i.registerArgumentProcessor({processArgument:l=>aM(l)?null:l})}transferActiveChat(e){this._proxy.$transferActiveChatSession(e)}createChatAgent(e,t,i){const s=pr._idPool++,r=new GI(e,t,this._proxy,s,i);return this._agents.set(s,r),this._proxy.$registerAgent(s,e.identifier,t,{},void 0),r.apiAgent}createDynamicChatAgent(e,t,i,s){const r=pr._idPool++,o=new GI(e,t,this._proxy,r,s);return this._agents.set(r,o),this._proxy.$registerAgent(r,e.identifier,t,{isSticky:!0},i),o.apiAgent}registerChatParticipantDetectionProvider(e,t){const i=pr._participantDetectionProviderIdPool++;return this._participantDetectionProviders.set(i,new cM(e,t)),this._proxy.$registerChatParticipantDetectionProvider(i),we(()=>{this._participantDetectionProviders.delete(i),this._proxy.$unregisterChatParticipantDetectionProvider(i)})}registerRelatedFilesProvider(e,t,i){const s=pr._relatedFilesProviderIdPool++;return this._relatedFilesProviders.set(s,new uM(e,t)),this._proxy.$registerRelatedFilesProvider(s,i),we(()=>{this._relatedFilesProviders.delete(s),this._proxy.$unregisterRelatedFilesProvider(s)})}async $provideRelatedFiles(e,t,i){const s=this._relatedFilesProviders.get(e);if(!s)return Promise.resolve([]);const r=uy.to(t);return await s.provider.provideRelatedFiles(r,i)??void 0}async $detectChatParticipant(e,t,i,s,r){const o=this._participantDetectionProviders.get(e);if(!o)return;const{request:a,location:l,history:c}=await this._createRequest(t,i,o.extension),u=await this.getModelForRequest(a,o.extension),d=Mm.to(a,l,u,this.getDiagnosticsWhenEnabled(o.extension),this.getToolsForRequest(o.extension,a),o.extension,this._logService);return o.provider.provideParticipantDetection(d,{history:c},{participants:s.participants,location:Um.to(s.location)},r)}async _createRequest(e,t,i){const s=an(e),r=await this.prepareHistoryTurns(i,s.agentId,t);let o;if(s.locationData?.type===zn.Editor){const a=this._documents.getDocument(s.locationData.document);o=new lP(a,hs.to(s.locationData.selection),z.to(s.locationData.wholeRange))}else if(s.locationData?.type===zn.Notebook){const a=this._documents.getDocument(s.locationData.sessionInputUri);o=new cP(a)}return{request:s,location:o,history:r}}async getModelForRequest(e,t){let i;if(e.userSelectedModelId&&(i=await this._languageModels.getLanguageModelByIdentifier(t,e.userSelectedModelId)),!i&&(i=await this._languageModels.getDefaultLanguageModel(t),!i))throw new Error("Language model unavailable");return i}async $setRequestPaused(e,t,i){const s=this._agents.get(e);if(!s)return;const r=fn.find(this._inFlightRequests,o=>o.requestId===t);r&&s.setChatRequestPauseState({request:r.extRequest,isPaused:i})}async $invokeAgent(e,t,i,s){const r=this._agents.get(e);if(!r)throw new Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);let o,a;try{const{request:l,location:c,history:u}=await this._createRequest(t,i,r.extension);let d=this._sessionDisposables.get(l.sessionId);d||(d=new xe,this._sessionDisposables.set(l.sessionId,d)),o=new lM(r.extension,l,this._proxy,this._commands.converter,d);const f=await this.getModelForRequest(l,r.extension),p=Mm.to(l,c,f,this.getDiagnosticsWhenEnabled(r.extension),this.getToolsForRequest(r.extension,l),r.extension,this._logService);a={requestId:t.requestId,extRequest:p},this._inFlightRequests.add(a);const _=r.invoke(p,{history:u},o.apiObject,s);return await dM(1e3,Promise.resolve(_).then(w=>{if(w?.metadata)try{JSON.stringify(w.metadata)}catch(E){const S=`result.metadata MUST be JSON.stringify-able. Got error: ${E.message}`;return this._logService.error(`[${r.extension.identifier.value}] [@${r.id}] ${S}`,r.extension),{errorDetails:{message:S},timings:o?.timings,nextQuestion:w.nextQuestion}}let v;return w?.errorDetails&&(v={...w.errorDetails,responseIsIncomplete:!0}),(v?.responseIsRedacted||v?.isQuotaExceeded||v?.confirmationButtons)&&$(r.extension,"chatParticipantPrivate"),{errorDetails:v,timings:o?.timings,metadata:w?.metadata,nextQuestion:w?.nextQuestion}}),s)}catch(l){this._logService.error(l,r.extension),l instanceof yn&&l.cause&&(l=l.cause);const c=l instanceof Error&&l.name==="ChatQuotaExceeded";return{errorDetails:{message:gu(l),responseIsIncomplete:!0,isQuotaExceeded:c}}}finally{a&&this._inFlightRequests.delete(a),o?.close()}}getDiagnosticsWhenEnabled(e){return dt(e,"chatReferenceDiagnostic")?this._diagnostics.getDiagnostics():[]}getToolsForRequest(e,t){if(!t.userSelectedTools)return new Map;const i=new Map;for(const s of this._tools.getTools(e))typeof t.userSelectedTools[s.name]=="boolean"&&i.set(s.name,t.userSelectedTools[s.name]);return i}async prepareHistoryTurns(e,t,i){const s=[];for(const r of i.history){const o=mc.to(r.result),a=t===r.request.agentId?o:{...o,metadata:void 0},l=[],c=[];for(const p of r.request.variables.variables)if(p.kind==="tool")c.push($h.to(p));else if(p.kind==="toolset")c.push(...p.value.map($h.to));else{const _=$m.to(p,this.getDiagnosticsWhenEnabled(e),this._logService);_&&l.push(_)}const u=dt(e,"chatParticipantPrivate")?r.request.editedFileEvents:void 0,d=new Ib(r.request.message,r.request.command,l,r.request.agentId,c,u);s.push(d);const f=rn(r.response.map(p=>Fm.toContent(p,this._commands.converter)));s.push(new aP(f,a,r.request.agentId,r.request.command))}return s}$releaseSession(e){this._sessionDisposables.deleteAndDispose(e),this._onDidDisposeChatSession.fire(e)}async $provideFollowups(e,t,i,s,r){const o=this._agents.get(t);if(!o)return Promise.resolve([]);const a=an(e),l=await this.prepareHistoryTurns(o.extension,o.id,s),c=mc.to(i);return(await o.provideFollowups(c,{history:l},r)).filter(u=>{const d=!u.participant||fn.some(this._agents.values(),f=>f.id===u.participant&&tt.equals(f.extension.identifier,o.extension.identifier));return d||this._logService.warn(`[@${o.id}] ChatFollowup refers to an unknown participant: ${u.participant}`),d}).map(u=>Im.from(u,a))}$acceptFeedback(e,t,i){const s=this._agents.get(e);if(!s)return;const r=mc.to(t);let o;switch(i.direction){case lg.Down:o=wh.Unhelpful;break;case lg.Up:o=wh.Helpful;break}const a={result:r,kind:o,unhelpfulReason:dt(s.extension,"chatParticipantAdditions")?i.reason:void 0};s.acceptFeedback(Object.freeze(a))}$acceptAction(e,t,i){const s=this._agents.get(e);if(!s||i.action.kind==="vote")return;const r=hy.to(t,i,this._commands.converter);r&&s.acceptAction(Object.freeze(r))}async $invokeCompletionProvider(e,t,i){const s=this._agents.get(e);if(!s)return[];let r=this._completionDisposables.get(e);return r?r.clear():(r=new xe,this._completionDisposables.set(e,r)),(await s.invokeCompletionProvider(t,i)).map(a=>dy.from(a,this._commands.converter,r))}async $provideChatTitle(e,t,i){const s=this._agents.get(e);if(!s)return;const r=await this.prepareHistoryTurns(s.extension,s.id,{history:t});return await s.provideTitle({history:r},i)}};pr._idPool=0,pr._participantDetectionProviderIdPool=0,pr._relatedFilesProviderIdPool=0;let L0=pr;class cM{constructor(e,t){this.extension=e,this.provider=t}}class uM{constructor(e,t){this.extension=e,this.provider=t}}class GI{constructor(e,t,i,s,r){this.extension=e,this.id=t,this._proxy=i,this._handle=s,this._requestHandler=r,this._onDidReceiveFeedback=new N,this._onDidPerformAction=new N,this._pauseStateEmitter=new N}acceptFeedback(e){this._onDidReceiveFeedback.fire(e)}acceptAction(e){this._onDidPerformAction.fire(e)}setChatRequestPauseState(e){this._pauseStateEmitter.fire(e)}async invokeCompletionProvider(e,t){return this._agentVariableProvider?await this._agentVariableProvider.provider.provideCompletionItems(e,t)??[]:[]}async provideFollowups(e,t,i){if(!this._followupProvider)return[];const s=await this._followupProvider.provideFollowups(e,t,i);return s?s.filter(r=>!(r&&"commandId"in r)).filter(r=>!(r&&"message"in r)):[]}async provideTitle(e,t){if(this._titleProvider)return await this._titleProvider.provideChatTitle(e,t)??void 0}get apiAgent(){let e=!1,t=!1;const i=()=>{e||t||(t=!0,queueMicrotask(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof x?this._iconPath:"light"in this._iconPath?this._iconPath.light:void 0:void 0,iconDark:this._iconPath&&"dark"in this._iconPath?this._iconPath.dark:void 0,themeIcon:this._iconPath instanceof Kn?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix=="string"?this._helpTextPrefix:Re.from(this._helpTextPrefix),helpTextVariablesPrefix:!this._helpTextVariablesPrefix||typeof this._helpTextVariablesPrefix=="string"?this._helpTextVariablesPrefix:Re.from(this._helpTextVariablesPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix=="string"?this._helpTextPostfix:Re.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,requester:this._requester,additionalWelcomeMessage:!this._additionalWelcomeMessage||typeof this._additionalWelcomeMessage=="string"?this._additionalWelcomeMessage:Re.from(this._additionalWelcomeMessage)}),t=!1}))},s=this;return{get id(){return s.id},get iconPath(){return s._iconPath},set iconPath(r){s._iconPath=r,i()},get requestHandler(){return s._requestHandler},set requestHandler(r){q4(typeof r=="function","Invalid request handler"),s._requestHandler=r},get followupProvider(){return s._followupProvider},set followupProvider(r){s._followupProvider=r,i()},get helpTextPrefix(){return $(s.extension,"defaultChatParticipant"),s._helpTextPrefix},set helpTextPrefix(r){$(s.extension,"defaultChatParticipant"),s._helpTextPrefix=r,i()},get helpTextVariablesPrefix(){return $(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix},set helpTextVariablesPrefix(r){$(s.extension,"defaultChatParticipant"),s._helpTextVariablesPrefix=r,i()},get helpTextPostfix(){return $(s.extension,"defaultChatParticipant"),s._helpTextPostfix},set helpTextPostfix(r){$(s.extension,"defaultChatParticipant"),s._helpTextPostfix=r,i()},get supportIssueReporting(){return $(s.extension,"chatParticipantPrivate"),s._supportIssueReporting},set supportIssueReporting(r){$(s.extension,"chatParticipantPrivate"),s._supportIssueReporting=r,i()},get onDidReceiveFeedback(){return s._onDidReceiveFeedback.event},set participantVariableProvider(r){if($(s.extension,"chatParticipantAdditions"),s._agentVariableProvider=r,r){if(!r.triggerCharacters.length)throw new Error("triggerCharacters are required");s._proxy.$registerAgentCompletionsProvider(s._handle,s.id,r.triggerCharacters)}else s._proxy.$unregisterAgentCompletionsProvider(s._handle,s.id)},get participantVariableProvider(){return $(s.extension,"chatParticipantAdditions"),s._agentVariableProvider},set additionalWelcomeMessage(r){$(s.extension,"defaultChatParticipant"),s._additionalWelcomeMessage=r,i()},get additionalWelcomeMessage(){return $(s.extension,"defaultChatParticipant"),s._additionalWelcomeMessage},set titleProvider(r){$(s.extension,"defaultChatParticipant"),s._titleProvider=r,i()},get titleProvider(){return $(s.extension,"defaultChatParticipant"),s._titleProvider},get onDidChangePauseState(){return $(s.extension,"chatParticipantAdditions"),s._pauseStateEmitter.event},onDidPerformAction:dt(this.extension,"chatParticipantAdditions")?this._onDidPerformAction.event:void 0,set requester(r){s._requester=r,i()},get requester(){return s._requester},dispose(){e=!0,s._followupProvider=void 0,s._onDidReceiveFeedback.dispose(),s._proxy.$unregisterAgent(s._handle)}}}invoke(e,t,i,s){return this._requestHandler(e,t,i,s)}}function dM(n,e,t){return new Promise((i,s)=>{const r=t.onCancellationRequested(async()=>{r.dispose(),await us(n),i(void 0)});e.then(i,s).finally(()=>r.dispose())})}class hM{constructor(e){this._items=new Map,this._proxy=e.getProxy(ee.MainThreadChatStatus)}createChatStatusItem(e,t){const i=fM(e.identifier,t);if(this._items.has(i))throw new Error(`Chat status item '${t}' already exists`);const s={id:i,title:"",description:"",detail:""};let r=!1,o=!1;const a=()=>{if(r)throw new Error("Chat status item is disposed");o&&this._proxy.$setEntry(t,s)},l=Object.freeze({id:t,get title(){return s.title},set title(c){s.title=c,a()},get description(){return s.description},set description(c){s.description=c,a()},get detail(){return s.detail},set detail(c){s.detail=c,a()},show:()=>{o=!0,a()},hide:()=>{o=!1,this._proxy.$disposeEntry(t)},dispose:()=>{r=!0,this._proxy.$disposeEntry(t),this._items.delete(i)}});return this._items.set(i,l),l}}function fM(n,e){return`${tt.toKey(n)}.${e}`}class pM{constructor(e){const t=e.getProxy(ee.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(i){return t.$writeText(i)}})}}const a5="vscode-cdn.net",gM=`vscode-resource.${a5}`,N0=`'self' https://*.${a5}`;function _d(n,e){return n.scheme===le.http||n.scheme===le.https?n:(e&&e.authority&&e.isRemote&&n.scheme===le.file&&(n=x.from({scheme:le.vscodeRemote,authority:e.authority,path:n.path})),x.from({scheme:le.https,authority:`${n.scheme}+${mM(n.authority)}.${gM}`,path:n.path,fragment:n.fragment,query:n.query}))}function mM(n){return n.replace(/./g,e=>{const t=e.charCodeAt(0);return t>=R.a&&t<=R.z||t>=R.A&&t<=R.Z||t>=R.Digit0&&t<=R.Digit9?e:"-"+t.toString(16).padStart(4,"0")})}class _M{constructor(e,t,i){this._proxy=e,this._editors=t,this._remoteInfo=i,this._handlePool=0,this._disposables=new xe,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{const s=t.getVisibleTextEditors();for(const r of this._insets.values())s.indexOf(r.editor)<0&&r.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,i,s,r){let o;for(const p of this._editors.getVisibleTextEditors(!0))if(p.value===e){o=p;break}if(!o)throw new Error("not a visible editor");const a=this,l=this._handlePool++,c=new N,u=new N,d=new class{constructor(){this._html="",this._options=Object.create(null)}asWebviewUri(p){return _d(p,a._remoteInfo)}get cspSource(){return N0}set options(p){this._options=p,a._proxy.$setOptions(l,p)}get options(){return this._options}set html(p){this._html=p,a._proxy.$setHtml(l,p)}get html(){return this._html}get onDidReceiveMessage(){return c.event}postMessage(p){return a._proxy.$postMessage(l,p)}},f=new class{constructor(){this.editor=e,this.line=t,this.height=i,this.webview=d,this.onDidDispose=u.event}dispose(){a._insets.has(l)&&(a._insets.delete(l),a._proxy.$disposeEditorInset(l),u.fire(),u.dispose(),c.dispose())}};return this._proxy.$createEditorInset(l,o.id,o.value.document.uri,t+1,i,s||{},r.identifier,r.extensionLocation),this._insets.set(l,{editor:e,inset:f,onDidReceiveMessage:c}),f}$onDidDispose(e){const t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}}const A1=class A1{constructor(e){this.providers=new Map,this._proxy=e.getProxy(ee.MainThreadCodeMapper)}async $mapCode(e,t,i){const s=this.providers.get(e);if(!s)throw new Error(`Received request to map code for unknown provider handle ${e}`);const r={textEdit:(l,c)=>{c=Ri(c),this._proxy.$handleProgress(t.requestId,{uri:l,edits:c.map(pn.from)})},notebookEdit:(l,c)=>{c=Ri(c),this._proxy.$handleProgress(t.requestId,{uri:l,edits:c.map(Lm.from)})}},o={location:t.location,chatRequestId:t.chatRequestId,chatRequestModel:t.chatRequestModel,chatSessionId:t.chatSessionId,codeBlocks:t.codeBlocks.map(l=>({code:l.code,resource:x.revive(l.resource),markdownBeforeBlock:l.markdownBeforeBlock}))};return await s.provideMappedEdits(o,r,i)??null}registerMappedEditsProvider(e,t){const i=A1._providerHandlePool++;return this._proxy.$registerCodeMapperProvider(i,e.displayName??e.name),this.providers.set(i,t),{dispose:()=>this._proxy.$unregisterCodeMapperProvider(i)}}};A1._providerHandlePool=0;let O0=A1;function vM(n,e,t){const i=n.getProxy(ee.MainThreadComments),p=class p{constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new Lr,e.registerArgumentProcessor({processArgument:v=>{if(v&&v.$mid===st.CommentController){const E=this._commentControllers.get(v.handle);return E?E.value:v}else if(v&&v.$mid===st.CommentThread){const E=v,S=this._commentControllers.get(E.commentControlHandle);if(!S)return E;const A=S.getCommentThread(E.commentThreadHandle);return A?A.value:E}else if(v&&(v.$mid===st.CommentThreadReply||v.$mid===st.CommentThreadInstance)){const E=this._commentControllers.get(v.thread.commentControlHandle);if(!E)return v;const S=E.getCommentThread(v.thread.commentThreadHandle);return S?v.$mid===st.CommentThreadInstance?S.value:{thread:S.value,text:v.text}:v}else if(v&&v.$mid===st.CommentNode){const E=this._commentControllers.get(v.thread.commentControlHandle);if(!E)return v;const S=E.getCommentThread(v.thread.commentThreadHandle);if(!S)return v;const A=v.commentUniqueId,G=S.getCommentByUniqueId(A);return G||v}else if(v&&v.$mid===st.CommentThreadNode){const E=this._commentControllers.get(v.thread.commentControlHandle);if(!E)return v;const S=E.getCommentThread(v.thread.commentThreadHandle);if(!S)return v;const A=v.text,G=v.commentUniqueId,W=S.getCommentByUniqueId(G);return W?(typeof W.body=="string"?W.body=A:W.body=new mi(A),W):v}return v}})}createCommentController(v,E,S){const A=p.handlePool++,G=new o(v,A,E,S);this._commentControllers.set(G.handle,G);const W=this._commentControllersByExtension.get(v.identifier)||[];return W.push(G),this._commentControllersByExtension.set(v.identifier,W),G.value}async $createCommentThreadTemplate(v,E,S,A){const G=this._commentControllers.get(v);G&&G.$createCommentThreadTemplate(E,S,A)}async $setActiveComment(v,E){const S=this._commentControllers.get(v);S&&S.$setActiveComment(E??void 0)}async $updateCommentThreadTemplate(v,E,S){const A=this._commentControllers.get(v);A&&A.$updateCommentThreadTemplate(E,S)}$deleteCommentThread(v,E){this._commentControllers.get(v)?.$deleteCommentThread(E)}async $updateCommentThread(v,E,S){this._commentControllers.get(v)?.$updateCommentThread(E,S)}async $provideCommentingRanges(v,E,S){const A=this._commentControllers.get(v);if(!A||!A.commentingRangeProvider)return Promise.resolve(void 0);const G=await t.ensureDocumentData(x.revive(E));return Ln(async()=>{const W=await A.commentingRangeProvider?.provideCommentingRanges(G.document,S);let ce;return Array.isArray(W)?ce={ranges:W,fileComments:!1}:W?ce={ranges:W.ranges||[],fileComments:W.enableFileComments||!1}:ce=W??void 0,ce}).then(W=>{let ce;return W&&(ce={ranges:W.ranges.map(Q=>z.from(Q)),fileComments:W.fileComments}),ce})}$toggleReaction(v,E,S,A,G){const W=this._commentControllers.get(v);return!W||!W.reactionHandler?Promise.resolve(void 0):Ln(()=>{const ce=W.getCommentThread(E);if(ce){const Q=ce.getCommentByUniqueId(A.uniqueIdInThread);if(W!==void 0&&Q&&W.reactionHandler)return W.reactionHandler(Q,c(G))}return Promise.resolve(void 0)})}};p.handlePool=0;let s=p;const _=class _{set threadId(v){this._id=v}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(v){(v===void 0!=(this._range===void 0)||!v||!this._range||!v.isEqual(this._range))&&(this._range=v,this.modifications.range=v,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(v){this._canReply!==v&&(this._canReply=v,this.modifications.canReply=v,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(v){this._label=v,this.modifications.label=v,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(v){this._contextValue=v,this.modifications.contextValue=v,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(v){this._comments=v,this.modifications.comments=v,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(v){this._collapseState!==v&&(this._collapseState=v,this.modifications.collapsibleState=v,this._onDidUpdateCommentThread.fire())}get state(){return this._state}set state(v){this._state=v,typeof v=="object"?($(this.extensionDescription,"commentThreadApplicability"),this.modifications.state=v.resolved,this.modifications.applicability=v.applicability):this.modifications.state=v,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(v,E,S,A,G,W,ce,Q,ne){this._commentControllerHandle=E,this._id=S,this._uri=A,this._range=G,this._comments=W,this.extensionDescription=ce,this._isTemplate=Q,this.handle=_._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new N,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new ao,this._acceptInputDisposables.value=new xe,this._id===void 0&&(this._id=`${v}.${this.handle}`),i.$createCommentThread(E,this.handle,this._id,this._uri,z.from(this._range),this._comments.map(de=>a(this,de,this._commentsMap,this.extensionDescription)),ce.identifier,this._isTemplate,ne),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{i.$deleteCommentThread(E,this.handle)}});const J=this;this.value={get uri(){return J.uri},get range(){return J.range},set range(de){J.range=de},get comments(){return J.comments},set comments(de){J.comments=de},get collapsibleState(){return J.collapsibleState},set collapsibleState(de){J.collapsibleState=de},get canReply(){return J.canReply},set canReply(de){J.canReply=de},get contextValue(){return J.contextValue},set contextValue(de){J.contextValue=de},get label(){return J.label},set label(de){J.label=de},get state(){return J.state},set state(de){J.state=de},reveal:(de,Ce)=>J.reveal(de,Ce),hide:()=>J.hide(),dispose:()=>{J.dispose()}}}updateIsTemplate(){this._isTemplate&&(this._isTemplate=!1,this.modifications.isTemplate=!1)}eventuallyUpdateCommentThread(){if(this._isDiposed)return;this.updateIsTemplate(),this._acceptInputDisposables.value||(this._acceptInputDisposables.value=new xe);const v=S=>Object.prototype.hasOwnProperty.call(this.modifications,S),E={};v("range")&&(E.range=z.from(this._range)),v("label")&&(E.label=this.label),v("contextValue")&&(E.contextValue=this.contextValue??null),v("comments")&&(E.comments=this._comments.map(S=>a(this,S,this._commentsMap,this.extensionDescription))),v("collapsibleState")&&(E.collapseState=u(this._collapseState)),v("canReply")&&(E.canReply=this.canReply),v("state")&&(E.state=d(this._state)),v("applicability")&&(E.applicability=f(this._state)),v("isTemplate")&&(E.isTemplate=this._isTemplate),this.modifications={},i.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,E)}getCommentByUniqueId(v){for(const E of this._commentsMap){const S=E[0],A=E[1];if(v===A)return S}}async reveal(v,E){$(this.extensionDescription,"commentReveal");let S;v&&v.body!==void 0?S=v:E=E??v;let A=S?this._commentsMap.get(S):void 0;A??=this._commentsMap.get(this._comments[0]);let G=!0,W=!1;return E?.focus===ph.Reply?(W=!0,G=!1):E?.focus===ph.Comment&&(G=!1),i.$revealCommentThread(this._commentControllerHandle,this.handle,A,{preserveFocus:G,focusReply:W})}async hide(){return i.$hideCommentThread(this._commentControllerHandle,this.handle)}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._localDisposables.forEach(v=>v.dispose())}};_._handlePool=0;let r=_;class o{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(v){this._commentingRangeProvider=v,v?.resourceHints&&$(this._extension,"commentingRangeHint"),i.$updateCommentingRanges(this.handle,v?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(v){this._reactionHandler=v,i.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!v})}get options(){return this._options}set options(v){this._options=v,i.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return $(this._extension,"activeComment"),this._activeComment}get activeCommentThread(){return $(this._extension,"activeComment"),this._activeThread?.value}constructor(v,E,S,A){this._extension=v,this._handle=E,this._id=S,this._label=A,this._threads=new Map,i.$registerCommentController(this.handle,S,A,this._extension.identifier.value);const G=this;this.value=Object.freeze({id:G.id,label:G.label,get options(){return G.options},set options(W){G.options=W},get commentingRangeProvider(){return G.commentingRangeProvider},set commentingRangeProvider(W){G.commentingRangeProvider=W},get reactionHandler(){return G.reactionHandler},set reactionHandler(W){G.reactionHandler=W},get activeCommentThread(){return G.activeCommentThread},createCommentThread(W,ce,Q){return G.createCommentThread(W,ce,Q).value},dispose:()=>{G.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{i.$unregisterCommentController(this.handle)}})}createCommentThread(v,E,S){const A=new r(this.id,this.handle,void 0,v,E,S,this._extension,!1);return this._threads.set(A.handle,A),A}$setActiveComment(v){if(!v){this._activeComment=void 0,this._activeThread=void 0;return}const E=this._threads.get(v.commentThreadHandle);E&&(this._activeComment=v.uniqueIdInThread?E.getCommentByUniqueId(v.uniqueIdInThread):void 0,this._activeThread=E)}$createCommentThreadTemplate(v,E,S){const A=new r(this.id,this.handle,void 0,x.revive(v),z.to(E),[],this._extension,!0,S);return A.collapsibleState=Rl.Expanded,this._threads.set(A.handle,A),A}$updateCommentThreadTemplate(v,E){const S=this._threads.get(v);S&&(S.range=z.to(E))}$updateCommentThread(v,E){const S=this._threads.get(v);if(!S)return;(G=>Object.prototype.hasOwnProperty.call(E,G))("collapseState")&&(S.collapsibleState=u(E.collapseState))}$deleteCommentThread(v){this._threads.get(v)?.dispose(),this._threads.delete(v)}getCommentThread(v){return this._threads.get(v)}dispose(){this._threads.forEach(v=>{v.dispose()}),this._localDisposables.forEach(v=>v.dispose())}}function a(w,v,E,S){let A=E.get(v);return A||(A=++w.commentHandle,E.set(v,A)),v.state!==void 0&&$(S,"commentsDraftState"),v.reactions?.some(G=>G.reactors!==void 0)&&$(S,"commentReactor"),{mode:v.mode,contextValue:v.contextValue,uniqueIdInThread:A,body:typeof v.body=="string"?v.body:Re.from(v.body),userName:v.author.name,userIconPath:v.author.iconPath,label:v.label,commentReactions:v.reactions?v.reactions.map(G=>l(G)):void 0,state:v.state,timestamp:v.timestamp?.toJSON()}}function l(w){return{label:w.label,iconPath:w.iconPath?m_(w.iconPath):void 0,count:w.count,hasReacted:w.authorHasReacted,reactors:w.reactors&&w.reactors.length>0&&typeof w.reactors[0]!="string"?w.reactors.map(v=>v.name):w.reactors}}function c(w){return{label:w.label||"",count:w.count||0,iconPath:w.iconPath?x.revive(w.iconPath):"",authorHasReacted:w.hasReacted||!1,reactors:w.reactors?.map(v=>({name:v}))}}function u(w){if(w!==void 0)switch(w){case dh.Expanded:return Rl.Expanded;case dh.Collapsed:return Rl.Collapsed}return Rl.Collapsed}function d(w){let v;if(typeof w=="object"?v=w.resolved:v=w,v!==void 0)switch(v){case hh.Unresolved:return td.Unresolved;case hh.Resolved:return td.Resolved}return td.Unresolved}function f(w){let v;if(typeof w=="object"&&(v=w.applicability),v!==void 0)switch(v){case fh.Current:return nd.Current;case fh.Outdated:return nd.Outdated}return nd.Current}return new s}var Rf={exports:{}},gv={},KI;function wM(){return KI||(KI=1,(function(n,e){e=n.exports=Xe;var t;typeof process=="object"&&gv&&gv.NODE_DEBUG&&/\bsemver\b/i.test(gv.NODE_DEBUG)?t=function(){var k=Array.prototype.slice.call(arguments,0);k.unshift("SEMVER"),console.log.apply(console,k)}:t=function(){},e.SEMVER_SPEC_VERSION="2.0.0";var i=256,s=Number.MAX_SAFE_INTEGER||9007199254740991,r=16,o=e.re=[],a=e.src=[],l=0,c=l++;a[c]="0|[1-9]\\d*";var u=l++;a[u]="[0-9]+";var d=l++;a[d]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var f=l++;a[f]="("+a[c]+")\\.("+a[c]+")\\.("+a[c]+")";var p=l++;a[p]="("+a[u]+")\\.("+a[u]+")\\.("+a[u]+")";var _=l++;a[_]="(?:"+a[c]+"|"+a[d]+")";var w=l++;a[w]="(?:"+a[u]+"|"+a[d]+")";var v=l++;a[v]="(?:-("+a[_]+"(?:\\."+a[_]+")*))";var E=l++;a[E]="(?:-?("+a[w]+"(?:\\."+a[w]+")*))";var S=l++;a[S]="[0-9A-Za-z-]+";var A=l++;a[A]="(?:\\+("+a[S]+"(?:\\."+a[S]+")*))";var G=l++,W="v?"+a[f]+a[v]+"?"+a[A]+"?";a[G]="^"+W+"$";var ce="[v=\\s]*"+a[p]+a[E]+"?"+a[A]+"?",Q=l++;a[Q]="^"+ce+"$";var ne=l++;a[ne]="((?:<|>)?=?)";var J=l++;a[J]=a[u]+"|x|X|\\*";var de=l++;a[de]=a[c]+"|x|X|\\*";var Ce=l++;a[Ce]="[v=\\s]*("+a[de]+")(?:\\.("+a[de]+")(?:\\.("+a[de]+")(?:"+a[v]+")?"+a[A]+"?)?)?";var Ae=l++;a[Ae]="[v=\\s]*("+a[J]+")(?:\\.("+a[J]+")(?:\\.("+a[J]+")(?:"+a[E]+")?"+a[A]+"?)?)?";var se=l++;a[se]="^"+a[ne]+"\\s*"+a[Ce]+"$";var q=l++;a[q]="^"+a[ne]+"\\s*"+a[Ae]+"$";var re=l++;a[re]="(?:^|[^\\d])(\\d{1,"+r+"})(?:\\.(\\d{1,"+r+"}))?(?:\\.(\\d{1,"+r+"}))?(?:$|[^\\d])";var Y=l++;a[Y]="(?:~>?)";var ve=l++;a[ve]="(\\s*)"+a[Y]+"\\s+",o[ve]=new RegExp(a[ve],"g");var Le="$1~",Pe=l++;a[Pe]="^"+a[Y]+a[Ce]+"$";var Et=l++;a[Et]="^"+a[Y]+a[Ae]+"$";var St=l++;a[St]="(?:\\^)";var Ke=l++;a[Ke]="(\\s*)"+a[St]+"\\s+",o[Ke]=new RegExp(a[Ke],"g");var Hn="$1^",$t=l++;a[$t]="^"+a[St]+a[Ce]+"$";var Xn=l++;a[Xn]="^"+a[St]+a[Ae]+"$";var Dn=l++;a[Dn]="^"+a[ne]+"\\s*("+ce+")$|^$";var gs=l++;a[gs]="^"+a[ne]+"\\s*("+W+")$|^$";var Ht=l++;a[Ht]="(\\s*)"+a[ne]+"\\s*("+ce+"|"+a[Ce]+")",o[Ht]=new RegExp(a[Ht],"g");var uf="$1$2$3",df=l++;a[df]="^\\s*("+a[Ce]+")\\s+-\\s+("+a[Ce]+")\\s*$";var $r=l++;a[$r]="^\\s*("+a[Ae]+")\\s+-\\s+("+a[Ae]+")\\s*$";var Ro=l++;a[Ro]="(<|>)?=?\\s*\\*";for(var We=0;We<l;We++)t(We,a[We]),o[We]||(o[We]=new RegExp(a[We]));e.parse=Qs;function Qs(k,M){if(k instanceof Xe)return k;if(typeof k!="string"||k.length>i)return null;var H=M?o[Q]:o[G];if(!H.test(k))return null;try{return new Xe(k,M)}catch{return null}}e.valid=C_;function C_(k,M){var H=Qs(k,M);return H?H.version:null}e.clean=Js;function Js(k,M){var H=Qs(k.trim().replace(/^[=v]+/,""),M);return H?H.version:null}e.SemVer=Xe;function Xe(k,M){if(k instanceof Xe){if(k.loose===M)return k;k=k.version}else if(typeof k!="string")throw new TypeError("Invalid Version: "+k);if(k.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof Xe))return new Xe(k,M);t("SemVer",k,M),this.loose=M;var H=k.trim().match(M?o[Q]:o[G]);if(!H)throw new TypeError("Invalid Version: "+k);if(this.raw=k,this.major=+H[1],this.minor=+H[2],this.patch=+H[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");H[4]?this.prerelease=H[4].split(".").map(function(oe){if(/^[0-9]+$/.test(oe)){var X=+oe;if(X>=0&&X<s)return X}return oe}):this.prerelease=[],this.build=H[5]?H[5].split("."):[],this.format()}Xe.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},Xe.prototype.toString=function(){return this.version},Xe.prototype.compare=function(k){return t("SemVer.compare",this.version,this.loose,k),k instanceof Xe||(k=new Xe(k,this.loose)),this.compareMain(k)||this.comparePre(k)},Xe.prototype.compareMain=function(k){return k instanceof Xe||(k=new Xe(k,this.loose)),Hr(this.major,k.major)||Hr(this.minor,k.minor)||Hr(this.patch,k.patch)},Xe.prototype.comparePre=function(k){if(k instanceof Xe||(k=new Xe(k,this.loose)),this.prerelease.length&&!k.prerelease.length)return-1;if(!this.prerelease.length&&k.prerelease.length)return 1;if(!this.prerelease.length&&!k.prerelease.length)return 0;var M=0;do{var H=this.prerelease[M],oe=k.prerelease[M];if(t("prerelease compare",M,H,oe),H===void 0&&oe===void 0)return 0;if(oe===void 0)return 1;if(H===void 0)return-1;if(H===oe)continue;return Hr(H,oe)}while(++M)},Xe.prototype.inc=function(k,M){switch(k){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",M);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",M);break;case"prepatch":this.prerelease.length=0,this.inc("patch",M),this.inc("pre",M);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",M),this.inc("pre",M);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var H=this.prerelease.length;--H>=0;)typeof this.prerelease[H]=="number"&&(this.prerelease[H]++,H=-2);H===-1&&this.prerelease.push(0)}M&&(this.prerelease[0]===M?isNaN(this.prerelease[1])&&(this.prerelease=[M,0]):this.prerelease=[M,0]);break;default:throw new Error("invalid increment argument: "+k)}return this.format(),this.raw=this.version,this},e.inc=hf;function hf(k,M,H,oe){typeof H=="string"&&(oe=H,H=void 0);try{return new Xe(k,H).inc(M,oe).version}catch{return null}}e.diff=T_;function T_(k,M){if(ms(k,M))return null;var H=Qs(k),oe=Qs(M);if(H.prerelease.length||oe.prerelease.length){for(var X in H)if((X==="major"||X==="minor"||X==="patch")&&H[X]!==oe[X])return"pre"+X;return"prerelease"}for(var X in H)if((X==="major"||X==="minor"||X==="patch")&&H[X]!==oe[X])return X}e.compareIdentifiers=Hr;var ff=/^[0-9]+$/;function Hr(k,M){var H=ff.test(k),oe=ff.test(M);return H&&oe&&(k=+k,M=+M),H&&!oe?-1:oe&&!H?1:k<M?-1:k>M?1:0}e.rcompareIdentifiers=P_;function P_(k,M){return Hr(M,k)}e.major=pf;function pf(k,M){return new Xe(k,M).major}e.minor=A_;function A_(k,M){return new Xe(k,M).minor}e.patch=wu;function wu(k,M){return new Xe(k,M).patch}e.compare=vi;function vi(k,M,H){return new Xe(k,H).compare(new Xe(M,H))}e.compareLoose=R_;function R_(k,M){return vi(k,M,!0)}e.rcompare=L_;function L_(k,M,H){return vi(M,k,H)}e.sort=Br;function Br(k,M){return k.sort(function(H,oe){return e.compare(H,oe,M)})}e.rsort=N_;function N_(k,M){return k.sort(function(H,oe){return e.rcompare(H,oe,M)})}e.gt=dl;function dl(k,M,H){return vi(k,M,H)>0}e.lt=Xs;function Xs(k,M,H){return vi(k,M,H)<0}e.eq=ms;function ms(k,M,H){return vi(k,M,H)===0}e.neq=bu;function bu(k,M,H){return vi(k,M,H)!==0}e.gte=yu;function yu(k,M,H){return vi(k,M,H)>=0}e.lte=xu;function xu(k,M,H){return vi(k,M,H)<=0}e.cmp=Lo;function Lo(k,M,H,oe){var X;switch(M){case"===":typeof k=="object"&&(k=k.version),typeof H=="object"&&(H=H.version),X=k===H;break;case"!==":typeof k=="object"&&(k=k.version),typeof H=="object"&&(H=H.version),X=k!==H;break;case"":case"=":case"==":X=ms(k,H,oe);break;case"!=":X=bu(k,H,oe);break;case">":X=dl(k,H,oe);break;case">=":X=yu(k,H,oe);break;case"<":X=Xs(k,H,oe);break;case"<=":X=xu(k,H,oe);break;default:throw new TypeError("Invalid operator: "+M)}return X}e.Comparator=ai;function ai(k,M){if(k instanceof ai){if(k.loose===M)return k;k=k.value}if(!(this instanceof ai))return new ai(k,M);t("comparator",k,M),this.loose=M,this.parse(k),this.semver===Bi?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}var Bi={};ai.prototype.parse=function(k){var M=this.loose?o[Dn]:o[gs],H=k.match(M);if(!H)throw new TypeError("Invalid comparator: "+k);this.operator=H[1],this.operator==="="&&(this.operator=""),H[2]?this.semver=new Xe(H[2],this.loose):this.semver=Bi},ai.prototype.toString=function(){return this.value},ai.prototype.test=function(k){return t("Comparator.test",k,this.loose),this.semver===Bi?!0:(typeof k=="string"&&(k=new Xe(k,this.loose)),Lo(k,this.operator,this.semver,this.loose))},ai.prototype.intersects=function(k,M){if(!(k instanceof ai))throw new TypeError("a Comparator is required");var H;if(this.operator==="")return H=new Bt(k.value,M),hl(this.value,H,M);if(k.operator==="")return H=new Bt(this.value,M),hl(k.semver,H,M);var oe=(this.operator===">="||this.operator===">")&&(k.operator===">="||k.operator===">"),X=(this.operator==="<="||this.operator==="<")&&(k.operator==="<="||k.operator==="<"),De=this.semver.version===k.semver.version,He=(this.operator===">="||this.operator==="<=")&&(k.operator===">="||k.operator==="<="),Qe=Lo(this.semver,"<",k.semver,M)&&(this.operator===">="||this.operator===">")&&(k.operator==="<="||k.operator==="<"),m=Lo(this.semver,">",k.semver,M)&&(this.operator==="<="||this.operator==="<")&&(k.operator===">="||k.operator===">");return oe||X||De&&He||Qe||m},e.Range=Bt;function Bt(k,M){if(k instanceof Bt)return k.loose===M?k:new Bt(k.raw,M);if(k instanceof ai)return new Bt(k.value,M);if(!(this instanceof Bt))return new Bt(k,M);if(this.loose=M,this.raw=k,this.set=k.split(/\s*\|\|\s*/).map(function(H){return this.parseRange(H.trim())},this).filter(function(H){return H.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+k);this.format()}Bt.prototype.format=function(){return this.range=this.set.map(function(k){return k.join(" ").trim()}).join("||").trim(),this.range},Bt.prototype.toString=function(){return this.range},Bt.prototype.parseRange=function(k){var M=this.loose;k=k.trim(),t("range",k,M);var H=M?o[$r]:o[df];k=k.replace(H,U_),t("hyphen replace",k),k=k.replace(o[Ht],uf),t("comparator trim",k,o[Ht]),k=k.replace(o[ve],Le),k=k.replace(o[Ke],Hn),k=k.split(/\s+/).join(" ");var oe=M?o[Dn]:o[gs],X=k.split(" ").map(function(De){return F_(De,M)}).join(" ").split(/\s+/);return this.loose&&(X=X.filter(function(De){return!!De.match(oe)})),X=X.map(function(De){return new ai(De,M)}),X},Bt.prototype.intersects=function(k,M){if(!(k instanceof Bt))throw new TypeError("a Range is required");return this.set.some(function(H){return H.every(function(oe){return k.set.some(function(X){return X.every(function(De){return oe.intersects(De,M)})})})})},e.toComparators=O_;function O_(k,M){return new Bt(k,M).set.map(function(H){return H.map(function(oe){return oe.value}).join(" ").trim().split(" ")})}function F_(k,M){return t("comp",k),k=C(k,M),t("caret",k),k=gf(k,M),t("tildes",k),k=Eu(k,M),t("xrange",k),k=lt(k,M),t("stars",k),k}function wn(k){return!k||k.toLowerCase()==="x"||k==="*"}function gf(k,M){return k.trim().split(/\s+/).map(function(H){return M_(H,M)}).join(" ")}function M_(k,M){var H=M?o[Et]:o[Pe];return k.replace(H,function(oe,X,De,He,Qe){t("tilde",k,oe,X,De,He,Qe);var m;return wn(X)?m="":wn(De)?m=">="+X+".0.0 <"+(+X+1)+".0.0":wn(He)?m=">="+X+"."+De+".0 <"+X+"."+(+De+1)+".0":Qe?(t("replaceTilde pr",Qe),Qe.charAt(0)!=="-"&&(Qe="-"+Qe),m=">="+X+"."+De+"."+He+Qe+" <"+X+"."+(+De+1)+".0"):m=">="+X+"."+De+"."+He+" <"+X+"."+(+De+1)+".0",t("tilde return",m),m})}function C(k,M){return k.trim().split(/\s+/).map(function(H){return _s(H,M)}).join(" ")}function _s(k,M){t("caret",k,M);var H=M?o[Xn]:o[$t];return k.replace(H,function(oe,X,De,He,Qe){t("caret",k,oe,X,De,He,Qe);var m;return wn(X)?m="":wn(De)?m=">="+X+".0.0 <"+(+X+1)+".0.0":wn(He)?X==="0"?m=">="+X+"."+De+".0 <"+X+"."+(+De+1)+".0":m=">="+X+"."+De+".0 <"+(+X+1)+".0.0":Qe?(t("replaceCaret pr",Qe),Qe.charAt(0)!=="-"&&(Qe="-"+Qe),X==="0"?De==="0"?m=">="+X+"."+De+"."+He+Qe+" <"+X+"."+De+"."+(+He+1):m=">="+X+"."+De+"."+He+Qe+" <"+X+"."+(+De+1)+".0":m=">="+X+"."+De+"."+He+Qe+" <"+(+X+1)+".0.0"):(t("no pr"),X==="0"?De==="0"?m=">="+X+"."+De+"."+He+" <"+X+"."+De+"."+(+He+1):m=">="+X+"."+De+"."+He+" <"+X+"."+(+De+1)+".0":m=">="+X+"."+De+"."+He+" <"+(+X+1)+".0.0"),t("caret return",m),m})}function Eu(k,M){return t("replaceXRanges",k,M),k.split(/\s+/).map(function(H){return ge(H,M)}).join(" ")}function ge(k,M){k=k.trim();var H=M?o[q]:o[se];return k.replace(H,function(oe,X,De,He,Qe,m){t("xRange",k,oe,X,De,He,Qe,m);var b=wn(De),I=b||wn(He),fe=I||wn(Qe),ze=fe;return X==="="&&ze&&(X=""),b?X===">"||X==="<"?oe="<0.0.0":oe="*":X&&ze?(I&&(He=0),fe&&(Qe=0),X===">"?(X=">=",I?(De=+De+1,He=0,Qe=0):fe&&(He=+He+1,Qe=0)):X==="<="&&(X="<",I?De=+De+1:He=+He+1),oe=X+De+"."+He+"."+Qe):I?oe=">="+De+".0.0 <"+(+De+1)+".0.0":fe&&(oe=">="+De+"."+He+".0 <"+De+"."+(+He+1)+".0"),t("xRange return",oe),oe})}function lt(k,M){return t("replaceStars",k,M),k.trim().replace(o[Ro],"")}function U_(k,M,H,oe,X,De,He,Qe,m,b,I,fe,ze){return wn(H)?M="":wn(oe)?M=">="+H+".0.0":wn(X)?M=">="+H+"."+oe+".0":M=">="+M,wn(m)?Qe="":wn(b)?Qe="<"+(+m+1)+".0.0":wn(I)?Qe="<"+m+"."+(+b+1)+".0":fe?Qe="<="+m+"."+b+"."+I+"-"+fe:Qe="<="+Qe,(M+" "+Qe).trim()}Bt.prototype.test=function(k){if(!k)return!1;typeof k=="string"&&(k=new Xe(k,this.loose));for(var M=0;M<this.set.length;M++)if($_(this.set[M],k))return!0;return!1};function $_(k,M){for(var H=0;H<k.length;H++)if(!k[H].test(M))return!1;if(M.prerelease.length){for(var H=0;H<k.length;H++)if(t(k[H].semver),k[H].semver!==Bi&&k[H].semver.prerelease.length>0){var oe=k[H].semver;if(oe.major===M.major&&oe.minor===M.minor&&oe.patch===M.patch)return!0}return!1}return!0}e.satisfies=hl;function hl(k,M,H){try{M=new Bt(M,H)}catch{return!1}return M.test(k)}e.maxSatisfying=H_;function H_(k,M,H){var oe=null,X=null;try{var De=new Bt(M,H)}catch{return null}return k.forEach(function(He){De.test(He)&&(!oe||X.compare(He)===-1)&&(oe=He,X=new Xe(oe,H))}),oe}e.minSatisfying=fl;function fl(k,M,H){var oe=null,X=null;try{var De=new Bt(M,H)}catch{return null}return k.forEach(function(He){De.test(He)&&(!oe||X.compare(He)===1)&&(oe=He,X=new Xe(oe,H))}),oe}e.validRange=B_;function B_(k,M){try{return new Bt(k,M).range||"*"}catch{return null}}e.ltr=W_;function W_(k,M,H){return pl(k,M,"<",H)}e.gtr=V_;function V_(k,M,H){return pl(k,M,">",H)}e.outside=pl;function pl(k,M,H,oe){k=new Xe(k,oe),M=new Bt(M,oe);var X,De,He,Qe,m;switch(H){case">":X=dl,De=xu,He=Xs,Qe=">",m=">=";break;case"<":X=Xs,De=yu,He=dl,Qe="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(hl(k,M,oe))return!1;for(var b=0;b<M.set.length;++b){var I=M.set[b],fe=null,ze=null;if(I.forEach(function(kt){kt.semver===Bi&&(kt=new ai(">=0.0.0")),fe=fe||kt,ze=ze||kt,X(kt.semver,fe.semver,oe)?fe=kt:He(kt.semver,ze.semver,oe)&&(ze=kt)}),fe.operator===Qe||fe.operator===m||(!ze.operator||ze.operator===Qe)&&De(k,ze.semver))return!1;if(ze.operator===m&&He(k,ze.semver))return!1}return!0}e.prerelease=z_;function z_(k,M){var H=Qs(k,M);return H&&H.prerelease.length?H.prerelease:null}e.intersects=q_;function q_(k,M,H){return k=new Bt(k,H),M=new Bt(M,H),k.intersects(M)}e.coerce=j_;function j_(k){if(k instanceof Xe)return k;if(typeof k!="string")return null;var M=k.match(o[re]);return M==null?null:Qs((M[1]||"0")+"."+(M[2]||"0")+"."+(M[3]||"0"))}})(Rf,Rf.exports)),Rf.exports}wM();const l5=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,bM=/^-(\d{4})(\d{2})(\d{2})$/;function yM(n){return n=n.trim(),n==="*"||l5.test(n)}function c5(n){if(!yM(n))return null;if(n=n.trim(),n==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=n.match(l5);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function u5(n){if(!n)return null;const e=n.majorBase,t=n.majorMustEqual,i=n.minorBase;let s=n.minorMustEqual;const r=n.patchBase;let o=n.patchMustEqual;n.hasCaret&&(e===0||(s=!1),o=!1);let a=0;if(n.preRelease){const l=bM.exec(n.preRelease);if(l){const[,c,u,d]=l;a=Date.UTC(Number(c),Number(u)-1,Number(d))}}return{majorBase:e,majorMustEqual:t,minorBase:i,minorMustEqual:s,patchBase:r,patchMustEqual:o,isMinimum:n.hasGreaterEquals,notBefore:a}}class xM{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}}function EM(n,e){if(e.serializeBuffersForPostMessage){const t=new xM,s=JSON.stringify(n,(o,a)=>{if(a instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a)};if(ArrayBuffer.isView(a)){const l=SM(a);if(l)return{$$vscode_array_buffer_reference$$:!0,index:t.add(a.buffer),view:{type:l,byteLength:a.byteLength,byteOffset:a.byteOffset}}}return a}),r=t.buffers.map(o=>{const a=new Uint8Array(o);return ue.wrap(a)});return{message:s,buffers:r}}else return{message:JSON.stringify(n),buffers:[]}}function SM(n){switch(n.constructor.name){case"Int8Array":return Vt.Int8Array;case"Uint8Array":return Vt.Uint8Array;case"Uint8ClampedArray":return Vt.Uint8ClampedArray;case"Int16Array":return Vt.Int16Array;case"Uint16Array":return Vt.Uint16Array;case"Int32Array":return Vt.Int32Array;case"Uint32Array":return Vt.Uint32Array;case"Float32Array":return Vt.Float32Array;case"Float64Array":return Vt.Float64Array;case"BigInt64Array":return Vt.BigInt64Array;case"BigUint64Array":return Vt.BigUint64Array}}function kM(n,e){const t=e.map(r=>{const o=new ArrayBuffer(r.byteLength);return new Uint8Array(o).set(r.buffer),o}),i=e.length?(r,o)=>{if(o&&typeof o=="object"&&o.$$vscode_array_buffer_reference$$){const a=o,{index:l}=a,c=t[l];if(a.view)switch(a.view.type){case Vt.Int8Array:return new Int8Array(c,a.view.byteOffset,a.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case Vt.Uint8Array:return new Uint8Array(c,a.view.byteOffset,a.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case Vt.Uint8ClampedArray:return new Uint8ClampedArray(c,a.view.byteOffset,a.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case Vt.Int16Array:return new Int16Array(c,a.view.byteOffset,a.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case Vt.Uint16Array:return new Uint16Array(c,a.view.byteOffset,a.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case Vt.Int32Array:return new Int32Array(c,a.view.byteOffset,a.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case Vt.Uint32Array:return new Uint32Array(c,a.view.byteOffset,a.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case Vt.Float32Array:return new Float32Array(c,a.view.byteOffset,a.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case Vt.Float64Array:return new Float64Array(c,a.view.byteOffset,a.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case Vt.BigInt64Array:return new BigInt64Array(c,a.view.byteOffset,a.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case Vt.BigUint64Array:return new BigUint64Array(c,a.view.byteOffset,a.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw new Error("Unknown array buffer view type")}return c}return o}:void 0;return{message:JSON.parse(n,i),arrayBuffers:t}}class DM{#e;#t;#n;#i;#r;#s;#a;#o;#l;#c;#u;#h;constructor(e,t,i,s,r,o,a){this.#a="",this.#l=!1,this.#c=!1,this._onMessageEmitter=new N,this.onDidReceiveMessage=this._onMessageEmitter.event,this.#d=new N,this._onDidDispose=this.#d.event,this.#e=e,this.#t=t,this.#o=i,this.#i=s,this.#r=r,this.#s=o,this.#u=du(o),this.#h=IM(o),this.#n=a}#d;dispose(){this.#l=!0,this.#d.fire(),this.#d.dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return this.#c=!0,_d(e,this.#i)}get cspSource(){const e=this.#s.extensionLocation;if(e.scheme===le.https||e.scheme===le.http){let t=e.toString();return t.endsWith("/")||(t+="/"),t+" "+N0}return N0}get html(){return this.assertNotDisposed(),this.#a}set html(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#h&&!this.#c&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(this.#c=!0,this.#n.report("Webview vscode-resource: uris",this.#s,"Please migrate to use the 'webview.asWebviewUri' api instead: https://aka.ms/vscode-webview-use-aswebviewuri")),this.#t.$setHtml(this.#e,this.rewriteOldResourceUrlsIfNeeded(e)))}get options(){return this.assertNotDisposed(),this.#o}set options(e){this.assertNotDisposed(),Gn(this.#o,e)||this.#t.$setOptions(this.#e,d5(this.#s,this.#r,e)),this.#o=e}async postMessage(e){if(this.#l)return!1;const t=EM(e,{serializeBuffersForPostMessage:this.#u});return this.#t.$postMessage(this.#e,t.message,...t.buffers)}assertNotDisposed(){if(this.#l)throw new Error("Webview is disposed")}rewriteOldResourceUrlsIfNeeded(e){if(!this.#h)return e;const t=this.#s.extensionLocation?.scheme===le.vscodeRemote,i=this.#s.extensionLocation.scheme===le.vscodeRemote?this.#s.extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,r,o,a,l,c)=>{const u=x.from({scheme:a||"file",path:decodeURIComponent(l)}),d=_d(u,{isRemote:t,authority:i}).toString();return`${r}${d}${c}`}).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(s,r,o,a,l,c)=>{const u=x.from({scheme:a||"file",path:decodeURIComponent(l)}),d=_d(u,{isRemote:t,authority:i}).toString();return`${r}${d}${c}`})}}function du(n){try{const e=u5(c5(n.engines.vscode));return!!e&&e.majorBase>=1&&e.minorBase>=57}catch{return!1}}function IM(n){try{const e=u5(c5(n.engines.vscode));return e?e.majorBase<1||e.majorBase===1&&e.minorBase<60:!1}catch{return!1}}class CM extends Se{constructor(e,t,i,s,r){super(),this.remoteInfo=t,this.workspace=i,this._logService=s,this._deprecationService=r,this._webviews=new Map,this._webviewProxy=e.getProxy(ee.MainThreadWebviews)}dispose(){super.dispose();for(const e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,i){const s=this.getWebview(e);if(s){const{message:r}=kM(t,i.value);s._onMessageEmitter.fire(r)}}$onMissingCsp(e,t){this._logService.warn(`${t} created a webview without a content security policy: https://aka.ms/vscode-webview-missing-csp`)}createNewWebview(e,t,i){const s=new DM(e,this._webviewProxy,TM(t),this.remoteInfo,this.workspace,i,this._deprecationService);this._webviews.set(e,s);const r=s._onDidDispose(()=>{r.dispose(),this.deleteWebview(e)});return s}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}}function n1(n){return{id:n.identifier,location:n.extensionLocation}}function d5(n,e,t){return{enableCommandUris:t.enableCommandUris,enableScripts:t.enableScripts,enableForms:t.enableForms,portMapping:t.portMapping,localResourceRoots:t.localResourceRoots||PM(n,e)}}function TM(n){return{enableCommandUris:n.enableCommandUris,enableScripts:n.enableScripts,enableForms:n.enableForms,portMapping:n.portMapping,localResourceRoots:n.localResourceRoots?.map(e=>x.from(e))}}function PM(n,e){return[...(e?.getWorkspaceFolders()||[]).map(t=>t.uri),n.extensionLocation]}const R1=class R1{constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){const t=this._idPool++;return this._data.set(t,e),this.logDebugInfo(),t}get(e,t){return this._data.has(e)?this._data.get(e)[t]:void 0}delete(e){this._data.delete(e),this.logDebugInfo()}logDebugInfo(){R1.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}};R1.enableDebugLogging=!1;let Oi=R1;class AM{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new Oi("custom documents")}addEdit(e){return this._edits.add([e])}async undo(e,t){await this.getEdit(e).undo(),t||this.disposeBackup()}async redo(e,t){await this.getEdit(e).redo(),t||this.disposeBackup()}disposeEdits(e){for(const t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw new Error("Backup requires a valid storage path");const e=MM(this.document.uri)+this._backupCounter++;return An(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){const t=this._edits.get(e,0);if(!t)throw new Error("No edit found");return t}}class RM{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,i){const s=this.key(e,t.uri);if(this._documents.has(s))throw new Error(`Document already exists for viewType:${e} resource:${t.uri}`);const r=new AM(t,i);return this._documents.set(s,r),r}delete(e,t){const i=this.key(e,t.uri);this._documents.delete(i)}key(e,t){return`${e}@@@${t}`}}var go;(function(n){n[n.Text=0]="Text",n[n.Custom=1]="Custom"})(go||(go={}));class LM{constructor(){this._providers=new Map}addTextProvider(e,t,i){return this.add(e,{type:go.Text,extension:t,provider:i})}addCustomProvider(e,t,i){return this.add(e,{type:go.Custom,extension:t,provider:i})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw new Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new je(()=>this._providers.delete(e))}}class NM{constructor(e,t,i,s,r){this._extHostDocuments=t,this._extensionStoragePaths=i,this._extHostWebview=s,this._extHostWebviewPanels=r,this._editorProviders=new LM,this._documents=new RM,this._proxy=e.getProxy(ee.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,i,s){const r=new xe;return OM(i)?(r.add(this._editorProviders.addTextProvider(t,e,i)),this._proxy.$registerTextEditorProvider(n1(e),t,s.webviewOptions||{},{supportsMove:!!i.moveCustomTextEditor},du(e))):(r.add(this._editorProviders.addCustomProvider(t,e,i)),Lf(i)&&r.add(i.onDidChangeCustomDocument(o=>{const a=this.getCustomDocumentEntry(t,o.document.uri);if(FM(o)){const l=a.addEdit(o);this._proxy.$onDidEdit(o.document.uri,t,l,o.label)}else this._proxy.$onContentChange(o.document.uri,t)})),this._proxy.$registerCustomEditorProvider(n1(e),t,s.webviewOptions||{},!!s.supportsMultipleEditorsPerDocument,du(e))),je.from(r,new je(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,i,s,r){const o=this._editorProviders.get(t);if(!o)throw new Error(`No provider found for '${t}'`);if(o.type!==go.Custom)throw new Error(`Invalid provide type for '${t}'`);const a=x.revive(e),l=await o.provider.openCustomDocument(a,{backupId:i,untitledDocumentData:s?.buffer},r);let c;return Lf(o.provider)&&this._extensionStoragePaths&&(c=this._extensionStoragePaths.workspaceValue(o.extension)??this._extensionStoragePaths.globalValue(o.extension)),this._documents.add(t,l,c),{editable:Lf(o.provider)}}async $disposeCustomDocument(e,t){const i=this._editorProviders.get(t);if(!i)throw new Error(`No provider found for '${t}'`);if(i.type!==go.Custom)throw new Error(`Invalid provider type for '${t}'`);const s=x.revive(e),{document:r}=this.getCustomDocumentEntry(t,s);this._documents.delete(t,r),r.dispose()}async $resolveCustomEditor(e,t,i,s,r,o){const a=this._editorProviders.get(i);if(!a)throw new Error(`No provider found for '${i}'`);const l=hn.to(r),c=this._extHostWebview.createNewWebview(t,s.contentOptions,a.extension),u=this._extHostWebviewPanels.createNewWebviewPanel(t,i,s.title,l,s.options,c,s.active),d=x.revive(e);switch(a.type){case go.Custom:{const{document:f}=this.getCustomDocumentEntry(i,d);return a.provider.resolveCustomEditor(f,u,o)}case go.Text:{const f=this._extHostDocuments.getDocument(d);return a.provider.resolveCustomTextEditor(f,u,o)}default:throw new Error("Unknown webview provider type")}}$disposeEdits(e,t,i){this.getCustomDocumentEntry(t,e).disposeEdits(i)}async $onMoveCustomEditor(e,t,i){const s=this._editorProviders.get(i);if(!s)throw new Error(`No provider found for '${i}'`);if(!s.provider.moveCustomTextEditor)throw new Error(`Provider does not implement move '${i}'`);const r=this._extHostWebviewPanels.getWebviewPanel(e);if(!r)throw new Error("No webview found");const o=x.revive(t),a=this._extHostDocuments.getDocument(o);await s.provider.moveCustomTextEditor(a,r,yt.None)}async $undo(e,t,i,s){return this.getCustomDocumentEntry(t,e).undo(i,s)}async $redo(e,t,i,s){return this.getCustomDocumentEntry(t,e).redo(i,s)}async $revert(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(s.document,i),s.disposeBackup()}async $onSave(e,t,i){const s=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(s.document,i),s.disposeBackup()}async $onSaveAs(e,t,i,s){const r=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(r.document,x.revive(i),s)}async $backup(e,t,i){const s=this.getCustomDocumentEntry(t,e),o=await this.getCustomEditorProvider(t).backupCustomDocument(s.document,{destination:s.getNewBackupUri()},i);return s.updateBackup(o),o.id}getCustomDocumentEntry(e,t){const i=this._documents.get(e,x.revive(t));if(!i)throw new Error("No custom document found");return i}getCustomEditorProvider(e){const i=this._editorProviders.get(e)?.provider;if(!i||!Lf(i))throw new Error("Custom document is not editable");return i}}function Lf(n){return!!n.onDidChangeCustomDocument}function OM(n){return typeof n.resolveCustomTextEditor=="function"}function FM(n){return typeof n.undo=="function"&&typeof n.redo=="function"}function MM(n){const e=n.scheme===le.file||n.scheme===le.untitled?n.fsPath:n.toString();return Vd(e)+""}var Wo;class i1{#e;#t;#n;constructor(e,t,i,s,r,o,a,l){this._name=e,this._owner=t,this._maxDiagnosticsTotal=i,this._maxDiagnosticsPerFile=s,this._modelVersionIdProvider=r,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(s,i),this.#n=new on(c=>o.getComparisonKey(c)),this.#e=a,this.#t=l}dispose(){this._isDisposed||(this.#t.fire([...this.#n.keys()]),this.#e?.$clear(this._owner),this.#n.clear(),this._isDisposed=!0)}get name(){return this._checkDisposed(),this._name}set(e,t){if(!e){this.clear();return}this._checkDisposed();let i=[];if(x.isUri(e)){if(!t){this.delete(e);return}this.#n.set(e,t.slice()),i=[e]}else if(Array.isArray(e)){i=[];let o;e=[...e].sort(i1._compareIndexedTuplesByUri);for(const a of e){const[l,c]=a;if((!o||l.toString()!==o.toString())&&(o&&this.#n.get(o).length===0&&this.#n.delete(o),o=l,i.push(l),this.#n.set(l,[])),c)this.#n.get(l)?.push(...c);else{const u=this.#n.get(l);u&&(u.length=0)}}}if(this.#t.fire(i),!this.#e)return;const s=[];let r=0;for(const o of i){let a=[];const l=this.#n.get(o);if(l)if(l.length>this._maxDiagnosticsPerFile){a=[];const c=[Pn.Error,Pn.Warning,Pn.Information,Pn.Hint];e:for(let u=0;u<4;u++)for(const d of l)if(d.severity===c[u]&&a.push({...Jc.from(d),modelVersionId:this._modelVersionIdProvider(o)})===this._maxDiagnosticsPerFile)break e;a.push({severity:si.Info,message:h(2579,"Not showing {0} further errors and warnings.",l.length-this._maxDiagnosticsPerFile),startLineNumber:a[a.length-1].startLineNumber,startColumn:a[a.length-1].startColumn,endLineNumber:a[a.length-1].endLineNumber,endColumn:a[a.length-1].endColumn})}else a=l.map(c=>({...Jc.from(c),modelVersionId:this._modelVersionIdProvider(o)}));if(s.push([o,a]),r+=a.length,r>this._maxDiagnosticsTotal)break}this.#e.$changeMany(this._owner,s)}delete(e){this._checkDisposed(),this.#t.fire([e]),this.#n.delete(e),this.#e?.$changeMany(this._owner,[[e,void 0]])}clear(){this._checkDisposed(),this.#t.fire([...this.#n.keys()]),this.#n.clear(),this.#e?.$clear(this._owner)}forEach(e,t){this._checkDisposed();for(const[i,s]of this)e.call(t,i,s,this)}*[Symbol.iterator](){this._checkDisposed();for(const e of this.#n.keys())yield[e,this.get(e)]}get(e){this._checkDisposed();const t=this.#n.get(e);return Array.isArray(t)?Object.freeze(t.slice(0)):[]}has(e){return this._checkDisposed(),Array.isArray(this.#n.get(e))}_checkDisposed(){if(this._isDisposed)throw new Error("illegal state - object is disposed")}static _compareIndexedTuplesByUri(e,t){return e[0].toString()<t[0].toString()?-1:e[0].toString()>t[0].toString()?1:0}}var Ps;let F0=(Ps=class{static _mapper(e){const t=new on;for(const i of e)t.set(i,i);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,i,s){this._logService=t,this._fileSystemInfoService=i,this._extHostDocumentsAndEditors=s,this._collections=new Map,this._onDidChangeDiagnostics=new pA({merge:r=>r.flat(),delay:50}),this.onDidChangeDiagnostics=Ut.map(this._onDidChangeDiagnostics.event,Wo._mapper),this._proxy=e.getProxy(ee.MainThreadDiagnostics)}createDiagnosticCollection(e,t){const{_collections:i,_proxy:s,_onDidChangeDiagnostics:r,_logService:o,_fileSystemInfoService:a,_extHostDocumentsAndEditors:l}=this,c=new class{$changeMany(f,p){s.$changeMany(f,p),o.trace("[DiagnosticCollection] change many (extension, owner, uris)",e.value,f,p.length===0?"CLEARING":p)}$clear(f){s.$clear(f),o.trace("[DiagnosticCollection] remove all (extension, owner)",e.value,f)}dispose(){s.dispose()}};let u;if(!t)t="_generated_diagnostic_collection_name_#"+Wo._idPool++,u=t;else if(!i.has(t))u=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do u=t+Wo._idPool++;while(i.has(u))}return new class extends i1{constructor(){super(t,u,Wo._maxDiagnosticsTotal,Wo._maxDiagnosticsPerFile,f=>l.getDocument(f)?.version,a.extUri,c,r),i.set(u,this)}dispose(){super.dispose(),i.delete(u)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{const t=new Map,i=[];for(const s of this._collections.values())s.forEach((r,o)=>{let a=t.get(r.toString());typeof a>"u"&&(a=i.length,t.set(r.toString(),a),i.push([r,[]])),i[a][1]=i[a][1].concat(...o)});return i}}_getDiagnostics(e){let t=[];for(const i of this._collections.values())i.has(e)&&(t=t.concat(i.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){const t="_generated_mirror",i=new i1(t,t,Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,s=>{},this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(t,i),this._mirrorCollection=i}for(const[t,i]of e)this._mirrorCollection.set(x.revive(t),i.map(Jc.to))}},Wo=Ps,Ps._idPool=0,Ps._maxDiagnosticsPerFile=1e3,Ps._maxDiagnosticsTotal=1.1*Ps._maxDiagnosticsPerFile,Ps);F0=Wo=V([L(1,at),L(2,hu)],F0);class UM{constructor(e){this._proxy=e.getProxy(ee.MainThreadDialogs)}showOpenDialog(e){return this._proxy.$showOpenDialog(e).then(t=>t?t.map(i=>x.revive(i)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(t=>t?x.revive(t):void 0)}}const L1=class L1{constructor(e,t,i){this._documentsAndEditors=t,this._logService=i,this._documentContentProviders=new Map,this._proxy=e.getProxy(ee.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(e,t){if(Object.keys(le).indexOf(e)>=0)throw new Error(`scheme '${e}' already registered`);const i=L1._handlePool++;this._documentContentProviders.set(i,t),this._proxy.$registerTextContentProvider(i,e);let s;if(typeof t.onDidChange=="function"){let r;s=t.onDidChange(async o=>{if(o.scheme!==e){this._logService.warn(`Provider for scheme '${e}' is firing event for schema '${o.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(o))return;r&&await r;const a=this.$provideTextDocumentContent(i,o).then(async l=>{if(!l&&typeof l!="string")return;const c=this._documentsAndEditors.getDocument(o);if(!c)return;const u=_C(l);if(!c.equalLines(u))return this._proxy.$onVirtualDocumentChange(o,l)}).catch(On).finally(()=>{r===a&&(r=void 0)});r=a})}return new je(()=>{this._documentContentProviders.delete(i)&&this._proxy.$unregisterTextContentProvider(i),s&&(s.dispose(),s=void 0)})}$provideTextDocumentContent(e,t){const i=this._documentContentProviders.get(e);return i?Promise.resolve(i.provideTextDocumentContent(x.revive(t),yt.None)):Promise.reject(new Error(`unsupported uri-scheme: ${t.scheme}`))}};L1._handlePool=0;let M0=L1;class $M{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._callbacks=new To,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,i,s)=>{const o={dispose:this._callbacks.push([t,i,e])};return Array.isArray(s)&&s.push(o),o}}async $participateInSave(e,t){const i=x.revive(e);let s=!1;const r=setTimeout(()=>s=!0,this._thresholds.timeout),o=[];try{for(const a of[...this._callbacks]){if(s)break;const l=this._documents.getDocument(i),c=await this._deliverEventAsyncAndBlameBadListeners(a,{document:l,reason:bm.to(t)});o.push(c)}}finally{clearTimeout(r)}return o}_deliverEventAsyncAndBlameBadListeners([e,t,i],s){const r=this._badListeners.get(e);return typeof r=="number"&&r>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(i,e,t,s).then(()=>!0,o=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' threw ERROR`),this._logService.error(o),!(o instanceof Error)||o.message!=="concurrent_edits"){const a=this._badListeners.get(e);this._badListeners.set(e,a?a+1:1),typeof a=="number"&&a>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${i.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,i,s){const r=[],o=Date.now(),{document:a,reason:l}=s,{version:c}=a,u=Object.freeze({document:a,reason:l,waitUntil(d){if(Object.isFrozen(r))throw mx("waitUntil can not be called async");r.push(Promise.resolve(d))}});try{t.apply(i,[u])}catch(d){return Promise.reject(d)}return new Promise((d,f)=>{const p=setTimeout(()=>f(new Error("timeout")),this._thresholds.timeout);return Promise.all(r).then(_=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-o}ms`),clearTimeout(p),d(_)}).catch(_=>{clearTimeout(p),f(_)})}).then(d=>{const f={edits:[]};for(const p of d)if(Array.isArray(p)&&p.every(_=>_ instanceof ko))for(const{newText:_,newEol:w,range:v}of p)f.edits.push({resource:a.uri,versionId:void 0,textEdit:{range:v&&z.from(v),text:_,eol:w&&eu.from(w)}});if(f.edits.length!==0)return c===a.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jn(f)):Promise.reject(new Error("concurrent_edits"))})}}class HM{constructor(e,t){this._onDidAddDocument=new N,this._onDidRemoveDocument=new N,this._onDidChangeDocument=new N,this._onDidSaveDocument=new N,this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._toDispose=new xe,this._documentLoader=new Map,this._proxy=e.getProxy(ee.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(i=>{for(const s of i)this._onDidRemoveDocument.fire(s.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(i=>{for(const s of i)this._onDidAddDocument.fire(s.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;const t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){const t=this.getDocumentData(e);if(!t?.document)throw new Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e,t){const i=this._documentsAndEditors.getDocument(e);if(i&&(!t?.encoding||i.document.encoding===t.encoding))return Promise.resolve(i);let s=this._documentLoader.get(e.toString());return s?t?.encoding&&(s=s.then(r=>r.document.encoding!==t.encoding?this.ensureDocumentData(e,t):r)):(s=this._proxy.$tryOpenDocument(e,t).then(r=>{this._documentLoader.delete(e.toString());const o=x.revive(r);return Tc(this._documentsAndEditors.getDocument(o))},r=>(this._documentLoader.delete(e.toString()),Promise.reject(r))),this._documentLoader.set(e.toString(),s)),s}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(t=>x.revive(t))}$acceptModelLanguageChanged(e,t){const i=x.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");this._onDidRemoveDocument.fire(s.document),s._acceptLanguageId(t),this._onDidAddDocument.fire(s.document)}$acceptModelSaved(e){const t=x.revive(e),i=this._documentsAndEditors.getDocument(t);if(!i)throw new Error("unknown document");this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(i.document)}$acceptDirtyStateChanged(e,t){const i=x.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");s._acceptIsDirty(t),this._onDidChangeDocument.fire({document:s.document,contentChanges:[],reason:void 0})}$acceptEncodingChanged(e,t){const i=x.revive(e),s=this._documentsAndEditors.getDocument(i);if(!s)throw new Error("unknown document");s._acceptEncoding(t),this._onDidChangeDocument.fire({document:s.document,contentChanges:[],reason:void 0})}$acceptModelChanged(e,t,i){const s=x.revive(e),r=this._documentsAndEditors.getDocument(s);if(!r)throw new Error("unknown document");r._acceptIsDirty(i),r.onEvents(t);let o;t.isUndoing?o=ih.Undo:t.isRedoing&&(o=ih.Redo),this._onDidChangeDocument.fire(NC({document:r.document,contentChanges:t.changes.map(a=>({range:z.to(a.range),rangeOffset:a.rangeOffset,rangeLength:a.rangeLength,text:a.text})),reason:o}))}setWordDefinitionFor(e,t){ZO(e,t)}}class BM{constructor(e){this._provider=new Map,this._onDidChange=new N,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(ee.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,i){if(this._allKnownModels.has(t))throw new Error("An embeddings provider for this model is already registered");const s=this._handlePool++;return this._proxy.$registerEmbeddingProvider(s,t),this._provider.set(s,{id:t,provider:i}),we(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(s),this._provider.delete(s)})}async computeEmbeddings(e,t,i){i??=yt.None;let s=!1;typeof t=="string"&&(t=[t],s=!0);const r=await this._proxy.$computeEmbeddings(e,t,i);if(r.length!==t.length)throw new Error;if(s){if(r.length!==1)throw new Error;return r[0]}return r}async $provideEmbeddings(e,t,i){const s=this._provider.get(e);if(!s)return[];const r=await s.provider.provideEmbeddings(t,i);return r||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}}class WM{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(ee.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,i){if(this._AiEmbeddingVectorProviders.size===0)throw new Error("No embedding vector providers registered");const s=this._AiEmbeddingVectorProviders.get(e);if(!s)throw new Error("Embedding vector provider not found");const r=await s.provideEmbeddingVector(t,i);if(!r)throw new Error("Embedding vector provider returned undefined");return r}registerEmbeddingVectorProvider(e,t,i){const s=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(s,i),this._proxy.$registerAiEmbeddingVectorProvider(t,s),new je(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(s),this._AiEmbeddingVectorProviders.delete(s)})}}var Ee;(function(n){n[n.Invalid=0]="Invalid",n[n.Start=1]="Start",n[n.H=2]="H",n[n.HT=3]="HT",n[n.HTT=4]="HTT",n[n.HTTP=5]="HTTP",n[n.F=6]="F",n[n.FI=7]="FI",n[n.FIL=8]="FIL",n[n.BeforeColon=9]="BeforeColon",n[n.AfterColon=10]="AfterColon",n[n.AlmostThere=11]="AlmostThere",n[n.End=12]="End",n[n.Accept=13]="Accept",n[n.LastKnownState=14]="LastKnownState"})(Ee||(Ee={}));class VM{constructor(e,t,i){const s=new Uint8Array(e*t);for(let r=0,o=e*t;r<o;r++)s[r]=i;this._data=s,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,i){this._data[e*this.cols+t]=i}}class h5{constructor(e){let t=0,i=Ee.Invalid;for(let r=0,o=e.length;r<o;r++){const[a,l,c]=e[r];l>t&&(t=l),a>i&&(i=a),c>i&&(i=c)}t++,i++;const s=new VM(i,t,Ee.Invalid);for(let r=0,o=e.length;r<o;r++){const[a,l,c]=e[r];s.set(a,l,c)}this._states=s,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?Ee.Invalid:this._states.get(e,t)}}let mv=null;function zM(){return mv===null&&(mv=new h5([[Ee.Start,R.h,Ee.H],[Ee.Start,R.H,Ee.H],[Ee.Start,R.f,Ee.F],[Ee.Start,R.F,Ee.F],[Ee.H,R.t,Ee.HT],[Ee.H,R.T,Ee.HT],[Ee.HT,R.t,Ee.HTT],[Ee.HT,R.T,Ee.HTT],[Ee.HTT,R.p,Ee.HTTP],[Ee.HTT,R.P,Ee.HTTP],[Ee.HTTP,R.s,Ee.BeforeColon],[Ee.HTTP,R.S,Ee.BeforeColon],[Ee.HTTP,R.Colon,Ee.AfterColon],[Ee.F,R.i,Ee.FI],[Ee.F,R.I,Ee.FI],[Ee.FI,R.l,Ee.FIL],[Ee.FI,R.L,Ee.FIL],[Ee.FIL,R.e,Ee.BeforeColon],[Ee.FIL,R.E,Ee.BeforeColon],[Ee.BeforeColon,R.Colon,Ee.AfterColon],[Ee.AfterColon,R.Slash,Ee.AlmostThere],[Ee.AlmostThere,R.Slash,Ee.End]])),mv}var Pt;(function(n){n[n.None=0]="None",n[n.ForceTermination=1]="ForceTermination",n[n.CannotEndIn=2]="CannotEndIn"})(Pt||(Pt={}));let Au=null;function qM(){if(Au===null){Au=new k_(Pt.None);const n=` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…`;for(let t=0;t<n.length;t++)Au.set(n.charCodeAt(t),Pt.ForceTermination);const e=".,;:";for(let t=0;t<e.length;t++)Au.set(e.charCodeAt(t),Pt.CannotEndIn)}return Au}class s1{static _createLink(e,t,i,s,r){let o=r-1;do{const a=t.charCodeAt(o);if(e.get(a)!==Pt.CannotEndIn)break;o--}while(o>s);if(s>0){const a=t.charCodeAt(s-1),l=t.charCodeAt(o);(a===R.OpenParen&&l===R.CloseParen||a===R.OpenSquareBracket&&l===R.CloseSquareBracket||a===R.OpenCurlyBrace&&l===R.CloseCurlyBrace)&&o--}return{range:{startLineNumber:i,startColumn:s+1,endLineNumber:i,endColumn:o+2},url:t.substring(s,o+1)}}static computeLinks(e,t=zM()){const i=qM(),s=[];for(let r=1,o=e.getLineCount();r<=o;r++){const a=e.getLineContent(r),l=a.length;let c=0,u=0,d=0,f=Ee.Start,p=!1,_=!1,w=!1,v=!1;for(;c<l;){let E=!1;const S=a.charCodeAt(c);if(f===Ee.Accept){let A;switch(S){case R.OpenParen:p=!0,A=Pt.None;break;case R.CloseParen:A=p?Pt.None:Pt.ForceTermination;break;case R.OpenSquareBracket:w=!0,_=!0,A=Pt.None;break;case R.CloseSquareBracket:w=!1,A=_?Pt.None:Pt.ForceTermination;break;case R.OpenCurlyBrace:v=!0,A=Pt.None;break;case R.CloseCurlyBrace:A=v?Pt.None:Pt.ForceTermination;break;case R.SingleQuote:case R.DoubleQuote:case R.BackTick:d===S?A=Pt.ForceTermination:d===R.SingleQuote||d===R.DoubleQuote||d===R.BackTick?A=Pt.None:A=Pt.ForceTermination;break;case R.Asterisk:A=d===R.Asterisk?Pt.ForceTermination:Pt.None;break;case R.Pipe:A=d===R.Pipe?Pt.ForceTermination:Pt.None;break;case R.Space:A=w?Pt.None:Pt.ForceTermination;break;default:A=i.get(S)}A===Pt.ForceTermination&&(s.push(s1._createLink(i,a,r,u,c)),E=!0)}else if(f===Ee.End){let A;S===R.OpenSquareBracket?(_=!0,A=Pt.None):A=i.get(S),A===Pt.ForceTermination?E=!0:f=Ee.Accept}else f=t.nextState(f,S),f===Ee.Invalid&&(E=!0);E&&(f=Ee.Start,p=!1,_=!1,v=!1,u=c+1,d=S),c++}f===Ee.Accept&&s.push(s1._createLink(i,a,r,u,l))}return s}}class jM{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){const t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){const e=this._schemes.sort(),t=[];let i,s,r=Ee.LastKnownState,o=Ee.LastKnownState;for(const a of e){let l=i?iR(i,a):0;for(l===0?s=Ee.Start:s=o;l<a.length;l++)l+1===a.length?(r=o,o=Ee.BeforeColon):o+=1,t.push([s,a.toUpperCase().charCodeAt(l),o]),t.push([s,a.toLowerCase().charCodeAt(l),o]),s=o;i=a,o=r}t.push([Ee.BeforeColon,R.Colon,Ee.AfterColon]),t.push([Ee.AfterColon,R.Slash,Ee.End]),this._stateMachine=new h5(t)}}provideDocumentLinks(e){this._initStateMachine();const t=[],i=s1.computeLinks({getLineContent(s){return e.lineAt(s-1).text},getLineCount(){return e.lineCount}},this._stateMachine);for(const s of i){const r=Da.to(s);r.target&&t.push(r)}return t}}class r1{constructor(e,t){this._extHostLanguageFeatures=t,this._linkProvider=new jM,this._fsProvider=new Map,this._registeredSchemes=new Set,this._watches=new Map,this._handlePool=0,this._proxy=e.getProxy(ee.MainThreadFileSystem)}dispose(){this._linkProviderRegistration?.dispose()}registerFileSystemProvider(e,t,i,s={}){if(r1._validateFileSystemProvider(i),this._registeredSchemes.has(t))throw new Error(`a provider for the scheme '${t}' is already registered`);this._linkProviderRegistration||(this._linkProviderRegistration=this._extHostLanguageFeatures.registerDocumentLinkProvider(e,"*",this._linkProvider));const r=this._handlePool++;this._linkProvider.add(t),this._registeredSchemes.add(t),this._fsProvider.set(r,i);let o=ks.FileReadWrite;s.isCaseSensitive&&(o+=ks.PathCaseSensitive),s.isReadonly&&(o+=ks.Readonly),typeof i.copy=="function"&&(o+=ks.FileFolderCopy),typeof i.open=="function"&&typeof i.close=="function"&&typeof i.read=="function"&&typeof i.write=="function"&&($(e,"fsChunks"),o+=ks.FileOpenReadWriteClose);let a;s.isReadonly&&Fr(s.isReadonly)&&s.isReadonly.value!==""&&(a={value:s.isReadonly.value,isTrusted:s.isReadonly.isTrusted,supportThemeIcons:s.isReadonly.supportThemeIcons,supportHtml:s.isReadonly.supportHtml,baseUri:s.isReadonly.baseUri,uris:s.isReadonly.uris}),this._proxy.$registerFileSystemProvider(r,t,o,a).catch(c=>{console.error(`FAILED to register filesystem provider of ${e.identifier.value}-extension for the scheme ${t}`),console.error(c)});const l=i.onDidChangeFile(c=>{const u=[];for(const d of c){const{uri:f,type:p}=d;if(f.scheme!==t)continue;let _;switch(p){case dc.Changed:_=Qu.UPDATED;break;case dc.Created:_=Qu.ADDED;break;case dc.Deleted:_=Qu.DELETED;break;default:throw new Error("Unknown FileChangeType")}u.push({resource:f,type:_})}this._proxy.$onFileSystemChange(r,u)});return we(()=>{l.dispose(),this._linkProvider.delete(t),this._registeredSchemes.delete(t),this._fsProvider.delete(r),this._proxy.$unregisterProvider(r)})}static _validateFileSystemProvider(e){if(!e)throw new Error("MISSING provider");if(typeof e.watch!="function")throw new Error("Provider does NOT implement watch");if(typeof e.stat!="function")throw new Error("Provider does NOT implement stat");if(typeof e.readDirectory!="function")throw new Error("Provider does NOT implement readDirectory");if(typeof e.createDirectory!="function")throw new Error("Provider does NOT implement createDirectory");if(typeof e.readFile!="function")throw new Error("Provider does NOT implement readFile");if(typeof e.writeFile!="function")throw new Error("Provider does NOT implement writeFile");if(typeof e.delete!="function")throw new Error("Provider does NOT implement delete");if(typeof e.rename!="function")throw new Error("Provider does NOT implement rename")}static _asIStat(e){const{type:t,ctime:i,mtime:s,size:r,permissions:o}=e;return{type:t,ctime:i,mtime:s,size:r,permissions:o}}$stat(e,t){return Promise.resolve(this._getFsProvider(e).stat(x.revive(t))).then(i=>r1._asIStat(i))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(x.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(x.revive(t))).then(i=>ue.wrap(i))}$writeFile(e,t,i,s){return Promise.resolve(this._getFsProvider(e).writeFile(x.revive(t),i.buffer,s))}$delete(e,t,i){return Promise.resolve(this._getFsProvider(e).delete(x.revive(t),i))}$rename(e,t,i,s){return Promise.resolve(this._getFsProvider(e).rename(x.revive(t),x.revive(i),s))}$copy(e,t,i,s){const r=this._getFsProvider(e);if(!r.copy)throw new Error('FileSystemProvider does not implement "copy"');return Promise.resolve(r.copy(x.revive(t),x.revive(i),s))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(x.revive(t)))}$watch(e,t,i,s){const r=this._getFsProvider(e).watch(x.revive(i),s);this._watches.set(t,r)}$unwatch(e,t){const i=this._watches.get(t);i&&(i.dispose(),this._watches.delete(t))}$open(e,t,i){const s=this._getFsProvider(e);if(!s.open)throw new Error('FileSystemProvider does not implement "open"');return Promise.resolve(s.open(x.revive(t),i))}$close(e,t){const i=this._getFsProvider(e);if(!i.close)throw new Error('FileSystemProvider does not implement "close"');return Promise.resolve(i.close(t))}$read(e,t,i,s){const r=this._getFsProvider(e);if(!r.read)throw new Error('FileSystemProvider does not implement "read"');const o=ue.alloc(s);return Promise.resolve(r.read(t,i,o.buffer,0,s)).then(a=>o.slice(0,a))}$write(e,t,i,s){const r=this._getFsProvider(e);if(!r.write)throw new Error('FileSystemProvider does not implement "write"');return Promise.resolve(r.write(t,i,s.buffer,0,s.byteLength))}_getFsProvider(e){const t=this._fsProvider.get(e);if(!t){const i=new Error;throw i.name="ENOPRO",i.message="no provider",i}return t}}const N1=class N1 extends Se{constructor(e,t,i,s){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=i,this.options=s,this.watcherDisposables=this._register(new ao),this.requests=void 0,this.restartCounter=0}init(){const e=new xe;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(t=>this.onFileChanges(t))),e.add(this.watcher.onDidLogMessage(t=>this.onLogMessage(t))),e.add(this.watcher.onDidError(t=>this.onError(t.error,t.request)))}onError(e,t){this.canRestart(e,t)?this.restartCounter<N1.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${e}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${e}`):this.error(e)}canRestart(e,t){return!(!this.options.restartOnError||t||e.indexOf("No space left on device")!==-1||e.indexOf("EMFILE")!==-1)}restart(e){this.restartCounter++,this.init(),this.watch(e)}async watch(e){this.requests=e,await this.watcher?.watch(e)}async setVerboseLogging(e){this.verboseLogging=e,await this.watcher?.setVerboseLogging(e)}error(e){this.onLogMessage({type:"error",message:`[File Watcher (${this.options.type})] ${e}`})}trace(e){this.onLogMessage({type:"trace",message:`[File Watcher (${this.options.type})] ${e}`})}dispose(){return this.watcher=void 0,super.dispose()}};N1.MAX_RESTARTS=5;let QI=N1;function GM(n,e){return typeof e=="string"&&!e.startsWith(ra)&&!Dp(e)?{base:n,pattern:e}:e}class KM{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,i,s,r,o,a){this.session=Math.random(),this._onDidCreate=new N,this._onDidChange=new N,this._onDidDelete=new N,this._config=0,a.ignoreCreateEvents&&(this._config+=1),a.ignoreChangeEvents&&(this._config+=2),a.ignoreDeleteEvents&&(this._config+=4);const l=Uc(o),c=typeof o=="string",u=r(d=>{if(!(typeof d.session=="number"&&d.session!==this.session)){if(!a.ignoreCreateEvents)for(const f of d.created){const p=x.revive(f);l(p.fsPath)&&(!c||i.getWorkspaceFolder(p))&&this._onDidCreate.fire(p)}if(!a.ignoreChangeEvents)for(const f of d.changed){const p=x.revive(f);l(p.fsPath)&&(!c||i.getWorkspaceFolder(p))&&this._onDidChange.fire(p)}if(!a.ignoreDeleteEvents)for(const f of d.deleted){const p=x.revive(f);l(p.fsPath)&&(!c||i.getWorkspaceFolder(p))&&this._onDidDelete.fire(p)}}});this._disposable=je.from(this.ensureWatching(e,i,t,s,o,a,!1),this._onDidCreate,this._onDidChange,this._onDidDelete,u)}ensureWatching(e,t,i,s,r,o,a){const l=je.from();if(typeof r=="string"||o.ignoreChangeEvents&&o.ignoreCreateEvents&&o.ignoreDeleteEvents)return l;const c=e.getProxy(ee.MainThreadFileSystemEventService);let u=!1;(r.pattern.includes(ra)||r.pattern.includes(_w))&&(u=!0);const d=[];let f,p;if(a)(o.ignoreChangeEvents||o.ignoreCreateEvents||o.ignoreDeleteEvents)&&(p=Qr.UPDATED|Qr.ADDED|Qr.DELETED,o.ignoreChangeEvents&&(p&=~Qr.UPDATED),o.ignoreCreateEvents&&(p&=~Qr.ADDED),o.ignoreDeleteEvents&&(p&=~Qr.DELETED));else if(u&&d.length===0){const _=t.getWorkspaceFolder(x.revive(r.baseUri)),w=i.getConfiguration("files",_).get("watcherExclude");if(w)for(const v in w)v&&w[v]===!0&&d.push(v)}else if(!u){const _=t.getWorkspaceFolder(x.revive(r.baseUri));if(_){const w=i.getConfiguration("files",_).get("watcherExclude");if(w){for(const v in w)if(v&&w[v]===!0){const E=`${Wv(v,"/")}/${ra}`;f||(f=[]),f.push(GM(_.uri.fsPath,E))}}if(!f||f.length===0)return l}}return c.$watch(s.identifier.value,this.session,r.baseUri,{recursive:u,excludes:d,includes:f,filter:p},!!a),je.from({dispose:()=>c.$unwatch(this.session)})}dispose(){this._disposable.dispose()}get onDidCreate(){return this._onDidCreate.event}get onDidChange(){return this._onDidChange.event}get onDidDelete(){return this._onDidDelete.event}}class QM{get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}constructor(e){this._events=e,this._created=new gi(()=>this._events.created.map(x.revive)),this._changed=new gi(()=>this._events.changed.map(x.revive)),this._deleted=new gi(()=>this._events.deleted.map(x.revive)),this.session=this._events.session}}class JM{constructor(e,t,i){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=i,this._onFileSystemEvent=new N,this._onDidRenameFile=new N,this._onDidCreateFile=new N,this._onDidDeleteFile=new N,this._onWillRenameFile=new qu,this._onWillCreateFile=new qu,this._onWillDeleteFile=new qu,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,i,s,r){return new KM(this._mainContext,t,e,i,this._onFileSystemEvent.event,pi.from(s),r)}$onFileEvent(e){this._onFileSystemEvent.fire(new QM(e))}$onDidRunFileOperation(e,t){switch(e){case ys.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(i=>({oldUri:x.revive(i.source),newUri:x.revive(i.target)}))}));break;case ys.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(i=>x.revive(i.target))}));break;case ys.CREATE:case ys.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(i=>x.revive(i.target))}));break}}getOnWillRenameFileEvent(e){return this._createWillExecuteEvent(e,this._onWillRenameFile)}getOnWillCreateFileEvent(e){return this._createWillExecuteEvent(e,this._onWillCreateFile)}getOnWillDeleteFileEvent(e){return this._createWillExecuteEvent(e,this._onWillDeleteFile)}_createWillExecuteEvent(e,t){return(i,s,r)=>{const o=function(l){i.call(s,l)};return o.extension=e,t.event(o,void 0,r)}}async $onWillRunFileOperation(e,t,i,s){switch(e){case ys.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(r=>({oldUri:x.revive(r.source),newUri:x.revive(r.target)}))},i,s);case ys.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(r=>x.revive(r.target))},i,s);case ys.CREATE:case ys.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(r=>x.revive(r.target))},i,s)}}async _fireWillEvent(e,t,i,s){const r=new Set,o=[];if(await e.fireAsync(t,s,async(l,c)=>{const u=Date.now(),d=await Promise.resolve(l);d instanceof Ga&&(o.push([c.extension,d]),r.add(c.extension.displayName??c.extension.identifier.value)),Date.now()-u>i&&this._logService.warn("SLOW file-participant",c.extension.identifier)}),s.isCancellationRequested||o.length===0)return;const a={edits:[]};for(const[,l]of o){const{edits:c}=_i.from(l,{getTextDocumentVersion:u=>this._extHostDocumentsAndEditors.getDocument(u)?.version,getNotebookDocumentVersion:()=>{}});a.edits=a.edits.concat(c)}return{edit:a,extensionNames:Array.from(r)}}}class XM{constructor(e,t,i,s,r){this._extHostNotebooks=t,this._textDocumentsAndEditors=i,this._commands=s;const o=new Te("interactive.open","_interactive.open","Open interactive window and return notebook editor and input URI",[new j("showOptions","Show Options",a=>!0,a=>a),new j("resource","Interactive resource Uri",a=>!0,a=>a),new j("controllerId","Notebook controller Id",a=>!0,a=>a),new j("title","Interactive editor title",a=>!0,a=>a)],new ke("Notebook and input URI",a=>{if(r.debug("[ExtHostInteractive] open iw with notebook editor id",a.notebookEditorId),a.notebookEditorId!==void 0){const l=this._extHostNotebooks.getEditorById(a.notebookEditorId);return r.debug("[ExtHostInteractive] notebook editor found",l.id),{notebookUri:x.revive(a.notebookUri),inputUri:x.revive(a.inputUri),notebookEditor:l.apiEditor}}return r.debug("[ExtHostInteractive] notebook editor not found, uris for the interactive document",a.notebookUri,a.inputUri),{notebookUri:x.revive(a.notebookUri),inputUri:x.revive(a.inputUri)}}));this._commands.registerApiCommand(o)}$willAddInteractiveDocument(e,t,i,s){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[""],languageId:i,uri:e,isDirty:!1,versionId:1,encoding:"utf8"}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}}class YM{constructor(e){this._handlePool=0,this._proxy=e.getProxy(ee.MainThreadLabelService)}$registerResourceLabelFormatter(e){const t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),we(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}}var to;(function(n){n[n.LTR=0]="LTR",n[n.RTL=1]="RTL"})(to||(to={}));class yi extends et{constructor(e,t,i,s){super(e,t,i,s),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=i,this.positionColumn=s}toString(){return"["+this.selectionStartLineNumber+","+this.selectionStartColumn+" -> "+this.positionLineNumber+","+this.positionColumn+"]"}equalsSelection(e){return yi.selectionsEqual(this,e)}static selectionsEqual(e,t){return e.selectionStartLineNumber===t.selectionStartLineNumber&&e.selectionStartColumn===t.selectionStartColumn&&e.positionLineNumber===t.positionLineNumber&&e.positionColumn===t.positionColumn}getDirection(){return this.selectionStartLineNumber===this.startLineNumber&&this.selectionStartColumn===this.startColumn?to.LTR:to.RTL}setEndPosition(e,t){return this.getDirection()===to.LTR?new yi(this.startLineNumber,this.startColumn,e,t):new yi(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Ti(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Ti(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return this.getDirection()===to.LTR?new yi(e,t,this.endLineNumber,this.endColumn):new yi(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new yi(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return t===to.LTR?new yi(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new yi(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new yi(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn)}static selectionsArrEqual(e,t){if(e&&!t||!e&&t)return!1;if(!e&&!t)return!0;if(e.length!==t.length)return!1;for(let i=0,s=e.length;i<s;i++)if(!this.selectionsEqual(e[i],t[i]))return!1;return!0}static isISelection(e){return e&&typeof e.selectionStartLineNumber=="number"&&typeof e.selectionStartColumn=="number"&&typeof e.positionLineNumber=="number"&&typeof e.positionColumn=="number"}static createWithDirection(e,t,i,s,r){return r===to.LTR?new yi(e,t,i,s):new yi(i,s,e,t)}}class o1{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentSymbols(i,t);if(!_x(s))return s[0]instanceof Xd?s.map(Vb.from):o1._asDocumentSymbolTree(s)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((s,r)=>{let o=s.location.range.start.compareTo(r.location.range.start);return o===0&&(o=r.location.range.end.compareTo(s.location.range.end)),o});const t=[],i=[];for(const s of e){const r={name:s.name||"!!MISSING: name!!",kind:Hi.from(s.kind),tags:s.tags?.map(Or.from)||[],detail:"",containerName:s.containerName,range:z.from(s.location.range),selectionRange:z.from(s.location.range),children:[]};for(;;){if(i.length===0){i.push(r),t.push(r);break}const o=i[i.length-1];if(et.containsRange(o.range,r.range)&&!et.equalsRange(o.range,r.range)){o.children?.push(r),i.push(r);break}i.pop()}}return t}}class Nf{constructor(e,t,i,s,r,o){this._documents=e,this._commands=t,this._provider=i,this._extension=s,this._extTelemetry=r,this._logService=o,this._cache=new Oi("CodeLens"),this._disposables=new Map}async provideCodeLenses(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideCodeLenses(i,t);if(!s||t.isCancellationRequested)return;const r=this._cache.add(s),o=new xe;this._disposables.set(r,o);const a={cacheId:r,lenses:[]};for(let l=0;l<s.length;l++){if(!Me.isRange(s[l].range)){console.warn("INVALID code lens, range is not defined",this._extension.identifier.value);continue}a.lenses.push({cacheId:[r,l],range:z.from(s[l].range),command:this._commands.toInternal(s[l].command,o)})}return a}async resolveCodeLens(e,t){const i=e.cacheId&&this._cache.get(...e.cacheId);if(!i)return;let s;if(typeof this._provider.resolveCodeLens!="function"||i.isResolved?s=i:s=await this._provider.resolveCodeLens(i,t),s||(s=i),t.isCancellationRequested)return;const r=e.cacheId&&this._disposables.get(e.cacheId[0]);if(r){if(!s.command){const o=new Error("INVALID code lens resolved, lacks command: "+this._extension.identifier.value);this._extTelemetry.onExtensionError(this._extension.identifier,o),this._logService.error(o);return}return e.command=this._commands.toInternal(s.command,r),e}}releaseCodeLenses(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}}function I_(n){return Array.isArray(n)?n.map(Ch.from):n?[Ch.from(n)]:[]}class JI{constructor(e,t){this._documents=e,this._provider=t}async provideDefinition(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideDefinition(s,r,i);return I_(o)}}class XI{constructor(e,t){this._documents=e,this._provider=t}async provideDeclaration(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideDeclaration(s,r,i);return I_(o)}}class YI{constructor(e,t){this._documents=e,this._provider=t}async provideImplementation(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideImplementation(s,r,i);return I_(o)}}class ZI{constructor(e,t){this._documents=e,this._provider=t}async provideTypeDefinition(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideTypeDefinition(s,r,i);return I_(o)}}const O1=class O1{constructor(e,t){this._documents=e,this._provider=t,this._hoverCounter=0,this._hoverMap=new Map}async provideHover(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t);let a;if(i&&i.verbosityRequest){const d=i.verbosityRequest.previousHover.id,f=this._hoverMap.get(d);if(!f)throw new Error(`Hover with id ${d} not found`);const p={verbosityDelta:i.verbosityRequest.verbosityDelta,previousHover:f};a=await this._provider.provideHover(r,o,s,p)}else a=await this._provider.provideHover(r,o,s);if(!a||_x(a.contents))return;a.range||(a.range=r.getWordRangeAtPosition(o)),a.range||(a.range=new Me(o,o));const l=Th.from(a),c=this._hoverCounter;if(this._hoverMap.size===O1.HOVER_MAP_MAX_SIZE){const d=Math.min(...this._hoverMap.keys());this._hoverMap.delete(d)}return this._hoverMap.set(c,a),this._hoverCounter+=1,{...l,id:c}}releaseHover(e){this._hoverMap.delete(e)}};O1.HOVER_MAP_MAX_SIZE=10;let vd=O1;class e4{constructor(e,t){this._documents=e,this._provider=t}async provideEvaluatableExpression(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideEvaluatableExpression(s,r,i);if(o)return jb.from(o)}}class t4{constructor(e,t){this._documents=e,this._provider=t}async provideInlineValues(e,t,i,s){const r=this._documents.getDocument(e),o=await this._provider.provideInlineValues(r,z.to(t),fm.to(i),s);if(Array.isArray(o))return o.map(a=>hm.from(a))}}class n4{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideDocumentHighlights(s,r,i);if(Array.isArray(o))return o.map(Yc.from)}}class i4{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideMultiDocumentHighlights(e,t,i,s){const r=this._documents.getDocument(e),o=i.map(c=>{try{return this._documents.getDocument(c)}catch(u){this._logService.error("Error: Unable to retrieve document from URI: "+c+". Error message: "+u);return}}).filter(c=>c!==void 0),a=ot.to(t),l=await this._provider.provideMultiDocumentHighlights(r,a,o,s);if(Array.isArray(l))return l.map(Gb.from)}}class s4{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.provideLinkedEditingRanges(s,r,i);if(o&&Array.isArray(o.ranges))return{ranges:rn(o.ranges.map(z.from)),wordPattern:o.wordPattern}}}class r4{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=await this._provider.provideReferences(r,o,i,s);if(Array.isArray(a))return a.map(oi.from)}}const Yl=class Yl{constructor(e,t,i,s,r,o,a){this._documents=e,this._commands=t,this._diagnostics=i,this._provider=s,this._logService=r,this._extension=o,this._apiDeprecation=a,this._cache=new Oi("CodeAction"),this._disposables=new Map}async provideCodeActions(e,t,i,s){const r=this._documents.getDocument(e),o=yi.isISelection(t)?hs.to(t):z.to(t),a=[];for(const p of this._diagnostics.getDiagnostics(e))if(o.intersection(p.range)&&a.push(p)>Yl._maxCodeActionsPerFile)break;const l={diagnostics:a,only:i.only?new At(i.only):void 0,triggerKind:oy.to(i.trigger)},c=await this._provider.provideCodeActions(r,o,l,s);if(!Kh(c)||s.isCancellationRequested)return;const u=this._cache.add(c),d=new xe;this._disposables.set(u,d);const f=[];for(let p=0;p<c.length;p++){const _=c[p];if(_)if(Yl._isCommand(_)&&!(_ instanceof Zd))this._apiDeprecation.report("CodeActionProvider.provideCodeActions - return commands",this._extension,"Return 'CodeAction' instances instead."),f.push({_isSynthetic:!0,title:_.title,command:this._commands.toInternal(_,d)});else{const w=_;l.only&&(w.kind?l.only.contains(w.kind)||this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${l.only.value}' requested but returned code action is of kind '${w.kind.value}'. Code action will be dropped. Please check 'CodeActionContext.only' to only return requested code actions.`):this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${l.only.value}' requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.`));const v=w.ranges??[];f.push({cacheId:[u,p],title:w.title,command:w.command&&this._commands.toInternal(w.command,d),diagnostics:w.diagnostics&&w.diagnostics.map(Jc.from),edit:w.edit&&_i.from(w.edit,void 0),kind:w.kind&&w.kind.value,isPreferred:w.isPreferred,isAI:dt(this._extension,"codeActionAI")?w.isAI:!1,ranges:dt(this._extension,"codeActionRanges")?rn(v.map(z.from)):void 0,disabled:w.disabled?.reason})}}return{cacheId:u,actions:f}}async resolveCodeAction(e,t){const[i,s]=e,r=this._cache.get(i,s);if(!r||Yl._isCommand(r))return{};if(!this._provider.resolveCodeAction)return{};const o=await this._provider.resolveCodeAction(r,t)??r;let a;o.edit&&(a=_i.from(o.edit,void 0));let l;if(o.command){const c=this._disposables.get(i);c&&(l=this._commands.toInternal(o.command,c))}return{edit:a,command:l}}releaseCodeActions(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}static _isCommand(e){return typeof e.command=="string"&&typeof e.title=="string"}};Yl._maxCodeActionsPerFile=1e3;let Bl=Yl;class Ru{constructor(e,t,i,s,r){this._proxy=e,this._documents=t,this._provider=i,this._handle=s,this._extension=r,this._editsCache=new Oi("DocumentPasteEdit.edits")}async prepareDocumentPaste(e,t,i,s){if(!this._provider.prepareDocumentPaste)return;this._cachedPrepare=void 0;const r=this._documents.getDocument(e),o=t.map(d=>z.to(d)),a=ou.toDataTransfer(i,()=>{throw new E5});if(await this._provider.prepareDocumentPaste(r,o,a,s),s.isCancellationRequested)return;const l=Array.from(a).filter(([,d])=>!(d instanceof Bg)),c=new Map,u=await Promise.all(Array.from(l,async([d,f])=>{const p=Sn();return c.set(p,f),[d,await Ca.from(d,f,p)]}));return this._cachedPrepare=c,{items:u}}async providePasteEdits(e,t,i,s,r,o){if(!this._provider.provideDocumentPasteEdits)return[];const a=this._documents.getDocument(t),l=i.map(p=>z.to(p)),c=s.items.map(([p,_])=>{const w=this._cachedPrepare?.get(_.id);return w?[p,w]:[p,Ca.to(p,_,async v=>(await this._proxy.$resolvePasteFileData(this._handle,e,v)).buffer)]}),u=new qc(c),d=await this._provider.provideDocumentPasteEdits(a,l,u,{only:r.only?new js(r.only):void 0,triggerKind:r.triggerKind},o);if(!d||o.isCancellationRequested)return[];const f=this._editsCache.add(d);return d.map((p,_)=>({_cacheId:[f,_],title:p.title??h(2582,"Paste using '{0}' extension",this._extension.displayName||this._extension.name),kind:p.kind,yieldTo:p.yieldTo?.map(w=>w.value),insertText:typeof p.insertText=="string"?p.insertText:{snippet:p.insertText.value},additionalEdit:p.additionalEdit?_i.from(p.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){const[i,s]=e,r=this._editsCache.get(i,s);if(!r||!this._provider.resolveDocumentPasteEdit)return{};const o=await this._provider.resolveDocumentPasteEdit(r,t)??r;return{insertText:o.insertText,additionalEdit:o.additionalEdit?_i.from(o.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._editsCache.delete(e)}}class o4{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideDocumentFormattingEdits(s,t,i);if(Array.isArray(r))return r.map(pn.from)}}class _v{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,i,s){const r=this._documents.getDocument(e),o=z.to(t),a=await this._provider.provideDocumentRangeFormattingEdits(r,o,i,s);if(Array.isArray(a))return a.map(pn.from)}async provideDocumentRangesFormattingEdits(e,t,i,s){q4(typeof this._provider.provideDocumentRangesFormattingEdits=="function","INVALID invocation of `provideDocumentRangesFormattingEdits`");const r=this._documents.getDocument(e),o=t.map(z.to),a=await this._provider.provideDocumentRangesFormattingEdits(r,o,i,s);if(Array.isArray(a))return a.map(pn.from)}}class a4{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,i,s,r){const o=this._documents.getDocument(e),a=ot.to(t),l=await this._provider.provideOnTypeFormattingEdits(o,a,i,s,r);if(Array.isArray(l))return l.map(pn.from)}}class Of{constructor(e,t){this._provider=e,this._logService=t,this._cache=new Oi("WorkspaceSymbols")}async provideWorkspaceSymbols(e,t){const i=await this._provider.provideWorkspaceSymbols(e,t);if(!Kh(i))return{symbols:[]};const s=this._cache.add(i),r={cacheId:s,symbols:[]};for(let o=0;o<i.length;o++){const a=i[o];if(!a||!a.name){this._logService.warn("INVALID SymbolInformation",a);continue}r.symbols.push({...Ya.from(a),cacheId:[s,o]})}return r}async resolveWorkspaceSymbol(e,t){if(typeof this._provider.resolveWorkspaceSymbol!="function"||!e.cacheId)return e;const i=this._cache.get(...e.cacheId);if(i){const s=await this._provider.resolveWorkspaceSymbol(i,t);return s&&qa(e,Ya.from(s),!0)}}releaseWorkspaceSymbols(e){this._cache.delete(e)}}class pa{static supportsResolving(e){return typeof e.prepareRename=="function"}constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideRenameEdits(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t);try{const a=await this._provider.provideRenameEdits(r,o,i,s);return a?_i.from(a):void 0}catch(a){const l=pa._asMessage(a);return l?{rejectReason:l,edits:void 0}:Promise.reject(a)}}async resolveRenameLocation(e,t,i){if(typeof this._provider.prepareRename!="function")return Promise.resolve(void 0);const s=this._documents.getDocument(e),r=ot.to(t);try{const o=await this._provider.prepareRename(s,r,i);let a,l;if(Me.isRange(o)?(a=o,l=s.getText(o)):nn(o)&&(a=o.range,l=o.placeholder),!a||!l)return;if(a.start.line>r.line||a.end.line<r.line){this._logService.warn("INVALID rename location: position line must be within range start/end lines");return}return{range:z.from(a),text:l}}catch(o){const a=pa._asMessage(o);return a?{rejectReason:a,range:void 0,text:void 0}:Promise.reject(o)}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}}const Id=class Id{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async supportsAutomaticNewSymbolNamesTriggerKind(){return this._provider.supportsAutomaticTriggerKind}async provideNewSymbolNames(e,t,i,s){const r=this._documents.getDocument(e),o=z.to(t);try{const a=Id.languageTriggerKindToVSCodeTriggerKind[i],l=await this._provider.provideNewSymbolNames(r,o,a,s);return l?l.map(c=>typeof c=="string"?{newSymbolName:c}:{newSymbolName:c.newSymbolName,tags:c.tags}):void 0}catch(a){this._logService.error(Id._asMessage(a)??JSON.stringify(a,null," "));return}}static _asMessage(e){return typeof e=="string"?e:e instanceof Error&&typeof e.message=="string"?e.message:void 0}};Id.languageTriggerKindToVSCodeTriggerKind={[Kp.Invoke]:uh.Invoke,[Kp.Automatic]:uh.Automatic};let wd=Id;class vv{constructor(e,t){this.resultId=e,this.tokens=t}}class di{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(e,t,i){const s=this._documents.getDocument(e),r=t!==0?this._previousResults.get(t):null;let o=typeof r?.resultId=="string"&&typeof this._provider.provideDocumentSemanticTokensEdits=="function"?await this._provider.provideDocumentSemanticTokensEdits(s,r.resultId,i):await this._provider.provideDocumentSemanticTokens(s,i);return r&&this._previousResults.delete(t),o?(o=di._fixProvidedSemanticTokens(o),this._send(di._convertToEdits(r,o),o)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(e){return di._isSemanticTokens(e)?di._isCorrectSemanticTokens(e)?e:new Gc(new Uint32Array(e.data),e.resultId):di._isSemanticTokensEdits(e)?di._isCorrectSemanticTokensEdits(e)?e:new sp(e.edits.map(t=>new GT(t.start,t.deleteCount,t.data?new Uint32Array(t.data):t.data)),e.resultId):e}static _isSemanticTokens(e){return e&&!!e.data}static _isCorrectSemanticTokens(e){return e.data instanceof Uint32Array}static _isSemanticTokensEdits(e){return e&&Array.isArray(e.edits)}static _isCorrectSemanticTokensEdits(e){for(const t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(e,t){if(!di._isSemanticTokens(t)||!e||!e.tokens)return t;const i=e.tokens,s=i.length,r=t.data,o=r.length;let a=0;const l=Math.min(s,o);for(;a<l&&i[a]===r[a];)a++;if(a===s&&a===o)return new sp([],t.resultId);let c=0;const u=l-a;for(;c<u&&i[s-c-1]===r[o-c-1];)c++;return new sp([{start:a,deleteCount:s-a-c,data:r.subarray(a,o-c)}],t.resultId)}_send(e,t){if(di._isSemanticTokens(e)){const i=this._nextResultId++;return this._previousResults.set(i,new vv(e.resultId,e.data)),A0({id:i,type:"full",data:e.data})}if(di._isSemanticTokensEdits(e)){const i=this._nextResultId++;return di._isSemanticTokens(t)?this._previousResults.set(i,new vv(t.resultId,t.data)):this._previousResults.set(i,new vv(e.resultId)),A0({id:i,type:"delta",deltas:(e.edits||[]).map(s=>({start:s.start,deleteCount:s.deleteCount,data:s.data}))})}return null}}class l4{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideDocumentRangeSemanticTokens(s,z.to(t),i);return r?this._send(r):null}_send(e){return A0({id:0,type:"full",data:e.data})}}class Go{static supportsResolving(e){return typeof e.resolveCompletionItem=="function"}constructor(e,t,i,s,r){this._documents=e,this._commands=t,this._provider=i,this._apiDeprecation=s,this._extension=r,this._cache=new Oi("CompletionItem"),this._disposables=new Map}async provideCompletionItems(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=r.getWordRangeAtPosition(o)||new Me(o,o),l=a.with({end:o}),c=new Rr,u=await this._provider.provideCompletionItems(r,o,s,Qb.to(i));if(!u||s.isCancellationRequested)return;const d=Array.isArray(u)?new Hc(u):u,f=Go.supportsResolving(this._provider)?this._cache.add(d.items):this._cache.add([]),p=new xe;this._disposables.set(f,p);const _=[],w={x:f,[Cl.completions]:_,[Cl.defaultRanges]:{replace:z.from(a),insert:z.from(l)},[Cl.isIncomplete]:d.isIncomplete||void 0,[Cl.duration]:c.elapsed()};for(let v=0;v<d.items.length;v++){const E=d.items[v],S=this._convertCompletionItem(E,[f,v],l,a);_.push(S)}return w}async resolveCompletionItem(e,t){if(typeof this._provider.resolveCompletionItem!="function")return;const i=this._cache.get(...e);if(!i)return;const s=this._convertCompletionItem(i,e),r=await this._provider.resolveCompletionItem(i,t);if(!r)return;const o=this._convertCompletionItem(r,e);return(s[Ue.insertText]!==o[Ue.insertText]||s[Ue.insertTextRules]!==o[Ue.insertTextRules])&&this._apiDeprecation.report("CompletionItem.insertText",this._extension,"extension MAY NOT change 'insertText' of a CompletionItem during resolve"),(s[Ue.commandIdent]!==o[Ue.commandIdent]||s[Ue.commandId]!==o[Ue.commandId]||!Gn(s[Ue.commandArguments],o[Ue.commandArguments]))&&this._apiDeprecation.report("CompletionItem.command",this._extension,"extension MAY NOT change 'command' of a CompletionItem during resolve"),{...s,[Ue.documentation]:o[Ue.documentation],[Ue.detail]:o[Ue.detail],[Ue.additionalTextEdits]:o[Ue.additionalTextEdits],[Ue.insertText]:o[Ue.insertText],[Ue.insertTextRules]:o[Ue.insertTextRules],[Ue.commandIdent]:o[Ue.commandIdent],[Ue.commandId]:o[Ue.commandId],[Ue.commandArguments]:o[Ue.commandArguments]}}releaseCompletionItems(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_convertCompletionItem(e,t,i,s){const r=this._disposables.get(t[0]);if(!r)throw Error("DisposableStore is missing...");const o=this._commands.toInternal(e.command,r),a={x:t,[Ue.label]:e.label,[Ue.kind]:e.kind!==void 0?gm.from(e.kind):void 0,[Ue.kindModifier]:e.tags&&e.tags.map(pm.from),[Ue.detail]:e.detail,[Ue.documentation]:typeof e.documentation>"u"?void 0:Re.fromStrict(e.documentation),[Ue.sortText]:e.sortText!==e.label?e.sortText:void 0,[Ue.filterText]:e.filterText!==e.label?e.filterText:void 0,[Ue.preselect]:e.preselect||void 0,[Ue.insertTextRules]:e.keepWhitespace?ba.KeepWhitespace:ba.None,[Ue.commitCharacters]:e.commitCharacters?.join(""),[Ue.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(pn.from),[Ue.commandIdent]:o?.$ident,[Ue.commandId]:o?.id,[Ue.commandArguments]:o?.$ident?void 0:o?.arguments};e.textEdit?(this._apiDeprecation.report("CompletionItem.textEdit",this._extension,"Use 'CompletionItem.insertText' and 'CompletionItem.range' instead."),a[Ue.insertText]=e.textEdit.newText):typeof e.insertText=="string"?a[Ue.insertText]=e.insertText:e.insertText instanceof Ka&&(a[Ue.insertText]=e.insertText.value,a[Ue.insertTextRules]|=ba.InsertAsSnippet);let l;return e.textEdit?l=e.textEdit.range:e.range&&(l=e.range),Me.isRange(l)?a[Ue.range]=z.from(l):l&&(!i?.isEqual(l.inserting)||!s?.isEqual(l.replacing))&&(a[Ue.range]={insert:z.from(l.inserting),replace:z.from(l.replacing)}),a}}class Gr{constructor(e,t,i,s){this._extension=e,this._documents=t,this._provider=i,this._commands=s,this._references=new f5,this.languageTriggerKindToVSCodeTriggerKind={[zp.Automatic]:ch.Automatic,[zp.Explicit]:ch.Invoke},this._isAdditionsProposedApiEnabled=dt(this._extension,"inlineCompletionsAdditions")}get supportsHandleEvents(){return dt(this._extension,"inlineCompletionsAdditions")&&(typeof this._provider.handleDidShowCompletionItem=="function"||typeof this._provider.handleDidPartiallyAcceptCompletionItem=="function"||typeof this._provider.handleDidRejectCompletionItem=="function"||typeof this._provider.handleEndOfLifetime=="function")}async provideInlineCompletions(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=await this._provider.provideInlineCompletionItems(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:z.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind],requestUuid:i.requestUuid},s);if(!a||s.isCancellationRequested)return;const l=Array.isArray(a)?a:a.items,c=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],u=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let d;return{pid:this._references.createReferenceId({dispose(){d?.dispose()},items:l}),items:l.map((p,_)=>{let w;p.command&&(d||(d=new xe),w=this._commands.toInternal(p.command,d));let v;p.action&&(d||(d=new xe),v=this._commands.toInternal(p.action,d));const E=p.insertText;return{insertText:typeof E=="string"?E:{snippet:E.value},filterText:p.filterText,range:p.range?z.from(p.range):void 0,showRange:this._isAdditionsProposedApiEnabled&&p.showRange?z.from(p.showRange):void 0,command:w,action:v,idx:_,completeBracketPairs:this._isAdditionsProposedApiEnabled?p.completeBracketPairs:!1,isInlineEdit:this._isAdditionsProposedApiEnabled?p.isInlineEdit:!1,showInlineEditMenu:this._isAdditionsProposedApiEnabled?p.showInlineEditMenu:!1,displayLocation:p.displayLocation&&this._isAdditionsProposedApiEnabled?{range:z.from(p.displayLocation.range),label:p.displayLocation.label}:void 0,warning:p.warning&&this._isAdditionsProposedApiEnabled?{message:Re.from(p.warning.message),icon:p.warning.icon?wy.fromThemeIcon(p.warning.icon):void 0}:void 0}}),commands:c.map(p=>(d||(d=new xe),this._commands.toInternal(p,d))),suppressSuggestions:!1,enableForwardStability:u}}async provideInlineEditsForRange(e,t,i,s){if(!this._provider.provideInlineEditsForRange)return;$(this._extension,"inlineCompletionsAdditions");const r=this._documents.getDocument(e),o=z.to(t),a=await this._provider.provideInlineEditsForRange(r,o,{selectedCompletionInfo:i.selectedSuggestionInfo?{range:z.to(i.selectedSuggestionInfo.range),text:i.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[i.triggerKind],userPrompt:i.userPrompt,requestUuid:i.requestUuid},s);if(!a||s.isCancellationRequested)return;const l=Array.isArray(a)?a:a.items,c=this._isAdditionsProposedApiEnabled?Array.isArray(a)?[]:a.commands||[]:[],u=this._isAdditionsProposedApiEnabled&&!Array.isArray(a)?a.enableForwardStability:void 0;let d;return{pid:this._references.createReferenceId({dispose(){d?.dispose()},items:l}),items:l.map((p,_)=>{let w;p.command&&(d||(d=new xe),w=this._commands.toInternal(p.command,d));let v;p.action&&(d||(d=new xe),v=this._commands.toInternal(p.action,d));const E=p.insertText;return{insertText:typeof E=="string"?E:{snippet:E.value},filterText:p.filterText,range:p.range?z.from(p.range):void 0,command:w,action:v,idx:_,completeBracketPairs:this._isAdditionsProposedApiEnabled?p.completeBracketPairs:!1}}),commands:c.map(p=>(d||(d=new xe),this._commands.toInternal(p,d))),suppressSuggestions:!1,enableForwardStability:u}}disposeCompletions(e){this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,i){const s=this._references.get(e)?.items[t];s&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(s,i)}handlePartialAccept(e,t,i,s){const r=this._references.get(e)?.items[t];r&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(r,i),this._provider.handleDidPartiallyAcceptCompletionItem(r,gy.to(s)))}handleEndOfLifetime(e,t,i){const s=this._references.get(e)?.items[t];if(s&&this._provider.handleEndOfLifetime&&this._isAdditionsProposedApiEnabled){const r=_y.to(i,o=>this._references.get(o.pid)?.items[o.idx]);this._provider.handleEndOfLifetime(s,r)}}handleRejection(e,t){const i=this._references.get(e)?.items[t];i&&this._provider.handleDidRejectCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidRejectCompletionItem(i)}}class wv{async provideInlineEdits(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideInlineEdit(s,{triggerKind:this.languageTriggerKindToVSCodeTriggerKind[t.triggerKind],requestUuid:t.requestUuid},i);if(!r||i.isCancellationRequested)return;let o;const a=this._references.createReferenceId({dispose(){o?.dispose()},item:r});let l;r.accepted&&(o||(o=new xe),l=this._commands.toInternal(r.accepted,o));let c;r.rejected&&(o||(o=new xe),c=this._commands.toInternal(r.rejected,o));let u;r.shown&&(o||(o=new xe),u=this._commands.toInternal(r.shown,o));let d;return r.action&&(o||(o=new xe),d=this._commands.toInternal(r.action,o)),o||(o=new xe),{pid:a,text:r.text,range:z.from(r.range),showRange:z.from(r.showRange),accepted:l,rejected:c,shown:u,action:d,commands:r.commands?.map(p=>this._commands.toInternal(p,o))}}disposeEdit(e){this._references.disposeReferenceId(e)?.dispose()}constructor(e,t,i,s){this._documents=t,this._provider=i,this._commands=s,this._references=new f5,this.languageTriggerKindToVSCodeTriggerKind={[Qp.Automatic]:kh.Automatic,[Qp.Invoke]:kh.Invoke}}}class f5{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){const t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){const t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}}class bv{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Oi("SignatureHelp")}async provideSignatureHelp(e,t,i,s){const r=this._documents.getDocument(e),o=ot.to(t),a=this.reviveContext(i),l=await this._provider.provideSignatureHelp(r,o,s,a);if(l){const c=this._cache.add([l]);return{...Ph.from(l),id:c}}}reviveContext(e){let t;if(e.activeSignatureHelp){const i=Ph.to(e.activeSignatureHelp),s=this._cache.get(e.activeSignatureHelp.id,0);s?(t=s,t.activeSignature=i.activeSignature,t.activeParameter=i.activeParameter):t=i}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}}class Ff{constructor(e,t,i,s,r){this._documents=e,this._commands=t,this._provider=i,this._logService=s,this._extension=r,this._cache=new Oi("InlayHints"),this._disposables=new Map}async provideInlayHints(e,t,i){const s=this._documents.getDocument(e),r=z.to(t),o=await this._provider.provideInlayHints(s,r,i);if(!Array.isArray(o)||o.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(i.isCancellationRequested)return;const a=this._cache.add(o);this._disposables.set(a,new xe);const l={hints:[],cacheId:a};for(let c=0;c<o.length;c++)this._isValidInlayHint(o[c],r)&&l.hints.push(this._convertInlayHint(o[c],[a,c]));return this._logService.trace(`[InlayHints] ${l.hints.length} inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`),l}async resolveInlayHint(e,t){if(typeof this._provider.resolveInlayHint!="function")return;const i=this._cache.get(...e);if(!i)return;const s=await this._provider.resolveInlayHint(i,t);if(s&&this._isValidInlayHint(s))return this._convertInlayHint(s,e)}releaseHints(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_isValidInlayHint(e,t){return e.label.length===0||Array.isArray(e.label)&&e.label.every(i=>i.value.length===0)?(console.log("INVALID inlay hint, empty label",e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){const i=this._disposables.get(t[0]);if(!i)throw Error("DisposableStore is missing...");const s={label:"",cacheId:t,tooltip:Re.fromStrict(e.tooltip),position:ot.from(e.position),textEdits:e.textEdits&&e.textEdits.map(pn.from),kind:e.kind&&vm.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label=="string")s.label=e.label;else{const r=[];s.label=r;for(const o of e.label){if(!o.value){console.warn("INVALID inlay hint, empty label part",this._extension.identifier.value);continue}const a={label:o.value,tooltip:Re.fromStrict(o.tooltip)};Ni.isLocation(o.location)&&(a.location=oi.from(o.location)),o.command&&(a.command=this._commands.toInternal(o.command,i)),r.push(a)}}return s}}class mo{constructor(e,t){this._documents=e,this._provider=t,this._cache=new Oi("DocumentLink")}async provideLinks(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentLinks(i,t);if(!(!Array.isArray(s)||s.length===0)&&!t.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!="function")return{links:s.filter(mo._validateLink).map(Da.from)};{const r=this._cache.add(s),o={links:[],cacheId:r};for(let a=0;a<s.length;a++){if(!mo._validateLink(s[a]))continue;const l=Da.from(s[a]);l.cacheId=[r,a],o.links.push(l)}return o}}}static _validateLink(e){return e.target&&e.target.path.length>5e4?(console.warn("DROPPING link because it is too long"),!1):!0}async resolveLink(e,t){if(typeof this._provider.resolveDocumentLink!="function")return;const i=this._cache.get(...e);if(!i)return;const s=await this._provider.resolveDocumentLink(i,t);if(!(!s||!mo._validateLink(s)))return Da.from(s)}releaseLinks(e){this._cache.delete(e)}}class yv{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){const i=this._documents.getDocument(e),s=await this._provider.provideDocumentColors(i,t);return Array.isArray(s)?s.map(o=>({color:Zc.from(o.color),range:z.from(o.range)})):[]}async provideColorPresentations(e,t,i){const s=this._documents.getDocument(e),r=z.to(t.range),o=Zc.to(t.color),a=await this._provider.provideColorPresentations(o,{document:s,range:r},i);if(Array.isArray(a))return a.map(wm.from)}}class c4{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,i){const s=this._documents.getDocument(e),r=await this._provider.provideFoldingRanges(s,t,i);if(Array.isArray(r))return r.map(xm.from)}}class u4{constructor(e,t,i){this._documents=e,this._provider=t,this._logService=i}async provideSelectionRanges(e,t,i){const s=this._documents.getDocument(e),r=t.map(ot.to),o=await this._provider.provideSelectionRanges(s,r,i);if(!Kh(o))return[];if(o.length!==r.length)return this._logService.warn("BAD selection ranges, provider must return ranges for each position"),[];const a=[];for(let l=0;l<r.length;l++){const c=[];a.push(c);let u=r[l],d=o[l];for(;;){if(!d.range.contains(u))throw new Error("INVALID selection range, must contain the previous range");if(c.push(Zb.from(d)),!d.parent)break;u=d.range,d=d.parent}}return a}}class Lu{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new xE(""),this._cache=new Map}async prepareSession(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.prepareCallHierarchy(s,r,i);if(!o)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(o)?o.map(l=>this._cacheAndConvertItem(a,l)):[this._cacheAndConvertItem(a,o)]}async provideCallsTo(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyIncomingCalls(s,i);if(r)return r.map(o=>({from:this._cacheAndConvertItem(e,o.from),fromRanges:o.fromRanges.map(a=>z.from(a))}))}async provideCallsFrom(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing call hierarchy item");const r=await this._provider.provideCallHierarchyOutgoingCalls(s,i);if(r)return r.map(o=>({to:this._cacheAndConvertItem(e,o.to),fromRanges:o.fromRanges.map(a=>z.from(a))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=Za.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class Nu{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new xE(""),this._cache=new Map}async prepareSession(e,t,i){const s=this._documents.getDocument(e),r=ot.to(t),o=await this._provider.prepareTypeHierarchy(s,r,i);if(!o)return;const a=this._idPool.nextId();return this._cache.set(a,new Map),Array.isArray(o)?o.map(l=>this._cacheAndConvertItem(a,l)):[this._cacheAndConvertItem(a,o)]}async provideSupertypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySupertypes(s,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}async provideSubtypes(e,t,i){const s=this._itemFromCache(e,t);if(!s)throw new Error("missing type hierarchy item");const r=await this._provider.provideTypeHierarchySubtypes(s,i);if(r)return r.map(o=>this._cacheAndConvertItem(e,o))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){const i=this._cache.get(e),s=Ia.from(t,e,i.size.toString(36));return i.set(s._itemId,t),s}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}}class Mf{constructor(e,t,i,s,r){this._proxy=e,this._documents=t,this._provider=i,this._handle=s,this._extension=r,this._cache=new Oi("DocumentDropEdit")}async provideDocumentOnDropEdits(e,t,i,s,r){const o=this._documents.getDocument(t),a=ot.to(i),l=ou.toDataTransfer(s,async f=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,f)).buffer),c=await this._provider.provideDocumentDropEdits(o,a,l,r);if(!c)return;const u=Ri(c),d=this._cache.add(u);return u.map((f,p)=>({_cacheId:[d,p],title:f.title??h(2583,"Drop using '{0}' extension",this._extension.displayName||this._extension.name),kind:f.kind?.value,yieldTo:f.yieldTo?.map(_=>_.value),insertText:typeof f.insertText=="string"?f.insertText:{snippet:f.insertText.value},additionalEdit:f.additionalEdit?_i.from(f.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){const[i,s]=e,r=this._cache.get(i,s);if(!r||!this._provider.resolveDocumentDropEdit)return{};const o=await this._provider.resolveDocumentDropEdit(r,t)??r;return{additionalEdit:o.additionalEdit?_i.from(o.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}}class Ou{constructor(e,t){this.adapter=e,this.extension=t}}const Xt=class Xt{constructor(e,t,i,s,r,o,a,l){this._uriTransformer=t,this._documents=i,this._commands=s,this._diagnostics=r,this._logService=o,this._apiDeprecation=a,this._extensionTelemetry=l,this._adapter=new Map,this._proxy=e.getProxy(ee.MainThreadLanguageFeatures)}_transformDocumentSelector(e,t){return Qc.from(e,this._uriTransformer,t)}_createDisposable(e){return new je(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return Xt._handlePool++}async _withAdapter(e,t,i,s,r,o=!1){const a=this._adapter.get(e);if(!a||!(a.adapter instanceof t))return s;const l=Date.now();o||this._logService.trace(`[${a.extension.identifier.value}] INVOKE provider '${i.toString().replace(/[\r\n]/g,"")}'`);const c=i(a.adapter,a.extension);return Promise.resolve(c).catch(u=>{Vs(u)||(this._logService.error(`[${a.extension.identifier.value}] provider FAILED`),this._logService.error(u),this._extensionTelemetry.onExtensionError(a.extension.identifier,u))}).finally(()=>{o||this._logService.trace(`[${a.extension.identifier.value}] provider DONE after ${Date.now()-l}ms`)}),yt.isCancellationToken(r)?Cx(c,r):c}_addNewAdapter(e,t){const i=this._nextHandle();return this._adapter.set(i,new Ou(e,t)),i}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(e,t,i,s){const r=this._addNewAdapter(new o1(this._documents,i),e),o=s&&s.label||Xt._extLabel(e);return this._proxy.$registerDocumentSymbolProvider(r,this._transformDocumentSelector(t,e),o),this._createDisposable(r)}$provideDocumentSymbols(e,t,i){return this._withAdapter(e,o1,s=>s.provideDocumentSymbols(x.revive(t),i),void 0,i)}registerCodeLensProvider(e,t,i){const s=this._nextHandle(),r=typeof i.onDidChangeCodeLenses=="function"?this._nextHandle():void 0;this._adapter.set(s,new Ou(new Nf(this._documents,this._commands.converter,i,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(s,this._transformDocumentSelector(t,e),r);let o=this._createDisposable(s);if(r!==void 0){const a=i.onDidChangeCodeLenses(l=>this._proxy.$emitCodeLensEvent(r));o=je.from(o,a)}return o}$provideCodeLenses(e,t,i){return this._withAdapter(e,Nf,s=>s.provideCodeLenses(x.revive(t),i),void 0,i,t.scheme==="output")}$resolveCodeLens(e,t,i){return this._withAdapter(e,Nf,s=>s.resolveCodeLens(t,i),void 0,void 0,!0)}$releaseCodeLenses(e,t){this._withAdapter(e,Nf,i=>Promise.resolve(i.releaseCodeLenses(t)),void 0,void 0,!0)}registerDefinitionProvider(e,t,i){const s=this._addNewAdapter(new JI(this._documents,i),e);return this._proxy.$registerDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDefinition(e,t,i,s){return this._withAdapter(e,JI,r=>r.provideDefinition(x.revive(t),i,s),[],s)}registerDeclarationProvider(e,t,i){const s=this._addNewAdapter(new XI(this._documents,i),e);return this._proxy.$registerDeclarationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDeclaration(e,t,i,s){return this._withAdapter(e,XI,r=>r.provideDeclaration(x.revive(t),i,s),[],s)}registerImplementationProvider(e,t,i){const s=this._addNewAdapter(new YI(this._documents,i),e);return this._proxy.$registerImplementationSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideImplementation(e,t,i,s){return this._withAdapter(e,YI,r=>r.provideImplementation(x.revive(t),i,s),[],s)}registerTypeDefinitionProvider(e,t,i){const s=this._addNewAdapter(new ZI(this._documents,i),e);return this._proxy.$registerTypeDefinitionSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideTypeDefinition(e,t,i,s){return this._withAdapter(e,ZI,r=>r.provideTypeDefinition(x.revive(t),i,s),[],s)}registerHoverProvider(e,t,i,s){const r=this._addNewAdapter(new vd(this._documents,i),e);return this._proxy.$registerHoverProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideHover(e,t,i,s,r){return this._withAdapter(e,vd,o=>o.provideHover(x.revive(t),i,s,r),void 0,r)}$releaseHover(e,t){this._withAdapter(e,vd,i=>Promise.resolve(i.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,i,s){const r=this._addNewAdapter(new e4(this._documents,i),e);return this._proxy.$registerEvaluatableExpressionProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideEvaluatableExpression(e,t,i,s){return this._withAdapter(e,e4,r=>r.provideEvaluatableExpression(x.revive(t),i,s),void 0,s)}registerInlineValuesProvider(e,t,i,s){const r=typeof i.onDidChangeInlineValues=="function"?this._nextHandle():void 0,o=this._addNewAdapter(new t4(this._documents,i),e);this._proxy.$registerInlineValuesProvider(o,this._transformDocumentSelector(t,e),r);let a=this._createDisposable(o);if(r!==void 0){const l=i.onDidChangeInlineValues(c=>this._proxy.$emitInlineValuesEvent(r));a=je.from(a,l)}return a}$provideInlineValues(e,t,i,s,r){return this._withAdapter(e,t4,o=>o.provideInlineValues(x.revive(t),i,s,r),void 0,r)}registerDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new n4(this._documents,i),e);return this._proxy.$registerDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}registerMultiDocumentHighlightProvider(e,t,i){const s=this._addNewAdapter(new i4(this._documents,i,this._logService),e);return this._proxy.$registerMultiDocumentHighlightProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentHighlights(e,t,i,s){return this._withAdapter(e,n4,r=>r.provideDocumentHighlights(x.revive(t),i,s),void 0,s)}$provideMultiDocumentHighlights(e,t,i,s,r){return this._withAdapter(e,i4,o=>o.provideMultiDocumentHighlights(x.revive(t),i,s.map(a=>x.revive(a)),r),void 0,r)}registerLinkedEditingRangeProvider(e,t,i){const s=this._addNewAdapter(new s4(this._documents,i),e);return this._proxy.$registerLinkedEditingRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideLinkedEditingRanges(e,t,i,s){return this._withAdapter(e,s4,async r=>{const o=await r.provideLinkedEditingRanges(x.revive(t),i,s);if(o)return{ranges:o.ranges,wordPattern:o.wordPattern?Xt._serializeRegExp(o.wordPattern):void 0}},void 0,s)}registerReferenceProvider(e,t,i){const s=this._addNewAdapter(new r4(this._documents,i),e);return this._proxy.$registerReferenceSupport(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideReferences(e,t,i,s,r){return this._withAdapter(e,r4,o=>o.provideReferences(x.revive(t),i,s,r),void 0,r)}registerCodeActionProvider(e,t,i,s){const r=new xe,o=this._addNewAdapter(new Bl(this._documents,this._commands.converter,this._diagnostics,i,this._logService,e,this._apiDeprecation),e);return this._proxy.$registerCodeActionSupport(o,this._transformDocumentSelector(t,e),{providedKinds:s?.providedCodeActionKinds?.map(a=>a.value),documentation:s?.documentation?.map(a=>({kind:a.kind.value,command:this._commands.converter.toInternal(a.command,r)}))},Xt._extLabel(e),Xt._extId(e),!!i.resolveCodeAction),r.add(this._createDisposable(o)),r}$provideCodeActions(e,t,i,s,r){return this._withAdapter(e,Bl,o=>o.provideCodeActions(x.revive(t),i,s,r),void 0,r)}$resolveCodeAction(e,t,i){return this._withAdapter(e,Bl,s=>s.resolveCodeAction(t,i),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,Bl,i=>Promise.resolve(i.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,i){const s=this._addNewAdapter(new o4(this._documents,i),e);return this._proxy.$registerDocumentFormattingSupport(s,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(s)}$provideDocumentFormattingEdits(e,t,i,s){return this._withAdapter(e,o4,r=>r.provideDocumentFormattingEdits(x.revive(t),i,s),void 0,s)}registerDocumentRangeFormattingEditProvider(e,t,i){const s=typeof i.provideDocumentRangesFormattingEdits=="function",r=this._addNewAdapter(new _v(this._documents,i),e);return this._proxy.$registerRangeFormattingSupport(r,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,s),this._createDisposable(r)}$provideDocumentRangeFormattingEdits(e,t,i,s,r){return this._withAdapter(e,_v,o=>o.provideDocumentRangeFormattingEdits(x.revive(t),i,s,r),void 0,r)}$provideDocumentRangesFormattingEdits(e,t,i,s,r){return this._withAdapter(e,_v,o=>o.provideDocumentRangesFormattingEdits(x.revive(t),i,s,r),void 0,r)}registerOnTypeFormattingEditProvider(e,t,i,s){const r=this._addNewAdapter(new a4(this._documents,i),e);return this._proxy.$registerOnTypeFormattingSupport(r,this._transformDocumentSelector(t,e),s,e.identifier),this._createDisposable(r)}$provideOnTypeFormattingEdits(e,t,i,s,r,o){return this._withAdapter(e,a4,a=>a.provideOnTypeFormattingEdits(x.revive(t),i,s,r,o),void 0,o)}registerWorkspaceSymbolProvider(e,t){const i=this._addNewAdapter(new Of(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(i,typeof t.resolveWorkspaceSymbol=="function"),this._createDisposable(i)}$provideWorkspaceSymbols(e,t,i){return this._withAdapter(e,Of,s=>s.provideWorkspaceSymbols(t,i),{symbols:[]},i)}$resolveWorkspaceSymbol(e,t,i){return this._withAdapter(e,Of,s=>s.resolveWorkspaceSymbol(t,i),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,Of,i=>i.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,i){const s=this._addNewAdapter(new pa(this._documents,i,this._logService),e);return this._proxy.$registerRenameSupport(s,this._transformDocumentSelector(t,e),pa.supportsResolving(i)),this._createDisposable(s)}$provideRenameEdits(e,t,i,s,r){return this._withAdapter(e,pa,o=>o.provideRenameEdits(x.revive(t),i,s,r),void 0,r)}$resolveRenameLocation(e,t,i,s){return this._withAdapter(e,pa,r=>r.resolveRenameLocation(x.revive(t),i,s),void 0,s)}registerNewSymbolNamesProvider(e,t,i){const s=this._addNewAdapter(new wd(this._documents,i,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,wd,t=>t.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,i,s,r){return this._withAdapter(e,wd,o=>o.provideNewSymbolNames(x.revive(t),i,s,r),void 0,r)}registerDocumentSemanticTokensProvider(e,t,i,s){const r=this._addNewAdapter(new di(this._documents,i),e),o=typeof i.onDidChangeSemanticTokens=="function"?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(r,this._transformDocumentSelector(t,e),s,o);let a=this._createDisposable(r);if(o){const l=i.onDidChangeSemanticTokens(c=>this._proxy.$emitDocumentSemanticTokensEvent(o));a=je.from(a,l)}return a}$provideDocumentSemanticTokens(e,t,i,s){return this._withAdapter(e,di,r=>r.provideDocumentSemanticTokens(x.revive(t),i,s),null,s)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,di,i=>i.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,i,s){const r=this._addNewAdapter(new l4(this._documents,i),e);return this._proxy.$registerDocumentRangeSemanticTokensProvider(r,this._transformDocumentSelector(t,e),s),this._createDisposable(r)}$provideDocumentRangeSemanticTokens(e,t,i,s){return this._withAdapter(e,l4,r=>r.provideDocumentRangeSemanticTokens(x.revive(t),i,s),null,s)}registerCompletionItemProvider(e,t,i,s){const r=this._addNewAdapter(new Go(this._documents,this._commands.converter,i,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(r,this._transformDocumentSelector(t,e),s,Go.supportsResolving(i),e.identifier),this._createDisposable(r)}$provideCompletionItems(e,t,i,s,r){return this._withAdapter(e,Go,o=>o.provideCompletionItems(x.revive(t),i,s,r),void 0,r)}$resolveCompletionItem(e,t,i){return this._withAdapter(e,Go,s=>s.resolveCompletionItem(t,i),void 0,i)}$releaseCompletionItems(e,t){this._withAdapter(e,Go,i=>i.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,i,s){const r=typeof i.onDidChange=="function"&&dt(e,"inlineCompletionsAdditions")?this._nextHandle():void 0,o=new Gr(e,this._documents,i,this._commands.converter),a=this._addNewAdapter(o,e);let l=this._createDisposable(a);if(r!==void 0){const c=i.onDidChange(u=>this._proxy.$emitInlineCompletionsChange(r));l=je.from(l,c)}return this._proxy.$registerInlineCompletionsSupport(a,this._transformDocumentSelector(t,e),o.supportsHandleEvents,tt.toKey(e.identifier.value),s?.yieldTo?.map(c=>tt.toKey(c))||[],s?.displayName,s?.debounceDelayMs,r),l}$provideInlineCompletions(e,t,i,s,r){return this._withAdapter(e,Gr,o=>o.provideInlineCompletions(x.revive(t),i,s,r),void 0,r)}$provideInlineEditsForRange(e,t,i,s,r){return this._withAdapter(e,Gr,o=>o.provideInlineEditsForRange(x.revive(t),i,s,r),void 0,r)}$handleInlineCompletionDidShow(e,t,i,s){this._withAdapter(e,Gr,async r=>{r.handleDidShowCompletionItem(t,i,s)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,i,s,r){this._withAdapter(e,Gr,async o=>{o.handlePartialAccept(t,i,s,r)},void 0,void 0)}$handleInlineCompletionEndOfLifetime(e,t,i,s){this._withAdapter(e,Gr,async r=>{r.handleEndOfLifetime(t,i,s)},void 0,void 0)}$handleInlineCompletionRejection(e,t,i){this._withAdapter(e,Gr,async s=>{s.handleRejection(t,i)},void 0,void 0)}$freeInlineCompletionsList(e,t){this._withAdapter(e,Gr,async i=>{i.disposeCompletions(t)},void 0,void 0)}registerInlineEditProvider(e,t,i){const s=new wv(e,this._documents,i,this._commands.converter),r=this._addNewAdapter(s,e);return this._proxy.$registerInlineEditProvider(r,this._transformDocumentSelector(t,e),e.identifier,i.displayName||e.name),this._createDisposable(r)}$provideInlineEdit(e,t,i,s){return this._withAdapter(e,wv,r=>r.provideInlineEdits(x.revive(t),i,s),void 0,s)}$freeInlineEdit(e,t){this._withAdapter(e,wv,async i=>{i.disposeEdit(t)},void 0,void 0)}registerSignatureHelpProvider(e,t,i,s){const r=Array.isArray(s)?{triggerCharacters:s,retriggerCharacters:[]}:s,o=this._addNewAdapter(new bv(this._documents,i),e);return this._proxy.$registerSignatureHelpProvider(o,this._transformDocumentSelector(t,e),r),this._createDisposable(o)}$provideSignatureHelp(e,t,i,s,r){return this._withAdapter(e,bv,o=>o.provideSignatureHelp(x.revive(t),i,s,r),void 0,r)}$releaseSignatureHelp(e,t){this._withAdapter(e,bv,i=>i.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(e,t,i){const s=typeof i.onDidChangeInlayHints=="function"?this._nextHandle():void 0,r=this._addNewAdapter(new Ff(this._documents,this._commands.converter,i,this._logService,e),e);this._proxy.$registerInlayHintsProvider(r,this._transformDocumentSelector(t,e),typeof i.resolveInlayHint=="function",s,Xt._extLabel(e));let o=this._createDisposable(r);if(s!==void 0){const a=i.onDidChangeInlayHints(l=>this._proxy.$emitInlayHintsEvent(s));o=je.from(o,a)}return o}$provideInlayHints(e,t,i,s){return this._withAdapter(e,Ff,r=>r.provideInlayHints(x.revive(t),i,s),void 0,s)}$resolveInlayHint(e,t,i){return this._withAdapter(e,Ff,s=>s.resolveInlayHint(t,i),void 0,i)}$releaseInlayHints(e,t){this._withAdapter(e,Ff,i=>i.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,i){const s=this._addNewAdapter(new mo(this._documents,i),e);return this._proxy.$registerDocumentLinkProvider(s,this._transformDocumentSelector(t,e),typeof i.resolveDocumentLink=="function"),this._createDisposable(s)}$provideDocumentLinks(e,t,i){return this._withAdapter(e,mo,s=>s.provideLinks(x.revive(t),i),void 0,i,t.scheme==="output")}$resolveDocumentLink(e,t,i){return this._withAdapter(e,mo,s=>s.resolveLink(t,i),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,mo,i=>i.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,i){const s=this._addNewAdapter(new yv(this._documents,i),e);return this._proxy.$registerDocumentColorProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideDocumentColors(e,t,i){return this._withAdapter(e,yv,s=>s.provideColors(x.revive(t),i),[],i)}$provideColorPresentations(e,t,i,s){return this._withAdapter(e,yv,r=>r.provideColorPresentations(x.revive(t),i,s),void 0,s)}registerFoldingRangeProvider(e,t,i){const s=this._nextHandle(),r=typeof i.onDidChangeFoldingRanges=="function"?this._nextHandle():void 0;this._adapter.set(s,new Ou(new c4(this._documents,i),e)),this._proxy.$registerFoldingRangeProvider(s,this._transformDocumentSelector(t,e),e.identifier,r);let o=this._createDisposable(s);if(r!==void 0){const a=i.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(r));o=je.from(o,a)}return o}$provideFoldingRanges(e,t,i,s){return this._withAdapter(e,c4,r=>r.provideFoldingRanges(x.revive(t),i,s),void 0,s)}registerSelectionRangeProvider(e,t,i){const s=this._addNewAdapter(new u4(this._documents,i,this._logService),e);return this._proxy.$registerSelectionRangeProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$provideSelectionRanges(e,t,i,s){return this._withAdapter(e,u4,r=>r.provideSelectionRanges(x.revive(t),i,s),[],s)}registerCallHierarchyProvider(e,t,i){const s=this._addNewAdapter(new Lu(this._documents,i),e);return this._proxy.$registerCallHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareCallHierarchy(e,t,i,s){return this._withAdapter(e,Lu,r=>Promise.resolve(r.prepareSession(x.revive(t),i,s)),void 0,s)}$provideCallHierarchyIncomingCalls(e,t,i,s){return this._withAdapter(e,Lu,r=>r.provideCallsTo(t,i,s),void 0,s)}$provideCallHierarchyOutgoingCalls(e,t,i,s){return this._withAdapter(e,Lu,r=>r.provideCallsFrom(t,i,s),void 0,s)}$releaseCallHierarchy(e,t){this._withAdapter(e,Lu,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,i){const s=this._addNewAdapter(new Nu(this._documents,i),e);return this._proxy.$registerTypeHierarchyProvider(s,this._transformDocumentSelector(t,e)),this._createDisposable(s)}$prepareTypeHierarchy(e,t,i,s){return this._withAdapter(e,Nu,r=>Promise.resolve(r.prepareSession(x.revive(t),i,s)),void 0,s)}$provideTypeHierarchySupertypes(e,t,i,s){return this._withAdapter(e,Nu,r=>r.provideSupertypes(t,i,s),void 0,s)}$provideTypeHierarchySubtypes(e,t,i,s){return this._withAdapter(e,Nu,r=>r.provideSubtypes(t,i,s),void 0,s)}$releaseTypeHierarchy(e,t){this._withAdapter(e,Nu,i=>Promise.resolve(i.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,i,s){const r=this._nextHandle();return this._adapter.set(r,new Ou(new Mf(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerDocumentOnDropEditProvider(r,this._transformDocumentSelector(t,e),s?{supportsResolve:!!i.resolveDocumentDropEdit,dropMimeTypes:s.dropMimeTypes,providedDropKinds:s.providedDropEditKinds?.map(o=>o.value)}:void 0),this._createDisposable(r)}$provideDocumentOnDropEdits(e,t,i,s,r,o){return this._withAdapter(e,Mf,a=>Promise.resolve(a.provideDocumentOnDropEdits(t,x.revive(i),s,r,o)),void 0,void 0)}$resolveDropEdit(e,t,i){return this._withAdapter(e,Mf,s=>s.resolveDropEdit(t,i),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,Mf,i=>Promise.resolve(i.releaseDropEdits(t)),void 0,void 0)}registerDocumentPasteEditProvider(e,t,i,s){const r=this._nextHandle();return this._adapter.set(r,new Ou(new Ru(this._proxy,this._documents,i,r,e),e)),this._proxy.$registerPasteEditProvider(r,this._transformDocumentSelector(t,e),{supportsCopy:!!i.prepareDocumentPaste,supportsPaste:!!i.provideDocumentPasteEdits,supportsResolve:!!i.resolveDocumentPasteEdit,providedPasteEditKinds:s.providedPasteEditKinds?.map(o=>o.value),copyMimeTypes:s.copyMimeTypes,pasteMimeTypes:s.pasteMimeTypes}),this._createDisposable(r)}$prepareDocumentPaste(e,t,i,s,r){return this._withAdapter(e,Ru,o=>o.prepareDocumentPaste(x.revive(t),i,s,r),void 0,r)}$providePasteEdits(e,t,i,s,r,o,a){return this._withAdapter(e,Ru,l=>l.providePasteEdits(t,x.revive(i),s,r,o,a),void 0,a)}$resolvePasteEdit(e,t,i){return this._withAdapter(e,Ru,s=>s.resolvePasteEdit(t,i),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,Ru,i=>Promise.resolve(i.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(e){return{decreaseIndentPattern:Xt._serializeRegExp(e.decreaseIndentPattern),increaseIndentPattern:Xt._serializeRegExp(e.increaseIndentPattern),indentNextLinePattern:e.indentNextLinePattern?Xt._serializeRegExp(e.indentNextLinePattern):void 0,unIndentedLinePattern:e.unIndentedLinePattern?Xt._serializeRegExp(e.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(e){return{beforeText:Xt._serializeRegExp(e.beforeText),afterText:e.afterText?Xt._serializeRegExp(e.afterText):void 0,previousLineText:e.previousLineText?Xt._serializeRegExp(e.previousLineText):void 0,action:e.action}}static _serializeOnEnterRules(e){return e.map(Xt._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(t=>Wc.toString(t)):void 0}}static _serializeAutoClosingPairs(e){return e.map(Xt._serializeAutoClosingPair)}setLanguageConfiguration(e,t,i){const{wordPattern:s}=i;if(s&&mC(s))throw new Error(`Invalid language configuration: wordPattern '${s}' is not allowed to match the empty string.`);s?this._documents.setWordDefinitionFor(t,s):this._documents.setWordDefinitionFor(t,void 0),i.__electricCharacterSupport&&this._apiDeprecation.report("LanguageConfiguration.__electricCharacterSupport",e,"Do not use."),i.__characterPairSupport&&this._apiDeprecation.report("LanguageConfiguration.__characterPairSupport",e,"Do not use.");const r=this._nextHandle(),o={comments:i.comments,brackets:i.brackets,wordPattern:i.wordPattern?Xt._serializeRegExp(i.wordPattern):void 0,indentationRules:i.indentationRules?Xt._serializeIndentationRule(i.indentationRules):void 0,onEnterRules:i.onEnterRules?Xt._serializeOnEnterRules(i.onEnterRules):void 0,__electricCharacterSupport:i.__electricCharacterSupport,__characterPairSupport:i.__characterPairSupport,autoClosingPairs:i.autoClosingPairs?Xt._serializeAutoClosingPairs(i.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(r,t,o),this._createDisposable(r)}$setWordDefinitions(e){for(const t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};Xt._handlePool=0;let U0=Xt;var a1;(function(n){n.Internal={type:"internal",label:"Built-In"};function e(s){switch(s.type){case"extension":return`extension:${s.extensionId.value}`;case"mcp":return`mcp:${s.collectionId}:${s.definitionId}`;case"user":return`user:${s.file.toString()}`;case"internal":return"internal"}}n.toKey=e;function t(s,r){return e(s)===e(r)}n.equals=t;function i(s){return s.type==="internal"?{ordinal:1,label:h(5169,"Built-In")}:s.type==="mcp"?{ordinal:2,label:h(5170,"MCP Server: {0}",s.label)}:s.type==="user"?{ordinal:0,label:h(5171,"User Defined")}:{ordinal:3,label:h(5172,"Extension: {0}",s.label)}}n.classify=i})(a1||(a1={}));function ZM(n){return typeof n=="object"&&typeof n.sessionId=="string"}const eU=pe("notebookService"),tU=pe("codeMapperService"),nU=pe("IChatService"),d4="vscode_editFile",$0="vscode_editFile_internal",h4={id:$0,displayName:"",modelDescription:"",source:a1.Internal};let H0=class{constructor(e,t,i){this.chatService=e,this.codeMapperService=t,this.notebookService=i}async invoke(e,t,i,s){if(!e.context)throw new Error("toolInvocationToken is required for this tool");const r=e.parameters,o=x.revive(r.uri),a=Xp.parse(o)?.notebook||o,l=this.chatService.getSession(e.context?.sessionId),c=l.getRequests().at(-1);l.acceptResponseProgress(c,{kind:"markdownContent",content:new Mc("\n````\n")}),l.acceptResponseProgress(c,{kind:"codeblockUri",uri:a,isEdit:!0}),l.acceptResponseProgress(c,{kind:"markdownContent",content:new Mc("\n````\n")}),this.notebookService.hasSupportedNotebooks(a)&&this.notebookService.getNotebookTextModel(a)?l.acceptResponseProgress(c,{kind:"notebookEdit",edits:[],uri:a}):l.acceptResponseProgress(c,{kind:"textEdit",edits:[],uri:a});const u=l.editingSession;if(!u)throw new Error("This tool must be called from within an editing session");const d=await this.codeMapperService.mapCode({codeBlocks:[{code:r.code,resource:a,markdownBeforeBlock:r.explanation}],location:"tool",chatRequestId:e.chatRequestId,chatRequestModel:e.modelId,chatSessionId:e.context.sessionId},{textEdit:(p,_)=>{l.acceptResponseProgress(c,{kind:"textEdit",uri:p,edits:_})},notebookEdit(p,_){l.acceptResponseProgress(c,{kind:"notebookEdit",uri:p,edits:_})}},s);if(this.notebookService.hasSupportedNotebooks(a)&&this.notebookService.getNotebookTextModel(a)?l.acceptResponseProgress(c,{kind:"notebookEdit",uri:a,edits:[],done:!0}):l.acceptResponseProgress(c,{kind:"textEdit",uri:a,edits:[],done:!0}),d?.errorMessage)throw new Error(d.errorMessage);let f;return await new Promise(p=>{let _=!1;f=mT(w=>{const E=u.entries.read(w)?.find(S=>S.modifiedURI.toString()===a.toString());E&&(E.isCurrentlyBeingModifiedBy.read(w)?_=!0:_&&p(!0))})}).finally(()=>{f.dispose()}),{content:[{kind:"text",value:"The file was edited successfully"}]}}async prepareToolInvocation(e,t){return{presentation:"hidden"}}};H0=V([L(0,nU),L(1,tU),L(2,eU)],H0);const iU=pe("ILanguageModelToolsService");var xc;let f4=(xc=class extends Se{constructor(e,t){super();const i=t.createInstance(H0);this._register(e.registerToolData(h4)),this._register(e.registerToolImplementation(h4.id,i))}},xc.ID="chat.builtinTools",xc);f4=V([L(0,iU),L(1,Yh)],f4);const sU="vscode_fetchWebPage_internal",p5=pe("commandService"),SE=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new N,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(n,e){if(!n)throw new Error("invalid command");if(typeof n=="string"){if(!e)throw new Error("invalid command");return this.registerCommand({id:n,handler:e})}if(n.metadata&&Array.isArray(n.metadata.args)){const o=[];for(const l of n.metadata.args)o.push(l.constraint);const a=n.handler;n.handler=function(l,...c){return B5(c,o),a(l,...c)}}const{id:t}=n;let i=this._commands.get(t);i||(i=new To,this._commands.set(t,i));const s=i.unshift(n),r=we(()=>{s(),this._commands.get(t)?.isEmpty()&&this._commands.delete(t)});return this._onDidRegisterCommand.fire(t),r}registerCommandAlias(n,e){return SE.registerCommand(n,(t,...i)=>t.get(p5).executeCommand(e,...i))}getCommand(n){const e=this._commands.get(n);if(!(!e||e.isEmpty()))return fn.first(e)}getCommands(){const n=new Map;for(const e of this._commands.keys()){const t=this.getCommand(e);t&&n.set(e,t)}return n}};SE.registerCommand("noop",()=>{});var D;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.Unknown=0]="Unknown",n[n.Backspace=1]="Backspace",n[n.Tab=2]="Tab",n[n.Enter=3]="Enter",n[n.Shift=4]="Shift",n[n.Ctrl=5]="Ctrl",n[n.Alt=6]="Alt",n[n.PauseBreak=7]="PauseBreak",n[n.CapsLock=8]="CapsLock",n[n.Escape=9]="Escape",n[n.Space=10]="Space",n[n.PageUp=11]="PageUp",n[n.PageDown=12]="PageDown",n[n.End=13]="End",n[n.Home=14]="Home",n[n.LeftArrow=15]="LeftArrow",n[n.UpArrow=16]="UpArrow",n[n.RightArrow=17]="RightArrow",n[n.DownArrow=18]="DownArrow",n[n.Insert=19]="Insert",n[n.Delete=20]="Delete",n[n.Digit0=21]="Digit0",n[n.Digit1=22]="Digit1",n[n.Digit2=23]="Digit2",n[n.Digit3=24]="Digit3",n[n.Digit4=25]="Digit4",n[n.Digit5=26]="Digit5",n[n.Digit6=27]="Digit6",n[n.Digit7=28]="Digit7",n[n.Digit8=29]="Digit8",n[n.Digit9=30]="Digit9",n[n.KeyA=31]="KeyA",n[n.KeyB=32]="KeyB",n[n.KeyC=33]="KeyC",n[n.KeyD=34]="KeyD",n[n.KeyE=35]="KeyE",n[n.KeyF=36]="KeyF",n[n.KeyG=37]="KeyG",n[n.KeyH=38]="KeyH",n[n.KeyI=39]="KeyI",n[n.KeyJ=40]="KeyJ",n[n.KeyK=41]="KeyK",n[n.KeyL=42]="KeyL",n[n.KeyM=43]="KeyM",n[n.KeyN=44]="KeyN",n[n.KeyO=45]="KeyO",n[n.KeyP=46]="KeyP",n[n.KeyQ=47]="KeyQ",n[n.KeyR=48]="KeyR",n[n.KeyS=49]="KeyS",n[n.KeyT=50]="KeyT",n[n.KeyU=51]="KeyU",n[n.KeyV=52]="KeyV",n[n.KeyW=53]="KeyW",n[n.KeyX=54]="KeyX",n[n.KeyY=55]="KeyY",n[n.KeyZ=56]="KeyZ",n[n.Meta=57]="Meta",n[n.ContextMenu=58]="ContextMenu",n[n.F1=59]="F1",n[n.F2=60]="F2",n[n.F3=61]="F3",n[n.F4=62]="F4",n[n.F5=63]="F5",n[n.F6=64]="F6",n[n.F7=65]="F7",n[n.F8=66]="F8",n[n.F9=67]="F9",n[n.F10=68]="F10",n[n.F11=69]="F11",n[n.F12=70]="F12",n[n.F13=71]="F13",n[n.F14=72]="F14",n[n.F15=73]="F15",n[n.F16=74]="F16",n[n.F17=75]="F17",n[n.F18=76]="F18",n[n.F19=77]="F19",n[n.F20=78]="F20",n[n.F21=79]="F21",n[n.F22=80]="F22",n[n.F23=81]="F23",n[n.F24=82]="F24",n[n.NumLock=83]="NumLock",n[n.ScrollLock=84]="ScrollLock",n[n.Semicolon=85]="Semicolon",n[n.Equal=86]="Equal",n[n.Comma=87]="Comma",n[n.Minus=88]="Minus",n[n.Period=89]="Period",n[n.Slash=90]="Slash",n[n.Backquote=91]="Backquote",n[n.BracketLeft=92]="BracketLeft",n[n.Backslash=93]="Backslash",n[n.BracketRight=94]="BracketRight",n[n.Quote=95]="Quote",n[n.OEM_8=96]="OEM_8",n[n.IntlBackslash=97]="IntlBackslash",n[n.Numpad0=98]="Numpad0",n[n.Numpad1=99]="Numpad1",n[n.Numpad2=100]="Numpad2",n[n.Numpad3=101]="Numpad3",n[n.Numpad4=102]="Numpad4",n[n.Numpad5=103]="Numpad5",n[n.Numpad6=104]="Numpad6",n[n.Numpad7=105]="Numpad7",n[n.Numpad8=106]="Numpad8",n[n.Numpad9=107]="Numpad9",n[n.NumpadMultiply=108]="NumpadMultiply",n[n.NumpadAdd=109]="NumpadAdd",n[n.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",n[n.NumpadSubtract=111]="NumpadSubtract",n[n.NumpadDecimal=112]="NumpadDecimal",n[n.NumpadDivide=113]="NumpadDivide",n[n.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",n[n.ABNT_C1=115]="ABNT_C1",n[n.ABNT_C2=116]="ABNT_C2",n[n.AudioVolumeMute=117]="AudioVolumeMute",n[n.AudioVolumeUp=118]="AudioVolumeUp",n[n.AudioVolumeDown=119]="AudioVolumeDown",n[n.BrowserSearch=120]="BrowserSearch",n[n.BrowserHome=121]="BrowserHome",n[n.BrowserBack=122]="BrowserBack",n[n.BrowserForward=123]="BrowserForward",n[n.MediaTrackNext=124]="MediaTrackNext",n[n.MediaTrackPrevious=125]="MediaTrackPrevious",n[n.MediaStop=126]="MediaStop",n[n.MediaPlayPause=127]="MediaPlayPause",n[n.LaunchMediaPlayer=128]="LaunchMediaPlayer",n[n.LaunchMail=129]="LaunchMail",n[n.LaunchApp2=130]="LaunchApp2",n[n.Clear=131]="Clear",n[n.MAX_VALUE=132]="MAX_VALUE"})(D||(D={}));var T;(function(n){n[n.DependsOnKbLayout=-1]="DependsOnKbLayout",n[n.None=0]="None",n[n.Hyper=1]="Hyper",n[n.Super=2]="Super",n[n.Fn=3]="Fn",n[n.FnLock=4]="FnLock",n[n.Suspend=5]="Suspend",n[n.Resume=6]="Resume",n[n.Turbo=7]="Turbo",n[n.Sleep=8]="Sleep",n[n.WakeUp=9]="WakeUp",n[n.KeyA=10]="KeyA",n[n.KeyB=11]="KeyB",n[n.KeyC=12]="KeyC",n[n.KeyD=13]="KeyD",n[n.KeyE=14]="KeyE",n[n.KeyF=15]="KeyF",n[n.KeyG=16]="KeyG",n[n.KeyH=17]="KeyH",n[n.KeyI=18]="KeyI",n[n.KeyJ=19]="KeyJ",n[n.KeyK=20]="KeyK",n[n.KeyL=21]="KeyL",n[n.KeyM=22]="KeyM",n[n.KeyN=23]="KeyN",n[n.KeyO=24]="KeyO",n[n.KeyP=25]="KeyP",n[n.KeyQ=26]="KeyQ",n[n.KeyR=27]="KeyR",n[n.KeyS=28]="KeyS",n[n.KeyT=29]="KeyT",n[n.KeyU=30]="KeyU",n[n.KeyV=31]="KeyV",n[n.KeyW=32]="KeyW",n[n.KeyX=33]="KeyX",n[n.KeyY=34]="KeyY",n[n.KeyZ=35]="KeyZ",n[n.Digit1=36]="Digit1",n[n.Digit2=37]="Digit2",n[n.Digit3=38]="Digit3",n[n.Digit4=39]="Digit4",n[n.Digit5=40]="Digit5",n[n.Digit6=41]="Digit6",n[n.Digit7=42]="Digit7",n[n.Digit8=43]="Digit8",n[n.Digit9=44]="Digit9",n[n.Digit0=45]="Digit0",n[n.Enter=46]="Enter",n[n.Escape=47]="Escape",n[n.Backspace=48]="Backspace",n[n.Tab=49]="Tab",n[n.Space=50]="Space",n[n.Minus=51]="Minus",n[n.Equal=52]="Equal",n[n.BracketLeft=53]="BracketLeft",n[n.BracketRight=54]="BracketRight",n[n.Backslash=55]="Backslash",n[n.IntlHash=56]="IntlHash",n[n.Semicolon=57]="Semicolon",n[n.Quote=58]="Quote",n[n.Backquote=59]="Backquote",n[n.Comma=60]="Comma",n[n.Period=61]="Period",n[n.Slash=62]="Slash",n[n.CapsLock=63]="CapsLock",n[n.F1=64]="F1",n[n.F2=65]="F2",n[n.F3=66]="F3",n[n.F4=67]="F4",n[n.F5=68]="F5",n[n.F6=69]="F6",n[n.F7=70]="F7",n[n.F8=71]="F8",n[n.F9=72]="F9",n[n.F10=73]="F10",n[n.F11=74]="F11",n[n.F12=75]="F12",n[n.PrintScreen=76]="PrintScreen",n[n.ScrollLock=77]="ScrollLock",n[n.Pause=78]="Pause",n[n.Insert=79]="Insert",n[n.Home=80]="Home",n[n.PageUp=81]="PageUp",n[n.Delete=82]="Delete",n[n.End=83]="End",n[n.PageDown=84]="PageDown",n[n.ArrowRight=85]="ArrowRight",n[n.ArrowLeft=86]="ArrowLeft",n[n.ArrowDown=87]="ArrowDown",n[n.ArrowUp=88]="ArrowUp",n[n.NumLock=89]="NumLock",n[n.NumpadDivide=90]="NumpadDivide",n[n.NumpadMultiply=91]="NumpadMultiply",n[n.NumpadSubtract=92]="NumpadSubtract",n[n.NumpadAdd=93]="NumpadAdd",n[n.NumpadEnter=94]="NumpadEnter",n[n.Numpad1=95]="Numpad1",n[n.Numpad2=96]="Numpad2",n[n.Numpad3=97]="Numpad3",n[n.Numpad4=98]="Numpad4",n[n.Numpad5=99]="Numpad5",n[n.Numpad6=100]="Numpad6",n[n.Numpad7=101]="Numpad7",n[n.Numpad8=102]="Numpad8",n[n.Numpad9=103]="Numpad9",n[n.Numpad0=104]="Numpad0",n[n.NumpadDecimal=105]="NumpadDecimal",n[n.IntlBackslash=106]="IntlBackslash",n[n.ContextMenu=107]="ContextMenu",n[n.Power=108]="Power",n[n.NumpadEqual=109]="NumpadEqual",n[n.F13=110]="F13",n[n.F14=111]="F14",n[n.F15=112]="F15",n[n.F16=113]="F16",n[n.F17=114]="F17",n[n.F18=115]="F18",n[n.F19=116]="F19",n[n.F20=117]="F20",n[n.F21=118]="F21",n[n.F22=119]="F22",n[n.F23=120]="F23",n[n.F24=121]="F24",n[n.Open=122]="Open",n[n.Help=123]="Help",n[n.Select=124]="Select",n[n.Again=125]="Again",n[n.Undo=126]="Undo",n[n.Cut=127]="Cut",n[n.Copy=128]="Copy",n[n.Paste=129]="Paste",n[n.Find=130]="Find",n[n.AudioVolumeMute=131]="AudioVolumeMute",n[n.AudioVolumeUp=132]="AudioVolumeUp",n[n.AudioVolumeDown=133]="AudioVolumeDown",n[n.NumpadComma=134]="NumpadComma",n[n.IntlRo=135]="IntlRo",n[n.KanaMode=136]="KanaMode",n[n.IntlYen=137]="IntlYen",n[n.Convert=138]="Convert",n[n.NonConvert=139]="NonConvert",n[n.Lang1=140]="Lang1",n[n.Lang2=141]="Lang2",n[n.Lang3=142]="Lang3",n[n.Lang4=143]="Lang4",n[n.Lang5=144]="Lang5",n[n.Abort=145]="Abort",n[n.Props=146]="Props",n[n.NumpadParenLeft=147]="NumpadParenLeft",n[n.NumpadParenRight=148]="NumpadParenRight",n[n.NumpadBackspace=149]="NumpadBackspace",n[n.NumpadMemoryStore=150]="NumpadMemoryStore",n[n.NumpadMemoryRecall=151]="NumpadMemoryRecall",n[n.NumpadMemoryClear=152]="NumpadMemoryClear",n[n.NumpadMemoryAdd=153]="NumpadMemoryAdd",n[n.NumpadMemorySubtract=154]="NumpadMemorySubtract",n[n.NumpadClear=155]="NumpadClear",n[n.NumpadClearEntry=156]="NumpadClearEntry",n[n.ControlLeft=157]="ControlLeft",n[n.ShiftLeft=158]="ShiftLeft",n[n.AltLeft=159]="AltLeft",n[n.MetaLeft=160]="MetaLeft",n[n.ControlRight=161]="ControlRight",n[n.ShiftRight=162]="ShiftRight",n[n.AltRight=163]="AltRight",n[n.MetaRight=164]="MetaRight",n[n.BrightnessUp=165]="BrightnessUp",n[n.BrightnessDown=166]="BrightnessDown",n[n.MediaPlay=167]="MediaPlay",n[n.MediaRecord=168]="MediaRecord",n[n.MediaFastForward=169]="MediaFastForward",n[n.MediaRewind=170]="MediaRewind",n[n.MediaTrackNext=171]="MediaTrackNext",n[n.MediaTrackPrevious=172]="MediaTrackPrevious",n[n.MediaStop=173]="MediaStop",n[n.Eject=174]="Eject",n[n.MediaPlayPause=175]="MediaPlayPause",n[n.MediaSelect=176]="MediaSelect",n[n.LaunchMail=177]="LaunchMail",n[n.LaunchApp2=178]="LaunchApp2",n[n.LaunchApp1=179]="LaunchApp1",n[n.SelectTask=180]="SelectTask",n[n.LaunchScreenSaver=181]="LaunchScreenSaver",n[n.BrowserSearch=182]="BrowserSearch",n[n.BrowserHome=183]="BrowserHome",n[n.BrowserBack=184]="BrowserBack",n[n.BrowserForward=185]="BrowserForward",n[n.BrowserStop=186]="BrowserStop",n[n.BrowserRefresh=187]="BrowserRefresh",n[n.BrowserFavorites=188]="BrowserFavorites",n[n.ZoomToggle=189]="ZoomToggle",n[n.MailReply=190]="MailReply",n[n.MailForward=191]="MailForward",n[n.MailSend=192]="MailSend",n[n.MAX_VALUE=193]="MAX_VALUE"})(T||(T={}));class kE{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||D.Unknown}}const fp=new kE,B0=new kE,W0=new kE,rU=new Array(230),oU=Object.create(null),aU=Object.create(null),V0=[];for(let n=0;n<=T.MAX_VALUE;n++)D.DependsOnKbLayout;for(let n=0;n<=D.MAX_VALUE;n++)V0[n]=T.DependsOnKbLayout;(function(){const e=[[1,T.None,"None",D.Unknown,"unknown",0,"VK_UNKNOWN","",""],[1,T.Hyper,"Hyper",D.Unknown,"",0,"","",""],[1,T.Super,"Super",D.Unknown,"",0,"","",""],[1,T.Fn,"Fn",D.Unknown,"",0,"","",""],[1,T.FnLock,"FnLock",D.Unknown,"",0,"","",""],[1,T.Suspend,"Suspend",D.Unknown,"",0,"","",""],[1,T.Resume,"Resume",D.Unknown,"",0,"","",""],[1,T.Turbo,"Turbo",D.Unknown,"",0,"","",""],[1,T.Sleep,"Sleep",D.Unknown,"",0,"VK_SLEEP","",""],[1,T.WakeUp,"WakeUp",D.Unknown,"",0,"","",""],[0,T.KeyA,"KeyA",D.KeyA,"A",65,"VK_A","",""],[0,T.KeyB,"KeyB",D.KeyB,"B",66,"VK_B","",""],[0,T.KeyC,"KeyC",D.KeyC,"C",67,"VK_C","",""],[0,T.KeyD,"KeyD",D.KeyD,"D",68,"VK_D","",""],[0,T.KeyE,"KeyE",D.KeyE,"E",69,"VK_E","",""],[0,T.KeyF,"KeyF",D.KeyF,"F",70,"VK_F","",""],[0,T.KeyG,"KeyG",D.KeyG,"G",71,"VK_G","",""],[0,T.KeyH,"KeyH",D.KeyH,"H",72,"VK_H","",""],[0,T.KeyI,"KeyI",D.KeyI,"I",73,"VK_I","",""],[0,T.KeyJ,"KeyJ",D.KeyJ,"J",74,"VK_J","",""],[0,T.KeyK,"KeyK",D.KeyK,"K",75,"VK_K","",""],[0,T.KeyL,"KeyL",D.KeyL,"L",76,"VK_L","",""],[0,T.KeyM,"KeyM",D.KeyM,"M",77,"VK_M","",""],[0,T.KeyN,"KeyN",D.KeyN,"N",78,"VK_N","",""],[0,T.KeyO,"KeyO",D.KeyO,"O",79,"VK_O","",""],[0,T.KeyP,"KeyP",D.KeyP,"P",80,"VK_P","",""],[0,T.KeyQ,"KeyQ",D.KeyQ,"Q",81,"VK_Q","",""],[0,T.KeyR,"KeyR",D.KeyR,"R",82,"VK_R","",""],[0,T.KeyS,"KeyS",D.KeyS,"S",83,"VK_S","",""],[0,T.KeyT,"KeyT",D.KeyT,"T",84,"VK_T","",""],[0,T.KeyU,"KeyU",D.KeyU,"U",85,"VK_U","",""],[0,T.KeyV,"KeyV",D.KeyV,"V",86,"VK_V","",""],[0,T.KeyW,"KeyW",D.KeyW,"W",87,"VK_W","",""],[0,T.KeyX,"KeyX",D.KeyX,"X",88,"VK_X","",""],[0,T.KeyY,"KeyY",D.KeyY,"Y",89,"VK_Y","",""],[0,T.KeyZ,"KeyZ",D.KeyZ,"Z",90,"VK_Z","",""],[0,T.Digit1,"Digit1",D.Digit1,"1",49,"VK_1","",""],[0,T.Digit2,"Digit2",D.Digit2,"2",50,"VK_2","",""],[0,T.Digit3,"Digit3",D.Digit3,"3",51,"VK_3","",""],[0,T.Digit4,"Digit4",D.Digit4,"4",52,"VK_4","",""],[0,T.Digit5,"Digit5",D.Digit5,"5",53,"VK_5","",""],[0,T.Digit6,"Digit6",D.Digit6,"6",54,"VK_6","",""],[0,T.Digit7,"Digit7",D.Digit7,"7",55,"VK_7","",""],[0,T.Digit8,"Digit8",D.Digit8,"8",56,"VK_8","",""],[0,T.Digit9,"Digit9",D.Digit9,"9",57,"VK_9","",""],[0,T.Digit0,"Digit0",D.Digit0,"0",48,"VK_0","",""],[1,T.Enter,"Enter",D.Enter,"Enter",13,"VK_RETURN","",""],[1,T.Escape,"Escape",D.Escape,"Escape",27,"VK_ESCAPE","",""],[1,T.Backspace,"Backspace",D.Backspace,"Backspace",8,"VK_BACK","",""],[1,T.Tab,"Tab",D.Tab,"Tab",9,"VK_TAB","",""],[1,T.Space,"Space",D.Space,"Space",32,"VK_SPACE","",""],[0,T.Minus,"Minus",D.Minus,"-",189,"VK_OEM_MINUS","-","OEM_MINUS"],[0,T.Equal,"Equal",D.Equal,"=",187,"VK_OEM_PLUS","=","OEM_PLUS"],[0,T.BracketLeft,"BracketLeft",D.BracketLeft,"[",219,"VK_OEM_4","[","OEM_4"],[0,T.BracketRight,"BracketRight",D.BracketRight,"]",221,"VK_OEM_6","]","OEM_6"],[0,T.Backslash,"Backslash",D.Backslash,"\\",220,"VK_OEM_5","\\","OEM_5"],[0,T.IntlHash,"IntlHash",D.Unknown,"",0,"","",""],[0,T.Semicolon,"Semicolon",D.Semicolon,";",186,"VK_OEM_1",";","OEM_1"],[0,T.Quote,"Quote",D.Quote,"'",222,"VK_OEM_7","'","OEM_7"],[0,T.Backquote,"Backquote",D.Backquote,"`",192,"VK_OEM_3","`","OEM_3"],[0,T.Comma,"Comma",D.Comma,",",188,"VK_OEM_COMMA",",","OEM_COMMA"],[0,T.Period,"Period",D.Period,".",190,"VK_OEM_PERIOD",".","OEM_PERIOD"],[0,T.Slash,"Slash",D.Slash,"/",191,"VK_OEM_2","/","OEM_2"],[1,T.CapsLock,"CapsLock",D.CapsLock,"CapsLock",20,"VK_CAPITAL","",""],[1,T.F1,"F1",D.F1,"F1",112,"VK_F1","",""],[1,T.F2,"F2",D.F2,"F2",113,"VK_F2","",""],[1,T.F3,"F3",D.F3,"F3",114,"VK_F3","",""],[1,T.F4,"F4",D.F4,"F4",115,"VK_F4","",""],[1,T.F5,"F5",D.F5,"F5",116,"VK_F5","",""],[1,T.F6,"F6",D.F6,"F6",117,"VK_F6","",""],[1,T.F7,"F7",D.F7,"F7",118,"VK_F7","",""],[1,T.F8,"F8",D.F8,"F8",119,"VK_F8","",""],[1,T.F9,"F9",D.F9,"F9",120,"VK_F9","",""],[1,T.F10,"F10",D.F10,"F10",121,"VK_F10","",""],[1,T.F11,"F11",D.F11,"F11",122,"VK_F11","",""],[1,T.F12,"F12",D.F12,"F12",123,"VK_F12","",""],[1,T.PrintScreen,"PrintScreen",D.Unknown,"",0,"","",""],[1,T.ScrollLock,"ScrollLock",D.ScrollLock,"ScrollLock",145,"VK_SCROLL","",""],[1,T.Pause,"Pause",D.PauseBreak,"PauseBreak",19,"VK_PAUSE","",""],[1,T.Insert,"Insert",D.Insert,"Insert",45,"VK_INSERT","",""],[1,T.Home,"Home",D.Home,"Home",36,"VK_HOME","",""],[1,T.PageUp,"PageUp",D.PageUp,"PageUp",33,"VK_PRIOR","",""],[1,T.Delete,"Delete",D.Delete,"Delete",46,"VK_DELETE","",""],[1,T.End,"End",D.End,"End",35,"VK_END","",""],[1,T.PageDown,"PageDown",D.PageDown,"PageDown",34,"VK_NEXT","",""],[1,T.ArrowRight,"ArrowRight",D.RightArrow,"RightArrow",39,"VK_RIGHT","Right",""],[1,T.ArrowLeft,"ArrowLeft",D.LeftArrow,"LeftArrow",37,"VK_LEFT","Left",""],[1,T.ArrowDown,"ArrowDown",D.DownArrow,"DownArrow",40,"VK_DOWN","Down",""],[1,T.ArrowUp,"ArrowUp",D.UpArrow,"UpArrow",38,"VK_UP","Up",""],[1,T.NumLock,"NumLock",D.NumLock,"NumLock",144,"VK_NUMLOCK","",""],[1,T.NumpadDivide,"NumpadDivide",D.NumpadDivide,"NumPad_Divide",111,"VK_DIVIDE","",""],[1,T.NumpadMultiply,"NumpadMultiply",D.NumpadMultiply,"NumPad_Multiply",106,"VK_MULTIPLY","",""],[1,T.NumpadSubtract,"NumpadSubtract",D.NumpadSubtract,"NumPad_Subtract",109,"VK_SUBTRACT","",""],[1,T.NumpadAdd,"NumpadAdd",D.NumpadAdd,"NumPad_Add",107,"VK_ADD","",""],[1,T.NumpadEnter,"NumpadEnter",D.Enter,"",0,"","",""],[1,T.Numpad1,"Numpad1",D.Numpad1,"NumPad1",97,"VK_NUMPAD1","",""],[1,T.Numpad2,"Numpad2",D.Numpad2,"NumPad2",98,"VK_NUMPAD2","",""],[1,T.Numpad3,"Numpad3",D.Numpad3,"NumPad3",99,"VK_NUMPAD3","",""],[1,T.Numpad4,"Numpad4",D.Numpad4,"NumPad4",100,"VK_NUMPAD4","",""],[1,T.Numpad5,"Numpad5",D.Numpad5,"NumPad5",101,"VK_NUMPAD5","",""],[1,T.Numpad6,"Numpad6",D.Numpad6,"NumPad6",102,"VK_NUMPAD6","",""],[1,T.Numpad7,"Numpad7",D.Numpad7,"NumPad7",103,"VK_NUMPAD7","",""],[1,T.Numpad8,"Numpad8",D.Numpad8,"NumPad8",104,"VK_NUMPAD8","",""],[1,T.Numpad9,"Numpad9",D.Numpad9,"NumPad9",105,"VK_NUMPAD9","",""],[1,T.Numpad0,"Numpad0",D.Numpad0,"NumPad0",96,"VK_NUMPAD0","",""],[1,T.NumpadDecimal,"NumpadDecimal",D.NumpadDecimal,"NumPad_Decimal",110,"VK_DECIMAL","",""],[0,T.IntlBackslash,"IntlBackslash",D.IntlBackslash,"OEM_102",226,"VK_OEM_102","",""],[1,T.ContextMenu,"ContextMenu",D.ContextMenu,"ContextMenu",93,"","",""],[1,T.Power,"Power",D.Unknown,"",0,"","",""],[1,T.NumpadEqual,"NumpadEqual",D.Unknown,"",0,"","",""],[1,T.F13,"F13",D.F13,"F13",124,"VK_F13","",""],[1,T.F14,"F14",D.F14,"F14",125,"VK_F14","",""],[1,T.F15,"F15",D.F15,"F15",126,"VK_F15","",""],[1,T.F16,"F16",D.F16,"F16",127,"VK_F16","",""],[1,T.F17,"F17",D.F17,"F17",128,"VK_F17","",""],[1,T.F18,"F18",D.F18,"F18",129,"VK_F18","",""],[1,T.F19,"F19",D.F19,"F19",130,"VK_F19","",""],[1,T.F20,"F20",D.F20,"F20",131,"VK_F20","",""],[1,T.F21,"F21",D.F21,"F21",132,"VK_F21","",""],[1,T.F22,"F22",D.F22,"F22",133,"VK_F22","",""],[1,T.F23,"F23",D.F23,"F23",134,"VK_F23","",""],[1,T.F24,"F24",D.F24,"F24",135,"VK_F24","",""],[1,T.Open,"Open",D.Unknown,"",0,"","",""],[1,T.Help,"Help",D.Unknown,"",0,"","",""],[1,T.Select,"Select",D.Unknown,"",0,"","",""],[1,T.Again,"Again",D.Unknown,"",0,"","",""],[1,T.Undo,"Undo",D.Unknown,"",0,"","",""],[1,T.Cut,"Cut",D.Unknown,"",0,"","",""],[1,T.Copy,"Copy",D.Unknown,"",0,"","",""],[1,T.Paste,"Paste",D.Unknown,"",0,"","",""],[1,T.Find,"Find",D.Unknown,"",0,"","",""],[1,T.AudioVolumeMute,"AudioVolumeMute",D.AudioVolumeMute,"AudioVolumeMute",173,"VK_VOLUME_MUTE","",""],[1,T.AudioVolumeUp,"AudioVolumeUp",D.AudioVolumeUp,"AudioVolumeUp",175,"VK_VOLUME_UP","",""],[1,T.AudioVolumeDown,"AudioVolumeDown",D.AudioVolumeDown,"AudioVolumeDown",174,"VK_VOLUME_DOWN","",""],[1,T.NumpadComma,"NumpadComma",D.NUMPAD_SEPARATOR,"NumPad_Separator",108,"VK_SEPARATOR","",""],[0,T.IntlRo,"IntlRo",D.ABNT_C1,"ABNT_C1",193,"VK_ABNT_C1","",""],[1,T.KanaMode,"KanaMode",D.Unknown,"",0,"","",""],[0,T.IntlYen,"IntlYen",D.Unknown,"",0,"","",""],[1,T.Convert,"Convert",D.Unknown,"",0,"","",""],[1,T.NonConvert,"NonConvert",D.Unknown,"",0,"","",""],[1,T.Lang1,"Lang1",D.Unknown,"",0,"","",""],[1,T.Lang2,"Lang2",D.Unknown,"",0,"","",""],[1,T.Lang3,"Lang3",D.Unknown,"",0,"","",""],[1,T.Lang4,"Lang4",D.Unknown,"",0,"","",""],[1,T.Lang5,"Lang5",D.Unknown,"",0,"","",""],[1,T.Abort,"Abort",D.Unknown,"",0,"","",""],[1,T.Props,"Props",D.Unknown,"",0,"","",""],[1,T.NumpadParenLeft,"NumpadParenLeft",D.Unknown,"",0,"","",""],[1,T.NumpadParenRight,"NumpadParenRight",D.Unknown,"",0,"","",""],[1,T.NumpadBackspace,"NumpadBackspace",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryStore,"NumpadMemoryStore",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryRecall,"NumpadMemoryRecall",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryClear,"NumpadMemoryClear",D.Unknown,"",0,"","",""],[1,T.NumpadMemoryAdd,"NumpadMemoryAdd",D.Unknown,"",0,"","",""],[1,T.NumpadMemorySubtract,"NumpadMemorySubtract",D.Unknown,"",0,"","",""],[1,T.NumpadClear,"NumpadClear",D.Clear,"Clear",12,"VK_CLEAR","",""],[1,T.NumpadClearEntry,"NumpadClearEntry",D.Unknown,"",0,"","",""],[1,T.None,"",D.Ctrl,"Ctrl",17,"VK_CONTROL","",""],[1,T.None,"",D.Shift,"Shift",16,"VK_SHIFT","",""],[1,T.None,"",D.Alt,"Alt",18,"VK_MENU","",""],[1,T.None,"",D.Meta,"Meta",91,"VK_COMMAND","",""],[1,T.ControlLeft,"ControlLeft",D.Ctrl,"",0,"VK_LCONTROL","",""],[1,T.ShiftLeft,"ShiftLeft",D.Shift,"",0,"VK_LSHIFT","",""],[1,T.AltLeft,"AltLeft",D.Alt,"",0,"VK_LMENU","",""],[1,T.MetaLeft,"MetaLeft",D.Meta,"",0,"VK_LWIN","",""],[1,T.ControlRight,"ControlRight",D.Ctrl,"",0,"VK_RCONTROL","",""],[1,T.ShiftRight,"ShiftRight",D.Shift,"",0,"VK_RSHIFT","",""],[1,T.AltRight,"AltRight",D.Alt,"",0,"VK_RMENU","",""],[1,T.MetaRight,"MetaRight",D.Meta,"",0,"VK_RWIN","",""],[1,T.BrightnessUp,"BrightnessUp",D.Unknown,"",0,"","",""],[1,T.BrightnessDown,"BrightnessDown",D.Unknown,"",0,"","",""],[1,T.MediaPlay,"MediaPlay",D.Unknown,"",0,"","",""],[1,T.MediaRecord,"MediaRecord",D.Unknown,"",0,"","",""],[1,T.MediaFastForward,"MediaFastForward",D.Unknown,"",0,"","",""],[1,T.MediaRewind,"MediaRewind",D.Unknown,"",0,"","",""],[1,T.MediaTrackNext,"MediaTrackNext",D.MediaTrackNext,"MediaTrackNext",176,"VK_MEDIA_NEXT_TRACK","",""],[1,T.MediaTrackPrevious,"MediaTrackPrevious",D.MediaTrackPrevious,"MediaTrackPrevious",177,"VK_MEDIA_PREV_TRACK","",""],[1,T.MediaStop,"MediaStop",D.MediaStop,"MediaStop",178,"VK_MEDIA_STOP","",""],[1,T.Eject,"Eject",D.Unknown,"",0,"","",""],[1,T.MediaPlayPause,"MediaPlayPause",D.MediaPlayPause,"MediaPlayPause",179,"VK_MEDIA_PLAY_PAUSE","",""],[1,T.MediaSelect,"MediaSelect",D.LaunchMediaPlayer,"LaunchMediaPlayer",181,"VK_MEDIA_LAUNCH_MEDIA_SELECT","",""],[1,T.LaunchMail,"LaunchMail",D.LaunchMail,"LaunchMail",180,"VK_MEDIA_LAUNCH_MAIL","",""],[1,T.LaunchApp2,"LaunchApp2",D.LaunchApp2,"LaunchApp2",183,"VK_MEDIA_LAUNCH_APP2","",""],[1,T.LaunchApp1,"LaunchApp1",D.Unknown,"",0,"VK_MEDIA_LAUNCH_APP1","",""],[1,T.SelectTask,"SelectTask",D.Unknown,"",0,"","",""],[1,T.LaunchScreenSaver,"LaunchScreenSaver",D.Unknown,"",0,"","",""],[1,T.BrowserSearch,"BrowserSearch",D.BrowserSearch,"BrowserSearch",170,"VK_BROWSER_SEARCH","",""],[1,T.BrowserHome,"BrowserHome",D.BrowserHome,"BrowserHome",172,"VK_BROWSER_HOME","",""],[1,T.BrowserBack,"BrowserBack",D.BrowserBack,"BrowserBack",166,"VK_BROWSER_BACK","",""],[1,T.BrowserForward,"BrowserForward",D.BrowserForward,"BrowserForward",167,"VK_BROWSER_FORWARD","",""],[1,T.BrowserStop,"BrowserStop",D.Unknown,"",0,"VK_BROWSER_STOP","",""],[1,T.BrowserRefresh,"BrowserRefresh",D.Unknown,"",0,"VK_BROWSER_REFRESH","",""],[1,T.BrowserFavorites,"BrowserFavorites",D.Unknown,"",0,"VK_BROWSER_FAVORITES","",""],[1,T.ZoomToggle,"ZoomToggle",D.Unknown,"",0,"","",""],[1,T.MailReply,"MailReply",D.Unknown,"",0,"","",""],[1,T.MailForward,"MailForward",D.Unknown,"",0,"","",""],[1,T.MailSend,"MailSend",D.Unknown,"",0,"","",""],[1,T.None,"",D.KEY_IN_COMPOSITION,"KeyInComposition",229,"","",""],[1,T.None,"",D.ABNT_C2,"ABNT_C2",194,"VK_ABNT_C2","",""],[1,T.None,"",D.OEM_8,"OEM_8",223,"VK_OEM_8","",""],[1,T.None,"",D.Unknown,"",0,"VK_KANA","",""],[1,T.None,"",D.Unknown,"",0,"VK_HANGUL","",""],[1,T.None,"",D.Unknown,"",0,"VK_JUNJA","",""],[1,T.None,"",D.Unknown,"",0,"VK_FINAL","",""],[1,T.None,"",D.Unknown,"",0,"VK_HANJA","",""],[1,T.None,"",D.Unknown,"",0,"VK_KANJI","",""],[1,T.None,"",D.Unknown,"",0,"VK_CONVERT","",""],[1,T.None,"",D.Unknown,"",0,"VK_NONCONVERT","",""],[1,T.None,"",D.Unknown,"",0,"VK_ACCEPT","",""],[1,T.None,"",D.Unknown,"",0,"VK_MODECHANGE","",""],[1,T.None,"",D.Unknown,"",0,"VK_SELECT","",""],[1,T.None,"",D.Unknown,"",0,"VK_PRINT","",""],[1,T.None,"",D.Unknown,"",0,"VK_EXECUTE","",""],[1,T.None,"",D.Unknown,"",0,"VK_SNAPSHOT","",""],[1,T.None,"",D.Unknown,"",0,"VK_HELP","",""],[1,T.None,"",D.Unknown,"",0,"VK_APPS","",""],[1,T.None,"",D.Unknown,"",0,"VK_PROCESSKEY","",""],[1,T.None,"",D.Unknown,"",0,"VK_PACKET","",""],[1,T.None,"",D.Unknown,"",0,"VK_DBE_SBCSCHAR","",""],[1,T.None,"",D.Unknown,"",0,"VK_DBE_DBCSCHAR","",""],[1,T.None,"",D.Unknown,"",0,"VK_ATTN","",""],[1,T.None,"",D.Unknown,"",0,"VK_CRSEL","",""],[1,T.None,"",D.Unknown,"",0,"VK_EXSEL","",""],[1,T.None,"",D.Unknown,"",0,"VK_EREOF","",""],[1,T.None,"",D.Unknown,"",0,"VK_PLAY","",""],[1,T.None,"",D.Unknown,"",0,"VK_ZOOM","",""],[1,T.None,"",D.Unknown,"",0,"VK_NONAME","",""],[1,T.None,"",D.Unknown,"",0,"VK_PA1","",""],[1,T.None,"",D.Unknown,"",0,"VK_OEM_CLEAR","",""]],t=[],i=[];for(const s of e){const[r,o,a,l,c,u,d,f,p]=s;if(i[o]||(i[o]=!0,oU[a]=o,aU[a.toLowerCase()]=o,r&&l!==D.Unknown&&l!==D.Enter&&l!==D.Ctrl&&l!==D.Shift&&l!==D.Alt&&l!==D.Meta&&(V0[l]=o)),!t[l]){if(t[l]=!0,!c)throw new Error(`String representation missing for key code ${l} around scan code ${a}`);fp.define(l,c),B0.define(l,f||c),W0.define(l,p||f||c)}u&&(rU[u]=l)}V0[D.Enter]=T.Enter})();var p4;(function(n){function e(a){return fp.keyCodeToStr(a)}n.toString=e;function t(a){return fp.strToKeyCode(a)}n.fromString=t;function i(a){return B0.keyCodeToStr(a)}n.toUserSettingsUS=i;function s(a){return W0.keyCodeToStr(a)}n.toUserSettingsGeneral=s;function r(a){return B0.strToKeyCode(a)||W0.strToKeyCode(a)}n.fromUserSettings=r;function o(a){if(a>=D.Numpad0&&a<=D.NumpadDivide)return null;switch(a){case D.UpArrow:return"Up";case D.DownArrow:return"Down";case D.LeftArrow:return"Left";case D.RightArrow:return"Right"}return fp.keyCodeToStr(a)}n.toElectronAccelerator=o})(p4||(p4={}));var g4;(function(n){n[n.CtrlCmd=2048]="CtrlCmd",n[n.Shift=1024]="Shift",n[n.Alt=512]="Alt",n[n.WinCtrl=256]="WinCtrl"})(g4||(g4={}));var Ko;(function(n){n[n.CtrlCmd=2048]="CtrlCmd",n[n.Shift=1024]="Shift",n[n.Alt=512]="Alt",n[n.WinCtrl=256]="WinCtrl",n[n.KeyCode=255]="KeyCode"})(Ko||(Ko={}));function m4(n,e){if(typeof n=="number"){if(n===0)return null;const t=(n&65535)>>>0,i=(n&4294901760)>>>16;return i!==0?new pp([Uf(t,e),Uf(i,e)]):new pp([Uf(t,e)])}else{const t=[];for(let i=0;i<n.length;i++)t.push(Uf(n[i],e));return new pp(t)}}function Uf(n,e){const t=!!(n&Ko.CtrlCmd),i=!!(n&Ko.WinCtrl),s=e===Ms.Macintosh?i:t,r=!!(n&Ko.Shift),o=!!(n&Ko.Alt),a=e===Ms.Macintosh?t:i,l=n&Ko.KeyCode;return new DE(s,r,o,a,l)}class DE{constructor(e,t,i,s,r){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=s,this.keyCode=r}equals(e){return e instanceof DE&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){const e=this.ctrlKey?"1":"0",t=this.shiftKey?"1":"0",i=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${e}${t}${i}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===D.Unknown||this.keyCode===D.Ctrl||this.keyCode===D.Meta||this.keyCode===D.Alt||this.keyCode===D.Shift}toKeybinding(){return new pp([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===D.Ctrl||this.shiftKey&&this.keyCode===D.Shift||this.altKey&&this.keyCode===D.Alt||this.metaKey&&this.keyCode===D.Meta}}class pp{constructor(e){if(e.length===0)throw Ve("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t<i;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}}var _4;(function(n){n[n.EditorCore=0]="EditorCore",n[n.EditorContrib=100]="EditorContrib",n[n.WorkbenchContrib=200]="WorkbenchContrib",n[n.BuiltinExtension=300]="BuiltinExtension",n[n.ExternalExtension=400]="ExternalExtension"})(_4||(_4={}));class IE{constructor(){this._coreKeybindings=new To,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToCurrentPlatform(e){if(bf===Ms.Windows){if(e&&e.win)return e.win}else if(bf===Ms.Macintosh){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}registerKeybindingRule(e){const t=IE.bindToCurrentPlatform(e),i=new xe;if(t&&t.primary){const s=m4(t.primary,bf);s&&i.add(this._registerDefaultKeybinding(s,e.id,e.args,e.weight,0,e.when))}if(t&&Array.isArray(t.secondary))for(let s=0,r=t.secondary.length;s<r;s++){const o=t.secondary[s],a=m4(o,bf);a&&i.add(this._registerDefaultKeybinding(a,e.id,e.args,e.weight,-s-1,e.when))}return i}setExtensionKeybindings(e){const t=[];let i=0;for(const s of e)s.keybinding&&(t[i++]={keybinding:s.keybinding,command:s.id,commandArgs:s.args,when:s.when,weight1:s.weight,weight2:0,extensionId:s.extensionId||null,isBuiltinExtension:s.isBuiltinExtension||!1});this._extensionKeybindings=t,this._cachedMergedKeybindings=null}registerCommandAndKeybindingRule(e){return bx(this.registerKeybindingRule(e),SE.registerCommand(e))}_registerDefaultKeybinding(e,t,i,s,r,o){const a=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:i,when:o,weight1:s,weight2:r,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,we(()=>{a(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(uU)),this._cachedMergedKeybindings.slice(0)}}const lU=new IE,cU={EditorModes:"platform.keybindingsRegistry"};mn.add(cU.EditorModes,lU);function uU(n,e){if(n.weight1!==e.weight1)return n.weight1-e.weight1;if(n.command&&e.command){if(n.command<e.command)return-1;if(n.command>e.command)return 1}return n.weight2-e.weight2}var gp;function dU(n){return n.command!==void 0}const y=class y{static for(e){return y._instances.get(e)??new y(e)}constructor(e){if(y._instances.has(e))throw new TypeError(`MenuId with identifier '${e}' already exists. Use MenuId.for(ident) or a unique identifier`);y._instances.set(e,this),this.id=e}};y._instances=new Map,y.CommandPalette=new y("CommandPalette"),y.DebugBreakpointsContext=new y("DebugBreakpointsContext"),y.DebugCallStackContext=new y("DebugCallStackContext"),y.DebugConsoleContext=new y("DebugConsoleContext"),y.DebugVariablesContext=new y("DebugVariablesContext"),y.NotebookVariablesContext=new y("NotebookVariablesContext"),y.DebugHoverContext=new y("DebugHoverContext"),y.DebugWatchContext=new y("DebugWatchContext"),y.DebugToolBar=new y("DebugToolBar"),y.DebugToolBarStop=new y("DebugToolBarStop"),y.DebugDisassemblyContext=new y("DebugDisassemblyContext"),y.DebugCallStackToolbar=new y("DebugCallStackToolbar"),y.DebugCreateConfiguration=new y("DebugCreateConfiguration"),y.EditorContext=new y("EditorContext"),y.SimpleEditorContext=new y("SimpleEditorContext"),y.EditorContent=new y("EditorContent"),y.EditorLineNumberContext=new y("EditorLineNumberContext"),y.EditorContextCopy=new y("EditorContextCopy"),y.EditorContextPeek=new y("EditorContextPeek"),y.EditorContextShare=new y("EditorContextShare"),y.EditorTitle=new y("EditorTitle"),y.CompactWindowEditorTitle=new y("CompactWindowEditorTitle"),y.EditorTitleRun=new y("EditorTitleRun"),y.EditorTitleContext=new y("EditorTitleContext"),y.EditorTitleContextShare=new y("EditorTitleContextShare"),y.EmptyEditorGroup=new y("EmptyEditorGroup"),y.EmptyEditorGroupContext=new y("EmptyEditorGroupContext"),y.EditorTabsBarContext=new y("EditorTabsBarContext"),y.EditorTabsBarShowTabsSubmenu=new y("EditorTabsBarShowTabsSubmenu"),y.EditorTabsBarShowTabsZenModeSubmenu=new y("EditorTabsBarShowTabsZenModeSubmenu"),y.EditorActionsPositionSubmenu=new y("EditorActionsPositionSubmenu"),y.ExplorerContext=new y("ExplorerContext"),y.ExplorerContextShare=new y("ExplorerContextShare"),y.ExtensionContext=new y("ExtensionContext"),y.ExtensionEditorContextMenu=new y("ExtensionEditorContextMenu"),y.GlobalActivity=new y("GlobalActivity"),y.CommandCenter=new y("CommandCenter"),y.CommandCenterCenter=new y("CommandCenterCenter"),y.LayoutControlMenuSubmenu=new y("LayoutControlMenuSubmenu"),y.LayoutControlMenu=new y("LayoutControlMenu"),y.MenubarMainMenu=new y("MenubarMainMenu"),y.MenubarAppearanceMenu=new y("MenubarAppearanceMenu"),y.MenubarDebugMenu=new y("MenubarDebugMenu"),y.MenubarEditMenu=new y("MenubarEditMenu"),y.MenubarCopy=new y("MenubarCopy"),y.MenubarFileMenu=new y("MenubarFileMenu"),y.MenubarGoMenu=new y("MenubarGoMenu"),y.MenubarHelpMenu=new y("MenubarHelpMenu"),y.MenubarLayoutMenu=new y("MenubarLayoutMenu"),y.MenubarNewBreakpointMenu=new y("MenubarNewBreakpointMenu"),y.PanelAlignmentMenu=new y("PanelAlignmentMenu"),y.PanelPositionMenu=new y("PanelPositionMenu"),y.ActivityBarPositionMenu=new y("ActivityBarPositionMenu"),y.MenubarPreferencesMenu=new y("MenubarPreferencesMenu"),y.MenubarRecentMenu=new y("MenubarRecentMenu"),y.MenubarSelectionMenu=new y("MenubarSelectionMenu"),y.MenubarShare=new y("MenubarShare"),y.MenubarSwitchEditorMenu=new y("MenubarSwitchEditorMenu"),y.MenubarSwitchGroupMenu=new y("MenubarSwitchGroupMenu"),y.MenubarTerminalMenu=new y("MenubarTerminalMenu"),y.MenubarTerminalSuggestStatusMenu=new y("MenubarTerminalSuggestStatusMenu"),y.MenubarViewMenu=new y("MenubarViewMenu"),y.MenubarHomeMenu=new y("MenubarHomeMenu"),y.OpenEditorsContext=new y("OpenEditorsContext"),y.OpenEditorsContextShare=new y("OpenEditorsContextShare"),y.ProblemsPanelContext=new y("ProblemsPanelContext"),y.SCMInputBox=new y("SCMInputBox"),y.SCMChangeContext=new y("SCMChangeContext"),y.SCMResourceContext=new y("SCMResourceContext"),y.SCMResourceContextShare=new y("SCMResourceContextShare"),y.SCMResourceFolderContext=new y("SCMResourceFolderContext"),y.SCMResourceGroupContext=new y("SCMResourceGroupContext"),y.SCMSourceControl=new y("SCMSourceControl"),y.SCMSourceControlInline=new y("SCMSourceControlInline"),y.SCMSourceControlTitle=new y("SCMSourceControlTitle"),y.SCMHistoryTitle=new y("SCMHistoryTitle"),y.SCMHistoryItemContext=new y("SCMHistoryItemContext"),y.SCMHistoryItemChatContext=new y("SCMHistoryItemChatContext"),y.SCMHistoryItemChangeContext=new y("SCMHistoryItemChangeContext"),y.SCMHistoryItemHover=new y("SCMHistoryItemHover"),y.SCMHistoryItemRefContext=new y("SCMHistoryItemRefContext"),y.SCMQuickDiffDecorations=new y("SCMQuickDiffDecorations"),y.SCMTitle=new y("SCMTitle"),y.SearchContext=new y("SearchContext"),y.SearchActionMenu=new y("SearchActionContext"),y.StatusBarWindowIndicatorMenu=new y("StatusBarWindowIndicatorMenu"),y.StatusBarRemoteIndicatorMenu=new y("StatusBarRemoteIndicatorMenu"),y.StickyScrollContext=new y("StickyScrollContext"),y.TestItem=new y("TestItem"),y.TestItemGutter=new y("TestItemGutter"),y.TestProfilesContext=new y("TestProfilesContext"),y.TestMessageContext=new y("TestMessageContext"),y.TestMessageContent=new y("TestMessageContent"),y.TestPeekElement=new y("TestPeekElement"),y.TestPeekTitle=new y("TestPeekTitle"),y.TestCallStack=new y("TestCallStack"),y.TestCoverageFilterItem=new y("TestCoverageFilterItem"),y.TouchBarContext=new y("TouchBarContext"),y.TitleBar=new y("TitleBar"),y.TitleBarContext=new y("TitleBarContext"),y.TitleBarTitleContext=new y("TitleBarTitleContext"),y.TunnelContext=new y("TunnelContext"),y.TunnelPrivacy=new y("TunnelPrivacy"),y.TunnelProtocol=new y("TunnelProtocol"),y.TunnelPortInline=new y("TunnelInline"),y.TunnelTitle=new y("TunnelTitle"),y.TunnelLocalAddressInline=new y("TunnelLocalAddressInline"),y.TunnelOriginInline=new y("TunnelOriginInline"),y.ViewItemContext=new y("ViewItemContext"),y.ViewContainerTitle=new y("ViewContainerTitle"),y.ViewContainerTitleContext=new y("ViewContainerTitleContext"),y.ViewTitle=new y("ViewTitle"),y.ViewTitleContext=new y("ViewTitleContext"),y.CommentEditorActions=new y("CommentEditorActions"),y.CommentThreadTitle=new y("CommentThreadTitle"),y.CommentThreadActions=new y("CommentThreadActions"),y.CommentThreadAdditionalActions=new y("CommentThreadAdditionalActions"),y.CommentThreadTitleContext=new y("CommentThreadTitleContext"),y.CommentThreadCommentContext=new y("CommentThreadCommentContext"),y.CommentTitle=new y("CommentTitle"),y.CommentActions=new y("CommentActions"),y.CommentsViewThreadActions=new y("CommentsViewThreadActions"),y.InteractiveToolbar=new y("InteractiveToolbar"),y.InteractiveCellTitle=new y("InteractiveCellTitle"),y.InteractiveCellDelete=new y("InteractiveCellDelete"),y.InteractiveCellExecute=new y("InteractiveCellExecute"),y.InteractiveInputExecute=new y("InteractiveInputExecute"),y.InteractiveInputConfig=new y("InteractiveInputConfig"),y.ReplInputExecute=new y("ReplInputExecute"),y.IssueReporter=new y("IssueReporter"),y.NotebookToolbar=new y("NotebookToolbar"),y.NotebookToolbarContext=new y("NotebookToolbarContext"),y.NotebookStickyScrollContext=new y("NotebookStickyScrollContext"),y.NotebookCellTitle=new y("NotebookCellTitle"),y.NotebookCellDelete=new y("NotebookCellDelete"),y.NotebookCellInsert=new y("NotebookCellInsert"),y.NotebookCellBetween=new y("NotebookCellBetween"),y.NotebookCellListTop=new y("NotebookCellTop"),y.NotebookCellExecute=new y("NotebookCellExecute"),y.NotebookCellExecuteGoTo=new y("NotebookCellExecuteGoTo"),y.NotebookCellExecutePrimary=new y("NotebookCellExecutePrimary"),y.NotebookDiffCellInputTitle=new y("NotebookDiffCellInputTitle"),y.NotebookDiffDocumentMetadata=new y("NotebookDiffDocumentMetadata"),y.NotebookDiffCellMetadataTitle=new y("NotebookDiffCellMetadataTitle"),y.NotebookDiffCellOutputsTitle=new y("NotebookDiffCellOutputsTitle"),y.NotebookOutputToolbar=new y("NotebookOutputToolbar"),y.NotebookOutlineFilter=new y("NotebookOutlineFilter"),y.NotebookOutlineActionMenu=new y("NotebookOutlineActionMenu"),y.NotebookEditorLayoutConfigure=new y("NotebookEditorLayoutConfigure"),y.NotebookKernelSource=new y("NotebookKernelSource"),y.BulkEditTitle=new y("BulkEditTitle"),y.BulkEditContext=new y("BulkEditContext"),y.TimelineItemContext=new y("TimelineItemContext"),y.TimelineTitle=new y("TimelineTitle"),y.TimelineTitleContext=new y("TimelineTitleContext"),y.TimelineFilterSubMenu=new y("TimelineFilterSubMenu"),y.AccountsContext=new y("AccountsContext"),y.SidebarTitle=new y("SidebarTitle"),y.PanelTitle=new y("PanelTitle"),y.AuxiliaryBarTitle=new y("AuxiliaryBarTitle"),y.AuxiliaryBarHeader=new y("AuxiliaryBarHeader"),y.TerminalInstanceContext=new y("TerminalInstanceContext"),y.TerminalEditorInstanceContext=new y("TerminalEditorInstanceContext"),y.TerminalNewDropdownContext=new y("TerminalNewDropdownContext"),y.TerminalTabContext=new y("TerminalTabContext"),y.TerminalTabEmptyAreaContext=new y("TerminalTabEmptyAreaContext"),y.TerminalStickyScrollContext=new y("TerminalStickyScrollContext"),y.WebviewContext=new y("WebviewContext"),y.InlineCompletionsActions=new y("InlineCompletionsActions"),y.InlineEditsActions=new y("InlineEditsActions"),y.NewFile=new y("NewFile"),y.MergeInput1Toolbar=new y("MergeToolbar1Toolbar"),y.MergeInput2Toolbar=new y("MergeToolbar2Toolbar"),y.MergeBaseToolbar=new y("MergeBaseToolbar"),y.MergeInputResultToolbar=new y("MergeToolbarResultToolbar"),y.InlineSuggestionToolbar=new y("InlineSuggestionToolbar"),y.InlineEditToolbar=new y("InlineEditToolbar"),y.ChatContext=new y("ChatContext"),y.ChatCodeBlock=new y("ChatCodeblock"),y.ChatCompareBlock=new y("ChatCompareBlock"),y.ChatMessageTitle=new y("ChatMessageTitle"),y.ChatMessageFooter=new y("ChatMessageFooter"),y.ChatExecute=new y("ChatExecute"),y.ChatExecuteSecondary=new y("ChatExecuteSecondary"),y.ChatInput=new y("ChatInput"),y.ChatInputSide=new y("ChatInputSide"),y.ChatModelPicker=new y("ChatModelPicker"),y.ChatModePicker=new y("ChatModePicker"),y.ChatEditingWidgetToolbar=new y("ChatEditingWidgetToolbar"),y.ChatEditingEditorContent=new y("ChatEditingEditorContent"),y.ChatEditingEditorHunk=new y("ChatEditingEditorHunk"),y.ChatEditingDeletedNotebookCell=new y("ChatEditingDeletedNotebookCell"),y.ChatInputAttachmentToolbar=new y("ChatInputAttachmentToolbar"),y.ChatEditingWidgetModifiedFilesToolbar=new y("ChatEditingWidgetModifiedFilesToolbar"),y.ChatInputResourceAttachmentContext=new y("ChatInputResourceAttachmentContext"),y.ChatInputSymbolAttachmentContext=new y("ChatInputSymbolAttachmentContext"),y.ChatInlineResourceAnchorContext=new y("ChatInlineResourceAnchorContext"),y.ChatInlineSymbolAnchorContext=new y("ChatInlineSymbolAnchorContext"),y.ChatEditingCodeBlockContext=new y("ChatEditingCodeBlockContext"),y.ChatTitleBarMenu=new y("ChatTitleBarMenu"),y.ChatAttachmentsContext=new y("ChatAttachmentsContext"),y.ChatToolOutputResourceToolbar=new y("ChatToolOutputResourceToolbar"),y.ChatExplorerMenu=new y("ChatExplorerMenu"),y.ChatTextEditorMenu=new y("ChatTextEditorMenu"),y.ChatTerminalMenu=new y("ChatTerminalMenu"),y.ChatToolOutputResourceContext=new y("ChatToolOutputResourceContext"),y.AccessibleView=new y("AccessibleView"),y.MultiDiffEditorFileToolbar=new y("MultiDiffEditorFileToolbar"),y.DiffEditorHunkToolbar=new y("DiffEditorHunkToolbar"),y.DiffEditorSelectionToolbar=new y("DiffEditorSelectionToolbar");let Ra=y;const Cd=class Cd{static for(e){let t=this._all.get(e);return t||(t=new Cd(e),this._all.set(e,t)),t}static merge(e){const t=new Set;for(const i of e)i instanceof Cd&&t.add(i.id);return t}constructor(e){this.id=e,this.has=t=>t===e}};Cd._all=new Map;let Qo=Cd;new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new gA({merge:Qo.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(n){return this._commands.set(n.id,n),this._onDidChangeMenu.fire(Qo.for(Ra.CommandPalette)),we(()=>{this._commands.delete(n.id)&&this._onDidChangeMenu.fire(Qo.for(Ra.CommandPalette))})}getCommand(n){return this._commands.get(n)}getCommands(){const n=new Map;return this._commands.forEach((e,t)=>n.set(t,e)),n}appendMenuItem(n,e){let t=this._menuItems.get(n);t||(t=new To,this._menuItems.set(n,t));const i=t.push(e);return this._onDidChangeMenu.fire(Qo.for(n)),we(()=>{i(),this._onDidChangeMenu.fire(Qo.for(n))})}appendMenuItems(n){const e=new xe;for(const{id:t,item:i}of n)e.add(this.appendMenuItem(t,i));return e}getMenuItems(n){let e;return this._menuItems.has(n)?e=[...this._menuItems.get(n)]:e=[],n===Ra.CommandPalette&&this._appendImplicitItems(e),e}_appendImplicitItems(n){const e=new Set;for(const t of n)dU(t)&&(e.add(t.command.id),t.alt&&e.add(t.alt.id));this._commands.forEach((t,i)=>{e.has(i)||n.push({command:t})})}};let v4=gp=class{static label(e,t){return t?.renderShortTitle&&e.shortTitle?typeof e.shortTitle=="string"?e.shortTitle:e.shortTitle.value:typeof e.title=="string"?e.title:e.title.value}constructor(e,t,i,s,r,o,a){this.hideActions=s,this.menuKeybinding=r,this._commandService=a,this.id=e.id,this.label=gp.label(e,i),this.tooltip=(typeof e.tooltip=="string"?e.tooltip:e.tooltip?.value)??"",this.enabled=!e.precondition||o.contextMatchesRules(e.precondition),this.checked=void 0;let l;if(e.toggled){const c=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=o.contextMatchesRules(c.condition),this.checked&&c.tooltip&&(this.tooltip=typeof c.tooltip=="string"?c.tooltip:c.tooltip.value),this.checked&&sn.isThemeIcon(c.icon)&&(l=c.icon),this.checked&&c.title&&(this.label=typeof c.title=="string"?c.title:c.title.value)}l||(l=sn.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new gp(t,void 0,i,s,void 0,o,a):void 0,this._options=i,this.class=l&&sn.asClassName(l)}run(...e){let t=[];return this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};v4=gp=V([L(5,r_),L(6,p5)],v4);const g5=pe("extensionsWorkbenchService");G1(6919,"Extensions");var z0;(function(n){n[n.Installing=0]="Installing",n[n.Installed=1]="Installed",n[n.Uninstalling=2]="Uninstalling",n[n.Uninstalled=3]="Uninstalled"})(z0||(z0={}));var w4;(function(n){n.ReloadWindow="reloadWindow",n.RestartExtensions="restartExtensions",n.DownloadUpdate="downloadUpdate",n.ApplyUpdate="applyUpdate",n.QuitAndInstall="quitAndInstall"})(w4||(w4={}));var b4;(function(n){n.Readme="readme",n.Features="features",n.Changelog="changelog",n.Dependencies="dependencies",n.ExtensionPack="extensionPack"})(b4||(b4={}));let y4=class extends Se{constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set extension(e){this.containers.forEach(t=>t.extension=e)}update(e){for(const t of this.containers)e&&t.extension?M6(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};y4=V([L(1,g5)],y4);new P("defaultExtensionViews",!0);new P("hasOutdatedExtensions",!1);new P("hasGallery",!1);new P("extensionResultListFocused ",!0);new P("searchMcpServers",!1);new Ra("extensionsSearchActionsMenu");new Ra("extensionsFilterSubMenu");const hU="vscode_searchExtensions_internal";sn.fromId(_e.extensions.id),h(6932,"Search Extensions"),h(6933,"This is a tool for browsing Visual Studio Code Extensions Marketplace. It allows the model to search for extensions and retrieve detailed information about them. The model should use this tool whenever it needs to discover extensions or resolve information about known ones. To use the tool, the model has to provide the category of the extensions, relevant search keywords, or known extension IDs. Note that search results may include false positives, so reviewing and filtering is recommended."),h(6934,"Search for extensions in the Visual Studio Code Extensions Marketplace"),a1.Internal;let x4=class{constructor(e){this.extensionWorkbenchService=e}async invoke(e,t,i,s){const r=e.parameters;if(!r.keywords?.length&&!r.category&&!r.ids?.length)return{content:[{kind:"text",value:h(6935,"Please provide a category or keywords or ids to search for.")}]};const o=new Map,a=u=>{for(const d of u)d.deprecationInfo||d.isMalicious||o.set(d.identifier.id.toLowerCase(),{id:d.identifier.id,name:d.displayName,description:d.description,installed:d.state===z0.Installed,installCount:d.installCount??0,rating:d.rating??0,categories:d.categories??[],tags:d.gallery?.tags??[]})},l=async u=>{const d=await this.extensionWorkbenchService.queryGallery({text:u,pageSize:10,sortBy:Sw.InstallCount},s);d.firstPage.length&&a(d.firstPage)};if(r.ids?.length){const u=await this.extensionWorkbenchService.getExtensions(r.ids.map(d=>({id:d})),s);a(u)}if(r.keywords?.length)for(const u of r.keywords??[])if(u==="featured")await l("featured");else{let d=r.category?`category:"${r.category}"`:"";d=u?`${d} ${u}`.trim():d,await l(d)}else await l(`category:"${r.category}"`);const c=Array.from(o.values());return{content:[{kind:"text",value:`Here are the list of extensions:
|
|
116
116
|
${JSON.stringify(c)}
|
|
117
117
|
. Important: Use the following format to display extensions to the user because there is a renderer available to parse these extensions in this format and display them with all details. So, do not describe about the extensions to the user.
|
|
118
118
|
\`\`\`vscode-extensions
|
|
@@ -136,9 +136,9 @@ extensionId1,extensionId2
|
|
|
136
136
|
`&&(this._cr>0||this._lf>0)||t===`
|
|
137
137
|
`&&(this._cr>0||this._crlf>0)))for(let r=0,o=i.length;r<o;r++){const a=i[r].buffer.replace(/\r\n|\r|\n/g,t),l=dr(a);i[r]=new Jo(a,l)}const s=new Wl(i,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:s,disposable:s}}getFirstLineText(e){return this._chunks[0].buffer.substr(0,e).split(/\r\n|\r|\n/)[0]}}class k4{constructor(){this.chunks=[],this.BOM="",this._hasPreviousChar=!1,this._previousChar=0,this._tmpLineStarts=[],this.cr=0,this.lf=0,this.crlf=0,this.containsRTL=!1,this.containsUnusualLineTerminators=!1,this.isBasicASCII=!0}acceptChunk(e){if(e.length===0)return;this.chunks.length===0&&hR(e)&&(this.BOM=dR,e=e.substr(1));const t=e.charCodeAt(e.length-1);t===R.CarriageReturn||t>=55296&&t<=56319?(this._acceptChunk1(e.substr(0,e.length-1),!1),this._hasPreviousChar=!0,this._previousChar=t):(this._acceptChunk1(e,!1),this._hasPreviousChar=!1,this._previousChar=t)}_acceptChunk1(e,t){!t&&e.length===0||(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=_U(this._tmpLineStarts,e);this.chunks.push(new Jo(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=yC(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=xC(e)))}finish(e=!0){return this._finish(),new SU(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(this.chunks.length===0&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=dr(e.buffer);e.lineStarts=t,this._previousChar===R.CarriageReturn&&this.cr++}}}class kU extends Se{constructor(e,t,i){super(),this._source=e,this._inputTextBuffer=t,this._outputs=i,this._outputTextBuffers=void 0}_getFullModelRange(e){const t=e.getLineCount();return new et(1,1,t,this._getLineMaxColumn(e,t))}_getLineMaxColumn(e,t){if(t<1||t>e.getLineCount())throw new Error("Illegal value for lineNumber");return e.getLineLength(t)+1}get inputTextBuffer(){if(!this._inputTextBuffer){const e=new k4;e.acceptChunk(this._source);const t=e.finish(!0),{textBuffer:i,disposable:s}=t.create(Ud.LF);this._inputTextBuffer=i,this._register(s)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||(this._outputTextBuffers=this._outputs.map(e=>{const t=new k4;t.acceptChunk(e);const i=t.finish(!0),{textBuffer:s,disposable:r}=i.create(Ud.LF);return this._register(r),s})),this._outputTextBuffers}findInInputs(e){const i=new _I(e,!1,!1,null).parseSearchRequest();if(!i)return[];const s=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(s,i,!0,5e3)}findInOutputs(e){const i=new _I(e,!1,!1,null).parseSearchRequest();return i?this.outputTextBuffers.map(s=>{const r=s.findMatchesLineByLine(this._getFullModelRange(s),i,!0,5e3);if(r.length!==0)return{textBuffer:s,matches:r}}).filter(s=>!!s):[]}}function D4(n,e){let t=-1;const i=[];let s=[];return n.forEach(o=>{o.range.startLineNumber!==t&&s.length>0&&(i.push([...s]),s=[]),s.push(o),t=o.range.endLineNumber}),s.length>0&&i.push([...s]),i.map(o=>{const a=[],l=o[0].range.startLineNumber,c=o[o.length-1].range.endLineNumber;for(let u=l;u<=c;u++)a.push(e.getLineContent(u));return new K3(a.join(`
|
|
138
138
|
`)+`
|
|
139
|
-
`,o.map(u=>new et(u.range.startLineNumber-1,u.range.startColumn-1,u.range.endLineNumber-1,u.range.endColumn-1)))})}const DU=pe("remoteAgentService"),IU=pe("IUserDataProfilesService"),CU=Object.freeze({id:"workbench",order:7,title:h(3797,"Workbench"),type:"object"}),TU=Object.freeze({id:"security",scope:bt.APPLICATION,title:h(3798,"Security"),type:"object",order:7});Object.freeze({id:"problems",title:h(3799,"Problems"),type:"object",order:101});const PU=Object.freeze({id:"window",order:8,title:h(3800,"Window"),type:"object"}),AU={ConfigurationMigration:"base.contributions.configuration.migration"};class RU{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new N,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const mp=new RU;mn.add(AU.ConfigurationMigration,mp);var Ec;let I4=(Ec=class extends Se{constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const s of i.added)await this.migrateConfigurationsForFolder(s,mp.migrations)})),this.migrateConfigurations(mp.migrations),this._register(mp.onDidRegisterConfigurationMigration(i=>this.migrateConfigurations(i)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(const t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(i=>this.migrateConfigurationsForFolderAndOverride(i,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){const i=this.configurationService.inspect(e.key,{resource:t}),s=this.workspaceService.getWorkbenchState()===Op.WORKSPACE?[["user",Zt.USER],["userLocal",Zt.USER_LOCAL],["userRemote",Zt.USER_REMOTE],["workspace",Zt.WORKSPACE],["workspaceFolder",Zt.WORKSPACE_FOLDER]]:[["user",Zt.USER],["userLocal",Zt.USER_LOCAL],["userRemote",Zt.USER_REMOTE],["workspace",Zt.WORKSPACE]];for(const[r,o]of s){const a=i[r];if(!a)continue;const l=[];if(a.value!==void 0){const c=await this.runMigration(e,r,a.value,t,void 0);for(const u of c??[])l.push([u,[]])}for(const{identifiers:c,value:u}of a.overrides??[])if(u!==void 0){const d=await this.runMigration(e,r,u,t,c);for(const f of d??[])l.push([f,c])}l.length&&await Promise.allSettled(l.map(async([[c,u],d])=>this.configurationService.updateValue(c,u.value,{resource:t,overrideIdentifiers:d},o)))}}async runMigration(e,t,i,s,r){const o=l=>{const u=this.configurationService.inspect(l,{resource:s})[t];if(u)return r?u.overrides?.find(({identifiers:d})=>Gn(d,r))?.value:u.value},a=await e.migrateFn(i,o);return Array.isArray(a)?a:[[e.key,a]]}},Ec.ID="workbench.contrib.configurationMigration",Ec);I4=V([L(0,b_),L(1,HP)],I4);var Sc;let C4=(Sc=class extends Se{constructor(e){super(),this.remoteAgentService=e,this._ready=new Eo,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Qn&&(await this.remoteAgentService.getEnvironment())?.os!==Ms.Windows)return;mn.as(ll.Configuration).registerConfiguration({...TU,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:h(3801,"UNC host names must not contain backslashes.")},default:[],markdownDescription:h(3802,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:bt.APPLICATION_MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:h(3803,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:bt.APPLICATION_MACHINE}}})}},Sc.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",Sc);C4=V([L(0,DU)],C4);const Fu="window.newWindowProfile";var kc;let T4=(kc=class extends Se{constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(i=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(i=>{i.source!==Zt.DEFAULT&&i.affectsConfiguration(Fu)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=mn.as(ll.Configuration),t={...PU,properties:{[Fu]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),h(3804,"Active Window")],description:h(3805,"Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the Default profile if no active window exists."),scope:bt.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(Fu);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(Fu);if(!e)return;const t=this.newWindowProfile?this.userDataProfilesService.profiles.find(i=>i.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(Fu,t?.name)}},kc.ID="workbench.contrib.dynamicWindowConfiguration",kc);T4=V([L(0,IU),L(1,b_)],T4);const LU=mn.as(ll.Configuration),NU={...CU,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:h(12470,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:"string"}}}};LU.registerConfiguration(NU);var Q0;(function(n){n.builtin="builtin",n.option="option",n.exclusive="exclusive",n.default="default"})(Q0||(Q0={}));var P4;(function(n){n[n.ABORT=1]="ABORT",n[n.NONE=2]="NONE"})(P4||(P4={}));function OU(n,e){if(new Set([le.extension,le.webviewPanel,le.vscodeWorkspaceTrust,le.vscodeSettings]).has(e.scheme))return!1;const s=typeof n=="string"&&n.indexOf(ct.sep)>=0?`${e.scheme}:${e.path}`:Ks(e);return sd(typeof n=="string"?n.toLowerCase():n,s.toLowerCase())}const ta=class ta{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,s,r,o,a){this._textDocumentsAndEditors=i,this._textDocuments=s,this._extHostFileSystem=r,this._extHostSearch=o,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new on,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new N,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new N,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new N,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new N,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new Oi("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(ee.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(ee.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(ee.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:l=>{if(l&&l.$mid===st.NotebookCellActionContext){const c=l.notebookEditor?.notebookUri,u=l.cell.handle,f=this._documents.get(c)?.getCell(u);if(f)return f.apiCell}if(l&&l.$mid===st.NotebookActionContext){const c=l.uri,u=this._documents.get(c);if(u)return u.apiNotebook}return l}}),ta._registerApiCommands(t)}getEditorById(e){const t=this._editors.get(e);if(!t)throw new Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(const[t,i]of this._editors)if(i.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){const i=this._documents.get(e);if(!i&&!t)throw new Error(`NO notebook document for '${e}'`);return i}static _convertNotebookRegistrationData(e,t){if(!t)return;const i=t.filenamePattern.map(s=>Sm.from(s)).filter(s=>s!==void 0);if(t.filenamePattern&&!i){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:i,priority:t.exclusive?Q0.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(e,t,i){const s=ta._notebookStatusBarItemProviderHandlePool++,r=typeof i.onDidChangeCellStatusBarItems=="function"?ta._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(s,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(s,r,t);let o;return r!==void 0&&(o=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(r))),new je(()=>{this._notebookStatusBarItemProviders.delete(s),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(s,r),o?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&Xr.from(e.content)});return x.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),s=this._documents.get(x.revive(i));return Tc(s?.apiNotebook)}async showNotebookDocument(e,t){let i;typeof t=="object"?i={position:hn.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(Ws.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0,label:typeof t.asRepl=="string"?t.asRepl:typeof t.asRepl=="object"?t.asRepl.label:void 0}:i={preserveFocus:!1,pinned:!0};const s=t?.asRepl?"repl":e.notebookType,r=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,s,i),o=r&&this._editors.get(r)?.apiEditor;if(o)return o;throw r?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,i,s){const r=this._notebookStatusBarItemProviders.get(e),o=x.revive(t),a=this._documents.get(o);if(!a||!r)return;const l=a.getCellFromIndex(i);if(!l)return;const c=await r.provideCellStatusBarItems(l.apiCell,s);if(!c)return;const u=new xe,d=this._statusBarCache.add([u]),p=(Array.isArray(c)?c:[c]).map(_=>ty.from(_,this._commandsConverter,u));return{cacheId:d,items:p}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,s,r){if(Od(t))throw new Error("viewType cannot be empty or just whitespace");const o=this._handlePool++;return this._notebookSerializer.set(o,{viewType:t,serializer:i,options:s}),this._notebookProxy.$registerNotebookSerializer(o,{id:e.identifier,location:e.extensionLocation},t,iy.from(s),ta._convertNotebookRegistrationData(e,r)),we(()=>{this._notebookProxy.$unregisterNotebookSerializer(o)})}async $dataToNotebook(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const r=await s.serializer.deserializeNotebook(t.buffer,i);return new jn(Xr.from(r))}async $notebookToData(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const r=await s.serializer.serializeNotebook(Xr.to(t.value),i);return ue.wrap(r)}async $saveNotebook(e,t,i,s,r){const o=x.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${o.toString()})`),!a)throw new Error("NO serializer found");const l=this._documents.get(o);if(!l)throw new Error("Document NOT found");if(l.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(o.scheme))throw new Yv(h(2588,"Unable to modify read-only file '{0}'",this._resourceForError(o)),Si.FILE_PERMISSION_DENIED);const c={metadata:SS(l.apiNotebook.metadata,_=>!(a.options?.transientDocumentMetadata??{})[_]),cells:[]};for(const _ of l.apiNotebook.getCells()){const w=new c_(_.kind,_.document.getText(),_.document.languageId,_.mime,a.options?.transientOutputs?[]:[..._.outputs],_.metadata,_.executionSummary);w.metadata=SS(_.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),c.cells.push(w)}if(await this._validateWriteFile(o,s),r.isCancellationRequested)throw new Error("canceled");const u=await a.serializer.serializeNotebook(c,r);if(r.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${o.toString()}`),await this._extHostFileSystem.value.writeFile(o,u),this.trace(`Finished write versionId: ${i} ${o.toString()}`);const d=this._extHostFileSystem.getFileSystemProviderExtUri(o.scheme),f=await this._extHostFileSystem.value.stat(o),p={name:d.basename(o),isFile:(f.type&va.File)!==0,isDirectory:(f.type&va.Directory)!==0,isSymbolicLink:(f.type&va.SymbolicLink)!==0,mtime:f.mtime,ctime:f.ctime,size:f.size,readonly:!!((f.permissions??0)&Oc.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(o.scheme),locked:!!((f.permissions??0)&Oc.Locked),etag:DS({mtime:f.mtime,size:f.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${o.toString()})`),p}async $searchInNotebooks(e,t,i,s,r){const o=this._notebookSerializer.get(e)?.serializer;if(!o)return{limitHit:!1,results:[]};const a=new V4;await(async(f,p,_)=>{await Promise.all(f.map(async w=>await Promise.all(w.filenamePatterns.map(v=>{const E={_reason:_._reason,folderQueries:_.folderQueries,includePattern:_.includePattern,excludePattern:_.excludePattern,maxResults:_.maxResults,type:Pa.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(E,p,S=>{S.forEach(A=>{a.has(A)||s.some(W=>w.isFromSettings&&!W.isFromSettings?!1:W.filenamePatterns.some(ce=>OU(ce,A)))||a.add(A)})}).catch(S=>{if(S.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw S})}))))})(i,r,t);const c=new on;let u=!1;const d=Array.from(a).map(async f=>{const p=[];try{if(r.isCancellationRequested)return;if(t.maxResults&&[...c.values()].reduce((E,S)=>E+S.cellResults.length,0)>t.maxResults){u=!0;return}const _=[],w=this._documents.get(f);if(w)w.apiNotebook.getCells().forEach(S=>_.push({input:S.document.getText(),outputs:S.outputs.flatMap(A=>A.items.map(G=>G.data.toString()))}));else{const E=await this._extHostFileSystem.value.readFile(f),S=ue.fromString(E.toString()),A=await o.deserializeNotebook(S.buffer,r);if(r.isCancellationRequested)return;Xr.from(A).cells.forEach(W=>_.push({input:W.source,outputs:W.outputs.flatMap(ce=>ce.items.map(Q=>Q.valueBytes.toString()))}))}if(r.isCancellationRequested)return;_.forEach((E,S)=>{const A=t.contentPattern.pattern,G=new kU(E.input,void 0,E.outputs),W=G.findInInputs(A),ce=G.findInOutputs(A),Q=ce.flatMap(ne=>D4(ne.matches,ne.textBuffer)).map((ne,J)=>(ne.webviewIndex=J,ne));if(W.length>0||ce.length>0){const ne={index:S,contentResults:D4(W,G.inputTextBuffer),webviewResults:Q};p.push(ne)}});const v={resource:f,cellResults:p};c.set(f,v);return}catch{return}});return await Promise.all(d),{limitHit:u,results:[...c.values()]}}async _validateWriteFile(e,t){const i=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime=="number"&&typeof t.etag=="string"&&t.etag!==c8&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtime<i.mtime&&t.etag!==DS({mtime:t.mtime,size:i.size}))throw new Yv(h(2589,"File Modified Since"),Si.FILE_MODIFIED_SINCE,t)}_resourceForError(e){return e.scheme===le.file?e.fsPath:e.toString()}_createExtHostEditor(e,t,i){if(this._editors.has(t))throw new Error(`editor with id ALREADY EXSIST: ${t}`);const s=new jh(t,this._notebookEditorsProxy,e,i.visibleRanges.map(Ws.to),i.selections.map(Ws.to),typeof i.viewColumn=="number"?hn.to(i.viewColumn):void 0,i.viewType);this._editors.set(t,s)}$acceptDocumentAndEditorsDelta(e){if(e.value.removedDocuments)for(const t of e.value.removedDocuments){const i=x.revive(t),s=this._documents.get(i);s&&(s.dispose(),this._documents.delete(i),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({removedDocuments:s.apiNotebook.getCells().map(r=>r.document.uri)}),this._onDidCloseNotebookDocument.fire(s.apiNotebook));for(const r of this._editors.values())r.notebookData.uri.toString()===i.toString()&&this._editors.delete(r.id)}if(e.value.addedDocuments){const t=[];for(const i of e.value.addedDocuments){const s=x.revive(i.uri);if(this._documents.has(s))throw new Error(`adding EXISTING notebook ${s} `);const r=new G0(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,s,i);t.push(...i.cells.map(o=>j0.asModelAddData(o))),this._documents.get(s)?.dispose(),this._documents.set(s,r),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(r.apiNotebook)}}if(e.value.addedEditors)for(const t of e.value.addedEditors){if(this._editors.has(t.id))return;const i=x.revive(t.documentUri),s=this._documents.get(i);s&&this._createExtHostEditor(s,t.id,t)}if(e.value.removedEditors)for(const t of e.value.removedEditors){const i=this._editors.get(t);i&&(this._editors.delete(t),this._activeNotebookEditor?.id===i.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(i=>this._editors.get(i)).filter(i=>!!i);const t=new Set;this._visibleNotebookEditors.forEach(i=>t.add(i.id));for(const i of this._editors.values()){const s=t.has(i.id);i._acceptVisibility(s)}this._visibleNotebookEditors=[...this._editors.values()].map(i=>i).filter(i=>i.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){const t=j.String.with("notebookType","A notebook type"),i=new Te("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new j("data","Bytes to convert to data",r=>r instanceof Uint8Array,r=>ue.wrap(r))],new ke("Notebook Data",r=>Xr.to(r.value))),s=new Te("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new j("NotebookData","Notebook data to convert to bytes",r=>!0,r=>new jn(Xr.from(r)))],new ke("Bytes",r=>r.buffer));e.registerApiCommand(i),e.registerApiCommand(s)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};ta._notebookStatusBarItemProviderHandlePool=0;let J0=ta;class FU{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._onWillSaveNotebookDocumentEvent=new qu}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,s)=>{const r=function(a){t.call(i,a)};return r.extension=e,this._onWillSaveNotebookDocumentEvent.event(r,void 0,s)}}async $participateInSave(e,t,i){const s=x.revive(e),r=this._notebooksAndEditors.getNotebookDocument(s);if(!r)throw new Error("Unable to resolve notebook document");const o=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:r.apiNotebook,reason:bm.to(t)},i,async(l,c)=>{const u=Date.now(),d=await await Promise.resolve(l);Date.now()-u>this._thresholds.timeout&&this._logService.warn("onWillSaveNotebookDocument-listener from extension",c.extension.identifier),!i.isCancellationRequested&&d&&(d instanceof Ga?o.push(d):this._logService.warn("onWillSaveNotebookDocument-listener from extension",c.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(o.length===0)return!0;const a={edits:[]};for(const l of o){const{edits:c}=_i.from(l);a.edits=a.edits.concat(c)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jn(a))}}class MU{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new N,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new N,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,i,s){const o=this._notebooksAndEditors.getNotebookDocument(x.revive(e)).acceptModelChanged(t.value,i,s);this._onDidChangeNotebookDocument.fire(o)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(x.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(x.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let X0=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new N,this._onDidChangeNotebookEditorVisibleRanges=new N,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug("ExtHostNotebook#$acceptEditorPropertiesChanged",e,t);const i=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&i._acceptVisibleRanges(t.visibleRanges.ranges.map(Ws.to)),t.selections&&i._acceptSelections(t.selections.selections.map(Ws.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:i.apiEditor,visibleRanges:i.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:i.apiEditor,selections:i.apiEditor.selections}))}$acceptEditorViewColumns(e){for(const t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(hn.to(e[t]))}};X0=V([L(0,at)],X0);var Vl;(function(n){n[n.Output=1]="Output",n[n.OutputItems=2]="OutputItems",n[n.ExecutionState=3]="ExecutionState"})(Vl||(Vl={}));const UU=100;var A4;(function(n){n[n.Disconnected=1]="Disconnected",n[n.Connected=2]="Connected",n[n.Initializing=3]="Initializing"})(A4||(A4={}));let Y0=class{constructor(e,t,i,s,r){this._initData=t,this._extHostNotebook=i,this._commands=s,this._logService=r,this._activeExecutions=new on,this._activeNotebookExecutions=new on,this._kernelDetectionTask=new Map,this._kernelDetectionTaskHandlePool=0,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProviderHandlePool=0,this._kernelData=new Map,this._handlePool=0,this.id=0,this.variableStore={},this._proxy=e.getProxy(ee.MainThreadNotebookKernels);const o=new Te("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new j("options","Select kernel options",l=>!0,l=>{if(l&&"notebookEditor"in l&&"id"in l){const c=this._extHostNotebook.getIdByEditor(l.notebookEditor);return{id:l.id,extension:l.extension,notebookEditorId:c}}else if(l&&"notebookEditor"in l){const c=this._extHostNotebook.getIdByEditor(l.notebookEditor);if(c===void 0)throw new Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${l.notebookEditor.notebook.uri.toString()}`);return"skipIfAlreadySelected"in l?{notebookEditorId:c,skipIfAlreadySelected:l.skipIfAlreadySelected}:{notebookEditorId:c}}return l})],ke.Void),a=new Te("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[j.Uri],new ke("A promise that resolves to an array of variables",(l,c)=>l.map(u=>({variable:{name:u.name,value:u.value,expression:u.expression,type:u.type,language:u.language},hasNamedChildren:u.hasNamedChildren,indexedChildrenCount:u.indexedChildrenCount}))));this._commands.registerApiCommand(o),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,s,r,o){for(const W of this._kernelData.values())if(W.controller.id===t&&tt.equals(e.identifier,W.extensionId))throw new Error(`notebook controller with id '${t}' ALREADY exist`);const a=this._handlePool++,l=this;this._logService.trace(`NotebookController[${a}], CREATED by ${e.identifier.value}, ${t}`);const c=()=>console.warn(`NO execute handler from notebook controller '${p.id}' of extension: '${e.identifier}'`);let u=!1;const d=new N,f=new N,p={id:Bf(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:s||e.identifier.value,preloads:o?o.map(km.from):[]};let _=r??c,w,v;this._proxy.$addKernel(a,p).catch(W=>{console.log(W),u=!0});let E=0;const S=()=>{if(u)return;const W=++E;Promise.resolve().then(()=>{W===E&&this._proxy.$updateKernel(a,p)})},A=new on,G={get id(){return t},get notebookType(){return p.notebookType},onDidChangeSelectedNotebooks:d.event,get label(){return p.label},set label(W){p.label=W??e.displayName??e.name,S()},get detail(){return p.detail??""},set detail(W){p.detail=W,S()},get description(){return p.description??""},set description(W){p.description=W,S()},get supportedLanguages(){return p.supportedLanguages},set supportedLanguages(W){p.supportedLanguages=W,S()},get supportsExecutionOrder(){return p.supportsExecutionOrder??!1},set supportsExecutionOrder(W){p.supportsExecutionOrder=W,S()},get rendererScripts(){return p.preloads?p.preloads.map(km.to):[]},get executeHandler(){return _},set executeHandler(W){_=W??c},get interruptHandler(){return w},set interruptHandler(W){w=W,p.supportsInterrupt=!!W,S()},set variableProvider(W){$(e,"notebookVariableProvider"),v=W,p.hasVariableProvider=!!W,W?.onDidChangeVariables(ce=>l._proxy.$variablesUpdated(ce.uri)),S()},get variableProvider(){return v},createNotebookCellExecution(W){if(u)throw new Error("notebook controller is DISPOSED");if(!A.has(W.notebook.uri))throw l._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(A.keys()).map(ce=>ce.toString())),new Error(`notebook controller is NOT associated to notebook: ${W.notebook.uri.toString()}`);return l._createNotebookCellExecution(W,Bf(e.identifier,this.id))},createNotebookExecution(W){if($(e,"notebookExecution"),u)throw new Error("notebook controller is DISPOSED");if(!A.has(W.uri))throw l._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(A.keys()).map(ce=>ce.toString())),new Error(`notebook controller is NOT associated to notebook: ${W.uri.toString()}`);return l._createNotebookExecution(W,Bf(e.identifier,this.id))},dispose:()=>{u||(this._logService.trace(`NotebookController[${a}], DISPOSED`),u=!0,this._kernelData.delete(a),d.dispose(),f.dispose(),this._proxy.$removeKernel(a))},updateNotebookAffinity(W,ce){ce===em.Hidden&&$(e,"notebookControllerAffinityHidden"),l._proxy.$updateNotebookPriority(a,W.uri,ce)},onDidReceiveMessage:f.event,postMessage(W,ce){return $(e,"notebookMessaging"),l._proxy.$postMessage(a,ce&&l._extHostNotebook.getIdByEditor(ce),W)},asWebviewUri(W){return $(e,"notebookMessaging"),_d(W,l._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:G,onDidReceiveMessage:f,onDidChangeSelection:d,associatedNotebooks:A}),G}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return Bf(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,s=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const r={dispose:()=>{this._kernelDetectionTask.delete(i),s._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,r),r}registerKernelSourceActionProvider(e,t,i){const s=this._kernelSourceActionProviderHandlePool++,r=typeof i.onDidChangeNotebookKernelSourceActions=="function"?s:void 0,o=this;this._kernelSourceActionProviders.set(s,i),this._logService.trace(`NotebookKernelSourceActionProvider[${s}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(s,s,t);let a;return r!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(l=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(r))),{dispose:()=>{this._kernelSourceActionProviders.delete(s),o._proxy.$removeKernelSourceActionProvider(s,s),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const s=new xe;return(await i.provideNotebookKernelSourceActions(t)??[]).map(o=>ny.from(o,this._commands.converter,s))}return[]}$acceptNotebookAssociation(e,t,i){const s=this._kernelData.get(e);if(s){const r=this._extHostNotebook.getNotebookDocument(x.revive(t));i?s.associatedNotebooks.set(r.uri,!0):s.associatedNotebooks.delete(r.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,r.uri.toString(),i),s.onDidChangeSelection.fire({selected:i,notebook:r.apiNotebook})}}async $executeCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const r=this._extHostNotebook.getNotebookDocument(x.revive(t)),o=[];for(const a of i){const l=r.getCell(a);l&&o.push(l.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,r.uri.toString(),o.length),await s.controller.executeHandler.call(s.controller,o,r.apiNotebook,s.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const r=this._extHostNotebook.getNotebookDocument(x.revive(t));if(s.controller.interruptHandler)await s.controller.interruptHandler.call(s.controller,r.apiNotebook);else for(const o of i){const a=r.getCell(o);a&&this._activeExecutions.get(a.uri)?.cancel()}if(s.controller.interruptHandler){const o=this._activeNotebookExecutions.get(r.uri);this._activeNotebookExecutions.delete(r.uri),i.length&&Array.isArray(o)&&o.length&&o.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,s,r,o,a){const l=this._kernelData.get(e);if(!l)return;const c=this._extHostNotebook.getNotebookDocument(x.revive(i)),u=l.controller.variableProvider;if(!u)return;let d;if(s!==void 0){if(d=this.variableStore[s],!d)return}else this.variableStore={};const f=r==="named"?_h.Named:_h.Indexed,p=u.provideVariables(c.apiNotebook,d,f,o,a);let _=0;for await(const w of p){if(a.isCancellationRequested)return;const v={id:this.id++,name:w.variable.name,value:w.variable.value,type:w.variable.type,interfaces:w.variable.interfaces,language:w.variable.language,expression:w.variable.expression,hasNamedChildren:w.hasNamedChildren,indexedChildrenCount:w.indexedChildrenCount,extensionId:l.extensionId.value};if(this.variableStore[v.id]=w.variable,this._proxy.$receiveVariable(t,v),_++>=UU)return}}$acceptKernelMessageFromRenderer(e,t,i){const s=this._kernelData.get(e);if(!s)return;const r=this._extHostNotebook.getEditorById(t);s.onDidReceiveMessage.fire(Object.freeze({editor:r.apiEditor,message:i}))}_createNotebookCellExecution(e,t){if(e.index<0)throw new Error("CANNOT execute cell that has been REMOVED from notebook");const s=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!s)throw new Error("invalid cell");if(this._activeExecutions.has(s.uri))throw new Error(`duplicate execution for ${s.uri}`);const r=new Z0(t,s,this._proxy);this._activeExecutions.set(s.uri,r);const o=r.onDidChangeState(()=>{r.state===Zi.Resolved&&(r.dispose(),o.dispose(),this._activeExecutions.delete(s.uri))});return r.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),s=e.getCells().find(a=>{const l=i.getCellFromApiCell(a);return l&&this._activeExecutions.has(l.uri)});if(s)throw new Error(`duplicate cell execution for ${s.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const r=new ex(t,i,this._proxy),o=r.onDidChangeState(()=>{r.state===vr.Resolved&&(r.dispose(),o.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[r,o]),r.asApiObject()}};Y0=V([L(4,at)],Y0);var Zi;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(Zi||(Zi={}));const U1=class U1 extends Se{get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=U1.HANDLE++,this._onDidChangeState=new N,this.onDidChangeState=this._onDidChangeState.event,this._state=Zi.Init,this._tokenSource=this._register(new Nt),this._collector=new HU(10,s=>this.update(s)),this._executionOrder=t.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,e,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){const t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new jn(t))}verifyStateForOutput(){if(this._state===Zi.Init)throw new Error("Must call start before modifying cell output");if(this._state===Zi.Resolved)throw new Error("Cannot modify cell output after calling resolve")}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw new Error("INVALID cell");return t.handle}validateAndConvertOutputs(e){return e.map(t=>{const i=Xg.ensureUniqueMimeTypes(t.items,!0);return i===t.items?Io.from(t):Io.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const s=this.cellIndexToHandle(t),r=this.validateAndConvertOutputs(Ri(e));return this.updateSoon({editType:Vl.Output,cellHandle:s,append:i,outputs:r})}async updateOutputItems(e,t,i){return e=Xg.ensureUniqueMimeTypes(Ri(e),!0),this.updateSoon({editType:Vl.OutputItems,items:e.map(iu.from),outputId:t.id,append:i})}asApiObject(){const e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(i){e._executionOrder=i,e.update([{editType:Vl.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===Zi.Resolved||e._state===Zi.Started)throw new Error("Cannot call start again");e._state=Zi.Started,e._onDidChangeState.fire(),e.update({editType:Vl.ExecutionState,runStartTime:i})},end(i,s,r){if(e._state===Zi.Resolved)throw new Error("Cannot call resolve twice");e._state=Zi.Resolved,e._onDidChangeState.fire(),e._collector.flush();const o=$U(r);e._proxy.$completeExecution(e._handle,new jn({runEndTime:s,lastRunSuccess:i,error:o}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!0)},replaceOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!1)},appendOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!0)},replaceOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!1)}})}};U1.HANDLE=0;let Z0=U1;function $U(n){const e=s=>s?{startLineNumber:s.start.line,startColumn:s.start.character,endLineNumber:s.end.line,endColumn:s.end.character}:void 0,t=s=>({uri:s.uri,position:s.position,label:s.label});return n?{name:n.name,message:n.message,stack:n.stack instanceof Array?n.stack.map(s=>t(s)):n.stack,location:e(n.location),uri:n.uri}:void 0}var vr;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(vr||(vr={}));const $1=class $1 extends Se{get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=$1.HANDLE++,this._onDidChangeState=new N,this.onDidChangeState=this._onDidChangeState.event,this._state=vr.Init,this._tokenSource=this._register(new Nt),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===vr.Resolved||this._state===vr.Started)throw new Error("Cannot call start again");this._state=vr.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===vr.Resolved)throw new Error("Cannot call resolve twice");this._state=vr.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};$1.HANDLE=0;let ex=$1;class HU{constructor(e,t){this.delay=e,this.callback=t,this.batch=[],this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new Eo,this.startedTimer=Date.now(),us(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();const e=this.currentDeferred;this.currentDeferred=void 0;const t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}}function Bf(n,e){return`${n.value}/${e}`}class BU{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(ee.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const s=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:s.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(s=>s.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(s,r,o)=>this.getOrCreateEmitterFor(t).event(s,r,o),postMessage:(s,r)=>{jh.apiEditorsToExtHost.has(s)&&([s,r]=[r,s]);const o=r&&jh.apiEditorsToExtHost.get(r);return this.proxy.$postMessage(o?.id,t,s)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new N({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}}class WU{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(ee.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if($(e,"profileContentHandlers"),this.handlers.has(t))throw new Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,i),this.proxy.$registerProfileContentHandler(t,i.name,i.description,e.identifier.value),we(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,i,s){const r=this.handlers.get(e);if(!r)throw new Error(`Unknown handler with id: ${e}`);return r.saveProfile(t,i,s)}async $readProfile(e,t,i){const s=this.handlers.get(e);if(!s)throw new Error(`Unknown handler with id: ${e}`);return s.readProfile(it(t)?t:x.revive(t),i)}}const H1=class H1{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(ee.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const s=x.revive(t),r=this.providers.get(e);return r?Ln(()=>r.provideOriginalResource(s,i)).then(o=>o||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,s,r,o){const a=H1.handlePool++;this.providers.set(a,i);const l=tt.toKey(e.identifier);return this.proxy.$registerQuickDiffProvider(a,Qc.from(t,this.uriTransformer),`${l}.${s}`,r,o),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(a),this.providers.delete(a)}}}};H1.handlePool=0;let tx=H1;function VU(n,e,t){const i=n.getProxy(ee.MainThreadQuickOpen);class s{constructor(_,w){this._sessions=new Map,this._instances=0,this._workspace=_,this._commands=w}showQuickPick(_,w,v,E=yt.None){this._onDidSelectItem=void 0;const S=Promise.resolve(w),A=++this._instances,G=i.$show(A,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},E),W={},ce=G.then(()=>W);return Promise.race([ce,S]).then(Q=>{if(Q===W)return;const ne=dt(_,"quickPickItemTooltip");return S.then(J=>{const de=[];for(let Ce=0;Ce<J.length;Ce++){const Ae=J[Ce];if(typeof Ae=="string")de.push({label:Ae,handle:Ce});else if(Ae.kind===mh.Separator)de.push({type:"separator",label:Ae.label});else{Ae.tooltip&&!ne&&console.warn(`Extension '${_.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${_.identifier.value}`);const se=Ae.iconPath?c(Ae.iconPath):void 0;de.push({label:Ae.label,iconPath:se?.iconPath,iconClass:se?.iconClass,description:Ae.description,detail:Ae.detail,picked:Ae.picked,alwaysShow:Ae.alwaysShow,tooltip:ne?Re.fromStrict(Ae.tooltip):void 0,handle:Ce})}}return v&&typeof v.onDidSelectItem=="function"&&(this._onDidSelectItem=Ce=>{v.onDidSelectItem(J[Ce])}),i.$setItems(A,de),G.then(Ce=>{if(typeof Ce=="number")return J[Ce];if(Array.isArray(Ce))return Ce.map(Ae=>J[Ae])})})}).then(void 0,Q=>{if(!Vs(Q))return i.$setError(A,Q),Promise.reject(Q)})}$onItemSelected(_){this._onDidSelectItem?.(_)}showInput(_,w=yt.None){return this._validateInput=_?.validateInput,i.$input(_,typeof this._validateInput=="function",w).then(void 0,v=>{if(!Vs(v))return Promise.reject(v)})}async $validateInput(_){if(!this._validateInput)return;const w=await this._validateInput(_);if(!w||typeof w=="string")return w;let v;switch(w.severity){case hc.Info:v=Qt.Info;break;case hc.Warning:v=Qt.Warning;break;case hc.Error:v=Qt.Error;break;default:v=w.message?Qt.Error:Qt.Ignore;break}return{content:w.message,severity:v}}async showWorkspaceFolderPick(_,w=yt.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[_]);if(!v)return;const E=await this._workspace.getWorkspaceFolders2();if(E)return E.find(S=>S.uri.toString()===v.uri.toString())}createQuickPick(_){const w=new u(_,()=>this._sessions.delete(w._id));return this._sessions.set(w._id,w),w}createInputBox(_){const w=new d(_,()=>this._sessions.delete(w._id));return this._sessions.set(w._id,w),w}$onDidChangeValue(_,w){this._sessions.get(_)?._fireDidChangeValue(w)}$onDidAccept(_){this._sessions.get(_)?._fireDidAccept()}$onDidChangeActive(_,w){const v=this._sessions.get(_);v instanceof u&&v._fireDidChangeActive(w)}$onDidChangeSelection(_,w){const v=this._sessions.get(_);v instanceof u&&v._fireDidChangeSelection(w)}$onDidTriggerButton(_,w){this._sessions.get(_)?._fireDidTriggerButton(w)}$onDidTriggerItemButton(_,w,v){const E=this._sessions.get(_);E instanceof u&&E._fireDidTriggerItemButton(w,v)}$onDidHide(_){this._sessions.get(_)?._fireDidHide()}}const f=class f{constructor(_,w){this._extension=_,this._onDidDispose=w,this._id=u._nextId++,this._visible=!1,this._expectingHide=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!0,this._value="",this._valueSelection=void 0,this._buttons=[],this._handlesToButtons=new Map,this._onDidAcceptEmitter=new N,this._onDidChangeValueEmitter=new N,this._onDidTriggerButtonEmitter=new N,this._onDidHideEmitter=new N,this._pendingUpdate={id:this._id},this._disposed=!1,this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter],this.onDidChangeValue=this._onDidChangeValueEmitter.event,this.onDidAccept=this._onDidAcceptEmitter.event,this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event,this.onDidHide=this._onDidHideEmitter.event}get title(){return this._title}set title(_){this._title=_,this.update({title:_})}get step(){return this._steps}set step(_){this._steps=_,this.update({step:_})}get totalSteps(){return this._totalSteps}set totalSteps(_){this._totalSteps=_,this.update({totalSteps:_})}get enabled(){return this._enabled}set enabled(_){this._enabled=_,this.update({enabled:_})}get busy(){return this._busy}set busy(_){this._busy=_,this.update({busy:_})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(_){this._ignoreFocusOut=_,this.update({ignoreFocusOut:_})}get value(){return this._value}set value(_){this._value=_,this.update({value:_})}get valueSelection(){return this._valueSelection}set valueSelection(_){this._valueSelection=_,this.update({valueSelection:_})}get placeholder(){return this._placeholder}set placeholder(_){this._placeholder=_,this.update({placeholder:_})}get buttons(){return this._buttons}set buttons(_){const w=dt(this._extension,"quickInputButtonLocation");!w&&_.some(v=>v.location)&&console.warn(`Extension '${this._extension.identifier.value}' uses a button location which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`),this._buttons=_.slice(),this._handlesToButtons.clear(),_.forEach((v,E)=>{const S=v===gh.Back?-1:E;this._handlesToButtons.set(S,v)}),this.update({buttons:_.map((v,E)=>({...c(v.iconPath),tooltip:v.tooltip,handle:v===gh.Back?-1:E,location:w?v.location:void 0}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(_){this._value=_,this._onDidChangeValueEmitter.fire(_)}_fireDidTriggerButton(_){const w=this._handlesToButtons.get(_);w&&this._onDidTriggerButtonEmitter.fire(w)}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=Ar(this._disposables),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this._onDidDispose(),i.$dispose(this._id))}update(_){if(!this._disposed){for(const w of Object.keys(_)){const v=_[w];this._pendingUpdate[w]=v===void 0?null:v}"visible"in this._pendingUpdate?(this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){i.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}};f._nextId=1;let r=f;function o(p){if(p instanceof Kn)return{id:p.id};const _=l(p),w=a(p);return{dark:typeof _=="string"?x.file(_):_,light:typeof w=="string"?x.file(w):w}}function a(p){return typeof p=="object"&&"light"in p?p.light:p}function l(p){return typeof p=="object"&&"dark"in p?p.dark:p}function c(p){const _=o(p);let w,v;return"id"in _?v=sn.asClassName(_):w=_,{iconPath:w,iconClass:v}}class u extends r{constructor(_,w){super(_,w),this._items=[],this._handlesToItems=new Map,this._itemsToHandles=new Map,this._canSelectMany=!1,this._matchOnDescription=!0,this._matchOnDetail=!0,this._sortByLabel=!0,this._keepScrollPosition=!1,this._activeItems=[],this._onDidChangeActiveEmitter=new N,this._selectedItems=[],this._onDidChangeSelectionEmitter=new N,this._onDidTriggerItemButtonEmitter=new N,this.onDidChangeActive=this._onDidChangeActiveEmitter.event,this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event,this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:"quickPick"})}get items(){return this._items}set items(_){this._items=_.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),_.forEach((E,S)=>{this._handlesToItems.set(S,E),this._itemsToHandles.set(E,S)});const w=dt(this._extension,"quickPickItemTooltip"),v=[];for(let E=0;E<_.length;E++){const S=_[E];if(S.kind===mh.Separator)v.push({type:"separator",label:S.label});else{S.tooltip&&!w&&console.warn(`Extension '${this._extension.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`);const A=S.iconPath?c(S.iconPath):void 0;v.push({handle:E,label:S.label,iconPath:A?.iconPath,iconClass:A?.iconClass,description:S.description,detail:S.detail,picked:S.picked,alwaysShow:S.alwaysShow,tooltip:w?Re.fromStrict(S.tooltip):void 0,buttons:S.buttons?.map((G,W)=>({...c(G.iconPath),tooltip:G.tooltip,handle:W}))})}}this.update({items:v})}get canSelectMany(){return this._canSelectMany}set canSelectMany(_){this._canSelectMany=_,this.update({canSelectMany:_})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(_){this._matchOnDescription=_,this.update({matchOnDescription:_})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(_){this._matchOnDetail=_,this.update({matchOnDetail:_})}get sortByLabel(){return this._sortByLabel}set sortByLabel(_){this._sortByLabel=_,this.update({sortByLabel:_})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(_){this._keepScrollPosition=_,this.update({keepScrollPosition:_})}get activeItems(){return this._activeItems}set activeItems(_){this._activeItems=_.filter(w=>this._itemsToHandles.has(w)),this.update({activeItems:this._activeItems.map(w=>this._itemsToHandles.get(w))})}get selectedItems(){return this._selectedItems}set selectedItems(_){this._selectedItems=_.filter(w=>this._itemsToHandles.has(w)),this.update({selectedItems:this._selectedItems.map(w=>this._itemsToHandles.get(w))})}_fireDidChangeActive(_){const w=rn(_.map(v=>this._handlesToItems.get(v)));this._activeItems=w,this._onDidChangeActiveEmitter.fire(w)}_fireDidChangeSelection(_){const w=rn(_.map(v=>this._handlesToItems.get(v)));this._selectedItems=w,this._onDidChangeSelectionEmitter.fire(w)}_fireDidTriggerItemButton(_,w){const v=this._handlesToItems.get(_);if(!v||!v.buttons||!v.buttons.length)return;const E=v.buttons[w];E&&this._onDidTriggerItemButtonEmitter.fire({button:E,item:v})}}class d extends r{constructor(_,w){super(_,w),this._password=!1,this.update({type:"inputBox"})}get password(){return this._password}set password(_){this._password=_,this.update({password:_})}get prompt(){return this._prompt}set prompt(_){this._prompt=_,this.update({prompt:_})}get validationMessage(){return this._validationMessage}set validationMessage(_){this._validationMessage=_,_?typeof _=="string"?this.update({validationMessage:_,severity:Qt.Error}):this.update({validationMessage:_.message,severity:_.severity??Qt.Error}):this.update({validationMessage:void 0,severity:Qt.Ignore})}}return new s(e,t)}const R4=new gi(()=>{const n=MP.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function zU(n,e,t=!1){const i=n||"",s=e||"",r=R4.value.collator.compare(i,s);return R4.value.collatorIsNumeric&&r===0&&i!==s?i<s?-1:1:r}function qU(n,e,t=!1){return t||(n=n&&n.toLowerCase(),e=e&&e.toLowerCase()),n===e?0:n<e?-1:1}function _p(n,e,t=!1){const i=n.split(cs),s=e.split(cs),r=i.length-1,o=s.length-1;let a,l;for(let c=0;;c++){if(a=r===c,l=o===c,a&&l)return zU(i[c],s[c],t);if(a)return-1;if(l)return 1;const u=qU(i[c],s[c],t);if(u!==0)return u}}var nx;function L4(n){return n instanceof x}function jU(n,e){return n.scheme===le.file&&e.scheme===le.file&&yo?n.toString()===e.toString():n.toString().toLowerCase()===e.toString().toLowerCase()}function Dv(n){if(n)return typeof n.iconPath=="string"?x.file(n.iconPath):x.isUri(n.iconPath)||sn.isThemeIcon(n.iconPath)?n.iconPath:void 0}function La(n){if(n){if(x.isUri(n))return n;if(sn.isThemeIcon(n))return n;{const e=n;return{light:e.light,dark:e.dark}}}else return}function GU(n){const e=La(n.authorIcon),t=n.references?.map(i=>({...i,icon:La(i.icon)}));return{...n,authorIcon:e,references:t}}function Iv(n){return n?{...n,icon:La(n.icon)}:void 0}function Cv(n,e){if(!n.iconPath&&!e.iconPath)return 0;if(n.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof n.iconPath=="string"?n.iconPath:x.isUri(n.iconPath)?n.iconPath.fsPath:n.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:x.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return _p(t,i)}function KU(n,e){let t=0;if(n.strikeThrough!==e.strikeThrough)return n.strikeThrough?1:-1;if(n.faded!==e.faded)return n.faded?1:-1;if(n.tooltip!==e.tooltip)return(n.tooltip||"").localeCompare(e.tooltip||"");if(t=Cv(n,e),t!==0)return t;if(n.light&&e.light)t=Cv(n.light,e.light);else{if(n.light)return 1;if(e.light)return-1}if(t!==0)return t;if(n.dark&&e.dark)t=Cv(n.dark,e.dark);else{if(n.dark)return 1;if(e.dark)return-1}return t}function QU(n,e){if(n.command!==e.command)return n.command<e.command?-1:1;if(n.title!==e.title)return n.title<e.title?-1:1;if(n.tooltip!==e.tooltip){if(n.tooltip!==void 0&&e.tooltip!==void 0)return n.tooltip<e.tooltip?-1:1;if(n.tooltip!==void 0)return 1;if(e.tooltip!==void 0)return-1}if(n.arguments===e.arguments)return 0;if(n.arguments)if(e.arguments){if(n.arguments.length!==e.arguments.length)return n.arguments.length-e.arguments.length}else return 1;else return-1;for(let t=0;t<n.arguments.length;t++){const i=n.arguments[t],s=e.arguments[t];if(i!==s&&!(L4(i)&&L4(s)&&jU(i,s)))return i<s?-1:1}return 0}function N4(n,e){let t=_p(n.resourceUri.fsPath,e.resourceUri.fsPath,!0);if(t!==0)return t;if(n.command&&e.command)t=QU(n.command,e.command);else{if(n.command)return 1;if(e.command)return-1}if(t!==0)return t;if(n.decorations&&e.decorations)t=KU(n.decorations,e.decorations);else{if(n.decorations)return 1;if(e.decorations)return-1}if(t!==0)return t;if(n.multiFileDiffEditorModifiedUri&&e.multiFileDiffEditorModifiedUri)t=_p(n.multiFileDiffEditorModifiedUri.fsPath,e.multiFileDiffEditorModifiedUri.fsPath,!0);else{if(n.multiFileDiffEditorModifiedUri)return 1;if(e.multiFileDiffEditorModifiedUri)return-1}if(t!==0)return t;if(n.multiDiffEditorOriginalUri&&e.multiDiffEditorOriginalUri)t=_p(n.multiDiffEditorOriginalUri.fsPath,e.multiDiffEditorOriginalUri.fsPath,!0);else{if(n.multiDiffEditorOriginalUri)return 1;if(e.multiDiffEditorOriginalUri)return-1}return t}function JU(n,e){for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function XU(n,e){return n.command===e.command&&n.title===e.title&&n.tooltip===e.tooltip&&(n.arguments&&e.arguments?JU(n.arguments,e.arguments):n.arguments===e.arguments)}function YU(n,e){return Pi(n,e,XU)}class ZU{#e;#t;get value(){return this._value}set value(e){e=e??"",this.#e.$setInputBoxValue(this._sourceControlHandle,e),this.updateValue(e)}get onDidChange(){return this._onDidChange.event}get placeholder(){return this._placeholder}set placeholder(e){this.#e.$setInputBoxPlaceholder(this._sourceControlHandle,e),this._placeholder=e}get validateInput(){return $(this._extension,"scmValidation"),this._validateInput}set validateInput(e){if($(this._extension,"scmValidation"),e&&typeof e!="function")throw new Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);this._validateInput=e,this.#e.$setValidationProviderIsEnabled(this._sourceControlHandle,!!e)}get enabled(){return this._enabled}set enabled(e){e=!!e,this._enabled!==e&&(this._enabled=e,this.#e.$setInputBoxEnablement(this._sourceControlHandle,e))}get visible(){return this._visible}set visible(e){e=!!e,this._visible!==e&&(this._visible=e,this.#e.$setInputBoxVisibility(this._sourceControlHandle,e))}get document(){return $(this._extension,"scmTextDocument"),this.#t.getDocument(this._documentUri)}constructor(e,t,i,s,r){this._extension=e,this._sourceControlHandle=s,this._documentUri=r,this._value="",this._onDidChange=new N,this._placeholder="",this._enabled=!0,this._visible=!0,this.#t=t,this.#e=i}showValidationMessage(e,t){$(this._extension,"scmValidation"),this.#e.$showValidationMessage(this._sourceControlHandle,e,t)}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}}const B1=class B1{get disposed(){return this._disposed}get id(){return this._id}get label(){return this._label}set label(e){this._label=e,this._proxy.$updateGroupLabel(this._sourceControlHandle,this.handle,e)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get hideWhenEmpty(){return this._hideWhenEmpty}set hideWhenEmpty(e){this._hideWhenEmpty=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get features(){return{contextValue:this.contextValue,hideWhenEmpty:this.hideWhenEmpty}}get resourceStates(){return[...this._resourceStates]}set resourceStates(e){this._resourceStates=[...e],this._onDidUpdateResourceStates.fire()}constructor(e,t,i,s,r,o,a){this._proxy=e,this._commands=t,this._sourceControlHandle=i,this._id=s,this._label=r,this.multiDiffEditorEnableViewChanges=o,this._extension=a,this._resourceHandlePool=0,this._resourceStates=[],this._resourceStatesMap=new Map,this._resourceStatesCommandsMap=new Map,this._resourceStatesDisposablesMap=new Map,this._onDidUpdateResourceStates=new N,this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event,this._disposed=!1,this._onDidDispose=new N,this.onDidDispose=this._onDidDispose.event,this._handlesSnapshot=[],this._resourceSnapshot=[],this._contextValue=void 0,this._hideWhenEmpty=void 0,this.handle=B1._handlePool++}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){const i=this._resourceStatesCommandsMap.get(e);return i?Ln(()=>this._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(N4),i=W4(this._resourceSnapshot,e,N4).map(o=>{const a=o.toInsert.map(l=>{const c=this._resourceHandlePool++;this._resourceStatesMap.set(c,l);const u=l.resourceUri;let d;if(l.command)if(l.command.command==="vscode.open"||l.command.command==="vscode.diff"||l.command.command==="vscode.changes"){const ne=new xe;d=this._commands.converter.toInternal(l.command,ne),this._resourceStatesDisposablesMap.set(c,ne)}else this._resourceStatesCommandsMap.set(c,l.command);const f=dt(this._extension,"scmMultiDiffEditor"),p=f?l.multiDiffEditorOriginalUri:void 0,_=f?l.multiFileDiffEditorModifiedUri:void 0,w=Dv(l.decorations),v=l.decorations&&Dv(l.decorations.light)||w,E=l.decorations&&Dv(l.decorations.dark)||w,S=[v,E],A=l.decorations&&l.decorations.tooltip||"",G=l.decorations&&!!l.decorations.strikeThrough,W=l.decorations&&!!l.decorations.faded,ce=l.contextValue||"";return{rawResource:[c,u,S,A,G,W,ce,d,p,_],handle:c}});return{start:o.start,deleteCount:o.deleteCount,toInsert:a}}),s=i.map(({start:o,deleteCount:a,toInsert:l})=>[o,a,l.map(c=>c.rawResource)]),r=i.reverse();for(const{start:o,deleteCount:a,toInsert:l}of r){const c=l.map(d=>d.handle),u=this._handlesSnapshot.splice(o,a,...c);for(const d of u)this._resourceStatesMap.delete(d),this._resourceStatesCommandsMap.delete(d),this._resourceStatesDisposablesMap.get(d)?.dispose(),this._resourceStatesDisposablesMap.delete(d)}return this._resourceSnapshot=e,s}dispose(){this._disposed=!0,this._onDidDispose.fire()}};B1._handlePool=0;let ix=B1;var un;const W1=class W1{constructor(e,t,i,s,r,o,a){mf(this,un);this._extension=e,this._commands=s,this._id=r,this._label=o,this._rootUri=a,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._secondaryQuickDiffProvider=void 0,this._historyProviderDisposable=new ao,this._commitTemplate=void 0,this._acceptInputDisposables=new ao,this._acceptInputCommand=void 0,this._actionButtonDisposables=new ao,this._statusBarDisposables=new ao,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new N,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=W1._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,_f(this,un,i);const l=x.from({scheme:le.vscodeSourceControl,path:`${r}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new ZU(e,t,Jt(this,un),this.handle,l),Jt(this,un).$registerSourceControl(this.handle,r,o,a,l)}get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,Jt(this,un).$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;dt(this._extension,"quickDiffProvider")&&(t=e?.label),Jt(this,un).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get secondaryQuickDiffProvider(){return $(this._extension,"quickDiffProvider"),this._secondaryQuickDiffProvider}set secondaryQuickDiffProvider(e){$(this._extension,"quickDiffProvider"),this._secondaryQuickDiffProvider=e;const t=e?.label;Jt(this,un).$updateSourceControl(this.handle,{hasSecondaryQuickDiffProvider:!!e,secondaryQuickDiffLabel:t})}get historyProvider(){return $(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){$(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new xe,Jt(this,un).$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&(this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemRefs(()=>{const t=Iv(e?.currentHistoryItemRef),i=Iv(e?.currentHistoryItemRemoteRef),s=Iv(e?.currentHistoryItemBaseRef);Jt(this,un).$onDidChangeHistoryProviderCurrentHistoryItemRefs(this.handle,t,i,s)})),this._historyProviderDisposable.value.add(e.onDidChangeHistoryItemRefs(t=>{if(t.added.length===0&&t.modified.length===0&&t.removed.length===0)return;const i=t.added.map(o=>({...o,icon:La(o.icon)})),s=t.modified.map(o=>({...o,icon:La(o.icon)})),r=t.removed.map(o=>({...o,icon:La(o.icon)}));Jt(this,un).$onDidChangeHistoryProviderHistoryItemRefs(this.handle,{added:i,modified:s,removed:r,silent:t.silent})})))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,Jt(this,un).$updateSourceControl(this.handle,{commitTemplate:e}))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new xe,this._acceptInputCommand=e;const t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);Jt(this,un).$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return $(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){if($(this._extension,"scmActionButton"),dw(this._actionButton,e))return;this._actionButton=e,this._actionButtonDisposables.value=new xe;const t=e!==void 0?{command:{...this._commands.converter.toInternal(e.command,this._actionButtonDisposables.value),shortTitle:e.command.shortTitle},secondaryCommands:e.secondaryCommands?.map(i=>i.map(s=>this._commands.converter.toInternal(s,this._actionButtonDisposables.value))),enabled:e.enabled}:void 0;Jt(this,un).$updateSourceControl(this.handle,{actionButton:t??null})}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&YU(this._statusBarCommands,e))return;this._statusBarDisposables.value=new xe,this._statusBarCommands=e;const t=(e||[]).map(i=>this._commands.converter.toInternal(i,this._statusBarDisposables.value));Jt(this,un).$updateSourceControl(this.handle,{statusBarCommands:t})}get selected(){return this._selected}createResourceGroup(e,t,i){const s=dt(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,r=new ix(Jt(this,un),this._commands,this.handle,e,t,s,this._extension),o=Ut.once(r.onDidDispose)(()=>this.createdResourceGroups.delete(r));return this.createdResourceGroups.set(r,o),this.eventuallyAddResourceGroups(),r}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,s]of this.createdResourceGroups){s.dispose();const r=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});Ut.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),r.dispose(),this._groups.delete(i.handle),Jt(this,un).$unregisterGroup(this.handle,i.handle)}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const o=i._takeResourceStateSnapshot();o.length>0&&t.push([i.handle,o]),this._groups.set(i.handle,i)}Jt(this,un).$registerGroups(this.handle,e,t),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){const e=[];this.updatedResourceGroups.forEach(t=>{const i=t._takeResourceStateSnapshot();i.length!==0&&e.push([t.handle,i])}),e.length>0&&Jt(this,un).$spliceResourceStates(this.handle,e),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._groups.forEach(e=>e.dispose()),Jt(this,un).$unregisterSourceControl(this.handle)}};un=new WeakMap,W1._handlePool=0;let el=W1;el.__decorator=V([FP(100)],el.prototype,"eventuallyAddResourceGroups",null);el.__decorator=V([FP(100)],el.prototype,"eventuallyUpdateResourceStates",null);var Ha;let sx=(Ha=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,s){this._commands=t,this._extHostDocuments=i,this.logService=s,this._sourceControls=new Map,this._sourceControlsByExtension=new Lr,this._onDidChangeActiveProvider=new N,this._proxy=e.getProxy(ee.MainThreadSCM),this._telemetry=e.getProxy(ee.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:r=>{if(r&&r.$mid===st.ScmResource){const o=this._sourceControls.get(r.sourceControlHandle);if(!o)return r;const a=o.getResourceGroup(r.groupHandle);return a?a.getResourceState(r.handle):r}else if(r&&r.$mid===st.ScmResourceGroup){const o=this._sourceControls.get(r.sourceControlHandle);return o?o.getResourceGroup(r.groupHandle):r}else if(r&&r.$mid===st.ScmProvider){const o=this._sourceControls.get(r.handle);return o||r}return r}})}createSourceControl(e,t,i,s){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,s),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const r=nx._handlePool++,o=new el(e,this._extHostDocuments,this._proxy,this._commands,t,i,s);this._sourceControls.set(r,o);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(o),this._sourceControlsByExtension.set(e.identifier,a),o}getLastInputBox(e){this.logService.trace("ExtHostSCM#getLastInputBox",e.identifier.value);const t=this._sourceControlsByExtension.get(e.identifier),i=t&&t[t.length-1];return i&&i.inputBox}$provideOriginalResource(e,t,i){const s=x.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,s.toString());const r=this._sourceControls.get(e);return!r||!r.quickDiffProvider||!r.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Ln(()=>r.quickDiffProvider.provideOriginalResource(s,i)).then(o=>o||null)}$provideSecondaryOriginalResource(e,t,i){const s=x.revive(t);this.logService.trace("ExtHostSCM#$provideSecondaryOriginalResource",e,s.toString());const r=this._sourceControls.get(e);return!r||!r.secondaryQuickDiffProvider||!r.secondaryQuickDiffProvider.provideOriginalResource?Promise.resolve(null):Ln(()=>r.secondaryQuickDiffProvider.provideOriginalResource(s,i)).then(o=>o||null)}$onInputBoxValueChange(e,t){this.logService.trace("ExtHostSCM#$onInputBoxValueChange",e);const i=this._sourceControls.get(e);return i&&i.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,i,s){this.logService.trace("ExtHostSCM#$executeResourceCommand",e,t,i);const r=this._sourceControls.get(e);if(!r)return Promise.resolve(void 0);const o=r.getResourceGroup(t);return o?o.$executeResourceCommand(i,s):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const s=this._sourceControls.get(e);return!s||!s.inputBox.validateInput?Promise.resolve(void 0):Ln(()=>s.inputBox.validateInput(t,i)).then(r=>{if(!r)return Promise.resolve(void 0);const o=Re.fromStrict(r.message);return o?Promise.resolve([o,r.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace("ExtHostSCM#$setSelectedSourceControl",e),e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e,Promise.resolve(void 0)}async $resolveHistoryItemChatContext(e,t,i){try{return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemChatContext(t,i)??void 0}catch(s){this.logService.error("ExtHostSCM#$resolveHistoryItemChatContext",s);return}}async $resolveHistoryItemRefsCommonAncestor(e,t,i){try{return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemRefsCommonAncestor(t,i)??void 0}catch(s){this.logService.error("ExtHostSCM#$resolveHistoryItemRefsCommonAncestor",s);return}}async $provideHistoryItemRefs(e,t,i){try{return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemRefs(t,i))?.map(o=>({...o,icon:La(o.icon)}))??void 0}catch(s){this.logService.error("ExtHostSCM#$provideHistoryItemRefs",s);return}}async $provideHistoryItems(e,t,i){try{return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i))?.map(o=>GU(o))??void 0}catch(s){this.logService.error("ExtHostSCM#$provideHistoryItems",s);return}}async $provideHistoryItemChanges(e,t,i,s){try{return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,s)??void 0}catch(r){this.logService.error("ExtHostSCM#$provideHistoryItemChanges",r);return}}},nx=Ha,Ha._handlePool=0,Ha);sx=nx=V([L(3,at)],sx);const V1=class V1{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(ee.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:z.to(t.selection),resourceUri:x.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=V1.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,Qc.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};V1.handlePool=0;let rx=V1;const z1=class z1{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(ee.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const s=this.providers.get(e);if(!s)return;const r=new xe,o=new Nt;this.sessions.set(t,o);const a=await s.provideSpeechToTextSession(o.token,i?{language:i}:void 0);a&&(r.add(a.onDidChange(l=>{o.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,l)})),r.add(o.token.onCancellationRequested(()=>r.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,i){const s=this.providers.get(e);if(!s)return;const r=new xe,o=new Nt;this.sessions.set(t,o);const a=await s.provideTextToSpeechSession(o.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),r.add(a.onDidChange(l=>{o.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,l)})),r.add(o.token.onCancellationRequested(()=>r.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){const i=this.providers.get(e);if(!i)return;const s=new xe,r=new Nt;this.sessions.set(t,r);const o=await i.provideKeywordRecognitionSession(r.token);o&&(s.add(o.onDidChange(a=>{r.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),s.add(r.token.onCancellationRequested(()=>s.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const s=z1.ID_POOL++;return this.providers.set(s,i),this.proxy.$registerProvider(s,t,{extension:e,displayName:e.value}),we(()=>{this.proxy.$unregisterProvider(s),this.providers.delete(s)})}};z1.ID_POOL=1;let ox=z1;var Dc,Ic;const na=class na{constructor(e,t,i,s,r,o=uo.Left,a,l){mf(this,Dc);mf(this,Ic);if(this._onDispose=l,this._disposed=!1,this._text="",this._staleCommandRegistrations=new xe,_f(this,Dc,e),_f(this,Ic,t),r&&s){this._entryId=d3(s.identifier,r);const c=i.get(this._entryId);c&&(o=c.alignLeft?uo.Left:uo.Right,a=c.priority,this._visible=!0,this.name=c.name,this.text=c.text,this.tooltip=c.tooltip,this.command=c.command,this.accessibilityInformation=c.accessibilityInformation)}else this._entryId=String(na.ID_GEN++);this._extension=s,this._id=r,this._alignment=o,this._priority=this.validatePriority(a)}validatePriority(e){if(ga(e))return e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get entryId(){return this._entryId}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get tooltip2(){return this._extension&&$(this._extension,"statusBarItemTooltip"),this._tooltip2}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set tooltip2(e){this._extension&&$(this._extension,"statusBarItemTooltip"),this._tooltip2=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(e){e&&!na.ALLOWED_BACKGROUND_COLORS.has(e.id)&&(e=void 0),this._backgroundColor=e,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new xe,typeof e=="string"?this._command={fromApi:e,internal:Jt(this,Ic).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:Jt(this,Ic).toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,Jt(this,Dc).$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let e;this._extension?this._id?e=`${this._extension.identifier.value}.${this._id}`:e=this._extension.identifier.value:e=this._id;let t;this._name?t=this._name:t=h(2590,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=na.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));let s,r;typeof this._tooltip2=="function"?(s=Re.fromStrict(this._tooltip),r=!0):(s=Re.fromStrict(this._tooltip2??this._tooltip),r=!1),Jt(this,Dc).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,s,r,this._command?.internal,i,this._backgroundColor,this._alignment===uo.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._onDispose?.(),this._disposed=!0}};Dc=new WeakMap,Ic=new WeakMap,na.ID_GEN=0,na.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new oh("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new oh("statusBarItem.warningForeground")]]);let ax=na;class e${constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",uo.Left,Number.MIN_VALUE),this._item.name=h(2591,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new je(()=>{const i=this._messages.indexOf(t);i>=0&&(this._messages.splice(i,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}}class t${constructor(e,t){this._entries=new Map,this._existingItems=new Map,this._proxy=e.getProxy(ee.MainThreadStatusBar),this._commands=t,this._statusMessage=new e$(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}async $provideTooltip(e,t){const i=this._entries.get(e);if(!i)return;const s=typeof i.tooltip2=="function"?await i.tooltip2(t):i.tooltip2;return t.isCancellationRequested?void 0:Re.fromStrict(s)}createStatusBarEntry(e,t,i,s){const r=new ax(this._proxy,this._commands,this._existingItems,e,t,i,s,()=>this._entries.delete(r.entryId));return this._entries.set(r.entryId,r),r}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let s;return typeof t=="number"?s=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new je(()=>{i.dispose(),clearTimeout(s)})}}class n$ extends Se{constructor(e,t){super(),this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=new N,this._onDidChangeTextEditorOptions=new N,this._onDidChangeTextEditorVisibleRanges=new N,this._onDidChangeTextEditorViewColumn=new N,this._onDidChangeTextEditorDiffInformation=new N,this._onDidChangeActiveTextEditor=new N,this._onDidChangeVisibleTextEditors=new N,this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event,this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event,this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event,this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event,this.onDidChangeTextEditorDiffInformation=this._onDidChangeTextEditorDiffInformation.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this._proxy=e.getProxy(ee.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i))),this._register(this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(i=>this._onDidChangeActiveTextEditor.fire(i)))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){const t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(i=>i.value)}async showTextDocument(e,t,i){let s;typeof t=="number"?s={position:hn.from(t),preserveFocus:i}:typeof t=="object"?s={position:hn.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?z.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:s={preserveFocus:!1};const r=await this._proxy.$tryShowTextDocument(e.uri,s),o=r&&this._extHostDocumentsAndEditors.getEditor(r);if(o)return o.value;throw r?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new o0(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(t.options&&i._acceptOptions(t.options),t.selections){const s=t.selections.selections.map(hs.to);i._acceptSelections(s)}if(t.visibleRanges){const s=rn(t.visibleRanges.map(z.to));i._acceptVisibleRanges(s)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:gc.to(t.options.lineNumbers)}}),t.selections){const s=Bc.fromValue(t.selections.source),r=t.selections.selections.map(hs.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:r,kind:s})}if(t.visibleRanges){const s=rn(t.visibleRanges.map(z.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:s})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const s=hn.to(e[t]);i.value.viewColumn!==s&&(i._acceptViewColumn(s),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:s}))}}$acceptEditorDiffInformation(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(!t){i._acceptDiffInformation(void 0),this._onDidChangeTextEditorDiffInformation.fire({textEditor:i.value,diffInformation:void 0});return}const s=this,r=t.map(o=>{const a=x.revive(o.original),l=x.revive(o.modified),c=o.changes.map(u=>{const[d,f,p,_]=u;let w;return d===f?w=lc.Addition:p===_?w=lc.Deletion:w=lc.Modification,{original:{startLineNumber:d,endLineNumberExclusive:f},modified:{startLineNumber:p,endLineNumberExclusive:_},kind:w}});return Object.freeze({documentVersion:o.documentVersion,original:a,modified:l,changes:c,get isStale(){return s._extHostDocumentsAndEditors.getDocument(l)?.version!==o.documentVersion}})});i._acceptDiffInformation(r),this._onDidChangeTextEditorDiffInformation.fire({textEditor:i.value,diffInformation:r})}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let lx=class{constructor(e){this._actual=new Jg(oo.Dark),this._onDidChangeActiveColorTheme=new N}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=oo.Light;break;case"hcDark":t=oo.HighContrast;break;case"hcLight":t=oo.HighContrastLight;break;default:t=oo.Dark}this._actual=new Jg(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};lx=V([L(0,nt)],lx);class i${constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(ee.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,s)=>{if(i&&i.$mid===st.TimelineActionContext)if(this._providers.get(i.source)&&s&&dt(s,"timeline")){const r=i.uri===void 0?void 0:x.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(O4(r))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,s){return this._providers.get(e)?.provider.provideTimeline(x.revive(t),i,s)}registerTimelineProvider(e,t,i,s){const r=new xe,o=this.convertTimelineItem(t.id,s,r).bind(this);let a;t.onDidChange&&(a=t.onDidChange(c=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...c,id:t.id}),this));const l=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(c,u,d){u?.resetCache&&(r.clear(),l.get(t.id)?.clear());const f=await t.provideTimeline(c,u,d);if(f==null)return;const p=o(c,u);return{...f,source:t.id,items:f.items.map(p)}},dispose(){for(const c of l.values())c.get(t.id)?.clear();a?.dispose(),r.dispose()}},i)}convertTimelineItem(e,t,i){return(s,r)=>{let o;if(r?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const l=O4(s);o=a.get(l),o===void 0&&(o=new Map,a.set(l,o))}return a=>{const{iconPath:l,...c}=a,u=`${e}|${a.id??a.timestamp}`;o?.set(u,a);let d,f,p;a.iconPath&&(l instanceof Kn?p={id:l.id,color:l.color}:x.isUri(l)?(d=l,f=l):{light:d,dark:f}=l);let _;return mi.isMarkdownString(c.tooltip)?_=Re.from(c.tooltip):it(c.tooltip)?_=c.tooltip:mi.isMarkdownString(c.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),_=Re.from(c.detail)):it(c.detail)&&(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),_=c.detail),{...c,id:c.id??void 0,handle:u,source:e,command:a.command?t.toInternal(a.command,i):void 0,icon:d,iconDark:f,themeIcon:p,tooltip:_,accessibilityInformation:a.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw new Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),we(()=>{for(const s of this._itemsBySourceAndUriMap.values())s.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function O4(n){return n?.toString()}h(4044,"Views");af("default-view-icon",_e.window,h(4045,"Default view icon."));var l1;(function(n){n.ViewContainersRegistry="workbench.registry.view.containers",n.ViewsRegistry="workbench.registry.view"})(l1||(l1={}));var xd;(function(n){n[n.Sidebar=0]="Sidebar",n[n.Panel=1]="Panel",n[n.AuxiliaryBar=2]="AuxiliaryBar"})(xd||(xd={}));xd.Sidebar,xd.Panel,xd.AuxiliaryBar;class s$ extends Se{constructor(){super(...arguments),this._onDidRegister=this._register(new N),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new N),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,i){const s=this.get(e.id);if(s)return s;const r=e;return r.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:r.openCommandActionDescriptor??{id:r.id},A5(this.viewContainers,t,[]).push(r),i?.isDefault&&this.defaultViewContainers.push(r),this._onDidRegister.fire({viewContainer:r,viewContainerLocation:t}),r}deregisterViewContainer(e){for(const t of this.viewContainers.keys()){const i=this.viewContainers.get(t),s=i?.indexOf(e);if(s!==-1){i?.splice(s,1),i.length===0&&this.viewContainers.delete(t),this._onDidDeregister.fire({viewContainer:e,viewContainerLocation:t});return}}}get(e){return this.all.filter(t=>t.id===e)[0]}getViewContainers(e){return[...this.viewContainers.get(e)||[]]}getViewContainerLocation(e){return[...this.viewContainers.keys()].filter(t=>this.getViewContainers(t).filter(i=>i?.id===e.id).length>0)[0]}getDefaultViewContainer(e){return this.defaultViewContainers.find(t=>this.getViewContainerLocation(t)===e)}}mn.add(l1.ViewContainersRegistry,new s$);var c1;(function(n){n.Open="2_open",n.Debug="4_debug",n.SCM="5_scm",n.More="9_more"})(c1||(c1={}));function r$(n,e){const t=n.group??c1.More,i=e.group??c1.More;return t!==i?t.localeCompare(i):(n.order??5)-(e.order??5)}class o$ extends Se{constructor(){super(...arguments),this._onViewsRegistered=this._register(new N),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new N),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new N),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new N),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new F5}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:t,viewContainer:i})=>this.addViews(t,i)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){const i=this.removeViews(e,t);i.length&&this._onViewsDeregistered.fire({views:i,viewContainer:t})}moveViews(e,t){for(const i of this._views.keys())if(i!==t){const s=this.removeViews(e,i);s.length&&(this.addViews(s,t),this._onDidChangeContainer.fire({views:s,from:i,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(const t of this._viewContainers){const i=(this._views.get(t)||[]).filter(s=>s.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(s=>s.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),we(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){const i=new Map;for(const[s,r]of t)this._viewWelcomeContents.add(e,r),i.set(s,we(()=>{this._viewWelcomeContents.delete(e,r),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),i}getViewWelcomeContent(e){const t=[];return this._viewWelcomeContents.forEach(e,i=>t.push(i)),t.sort(r$)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const s of e){if(this.getView(s.id)!==null)throw new Error(h(4046,"A view with id '{0}' is already registered",s.id));i.push(s)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const s=[],r=[];for(const o of i)e.includes(o)?s.push(o):r.push(o);return s.length&&(r.length?this._views.set(t,r):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),s}}mn.add(l1.ViewsRegistry,new o$);var F4;(function(n){n[n.Default=0]="Default",n[n.Expand=1]="Expand"})(F4||(F4={}));var M4;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(M4||(M4={}));class tr extends Error{constructor(e){super(h(4047,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return!!e&&e.name==="NoTreeViewError"}}class a${constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}}function U4(n,e){if(it(n))return{label:n};if(n&&typeof n=="object"&&typeof n.label=="string"){let t;return Array.isArray(n.highlights)&&(t=n.highlights.filter(i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number"),t=t.length?t:void 0),{label:n.label,highlights:t}}}class l$ extends Se{constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new a$;function s(r){return r&&r.$treeViewId&&(r.$treeItemHandle||r.$selectedTreeItems||r.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:r=>s(r)?this.convertArgument(r):Array.isArray(r)&&r.length>0?r.map(o=>s(o)?this.convertArgument(o):o):r})}registerTreeDataProvider(e,t,i){const s=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>s.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const s=t.dragAndDropController?.dropMimeTypes??[],r=t.dragAndDropController?.dragMimeTypes??[],o=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,l=this.createExtHostTreeView(e,t,i),c={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:s,dragMimeTypes:r,hasHandleDrag:o,hasHandleDrop:a,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},u=this._proxy.$registerTreeViewDataProvider(e,c),d={get onDidCollapseElement(){return l.onDidCollapseElement},get onDidExpandElement(){return l.onDidExpandElement},get selection(){return l.selectedElements},get onDidChangeSelection(){return l.onDidChangeSelection},get activeItem(){return $(i,"treeViewActiveItem"),l.focusedElement},get onDidChangeActiveItem(){return $(i,"treeViewActiveItem"),l.onDidChangeActiveItem},get visible(){return l.visible},get onDidChangeVisibility(){return l.onDidChangeVisibility},get onDidChangeCheckboxState(){return l.onDidChangeCheckboxState},get message(){return l.message},set message(f){Fr(f)&&$(i,"treeViewMarkdownMessage"),l.message=f},get title(){return l.title},set title(f){l.title=f},get description(){return l.description},set description(f){l.description=f},get badge(){return l.badge},set badge(f){f!==void 0&&tb.isViewBadge(f)?l.badge={value:Math.floor(Math.abs(f.value)),tooltip:f.tooltip}:f===void 0&&(l.badge=void 0)},reveal:(f,p)=>l.reveal(f,p),dispose:async()=>{await u,this.treeViews.delete(e),l.dispose()}};return this._register(d),d}async $getChildren(e,t){const i=this.treeViews.get(e);if(!i)return Promise.reject(new tr(e));if(!t){const r=await i.getChildren();return r?[[0,...r]]:void 0}const s=[];for(let r=0;r<t.length;r++){const o=t[r],a=await i.getChildren(o);a&&s.push([r,...a])}return s}async $handleDrop(e,t,i,s,r,o,a,l){const c=this.treeViews.get(e);if(!c)return Promise.reject(new tr(e));const u=ou.toDataTransfer(i,async d=>(await this._proxy.$resolveDropFileData(e,t,d)).buffer);return a===e&&l&&await this.addAdditionalTransferItems(u,c,l,r,o),c.onDrop(u,s,r)}async addAdditionalTransferItems(e,t,i,s,r){const o=this.treeDragAndDropService.removeDragOperationTransfer(r);if(o)(await o)?.forEach((a,l)=>{a&&e.set(l,a)});else if(r&&t.handleDrag){const a=t.handleDrag(i,e,s);this.treeDragAndDropService.addDragOperationTransfer(r,a),await a}return e}async $handleDrag(e,t,i,s){const r=this.treeViews.get(e);if(!r)return Promise.reject(new tr(e));const o=await this.addAdditionalTransferItems(new qc,r,t,s,i);if(!(!o||s.isCancellationRequested))return ou.from(o)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new tr(e);return t.hasResolve}$resolve(e,t,i){const s=this.treeViews.get(e);if(!s)throw new tr(e);return s.resolveTreeItem(t,i)}$setExpanded(e,t,i){const s=this.treeViews.get(e);if(!s)throw new tr(e);s.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const s=this.treeViews.get(e);if(!s)throw new tr(e);s.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new tr(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new tr(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const s=this._register(new cx(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,s),s}convertArgument(e){const t=this.treeViews.get(e.$treeViewId),i=e;return t&&i.$treeItemHandle?t.getExtensionElement(i.$treeItemHandle):t&&e.$focusedTreeItem?t.focusedElement:null}}const Zl=class Zl extends Se{get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!tn(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,s,r,o){if(super(),this.viewId=e,this.proxy=i,this.commands=s,this.logService=r,this.extension=o,this.roots=void 0,this.elements=new Map,this.nodes=new Map,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new N),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new N),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new N),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new N),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new N),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new N),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new N),this.refreshPromise=Promise.resolve(),this.refreshQueue=Promise.resolve(),this._message="",this._title="",this._refreshCancellationSource=new Nt,o.contributes&&o.contributes.views)for(const u in o.contributes.views)for(const d of o.contributes.views[u])d.id===e&&(this._title=d.name);this.dataProvider=t.treeDataProvider,this.dndController=t.dragAndDropController,this.dataProvider.onDidChangeTreeData&&this._register(this.dataProvider.onDidChangeTreeData(u=>{Array.isArray(u)&&u.length===0||this._onDidChangeData.fire({message:!1,element:u})}));let a,l;const c=Ut.debounce(this._onDidChangeData.event,(u,d)=>(u||(u={message:!1,elements:[]}),d.element!==!1&&(a||(a=new Promise(f=>l=f),this.refreshPromise=this.refreshPromise.then(()=>a)),Array.isArray(d.element)?u.elements.push(...d.element):u.elements.push(d.element)),d.message&&(u.message=!0),u),200,!0);this._register(c(({message:u,elements:d})=>{d.length&&(this.refreshQueue=this.refreshQueue.then(()=>{const f=l;return a=null,this.refresh(d).then(()=>f())})),u&&this.proxy.$setMessage(this.viewId,Re.fromStrict(this._message)??"")}))}async getChildren(e){const t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this.logService.error(`No tree item with id '${e}' found.`),Promise.resolve([]);let i=this.getChildrenNodes(e);return i||(i=await this.fetchChildrenNodes(t)),i?i.map(s=>s.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=tn(t.select)?!0:t.select,s=tn(t.focus)?!1:t.focus,r=tn(t.expand)?!1:t.expand;return typeof this.dataProvider.getParent!="function"?Promise.reject(new Error("Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method")):e?this.refreshPromise.then(()=>this.resolveUnknownParentChain(e)).then(o=>this.resolveTreeNode(e,o[o.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:o.map(l=>l.item)},{select:i,focus:s,expand:r})),o=>this.logService.error(o)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:s,expand:r})}get message(){return this._message}set message(e){this._message=e,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(e){this._title=e,this.proxy.$setTitle(this.viewId,e,this._description)}get description(){return this._description}set description(e){this._description=e,this.proxy.$setTitle(this.viewId,this._title,e)}get badge(){return this._badge}set badge(e){this._badge?.value===e?.value&&this._badge?.tooltip===e?.tooltip||(this._badge=Dm.from(e),this.proxy.$setBadge(this.viewId,e))}setExpanded(e,t){const i=this.getExtensionElement(e);i&&(t?this._onDidExpandElement.fire(Object.freeze({element:i})):this._onDidCollapseElement.fire(Object.freeze({element:i})))}setSelectionAndFocus(e,t){const i=!Pi(this._selectedHandles,e);this._selectedHandles=e;const s=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),s&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(e){e!==this._visible&&(this._visible=e,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(e){const t=(await Promise.all(e.map(async i=>{const s=this.getExtensionElement(i.treeItemHandle);return s?{extensionItem:s,treeItem:await this.dataProvider.getTreeItem(s),newState:i.newState?Is.Checked:Is.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?Is.Checked:Is.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const s=[];for(const r of e){const o=this.getExtensionElement(r);o&&s.push(o)}if(!(!this.dndController?.handleDrag||s.length===0))return await this.dndController.handleDrag(s,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const s=t?this.getExtensionElement(t):void 0;if(!(!s&&t||!this.dndController?.handleDrop))return Ln(()=>this.dndController?.handleDrop?this.dndController.handleDrop(s,e,i):void 0)}get hasResolve(){return!!this.dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this.dataProvider.resolveTreeItem)return;const i=this.elements.get(e);if(i){const s=this.nodes.get(i);if(s){const r=await this.dataProvider.resolveTreeItem(s.extensionItem,i,t)??s.extensionItem;return this.validateTreeItem(r),s.item.tooltip=this.getTooltip(r.tooltip),s.item.command=this.getCommand(s.disposableStore,r.command),s.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(s=>(i.push(s),i))):Promise.resolve([]))}resolveParent(e){const t=this.nodes.get(e);return t?Promise.resolve(t.parent?this.elements.get(t.parent.item.handle):void 0):Ln(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):Ln(()=>this.dataProvider.getTreeItem(e)).then(s=>this.createHandle(e,s,t,!0)).then(s=>this.getChildren(t?t.item.handle:void 0).then(()=>{const r=this.getExtensionElement(s);if(r){const o=this.nodes.get(r);if(o)return Promise.resolve(o)}throw new Error(`Cannot resolve tree item for element ${s} from extension ${this.extension.identifier.value}`)}))}getChildrenNodes(e){if(e){let t;if(typeof e=="string"){const i=this.getExtensionElement(e);t=i?this.nodes.get(i):void 0}else t=e;return t&&t.children||void 0}return this.roots}async fetchChildrenNodes(e){this.clearChildren(e);const t=new Nt(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,s=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const r=rn(s||[]),o=await Promise.all(rn(r).map(l=>this.dataProvider.getTreeItem(l)));if(t.token.isCancellationRequested)return;const a=o.map((l,c)=>l?this.createAndRegisterTreeNode(r[c],l,i):null);return rn(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new Nt,this.clearAll(),this.proxy.$refresh(this.viewId);{const i=this.getHandlesToRefresh(e);if(i.length)return this.refreshHandles(i)}return Promise.resolve(void 0)}getHandlesToRefresh(e){const t=new Set,i=e.map(r=>this.nodes.get(r));for(const r of i)if(r&&!t.has(r.item.handle)){let o=r;for(;o&&o.parent&&i.findIndex(a=>o&&o.parent&&a&&a.item.handle===o.parent.item.handle)===-1;){const a=this.elements.get(o.parent.item.handle);o=a?this.nodes.get(a):void 0}o&&!o.parent&&t.add(r.item.handle)}const s=[];return t.forEach(r=>{const o=this.elements.get(r);if(o){const a=this.nodes.get(o);a&&(!a.parent||!t.has(a.parent.item.handle))&&s.push(r)}}),s}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(s=>{s&&(t[i]=s.item)}))).then(()=>Object.keys(t).length?this.proxy.$refresh(this.viewId,t):void 0)}refreshNode(e){const t=this.getExtensionElement(e);if(t){const i=this.nodes.get(t);if(i)return this.clearChildren(t),Ln(()=>this.dataProvider.getTreeItem(t)).then(s=>{if(s){const r=this.createTreeNode(t,s,i.parent);return this.updateNodeCache(t,r,i,i.parent),i.dispose(),r}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const s=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(s.item.handle))throw new Error(h(2594,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,s),this.addNodeToParentCache(s,i),s}getTooltip(e){return mi.isMarkdownString(e)?Re.from(e):e}getCommand(e,t){return t?{...this.commands.toInternal(t,e),originalId:t.command}:void 0}getCheckbox(e){if(e.checkboxState===void 0)return;let t,i,s;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,s=e.checkboxState.accessibilityInformation),{isChecked:t===Is.Checked,tooltip:i,accessibilityInformation:s}}validateTreeItem(e){if(!$g.isTreeItem(e,this.extension))throw new Error(`Extension ${this.extension.identifier.value} has provided an invalid tree item.`)}createTreeNode(e,t,i){this.validateTreeItem(t);const s=this._register(new xe),r=this.createHandle(e,t,i),o=this.getLightIconPath(t);return{item:{handle:r,parentHandle:i?i.item.handle:void 0,label:U4(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(s,t.command),contextValue:t.contextValue,icon:o,iconDark:this.getDarkIconPath(t)||o,themeIcon:this.getThemeIcon(t),collapsibleState:tn(t.collapsibleState)?Ea.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:s,dispose(){s.dispose()}}}getThemeIcon(e){return e.iconPath instanceof Kn?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:s},r,o){if(t)return`${Zl.ID_HANDLE_PREFIX}/${t}`;const a=U4(i),l=r?r.item.handle:Zl.LABEL_HANDLE_PREFIX;let c=a?a.label:s?Ks(s):"";c=c.indexOf("/")!==-1?c.replace("/","//"):c;const u=this.nodes.has(e)?this.nodes.get(e).item.handle:void 0,d=this.getChildrenNodes(r)||[];let f,p=0;do{if(f=`${l}/${p}:${c}`,o||!this.elements.has(f)||u===f)break;p++}while(p<=d.length);return f}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof Kn))return typeof e.iconPath=="string"||x.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof Kn)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return x.isUri(e)?e:x.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,s){this.elements.delete(t.item.handle),this.nodes.delete(e),t.item.handle!==i.item.handle&&this.elements.delete(i.item.handle),this.addNodeToCache(e,t);const r=this.getChildrenNodes(s)||[],o=r.filter(a=>a.item.handle===i.item.handle)[0];o&&r.splice(r.indexOf(o),1,t)}addNodeToParentCache(e,t){t?(t.children||(t.children=[]),t.children.push(e)):(this.roots||(this.roots=[]),this.roots.push(e))}clearChildren(e){if(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}t.children=void 0}}else this.clearAll()}clear(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}this.nodes.delete(e),this.elements.delete(t.item.handle),t.dispose()}}clearAll(){this.roots=void 0,this.elements.clear(),this.nodes.forEach(e=>e.dispose()),this.nodes.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this.clearAll(),this.proxy.$disposeTree(this.viewId)}};Zl.LABEL_HANDLE_PREFIX="0",Zl.ID_HANDLE_PREFIX="1";let cx=Zl;const q1=class q1{constructor(e){this._openers=new Map,this._proxy=e.getProxy(ee.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,s){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const r=s.schemes.find(o=>!q1.supportedSchemes.has(o));if(r)throw new Error(`Scheme '${r}' is not supported. Only http and https are currently supported.`);return this._openers.set(t,i),this._proxy.$registerUriOpener(t,s.schemes,e,s.label),we(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener with id: ${e}`);const r=x.revive(t);return s.canOpenExternalUri(r,i)}async $openUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener id: '${e}'`);return s.openExternalUri(x.revive(t.resolvedUri),{sourceUri:x.revive(t.sourceUri)},i)}};q1.supportedSchemes=new Set([le.http,le.https]);let ux=q1;class c$ extends Se{#e;#t;#n;#i;#r;#s;#a;#o;#l;#c;#u;#h;#d;constructor(e,t,i,s){super(),this.#o=void 0,this.#l=!0,this.#u=!1,this.#h=this._register(new N),this.onDidDispose=this.#h.event,this.#d=this._register(new N),this.onDidChangeViewState=this.#d.event,this.#e=e,this.#t=t,this.#i=i,this.#n=s.viewType,this.#r=s.panelOptions,this.#o=s.viewColumn,this.#s=s.title,this.#c=s.active}dispose(){this.#u||(this.#u=!0,this.#h.fire(),this.#t.$disposeWebview(this.#e),this.#i.dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),this.#i}get viewType(){return this.assertNotDisposed(),this.#n}get title(){return this.assertNotDisposed(),this.#s}set title(e){this.assertNotDisposed(),this.#s!==e&&(this.#s=e,this.#t.$setTitle(this.#e,e))}get iconPath(){return this.assertNotDisposed(),this.#a}set iconPath(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#t.$setIconPath(this.#e,x.isUri(e)?{light:e,dark:e}:e))}get options(){return this.#r}get viewColumn(){if(this.assertNotDisposed(),!(typeof this.#o=="number"&&this.#o<0))return this.#o}get active(){return this.assertNotDisposed(),this.#c}get visible(){return this.assertNotDisposed(),this.#l}_updateViewState(e){this.#u||(this.active!==e.active||this.visible!==e.visible||this.viewColumn!==e.viewColumn)&&(this.#c=e.active,this.#l=e.visible,this.#o=e.viewColumn,this.#d.fire({webviewPanel:this}))}reveal(e,t){this.assertNotDisposed(),this.#t.$reveal(this.#e,{viewColumn:typeof e>"u"?void 0:hn.from(e),preserveFocus:!!t})}assertNotDisposed(){if(this.#u)throw new Error("Webview is disposed")}}class AE extends Se{static newHandle(){return Sn()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(ee.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,s,r={}){const o=typeof s=="object"?s.viewColumn:s,a={viewColumn:hn.from(o),preserveFocus:typeof s=="object"&&!!s.preserveFocus},l=du(e),c=AE.newHandle();this._proxy.$createWebviewPanel(n1(e),c,t,{title:i,panelOptions:u$(r),webviewOptions:d5(e,this.workspace,r),serializeBuffersForPostMessage:l},a);const u=this.webviews.createNewWebview(c,r,e);return this.createNewWebviewPanel(c,t,i,o,r,u,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,s)=>{const r=e[i],o=e[s];return r.active?1:o.active?-1:+r.visible-+o.visible});for(const i of t){const s=this.getWebviewPanel(i);if(!s)continue;const r=e[i];s._updateViewState({active:r.active,visible:r.visible,viewColumn:hn.to(r.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,i){if(this._serializers.has(t))throw new Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:i,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:du(e)}),new je(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,s){const r=this._serializers.get(t);if(!r)throw new Error(`No serializer found for '${t}'`);const{serializer:o,extension:a}=r,l=this.webviews.createNewWebview(e,i.webviewOptions,a),c=this.createNewWebviewPanel(e,t,i.title,s,i.panelOptions,l,i.active);await o.deserializeWebviewPanel(c,i.state)}createNewWebviewPanel(e,t,i,s,r,o,a){const l=new c$(e,this._proxy,o,{viewType:t,title:i,viewColumn:s,panelOptions:r,active:a});return this._webviewPanels.set(e,l),l}getWebviewPanel(e){return this._webviewPanels.get(e)}}function u$(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}class d$ extends Se{#e;#t;#n;#i;#r;#s;#a;#o;#l;constructor(e,t,i,s,r,o){super(),this.#r=!1,this.#c=this._register(new N),this.onDidChangeVisibility=this.#c.event,this.#u=this._register(new N),this.onDidDispose=this.#u.event,this.#n=i,this.#a=s,this.#e=e,this.#t=t,this.#i=r,this.#s=o}dispose(){this.#r||(this.#r=!0,this.#u.fire(),this.#i.dispose(),super.dispose())}#c;#u;get title(){return this.assertNotDisposed(),this.#a}set title(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#t.$setWebviewViewTitle(this.#e,e))}get description(){return this.assertNotDisposed(),this.#o}set description(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,this.#t.$setWebviewViewDescription(this.#e,e))}get visible(){return this.#s}get webview(){return this.#i}get viewType(){return this.#n}_setVisible(e){e===this.#s||this.#r||(this.#s=e,this.#c.fire())}get badge(){return this.assertNotDisposed(),this.#l}set badge(e){this.assertNotDisposed(),!(e?.value===this.#l?.value&&e?.tooltip===this.#l?.tooltip)&&(this.#l=Dm.from(e),this.#t.$setWebviewViewBadge(this.#e,e))}show(e){this.assertNotDisposed(),this.#t.$show(this.#e,!!e)}assertNotDisposed(){if(this.#r)throw new Error("Webview is disposed")}}class h${constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(ee.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,s){if(this._viewProviders.has(t))throw new Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:i,extension:e}),this._proxy.$registerWebviewViewProvider(n1(e),t,{retainContextWhenHidden:s?.retainContextWhenHidden,serializeBuffersForPostMessage:du(e)}),new je(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,s,r){const o=this._viewProviders.get(t);if(!o)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:l}=o,c=this._extHostWebview.createNewWebview(e,{},l),u=new d$(e,this._proxy,t,i,c,!0);this._webviewViews.set(e,u),await a.resolveWebviewView(u,{state:s},r)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){const t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("No webview found");return t}}class f${constructor(e){this._settingsSearchProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(ee.MainThreadAiSettingsSearch)}async $startSearch(e,t,i,s){if(this._settingsSearchProviders.size===0)throw new Error("No related information providers registered");const r=this._settingsSearchProviders.get(e);if(!r)throw new Error("Settings search provider not found");const o=new $d(a=>{this._proxy.$handleSearchResult(e,by.fromSettingsSearchResult(a))});return r.provideSettingsSearchResults(t,i,o,s)}registerSettingsSearchProvider(e,t){const i=this._nextHandle;return this._nextHandle++,this._settingsSearchProviders.set(i,t),this._proxy.$registerAiSettingsSearchProvider(i),new je(()=>{this._proxy.$unregisterAiSettingsSearchProvider(i),this._settingsSearchProviders.delete(i)})}}function p$(n){const e=n.get(gn),t=n.get(hu),i=n.get(w_),s=n.get(Ao),r=n.get(Mr),o=n.get(y_),a=n.get(Ur),l=n.get(Q1),c=n.get(nt),u=n.get(hE),d=n.get(fE),f=n.get(Po),p=n.get(at),_=n.get(pE),w=n.get(lf),v=n.get(x_),E=n.get(E_),S=n.get(vE),A=n.get(cf),G=n.get(bE),W=n.get(S_),ce=n.get(mE),Q=n.get(_E),ne=n.get(I0);c.set(he.ExtHostFileSystemInfo,t),c.set(he.ExtHostLogLevelServiceShape,f),c.set(he.ExtHostWorkspace,r),c.set(he.ExtHostConfiguration,a),c.set(he.ExtHostExtensionService,s),c.set(he.ExtHostStorage,u),c.set(he.ExtHostTunnelService,_),c.set(he.ExtHostWindow,v),c.set(he.ExtHostUrls,E),c.set(he.ExtHostSecretState,S),c.set(he.ExtHostTelemetry,o),c.set(he.ExtHostEditorTabs,A),c.set(he.ExtHostManagedSockets,G),c.set(he.ExtHostProgress,W),c.set(he.ExtHostAuthentication,ce),c.set(he.ExtHostChatProvider,Q);const J=c.set(he.ExtHostDecorations,n.get(KP)),de=c.set(he.ExtHostDocumentsAndEditors,n.get(vu)),Ce=c.set(he.ExtHostCommands,n.get(ul)),Ae=c.set(he.ExtHostTerminalService,n.get(_u)),se=c.set(he.ExtHostTerminalShellIntegration,n.get(i5)),q=c.set(he.ExtHostDebugService,n.get(ZP)),re=c.set(he.ExtHostSearch,n.get(n5)),Y=c.set(he.ExtHostTask,n.get(QP)),ve=c.set(he.ExtHostOutputService,n.get(GP)),Le=c.set(he.ExtHostLocalization,n.get(wE)),Pe=c.set(he.ExtHostDocuments,new HM(c,de)),Et=c.set(he.ExtHostDocumentContentProviders,new M0(c,de,p)),St=c.set(he.ExtHostDocumentSaveParticipant,new $M(p,Pe,c.getProxy(ee.MainThreadBulkEdits))),Ke=c.set(he.ExtHostNotebook,new J0(c,Ce,de,Pe,i,re,p)),Hn=c.set(he.ExtHostNotebookDocuments,new MU(Ke)),$t=c.set(he.ExtHostNotebookEditors,new X0(p,Ke)),Xn=c.set(he.ExtHostNotebookKernels,new Y0(c,e,Ke,Ce,p)),Dn=c.set(he.ExtHostNotebookRenderers,new BU(c,Ke)),gs=c.set(he.ExtHostNotebookDocumentSaveParticipant,new FU(p,Ke,c.getProxy(ee.MainThreadBulkEdits))),Ht=c.set(he.ExtHostEditors,new n$(c,de)),uf=c.set(he.ExtHostTreeViews,new l$(c.getProxy(ee.MainThreadTreeViews),Ce,p)),df=c.set(he.ExtHostEditorInsets,new _M(c.getProxy(ee.MainThreadEditorInsets),Ht,e.remote)),$r=c.set(he.ExtHostDiagnostics,new F0(c,p,t,de)),Ro=c.set(he.ExtHostLanguages,new pU(c,Pe,Ce.converter,l)),We=c.set(he.ExtHostLanguageFeatures,new U0(c,l,Pe,Ce,$r,p,w,o)),Qs=c.set(he.ExtHostCodeMapper,new O0(c)),C_=c.set(he.ExtHostFileSystem,new r1(c,We)),Js=c.set(he.ExtHostFileSystemEventService,new JM(c,p,de)),Xe=c.set(he.ExtHostQuickOpen,VU(c,r,Ce)),hf=c.set(he.ExtHostSCM,new sx(c,Ce,Pe,p)),T_=c.set(he.ExtHostQuickDiff,new tx(c,l)),ff=c.set(he.ExtHostShare,new rx(c,l)),Hr=c.set(he.ExtHostComments,vM(c,Ce,Pe)),P_=c.set(he.ExtHostLabelService,new YM(c)),pf=c.set(he.ExtHostTheming,new lx(c)),A_=c.set(he.ExtHostTimeline,new i$(c,Ce)),wu=c.set(he.ExtHostWebviews,new CM(c,e.remote,r,p,w)),vi=c.set(he.ExtHostWebviewPanels,new AE(c,wu,r)),R_=c.set(he.ExtHostCustomEditors,new NM(c,Pe,d,wu,vi)),L_=c.set(he.ExtHostWebviewViews,new h$(c,wu)),Br=c.set(he.ExtHostTesting,n.get(D_)),N_=c.set(he.ExtHostUriOpeners,new ux(c)),dl=c.set(he.ExtHostProfileContentHandlers,new WU(c));c.set(he.ExtHostInteractive,new XM(c,Ke,de,Ce,p));const Xs=c.set(he.ExtHostLanguageModelTools,new fU(c,Q)),ms=c.set(he.ExtHostChatAgents2,new L0(c,p,Ce,Pe,Q,$r,Xs)),bu=c.set(he.ExtHostAiRelatedInformation,new tM(c)),yu=c.set(he.ExtHostAiEmbeddingVector,new WM(c)),xu=c.set(he.ExtHostAiSettingsSearch,new f$(c)),Lo=c.set(he.ExtHostStatusBar,new t$(c,Ce.converter)),ai=c.set(he.ExtHostSpeech,new ox(c)),Bi=c.set(he.ExtHostEmbeddings,new BM(c));c.set(he.ExtHostMcp,n.get(I0));const Bt=Object.values(he);c.assertRegistered(Bt);const O_=new R0(c,de),F_=new pM(c),wn=new q0(c,p),gf=new UM(c),M_=new hM(c);return oM.register(Ce),function(C,_s,Eu){function ge(m){return(b,I,fe)=>{const ze=m(kt=>{try{b.call(I,kt)}catch(y5){Pv(new PC(C.identifier,y5,"FAILED to handle event"))}});return fe?.push(ze),ze}}const lt=function(){let m=!C.isUnderDevelopment;function b(){m||(p.info(`Extension '${C.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),m=!0)}return function I(fe){if(Array.isArray(fe))fe.forEach(I);else if(typeof fe=="string")b();else{const ze=fe;typeof ze.scheme>"u"&&b(),typeof ze.exclusive=="boolean"&&$(C,"documentFiltersExclusive")}return fe}}(),U_={getSession(m,b,I){return(typeof I?.forceNewSession=="object"&&I.forceNewSession.learnMore||typeof I?.createIfNone=="object"&&I.createIfNone.learnMore)&&$(C,"authLearnMore"),I?.authorizationServer&&$(C,"authIssuers"),ce.getSession(C,m,b,I)},getAccounts(m){return ce.getAccounts(m)},async hasSession(m,b){return $(C,"authSession"),!!await ce.getSession(C,m,b,{silent:!0})},get onDidChangeSessions(){return ge(ce.getExtensionScopedSessionsEvent(C.identifier.value))},registerAuthenticationProvider(m,b,I,fe){return fe?.supportedAuthorizationServers&&$(C,"authIssuers"),ce.registerAuthenticationProvider(m,b,I,fe)}},$_={registerCommand(m,b,I){return Ce.registerCommand(!0,m,b,I,void 0,C)},registerTextEditorCommand(m,b,I){return Ce.registerCommand(!0,m,(...fe)=>{const ze=Ht.getActiveTextEditor();if(!ze){p.warn("Cannot execute "+m+" because there is no active text editor.");return}return ze.edit(kt=>{b.apply(I,[ze,kt,...fe])}).then(kt=>{kt||p.warn("Edits from command "+m+" were not applied.")},kt=>{p.warn("An error occurred while running command "+m,kt)})},void 0,void 0,C)},registerDiffInformationCommand:(m,b,I)=>($(C,"diffCommand"),Ce.registerCommand(!0,m,async(...fe)=>{const ze=de.activeEditor(!0);if(!ze){p.warn("Cannot execute "+m+" because there is no active text editor.");return}const kt=await Ht.getDiffInformation(ze.id);b.apply(I,[kt,...fe])},void 0,void 0,C)),executeCommand(m,...b){return Ce.executeCommand(m,...b)},getCommands(m=!1){return Ce.getCommands(m)}},hl={get machineId(){return e.telemetryInfo.machineId},get sessionId(){return e.telemetryInfo.sessionId},get language(){return e.environment.appLanguage},get appName(){return e.environment.appName},get appRoot(){return e.environment.appRoot?.fsPath??""},get appHost(){return e.environment.appHost},get uriScheme(){return e.environment.appUriScheme},get clipboard(){return F_.value},get shell(){return Ae.getDefaultShell(!1)},get onDidChangeShell(){return ge(Ae.onDidChangeShell)},get isTelemetryEnabled(){return o.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return ge(o.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return $(C,"telemetry"),o.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return $(C,"telemetry"),ge(o.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return RP(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(m,b){return AP.validateSender(m),o.instantiateLogger(C,m,b)},openExternal(m,b){return v.openUri(m,{allowTunneling:!!e.remote.authority,allowContributedOpeners:b?.allowContributedOpeners})},async asExternalUri(m){if(m.scheme===e.environment.appUriScheme)return E.createAppUri(m);try{return await v.asExternalUri(m,{allowTunneling:!!e.remote.authority})}catch(b){if(zv(m,le.http)||zv(m,le.https))return m;throw b}},get remoteName(){return Px(e.remote.authority)},get remoteAuthority(){return $(C,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return p.getLevel()},get onDidChangeLogLevel(){return ge(p.onDidChangeLogLevel)},get appQuality(){return $(C,"resolvers"),e.quality},get appCommit(){return $(C,"resolvers"),e.commit}},H_={createTestController(m,b,I){return Br.createTestController(C,m,b,I)},createTestObserver(){return $(C,"testObserver"),Br.createTestObserver()},runTests(m){return $(C,"testObserver"),Br.runTests(m)},registerTestFollowupProvider(m){return $(C,"testObserver"),Br.registerTestFollowupProvider(m)},get onDidChangeTestResults(){return $(C,"testObserver"),ge(Br.onResultsChanged)},get testResults(){return $(C,"testObserver"),Br.results}},fl=e.remote.isRemote?Sa.Workspace:Sa.UI,B_={getExtension(m,b){dt(C,"extensionsAny")||(b=!1);const I=_s.mine.getExtensionDescription(m);if(I)return new Wu(s,C.identifier,I,fl,!1);if(b){const fe=_s.all.getExtensionDescription(m);if(fe)return new Wu(s,C.identifier,fe,fl,!0)}},get all(){const m=[];for(const b of _s.mine.getAllExtensionDescriptions())m.push(new Wu(s,C.identifier,b,fl,!1));return m},get allAcrossExtensionHosts(){$(C,"extensionsAny");const m=new nl(_s.mine.getAllExtensionDescriptions().map(I=>I.identifier)),b=[];for(const I of _s.all.getAllExtensionDescriptions()){const fe=!m.has(I.identifier);b.push(new Wu(s,C.identifier,I,fl,fe))}return b},get onDidChange(){return dt(C,"extensionsAny")?ge(Ut.any(_s.mine.onDidChange,_s.all.onDidChange)):ge(_s.mine.onDidChange)}},W_={createDiagnosticCollection(m){return $r.createDiagnosticCollection(C.identifier,m)},get onDidChangeDiagnostics(){return ge($r.onDidChangeDiagnostics)},getDiagnostics:m=>$r.getDiagnostics(m),getLanguages(){return Ro.getLanguages()},setTextDocumentLanguage(m,b){return Ro.changeLanguage(m.uri,b)},match(m,b){const I=ey.from(m);let fe;return r5(I)&&(fe=Ke.notebookDocuments.find(ze=>ze.apiNotebook.getCells().find(kt=>kt.document===b))?.apiNotebook),s5(I,b.uri,b.languageId,!0,fe?.uri,fe?.notebookType)},registerCodeActionsProvider(m,b,I){return We.registerCodeActionProvider(C,lt(m),b,I)},registerDocumentPasteEditProvider(m,b,I){return We.registerDocumentPasteEditProvider(C,lt(m),b,I)},registerCodeLensProvider(m,b){return We.registerCodeLensProvider(C,lt(m),b)},registerDefinitionProvider(m,b){return We.registerDefinitionProvider(C,lt(m),b)},registerDeclarationProvider(m,b){return We.registerDeclarationProvider(C,lt(m),b)},registerImplementationProvider(m,b){return We.registerImplementationProvider(C,lt(m),b)},registerTypeDefinitionProvider(m,b){return We.registerTypeDefinitionProvider(C,lt(m),b)},registerHoverProvider(m,b){return We.registerHoverProvider(C,lt(m),b,C.identifier)},registerEvaluatableExpressionProvider(m,b){return We.registerEvaluatableExpressionProvider(C,lt(m),b,C.identifier)},registerInlineValuesProvider(m,b){return We.registerInlineValuesProvider(C,lt(m),b,C.identifier)},registerDocumentHighlightProvider(m,b){return We.registerDocumentHighlightProvider(C,lt(m),b)},registerMultiDocumentHighlightProvider(m,b){return We.registerMultiDocumentHighlightProvider(C,lt(m),b)},registerLinkedEditingRangeProvider(m,b){return We.registerLinkedEditingRangeProvider(C,lt(m),b)},registerReferenceProvider(m,b){return We.registerReferenceProvider(C,lt(m),b)},registerRenameProvider(m,b){return We.registerRenameProvider(C,lt(m),b)},registerNewSymbolNamesProvider(m,b){return $(C,"newSymbolNamesProvider"),We.registerNewSymbolNamesProvider(C,lt(m),b)},registerDocumentSymbolProvider(m,b,I){return We.registerDocumentSymbolProvider(C,lt(m),b,I)},registerWorkspaceSymbolProvider(m){return We.registerWorkspaceSymbolProvider(C,m)},registerDocumentFormattingEditProvider(m,b){return We.registerDocumentFormattingEditProvider(C,lt(m),b)},registerDocumentRangeFormattingEditProvider(m,b){return We.registerDocumentRangeFormattingEditProvider(C,lt(m),b)},registerOnTypeFormattingEditProvider(m,b,I,...fe){return We.registerOnTypeFormattingEditProvider(C,lt(m),b,[I].concat(fe))},registerDocumentSemanticTokensProvider(m,b,I){return We.registerDocumentSemanticTokensProvider(C,lt(m),b,I)},registerDocumentRangeSemanticTokensProvider(m,b,I){return We.registerDocumentRangeSemanticTokensProvider(C,lt(m),b,I)},registerSignatureHelpProvider(m,b,I,...fe){return typeof I=="object"?We.registerSignatureHelpProvider(C,lt(m),b,I):We.registerSignatureHelpProvider(C,lt(m),b,typeof I>"u"?[]:[I,...fe])},registerCompletionItemProvider(m,b,...I){return We.registerCompletionItemProvider(C,lt(m),b,I)},registerInlineCompletionItemProvider(m,b,I){return b.handleDidShowCompletionItem&&$(C,"inlineCompletionsAdditions"),b.handleDidPartiallyAcceptCompletionItem&&$(C,"inlineCompletionsAdditions"),I&&$(C,"inlineCompletionsAdditions"),We.registerInlineCompletionsProvider(C,lt(m),b,I)},registerInlineEditProvider(m,b){return $(C,"inlineEdit"),We.registerInlineEditProvider(C,lt(m),b)},registerDocumentLinkProvider(m,b){return We.registerDocumentLinkProvider(C,lt(m),b)},registerColorProvider(m,b){return We.registerColorProvider(C,lt(m),b)},registerFoldingRangeProvider(m,b){return We.registerFoldingRangeProvider(C,lt(m),b)},registerSelectionRangeProvider(m,b){return We.registerSelectionRangeProvider(C,m,b)},registerCallHierarchyProvider(m,b){return We.registerCallHierarchyProvider(C,m,b)},registerTypeHierarchyProvider(m,b){return We.registerTypeHierarchyProvider(C,m,b)},setLanguageConfiguration:(m,b)=>We.setLanguageConfiguration(C,m,b),getTokenInformationAtPosition(m,b){return $(C,"tokenInformation"),Ro.tokenAtPosition(m,b)},registerInlayHintsProvider(m,b){return We.registerInlayHintsProvider(C,m,b)},createLanguageStatusItem(m,b){return Ro.createLanguageStatusItem(C,m,b)},registerDocumentDropEditProvider(m,b,I){return We.registerDocumentOnDropEditProvider(C,m,b,I)}},V_={get activeTextEditor(){return Ht.getActiveTextEditor()},get visibleTextEditors(){return Ht.getVisibleTextEditors()},get activeTerminal(){return Ae.activeTerminal},get terminals(){return Ae.terminals},async showTextDocument(m,b,I){x.isUri(m)&&m.scheme===le.vscodeRemote&&!m.authority&&w.report("workspace.showTextDocument",C,"A URI of 'vscode-remote' scheme requires an authority.");const fe=await(x.isUri(m)?Promise.resolve(pl.openTextDocument(m)):Promise.resolve(m));return Ht.showTextDocument(fe,b,I)},createTextEditorDecorationType(m){return Ht.createTextEditorDecorationType(C,m)},onDidChangeActiveTextEditor(m,b,I){return ge(Ht.onDidChangeActiveTextEditor)(m,b,I)},onDidChangeVisibleTextEditors(m,b,I){return ge(Ht.onDidChangeVisibleTextEditors)(m,b,I)},onDidChangeTextEditorSelection(m,b,I){return ge(Ht.onDidChangeTextEditorSelection)(m,b,I)},onDidChangeTextEditorOptions(m,b,I){return ge(Ht.onDidChangeTextEditorOptions)(m,b,I)},onDidChangeTextEditorVisibleRanges(m,b,I){return ge(Ht.onDidChangeTextEditorVisibleRanges)(m,b,I)},onDidChangeTextEditorViewColumn(m,b,I){return ge(Ht.onDidChangeTextEditorViewColumn)(m,b,I)},onDidChangeTextEditorDiffInformation(m,b,I){return $(C,"textEditorDiffInformation"),ge(Ht.onDidChangeTextEditorDiffInformation)(m,b,I)},onDidCloseTerminal(m,b,I){return ge(Ae.onDidCloseTerminal)(m,b,I)},onDidOpenTerminal(m,b,I){return ge(Ae.onDidOpenTerminal)(m,b,I)},onDidChangeActiveTerminal(m,b,I){return ge(Ae.onDidChangeActiveTerminal)(m,b,I)},onDidChangeTerminalDimensions(m,b,I){return $(C,"terminalDimensions"),ge(Ae.onDidChangeTerminalDimensions)(m,b,I)},onDidChangeTerminalState(m,b,I){return ge(Ae.onDidChangeTerminalState)(m,b,I)},onDidWriteTerminalData(m,b,I){return $(C,"terminalDataWriteEvent"),ge(Ae.onDidWriteTerminalData)(m,b,I)},onDidExecuteTerminalCommand(m,b,I){return $(C,"terminalExecuteCommandEvent"),ge(Ae.onDidExecuteTerminalCommand)(m,b,I)},onDidChangeTerminalShellIntegration(m,b,I){return ge(se.onDidChangeTerminalShellIntegration)(m,b,I)},onDidStartTerminalShellExecution(m,b,I){return ge(se.onDidStartTerminalShellExecution)(m,b,I)},onDidEndTerminalShellExecution(m,b,I){return ge(se.onDidEndTerminalShellExecution)(m,b,I)},get state(){return v.getState()},onDidChangeWindowState(m,b,I){return ge(v.onDidChangeWindowState)(m,b,I)},showInformationMessage(m,...b){return wn.showMessage(C,Qt.Info,m,b[0],b.slice(1))},showWarningMessage(m,...b){return wn.showMessage(C,Qt.Warning,m,b[0],b.slice(1))},showErrorMessage(m,...b){return wn.showMessage(C,Qt.Error,m,b[0],b.slice(1))},showQuickPick(m,b,I){return Xe.showQuickPick(C,m,b,I)},showWorkspaceFolderPick(m){return Xe.showWorkspaceFolderPick(m)},showInputBox(m,b){return Xe.showInput(m,b)},showOpenDialog(m){return gf.showOpenDialog(m)},showSaveDialog(m){return gf.showSaveDialog(m)},createStatusBarItem(m,b,I){let fe,ze,kt;return typeof m=="string"?(fe=m,ze=b,kt=I):(ze=m,kt=b),Lo.createStatusBarEntry(C,fe,ze,kt)},setStatusBarMessage(m,b){return Lo.setStatusBarMessage(m,b)},withScmProgress(m){return w.report("window.withScmProgress",C,"Use 'withProgress' instead."),W.withProgress(C,{location:wo.SourceControl},(b,I)=>m({report(fe){}}))},withProgress(m,b){return W.withProgress(C,m,b)},createOutputChannel(m,b){return ve.createOutputChannel(m,b,C)},createWebviewPanel(m,b,I,fe){return vi.createWebviewPanel(C,m,b,I,fe)},createWebviewTextEditorInset(m,b,I,fe){return $(C,"editorInsets"),df.createWebviewEditorInset(m,b,I,fe,C)},createTerminal(m,b,I){return typeof m=="object"?"pty"in m?Ae.createExtensionTerminal(m):Ae.createTerminalFromOptions(m):Ae.createTerminal(m,b,I)},registerTerminalLinkProvider(m){return Ae.registerLinkProvider(m)},registerTerminalProfileProvider(m,b){return Ae.registerProfileProvider(C,m,b)},registerTerminalCompletionProvider(m,...b){return $(C,"terminalCompletionProvider"),Ae.registerTerminalCompletionProvider(C,m,...b)},registerTerminalQuickFixProvider(m,b){return $(C,"terminalQuickFixProvider"),Ae.registerTerminalQuickFixProvider(m,C.identifier.value,b)},registerTreeDataProvider(m,b){return uf.registerTreeDataProvider(m,b,C)},createTreeView(m,b){return uf.createTreeView(m,b,C)},registerWebviewPanelSerializer:(m,b)=>vi.registerWebviewPanelSerializer(C,m,b),registerCustomEditorProvider:(m,b,I={})=>R_.registerCustomEditorProvider(C,m,b,I),registerFileDecorationProvider(m){return J.registerFileDecorationProvider(m,C)},registerUriHandler(m){return E.registerUriHandler(C,m)},createQuickPick(){return Xe.createQuickPick(C)},createInputBox(){return Xe.createInputBox(C)},get activeColorTheme(){return pf.activeColorTheme},onDidChangeActiveColorTheme(m,b,I){return ge(pf.onDidChangeActiveColorTheme)(m,b,I)},registerWebviewViewProvider(m,b,I){return L_.registerWebviewViewProvider(C,m,b,I?.webviewOptions)},get activeNotebookEditor(){return Ke.activeNotebookEditor},onDidChangeActiveNotebookEditor(m,b,I){return ge(Ke.onDidChangeActiveNotebookEditor)(m,b,I)},get visibleNotebookEditors(){return Ke.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return ge(Ke.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(m,b,I){return ge($t.onDidChangeNotebookEditorSelection)(m,b,I)},onDidChangeNotebookEditorVisibleRanges(m,b,I){return ge($t.onDidChangeNotebookEditorVisibleRanges)(m,b,I)},showNotebookDocument(m,b){return Ke.showNotebookDocument(m,b)},registerExternalUriOpener(m,b,I){return $(C,"externalUriOpener"),N_.registerExternalUriOpener(C.identifier,m,b,I)},registerProfileContentHandler(m,b){return $(C,"profileContentHandlers"),dl.registerProfileContentHandler(C,m,b)},registerQuickDiffProvider(m,b,I,fe,ze){return $(C,"quickDiffProvider"),T_.registerQuickDiffProvider(C,lt(m),b,I,fe,ze)},get tabGroups(){return A.tabGroups},registerShareProvider(m,b){return $(C,"shareProvider"),ff.registerShareProvider(lt(m),b)},get nativeHandle(){return $(C,"nativeWindowHandle"),v.nativeHandle},createChatStatusItem:m=>($(C,"chatStatusItem"),M_.createChatStatusItem(C,m))},pl={get rootPath(){return w.report("workspace.rootPath",C,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),r.getPath()},set rootPath(m){throw new ia("rootPath")},getWorkspaceFolder(m){return r.getWorkspaceFolder(m)},get workspaceFolders(){return r.getWorkspaceFolders()},get name(){return r.name},set name(m){throw new ia("name")},get workspaceFile(){return r.workspaceFile},set workspaceFile(m){throw new ia("workspaceFile")},updateWorkspaceFolders:(m,b,...I)=>r.updateWorkspaceFolders(C,m,b||0,...I),onDidChangeWorkspaceFolders:function(m,b,I){return ge(r.onDidChangeWorkspace)(m,b,I)},asRelativePath:(m,b)=>r.getRelativePath(m,b),findFiles:(m,b,I,fe)=>r.findFiles(m,b,I,C.identifier,fe),findFiles2:(m,b,I)=>($(C,"findFiles2"),r.findFiles2(m,b,C.identifier,I)),findTextInFiles:(m,b,I,fe)=>{$(C,"findTextInFiles");let ze,kt;return typeof b=="object"?(ze=b,kt=I):(ze={},kt=b,fe=I),r.findTextInFiles(m,ze||{},kt,C.identifier,fe)},findTextInFiles2:(m,b,I)=>($(C,"findTextInFiles2"),$(C,"textSearchProvider2"),r.findTextInFiles2(m,b,C.identifier,I)),save:m=>r.save(m),saveAs:m=>r.saveAs(m),saveAll:m=>r.saveAll(m),applyEdit(m,b){return O_.applyWorkspaceEdit(m,C,b)},createFileSystemWatcher:(m,b,I,fe)=>{const ze={ignoreCreateEvents:!!b,ignoreChangeEvents:!!I,ignoreDeleteEvents:!!fe};return Js.createFileSystemWatcher(r,Eu,C,m,ze)},get textDocuments(){return Pe.getAllDocumentData().map(m=>m.document)},set textDocuments(m){throw new ia("textDocuments")},openTextDocument(m,b){let I;if(b=b??m,typeof m=="string")I=Promise.resolve(x.file(m));else if(x.isUri(m))I=Promise.resolve(m);else if(!b||typeof b=="object")I=Pe.createDocumentData(b);else throw new Error("illegal argument - uriOrFileNameOrOptions");return I.then(fe=>(p.trace(`openTextDocument from ${C.identifier}`),fe.scheme===le.vscodeRemote&&!fe.authority&&w.report("workspace.openTextDocument",C,"A URI of 'vscode-remote' scheme requires an authority."),Pe.ensureDocumentData(fe,b).then(ze=>ze.document)))},onDidOpenTextDocument:(m,b,I)=>ge(Pe.onDidAddDocument)(m,b,I),onDidCloseTextDocument:(m,b,I)=>ge(Pe.onDidRemoveDocument)(m,b,I),onDidChangeTextDocument:(m,b,I)=>ge(Pe.onDidChangeDocument)(m,b,I),onDidSaveTextDocument:(m,b,I)=>ge(Pe.onDidSaveDocument)(m,b,I),onWillSaveTextDocument:(m,b,I)=>ge(St.getOnWillSaveTextDocumentEvent(C))(m,b,I),get notebookDocuments(){return Ke.notebookDocuments.map(m=>m.apiNotebook)},async openNotebookDocument(m,b){let I;if(x.isUri(m))I=m,await Ke.openNotebookDocument(m);else if(typeof m=="string")I=x.revive(await Ke.createNotebookDocument({viewType:m,content:b}));else throw new Error("Invalid arguments");return Ke.getNotebookDocument(I).apiNotebook},onDidSaveNotebookDocument(m,b,I){return ge(Hn.onDidSaveNotebookDocument)(m,b,I)},onDidChangeNotebookDocument(m,b,I){return ge(Hn.onDidChangeNotebookDocument)(m,b,I)},onWillSaveNotebookDocument(m,b,I){return ge(gs.getOnWillSaveNotebookDocumentEvent(C))(m,b,I)},get onDidOpenNotebookDocument(){return ge(Ke.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return ge(Ke.onDidCloseNotebookDocument)},registerNotebookSerializer(m,b,I,fe){return Ke.registerNotebookSerializer(C,m,b,I,dt(C,"notebookLiveShare")?fe:void 0)},onDidChangeConfiguration:(m,b,I)=>ge(Eu.onDidChangeConfiguration)(m,b,I),getConfiguration(m,b){return b=arguments.length===1?void 0:b,Eu.getConfiguration(m,b,C)},registerTextDocumentContentProvider(m,b){return Et.registerTextDocumentContentProvider(m,b)},registerTaskProvider:(m,b)=>(w.report("window.registerTaskProvider",C,"Use the corresponding function on the 'tasks' namespace instead"),Y.registerTaskProvider(C,m,b)),registerFileSystemProvider(m,b,I){return bx(C_.registerFileSystemProvider(C,m,b,I),i.addFileSystemProvider(m,b,I))},get fs(){return i.value},registerFileSearchProvider:(m,b)=>($(C,"fileSearchProvider"),re.registerFileSearchProviderOld(m,b)),registerTextSearchProvider:(m,b)=>($(C,"textSearchProvider"),re.registerTextSearchProviderOld(m,b)),registerAITextSearchProvider:(m,b)=>($(C,"aiTextSearchProvider"),$(C,"textSearchProvider2"),re.registerAITextSearchProvider(m,b)),registerFileSearchProvider2:(m,b)=>($(C,"fileSearchProvider2"),re.registerFileSearchProvider(m,b)),registerTextSearchProvider2:(m,b)=>($(C,"textSearchProvider2"),re.registerTextSearchProvider(m,b)),registerRemoteAuthorityResolver:(m,b)=>($(C,"resolvers"),s.registerRemoteAuthorityResolver(m,b)),registerResourceLabelFormatter:m=>($(C,"resolvers"),P_.$registerResourceLabelFormatter(m)),getRemoteExecServer:m=>($(C,"resolvers"),s.getRemoteExecServer(m)),onDidCreateFiles:(m,b,I)=>ge(Js.onDidCreateFile)(m,b,I),onDidDeleteFiles:(m,b,I)=>ge(Js.onDidDeleteFile)(m,b,I),onDidRenameFiles:(m,b,I)=>ge(Js.onDidRenameFile)(m,b,I),onWillCreateFiles:(m,b,I)=>ge(Js.getOnWillCreateFileEvent(C))(m,b,I),onWillDeleteFiles:(m,b,I)=>ge(Js.getOnWillDeleteFileEvent(C))(m,b,I),onWillRenameFiles:(m,b,I)=>ge(Js.getOnWillRenameFileEvent(C))(m,b,I),openTunnel:m=>($(C,"tunnels"),_.openTunnel(C,m).then(b=>{if(!b)throw new Error("cannot open tunnel");return b})),get tunnels(){return $(C,"tunnels"),_.getTunnels()},onDidChangeTunnels:(m,b,I)=>($(C,"tunnels"),ge(_.onDidChangeTunnels)(m,b,I)),registerPortAttributesProvider:(m,b)=>($(C,"portsAttributes"),_.registerPortsAttributesProvider(m,b)),registerTunnelProvider:(m,b)=>($(C,"tunnelFactory"),_.registerTunnelProvider(m,b)),registerTimelineProvider:(m,b)=>($(C,"timeline"),A_.registerTimelineProvider(m,b,C.identifier,Ce.converter)),get isTrusted(){return r.trusted},requestWorkspaceTrust:m=>($(C,"workspaceTrust"),r.requestWorkspaceTrust(m)),onDidGrantWorkspaceTrust:(m,b,I)=>ge(r.onDidGrantWorkspaceTrust)(m,b,I),registerEditSessionIdentityProvider:(m,b)=>($(C,"editSessionIdentityProvider"),r.registerEditSessionIdentityProvider(m,b)),onWillCreateEditSessionIdentity:(m,b,I)=>($(C,"editSessionIdentityProvider"),ge(r.getOnWillCreateEditSessionIdentityEvent(C))(m,b,I)),registerCanonicalUriProvider:(m,b)=>($(C,"canonicalUriProvider"),r.registerCanonicalUriProvider(m,b)),getCanonicalUri:(m,b,I)=>($(C,"canonicalUriProvider"),r.provideCanonicalUri(m,b,I)),decode(m,b){return r.decode(m,b)},encode(m,b){return r.encode(m,b)}},z_={get inputBox(){return w.report("scm.inputBox",C,"Use 'SourceControl.inputBox' instead"),hf.getLastInputBox(C)},createSourceControl(m,b,I){return hf.createSourceControl(C,m,b,I)}},q_={createCommentController(m,b){return Hr.createCommentController(C,m,b)}},j_={get activeDebugSession(){return q.activeDebugSession},get activeDebugConsole(){return q.activeDebugConsole},get breakpoints(){return q.breakpoints},get activeStackItem(){return q.activeStackItem},registerDebugVisualizationProvider(m,b){return $(C,"debugVisualization"),q.registerDebugVisualizationProvider(C,m,b)},registerDebugVisualizationTreeProvider(m,b){return $(C,"debugVisualization"),q.registerDebugVisualizationTree(C,m,b)},onDidStartDebugSession(m,b,I){return ge(q.onDidStartDebugSession)(m,b,I)},onDidTerminateDebugSession(m,b,I){return ge(q.onDidTerminateDebugSession)(m,b,I)},onDidChangeActiveDebugSession(m,b,I){return ge(q.onDidChangeActiveDebugSession)(m,b,I)},onDidReceiveDebugSessionCustomEvent(m,b,I){return ge(q.onDidReceiveDebugSessionCustomEvent)(m,b,I)},onDidChangeBreakpoints(m,b,I){return ge(q.onDidChangeBreakpoints)(m,b,I)},onDidChangeActiveStackItem(m,b,I){return ge(q.onDidChangeActiveStackItem)(m,b,I)},registerDebugConfigurationProvider(m,b,I){return q.registerDebugConfigurationProvider(m,b,I||dg.Initial)},registerDebugAdapterDescriptorFactory(m,b){return q.registerDebugAdapterDescriptorFactory(C,m,b)},registerDebugAdapterTrackerFactory(m,b){return q.registerDebugAdapterTrackerFactory(m,b)},startDebugging(m,b,I){return!I||typeof I=="object"&&"configuration"in I?q.startDebugging(m,b,{parentSession:I}):q.startDebugging(m,b,I||{})},stopDebugging(m){return q.stopDebugging(m)},addBreakpoints(m){return q.addBreakpoints(m)},removeBreakpoints(m){return q.removeBreakpoints(m)},asDebugSourceUri(m,b){return q.asDebugSourceUri(m,b)}},k={registerTaskProvider:(m,b)=>Y.registerTaskProvider(C,m,b),fetchTasks:m=>Y.fetchTasks(m),executeTask:m=>Y.executeTask(C,m),get taskExecutions(){return Y.taskExecutions},onDidStartTask:(m,b,I)=>ge(Y.onDidStartTask)(m,b,I),onDidEndTask:(m,b,I)=>ge(Y.onDidEndTask)(m,b,I),onDidStartTaskProcess:(m,b,I)=>ge(Y.onDidStartTaskProcess)(m,b,I),onDidEndTaskProcess:(m,b,I)=>ge(Y.onDidEndTaskProcess)(m,b,I),onDidStartTaskProblemMatchers:(m,b,I)=>($(C,"taskProblemMatcherStatus"),ge(Y.onDidStartTaskProblemMatchers)(m,b,I)),onDidEndTaskProblemMatchers:(m,b,I)=>($(C,"taskProblemMatcherStatus"),ge(Y.onDidEndTaskProblemMatchers)(m,b,I))},M={createNotebookController(m,b,I,fe,ze){return Xn.createNotebookController(C,m,b,I,fe,dt(C,"notebookMessaging")?ze:void 0)},registerNotebookCellStatusBarItemProvider:(m,b)=>Ke.registerNotebookCellStatusBarItemProvider(C,m,b),createRendererMessaging(m){return Dn.createRendererMessaging(C,m)},createNotebookControllerDetectionTask(m){return $(C,"notebookKernelSource"),Xn.createNotebookControllerDetectionTask(C,m)},registerKernelSourceActionProvider(m,b){return $(C,"notebookKernelSource"),Xn.registerKernelSourceActionProvider(C,m,b)}},H={t(...m){if(typeof m[0]=="string"){const b=m.shift(),I=!m||typeof m[0]!="object"?m:m[0];return Le.getMessage(C.identifier.value,{message:b,args:I})}return Le.getMessage(C.identifier.value,m[0])},get bundle(){return Le.getBundle(C.identifier.value)},get uri(){return Le.getBundleUri(C.identifier.value)}},oe={transferActiveChat(m){return $(C,"interactive"),ms.transferActiveChat(m)}},X={getRelatedInformation(m,b){return $(C,"aiRelatedInformation"),bu.getRelatedInformation(C,m,b)},registerRelatedInformationProvider(m,b){return $(C,"aiRelatedInformation"),bu.registerRelatedInformationProvider(C,m,b)},registerEmbeddingVectorProvider(m,b){return $(C,"aiRelatedInformation"),yu.registerEmbeddingVectorProvider(C,m,b)},registerSettingsSearchProvider(m){return $(C,"aiSettingsSearch"),xu.registerSettingsSearchProvider(C,m)}},De={registerMappedEditsProvider(m,b){return $(C,"mappedEditsProvider"),{dispose(){}}},registerMappedEditsProvider2(m){return $(C,"mappedEditsProvider"),Qs.registerMappedEditsProvider(C,m)},createChatParticipant(m,b){return ms.createChatAgent(C,m,b)},createDynamicChatParticipant(m,b,I){return $(C,"chatParticipantPrivate"),ms.createDynamicChatAgent(C,m,b,I)},registerChatParticipantDetectionProvider(m){return $(C,"chatParticipantPrivate"),ms.registerChatParticipantDetectionProvider(C,m)},registerRelatedFilesProvider(m,b){return $(C,"chatEditing"),ms.registerRelatedFilesProvider(C,m,b)},onDidDisposeChatSession:(m,b,I)=>($(C,"chatParticipantPrivate"),ge(ms.onDidDisposeChatSession)(m,b,I))},He={selectChatModels:m=>Q.selectLanguageModels(C,m??{}),onDidChangeChatModels:(m,b,I)=>Q.onDidChangeProviders(m,b,I),registerChatModelProvider:(m,b,I)=>($(C,"chatProvider"),Q.registerLanguageModel(C,m,b,I)),get embeddingModels(){return $(C,"embeddings"),Bi.embeddingsModels},onDidChangeEmbeddingModels:(m,b,I)=>($(C,"embeddings"),Bi.onDidChange(m,b,I)),registerEmbeddingsProvider(m,b){return $(C,"embeddings"),Bi.registerEmbeddingsProvider(C,m,b)},async computeEmbeddings(m,b,I){return $(C,"embeddings"),Bi.computeEmbeddings(m,b,I)},registerTool(m,b){return Xs.registerTool(C,m,b)},invokeTool(m,b,I){return Xs.invokeTool(C,m,b,I)},get tools(){return Xs.getTools(C)},fileIsIgnored(m,b){return Q.fileIsIgnored(C,m,b)},registerIgnoredFileProvider(m){return Q.registerIgnoredFileProvider(C,m)},registerMcpServerDefinitionProvider(m,b){return ne.registerMcpConfigurationProvider(C,m,b)}},Qe={registerSpeechProvider(m,b){return $(C,"speech"),ai.registerProvider(C.identifier,m,b)}};return{version:e.version,ai:X,authentication:U_,commands:$_,comments:q_,chat:De,debug:j_,env:hl,extensions:B_,interactive:oe,l10n:H,languages:W_,lm:He,notebooks:M,scm:z_,speech:Qe,tasks:k,tests:H_,window:V_,workspace:pl,Breakpoint:jc,TerminalOutputAnchor:Mw,ChatResultFeedbackKind:wh,ChatVariableLevel:Sb,ChatCompletionItem:A3,ChatReferenceDiagnostic:dP,CallHierarchyIncomingCall:BT,CallHierarchyItem:Yx,CallHierarchyOutgoingCall:WT,CancellationError:Ai,CancellationTokenSource:Nt,CandidatePortSource:Bv,CodeAction:Zd,CodeActionKind:At,CodeActionTriggerKind:Yd,CodeLens:Pg,Color:Vc,ColorInformation:Fg,ColorPresentation:Mg,ColorThemeKind:oo,CommentMode:ab,CommentState:lb,CommentThreadCollapsibleState:dh,CommentThreadState:hh,CommentThreadApplicability:fh,CommentThreadFocus:ph,CompletionItem:Lg,CompletionItemKind:Ie,CompletionItemTag:th,CompletionList:Hc,CompletionTriggerKind:rc,ConfigurationTarget:cc,CustomExecution:Zx,DebugAdapterExecutable:Vg,DebugAdapterInlineImplementation:lh,DebugAdapterNamedPipeServer:zg,DebugAdapterServer:ah,DebugConfigurationProviderTriggerKind:dg,DebugConsoleMode:Qg,DebugVisualization:S3,DecorationRangeBehavior:la,Diagnostic:kg,DiagnosticRelatedInformation:Gd,DiagnosticSeverity:Pn,DiagnosticTag:oa,Disposable:je,DocumentHighlight:Cg,DocumentHighlightKind:Kd,MultiDocumentHighlight:Tg,DocumentLink:Og,DocumentSymbol:Xd,EndOfLine:os,EnvironmentVariableMutatorType:ic,EvaluatableExpression:qg,InlineValueText:jg,InlineValueVariableLookup:Gg,InlineValueEvaluatableExpression:Kg,InlineCompletionTriggerKind:ch,EventEmitter:N,ExtensionKind:Sa,ExtensionMode:fc,ExternalUriOpenerPriority:wb,FileChangeType:dc,FileDecoration:db,FileDecoration2:db,FileSystemError:cn,FileType:va,FilePermission:Oc,FoldingRange:ob,FoldingRangeKind:gr,FunctionBreakpoint:ua,InlineCompletionItem:zw,InlineCompletionList:qw,Hover:Dg,VerboseHover:Ig,HoverVerbosityAction:Uw,IndentAction:T0,Location:Ni,MarkdownString:mi,OverviewRulerLane:lw,ParameterInformation:$w,PortAutoForwardAction:yb,Position:qe,ProcessExecution:zc,ProgressLocation:wo,QuickInputButtonLocation:ub,QuickInputButtons:gh,Range:Me,RelativePattern:uc,Selection:Nr,SelectionRange:eh,SemanticTokens:Gc,SemanticTokensBuilder:eE,SemanticTokensEdit:GT,SemanticTokensEdits:sp,SemanticTokensLegend:cb,ShellExecution:Qa,ShellQuoting:eb,SignatureHelp:Bw,SignatureHelpTriggerKind:Ww,SignatureInformation:Hw,SnippetString:Ka,SourceBreakpoint:ca,StandardTokenType:ho,StatusBarAlignment:uo,SymbolInformation:Jd,SymbolKind:_t,SymbolTag:Qd,Task:Ug,TaskEventKind:Yw,TaskGroup:rh,TaskPanelKind:Zw,TaskRevealKind:Xw,TaskScope:Do,TerminalLink:h3,TerminalQuickFixTerminalCommand:p3,TerminalQuickFixOpener:f3,TerminalLocation:Qw,TerminalProfile:g3,TerminalExitReason:Gw,TerminalShellExecutionCommandLineConfidence:sh,TerminalCompletionItem:m3,TerminalCompletionItemKind:Jw,TerminalCompletionList:_3,TerminalShellType:Kw,TextDocumentSaveReason:ac,TextEdit:ko,SnippetTextEdit:xa,TextEditorCursorStyle:ns,TextEditorChangeKind:lc,TextEditorLineNumbersStyle:Xi,TextEditorRevealType:Ng,TextEditorSelectionChangeKind:Bc,SyntaxTokenType:Wc,TextDocumentChangeReason:ih,ThemeColor:oh,ThemeIcon:Kn,TreeItem:$g,TreeItemCheckboxState:Is,TreeItemCollapsibleState:Ea,TypeHierarchyItem:tE,UIKind:Td,Uri:x,ViewColumn:nh,WorkspaceEdit:Ga,DocumentPasteTriggerKind:ib,DocumentDropEdit:nb,DocumentDropOrPasteEditKind:js,DocumentPasteEdit:b3,InlayHint:Rg,InlayHintLabelPart:Ag,InlayHintKind:Vw,RemoteAuthorityResolverError:Ds,ResolvedAuthority:u3,ManagedResolvedAuthority:ip,SourceControlInputBoxValidationType:jw,ExtensionRuntime:tm,TimelineItem:_b,NotebookRange:as,NotebookCellKind:da,NotebookCellExecutionState:gb,NotebookCellData:c_,NotebookData:KT,NotebookRendererScript:JT,NotebookCellStatusBarAlignment:Yg,NotebookEditorRevealType:Zg,NotebookCellOutput:Xg,NotebookCellOutputItem:QT,CellErrorStackFrame:k3,NotebookCellStatusBarItem:D3,NotebookControllerAffinity:mb,NotebookControllerAffinity2:em,NotebookEdit:Sg,NotebookKernelSourceAction:I3,NotebookVariablesRequestKind:_h,PortAttributes:T3,LinkedEditingRanges:C3,TestResultState:vb,TestRunRequest:nm,TestMessage:im,TestMessageStackFrame:P3,TestTag:vh,TestRunProfileKind:pc,TextSearchCompleteMessageType:Vm,DataTransfer:qc,DataTransferItem:Hg,TestCoverageCount:rp,FileCoverage:Kc,StatementCoverage:YT,BranchCoverage:ZT,DeclarationCoverage:eP,WorkspaceTrustState:bb,LanguageStatusSeverity:sc,QuickPickItemKind:mh,InputBoxValidationSeverity:hc,TabInputText:nE,TabInputTextDiff:sm,TabInputTextMerge:tP,TabInputCustom:iE,TabInputNotebook:sE,TabInputNotebookDiff:rE,TabInputWebview:nP,TabInputTerminal:iP,TabInputInteractiveWindow:sP,TabInputChat:rP,TabInputTextMultiDiff:oP,TelemetryTrustedValue:Kx,LogLevel:Be,EditSessionIdentityMatch:P0,InteractiveSessionVoteDirection:xb,ChatCopyKind:Eb,ChatEditingSessionActionOutcome:ha,InteractiveEditorResponseFeedbackKind:Db,DebugStackFrame:qT,DebugThread:jT,RelatedInformationType:Nb,SpeechToTextStatus:Fb,TextToSpeechStatus:Mb,PartialAcceptTriggerKind:aa,InlineCompletionEndOfLifeReasonKind:oc,KeywordRecognitionStatus:Ub,ChatImageMimeType:br,ChatResponseMarkdownPart:u_,ChatResponseFileTreePart:d_,ChatResponseAnchorPart:yh,ChatResponseProgressPart:oE,ChatResponseProgressPart2:ap,ChatResponseReferencePart:ka,ChatResponseReferencePart2:ka,ChatResponseCodeCitationPart:om,ChatResponseCodeblockUriPart:f_,ChatResponseWarningPart:xh,ChatResponseTextEditPart:Eh,ChatResponseNotebookEditPart:am,ChatResponseMarkdownWithVulnerabilitiesPart:bh,ChatResponseCommandButtonPart:h_,ChatResponseConfirmationPart:rm,ChatResponseMovePart:p_,ChatResponseExtensionsPart:aE,ChatPrepareToolInvocationPart:Sh,ChatResponseReferencePartStatusKind:Cb,ChatRequestTurn:Ib,ChatRequestTurn2:Ib,ChatResponseTurn:aP,ChatLocation:Yi,ChatRequestEditorData:lP,ChatRequestNotebookData:cP,ChatReferenceBinaryData:uP,ChatRequestEditedFileEventKind:kb,LanguageModelChatMessageRole:fi,LanguageModelChatMessage:hP,LanguageModelChatMessage2:fP,LanguageModelToolResultPart:lm,LanguageModelToolResultPart2:Tb,LanguageModelTextPart:zt,LanguageModelToolCallPart:Ja,LanguageModelError:yn,LanguageModelToolResult:g_,LanguageModelToolResult2:pP,LanguageModelDataPart:Ci,ExtendedLanguageModelToolResult:L3,PreparedTerminalToolInvocation:R3,LanguageModelChatToolMode:Lb,LanguageModelPromptTsxPart:Gs,NewSymbolName:x3,NewSymbolNameTag:rb,NewSymbolNameTriggerKind:uh,InlineEdit:N3,InlineEditTriggerKind:kh,ExcludeSettingOptions:_r,TextSearchContext2:lE,TextSearchMatch2:fo,AISearchKeyword:yy,TextSearchCompleteMessageTypeNew:Vm,ChatErrorLevel:Pb,McpHttpServerDefinition:F3,McpStdioServerDefinition:O3,SettingsSearchResultKind:Ob}}}var vp;let dx=class{constructor(e,t,i,s,r,o,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=s,this._extHostExtensionService=r,this._initData=o,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),ri("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();ri("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new g$(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(hx)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(fx,t,this._initData.environment.appUriScheme))}register(e){if("nodeModuleName"in e)if(Array.isArray(e.nodeModuleName))for(const t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName=="function"&&this._alternatives.push(t=>e.alternativeModuleName(t))}};dx=V([L(2,Yh),L(3,Ur),L(4,Ao),L(5,gn),L(6,at)],dx);var Ba;let hx=(Ba=class{constructor(e){if(e.environment.appRoot&&vp.aliased.size){const t=Wa(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",s=`@${i}+\\/${i}+|${i}+`,r="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${r}\\/)(${s})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,s,r]=t,o=vp.aliased.get(s);if(o!==void 0)return console.warn(`${s} as been renamed to ${o}, please update your imports`),i+o+r}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},vp=Ba,Ba.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),Ba);hx=vp=V([L(0,gn)],hx);class g${constructor(e,t,i,s,r){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=s,this._logService=r,this.nodeModuleName="vscode",this._extApiImpl=new Lr}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let s=this._extApiImpl.get(i.identifier);return s||(s=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,s)),s}if(!this._defaultApiImpl){let s="";this._extensionPaths.forEach((r,o)=>s+=` ${o} -> ${r.identifier.value}
|
|
139
|
+
`,o.map(u=>new et(u.range.startLineNumber-1,u.range.startColumn-1,u.range.endLineNumber-1,u.range.endColumn-1)))})}const DU=pe("remoteAgentService"),IU=pe("IUserDataProfilesService"),CU=Object.freeze({id:"workbench",order:7,title:h(3797,"Workbench"),type:"object"}),TU=Object.freeze({id:"security",scope:bt.APPLICATION,title:h(3798,"Security"),type:"object",order:7});Object.freeze({id:"problems",title:h(3799,"Problems"),type:"object",order:101});const PU=Object.freeze({id:"window",order:8,title:h(3800,"Window"),type:"object"}),AU={ConfigurationMigration:"base.contributions.configuration.migration"};class RU{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new N,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}}const mp=new RU;mn.add(AU.ConfigurationMigration,mp);var Ec;let I4=(Ec=class extends Se{constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async i=>{for(const s of i.added)await this.migrateConfigurationsForFolder(s,mp.migrations)})),this.migrateConfigurations(mp.migrations),this._register(mp.onDidRegisterConfigurationMigration(i=>this.migrateConfigurations(i)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(const t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(i=>this.migrateConfigurationsForFolderAndOverride(i,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){const i=this.configurationService.inspect(e.key,{resource:t}),s=this.workspaceService.getWorkbenchState()===Op.WORKSPACE?[["user",Zt.USER],["userLocal",Zt.USER_LOCAL],["userRemote",Zt.USER_REMOTE],["workspace",Zt.WORKSPACE],["workspaceFolder",Zt.WORKSPACE_FOLDER]]:[["user",Zt.USER],["userLocal",Zt.USER_LOCAL],["userRemote",Zt.USER_REMOTE],["workspace",Zt.WORKSPACE]];for(const[r,o]of s){const a=i[r];if(!a)continue;const l=[];if(a.value!==void 0){const c=await this.runMigration(e,r,a.value,t,void 0);for(const u of c??[])l.push([u,[]])}for(const{identifiers:c,value:u}of a.overrides??[])if(u!==void 0){const d=await this.runMigration(e,r,u,t,c);for(const f of d??[])l.push([f,c])}l.length&&await Promise.allSettled(l.map(async([[c,u],d])=>this.configurationService.updateValue(c,u.value,{resource:t,overrideIdentifiers:d},o)))}}async runMigration(e,t,i,s,r){const o=l=>{const u=this.configurationService.inspect(l,{resource:s})[t];if(u)return r?u.overrides?.find(({identifiers:d})=>Gn(d,r))?.value:u.value},a=await e.migrateFn(i,o);return Array.isArray(a)?a:[[e.key,a]]}},Ec.ID="workbench.contrib.configurationMigration",Ec);I4=V([L(0,b_),L(1,HP)],I4);var Sc;let C4=(Sc=class extends Se{constructor(e){super(),this.remoteAgentService=e,this._ready=new Eo,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){if(!Qn&&(await this.remoteAgentService.getEnvironment())?.os!==Ms.Windows)return;mn.as(ll.Configuration).registerConfiguration({...TU,properties:{"security.allowedUNCHosts":{type:"array",items:{type:"string",pattern:"^[^\\\\]+$",patternErrorMessage:h(3801,"UNC host names must not contain backslashes.")},default:[],markdownDescription:h(3802,"A set of UNC host names (without leading or trailing backslash, for example `192.168.0.1` or `my-server`) to allow without user confirmation. If a UNC host is being accessed that is not allowed via this setting or has not been acknowledged via user confirmation, an error will occur and the operation stopped. A restart is required when changing this setting. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:bt.APPLICATION_MACHINE},"security.restrictUNCAccess":{type:"boolean",default:!0,markdownDescription:h(3803,"If enabled, only allows access to UNC host names that are allowed by the `#security.allowedUNCHosts#` setting or after user confirmation. Find out more about this setting at https://aka.ms/vscode-windows-unc."),scope:bt.APPLICATION_MACHINE}}})}},Sc.ID="workbench.contrib.dynamicWorkbenchSecurityConfiguration",Sc);C4=V([L(0,DU)],C4);const Fu="window.newWindowProfile";var kc;let T4=(kc=class extends Se{constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(i=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(i=>{i.source!==Zt.DEFAULT&&i.affectsConfiguration(Fu)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){const e=mn.as(ll.Configuration),t={...PU,properties:{[Fu]:{type:["string","null"],default:null,enum:[...this.userDataProfilesService.profiles.map(i=>i.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(i=>""),h(3804,"Active Window")],description:h(3805,"Specifies the profile to use when opening a new window. If a profile name is provided, the new window will use that profile. If no profile name is provided, the new window will use the profile of the active window or the Default profile if no active window exists."),scope:bt.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){const e=this.configurationService.getValue(Fu);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){const e=this.configurationService.getValue(Fu);if(!e)return;const t=this.newWindowProfile?this.userDataProfilesService.profiles.find(i=>i.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(Fu,t?.name)}},kc.ID="workbench.contrib.dynamicWindowConfiguration",kc);T4=V([L(0,IU),L(1,b_)],T4);const LU=mn.as(ll.Configuration),NU={...CU,properties:{"workbench.editorAssociations":{type:"object",markdownDescription:h(12470,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors (for example `"*.hex": "hexEditor.hexedit"`). These have precedence over the default behavior.'),additionalProperties:{type:"string"}}}};LU.registerConfiguration(NU);var Q0;(function(n){n.builtin="builtin",n.option="option",n.exclusive="exclusive",n.default="default"})(Q0||(Q0={}));var P4;(function(n){n[n.ABORT=1]="ABORT",n[n.NONE=2]="NONE"})(P4||(P4={}));function OU(n,e){if(new Set([le.extension,le.webviewPanel,le.vscodeWorkspaceTrust,le.vscodeSettings]).has(e.scheme))return!1;const s=typeof n=="string"&&n.indexOf(ct.sep)>=0?`${e.scheme}:${e.path}`:Ks(e);return sd(typeof n=="string"?n.toLowerCase():n,s.toLowerCase())}const ta=class ta{get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(e,t,i,s,r,o,a){this._textDocumentsAndEditors=i,this._textDocuments=s,this._extHostFileSystem=r,this._extHostSearch=o,this._logService=a,this._notebookStatusBarItemProviders=new Map,this._documents=new on,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new N,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new N,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new N,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new N,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new Oi("NotebookCellStatusBarCache"),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=e.getProxy(ee.MainThreadNotebook),this._notebookDocumentsProxy=e.getProxy(ee.MainThreadNotebookDocuments),this._notebookEditorsProxy=e.getProxy(ee.MainThreadNotebookEditors),this._commandsConverter=t.converter,t.registerArgumentProcessor({processArgument:l=>{if(l&&l.$mid===st.NotebookCellActionContext){const c=l.notebookEditor?.notebookUri,u=l.cell.handle,f=this._documents.get(c)?.getCell(u);if(f)return f.apiCell}if(l&&l.$mid===st.NotebookActionContext){const c=l.uri,u=this._documents.get(c);if(u)return u.apiNotebook}return l}}),ta._registerApiCommands(t)}getEditorById(e){const t=this._editors.get(e);if(!t)throw new Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(const[t,i]of this._editors)if(i.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){const i=this._documents.get(e);if(!i&&!t)throw new Error(`NO notebook document for '${e}'`);return i}static _convertNotebookRegistrationData(e,t){if(!t)return;const i=t.filenamePattern.map(s=>Sm.from(s)).filter(s=>s!==void 0);if(t.filenamePattern&&!i){console.warn(`Notebook content provider view options file name pattern is invalid ${t.filenamePattern}`);return}return{extension:e.identifier,providerDisplayName:e.displayName||e.name,displayName:t.displayName,filenamePattern:i,priority:t.exclusive?Q0.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(e,t,i){const s=ta._notebookStatusBarItemProviderHandlePool++,r=typeof i.onDidChangeCellStatusBarItems=="function"?ta._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(s,i),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(s,r,t);let o;return r!==void 0&&(o=i.onDidChangeCellStatusBarItems(a=>this._notebookProxy.$emitCellStatusBarEvent(r))),new je(()=>{this._notebookStatusBarItemProviders.delete(s),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(s,r),o?.dispose()})}async createNotebookDocument(e){const t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&Xr.from(e.content)});return x.revive(t)}async openNotebookDocument(e){const t=this._documents.get(e);if(t)return t.apiNotebook;const i=await this._notebookDocumentsProxy.$tryOpenNotebook(e),s=this._documents.get(x.revive(i));return Tc(s?.apiNotebook)}async showNotebookDocument(e,t){let i;typeof t=="object"?i={position:hn.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(Ws.from),pinned:typeof t.preview=="boolean"?!t.preview:void 0,label:typeof t.asRepl=="string"?t.asRepl:typeof t.asRepl=="object"?t.asRepl.label:void 0}:i={preserveFocus:!1,pinned:!0};const s=t?.asRepl?"repl":e.notebookType,r=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,s,i),o=r&&this._editors.get(r)?.apiEditor;if(o)return o;throw r?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,i,s){const r=this._notebookStatusBarItemProviders.get(e),o=x.revive(t),a=this._documents.get(o);if(!a||!r)return;const l=a.getCellFromIndex(i);if(!l)return;const c=await r.provideCellStatusBarItems(l.apiCell,s);if(!c)return;const u=new xe,d=this._statusBarCache.add([u]),p=(Array.isArray(c)?c:[c]).map(_=>ty.from(_,this._commandsConverter,u));return{cacheId:d,items:p}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(e,t,i,s,r){if(Od(t))throw new Error("viewType cannot be empty or just whitespace");const o=this._handlePool++;return this._notebookSerializer.set(o,{viewType:t,serializer:i,options:s}),this._notebookProxy.$registerNotebookSerializer(o,{id:e.identifier,location:e.extensionLocation},t,iy.from(s),ta._convertNotebookRegistrationData(e,r)),we(()=>{this._notebookProxy.$unregisterNotebookSerializer(o)})}async $dataToNotebook(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const r=await s.serializer.deserializeNotebook(t.buffer,i);return new jn(Xr.from(r))}async $notebookToData(e,t,i){const s=this._notebookSerializer.get(e);if(!s)throw new Error("NO serializer found");const r=await s.serializer.serializeNotebook(Xr.to(t.value),i);return ue.wrap(r)}async $saveNotebook(e,t,i,s,r){const o=x.revive(t),a=this._notebookSerializer.get(e);if(this.trace(`enter saveNotebook(versionId: ${i}, ${o.toString()})`),!a)throw new Error("NO serializer found");const l=this._documents.get(o);if(!l)throw new Error("Document NOT found");if(l.versionId!==i)throw new Error("Document version mismatch");if(!this._extHostFileSystem.value.isWritableFileSystem(o.scheme))throw new Yv(h(2588,"Unable to modify read-only file '{0}'",this._resourceForError(o)),Si.FILE_PERMISSION_DENIED);const c={metadata:SS(l.apiNotebook.metadata,_=>!(a.options?.transientDocumentMetadata??{})[_]),cells:[]};for(const _ of l.apiNotebook.getCells()){const w=new c_(_.kind,_.document.getText(),_.document.languageId,_.mime,a.options?.transientOutputs?[]:[..._.outputs],_.metadata,_.executionSummary);w.metadata=SS(_.metadata,v=>!(a.options?.transientCellMetadata??{})[v]),c.cells.push(w)}if(await this._validateWriteFile(o,s),r.isCancellationRequested)throw new Error("canceled");const u=await a.serializer.serializeNotebook(c,r);if(r.isCancellationRequested)throw new Error("canceled");this.trace(`serialized versionId: ${i} ${o.toString()}`),await this._extHostFileSystem.value.writeFile(o,u),this.trace(`Finished write versionId: ${i} ${o.toString()}`);const d=this._extHostFileSystem.getFileSystemProviderExtUri(o.scheme),f=await this._extHostFileSystem.value.stat(o),p={name:d.basename(o),isFile:(f.type&va.File)!==0,isDirectory:(f.type&va.Directory)!==0,isSymbolicLink:(f.type&va.SymbolicLink)!==0,mtime:f.mtime,ctime:f.ctime,size:f.size,readonly:!!((f.permissions??0)&Oc.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(o.scheme),locked:!!((f.permissions??0)&Oc.Locked),etag:DS({mtime:f.mtime,size:f.size}),children:void 0};return this.trace(`exit saveNotebook(versionId: ${i}, ${o.toString()})`),p}async $searchInNotebooks(e,t,i,s,r){const o=this._notebookSerializer.get(e)?.serializer;if(!o)return{limitHit:!1,results:[]};const a=new V4;await(async(f,p,_)=>{await Promise.all(f.map(async w=>await Promise.all(w.filenamePatterns.map(v=>{const E={_reason:_._reason,folderQueries:_.folderQueries,includePattern:_.includePattern,excludePattern:_.excludePattern,maxResults:_.maxResults,type:Pa.File,filePattern:v};return this._extHostSearch.doInternalFileSearchWithCustomCallback(E,p,S=>{S.forEach(A=>{a.has(A)||s.some(W=>w.isFromSettings&&!W.isFromSettings?!1:W.filenamePatterns.some(ce=>OU(ce,A)))||a.add(A)})}).catch(S=>{if(S.code==="ENOENT")return console.warn("Could not find notebook search results, ignoring notebook results."),{limitHit:!1,messages:[]};throw S})}))))})(i,r,t);const c=new on;let u=!1;const d=Array.from(a).map(async f=>{const p=[];try{if(r.isCancellationRequested)return;if(t.maxResults&&[...c.values()].reduce((E,S)=>E+S.cellResults.length,0)>t.maxResults){u=!0;return}const _=[],w=this._documents.get(f);if(w)w.apiNotebook.getCells().forEach(S=>_.push({input:S.document.getText(),outputs:S.outputs.flatMap(A=>A.items.map(G=>G.data.toString()))}));else{const E=await this._extHostFileSystem.value.readFile(f),S=ue.fromString(E.toString()),A=await o.deserializeNotebook(S.buffer,r);if(r.isCancellationRequested)return;Xr.from(A).cells.forEach(W=>_.push({input:W.source,outputs:W.outputs.flatMap(ce=>ce.items.map(Q=>Q.valueBytes.toString()))}))}if(r.isCancellationRequested)return;_.forEach((E,S)=>{const A=t.contentPattern.pattern,G=new kU(E.input,void 0,E.outputs),W=G.findInInputs(A),ce=G.findInOutputs(A),Q=ce.flatMap(ne=>D4(ne.matches,ne.textBuffer)).map((ne,J)=>(ne.webviewIndex=J,ne));if(W.length>0||ce.length>0){const ne={index:S,contentResults:D4(W,G.inputTextBuffer),webviewResults:Q};p.push(ne)}});const v={resource:f,cellResults:p};c.set(f,v);return}catch{return}});return await Promise.all(d),{limitHit:u,results:[...c.values()]}}async _validateWriteFile(e,t){const i=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime=="number"&&typeof t.etag=="string"&&t.etag!==c8&&typeof i.mtime=="number"&&typeof i.size=="number"&&t.mtime<i.mtime&&t.etag!==DS({mtime:t.mtime,size:i.size}))throw new Yv(h(2589,"File Modified Since"),Si.FILE_MODIFIED_SINCE,t)}_resourceForError(e){return e.scheme===le.file?e.fsPath:e.toString()}_createExtHostEditor(e,t,i){if(this._editors.has(t))throw new Error(`editor with id ALREADY EXSIST: ${t}`);const s=new jh(t,this._notebookEditorsProxy,e,i.visibleRanges.map(Ws.to),i.selections.map(Ws.to),typeof i.viewColumn=="number"?hn.to(i.viewColumn):void 0,i.viewType);this._editors.set(t,s)}$acceptDocumentAndEditorsDelta(e){if(e.value.removedDocuments)for(const t of e.value.removedDocuments){const i=x.revive(t),s=this._documents.get(i);s&&(s.dispose(),this._documents.delete(i),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({removedDocuments:s.apiNotebook.getCells().map(r=>r.document.uri)}),this._onDidCloseNotebookDocument.fire(s.apiNotebook));for(const r of this._editors.values())r.notebookData.uri.toString()===i.toString()&&this._editors.delete(r.id)}if(e.value.addedDocuments){const t=[];for(const i of e.value.addedDocuments){const s=x.revive(i.uri);if(this._documents.has(s))throw new Error(`adding EXISTING notebook ${s} `);const r=new G0(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,s,i);t.push(...i.cells.map(o=>j0.asModelAddData(o))),this._documents.get(s)?.dispose(),this._documents.set(s,r),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(r.apiNotebook)}}if(e.value.addedEditors)for(const t of e.value.addedEditors){if(this._editors.has(t.id))return;const i=x.revive(t.documentUri),s=this._documents.get(i);s&&this._createExtHostEditor(s,t.id,t)}if(e.value.removedEditors)for(const t of e.value.removedEditors){const i=this._editors.get(t);i&&(this._editors.delete(t),this._activeNotebookEditor?.id===i.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(i=>this._editors.get(i)).filter(i=>!!i);const t=new Set;this._visibleNotebookEditors.forEach(i=>t.add(i.id));for(const i of this._editors.values()){const s=t.has(i.id);i._acceptVisibility(s)}this._visibleNotebookEditors=[...this._editors.values()].map(i=>i).filter(i=>i.visible),this._onDidChangeVisibleNotebookEditors.fire(this.visibleNotebookEditors)}e.value.newActiveEditor===null?this._activeNotebookEditor=void 0:e.value.newActiveEditor&&(this._editors.get(e.value.newActiveEditor)||console.error(`FAILED to find active notebook editor ${e.value.newActiveEditor}`),this._activeNotebookEditor=this._editors.get(e.value.newActiveEditor)),e.value.newActiveEditor!==void 0&&this._onDidChangeActiveNotebookEditor.fire(this._activeNotebookEditor?.apiEditor)}static _registerApiCommands(e){const t=j.String.with("notebookType","A notebook type"),i=new Te("vscode.executeDataToNotebook","_executeDataToNotebook","Invoke notebook serializer",[t,new j("data","Bytes to convert to data",r=>r instanceof Uint8Array,r=>ue.wrap(r))],new ke("Notebook Data",r=>Xr.to(r.value))),s=new Te("vscode.executeNotebookToData","_executeNotebookToData","Invoke notebook serializer",[t,new j("NotebookData","Notebook data to convert to bytes",r=>!0,r=>new jn(Xr.from(r)))],new ke("Bytes",r=>r.buffer));e.registerApiCommand(i),e.registerApiCommand(s)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}};ta._notebookStatusBarItemProviderHandlePool=0;let J0=ta;class FU{constructor(e,t,i,s={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=i,this._thresholds=s,this._onWillSaveNotebookDocumentEvent=new qu}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,i,s)=>{const r=function(a){t.call(i,a)};return r.extension=e,this._onWillSaveNotebookDocumentEvent.event(r,void 0,s)}}async $participateInSave(e,t,i){const s=x.revive(e),r=this._notebooksAndEditors.getNotebookDocument(s);if(!r)throw new Error("Unable to resolve notebook document");const o=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:r.apiNotebook,reason:bm.to(t)},i,async(l,c)=>{const u=Date.now(),d=await await Promise.resolve(l);Date.now()-u>this._thresholds.timeout&&this._logService.warn("onWillSaveNotebookDocument-listener from extension",c.extension.identifier),!i.isCancellationRequested&&d&&(d instanceof Ga?o.push(d):this._logService.warn("onWillSaveNotebookDocument-listener from extension",c.extension.identifier,"ignored due to invalid data"))}),i.isCancellationRequested)return!1;if(o.length===0)return!0;const a={edits:[]};for(const l of o){const{edits:c}=_i.from(l);a.edits=a.edits.concat(c)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new jn(a))}}class MU{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new N,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new N,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,i,s){const o=this._notebooksAndEditors.getNotebookDocument(x.revive(e)).acceptModelChanged(t.value,i,s);this._onDidChangeNotebookDocument.fire(o)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(x.revive(e)).acceptDirty(t)}$acceptModelSaved(e){const t=this._notebooksAndEditors.getNotebookDocument(x.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}}let X0=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new N,this._onDidChangeNotebookEditorVisibleRanges=new N,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug("ExtHostNotebook#$acceptEditorPropertiesChanged",e,t);const i=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&i._acceptVisibleRanges(t.visibleRanges.ranges.map(Ws.to)),t.selections&&i._acceptSelections(t.selections.selections.map(Ws.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:i.apiEditor,visibleRanges:i.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:i.apiEditor,selections:i.apiEditor.selections}))}$acceptEditorViewColumns(e){for(const t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(hn.to(e[t]))}};X0=V([L(0,at)],X0);var Vl;(function(n){n[n.Output=1]="Output",n[n.OutputItems=2]="OutputItems",n[n.ExecutionState=3]="ExecutionState"})(Vl||(Vl={}));const UU=100;var A4;(function(n){n[n.Disconnected=1]="Disconnected",n[n.Connected=2]="Connected",n[n.Initializing=3]="Initializing"})(A4||(A4={}));let Y0=class{constructor(e,t,i,s,r){this._initData=t,this._extHostNotebook=i,this._commands=s,this._logService=r,this._activeExecutions=new on,this._activeNotebookExecutions=new on,this._kernelDetectionTask=new Map,this._kernelDetectionTaskHandlePool=0,this._kernelSourceActionProviders=new Map,this._kernelSourceActionProviderHandlePool=0,this._kernelData=new Map,this._handlePool=0,this.id=0,this.variableStore={},this._proxy=e.getProxy(ee.MainThreadNotebookKernels);const o=new Te("notebook.selectKernel","_notebook.selectKernel","Trigger kernel picker for specified notebook editor widget",[new j("options","Select kernel options",l=>!0,l=>{if(l&&"notebookEditor"in l&&"id"in l){const c=this._extHostNotebook.getIdByEditor(l.notebookEditor);return{id:l.id,extension:l.extension,notebookEditorId:c}}else if(l&&"notebookEditor"in l){const c=this._extHostNotebook.getIdByEditor(l.notebookEditor);if(c===void 0)throw new Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${l.notebookEditor.notebook.uri.toString()}`);return"skipIfAlreadySelected"in l?{notebookEditorId:c,skipIfAlreadySelected:l.skipIfAlreadySelected}:{notebookEditorId:c}}return l})],ke.Void),a=new Te("vscode.executeNotebookVariableProvider","_executeNotebookVariableProvider","Execute notebook variable provider",[j.Uri],new ke("A promise that resolves to an array of variables",(l,c)=>l.map(u=>({variable:{name:u.name,value:u.value,expression:u.expression,type:u.type,language:u.language},hasNamedChildren:u.hasNamedChildren,indexedChildrenCount:u.indexedChildrenCount}))));this._commands.registerApiCommand(o),this._commands.registerApiCommand(a)}createNotebookController(e,t,i,s,r,o){for(const W of this._kernelData.values())if(W.controller.id===t&&tt.equals(e.identifier,W.extensionId))throw new Error(`notebook controller with id '${t}' ALREADY exist`);const a=this._handlePool++,l=this;this._logService.trace(`NotebookController[${a}], CREATED by ${e.identifier.value}, ${t}`);const c=()=>console.warn(`NO execute handler from notebook controller '${p.id}' of extension: '${e.identifier}'`);let u=!1;const d=new N,f=new N,p={id:Bf(e.identifier,t),notebookType:i,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:s||e.identifier.value,preloads:o?o.map(km.from):[]};let _=r??c,w,v;this._proxy.$addKernel(a,p).catch(W=>{console.log(W),u=!0});let E=0;const S=()=>{if(u)return;const W=++E;Promise.resolve().then(()=>{W===E&&this._proxy.$updateKernel(a,p)})},A=new on,G={get id(){return t},get notebookType(){return p.notebookType},onDidChangeSelectedNotebooks:d.event,get label(){return p.label},set label(W){p.label=W??e.displayName??e.name,S()},get detail(){return p.detail??""},set detail(W){p.detail=W,S()},get description(){return p.description??""},set description(W){p.description=W,S()},get supportedLanguages(){return p.supportedLanguages},set supportedLanguages(W){p.supportedLanguages=W,S()},get supportsExecutionOrder(){return p.supportsExecutionOrder??!1},set supportsExecutionOrder(W){p.supportsExecutionOrder=W,S()},get rendererScripts(){return p.preloads?p.preloads.map(km.to):[]},get executeHandler(){return _},set executeHandler(W){_=W??c},get interruptHandler(){return w},set interruptHandler(W){w=W,p.supportsInterrupt=!!W,S()},set variableProvider(W){$(e,"notebookVariableProvider"),v=W,p.hasVariableProvider=!!W,W?.onDidChangeVariables(ce=>l._proxy.$variablesUpdated(ce.uri)),S()},get variableProvider(){return v},createNotebookCellExecution(W){if(u)throw new Error("notebook controller is DISPOSED");if(!A.has(W.notebook.uri))throw l._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(A.keys()).map(ce=>ce.toString())),new Error(`notebook controller is NOT associated to notebook: ${W.notebook.uri.toString()}`);return l._createNotebookCellExecution(W,Bf(e.identifier,this.id))},createNotebookExecution(W){if($(e,"notebookExecution"),u)throw new Error("notebook controller is DISPOSED");if(!A.has(W.uri))throw l._logService.trace(`NotebookController[${a}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(A.keys()).map(ce=>ce.toString())),new Error(`notebook controller is NOT associated to notebook: ${W.uri.toString()}`);return l._createNotebookExecution(W,Bf(e.identifier,this.id))},dispose:()=>{u||(this._logService.trace(`NotebookController[${a}], DISPOSED`),u=!0,this._kernelData.delete(a),d.dispose(),f.dispose(),this._proxy.$removeKernel(a))},updateNotebookAffinity(W,ce){ce===em.Hidden&&$(e,"notebookControllerAffinityHidden"),l._proxy.$updateNotebookPriority(a,W.uri,ce)},onDidReceiveMessage:f.event,postMessage(W,ce){return $(e,"notebookMessaging"),l._proxy.$postMessage(a,ce&&l._extHostNotebook.getIdByEditor(ce),W)},asWebviewUri(W){return $(e,"notebookMessaging"),_d(W,l._initData.remote)}};return this._kernelData.set(a,{extensionId:e.identifier,controller:G,onDidReceiveMessage:f,onDidChangeSelection:d,associatedNotebooks:A}),G}getIdByController(e){for(const[t,i]of this._kernelData)if(i.controller===e)return Bf(i.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){const i=this._kernelDetectionTaskHandlePool++,s=this;this._logService.trace(`NotebookControllerDetectionTask[${i}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(i,t);const r={dispose:()=>{this._kernelDetectionTask.delete(i),s._proxy.$removeKernelDetectionTask(i)}};return this._kernelDetectionTask.set(i,r),r}registerKernelSourceActionProvider(e,t,i){const s=this._kernelSourceActionProviderHandlePool++,r=typeof i.onDidChangeNotebookKernelSourceActions=="function"?s:void 0,o=this;this._kernelSourceActionProviders.set(s,i),this._logService.trace(`NotebookKernelSourceActionProvider[${s}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(s,s,t);let a;return r!==void 0&&(a=i.onDidChangeNotebookKernelSourceActions(l=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(r))),{dispose:()=>{this._kernelSourceActionProviders.delete(s),o._proxy.$removeKernelSourceActionProvider(s,s),a?.dispose()}}}async $provideKernelSourceActions(e,t){const i=this._kernelSourceActionProviders.get(e);if(i){const s=new xe;return(await i.provideNotebookKernelSourceActions(t)??[]).map(o=>ny.from(o,this._commands.converter,s))}return[]}$acceptNotebookAssociation(e,t,i){const s=this._kernelData.get(e);if(s){const r=this._extHostNotebook.getNotebookDocument(x.revive(t));i?s.associatedNotebooks.set(r.uri,!0):s.associatedNotebooks.delete(r.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,r.uri.toString(),i),s.onDidChangeSelection.fire({selected:i,notebook:r.apiNotebook})}}async $executeCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const r=this._extHostNotebook.getNotebookDocument(x.revive(t)),o=[];for(const a of i){const l=r.getCell(a);l&&o.push(l.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,r.uri.toString(),o.length),await s.controller.executeHandler.call(s.controller,o,r.apiNotebook,s.controller)}catch(a){this._logService.error(`NotebookController[${e}] execute cells FAILED`,a),console.error(a)}}async $cancelCells(e,t,i){const s=this._kernelData.get(e);if(!s)return;const r=this._extHostNotebook.getNotebookDocument(x.revive(t));if(s.controller.interruptHandler)await s.controller.interruptHandler.call(s.controller,r.apiNotebook);else for(const o of i){const a=r.getCell(o);a&&this._activeExecutions.get(a.uri)?.cancel()}if(s.controller.interruptHandler){const o=this._activeNotebookExecutions.get(r.uri);this._activeNotebookExecutions.delete(r.uri),i.length&&Array.isArray(o)&&o.length&&o.forEach(a=>a.dispose())}}async $provideVariables(e,t,i,s,r,o,a){const l=this._kernelData.get(e);if(!l)return;const c=this._extHostNotebook.getNotebookDocument(x.revive(i)),u=l.controller.variableProvider;if(!u)return;let d;if(s!==void 0){if(d=this.variableStore[s],!d)return}else this.variableStore={};const f=r==="named"?_h.Named:_h.Indexed,p=u.provideVariables(c.apiNotebook,d,f,o,a);let _=0;for await(const w of p){if(a.isCancellationRequested)return;const v={id:this.id++,name:w.variable.name,value:w.variable.value,type:w.variable.type,interfaces:w.variable.interfaces,language:w.variable.language,expression:w.variable.expression,hasNamedChildren:w.hasNamedChildren,indexedChildrenCount:w.indexedChildrenCount,extensionId:l.extensionId.value};if(this.variableStore[v.id]=w.variable,this._proxy.$receiveVariable(t,v),_++>=UU)return}}$acceptKernelMessageFromRenderer(e,t,i){const s=this._kernelData.get(e);if(!s)return;const r=this._extHostNotebook.getEditorById(t);s.onDidReceiveMessage.fire(Object.freeze({editor:r.apiEditor,message:i}))}_createNotebookCellExecution(e,t){if(e.index<0)throw new Error("CANNOT execute cell that has been REMOVED from notebook");const s=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!s)throw new Error("invalid cell");if(this._activeExecutions.has(s.uri))throw new Error(`duplicate execution for ${s.uri}`);const r=new Z0(t,s,this._proxy);this._activeExecutions.set(s.uri,r);const o=r.onDidChangeState(()=>{r.state===Zi.Resolved&&(r.dispose(),o.dispose(),this._activeExecutions.delete(s.uri))});return r.asApiObject()}_createNotebookExecution(e,t){const i=this._extHostNotebook.getNotebookDocument(e.uri),s=e.getCells().find(a=>{const l=i.getCellFromApiCell(a);return l&&this._activeExecutions.has(l.uri)});if(s)throw new Error(`duplicate cell execution for ${s.document.uri}`);if(this._activeNotebookExecutions.has(i.uri))throw new Error(`duplicate notebook execution for ${i.uri}`);const r=new ex(t,i,this._proxy),o=r.onDidChangeState(()=>{r.state===vr.Resolved&&(r.dispose(),o.dispose(),this._activeNotebookExecutions.delete(i.uri))});return this._activeNotebookExecutions.set(i.uri,[r,o]),r.asApiObject()}};Y0=V([L(4,at)],Y0);var Zi;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(Zi||(Zi={}));const U1=class U1 extends Se{get state(){return this._state}constructor(e,t,i){super(),this._cell=t,this._proxy=i,this._handle=U1.HANDLE++,this._onDidChangeState=new N,this.onDidChangeState=this._onDidChangeState.event,this._state=Zi.Init,this._tokenSource=this._register(new Nt),this._collector=new HU(10,s=>this.update(s)),this._executionOrder=t.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,e,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){const t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new jn(t))}verifyStateForOutput(){if(this._state===Zi.Init)throw new Error("Must call start before modifying cell output");if(this._state===Zi.Resolved)throw new Error("Cannot modify cell output after calling resolve")}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw new Error("INVALID cell");return t.handle}validateAndConvertOutputs(e){return e.map(t=>{const i=Xg.ensureUniqueMimeTypes(t.items,!0);return i===t.items?Io.from(t):Io.from({items:i,id:t.id,metadata:t.metadata})})}async updateOutputs(e,t,i){const s=this.cellIndexToHandle(t),r=this.validateAndConvertOutputs(Ri(e));return this.updateSoon({editType:Vl.Output,cellHandle:s,append:i,outputs:r})}async updateOutputItems(e,t,i){return e=Xg.ensureUniqueMimeTypes(Ri(e),!0),this.updateSoon({editType:Vl.OutputItems,items:e.map(iu.from),outputId:t.id,append:i})}asApiObject(){const e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(i){e._executionOrder=i,e.update([{editType:Vl.ExecutionState,executionOrder:e._executionOrder}])},start(i){if(e._state===Zi.Resolved||e._state===Zi.Started)throw new Error("Cannot call start again");e._state=Zi.Started,e._onDidChangeState.fire(),e.update({editType:Vl.ExecutionState,runStartTime:i})},end(i,s,r){if(e._state===Zi.Resolved)throw new Error("Cannot call resolve twice");e._state=Zi.Resolved,e._onDidChangeState.fire(),e._collector.flush();const o=$U(r);e._proxy.$completeExecution(e._handle,new jn({runEndTime:s,lastRunSuccess:i,error:o}))},clearOutput(i){return e.verifyStateForOutput(),e.updateOutputs([],i,!1)},appendOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!0)},replaceOutput(i,s){return e.verifyStateForOutput(),e.updateOutputs(i,s,!1)},appendOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!0)},replaceOutputItems(i,s){return e.verifyStateForOutput(),e.updateOutputItems(i,s,!1)}})}};U1.HANDLE=0;let Z0=U1;function $U(n){const e=s=>s?{startLineNumber:s.start.line,startColumn:s.start.character,endLineNumber:s.end.line,endColumn:s.end.character}:void 0,t=s=>({uri:s.uri,position:s.position,label:s.label});return n?{name:n.name,message:n.message,stack:n.stack instanceof Array?n.stack.map(s=>t(s)):n.stack,location:e(n.location),uri:n.uri}:void 0}var vr;(function(n){n[n.Init=0]="Init",n[n.Started=1]="Started",n[n.Resolved=2]="Resolved"})(vr||(vr={}));const $1=class $1 extends Se{get state(){return this._state}constructor(e,t,i){super(),this._notebook=t,this._proxy=i,this._handle=$1.HANDLE++,this._onDidChangeState=new N,this.onDidChangeState=this._onDidChangeState.event,this._state=vr.Init,this._tokenSource=this._register(new Nt),this._proxy.$createNotebookExecution(this._handle,e,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===vr.Resolved||this._state===vr.Started)throw new Error("Cannot call start again");this._state=vr.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===vr.Resolved)throw new Error("Cannot call resolve twice");this._state=vr.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}};$1.HANDLE=0;let ex=$1;class HU{constructor(e,t){this.delay=e,this.callback=t,this.batch=[],this.startedTimer=Date.now()}addItem(e){return this.batch.push(e),this.currentDeferred||(this.currentDeferred=new Eo,this.startedTimer=Date.now(),us(this.delay).then(()=>this.flush())),Date.now()-this.startedTimer>this.delay?this.flush():this.currentDeferred.p}flush(){if(this.batch.length===0||!this.currentDeferred)return Promise.resolve();const e=this.currentDeferred;this.currentDeferred=void 0;const t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}}function Bf(n,e){return`${n.value}/${e}`}class BU{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(ee.MainThreadNotebookRenderers)}$postRendererMessage(e,t,i){const s=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:s.apiEditor,message:i})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(s=>s.id===t))throw new Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(s,r,o)=>this.getOrCreateEmitterFor(t).event(s,r,o),postMessage:(s,r)=>{jh.apiEditorsToExtHost.has(s)&&([s,r]=[r,s]);const o=r&&jh.apiEditorsToExtHost.get(r);return this.proxy.$postMessage(o?.id,t,s)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new N({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}}class WU{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(ee.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,i){if($(e,"profileContentHandlers"),this.handlers.has(t))throw new Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,i),this.proxy.$registerProfileContentHandler(t,i.name,i.description,e.identifier.value),we(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,i,s){const r=this.handlers.get(e);if(!r)throw new Error(`Unknown handler with id: ${e}`);return r.saveProfile(t,i,s)}async $readProfile(e,t,i){const s=this.handlers.get(e);if(!s)throw new Error(`Unknown handler with id: ${e}`);return s.readProfile(it(t)?t:x.revive(t),i)}}const H1=class H1{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(ee.MainThreadQuickDiff)}$provideOriginalResource(e,t,i){const s=x.revive(t),r=this.providers.get(e);return r?Ln(()=>r.provideOriginalResource(s,i)).then(o=>o||null):Promise.resolve(null)}registerQuickDiffProvider(e,t,i,s,r,o){const a=H1.handlePool++;this.providers.set(a,i);const l=tt.toKey(e.identifier);return this.proxy.$registerQuickDiffProvider(a,Qc.from(t,this.uriTransformer),`${l}.${s}`,r,o),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(a),this.providers.delete(a)}}}};H1.handlePool=0;let tx=H1;function VU(n,e,t){const i=n.getProxy(ee.MainThreadQuickOpen);class s{constructor(_,w){this._sessions=new Map,this._instances=0,this._workspace=_,this._commands=w}showQuickPick(_,w,v,E=yt.None){this._onDidSelectItem=void 0;const S=Promise.resolve(w),A=++this._instances,G=i.$show(A,{title:v?.title,placeHolder:v?.placeHolder,matchOnDescription:v?.matchOnDescription,matchOnDetail:v?.matchOnDetail,ignoreFocusLost:v?.ignoreFocusOut,canPickMany:v?.canPickMany},E),W={},ce=G.then(()=>W);return Promise.race([ce,S]).then(Q=>{if(Q===W)return;const ne=dt(_,"quickPickItemTooltip");return S.then(J=>{const de=[];for(let Ce=0;Ce<J.length;Ce++){const Ae=J[Ce];if(typeof Ae=="string")de.push({label:Ae,handle:Ce});else if(Ae.kind===mh.Separator)de.push({type:"separator",label:Ae.label});else{Ae.tooltip&&!ne&&console.warn(`Extension '${_.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${_.identifier.value}`);const se=Ae.iconPath?c(Ae.iconPath):void 0;de.push({label:Ae.label,iconPath:se?.iconPath,iconClass:se?.iconClass,description:Ae.description,detail:Ae.detail,picked:Ae.picked,alwaysShow:Ae.alwaysShow,tooltip:ne?Re.fromStrict(Ae.tooltip):void 0,handle:Ce})}}return v&&typeof v.onDidSelectItem=="function"&&(this._onDidSelectItem=Ce=>{v.onDidSelectItem(J[Ce])}),i.$setItems(A,de),G.then(Ce=>{if(typeof Ce=="number")return J[Ce];if(Array.isArray(Ce))return Ce.map(Ae=>J[Ae])})})}).then(void 0,Q=>{if(!Vs(Q))return i.$setError(A,Q),Promise.reject(Q)})}$onItemSelected(_){this._onDidSelectItem?.(_)}showInput(_,w=yt.None){return this._validateInput=_?.validateInput,i.$input(_,typeof this._validateInput=="function",w).then(void 0,v=>{if(!Vs(v))return Promise.reject(v)})}async $validateInput(_){if(!this._validateInput)return;const w=await this._validateInput(_);if(!w||typeof w=="string")return w;let v;switch(w.severity){case hc.Info:v=Qt.Info;break;case hc.Warning:v=Qt.Warning;break;case hc.Error:v=Qt.Error;break;default:v=w.message?Qt.Error:Qt.Ignore;break}return{content:w.message,severity:v}}async showWorkspaceFolderPick(_,w=yt.None){const v=await this._commands.executeCommand("_workbench.pickWorkspaceFolder",[_]);if(!v)return;const E=await this._workspace.getWorkspaceFolders2();if(E)return E.find(S=>S.uri.toString()===v.uri.toString())}createQuickPick(_){const w=new u(_,()=>this._sessions.delete(w._id));return this._sessions.set(w._id,w),w}createInputBox(_){const w=new d(_,()=>this._sessions.delete(w._id));return this._sessions.set(w._id,w),w}$onDidChangeValue(_,w){this._sessions.get(_)?._fireDidChangeValue(w)}$onDidAccept(_){this._sessions.get(_)?._fireDidAccept()}$onDidChangeActive(_,w){const v=this._sessions.get(_);v instanceof u&&v._fireDidChangeActive(w)}$onDidChangeSelection(_,w){const v=this._sessions.get(_);v instanceof u&&v._fireDidChangeSelection(w)}$onDidTriggerButton(_,w){this._sessions.get(_)?._fireDidTriggerButton(w)}$onDidTriggerItemButton(_,w,v){const E=this._sessions.get(_);E instanceof u&&E._fireDidTriggerItemButton(w,v)}$onDidHide(_){this._sessions.get(_)?._fireDidHide()}}const f=class f{constructor(_,w){this._extension=_,this._onDidDispose=w,this._id=u._nextId++,this._visible=!1,this._expectingHide=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!0,this._value="",this._valueSelection=void 0,this._buttons=[],this._handlesToButtons=new Map,this._onDidAcceptEmitter=new N,this._onDidChangeValueEmitter=new N,this._onDidTriggerButtonEmitter=new N,this._onDidHideEmitter=new N,this._pendingUpdate={id:this._id},this._disposed=!1,this._disposables=[this._onDidTriggerButtonEmitter,this._onDidHideEmitter,this._onDidAcceptEmitter,this._onDidChangeValueEmitter],this.onDidChangeValue=this._onDidChangeValueEmitter.event,this.onDidAccept=this._onDidAcceptEmitter.event,this.onDidTriggerButton=this._onDidTriggerButtonEmitter.event,this.onDidHide=this._onDidHideEmitter.event}get title(){return this._title}set title(_){this._title=_,this.update({title:_})}get step(){return this._steps}set step(_){this._steps=_,this.update({step:_})}get totalSteps(){return this._totalSteps}set totalSteps(_){this._totalSteps=_,this.update({totalSteps:_})}get enabled(){return this._enabled}set enabled(_){this._enabled=_,this.update({enabled:_})}get busy(){return this._busy}set busy(_){this._busy=_,this.update({busy:_})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(_){this._ignoreFocusOut=_,this.update({ignoreFocusOut:_})}get value(){return this._value}set value(_){this._value=_,this.update({value:_})}get valueSelection(){return this._valueSelection}set valueSelection(_){this._valueSelection=_,this.update({valueSelection:_})}get placeholder(){return this._placeholder}set placeholder(_){this._placeholder=_,this.update({placeholder:_})}get buttons(){return this._buttons}set buttons(_){const w=dt(this._extension,"quickInputButtonLocation");!w&&_.some(v=>v.location)&&console.warn(`Extension '${this._extension.identifier.value}' uses a button location which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`),this._buttons=_.slice(),this._handlesToButtons.clear(),_.forEach((v,E)=>{const S=v===gh.Back?-1:E;this._handlesToButtons.set(S,v)}),this.update({buttons:_.map((v,E)=>({...c(v.iconPath),tooltip:v.tooltip,handle:v===gh.Back?-1:E,location:w?v.location:void 0}))})}show(){this._visible=!0,this._expectingHide=!0,this.update({visible:!0})}hide(){this._visible=!1,this.update({visible:!1})}_fireDidAccept(){this._onDidAcceptEmitter.fire()}_fireDidChangeValue(_){this._value=_,this._onDidChangeValueEmitter.fire(_)}_fireDidTriggerButton(_){const w=this._handlesToButtons.get(_);w&&this._onDidTriggerButtonEmitter.fire(w)}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=Ar(this._disposables),this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this._onDidDispose(),i.$dispose(this._id))}update(_){if(!this._disposed){for(const w of Object.keys(_)){const v=_[w];this._pendingUpdate[w]=v===void 0?null:v}"visible"in this._pendingUpdate?(this._updateTimeout&&(clearTimeout(this._updateTimeout),this._updateTimeout=void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){i.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}};f._nextId=1;let r=f;function o(p){if(p instanceof Kn)return{id:p.id};const _=l(p),w=a(p);return{dark:typeof _=="string"?x.file(_):_,light:typeof w=="string"?x.file(w):w}}function a(p){return typeof p=="object"&&"light"in p?p.light:p}function l(p){return typeof p=="object"&&"dark"in p?p.dark:p}function c(p){const _=o(p);let w,v;return"id"in _?v=sn.asClassName(_):w=_,{iconPath:w,iconClass:v}}class u extends r{constructor(_,w){super(_,w),this._items=[],this._handlesToItems=new Map,this._itemsToHandles=new Map,this._canSelectMany=!1,this._matchOnDescription=!0,this._matchOnDetail=!0,this._sortByLabel=!0,this._keepScrollPosition=!1,this._activeItems=[],this._onDidChangeActiveEmitter=new N,this._selectedItems=[],this._onDidChangeSelectionEmitter=new N,this._onDidTriggerItemButtonEmitter=new N,this.onDidChangeActive=this._onDidChangeActiveEmitter.event,this.onDidChangeSelection=this._onDidChangeSelectionEmitter.event,this.onDidTriggerItemButton=this._onDidTriggerItemButtonEmitter.event,this._disposables.push(this._onDidChangeActiveEmitter,this._onDidChangeSelectionEmitter,this._onDidTriggerItemButtonEmitter),this.update({type:"quickPick"})}get items(){return this._items}set items(_){this._items=_.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),_.forEach((E,S)=>{this._handlesToItems.set(S,E),this._itemsToHandles.set(E,S)});const w=dt(this._extension,"quickPickItemTooltip"),v=[];for(let E=0;E<_.length;E++){const S=_[E];if(S.kind===mh.Separator)v.push({type:"separator",label:S.label});else{S.tooltip&&!w&&console.warn(`Extension '${this._extension.identifier.value}' uses a tooltip which is proposed API that is only available when running out of dev or with the following command line switch: --enable-proposed-api ${this._extension.identifier.value}`);const A=S.iconPath?c(S.iconPath):void 0;v.push({handle:E,label:S.label,iconPath:A?.iconPath,iconClass:A?.iconClass,description:S.description,detail:S.detail,picked:S.picked,alwaysShow:S.alwaysShow,tooltip:w?Re.fromStrict(S.tooltip):void 0,buttons:S.buttons?.map((G,W)=>({...c(G.iconPath),tooltip:G.tooltip,handle:W}))})}}this.update({items:v})}get canSelectMany(){return this._canSelectMany}set canSelectMany(_){this._canSelectMany=_,this.update({canSelectMany:_})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(_){this._matchOnDescription=_,this.update({matchOnDescription:_})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(_){this._matchOnDetail=_,this.update({matchOnDetail:_})}get sortByLabel(){return this._sortByLabel}set sortByLabel(_){this._sortByLabel=_,this.update({sortByLabel:_})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(_){this._keepScrollPosition=_,this.update({keepScrollPosition:_})}get activeItems(){return this._activeItems}set activeItems(_){this._activeItems=_.filter(w=>this._itemsToHandles.has(w)),this.update({activeItems:this._activeItems.map(w=>this._itemsToHandles.get(w))})}get selectedItems(){return this._selectedItems}set selectedItems(_){this._selectedItems=_.filter(w=>this._itemsToHandles.has(w)),this.update({selectedItems:this._selectedItems.map(w=>this._itemsToHandles.get(w))})}_fireDidChangeActive(_){const w=rn(_.map(v=>this._handlesToItems.get(v)));this._activeItems=w,this._onDidChangeActiveEmitter.fire(w)}_fireDidChangeSelection(_){const w=rn(_.map(v=>this._handlesToItems.get(v)));this._selectedItems=w,this._onDidChangeSelectionEmitter.fire(w)}_fireDidTriggerItemButton(_,w){const v=this._handlesToItems.get(_);if(!v||!v.buttons||!v.buttons.length)return;const E=v.buttons[w];E&&this._onDidTriggerItemButtonEmitter.fire({button:E,item:v})}}class d extends r{constructor(_,w){super(_,w),this._password=!1,this.update({type:"inputBox"})}get password(){return this._password}set password(_){this._password=_,this.update({password:_})}get prompt(){return this._prompt}set prompt(_){this._prompt=_,this.update({prompt:_})}get validationMessage(){return this._validationMessage}set validationMessage(_){this._validationMessage=_,_?typeof _=="string"?this.update({validationMessage:_,severity:Qt.Error}):this.update({validationMessage:_.message,severity:_.severity??Qt.Error}):this.update({validationMessage:void 0,severity:Qt.Ignore})}}return new s(e,t)}const R4=new gi(()=>{const n=MP.Collator(void 0,{numeric:!0,sensitivity:"base"}).value;return{collator:n,collatorIsNumeric:n.resolvedOptions().numeric}});function zU(n,e,t=!1){const i=n||"",s=e||"",r=R4.value.collator.compare(i,s);return R4.value.collatorIsNumeric&&r===0&&i!==s?i<s?-1:1:r}function qU(n,e,t=!1){return t||(n=n&&n.toLowerCase(),e=e&&e.toLowerCase()),n===e?0:n<e?-1:1}function _p(n,e,t=!1){const i=n.split(cs),s=e.split(cs),r=i.length-1,o=s.length-1;let a,l;for(let c=0;;c++){if(a=r===c,l=o===c,a&&l)return zU(i[c],s[c],t);if(a)return-1;if(l)return 1;const u=qU(i[c],s[c],t);if(u!==0)return u}}var nx;function L4(n){return n instanceof x}function jU(n,e){return n.scheme===le.file&&e.scheme===le.file&&yo?n.toString()===e.toString():n.toString().toLowerCase()===e.toString().toLowerCase()}function Dv(n){if(n)return typeof n.iconPath=="string"?x.file(n.iconPath):x.isUri(n.iconPath)||sn.isThemeIcon(n.iconPath)?n.iconPath:void 0}function La(n){if(n){if(x.isUri(n))return n;if(sn.isThemeIcon(n))return n;{const e=n;return{light:e.light,dark:e.dark}}}else return}function GU(n){const e=La(n.authorIcon),t=n.references?.map(i=>({...i,icon:La(i.icon)}));return{...n,authorIcon:e,references:t}}function Iv(n){return n?{...n,icon:La(n.icon)}:void 0}function Cv(n,e){if(!n.iconPath&&!e.iconPath)return 0;if(n.iconPath){if(!e.iconPath)return 1}else return-1;const t=typeof n.iconPath=="string"?n.iconPath:x.isUri(n.iconPath)?n.iconPath.fsPath:n.iconPath.id,i=typeof e.iconPath=="string"?e.iconPath:x.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id;return _p(t,i)}function KU(n,e){let t=0;if(n.strikeThrough!==e.strikeThrough)return n.strikeThrough?1:-1;if(n.faded!==e.faded)return n.faded?1:-1;if(n.tooltip!==e.tooltip)return(n.tooltip||"").localeCompare(e.tooltip||"");if(t=Cv(n,e),t!==0)return t;if(n.light&&e.light)t=Cv(n.light,e.light);else{if(n.light)return 1;if(e.light)return-1}if(t!==0)return t;if(n.dark&&e.dark)t=Cv(n.dark,e.dark);else{if(n.dark)return 1;if(e.dark)return-1}return t}function QU(n,e){if(n.command!==e.command)return n.command<e.command?-1:1;if(n.title!==e.title)return n.title<e.title?-1:1;if(n.tooltip!==e.tooltip){if(n.tooltip!==void 0&&e.tooltip!==void 0)return n.tooltip<e.tooltip?-1:1;if(n.tooltip!==void 0)return 1;if(e.tooltip!==void 0)return-1}if(n.arguments===e.arguments)return 0;if(n.arguments)if(e.arguments){if(n.arguments.length!==e.arguments.length)return n.arguments.length-e.arguments.length}else return 1;else return-1;for(let t=0;t<n.arguments.length;t++){const i=n.arguments[t],s=e.arguments[t];if(i!==s&&!(L4(i)&&L4(s)&&jU(i,s)))return i<s?-1:1}return 0}function N4(n,e){let t=_p(n.resourceUri.fsPath,e.resourceUri.fsPath,!0);if(t!==0)return t;if(n.command&&e.command)t=QU(n.command,e.command);else{if(n.command)return 1;if(e.command)return-1}if(t!==0)return t;if(n.decorations&&e.decorations)t=KU(n.decorations,e.decorations);else{if(n.decorations)return 1;if(e.decorations)return-1}if(t!==0)return t;if(n.multiFileDiffEditorModifiedUri&&e.multiFileDiffEditorModifiedUri)t=_p(n.multiFileDiffEditorModifiedUri.fsPath,e.multiFileDiffEditorModifiedUri.fsPath,!0);else{if(n.multiFileDiffEditorModifiedUri)return 1;if(e.multiFileDiffEditorModifiedUri)return-1}if(t!==0)return t;if(n.multiDiffEditorOriginalUri&&e.multiDiffEditorOriginalUri)t=_p(n.multiDiffEditorOriginalUri.fsPath,e.multiDiffEditorOriginalUri.fsPath,!0);else{if(n.multiDiffEditorOriginalUri)return 1;if(e.multiDiffEditorOriginalUri)return-1}return t}function JU(n,e){for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}function XU(n,e){return n.command===e.command&&n.title===e.title&&n.tooltip===e.tooltip&&(n.arguments&&e.arguments?JU(n.arguments,e.arguments):n.arguments===e.arguments)}function YU(n,e){return Pi(n,e,XU)}class ZU{#e;#t;get value(){return this._value}set value(e){e=e??"",this.#e.$setInputBoxValue(this._sourceControlHandle,e),this.updateValue(e)}get onDidChange(){return this._onDidChange.event}get placeholder(){return this._placeholder}set placeholder(e){this.#e.$setInputBoxPlaceholder(this._sourceControlHandle,e),this._placeholder=e}get validateInput(){return $(this._extension,"scmValidation"),this._validateInput}set validateInput(e){if($(this._extension,"scmValidation"),e&&typeof e!="function")throw new Error(`[${this._extension.identifier.value}]: Invalid SCM input box validation function`);this._validateInput=e,this.#e.$setValidationProviderIsEnabled(this._sourceControlHandle,!!e)}get enabled(){return this._enabled}set enabled(e){e=!!e,this._enabled!==e&&(this._enabled=e,this.#e.$setInputBoxEnablement(this._sourceControlHandle,e))}get visible(){return this._visible}set visible(e){e=!!e,this._visible!==e&&(this._visible=e,this.#e.$setInputBoxVisibility(this._sourceControlHandle,e))}get document(){return $(this._extension,"scmTextDocument"),this.#t.getDocument(this._documentUri)}constructor(e,t,i,s,r){this._extension=e,this._sourceControlHandle=s,this._documentUri=r,this._value="",this._onDidChange=new N,this._placeholder="",this._enabled=!0,this._visible=!0,this.#t=t,this.#e=i}showValidationMessage(e,t){$(this._extension,"scmValidation"),this.#e.$showValidationMessage(this._sourceControlHandle,e,t)}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}}const B1=class B1{get disposed(){return this._disposed}get id(){return this._id}get label(){return this._label}set label(e){this._label=e,this._proxy.$updateGroupLabel(this._sourceControlHandle,this.handle,e)}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get hideWhenEmpty(){return this._hideWhenEmpty}set hideWhenEmpty(e){this._hideWhenEmpty=e,this._proxy.$updateGroup(this._sourceControlHandle,this.handle,this.features)}get features(){return{contextValue:this.contextValue,hideWhenEmpty:this.hideWhenEmpty}}get resourceStates(){return[...this._resourceStates]}set resourceStates(e){this._resourceStates=[...e],this._onDidUpdateResourceStates.fire()}constructor(e,t,i,s,r,o,a){this._proxy=e,this._commands=t,this._sourceControlHandle=i,this._id=s,this._label=r,this.multiDiffEditorEnableViewChanges=o,this._extension=a,this._resourceHandlePool=0,this._resourceStates=[],this._resourceStatesMap=new Map,this._resourceStatesCommandsMap=new Map,this._resourceStatesDisposablesMap=new Map,this._onDidUpdateResourceStates=new N,this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event,this._disposed=!1,this._onDidDispose=new N,this.onDidDispose=this._onDidDispose.event,this._handlesSnapshot=[],this._resourceSnapshot=[],this._contextValue=void 0,this._hideWhenEmpty=void 0,this.handle=B1._handlePool++}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){const i=this._resourceStatesCommandsMap.get(e);return i?Ln(()=>this._commands.executeCommand(i.command,...i.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){const e=[...this._resourceStates].sort(N4),i=W4(this._resourceSnapshot,e,N4).map(o=>{const a=o.toInsert.map(l=>{const c=this._resourceHandlePool++;this._resourceStatesMap.set(c,l);const u=l.resourceUri;let d;if(l.command)if(l.command.command==="vscode.open"||l.command.command==="vscode.diff"||l.command.command==="vscode.changes"){const ne=new xe;d=this._commands.converter.toInternal(l.command,ne),this._resourceStatesDisposablesMap.set(c,ne)}else this._resourceStatesCommandsMap.set(c,l.command);const f=dt(this._extension,"scmMultiDiffEditor"),p=f?l.multiDiffEditorOriginalUri:void 0,_=f?l.multiFileDiffEditorModifiedUri:void 0,w=Dv(l.decorations),v=l.decorations&&Dv(l.decorations.light)||w,E=l.decorations&&Dv(l.decorations.dark)||w,S=[v,E],A=l.decorations&&l.decorations.tooltip||"",G=l.decorations&&!!l.decorations.strikeThrough,W=l.decorations&&!!l.decorations.faded,ce=l.contextValue||"";return{rawResource:[c,u,S,A,G,W,ce,d,p,_],handle:c}});return{start:o.start,deleteCount:o.deleteCount,toInsert:a}}),s=i.map(({start:o,deleteCount:a,toInsert:l})=>[o,a,l.map(c=>c.rawResource)]),r=i.reverse();for(const{start:o,deleteCount:a,toInsert:l}of r){const c=l.map(d=>d.handle),u=this._handlesSnapshot.splice(o,a,...c);for(const d of u)this._resourceStatesMap.delete(d),this._resourceStatesCommandsMap.delete(d),this._resourceStatesDisposablesMap.get(d)?.dispose(),this._resourceStatesDisposablesMap.delete(d)}return this._resourceSnapshot=e,s}dispose(){this._disposed=!0,this._onDidDispose.fire()}};B1._handlePool=0;let ix=B1;var un;const W1=class W1{constructor(e,t,i,s,r,o,a){mf(this,un);this._extension=e,this._commands=s,this._id=r,this._label=o,this._rootUri=a,this._groups=new Map,this._count=void 0,this._quickDiffProvider=void 0,this._secondaryQuickDiffProvider=void 0,this._historyProviderDisposable=new ao,this._commitTemplate=void 0,this._acceptInputDisposables=new ao,this._acceptInputCommand=void 0,this._actionButtonDisposables=new ao,this._statusBarDisposables=new ao,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new N,this.onDidChangeSelection=this._onDidChangeSelection.event,this.handle=W1._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,_f(this,un,i);const l=x.from({scheme:le.vscodeSourceControl,path:`${r}/scm${this.handle}/input`,query:a?`rootUri=${encodeURIComponent(a.toString())}`:void 0});this._inputBox=new ZU(e,t,Jt(this,un),this.handle,l),Jt(this,un).$registerSourceControl(this.handle,r,o,a,l)}get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,Jt(this,un).$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;dt(this._extension,"quickDiffProvider")&&(t=e?.label),Jt(this,un).$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get secondaryQuickDiffProvider(){return $(this._extension,"quickDiffProvider"),this._secondaryQuickDiffProvider}set secondaryQuickDiffProvider(e){$(this._extension,"quickDiffProvider"),this._secondaryQuickDiffProvider=e;const t=e?.label;Jt(this,un).$updateSourceControl(this.handle,{hasSecondaryQuickDiffProvider:!!e,secondaryQuickDiffLabel:t})}get historyProvider(){return $(this._extension,"scmHistoryProvider"),this._historyProvider}set historyProvider(e){$(this._extension,"scmHistoryProvider"),this._historyProvider=e,this._historyProviderDisposable.value=new xe,Jt(this,un).$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&(this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemRefs(()=>{const t=Iv(e?.currentHistoryItemRef),i=Iv(e?.currentHistoryItemRemoteRef),s=Iv(e?.currentHistoryItemBaseRef);Jt(this,un).$onDidChangeHistoryProviderCurrentHistoryItemRefs(this.handle,t,i,s)})),this._historyProviderDisposable.value.add(e.onDidChangeHistoryItemRefs(t=>{if(t.added.length===0&&t.modified.length===0&&t.removed.length===0)return;const i=t.added.map(o=>({...o,icon:La(o.icon)})),s=t.modified.map(o=>({...o,icon:La(o.icon)})),r=t.removed.map(o=>({...o,icon:La(o.icon)}));Jt(this,un).$onDidChangeHistoryProviderHistoryItemRefs(this.handle,{added:i,modified:s,removed:r,silent:t.silent})})))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,Jt(this,un).$updateSourceControl(this.handle,{commitTemplate:e}))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new xe,this._acceptInputCommand=e;const t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);Jt(this,un).$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return $(this._extension,"scmActionButton"),this._actionButton}set actionButton(e){if($(this._extension,"scmActionButton"),dw(this._actionButton,e))return;this._actionButton=e,this._actionButtonDisposables.value=new xe;const t=e!==void 0?{command:{...this._commands.converter.toInternal(e.command,this._actionButtonDisposables.value),shortTitle:e.command.shortTitle},secondaryCommands:e.secondaryCommands?.map(i=>i.map(s=>this._commands.converter.toInternal(s,this._actionButtonDisposables.value))),enabled:e.enabled}:void 0;Jt(this,un).$updateSourceControl(this.handle,{actionButton:t??null})}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&YU(this._statusBarCommands,e))return;this._statusBarDisposables.value=new xe,this._statusBarCommands=e;const t=(e||[]).map(i=>this._commands.converter.toInternal(i,this._statusBarDisposables.value));Jt(this,un).$updateSourceControl(this.handle,{statusBarCommands:t})}get selected(){return this._selected}createResourceGroup(e,t,i){const s=dt(this._extension,"scmMultiDiffEditor")&&i?.multiDiffEditorEnableViewChanges===!0,r=new ix(Jt(this,un),this._commands,this.handle,e,t,s,this._extension),o=Ut.once(r.onDidDispose)(()=>this.createdResourceGroups.delete(r));return this.createdResourceGroups.set(r,o),this.eventuallyAddResourceGroups(),r}eventuallyAddResourceGroups(){const e=[],t=[];for(const[i,s]of this.createdResourceGroups){s.dispose();const r=i.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(i),this.eventuallyUpdateResourceStates()});Ut.once(i.onDidDispose)(()=>{this.updatedResourceGroups.delete(i),r.dispose(),this._groups.delete(i.handle),Jt(this,un).$unregisterGroup(this.handle,i.handle)}),e.push([i.handle,i.id,i.label,i.features,i.multiDiffEditorEnableViewChanges]);const o=i._takeResourceStateSnapshot();o.length>0&&t.push([i.handle,o]),this._groups.set(i.handle,i)}Jt(this,un).$registerGroups(this.handle,e,t),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){const e=[];this.updatedResourceGroups.forEach(t=>{const i=t._takeResourceStateSnapshot();i.length!==0&&e.push([t.handle,i])}),e.length>0&&Jt(this,un).$spliceResourceStates(this.handle,e),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._groups.forEach(e=>e.dispose()),Jt(this,un).$unregisterSourceControl(this.handle)}};un=new WeakMap,W1._handlePool=0;let el=W1;el.__decorator=V([FP(100)],el.prototype,"eventuallyAddResourceGroups",null);el.__decorator=V([FP(100)],el.prototype,"eventuallyUpdateResourceStates",null);var Ha;let sx=(Ha=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,i,s){this._commands=t,this._extHostDocuments=i,this.logService=s,this._sourceControls=new Map,this._sourceControlsByExtension=new Lr,this._onDidChangeActiveProvider=new N,this._proxy=e.getProxy(ee.MainThreadSCM),this._telemetry=e.getProxy(ee.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:r=>{if(r&&r.$mid===st.ScmResource){const o=this._sourceControls.get(r.sourceControlHandle);if(!o)return r;const a=o.getResourceGroup(r.groupHandle);return a?a.getResourceState(r.handle):r}else if(r&&r.$mid===st.ScmResourceGroup){const o=this._sourceControls.get(r.sourceControlHandle);return o?o.getResourceGroup(r.groupHandle):r}else if(r&&r.$mid===st.ScmProvider){const o=this._sourceControls.get(r.handle);return o||r}return r}})}createSourceControl(e,t,i,s){this.logService.trace("ExtHostSCM#createSourceControl",e.identifier.value,t,i,s),this._telemetry.$publicLog2("api/scm/createSourceControl",{extensionId:e.identifier.value});const r=nx._handlePool++,o=new el(e,this._extHostDocuments,this._proxy,this._commands,t,i,s);this._sourceControls.set(r,o);const a=this._sourceControlsByExtension.get(e.identifier)||[];return a.push(o),this._sourceControlsByExtension.set(e.identifier,a),o}getLastInputBox(e){this.logService.trace("ExtHostSCM#getLastInputBox",e.identifier.value);const t=this._sourceControlsByExtension.get(e.identifier),i=t&&t[t.length-1];return i&&i.inputBox}$provideOriginalResource(e,t,i){const s=x.revive(t);this.logService.trace("ExtHostSCM#$provideOriginalResource",e,s.toString());const r=this._sourceControls.get(e);return!r||!r.quickDiffProvider||!r.quickDiffProvider.provideOriginalResource?Promise.resolve(null):Ln(()=>r.quickDiffProvider.provideOriginalResource(s,i)).then(o=>o||null)}$provideSecondaryOriginalResource(e,t,i){const s=x.revive(t);this.logService.trace("ExtHostSCM#$provideSecondaryOriginalResource",e,s.toString());const r=this._sourceControls.get(e);return!r||!r.secondaryQuickDiffProvider||!r.secondaryQuickDiffProvider.provideOriginalResource?Promise.resolve(null):Ln(()=>r.secondaryQuickDiffProvider.provideOriginalResource(s,i)).then(o=>o||null)}$onInputBoxValueChange(e,t){this.logService.trace("ExtHostSCM#$onInputBoxValueChange",e);const i=this._sourceControls.get(e);return i&&i.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,i,s){this.logService.trace("ExtHostSCM#$executeResourceCommand",e,t,i);const r=this._sourceControls.get(e);if(!r)return Promise.resolve(void 0);const o=r.getResourceGroup(t);return o?o.$executeResourceCommand(i,s):Promise.resolve(void 0)}$validateInput(e,t,i){this.logService.trace("ExtHostSCM#$validateInput",e);const s=this._sourceControls.get(e);return!s||!s.inputBox.validateInput?Promise.resolve(void 0):Ln(()=>s.inputBox.validateInput(t,i)).then(r=>{if(!r)return Promise.resolve(void 0);const o=Re.fromStrict(r.message);return o?Promise.resolve([o,r.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace("ExtHostSCM#$setSelectedSourceControl",e),e!==void 0&&this._sourceControls.get(e)?.setSelectionState(!0),this._selectedSourceControlHandle!==void 0&&this._sourceControls.get(this._selectedSourceControlHandle)?.setSelectionState(!1),this._selectedSourceControlHandle=e,Promise.resolve(void 0)}async $resolveHistoryItemChatContext(e,t,i){try{return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemChatContext(t,i)??void 0}catch(s){this.logService.error("ExtHostSCM#$resolveHistoryItemChatContext",s);return}}async $resolveHistoryItemRefsCommonAncestor(e,t,i){try{return await this._sourceControls.get(e)?.historyProvider?.resolveHistoryItemRefsCommonAncestor(t,i)??void 0}catch(s){this.logService.error("ExtHostSCM#$resolveHistoryItemRefsCommonAncestor",s);return}}async $provideHistoryItemRefs(e,t,i){try{return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemRefs(t,i))?.map(o=>({...o,icon:La(o.icon)}))??void 0}catch(s){this.logService.error("ExtHostSCM#$provideHistoryItemRefs",s);return}}async $provideHistoryItems(e,t,i){try{return(await this._sourceControls.get(e)?.historyProvider?.provideHistoryItems(t,i))?.map(o=>GU(o))??void 0}catch(s){this.logService.error("ExtHostSCM#$provideHistoryItems",s);return}}async $provideHistoryItemChanges(e,t,i,s){try{return await this._sourceControls.get(e)?.historyProvider?.provideHistoryItemChanges(t,i,s)??void 0}catch(r){this.logService.error("ExtHostSCM#$provideHistoryItemChanges",r);return}}},nx=Ha,Ha._handlePool=0,Ha);sx=nx=V([L(3,at)],sx);const V1=class V1{constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(ee.MainThreadShare)}async $provideShare(e,t,i){return await this.providers.get(e)?.provideShare({selection:z.to(t.selection),resourceUri:x.revive(t.resourceUri)},i)??void 0}registerShareProvider(e,t){const i=V1.handlePool++;return this.providers.set(i,t),this.proxy.$registerShareProvider(i,Qc.from(e,this.uriTransformer),t.id,t.label,t.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(i),this.providers.delete(i)}}}};V1.handlePool=0;let rx=V1;const z1=class z1{constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(ee.MainThreadSpeech)}async $createSpeechToTextSession(e,t,i){const s=this.providers.get(e);if(!s)return;const r=new xe,o=new Nt;this.sessions.set(t,o);const a=await s.provideSpeechToTextSession(o.token,i?{language:i}:void 0);a&&(r.add(a.onDidChange(l=>{o.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,l)})),r.add(o.token.onCancellationRequested(()=>r.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,i){const s=this.providers.get(e);if(!s)return;const r=new xe,o=new Nt;this.sessions.set(t,o);const a=await s.provideTextToSpeechSession(o.token,i?{language:i}:void 0);a&&(this.synthesizers.set(t,a),r.add(a.onDidChange(l=>{o.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,l)})),r.add(o.token.onCancellationRequested(()=>r.dispose())))}async $synthesizeSpeech(e,t){this.synthesizers.get(e)?.synthesize(t)}async $cancelTextToSpeechSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e),this.synthesizers.delete(e)}async $createKeywordRecognitionSession(e,t){const i=this.providers.get(e);if(!i)return;const s=new xe,r=new Nt;this.sessions.set(t,r);const o=await i.provideKeywordRecognitionSession(r.token);o&&(s.add(o.onDidChange(a=>{r.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,a)})),s.add(r.token.onCancellationRequested(()=>s.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(e,t,i){const s=z1.ID_POOL++;return this.providers.set(s,i),this.proxy.$registerProvider(s,t,{extension:e,displayName:e.value}),we(()=>{this.proxy.$unregisterProvider(s),this.providers.delete(s)})}};z1.ID_POOL=1;let ox=z1;var Dc,Ic;const na=class na{constructor(e,t,i,s,r,o=uo.Left,a,l){mf(this,Dc);mf(this,Ic);if(this._onDispose=l,this._disposed=!1,this._text="",this._staleCommandRegistrations=new xe,_f(this,Dc,e),_f(this,Ic,t),r&&s){this._entryId=d3(s.identifier,r);const c=i.get(this._entryId);c&&(o=c.alignLeft?uo.Left:uo.Right,a=c.priority,this._visible=!0,this.name=c.name,this.text=c.text,this.tooltip=c.tooltip,this.command=c.command,this.accessibilityInformation=c.accessibilityInformation)}else this._entryId=String(na.ID_GEN++);this._extension=s,this._id=r,this._alignment=o,this._priority=this.validatePriority(a)}validatePriority(e){if(ga(e))return e===Number.POSITIVE_INFINITY?Number.MAX_VALUE:e===Number.NEGATIVE_INFINITY?-Number.MAX_VALUE:e}get id(){return this._id??this._extension.identifier.value}get entryId(){return this._entryId}get alignment(){return this._alignment}get priority(){return this._priority}get text(){return this._text}get name(){return this._name}get tooltip(){return this._tooltip}get tooltip2(){return this._extension&&$(this._extension,"statusBarItemTooltip"),this._tooltip2}get color(){return this._color}get backgroundColor(){return this._backgroundColor}get command(){return this._command?.fromApi}get accessibilityInformation(){return this._accessibilityInformation}set text(e){this._text=e,this.update()}set name(e){this._name=e,this.update()}set tooltip(e){this._tooltip=e,this.update()}set tooltip2(e){this._extension&&$(this._extension,"statusBarItemTooltip"),this._tooltip2=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(e){e&&!na.ALLOWED_BACKGROUND_COLORS.has(e.id)&&(e=void 0),this._backgroundColor=e,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new xe,typeof e=="string"?this._command={fromApi:e,internal:Jt(this,Ic).toInternal({title:"",command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:Jt(this,Ic).toInternal(e,this._latestCommandRegistration)}:this._command=void 0,this.update())}set accessibilityInformation(e){this._accessibilityInformation=e,this.update()}show(){this._visible=!0,this.update()}hide(){clearTimeout(this._timeoutHandle),this._visible=!1,Jt(this,Dc).$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let e;this._extension?this._id?e=`${this._extension.identifier.value}.${this._id}`:e=this._extension.identifier.value:e=this._id;let t;this._name?t=this._name:t=h(2590,"{0} (Extension)",this._extension.displayName||this._extension.name);let i=this._color;this._backgroundColor&&(i=na.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));let s,r;typeof this._tooltip2=="function"?(s=Re.fromStrict(this._tooltip),r=!0):(s=Re.fromStrict(this._tooltip2??this._tooltip),r=!1),Jt(this,Dc).$setEntry(this._entryId,e,this._extension?.identifier.value,t,this._text,s,r,this._command?.internal,i,this._backgroundColor,this._alignment===uo.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._onDispose?.(),this._disposed=!0}};Dc=new WeakMap,Ic=new WeakMap,na.ID_GEN=0,na.ALLOWED_BACKGROUND_COLORS=new Map([["statusBarItem.errorBackground",new oh("statusBarItem.errorForeground")],["statusBarItem.warningBackground",new oh("statusBarItem.warningForeground")]]);let ax=na;class e${constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,"status.extensionMessage",uo.Left,Number.MIN_VALUE),this._item.name=h(2591,"Extension Status")}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){const t={message:e};return this._messages.unshift(t),this._update(),new je(()=>{const i=this._messages.indexOf(t);i>=0&&(this._messages.splice(i,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}}class t${constructor(e,t){this._entries=new Map,this._existingItems=new Map,this._proxy=e.getProxy(ee.MainThreadStatusBar),this._commands=t,this._statusMessage=new e$(this)}$acceptStaticEntries(e){for(const t of e)this._existingItems.set(t.entryId,t)}async $provideTooltip(e,t){const i=this._entries.get(e);if(!i)return;const s=typeof i.tooltip2=="function"?await i.tooltip2(t):i.tooltip2;return t.isCancellationRequested?void 0:Re.fromStrict(s)}createStatusBarEntry(e,t,i,s){const r=new ax(this._proxy,this._commands,this._existingItems,e,t,i,s,()=>this._entries.delete(r.entryId));return this._entries.set(r.entryId,r),r}setStatusBarMessage(e,t){const i=this._statusMessage.setMessage(e);let s;return typeof t=="number"?s=setTimeout(()=>i.dispose(),t):typeof t<"u"&&t.then(()=>i.dispose(),()=>i.dispose()),new je(()=>{i.dispose(),clearTimeout(s)})}}class n$ extends Se{constructor(e,t){super(),this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=new N,this._onDidChangeTextEditorOptions=new N,this._onDidChangeTextEditorVisibleRanges=new N,this._onDidChangeTextEditorViewColumn=new N,this._onDidChangeTextEditorDiffInformation=new N,this._onDidChangeActiveTextEditor=new N,this._onDidChangeVisibleTextEditors=new N,this.onDidChangeTextEditorSelection=this._onDidChangeTextEditorSelection.event,this.onDidChangeTextEditorOptions=this._onDidChangeTextEditorOptions.event,this.onDidChangeTextEditorVisibleRanges=this._onDidChangeTextEditorVisibleRanges.event,this.onDidChangeTextEditorViewColumn=this._onDidChangeTextEditorViewColumn.event,this.onDidChangeTextEditorDiffInformation=this._onDidChangeTextEditorDiffInformation.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this._proxy=e.getProxy(ee.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(i=>this._onDidChangeVisibleTextEditors.fire(i))),this._register(this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(i=>this._onDidChangeActiveTextEditor.fire(i)))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){const t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(i=>i.value)}async showTextDocument(e,t,i){let s;typeof t=="number"?s={position:hn.from(t),preserveFocus:i}:typeof t=="object"?s={position:hn.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection=="object"?z.from(t.selection):void 0,pinned:typeof t.preview=="boolean"?!t.preview:void 0}:s={preserveFocus:!1};const r=await this._proxy.$tryShowTextDocument(e.uri,s),o=r&&this._extHostDocumentsAndEditors.getEditor(r);if(o)return o.value;throw r?new Error(`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`):new Error(`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new o0(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(t.options&&i._acceptOptions(t.options),t.selections){const s=t.selections.selections.map(hs.to);i._acceptSelections(s)}if(t.visibleRanges){const s=rn(t.visibleRanges.map(z.to));i._acceptVisibleRanges(s)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:i.value,options:{...t.options,lineNumbers:gc.to(t.options.lineNumbers)}}),t.selections){const s=Bc.fromValue(t.selections.source),r=t.selections.selections.map(hs.to);this._onDidChangeTextEditorSelection.fire({textEditor:i.value,selections:r,kind:s})}if(t.visibleRanges){const s=rn(t.visibleRanges.map(z.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:i.value,visibleRanges:s})}}$acceptEditorPositionData(e){for(const t in e){const i=this._extHostDocumentsAndEditors.getEditor(t);if(!i)throw new Error("Unknown text editor");const s=hn.to(e[t]);i.value.viewColumn!==s&&(i._acceptViewColumn(s),this._onDidChangeTextEditorViewColumn.fire({textEditor:i.value,viewColumn:s}))}}$acceptEditorDiffInformation(e,t){const i=this._extHostDocumentsAndEditors.getEditor(e);if(!i)throw new Error("unknown text editor");if(!t){i._acceptDiffInformation(void 0),this._onDidChangeTextEditorDiffInformation.fire({textEditor:i.value,diffInformation:void 0});return}const s=this,r=t.map(o=>{const a=x.revive(o.original),l=x.revive(o.modified),c=o.changes.map(u=>{const[d,f,p,_]=u;let w;return d===f?w=lc.Addition:p===_?w=lc.Deletion:w=lc.Modification,{original:{startLineNumber:d,endLineNumberExclusive:f},modified:{startLineNumber:p,endLineNumberExclusive:_},kind:w}});return Object.freeze({documentVersion:o.documentVersion,original:a,modified:l,changes:c,get isStale(){return s._extHostDocumentsAndEditors.getDocument(l)?.version!==o.documentVersion}})});i._acceptDiffInformation(r),this._onDidChangeTextEditorDiffInformation.fire({textEditor:i.value,diffInformation:r})}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}}let lx=class{constructor(e){this._actual=new Jg(oo.Dark),this._onDidChangeActiveColorTheme=new N}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case"light":t=oo.Light;break;case"hcDark":t=oo.HighContrast;break;case"hcLight":t=oo.HighContrastLight;break;default:t=oo.Dark}this._actual=new Jg(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};lx=V([L(0,nt)],lx);class i${constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(ee.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(i,s)=>{if(i&&i.$mid===st.TimelineActionContext)if(this._providers.get(i.source)&&s&&dt(s,"timeline")){const r=i.uri===void 0?void 0:x.revive(i.uri);return this._itemsBySourceAndUriMap.get(i.source)?.get(O4(r))?.get(i.handle)}else return;return i}})}async $getTimeline(e,t,i,s){return this._providers.get(e)?.provider.provideTimeline(x.revive(t),i,s)}registerTimelineProvider(e,t,i,s){const r=new xe,o=this.convertTimelineItem(t.id,s,r).bind(this);let a;t.onDidChange&&(a=t.onDidChange(c=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...c,id:t.id}),this));const l=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(c,u,d){u?.resetCache&&(r.clear(),l.get(t.id)?.clear());const f=await t.provideTimeline(c,u,d);if(f==null)return;const p=o(c,u);return{...f,source:t.id,items:f.items.map(p)}},dispose(){for(const c of l.values())c.get(t.id)?.clear();a?.dispose(),r.dispose()}},i)}convertTimelineItem(e,t,i){return(s,r)=>{let o;if(r?.cacheResults){let a=this._itemsBySourceAndUriMap.get(e);a===void 0&&(a=new Map,this._itemsBySourceAndUriMap.set(e,a));const l=O4(s);o=a.get(l),o===void 0&&(o=new Map,a.set(l,o))}return a=>{const{iconPath:l,...c}=a,u=`${e}|${a.id??a.timestamp}`;o?.set(u,a);let d,f,p;a.iconPath&&(l instanceof Kn?p={id:l.id,color:l.color}:x.isUri(l)?(d=l,f=l):{light:d,dark:f}=l);let _;return mi.isMarkdownString(c.tooltip)?_=Re.from(c.tooltip):it(c.tooltip)?_=c.tooltip:mi.isMarkdownString(c.detail)?(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),_=Re.from(c.detail)):it(c.detail)&&(console.warn("Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip"),_=c.detail),{...c,id:c.id??void 0,handle:u,source:e,command:a.command?t.toInternal(a.command,i):void 0,icon:d,iconDark:f,themeIcon:p,tooltip:_,accessibilityInformation:a.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw new Error(`Timeline Provider ${e.id} already exists.`);return this._proxy.$registerTimelineProvider({id:e.id,label:e.label,scheme:e.scheme}),this._providers.set(e.id,{provider:e,extension:t}),we(()=>{for(const s of this._itemsBySourceAndUriMap.values())s.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}}function O4(n){return n?.toString()}h(4044,"Views");af("default-view-icon",_e.window,h(4045,"Default view icon."));var l1;(function(n){n.ViewContainersRegistry="workbench.registry.view.containers",n.ViewsRegistry="workbench.registry.view"})(l1||(l1={}));var xd;(function(n){n[n.Sidebar=0]="Sidebar",n[n.Panel=1]="Panel",n[n.AuxiliaryBar=2]="AuxiliaryBar"})(xd||(xd={}));xd.Sidebar,xd.Panel,xd.AuxiliaryBar;class s$ extends Se{constructor(){super(...arguments),this._onDidRegister=this._register(new N),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new N),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,i){const s=this.get(e.id);if(s)return s;const r=e;return r.openCommandActionDescriptor=i?.doNotRegisterOpenCommand?void 0:r.openCommandActionDescriptor??{id:r.id},A5(this.viewContainers,t,[]).push(r),i?.isDefault&&this.defaultViewContainers.push(r),this._onDidRegister.fire({viewContainer:r,viewContainerLocation:t}),r}deregisterViewContainer(e){for(const t of this.viewContainers.keys()){const i=this.viewContainers.get(t),s=i?.indexOf(e);if(s!==-1){i?.splice(s,1),i.length===0&&this.viewContainers.delete(t),this._onDidDeregister.fire({viewContainer:e,viewContainerLocation:t});return}}}get(e){return this.all.filter(t=>t.id===e)[0]}getViewContainers(e){return[...this.viewContainers.get(e)||[]]}getViewContainerLocation(e){return[...this.viewContainers.keys()].filter(t=>this.getViewContainers(t).filter(i=>i?.id===e.id).length>0)[0]}getDefaultViewContainer(e){return this.defaultViewContainers.find(t=>this.getViewContainerLocation(t)===e)}}mn.add(l1.ViewContainersRegistry,new s$);var c1;(function(n){n.Open="2_open",n.Debug="4_debug",n.SCM="5_scm",n.More="9_more"})(c1||(c1={}));function r$(n,e){const t=n.group??c1.More,i=e.group??c1.More;return t!==i?t.localeCompare(i):(n.order??5)-(e.order??5)}class o$ extends Se{constructor(){super(...arguments),this._onViewsRegistered=this._register(new N),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new N),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new N),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new N),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new F5}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:t,viewContainer:i})=>this.addViews(t,i)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){const i=this.removeViews(e,t);i.length&&this._onViewsDeregistered.fire({views:i,viewContainer:t})}moveViews(e,t){for(const i of this._views.keys())if(i!==t){const s=this.removeViews(e,i);s.length&&(this.addViews(s,t),this._onDidChangeContainer.fire({views:s,from:i,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(const t of this._viewContainers){const i=(this._views.get(t)||[]).filter(s=>s.id===e)[0];if(i)return i}return null}getViewContainer(e){for(const t of this._viewContainers)if((this._views.get(t)||[]).filter(s=>s.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),we(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){const i=new Map;for(const[s,r]of t)this._viewWelcomeContents.add(e,r),i.set(s,we(()=>{this._viewWelcomeContents.delete(e,r),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),i}getViewWelcomeContent(e){const t=[];return this._viewWelcomeContents.forEach(e,i=>t.push(i)),t.sort(r$)}addViews(e,t){let i=this._views.get(t);i||(i=[],this._views.set(t,i),this._viewContainers.push(t));for(const s of e){if(this.getView(s.id)!==null)throw new Error(h(4046,"A view with id '{0}' is already registered",s.id));i.push(s)}}removeViews(e,t){const i=this._views.get(t);if(!i)return[];const s=[],r=[];for(const o of i)e.includes(o)?s.push(o):r.push(o);return s.length&&(r.length?this._views.set(t,r):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),s}}mn.add(l1.ViewsRegistry,new o$);var F4;(function(n){n[n.Default=0]="Default",n[n.Expand=1]="Expand"})(F4||(F4={}));var M4;(function(n){n[n.None=0]="None",n[n.Collapsed=1]="Collapsed",n[n.Expanded=2]="Expanded"})(M4||(M4={}));class tr extends Error{constructor(e){super(h(4047,"No tree view with id '{0}' registered.",e)),this.name="NoTreeViewError"}static is(e){return!!e&&e.name==="NoTreeViewError"}}class a${constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){const t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}}function U4(n,e){if(it(n))return{label:n};if(n&&typeof n=="object"&&typeof n.label=="string"){let t;return Array.isArray(n.highlights)&&(t=n.highlights.filter((i=>i.length===2&&typeof i[0]=="number"&&typeof i[1]=="number")),t=t.length?t:void 0),{label:n.label,highlights:t}}}class l$ extends Se{constructor(e,t,i){super(),this._proxy=e,this.commands=t,this.logService=i,this.treeViews=new Map,this.treeDragAndDropService=new a$;function s(r){return r&&r.$treeViewId&&(r.$treeItemHandle||r.$selectedTreeItems||r.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:r=>s(r)?this.convertArgument(r):Array.isArray(r)&&r.length>0?r.map(o=>s(o)?this.convertArgument(o):o):r})}registerTreeDataProvider(e,t,i){const s=this.createTreeView(e,{treeDataProvider:t},i);return{dispose:()=>s.dispose()}}createTreeView(e,t,i){if(!t||!t.treeDataProvider)throw new Error("Options with treeDataProvider is mandatory");const s=t.dragAndDropController?.dropMimeTypes??[],r=t.dragAndDropController?.dragMimeTypes??[],o=!!t.dragAndDropController?.handleDrag,a=!!t.dragAndDropController?.handleDrop,l=this.createExtHostTreeView(e,t,i),c={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:s,dragMimeTypes:r,hasHandleDrag:o,hasHandleDrop:a,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},u=this._proxy.$registerTreeViewDataProvider(e,c),d={get onDidCollapseElement(){return l.onDidCollapseElement},get onDidExpandElement(){return l.onDidExpandElement},get selection(){return l.selectedElements},get onDidChangeSelection(){return l.onDidChangeSelection},get activeItem(){return $(i,"treeViewActiveItem"),l.focusedElement},get onDidChangeActiveItem(){return $(i,"treeViewActiveItem"),l.onDidChangeActiveItem},get visible(){return l.visible},get onDidChangeVisibility(){return l.onDidChangeVisibility},get onDidChangeCheckboxState(){return l.onDidChangeCheckboxState},get message(){return l.message},set message(f){Fr(f)&&$(i,"treeViewMarkdownMessage"),l.message=f},get title(){return l.title},set title(f){l.title=f},get description(){return l.description},set description(f){l.description=f},get badge(){return l.badge},set badge(f){f!==void 0&&tb.isViewBadge(f)?l.badge={value:Math.floor(Math.abs(f.value)),tooltip:f.tooltip}:f===void 0&&(l.badge=void 0)},reveal:(f,p)=>l.reveal(f,p),dispose:async()=>{await u,this.treeViews.delete(e),l.dispose()}};return this._register(d),d}async $getChildren(e,t){const i=this.treeViews.get(e);if(!i)return Promise.reject(new tr(e));if(!t){const r=await i.getChildren();return r?[[0,...r]]:void 0}const s=[];for(let r=0;r<t.length;r++){const o=t[r],a=await i.getChildren(o);a&&s.push([r,...a])}return s}async $handleDrop(e,t,i,s,r,o,a,l){const c=this.treeViews.get(e);if(!c)return Promise.reject(new tr(e));const u=ou.toDataTransfer(i,async d=>(await this._proxy.$resolveDropFileData(e,t,d)).buffer);return a===e&&l&&await this.addAdditionalTransferItems(u,c,l,r,o),c.onDrop(u,s,r)}async addAdditionalTransferItems(e,t,i,s,r){const o=this.treeDragAndDropService.removeDragOperationTransfer(r);if(o)(await o)?.forEach((a,l)=>{a&&e.set(l,a)});else if(r&&t.handleDrag){const a=t.handleDrag(i,e,s);this.treeDragAndDropService.addDragOperationTransfer(r,a),await a}return e}async $handleDrag(e,t,i,s){const r=this.treeViews.get(e);if(!r)return Promise.reject(new tr(e));const o=await this.addAdditionalTransferItems(new qc,r,t,s,i);if(!(!o||s.isCancellationRequested))return ou.from(o)}async $hasResolve(e){const t=this.treeViews.get(e);if(!t)throw new tr(e);return t.hasResolve}$resolve(e,t,i){const s=this.treeViews.get(e);if(!s)throw new tr(e);return s.resolveTreeItem(t,i)}$setExpanded(e,t,i){const s=this.treeViews.get(e);if(!s)throw new tr(e);s.setExpanded(t,i)}$setSelectionAndFocus(e,t,i){const s=this.treeViews.get(e);if(!s)throw new tr(e);s.setSelectionAndFocus(t,i)}$setVisible(e,t){const i=this.treeViews.get(e);if(!i){if(!t)return;throw new tr(e)}i.setVisible(t)}$changeCheckboxState(e,t){const i=this.treeViews.get(e);if(!i)throw new tr(e);i.setCheckboxState(t)}createExtHostTreeView(e,t,i){const s=this._register(new cx(e,t,this._proxy,this.commands.converter,this.logService,i));return this.treeViews.set(e,s),s}convertArgument(e){const t=this.treeViews.get(e.$treeViewId),i=e;return t&&i.$treeItemHandle?t.getExtensionElement(i.$treeItemHandle):t&&e.$focusedTreeItem?t.focusedElement:null}}const Zl=class Zl extends Se{get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!tn(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,i,s,r,o){if(super(),this.viewId=e,this.proxy=i,this.commands=s,this.logService=r,this.extension=o,this.roots=void 0,this.elements=new Map,this.nodes=new Map,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new N),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new N),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new N),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new N),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new N),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new N),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new N),this.refreshPromise=Promise.resolve(),this.refreshQueue=Promise.resolve(),this._message="",this._title="",this._refreshCancellationSource=new Nt,o.contributes&&o.contributes.views)for(const u in o.contributes.views)for(const d of o.contributes.views[u])d.id===e&&(this._title=d.name);this.dataProvider=t.treeDataProvider,this.dndController=t.dragAndDropController,this.dataProvider.onDidChangeTreeData&&this._register(this.dataProvider.onDidChangeTreeData(u=>{Array.isArray(u)&&u.length===0||this._onDidChangeData.fire({message:!1,element:u})}));let a,l;const c=Ut.debounce(this._onDidChangeData.event,(u,d)=>(u||(u={message:!1,elements:[]}),d.element!==!1&&(a||(a=new Promise(f=>l=f),this.refreshPromise=this.refreshPromise.then(()=>a)),Array.isArray(d.element)?u.elements.push(...d.element):u.elements.push(d.element)),d.message&&(u.message=!0),u),200,!0);this._register(c(({message:u,elements:d})=>{d.length&&(this.refreshQueue=this.refreshQueue.then(()=>{const f=l;return a=null,this.refresh(d).then(()=>f())})),u&&this.proxy.$setMessage(this.viewId,Re.fromStrict(this._message)??"")}))}async getChildren(e){const t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this.logService.error(`No tree item with id '${e}' found.`),Promise.resolve([]);let i=this.getChildrenNodes(e);return i||(i=await this.fetchChildrenNodes(t)),i?i.map(s=>s.item):void 0}getExtensionElement(e){return this.elements.get(e)}reveal(e,t){t=t||{select:!0,focus:!1};const i=tn(t.select)?!0:t.select,s=tn(t.focus)?!1:t.focus,r=tn(t.expand)?!1:t.expand;return typeof this.dataProvider.getParent!="function"?Promise.reject(new Error("Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method")):e?this.refreshPromise.then(()=>this.resolveUnknownParentChain(e)).then(o=>this.resolveTreeNode(e,o[o.length-1]).then(a=>this.proxy.$reveal(this.viewId,{item:a.item,parentChain:o.map(l=>l.item)},{select:i,focus:s,expand:r})),o=>this.logService.error(o)):this.proxy.$reveal(this.viewId,void 0,{select:i,focus:s,expand:r})}get message(){return this._message}set message(e){this._message=e,this._onDidChangeData.fire({message:!0,element:!1})}get title(){return this._title}set title(e){this._title=e,this.proxy.$setTitle(this.viewId,e,this._description)}get description(){return this._description}set description(e){this._description=e,this.proxy.$setTitle(this.viewId,this._title,e)}get badge(){return this._badge}set badge(e){this._badge?.value===e?.value&&this._badge?.tooltip===e?.tooltip||(this._badge=Dm.from(e),this.proxy.$setBadge(this.viewId,e))}setExpanded(e,t){const i=this.getExtensionElement(e);i&&(t?this._onDidExpandElement.fire(Object.freeze({element:i})):this._onDidCollapseElement.fire(Object.freeze({element:i})))}setSelectionAndFocus(e,t){const i=!Pi(this._selectedHandles,e);this._selectedHandles=e;const s=this._focusedHandle!==t;this._focusedHandle=t,i&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),s&&this._onDidChangeActiveItem.fire(Object.freeze({activeItem:this.focusedElement}))}setVisible(e){e!==this._visible&&(this._visible=e,this._onDidChangeVisibility.fire(Object.freeze({visible:this._visible})))}async setCheckboxState(e){const t=(await Promise.all(e.map(async i=>{const s=this.getExtensionElement(i.treeItemHandle);return s?{extensionItem:s,treeItem:await this.dataProvider.getTreeItem(s),newState:i.newState?Is.Checked:Is.Unchecked}:Promise.resolve(void 0)}))).filter(i=>i!==void 0);t.forEach(i=>{i.treeItem.checkboxState=i.newState?Is.Checked:Is.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(i=>[i.extensionItem,i.newState])})}async handleDrag(e,t,i){const s=[];for(const r of e){const o=this.getExtensionElement(r);o&&s.push(o)}if(!(!this.dndController?.handleDrag||s.length===0))return await this.dndController.handleDrag(s,t,i),t}get hasHandleDrag(){return!!this.dndController?.handleDrag}async onDrop(e,t,i){const s=t?this.getExtensionElement(t):void 0;if(!(!s&&t||!this.dndController?.handleDrop))return Ln(()=>this.dndController?.handleDrop?this.dndController.handleDrop(s,e,i):void 0)}get hasResolve(){return!!this.dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this.dataProvider.resolveTreeItem)return;const i=this.elements.get(e);if(i){const s=this.nodes.get(i);if(s){const r=await this.dataProvider.resolveTreeItem(s.extensionItem,i,t)??s.extensionItem;return this.validateTreeItem(r),s.item.tooltip=this.getTooltip(r.tooltip),s.item.command=this.getCommand(s.disposableStore,r.command),s.item}}}resolveUnknownParentChain(e){return this.resolveParent(e).then(t=>t?this.resolveUnknownParentChain(t).then(i=>this.resolveTreeNode(t,i[i.length-1]).then(s=>(i.push(s),i))):Promise.resolve([]))}resolveParent(e){const t=this.nodes.get(e);return t?Promise.resolve(t.parent?this.elements.get(t.parent.item.handle):void 0):Ln(()=>this.dataProvider.getParent(e))}resolveTreeNode(e,t){const i=this.nodes.get(e);return i?Promise.resolve(i):Ln(()=>this.dataProvider.getTreeItem(e)).then(s=>this.createHandle(e,s,t,!0)).then(s=>this.getChildren(t?t.item.handle:void 0).then(()=>{const r=this.getExtensionElement(s);if(r){const o=this.nodes.get(r);if(o)return Promise.resolve(o)}throw new Error(`Cannot resolve tree item for element ${s} from extension ${this.extension.identifier.value}`)}))}getChildrenNodes(e){if(e){let t;if(typeof e=="string"){const i=this.getExtensionElement(e);t=i?this.nodes.get(i):void 0}else t=e;return t&&t.children||void 0}return this.roots}async fetchChildrenNodes(e){this.clearChildren(e);const t=new Nt(this._refreshCancellationSource.token);try{const i=e?this.nodes.get(e):void 0,s=await this.dataProvider.getChildren(e);if(t.token.isCancellationRequested)return;const r=rn(s||[]),o=await Promise.all(rn(r).map(l=>this.dataProvider.getTreeItem(l)));if(t.token.isCancellationRequested)return;const a=o.map((l,c)=>l?this.createAndRegisterTreeNode(r[c],l,i):null);return rn(a)}finally{t.dispose()}}refresh(e){if(e.some(i=>!i))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new Nt,this.clearAll(),this.proxy.$refresh(this.viewId);{const i=this.getHandlesToRefresh(e);if(i.length)return this.refreshHandles(i)}return Promise.resolve(void 0)}getHandlesToRefresh(e){const t=new Set,i=e.map(r=>this.nodes.get(r));for(const r of i)if(r&&!t.has(r.item.handle)){let o=r;for(;o&&o.parent&&i.findIndex(a=>o&&o.parent&&a&&a.item.handle===o.parent.item.handle)===-1;){const a=this.elements.get(o.parent.item.handle);o=a?this.nodes.get(a):void 0}o&&!o.parent&&t.add(r.item.handle)}const s=[];return t.forEach(r=>{const o=this.elements.get(r);if(o){const a=this.nodes.get(o);a&&(!a.parent||!t.has(a.parent.item.handle))&&s.push(r)}}),s}refreshHandles(e){const t={};return Promise.all(e.map(i=>this.refreshNode(i).then(s=>{s&&(t[i]=s.item)}))).then(()=>Object.keys(t).length?this.proxy.$refresh(this.viewId,t):void 0)}refreshNode(e){const t=this.getExtensionElement(e);if(t){const i=this.nodes.get(t);if(i)return this.clearChildren(t),Ln(()=>this.dataProvider.getTreeItem(t)).then(s=>{if(s){const r=this.createTreeNode(t,s,i.parent);return this.updateNodeCache(t,r,i,i.parent),i.dispose(),r}return null})}return Promise.resolve(null)}createAndRegisterTreeNode(e,t,i){const s=this.createTreeNode(e,t,i);if(t.id&&this.elements.has(s.item.handle))throw new Error(h(2594,"Element with id {0} is already registered",t.id));return this.addNodeToCache(e,s),this.addNodeToParentCache(s,i),s}getTooltip(e){return mi.isMarkdownString(e)?Re.from(e):e}getCommand(e,t){return t?{...this.commands.toInternal(t,e),originalId:t.command}:void 0}getCheckbox(e){if(e.checkboxState===void 0)return;let t,i,s;return typeof e.checkboxState=="number"?t=e.checkboxState:(t=e.checkboxState.state,i=e.checkboxState.tooltip,s=e.checkboxState.accessibilityInformation),{isChecked:t===Is.Checked,tooltip:i,accessibilityInformation:s}}validateTreeItem(e){if(!$g.isTreeItem(e,this.extension))throw new Error(`Extension ${this.extension.identifier.value} has provided an invalid tree item.`)}createTreeNode(e,t,i){this.validateTreeItem(t);const s=this._register(new xe),r=this.createHandle(e,t,i),o=this.getLightIconPath(t);return{item:{handle:r,parentHandle:i?i.item.handle:void 0,label:U4(t.label),description:t.description,resourceUri:t.resourceUri,tooltip:this.getTooltip(t.tooltip),command:this.getCommand(s,t.command),contextValue:t.contextValue,icon:o,iconDark:this.getDarkIconPath(t)||o,themeIcon:this.getThemeIcon(t),collapsibleState:tn(t.collapsibleState)?Ea.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this.getCheckbox(t)},extensionItem:t,parent:i,children:void 0,disposableStore:s,dispose(){s.dispose()}}}getThemeIcon(e){return e.iconPath instanceof Kn?e.iconPath:void 0}createHandle(e,{id:t,label:i,resourceUri:s},r,o){if(t)return`${Zl.ID_HANDLE_PREFIX}/${t}`;const a=U4(i),l=r?r.item.handle:Zl.LABEL_HANDLE_PREFIX;let c=a?a.label:s?Ks(s):"";c=c.indexOf("/")!==-1?c.replace("/","//"):c;const u=this.nodes.has(e)?this.nodes.get(e).item.handle:void 0,d=this.getChildrenNodes(r)||[];let f,p=0;do{if(f=`${l}/${p}:${c}`,o||!this.elements.has(f)||u===f)break;p++}while(p<=d.length);return f}getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof Kn))return typeof e.iconPath=="string"||x.isUri(e.iconPath)?this.getIconPath(e.iconPath):this.getIconPath(e.iconPath.light)}getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof Kn)&&e.iconPath.dark)return this.getIconPath(e.iconPath.dark)}getIconPath(e){return x.isUri(e)?e:x.file(e)}addNodeToCache(e,t){this.elements.set(t.item.handle,e),this.nodes.set(e,t)}updateNodeCache(e,t,i,s){this.elements.delete(t.item.handle),this.nodes.delete(e),t.item.handle!==i.item.handle&&this.elements.delete(i.item.handle),this.addNodeToCache(e,t);const r=this.getChildrenNodes(s)||[],o=r.filter(a=>a.item.handle===i.item.handle)[0];o&&r.splice(r.indexOf(o),1,t)}addNodeToParentCache(e,t){t?(t.children||(t.children=[]),t.children.push(e)):(this.roots||(this.roots=[]),this.roots.push(e))}clearChildren(e){if(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}t.children=void 0}}else this.clearAll()}clear(e){const t=this.nodes.get(e);if(t){if(t.children)for(const i of t.children){const s=this.elements.get(i.item.handle);s&&this.clear(s)}this.nodes.delete(e),this.elements.delete(t.item.handle),t.dispose()}}clearAll(){this.roots=void 0,this.elements.clear(),this.nodes.forEach(e=>e.dispose()),this.nodes.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this.clearAll(),this.proxy.$disposeTree(this.viewId)}};Zl.LABEL_HANDLE_PREFIX="0",Zl.ID_HANDLE_PREFIX="1";let cx=Zl;const q1=class q1{constructor(e){this._openers=new Map,this._proxy=e.getProxy(ee.MainThreadUriOpeners)}registerExternalUriOpener(e,t,i,s){if(this._openers.has(t))throw new Error(`Opener with id '${t}' already registered`);const r=s.schemes.find(o=>!q1.supportedSchemes.has(o));if(r)throw new Error(`Scheme '${r}' is not supported. Only http and https are currently supported.`);return this._openers.set(t,i),this._proxy.$registerUriOpener(t,s.schemes,e,s.label),we(()=>{this._openers.delete(t),this._proxy.$unregisterUriOpener(t)})}async $canOpenUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener with id: ${e}`);const r=x.revive(t);return s.canOpenExternalUri(r,i)}async $openUri(e,t,i){const s=this._openers.get(e);if(!s)throw new Error(`Unknown opener id: '${e}'`);return s.openExternalUri(x.revive(t.resolvedUri),{sourceUri:x.revive(t.sourceUri)},i)}};q1.supportedSchemes=new Set([le.http,le.https]);let ux=q1;class c$ extends Se{#e;#t;#n;#i;#r;#s;#a;#o;#l;#c;#u;#h;#d;constructor(e,t,i,s){super(),this.#o=void 0,this.#l=!0,this.#u=!1,this.#h=this._register(new N),this.onDidDispose=this.#h.event,this.#d=this._register(new N),this.onDidChangeViewState=this.#d.event,this.#e=e,this.#t=t,this.#i=i,this.#n=s.viewType,this.#r=s.panelOptions,this.#o=s.viewColumn,this.#s=s.title,this.#c=s.active}dispose(){this.#u||(this.#u=!0,this.#h.fire(),this.#t.$disposeWebview(this.#e),this.#i.dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),this.#i}get viewType(){return this.assertNotDisposed(),this.#n}get title(){return this.assertNotDisposed(),this.#s}set title(e){this.assertNotDisposed(),this.#s!==e&&(this.#s=e,this.#t.$setTitle(this.#e,e))}get iconPath(){return this.assertNotDisposed(),this.#a}set iconPath(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#t.$setIconPath(this.#e,x.isUri(e)?{light:e,dark:e}:e))}get options(){return this.#r}get viewColumn(){if(this.assertNotDisposed(),!(typeof this.#o=="number"&&this.#o<0))return this.#o}get active(){return this.assertNotDisposed(),this.#c}get visible(){return this.assertNotDisposed(),this.#l}_updateViewState(e){this.#u||(this.active!==e.active||this.visible!==e.visible||this.viewColumn!==e.viewColumn)&&(this.#c=e.active,this.#l=e.visible,this.#o=e.viewColumn,this.#d.fire({webviewPanel:this}))}reveal(e,t){this.assertNotDisposed(),this.#t.$reveal(this.#e,{viewColumn:typeof e>"u"?void 0:hn.from(e),preserveFocus:!!t})}assertNotDisposed(){if(this.#u)throw new Error("Webview is disposed")}}class AE extends Se{static newHandle(){return Sn()}constructor(e,t,i){super(),this.webviews=t,this.workspace=i,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(ee.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(e,t,i,s,r={}){const o=typeof s=="object"?s.viewColumn:s,a={viewColumn:hn.from(o),preserveFocus:typeof s=="object"&&!!s.preserveFocus},l=du(e),c=AE.newHandle();this._proxy.$createWebviewPanel(n1(e),c,t,{title:i,panelOptions:u$(r),webviewOptions:d5(e,this.workspace,r),serializeBuffersForPostMessage:l},a);const u=this.webviews.createNewWebview(c,r,e);return this.createNewWebviewPanel(c,t,i,o,r,u,!0)}$onDidChangeWebviewPanelViewStates(e){const t=Object.keys(e);t.sort((i,s)=>{const r=e[i],o=e[s];return r.active?1:o.active?-1:+r.visible-+o.visible});for(const i of t){const s=this.getWebviewPanel(i);if(!s)continue;const r=e[i];s._updateViewState({active:r.active,visible:r.visible,viewColumn:hn.to(r.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,i){if(this._serializers.has(t))throw new Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:i,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:du(e)}),new je(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,i,s){const r=this._serializers.get(t);if(!r)throw new Error(`No serializer found for '${t}'`);const{serializer:o,extension:a}=r,l=this.webviews.createNewWebview(e,i.webviewOptions,a),c=this.createNewWebviewPanel(e,t,i.title,s,i.panelOptions,l,i.active);await o.deserializeWebviewPanel(c,i.state)}createNewWebviewPanel(e,t,i,s,r,o,a){const l=new c$(e,this._proxy,o,{viewType:t,title:i,viewColumn:s,panelOptions:r,active:a});return this._webviewPanels.set(e,l),l}getWebviewPanel(e){return this._webviewPanels.get(e)}}function u$(n){return{enableFindWidget:n.enableFindWidget,retainContextWhenHidden:n.retainContextWhenHidden}}class d$ extends Se{#e;#t;#n;#i;#r;#s;#a;#o;#l;constructor(e,t,i,s,r,o){super(),this.#r=!1,this.#c=this._register(new N),this.onDidChangeVisibility=this.#c.event,this.#u=this._register(new N),this.onDidDispose=this.#u.event,this.#n=i,this.#a=s,this.#e=e,this.#t=t,this.#i=r,this.#s=o}dispose(){this.#r||(this.#r=!0,this.#u.fire(),this.#i.dispose(),super.dispose())}#c;#u;get title(){return this.assertNotDisposed(),this.#a}set title(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#t.$setWebviewViewTitle(this.#e,e))}get description(){return this.assertNotDisposed(),this.#o}set description(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,this.#t.$setWebviewViewDescription(this.#e,e))}get visible(){return this.#s}get webview(){return this.#i}get viewType(){return this.#n}_setVisible(e){e===this.#s||this.#r||(this.#s=e,this.#c.fire())}get badge(){return this.assertNotDisposed(),this.#l}set badge(e){this.assertNotDisposed(),!(e?.value===this.#l?.value&&e?.tooltip===this.#l?.tooltip)&&(this.#l=Dm.from(e),this.#t.$setWebviewViewBadge(this.#e,e))}show(e){this.assertNotDisposed(),this.#t.$show(this.#e,!!e)}assertNotDisposed(){if(this.#r)throw new Error("Webview is disposed")}}class h${constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(ee.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,i,s){if(this._viewProviders.has(t))throw new Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:i,extension:e}),this._proxy.$registerWebviewViewProvider(n1(e),t,{retainContextWhenHidden:s?.retainContextWhenHidden,serializeBuffersForPostMessage:du(e)}),new je(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,i,s,r){const o=this._viewProviders.get(t);if(!o)throw new Error(`No view provider found for '${t}'`);const{provider:a,extension:l}=o,c=this._extHostWebview.createNewWebview(e,{},l),u=new d$(e,this._proxy,t,i,c,!0);this._webviewViews.set(e,u),await a.resolveWebviewView(u,{state:s},r)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){const t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){const t=this._webviewViews.get(e);if(!t)throw new Error("No webview found");return t}}class f${constructor(e){this._settingsSearchProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(ee.MainThreadAiSettingsSearch)}async $startSearch(e,t,i,s){if(this._settingsSearchProviders.size===0)throw new Error("No related information providers registered");const r=this._settingsSearchProviders.get(e);if(!r)throw new Error("Settings search provider not found");const o=new $d(a=>{this._proxy.$handleSearchResult(e,by.fromSettingsSearchResult(a))});return r.provideSettingsSearchResults(t,i,o,s)}registerSettingsSearchProvider(e,t){const i=this._nextHandle;return this._nextHandle++,this._settingsSearchProviders.set(i,t),this._proxy.$registerAiSettingsSearchProvider(i),new je(()=>{this._proxy.$unregisterAiSettingsSearchProvider(i),this._settingsSearchProviders.delete(i)})}}function p$(n){const e=n.get(gn),t=n.get(hu),i=n.get(w_),s=n.get(Ao),r=n.get(Mr),o=n.get(y_),a=n.get(Ur),l=n.get(Q1),c=n.get(nt),u=n.get(hE),d=n.get(fE),f=n.get(Po),p=n.get(at),_=n.get(pE),w=n.get(lf),v=n.get(x_),E=n.get(E_),S=n.get(vE),A=n.get(cf),G=n.get(bE),W=n.get(S_),ce=n.get(mE),Q=n.get(_E),ne=n.get(I0);c.set(he.ExtHostFileSystemInfo,t),c.set(he.ExtHostLogLevelServiceShape,f),c.set(he.ExtHostWorkspace,r),c.set(he.ExtHostConfiguration,a),c.set(he.ExtHostExtensionService,s),c.set(he.ExtHostStorage,u),c.set(he.ExtHostTunnelService,_),c.set(he.ExtHostWindow,v),c.set(he.ExtHostUrls,E),c.set(he.ExtHostSecretState,S),c.set(he.ExtHostTelemetry,o),c.set(he.ExtHostEditorTabs,A),c.set(he.ExtHostManagedSockets,G),c.set(he.ExtHostProgress,W),c.set(he.ExtHostAuthentication,ce),c.set(he.ExtHostChatProvider,Q);const J=c.set(he.ExtHostDecorations,n.get(KP)),de=c.set(he.ExtHostDocumentsAndEditors,n.get(vu)),Ce=c.set(he.ExtHostCommands,n.get(ul)),Ae=c.set(he.ExtHostTerminalService,n.get(_u)),se=c.set(he.ExtHostTerminalShellIntegration,n.get(i5)),q=c.set(he.ExtHostDebugService,n.get(ZP)),re=c.set(he.ExtHostSearch,n.get(n5)),Y=c.set(he.ExtHostTask,n.get(QP)),ve=c.set(he.ExtHostOutputService,n.get(GP)),Le=c.set(he.ExtHostLocalization,n.get(wE)),Pe=c.set(he.ExtHostDocuments,new HM(c,de)),Et=c.set(he.ExtHostDocumentContentProviders,new M0(c,de,p)),St=c.set(he.ExtHostDocumentSaveParticipant,new $M(p,Pe,c.getProxy(ee.MainThreadBulkEdits))),Ke=c.set(he.ExtHostNotebook,new J0(c,Ce,de,Pe,i,re,p)),Hn=c.set(he.ExtHostNotebookDocuments,new MU(Ke)),$t=c.set(he.ExtHostNotebookEditors,new X0(p,Ke)),Xn=c.set(he.ExtHostNotebookKernels,new Y0(c,e,Ke,Ce,p)),Dn=c.set(he.ExtHostNotebookRenderers,new BU(c,Ke)),gs=c.set(he.ExtHostNotebookDocumentSaveParticipant,new FU(p,Ke,c.getProxy(ee.MainThreadBulkEdits))),Ht=c.set(he.ExtHostEditors,new n$(c,de)),uf=c.set(he.ExtHostTreeViews,new l$(c.getProxy(ee.MainThreadTreeViews),Ce,p)),df=c.set(he.ExtHostEditorInsets,new _M(c.getProxy(ee.MainThreadEditorInsets),Ht,e.remote)),$r=c.set(he.ExtHostDiagnostics,new F0(c,p,t,de)),Ro=c.set(he.ExtHostLanguages,new pU(c,Pe,Ce.converter,l)),We=c.set(he.ExtHostLanguageFeatures,new U0(c,l,Pe,Ce,$r,p,w,o)),Qs=c.set(he.ExtHostCodeMapper,new O0(c)),C_=c.set(he.ExtHostFileSystem,new r1(c,We)),Js=c.set(he.ExtHostFileSystemEventService,new JM(c,p,de)),Xe=c.set(he.ExtHostQuickOpen,VU(c,r,Ce)),hf=c.set(he.ExtHostSCM,new sx(c,Ce,Pe,p)),T_=c.set(he.ExtHostQuickDiff,new tx(c,l)),ff=c.set(he.ExtHostShare,new rx(c,l)),Hr=c.set(he.ExtHostComments,vM(c,Ce,Pe)),P_=c.set(he.ExtHostLabelService,new YM(c)),pf=c.set(he.ExtHostTheming,new lx(c)),A_=c.set(he.ExtHostTimeline,new i$(c,Ce)),wu=c.set(he.ExtHostWebviews,new CM(c,e.remote,r,p,w)),vi=c.set(he.ExtHostWebviewPanels,new AE(c,wu,r)),R_=c.set(he.ExtHostCustomEditors,new NM(c,Pe,d,wu,vi)),L_=c.set(he.ExtHostWebviewViews,new h$(c,wu)),Br=c.set(he.ExtHostTesting,n.get(D_)),N_=c.set(he.ExtHostUriOpeners,new ux(c)),dl=c.set(he.ExtHostProfileContentHandlers,new WU(c));c.set(he.ExtHostInteractive,new XM(c,Ke,de,Ce,p));const Xs=c.set(he.ExtHostLanguageModelTools,new fU(c,Q)),ms=c.set(he.ExtHostChatAgents2,new L0(c,p,Ce,Pe,Q,$r,Xs)),bu=c.set(he.ExtHostAiRelatedInformation,new tM(c)),yu=c.set(he.ExtHostAiEmbeddingVector,new WM(c)),xu=c.set(he.ExtHostAiSettingsSearch,new f$(c)),Lo=c.set(he.ExtHostStatusBar,new t$(c,Ce.converter)),ai=c.set(he.ExtHostSpeech,new ox(c)),Bi=c.set(he.ExtHostEmbeddings,new BM(c));c.set(he.ExtHostMcp,n.get(I0));const Bt=Object.values(he);c.assertRegistered(Bt);const O_=new R0(c,de),F_=new pM(c),wn=new q0(c,p),gf=new UM(c),M_=new hM(c);return oM.register(Ce),function(C,_s,Eu){function ge(m){return(b,I,fe)=>{const ze=m(kt=>{try{b.call(I,kt)}catch(y5){Pv(new PC(C.identifier,y5,"FAILED to handle event"))}});return fe?.push(ze),ze}}const lt=(function(){let m=!C.isUnderDevelopment;function b(){m||(p.info(`Extension '${C.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),m=!0)}return function I(fe){if(Array.isArray(fe))fe.forEach(I);else if(typeof fe=="string")b();else{const ze=fe;typeof ze.scheme>"u"&&b(),typeof ze.exclusive=="boolean"&&$(C,"documentFiltersExclusive")}return fe}})(),U_={getSession(m,b,I){return(typeof I?.forceNewSession=="object"&&I.forceNewSession.learnMore||typeof I?.createIfNone=="object"&&I.createIfNone.learnMore)&&$(C,"authLearnMore"),I?.authorizationServer&&$(C,"authIssuers"),ce.getSession(C,m,b,I)},getAccounts(m){return ce.getAccounts(m)},async hasSession(m,b){return $(C,"authSession"),!!await ce.getSession(C,m,b,{silent:!0})},get onDidChangeSessions(){return ge(ce.getExtensionScopedSessionsEvent(C.identifier.value))},registerAuthenticationProvider(m,b,I,fe){return fe?.supportedAuthorizationServers&&$(C,"authIssuers"),ce.registerAuthenticationProvider(m,b,I,fe)}},$_={registerCommand(m,b,I){return Ce.registerCommand(!0,m,b,I,void 0,C)},registerTextEditorCommand(m,b,I){return Ce.registerCommand(!0,m,(...fe)=>{const ze=Ht.getActiveTextEditor();if(!ze){p.warn("Cannot execute "+m+" because there is no active text editor.");return}return ze.edit(kt=>{b.apply(I,[ze,kt,...fe])}).then(kt=>{kt||p.warn("Edits from command "+m+" were not applied.")},kt=>{p.warn("An error occurred while running command "+m,kt)})},void 0,void 0,C)},registerDiffInformationCommand:(m,b,I)=>($(C,"diffCommand"),Ce.registerCommand(!0,m,async(...fe)=>{const ze=de.activeEditor(!0);if(!ze){p.warn("Cannot execute "+m+" because there is no active text editor.");return}const kt=await Ht.getDiffInformation(ze.id);b.apply(I,[kt,...fe])},void 0,void 0,C)),executeCommand(m,...b){return Ce.executeCommand(m,...b)},getCommands(m=!1){return Ce.getCommands(m)}},hl={get machineId(){return e.telemetryInfo.machineId},get sessionId(){return e.telemetryInfo.sessionId},get language(){return e.environment.appLanguage},get appName(){return e.environment.appName},get appRoot(){return e.environment.appRoot?.fsPath??""},get appHost(){return e.environment.appHost},get uriScheme(){return e.environment.appUriScheme},get clipboard(){return F_.value},get shell(){return Ae.getDefaultShell(!1)},get onDidChangeShell(){return ge(Ae.onDidChangeShell)},get isTelemetryEnabled(){return o.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return ge(o.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return $(C,"telemetry"),o.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return $(C,"telemetry"),ge(o.onDidChangeTelemetryConfiguration)},get isNewAppInstall(){return RP(e.telemetryInfo.firstSessionDate)},createTelemetryLogger(m,b){return AP.validateSender(m),o.instantiateLogger(C,m,b)},openExternal(m,b){return v.openUri(m,{allowTunneling:!!e.remote.authority,allowContributedOpeners:b?.allowContributedOpeners})},async asExternalUri(m){if(m.scheme===e.environment.appUriScheme)return E.createAppUri(m);try{return await v.asExternalUri(m,{allowTunneling:!!e.remote.authority})}catch(b){if(zv(m,le.http)||zv(m,le.https))return m;throw b}},get remoteName(){return Px(e.remote.authority)},get remoteAuthority(){return $(C,"resolvers"),e.remote.authority},get uiKind(){return e.uiKind},get logLevel(){return p.getLevel()},get onDidChangeLogLevel(){return ge(p.onDidChangeLogLevel)},get appQuality(){return $(C,"resolvers"),e.quality},get appCommit(){return $(C,"resolvers"),e.commit}},H_={createTestController(m,b,I){return Br.createTestController(C,m,b,I)},createTestObserver(){return $(C,"testObserver"),Br.createTestObserver()},runTests(m){return $(C,"testObserver"),Br.runTests(m)},registerTestFollowupProvider(m){return $(C,"testObserver"),Br.registerTestFollowupProvider(m)},get onDidChangeTestResults(){return $(C,"testObserver"),ge(Br.onResultsChanged)},get testResults(){return $(C,"testObserver"),Br.results}},fl=e.remote.isRemote?Sa.Workspace:Sa.UI,B_={getExtension(m,b){dt(C,"extensionsAny")||(b=!1);const I=_s.mine.getExtensionDescription(m);if(I)return new Wu(s,C.identifier,I,fl,!1);if(b){const fe=_s.all.getExtensionDescription(m);if(fe)return new Wu(s,C.identifier,fe,fl,!0)}},get all(){const m=[];for(const b of _s.mine.getAllExtensionDescriptions())m.push(new Wu(s,C.identifier,b,fl,!1));return m},get allAcrossExtensionHosts(){$(C,"extensionsAny");const m=new nl(_s.mine.getAllExtensionDescriptions().map(I=>I.identifier)),b=[];for(const I of _s.all.getAllExtensionDescriptions()){const fe=!m.has(I.identifier);b.push(new Wu(s,C.identifier,I,fl,fe))}return b},get onDidChange(){return dt(C,"extensionsAny")?ge(Ut.any(_s.mine.onDidChange,_s.all.onDidChange)):ge(_s.mine.onDidChange)}},W_={createDiagnosticCollection(m){return $r.createDiagnosticCollection(C.identifier,m)},get onDidChangeDiagnostics(){return ge($r.onDidChangeDiagnostics)},getDiagnostics:m=>$r.getDiagnostics(m),getLanguages(){return Ro.getLanguages()},setTextDocumentLanguage(m,b){return Ro.changeLanguage(m.uri,b)},match(m,b){const I=ey.from(m);let fe;return r5(I)&&(fe=Ke.notebookDocuments.find(ze=>ze.apiNotebook.getCells().find(kt=>kt.document===b))?.apiNotebook),s5(I,b.uri,b.languageId,!0,fe?.uri,fe?.notebookType)},registerCodeActionsProvider(m,b,I){return We.registerCodeActionProvider(C,lt(m),b,I)},registerDocumentPasteEditProvider(m,b,I){return We.registerDocumentPasteEditProvider(C,lt(m),b,I)},registerCodeLensProvider(m,b){return We.registerCodeLensProvider(C,lt(m),b)},registerDefinitionProvider(m,b){return We.registerDefinitionProvider(C,lt(m),b)},registerDeclarationProvider(m,b){return We.registerDeclarationProvider(C,lt(m),b)},registerImplementationProvider(m,b){return We.registerImplementationProvider(C,lt(m),b)},registerTypeDefinitionProvider(m,b){return We.registerTypeDefinitionProvider(C,lt(m),b)},registerHoverProvider(m,b){return We.registerHoverProvider(C,lt(m),b,C.identifier)},registerEvaluatableExpressionProvider(m,b){return We.registerEvaluatableExpressionProvider(C,lt(m),b,C.identifier)},registerInlineValuesProvider(m,b){return We.registerInlineValuesProvider(C,lt(m),b,C.identifier)},registerDocumentHighlightProvider(m,b){return We.registerDocumentHighlightProvider(C,lt(m),b)},registerMultiDocumentHighlightProvider(m,b){return We.registerMultiDocumentHighlightProvider(C,lt(m),b)},registerLinkedEditingRangeProvider(m,b){return We.registerLinkedEditingRangeProvider(C,lt(m),b)},registerReferenceProvider(m,b){return We.registerReferenceProvider(C,lt(m),b)},registerRenameProvider(m,b){return We.registerRenameProvider(C,lt(m),b)},registerNewSymbolNamesProvider(m,b){return $(C,"newSymbolNamesProvider"),We.registerNewSymbolNamesProvider(C,lt(m),b)},registerDocumentSymbolProvider(m,b,I){return We.registerDocumentSymbolProvider(C,lt(m),b,I)},registerWorkspaceSymbolProvider(m){return We.registerWorkspaceSymbolProvider(C,m)},registerDocumentFormattingEditProvider(m,b){return We.registerDocumentFormattingEditProvider(C,lt(m),b)},registerDocumentRangeFormattingEditProvider(m,b){return We.registerDocumentRangeFormattingEditProvider(C,lt(m),b)},registerOnTypeFormattingEditProvider(m,b,I,...fe){return We.registerOnTypeFormattingEditProvider(C,lt(m),b,[I].concat(fe))},registerDocumentSemanticTokensProvider(m,b,I){return We.registerDocumentSemanticTokensProvider(C,lt(m),b,I)},registerDocumentRangeSemanticTokensProvider(m,b,I){return We.registerDocumentRangeSemanticTokensProvider(C,lt(m),b,I)},registerSignatureHelpProvider(m,b,I,...fe){return typeof I=="object"?We.registerSignatureHelpProvider(C,lt(m),b,I):We.registerSignatureHelpProvider(C,lt(m),b,typeof I>"u"?[]:[I,...fe])},registerCompletionItemProvider(m,b,...I){return We.registerCompletionItemProvider(C,lt(m),b,I)},registerInlineCompletionItemProvider(m,b,I){return b.handleDidShowCompletionItem&&$(C,"inlineCompletionsAdditions"),b.handleDidPartiallyAcceptCompletionItem&&$(C,"inlineCompletionsAdditions"),I&&$(C,"inlineCompletionsAdditions"),We.registerInlineCompletionsProvider(C,lt(m),b,I)},registerInlineEditProvider(m,b){return $(C,"inlineEdit"),We.registerInlineEditProvider(C,lt(m),b)},registerDocumentLinkProvider(m,b){return We.registerDocumentLinkProvider(C,lt(m),b)},registerColorProvider(m,b){return We.registerColorProvider(C,lt(m),b)},registerFoldingRangeProvider(m,b){return We.registerFoldingRangeProvider(C,lt(m),b)},registerSelectionRangeProvider(m,b){return We.registerSelectionRangeProvider(C,m,b)},registerCallHierarchyProvider(m,b){return We.registerCallHierarchyProvider(C,m,b)},registerTypeHierarchyProvider(m,b){return We.registerTypeHierarchyProvider(C,m,b)},setLanguageConfiguration:(m,b)=>We.setLanguageConfiguration(C,m,b),getTokenInformationAtPosition(m,b){return $(C,"tokenInformation"),Ro.tokenAtPosition(m,b)},registerInlayHintsProvider(m,b){return We.registerInlayHintsProvider(C,m,b)},createLanguageStatusItem(m,b){return Ro.createLanguageStatusItem(C,m,b)},registerDocumentDropEditProvider(m,b,I){return We.registerDocumentOnDropEditProvider(C,m,b,I)}},V_={get activeTextEditor(){return Ht.getActiveTextEditor()},get visibleTextEditors(){return Ht.getVisibleTextEditors()},get activeTerminal(){return Ae.activeTerminal},get terminals(){return Ae.terminals},async showTextDocument(m,b,I){x.isUri(m)&&m.scheme===le.vscodeRemote&&!m.authority&&w.report("workspace.showTextDocument",C,"A URI of 'vscode-remote' scheme requires an authority.");const fe=await(x.isUri(m)?Promise.resolve(pl.openTextDocument(m)):Promise.resolve(m));return Ht.showTextDocument(fe,b,I)},createTextEditorDecorationType(m){return Ht.createTextEditorDecorationType(C,m)},onDidChangeActiveTextEditor(m,b,I){return ge(Ht.onDidChangeActiveTextEditor)(m,b,I)},onDidChangeVisibleTextEditors(m,b,I){return ge(Ht.onDidChangeVisibleTextEditors)(m,b,I)},onDidChangeTextEditorSelection(m,b,I){return ge(Ht.onDidChangeTextEditorSelection)(m,b,I)},onDidChangeTextEditorOptions(m,b,I){return ge(Ht.onDidChangeTextEditorOptions)(m,b,I)},onDidChangeTextEditorVisibleRanges(m,b,I){return ge(Ht.onDidChangeTextEditorVisibleRanges)(m,b,I)},onDidChangeTextEditorViewColumn(m,b,I){return ge(Ht.onDidChangeTextEditorViewColumn)(m,b,I)},onDidChangeTextEditorDiffInformation(m,b,I){return $(C,"textEditorDiffInformation"),ge(Ht.onDidChangeTextEditorDiffInformation)(m,b,I)},onDidCloseTerminal(m,b,I){return ge(Ae.onDidCloseTerminal)(m,b,I)},onDidOpenTerminal(m,b,I){return ge(Ae.onDidOpenTerminal)(m,b,I)},onDidChangeActiveTerminal(m,b,I){return ge(Ae.onDidChangeActiveTerminal)(m,b,I)},onDidChangeTerminalDimensions(m,b,I){return $(C,"terminalDimensions"),ge(Ae.onDidChangeTerminalDimensions)(m,b,I)},onDidChangeTerminalState(m,b,I){return ge(Ae.onDidChangeTerminalState)(m,b,I)},onDidWriteTerminalData(m,b,I){return $(C,"terminalDataWriteEvent"),ge(Ae.onDidWriteTerminalData)(m,b,I)},onDidExecuteTerminalCommand(m,b,I){return $(C,"terminalExecuteCommandEvent"),ge(Ae.onDidExecuteTerminalCommand)(m,b,I)},onDidChangeTerminalShellIntegration(m,b,I){return ge(se.onDidChangeTerminalShellIntegration)(m,b,I)},onDidStartTerminalShellExecution(m,b,I){return ge(se.onDidStartTerminalShellExecution)(m,b,I)},onDidEndTerminalShellExecution(m,b,I){return ge(se.onDidEndTerminalShellExecution)(m,b,I)},get state(){return v.getState()},onDidChangeWindowState(m,b,I){return ge(v.onDidChangeWindowState)(m,b,I)},showInformationMessage(m,...b){return wn.showMessage(C,Qt.Info,m,b[0],b.slice(1))},showWarningMessage(m,...b){return wn.showMessage(C,Qt.Warning,m,b[0],b.slice(1))},showErrorMessage(m,...b){return wn.showMessage(C,Qt.Error,m,b[0],b.slice(1))},showQuickPick(m,b,I){return Xe.showQuickPick(C,m,b,I)},showWorkspaceFolderPick(m){return Xe.showWorkspaceFolderPick(m)},showInputBox(m,b){return Xe.showInput(m,b)},showOpenDialog(m){return gf.showOpenDialog(m)},showSaveDialog(m){return gf.showSaveDialog(m)},createStatusBarItem(m,b,I){let fe,ze,kt;return typeof m=="string"?(fe=m,ze=b,kt=I):(ze=m,kt=b),Lo.createStatusBarEntry(C,fe,ze,kt)},setStatusBarMessage(m,b){return Lo.setStatusBarMessage(m,b)},withScmProgress(m){return w.report("window.withScmProgress",C,"Use 'withProgress' instead."),W.withProgress(C,{location:wo.SourceControl},(b,I)=>m({report(fe){}}))},withProgress(m,b){return W.withProgress(C,m,b)},createOutputChannel(m,b){return ve.createOutputChannel(m,b,C)},createWebviewPanel(m,b,I,fe){return vi.createWebviewPanel(C,m,b,I,fe)},createWebviewTextEditorInset(m,b,I,fe){return $(C,"editorInsets"),df.createWebviewEditorInset(m,b,I,fe,C)},createTerminal(m,b,I){return typeof m=="object"?"pty"in m?Ae.createExtensionTerminal(m):Ae.createTerminalFromOptions(m):Ae.createTerminal(m,b,I)},registerTerminalLinkProvider(m){return Ae.registerLinkProvider(m)},registerTerminalProfileProvider(m,b){return Ae.registerProfileProvider(C,m,b)},registerTerminalCompletionProvider(m,...b){return $(C,"terminalCompletionProvider"),Ae.registerTerminalCompletionProvider(C,m,...b)},registerTerminalQuickFixProvider(m,b){return $(C,"terminalQuickFixProvider"),Ae.registerTerminalQuickFixProvider(m,C.identifier.value,b)},registerTreeDataProvider(m,b){return uf.registerTreeDataProvider(m,b,C)},createTreeView(m,b){return uf.createTreeView(m,b,C)},registerWebviewPanelSerializer:(m,b)=>vi.registerWebviewPanelSerializer(C,m,b),registerCustomEditorProvider:(m,b,I={})=>R_.registerCustomEditorProvider(C,m,b,I),registerFileDecorationProvider(m){return J.registerFileDecorationProvider(m,C)},registerUriHandler(m){return E.registerUriHandler(C,m)},createQuickPick(){return Xe.createQuickPick(C)},createInputBox(){return Xe.createInputBox(C)},get activeColorTheme(){return pf.activeColorTheme},onDidChangeActiveColorTheme(m,b,I){return ge(pf.onDidChangeActiveColorTheme)(m,b,I)},registerWebviewViewProvider(m,b,I){return L_.registerWebviewViewProvider(C,m,b,I?.webviewOptions)},get activeNotebookEditor(){return Ke.activeNotebookEditor},onDidChangeActiveNotebookEditor(m,b,I){return ge(Ke.onDidChangeActiveNotebookEditor)(m,b,I)},get visibleNotebookEditors(){return Ke.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return ge(Ke.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(m,b,I){return ge($t.onDidChangeNotebookEditorSelection)(m,b,I)},onDidChangeNotebookEditorVisibleRanges(m,b,I){return ge($t.onDidChangeNotebookEditorVisibleRanges)(m,b,I)},showNotebookDocument(m,b){return Ke.showNotebookDocument(m,b)},registerExternalUriOpener(m,b,I){return $(C,"externalUriOpener"),N_.registerExternalUriOpener(C.identifier,m,b,I)},registerProfileContentHandler(m,b){return $(C,"profileContentHandlers"),dl.registerProfileContentHandler(C,m,b)},registerQuickDiffProvider(m,b,I,fe,ze){return $(C,"quickDiffProvider"),T_.registerQuickDiffProvider(C,lt(m),b,I,fe,ze)},get tabGroups(){return A.tabGroups},registerShareProvider(m,b){return $(C,"shareProvider"),ff.registerShareProvider(lt(m),b)},get nativeHandle(){return $(C,"nativeWindowHandle"),v.nativeHandle},createChatStatusItem:m=>($(C,"chatStatusItem"),M_.createChatStatusItem(C,m))},pl={get rootPath(){return w.report("workspace.rootPath",C,"Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath"),r.getPath()},set rootPath(m){throw new ia("rootPath")},getWorkspaceFolder(m){return r.getWorkspaceFolder(m)},get workspaceFolders(){return r.getWorkspaceFolders()},get name(){return r.name},set name(m){throw new ia("name")},get workspaceFile(){return r.workspaceFile},set workspaceFile(m){throw new ia("workspaceFile")},updateWorkspaceFolders:(m,b,...I)=>r.updateWorkspaceFolders(C,m,b||0,...I),onDidChangeWorkspaceFolders:function(m,b,I){return ge(r.onDidChangeWorkspace)(m,b,I)},asRelativePath:(m,b)=>r.getRelativePath(m,b),findFiles:(m,b,I,fe)=>r.findFiles(m,b,I,C.identifier,fe),findFiles2:(m,b,I)=>($(C,"findFiles2"),r.findFiles2(m,b,C.identifier,I)),findTextInFiles:(m,b,I,fe)=>{$(C,"findTextInFiles");let ze,kt;return typeof b=="object"?(ze=b,kt=I):(ze={},kt=b,fe=I),r.findTextInFiles(m,ze||{},kt,C.identifier,fe)},findTextInFiles2:(m,b,I)=>($(C,"findTextInFiles2"),$(C,"textSearchProvider2"),r.findTextInFiles2(m,b,C.identifier,I)),save:m=>r.save(m),saveAs:m=>r.saveAs(m),saveAll:m=>r.saveAll(m),applyEdit(m,b){return O_.applyWorkspaceEdit(m,C,b)},createFileSystemWatcher:(m,b,I,fe)=>{const ze={ignoreCreateEvents:!!b,ignoreChangeEvents:!!I,ignoreDeleteEvents:!!fe};return Js.createFileSystemWatcher(r,Eu,C,m,ze)},get textDocuments(){return Pe.getAllDocumentData().map(m=>m.document)},set textDocuments(m){throw new ia("textDocuments")},openTextDocument(m,b){let I;if(b=b??m,typeof m=="string")I=Promise.resolve(x.file(m));else if(x.isUri(m))I=Promise.resolve(m);else if(!b||typeof b=="object")I=Pe.createDocumentData(b);else throw new Error("illegal argument - uriOrFileNameOrOptions");return I.then(fe=>(p.trace(`openTextDocument from ${C.identifier}`),fe.scheme===le.vscodeRemote&&!fe.authority&&w.report("workspace.openTextDocument",C,"A URI of 'vscode-remote' scheme requires an authority."),Pe.ensureDocumentData(fe,b).then(ze=>ze.document)))},onDidOpenTextDocument:(m,b,I)=>ge(Pe.onDidAddDocument)(m,b,I),onDidCloseTextDocument:(m,b,I)=>ge(Pe.onDidRemoveDocument)(m,b,I),onDidChangeTextDocument:(m,b,I)=>ge(Pe.onDidChangeDocument)(m,b,I),onDidSaveTextDocument:(m,b,I)=>ge(Pe.onDidSaveDocument)(m,b,I),onWillSaveTextDocument:(m,b,I)=>ge(St.getOnWillSaveTextDocumentEvent(C))(m,b,I),get notebookDocuments(){return Ke.notebookDocuments.map(m=>m.apiNotebook)},async openNotebookDocument(m,b){let I;if(x.isUri(m))I=m,await Ke.openNotebookDocument(m);else if(typeof m=="string")I=x.revive(await Ke.createNotebookDocument({viewType:m,content:b}));else throw new Error("Invalid arguments");return Ke.getNotebookDocument(I).apiNotebook},onDidSaveNotebookDocument(m,b,I){return ge(Hn.onDidSaveNotebookDocument)(m,b,I)},onDidChangeNotebookDocument(m,b,I){return ge(Hn.onDidChangeNotebookDocument)(m,b,I)},onWillSaveNotebookDocument(m,b,I){return ge(gs.getOnWillSaveNotebookDocumentEvent(C))(m,b,I)},get onDidOpenNotebookDocument(){return ge(Ke.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return ge(Ke.onDidCloseNotebookDocument)},registerNotebookSerializer(m,b,I,fe){return Ke.registerNotebookSerializer(C,m,b,I,dt(C,"notebookLiveShare")?fe:void 0)},onDidChangeConfiguration:(m,b,I)=>ge(Eu.onDidChangeConfiguration)(m,b,I),getConfiguration(m,b){return b=arguments.length===1?void 0:b,Eu.getConfiguration(m,b,C)},registerTextDocumentContentProvider(m,b){return Et.registerTextDocumentContentProvider(m,b)},registerTaskProvider:(m,b)=>(w.report("window.registerTaskProvider",C,"Use the corresponding function on the 'tasks' namespace instead"),Y.registerTaskProvider(C,m,b)),registerFileSystemProvider(m,b,I){return bx(C_.registerFileSystemProvider(C,m,b,I),i.addFileSystemProvider(m,b,I))},get fs(){return i.value},registerFileSearchProvider:(m,b)=>($(C,"fileSearchProvider"),re.registerFileSearchProviderOld(m,b)),registerTextSearchProvider:(m,b)=>($(C,"textSearchProvider"),re.registerTextSearchProviderOld(m,b)),registerAITextSearchProvider:(m,b)=>($(C,"aiTextSearchProvider"),$(C,"textSearchProvider2"),re.registerAITextSearchProvider(m,b)),registerFileSearchProvider2:(m,b)=>($(C,"fileSearchProvider2"),re.registerFileSearchProvider(m,b)),registerTextSearchProvider2:(m,b)=>($(C,"textSearchProvider2"),re.registerTextSearchProvider(m,b)),registerRemoteAuthorityResolver:(m,b)=>($(C,"resolvers"),s.registerRemoteAuthorityResolver(m,b)),registerResourceLabelFormatter:m=>($(C,"resolvers"),P_.$registerResourceLabelFormatter(m)),getRemoteExecServer:m=>($(C,"resolvers"),s.getRemoteExecServer(m)),onDidCreateFiles:(m,b,I)=>ge(Js.onDidCreateFile)(m,b,I),onDidDeleteFiles:(m,b,I)=>ge(Js.onDidDeleteFile)(m,b,I),onDidRenameFiles:(m,b,I)=>ge(Js.onDidRenameFile)(m,b,I),onWillCreateFiles:(m,b,I)=>ge(Js.getOnWillCreateFileEvent(C))(m,b,I),onWillDeleteFiles:(m,b,I)=>ge(Js.getOnWillDeleteFileEvent(C))(m,b,I),onWillRenameFiles:(m,b,I)=>ge(Js.getOnWillRenameFileEvent(C))(m,b,I),openTunnel:m=>($(C,"tunnels"),_.openTunnel(C,m).then(b=>{if(!b)throw new Error("cannot open tunnel");return b})),get tunnels(){return $(C,"tunnels"),_.getTunnels()},onDidChangeTunnels:(m,b,I)=>($(C,"tunnels"),ge(_.onDidChangeTunnels)(m,b,I)),registerPortAttributesProvider:(m,b)=>($(C,"portsAttributes"),_.registerPortsAttributesProvider(m,b)),registerTunnelProvider:(m,b)=>($(C,"tunnelFactory"),_.registerTunnelProvider(m,b)),registerTimelineProvider:(m,b)=>($(C,"timeline"),A_.registerTimelineProvider(m,b,C.identifier,Ce.converter)),get isTrusted(){return r.trusted},requestWorkspaceTrust:m=>($(C,"workspaceTrust"),r.requestWorkspaceTrust(m)),onDidGrantWorkspaceTrust:(m,b,I)=>ge(r.onDidGrantWorkspaceTrust)(m,b,I),registerEditSessionIdentityProvider:(m,b)=>($(C,"editSessionIdentityProvider"),r.registerEditSessionIdentityProvider(m,b)),onWillCreateEditSessionIdentity:(m,b,I)=>($(C,"editSessionIdentityProvider"),ge(r.getOnWillCreateEditSessionIdentityEvent(C))(m,b,I)),registerCanonicalUriProvider:(m,b)=>($(C,"canonicalUriProvider"),r.registerCanonicalUriProvider(m,b)),getCanonicalUri:(m,b,I)=>($(C,"canonicalUriProvider"),r.provideCanonicalUri(m,b,I)),decode(m,b){return r.decode(m,b)},encode(m,b){return r.encode(m,b)}},z_={get inputBox(){return w.report("scm.inputBox",C,"Use 'SourceControl.inputBox' instead"),hf.getLastInputBox(C)},createSourceControl(m,b,I){return hf.createSourceControl(C,m,b,I)}},q_={createCommentController(m,b){return Hr.createCommentController(C,m,b)}},j_={get activeDebugSession(){return q.activeDebugSession},get activeDebugConsole(){return q.activeDebugConsole},get breakpoints(){return q.breakpoints},get activeStackItem(){return q.activeStackItem},registerDebugVisualizationProvider(m,b){return $(C,"debugVisualization"),q.registerDebugVisualizationProvider(C,m,b)},registerDebugVisualizationTreeProvider(m,b){return $(C,"debugVisualization"),q.registerDebugVisualizationTree(C,m,b)},onDidStartDebugSession(m,b,I){return ge(q.onDidStartDebugSession)(m,b,I)},onDidTerminateDebugSession(m,b,I){return ge(q.onDidTerminateDebugSession)(m,b,I)},onDidChangeActiveDebugSession(m,b,I){return ge(q.onDidChangeActiveDebugSession)(m,b,I)},onDidReceiveDebugSessionCustomEvent(m,b,I){return ge(q.onDidReceiveDebugSessionCustomEvent)(m,b,I)},onDidChangeBreakpoints(m,b,I){return ge(q.onDidChangeBreakpoints)(m,b,I)},onDidChangeActiveStackItem(m,b,I){return ge(q.onDidChangeActiveStackItem)(m,b,I)},registerDebugConfigurationProvider(m,b,I){return q.registerDebugConfigurationProvider(m,b,I||dg.Initial)},registerDebugAdapterDescriptorFactory(m,b){return q.registerDebugAdapterDescriptorFactory(C,m,b)},registerDebugAdapterTrackerFactory(m,b){return q.registerDebugAdapterTrackerFactory(m,b)},startDebugging(m,b,I){return!I||typeof I=="object"&&"configuration"in I?q.startDebugging(m,b,{parentSession:I}):q.startDebugging(m,b,I||{})},stopDebugging(m){return q.stopDebugging(m)},addBreakpoints(m){return q.addBreakpoints(m)},removeBreakpoints(m){return q.removeBreakpoints(m)},asDebugSourceUri(m,b){return q.asDebugSourceUri(m,b)}},k={registerTaskProvider:(m,b)=>Y.registerTaskProvider(C,m,b),fetchTasks:m=>Y.fetchTasks(m),executeTask:m=>Y.executeTask(C,m),get taskExecutions(){return Y.taskExecutions},onDidStartTask:(m,b,I)=>ge(Y.onDidStartTask)(m,b,I),onDidEndTask:(m,b,I)=>ge(Y.onDidEndTask)(m,b,I),onDidStartTaskProcess:(m,b,I)=>ge(Y.onDidStartTaskProcess)(m,b,I),onDidEndTaskProcess:(m,b,I)=>ge(Y.onDidEndTaskProcess)(m,b,I),onDidStartTaskProblemMatchers:(m,b,I)=>($(C,"taskProblemMatcherStatus"),ge(Y.onDidStartTaskProblemMatchers)(m,b,I)),onDidEndTaskProblemMatchers:(m,b,I)=>($(C,"taskProblemMatcherStatus"),ge(Y.onDidEndTaskProblemMatchers)(m,b,I))},M={createNotebookController(m,b,I,fe,ze){return Xn.createNotebookController(C,m,b,I,fe,dt(C,"notebookMessaging")?ze:void 0)},registerNotebookCellStatusBarItemProvider:(m,b)=>Ke.registerNotebookCellStatusBarItemProvider(C,m,b),createRendererMessaging(m){return Dn.createRendererMessaging(C,m)},createNotebookControllerDetectionTask(m){return $(C,"notebookKernelSource"),Xn.createNotebookControllerDetectionTask(C,m)},registerKernelSourceActionProvider(m,b){return $(C,"notebookKernelSource"),Xn.registerKernelSourceActionProvider(C,m,b)}},H={t(...m){if(typeof m[0]=="string"){const b=m.shift(),I=!m||typeof m[0]!="object"?m:m[0];return Le.getMessage(C.identifier.value,{message:b,args:I})}return Le.getMessage(C.identifier.value,m[0])},get bundle(){return Le.getBundle(C.identifier.value)},get uri(){return Le.getBundleUri(C.identifier.value)}},oe={transferActiveChat(m){return $(C,"interactive"),ms.transferActiveChat(m)}},X={getRelatedInformation(m,b){return $(C,"aiRelatedInformation"),bu.getRelatedInformation(C,m,b)},registerRelatedInformationProvider(m,b){return $(C,"aiRelatedInformation"),bu.registerRelatedInformationProvider(C,m,b)},registerEmbeddingVectorProvider(m,b){return $(C,"aiRelatedInformation"),yu.registerEmbeddingVectorProvider(C,m,b)},registerSettingsSearchProvider(m){return $(C,"aiSettingsSearch"),xu.registerSettingsSearchProvider(C,m)}},De={registerMappedEditsProvider(m,b){return $(C,"mappedEditsProvider"),{dispose(){}}},registerMappedEditsProvider2(m){return $(C,"mappedEditsProvider"),Qs.registerMappedEditsProvider(C,m)},createChatParticipant(m,b){return ms.createChatAgent(C,m,b)},createDynamicChatParticipant(m,b,I){return $(C,"chatParticipantPrivate"),ms.createDynamicChatAgent(C,m,b,I)},registerChatParticipantDetectionProvider(m){return $(C,"chatParticipantPrivate"),ms.registerChatParticipantDetectionProvider(C,m)},registerRelatedFilesProvider(m,b){return $(C,"chatEditing"),ms.registerRelatedFilesProvider(C,m,b)},onDidDisposeChatSession:(m,b,I)=>($(C,"chatParticipantPrivate"),ge(ms.onDidDisposeChatSession)(m,b,I))},He={selectChatModels:m=>Q.selectLanguageModels(C,m??{}),onDidChangeChatModels:(m,b,I)=>Q.onDidChangeProviders(m,b,I),registerChatModelProvider:(m,b,I)=>($(C,"chatProvider"),Q.registerLanguageModel(C,m,b,I)),get embeddingModels(){return $(C,"embeddings"),Bi.embeddingsModels},onDidChangeEmbeddingModels:(m,b,I)=>($(C,"embeddings"),Bi.onDidChange(m,b,I)),registerEmbeddingsProvider(m,b){return $(C,"embeddings"),Bi.registerEmbeddingsProvider(C,m,b)},async computeEmbeddings(m,b,I){return $(C,"embeddings"),Bi.computeEmbeddings(m,b,I)},registerTool(m,b){return Xs.registerTool(C,m,b)},invokeTool(m,b,I){return Xs.invokeTool(C,m,b,I)},get tools(){return Xs.getTools(C)},fileIsIgnored(m,b){return Q.fileIsIgnored(C,m,b)},registerIgnoredFileProvider(m){return Q.registerIgnoredFileProvider(C,m)},registerMcpServerDefinitionProvider(m,b){return ne.registerMcpConfigurationProvider(C,m,b)}},Qe={registerSpeechProvider(m,b){return $(C,"speech"),ai.registerProvider(C.identifier,m,b)}};return{version:e.version,ai:X,authentication:U_,commands:$_,comments:q_,chat:De,debug:j_,env:hl,extensions:B_,interactive:oe,l10n:H,languages:W_,lm:He,notebooks:M,scm:z_,speech:Qe,tasks:k,tests:H_,window:V_,workspace:pl,Breakpoint:jc,TerminalOutputAnchor:Mw,ChatResultFeedbackKind:wh,ChatVariableLevel:Sb,ChatCompletionItem:A3,ChatReferenceDiagnostic:dP,CallHierarchyIncomingCall:BT,CallHierarchyItem:Yx,CallHierarchyOutgoingCall:WT,CancellationError:Ai,CancellationTokenSource:Nt,CandidatePortSource:Bv,CodeAction:Zd,CodeActionKind:At,CodeActionTriggerKind:Yd,CodeLens:Pg,Color:Vc,ColorInformation:Fg,ColorPresentation:Mg,ColorThemeKind:oo,CommentMode:ab,CommentState:lb,CommentThreadCollapsibleState:dh,CommentThreadState:hh,CommentThreadApplicability:fh,CommentThreadFocus:ph,CompletionItem:Lg,CompletionItemKind:Ie,CompletionItemTag:th,CompletionList:Hc,CompletionTriggerKind:rc,ConfigurationTarget:cc,CustomExecution:Zx,DebugAdapterExecutable:Vg,DebugAdapterInlineImplementation:lh,DebugAdapterNamedPipeServer:zg,DebugAdapterServer:ah,DebugConfigurationProviderTriggerKind:dg,DebugConsoleMode:Qg,DebugVisualization:S3,DecorationRangeBehavior:la,Diagnostic:kg,DiagnosticRelatedInformation:Gd,DiagnosticSeverity:Pn,DiagnosticTag:oa,Disposable:je,DocumentHighlight:Cg,DocumentHighlightKind:Kd,MultiDocumentHighlight:Tg,DocumentLink:Og,DocumentSymbol:Xd,EndOfLine:os,EnvironmentVariableMutatorType:ic,EvaluatableExpression:qg,InlineValueText:jg,InlineValueVariableLookup:Gg,InlineValueEvaluatableExpression:Kg,InlineCompletionTriggerKind:ch,EventEmitter:N,ExtensionKind:Sa,ExtensionMode:fc,ExternalUriOpenerPriority:wb,FileChangeType:dc,FileDecoration:db,FileDecoration2:db,FileSystemError:cn,FileType:va,FilePermission:Oc,FoldingRange:ob,FoldingRangeKind:gr,FunctionBreakpoint:ua,InlineCompletionItem:zw,InlineCompletionList:qw,Hover:Dg,VerboseHover:Ig,HoverVerbosityAction:Uw,IndentAction:T0,Location:Ni,MarkdownString:mi,OverviewRulerLane:lw,ParameterInformation:$w,PortAutoForwardAction:yb,Position:qe,ProcessExecution:zc,ProgressLocation:wo,QuickInputButtonLocation:ub,QuickInputButtons:gh,Range:Me,RelativePattern:uc,Selection:Nr,SelectionRange:eh,SemanticTokens:Gc,SemanticTokensBuilder:eE,SemanticTokensEdit:GT,SemanticTokensEdits:sp,SemanticTokensLegend:cb,ShellExecution:Qa,ShellQuoting:eb,SignatureHelp:Bw,SignatureHelpTriggerKind:Ww,SignatureInformation:Hw,SnippetString:Ka,SourceBreakpoint:ca,StandardTokenType:ho,StatusBarAlignment:uo,SymbolInformation:Jd,SymbolKind:_t,SymbolTag:Qd,Task:Ug,TaskEventKind:Yw,TaskGroup:rh,TaskPanelKind:Zw,TaskRevealKind:Xw,TaskScope:Do,TerminalLink:h3,TerminalQuickFixTerminalCommand:p3,TerminalQuickFixOpener:f3,TerminalLocation:Qw,TerminalProfile:g3,TerminalExitReason:Gw,TerminalShellExecutionCommandLineConfidence:sh,TerminalCompletionItem:m3,TerminalCompletionItemKind:Jw,TerminalCompletionList:_3,TerminalShellType:Kw,TextDocumentSaveReason:ac,TextEdit:ko,SnippetTextEdit:xa,TextEditorCursorStyle:ns,TextEditorChangeKind:lc,TextEditorLineNumbersStyle:Xi,TextEditorRevealType:Ng,TextEditorSelectionChangeKind:Bc,SyntaxTokenType:Wc,TextDocumentChangeReason:ih,ThemeColor:oh,ThemeIcon:Kn,TreeItem:$g,TreeItemCheckboxState:Is,TreeItemCollapsibleState:Ea,TypeHierarchyItem:tE,UIKind:Td,Uri:x,ViewColumn:nh,WorkspaceEdit:Ga,DocumentPasteTriggerKind:ib,DocumentDropEdit:nb,DocumentDropOrPasteEditKind:js,DocumentPasteEdit:b3,InlayHint:Rg,InlayHintLabelPart:Ag,InlayHintKind:Vw,RemoteAuthorityResolverError:Ds,ResolvedAuthority:u3,ManagedResolvedAuthority:ip,SourceControlInputBoxValidationType:jw,ExtensionRuntime:tm,TimelineItem:_b,NotebookRange:as,NotebookCellKind:da,NotebookCellExecutionState:gb,NotebookCellData:c_,NotebookData:KT,NotebookRendererScript:JT,NotebookCellStatusBarAlignment:Yg,NotebookEditorRevealType:Zg,NotebookCellOutput:Xg,NotebookCellOutputItem:QT,CellErrorStackFrame:k3,NotebookCellStatusBarItem:D3,NotebookControllerAffinity:mb,NotebookControllerAffinity2:em,NotebookEdit:Sg,NotebookKernelSourceAction:I3,NotebookVariablesRequestKind:_h,PortAttributes:T3,LinkedEditingRanges:C3,TestResultState:vb,TestRunRequest:nm,TestMessage:im,TestMessageStackFrame:P3,TestTag:vh,TestRunProfileKind:pc,TextSearchCompleteMessageType:Vm,DataTransfer:qc,DataTransferItem:Hg,TestCoverageCount:rp,FileCoverage:Kc,StatementCoverage:YT,BranchCoverage:ZT,DeclarationCoverage:eP,WorkspaceTrustState:bb,LanguageStatusSeverity:sc,QuickPickItemKind:mh,InputBoxValidationSeverity:hc,TabInputText:nE,TabInputTextDiff:sm,TabInputTextMerge:tP,TabInputCustom:iE,TabInputNotebook:sE,TabInputNotebookDiff:rE,TabInputWebview:nP,TabInputTerminal:iP,TabInputInteractiveWindow:sP,TabInputChat:rP,TabInputTextMultiDiff:oP,TelemetryTrustedValue:Kx,LogLevel:Be,EditSessionIdentityMatch:P0,InteractiveSessionVoteDirection:xb,ChatCopyKind:Eb,ChatEditingSessionActionOutcome:ha,InteractiveEditorResponseFeedbackKind:Db,DebugStackFrame:qT,DebugThread:jT,RelatedInformationType:Nb,SpeechToTextStatus:Fb,TextToSpeechStatus:Mb,PartialAcceptTriggerKind:aa,InlineCompletionEndOfLifeReasonKind:oc,KeywordRecognitionStatus:Ub,ChatImageMimeType:br,ChatResponseMarkdownPart:u_,ChatResponseFileTreePart:d_,ChatResponseAnchorPart:yh,ChatResponseProgressPart:oE,ChatResponseProgressPart2:ap,ChatResponseReferencePart:ka,ChatResponseReferencePart2:ka,ChatResponseCodeCitationPart:om,ChatResponseCodeblockUriPart:f_,ChatResponseWarningPart:xh,ChatResponseTextEditPart:Eh,ChatResponseNotebookEditPart:am,ChatResponseMarkdownWithVulnerabilitiesPart:bh,ChatResponseCommandButtonPart:h_,ChatResponseConfirmationPart:rm,ChatResponseMovePart:p_,ChatResponseExtensionsPart:aE,ChatPrepareToolInvocationPart:Sh,ChatResponseReferencePartStatusKind:Cb,ChatRequestTurn:Ib,ChatRequestTurn2:Ib,ChatResponseTurn:aP,ChatLocation:Yi,ChatRequestEditorData:lP,ChatRequestNotebookData:cP,ChatReferenceBinaryData:uP,ChatRequestEditedFileEventKind:kb,LanguageModelChatMessageRole:fi,LanguageModelChatMessage:hP,LanguageModelChatMessage2:fP,LanguageModelToolResultPart:lm,LanguageModelToolResultPart2:Tb,LanguageModelTextPart:zt,LanguageModelToolCallPart:Ja,LanguageModelError:yn,LanguageModelToolResult:g_,LanguageModelToolResult2:pP,LanguageModelDataPart:Ci,ExtendedLanguageModelToolResult:L3,PreparedTerminalToolInvocation:R3,LanguageModelChatToolMode:Lb,LanguageModelPromptTsxPart:Gs,NewSymbolName:x3,NewSymbolNameTag:rb,NewSymbolNameTriggerKind:uh,InlineEdit:N3,InlineEditTriggerKind:kh,ExcludeSettingOptions:_r,TextSearchContext2:lE,TextSearchMatch2:fo,AISearchKeyword:yy,TextSearchCompleteMessageTypeNew:Vm,ChatErrorLevel:Pb,McpHttpServerDefinition:F3,McpStdioServerDefinition:O3,SettingsSearchResultKind:Ob}}}var vp;let dx=class{constructor(e,t,i,s,r,o,a){this._apiFactory=e,this._extensionRegistry=t,this._instaService=i,this._extHostConfiguration=s,this._extHostExtensionService=r,this._initData=o,this._logService=a,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),ri("code/extHost/willWaitForConfig");const e=await this._extHostConfiguration.getConfigProvider();ri("code/extHost/didWaitForConfig");const t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new g$(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(hx)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(fx,t,this._initData.environment.appUriScheme))}register(e){if("nodeModuleName"in e)if(Array.isArray(e.nodeModuleName))for(const t of e.nodeModuleName)this._factories.set(t,e);else this._factories.set(e.nodeModuleName,e);typeof e.alternativeModuleName=="function"&&this._alternatives.push(t=>e.alternativeModuleName(t))}};dx=V([L(2,Yh),L(3,Ur),L(4,Ao),L(5,gn),L(6,at)],dx);var Ba;let hx=(Ba=class{constructor(e){if(e.environment.appRoot&&vp.aliased.size){const t=Wa(this.forceForwardSlashes(e.environment.appRoot.fsPath)),i="[a-z0-9_.-]",s=`@${i}+\\/${i}+|${i}+`,r="node_modules|node_modules\\.asar(?:\\.unpacked)?";this.re=new RegExp(`^(${t}/${r}\\/)(${s})(.*)$`,"i")}}alternativeModuleName(e){if(!this.re)return;const t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;const[,i,s,r]=t,o=vp.aliased.get(s);if(o!==void 0)return console.warn(`${s} as been renamed to ${o}, please update your imports`),i+o+r}forceForwardSlashes(e){return e.replace(/\\/g,"/")}},vp=Ba,Ba.aliased=new Map([["vscode-ripgrep","@vscode/ripgrep"],["vscode-windows-registry","@vscode/windows-registry"]]),Ba);hx=vp=V([L(0,gn)],hx);class g${constructor(e,t,i,s,r){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=i,this._configProvider=s,this._logService=r,this.nodeModuleName="vscode",this._extApiImpl=new Lr}load(e,t){const i=this._extensionPaths.findSubstr(t);if(i){let s=this._extApiImpl.get(i.identifier);return s||(s=this._apiFactory(i,this._extensionRegistry,this._configProvider),this._extApiImpl.set(i.identifier,s)),s}if(!this._defaultApiImpl){let s="";this._extensionPaths.forEach((r,o)=>s+=` ${o} -> ${r.identifier.value}
|
|
140
140
|
`),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings:
|
|
141
|
-
${s}`),this._defaultApiImpl=this._apiFactory(H6,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let fx=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(ee.MainThreadTelemetry);const s=i.getProxy(ee.MainThreadWindow);this._impl=(r,o)=>{const a=x.parse(r);return o?this.callOriginal(r,o):a.scheme==="http"||a.scheme==="https"?s.$openUri(a,r,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?s.$openUri(a,r,{}):this.callOriginal(r,o)}}load(e,t,i){const s=this._extensionPaths.findSubstr(t);return s&&(this._extensionId=s.identifier.value,this.sendShimmingTelemetry()),this._original=i(e),this._impl}callOriginal(e,t){return this.sendNoForwardTelemetry(),this._original(e,t)}sendShimmingTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open",{extension:this._extensionId})}sendNoForwardTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open.call.noForward",{extension:this._extensionId})}};fx=V([L(2,nt)],fx);let px=class{constructor(e,t){this._mainThreadConsole=e.getProxy(ee.MainThreadConsole),this._includeStack=t.consoleForward.includeStack,this._logNative=t.consoleForward.logNative,this._wrapConsoleMethod("info","log"),this._wrapConsoleMethod("log","log"),this._wrapConsoleMethod("warn","warn"),this._wrapConsoleMethod("debug","debug"),this._wrapConsoleMethod("error","error")}_wrapConsoleMethod(e,t){const i=this,s=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>function(){i._handleConsoleCall(e,t,s,arguments)}})}_handleConsoleCall(e,t,i,s){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:_$(s,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,s)}};px=V([L(0,nt),L(1,gn)],px);const m$=1e5;function _$(n,e){const t=[];if(n.length)for(let i=0;i<n.length;i++){let s=n[i];if(typeof s>"u")s="undefined";else if(s instanceof Error){const r=s;r.stack?s=r.stack:s=r.toString()}t.push(s)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(`
|
|
141
|
+
${s}`),this._defaultApiImpl=this._apiFactory(H6,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}}let fx=class{constructor(e,t,i){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=["open","opn"],this._mainThreadTelemetry=i.getProxy(ee.MainThreadTelemetry);const s=i.getProxy(ee.MainThreadWindow);this._impl=(r,o)=>{const a=x.parse(r);return o?this.callOriginal(r,o):a.scheme==="http"||a.scheme==="https"?s.$openUri(a,r,{allowTunneling:!0}):a.scheme==="mailto"||a.scheme===this._appUriScheme?s.$openUri(a,r,{}):this.callOriginal(r,o)}}load(e,t,i){const s=this._extensionPaths.findSubstr(t);return s&&(this._extensionId=s.identifier.value,this.sendShimmingTelemetry()),this._original=i(e),this._impl}callOriginal(e,t){return this.sendNoForwardTelemetry(),this._original(e,t)}sendShimmingTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open",{extension:this._extensionId})}sendNoForwardTelemetry(){this._extensionId&&this._mainThreadTelemetry.$publicLog2("shimming.open.call.noForward",{extension:this._extensionId})}};fx=V([L(2,nt)],fx);let px=class{constructor(e,t){this._mainThreadConsole=e.getProxy(ee.MainThreadConsole),this._includeStack=t.consoleForward.includeStack,this._logNative=t.consoleForward.logNative,this._wrapConsoleMethod("info","log"),this._wrapConsoleMethod("log","log"),this._wrapConsoleMethod("warn","warn"),this._wrapConsoleMethod("debug","debug"),this._wrapConsoleMethod("error","error")}_wrapConsoleMethod(e,t){const i=this,s=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>(function(){i._handleConsoleCall(e,t,s,arguments)})})}_handleConsoleCall(e,t,i,s){this._mainThreadConsole.$logExtensionHostMessage({type:"__$console",severity:t,arguments:_$(s,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,i,s)}};px=V([L(0,nt),L(1,gn)],px);const m$=1e5;function _$(n,e){const t=[];if(n.length)for(let i=0;i<n.length;i++){let s=n[i];if(typeof s>"u")s="undefined";else if(s instanceof Error){const r=s;r.stack?s=r.stack:s=r.toString()}t.push(s)}if(e){const i=new Error().stack;i&&t.push({__$stack:i.split(`
|
|
142
142
|
`).slice(3).join(`
|
|
143
143
|
`)})}try{const i=o8(t);return i.length>m$?"Output omitted for a large object that exceeds the limits":i}catch(i){return`Output omitted for an object that cannot be inspected ('${i.toString()}')`}}let gx=class extends px{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,i){t.apply(console,i)}};gx=V([L(0,nt),L(1,gn)],gx);class v$ extends dx{_installInterceptor(){}getModule(e,t){for(const i of this._alternatives){const s=i(e);if(s){e=s;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw new Error("CANNOT LOAD MODULE from here.")})}}class w$ extends e0{constructor(){super(...arguments),this.extensionRuntime=tm.Webworker}async _beforeAlmostReadyToRunExtensions(){Rd&&this._instaService.createInstance(gx),this._apiFactory=this._instaService.invokeFunction(p$),this._fakeModules=this._instaService.createInstance(v$,this._apiFactory,{mine:this._myRegistry,all:this._globalRegistry}),await this._fakeModules.install(),performance.mark("code/extHost/didInitAPI"),await this._waitForDebuggerAttachment()}_getEntryPoint(e){return e.browser}async _loadCommonJSModule(e,t,i){t=t.with({path:b$(t.path,".js")});const s=e?.identifier.value;s&&performance.mark(`code/extHost/willFetchExtensionCode/${s}`);const r=x.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),o=await fetch(r.toString(!0));if(s&&performance.mark(`code/extHost/didFetchExtensionCode/${s}`),o.status!==200)throw new Error(o.statusText);const a=await o.text(),l=`${t.toString(!0)}#vscode-extension`,c=`${a}
|
|
144
144
|
//# sourceURL=${l}`;let u;try{u=new Function("module","exports","require",c)}catch(_){throw console.error(s?`Loading code for extension ${s} failed: ${_.message}`:`Loading code failed: ${_.message}`),console.error(`${t.toString(!0)}${typeof _.line=="number"?` line ${_.line}`:""}${typeof _.column=="number"?` column ${_.column}`:""}`),console.error(_),_}e&&await this._extHostLocalizationService.initializeLocalizedMessages(e);const d={},f={exports:d},p=_=>{const w=this._fakeModules.getModule(_,t);if(w===void 0)throw new Error(`Cannot load module '${_}'`);return w};try{return i.codeLoadingStart(),s&&performance.mark(`code/extHost/willLoadExtensionCode/${s}`),u(f,d,p),f.exports!==d?f.exports:d}finally{s&&performance.mark(`code/extHost/didLoadExtensionCode/${s}`),i.codeLoadingStop()}}_loadESMModule(e,t,i){throw new Error("ESM modules are not supported in the web worker extension host")}async $setRemoteEnvironment(e){}async _waitForDebuggerAttachment(e=5e3){if(!this._initData.environment.isExtensionDevelopmentDebug)return;const t=Date.now()+e;for(;Date.now()<t&&!("__jsDebugIsReady"in globalThis);)await us(10)}}function b$(n,e){return Ip(n)?n:n+e}gt(mE,Ky,ht.Eager);gt(Ao,w$,ht.Eager);gt(fE,Ry,ht.Eager);gt(y_,new ts(Uy,[!0],!0));const v5=self.close.bind(self);self.close=()=>console.trace("'close' has been blocked");const w5=postMessage.bind(self);self.postMessage=()=>console.trace("'postMessage' has been blocked");function $4(n){return/^(file|extension-file|vscode-remote):/i.test(n)}const H4=fetch.bind(self);function y$(n){self.fetch=async function(e,t){return e instanceof Request||$4(String(e))&&(e=(await n(x.parse(String(e)))).toString(!0)),H4(e,t)},self.XMLHttpRequest=class extends XMLHttpRequest{open(e,t,i,s,r){(async()=>($4(t.toString())&&(t=(await n(x.parse(t.toString()))).toString(!0)),super.open(e,t,i??!0,s,r)))()}}}self.importScripts=()=>{throw new Error("'importScripts' has been blocked")};self.addEventListener=()=>console.trace("'addEventListener' has been blocked");self.AMDLoader=void 0;self.NLSLoaderPlugin=void 0;self.define=void 0;self.require=void 0;self.webkitRequestFileSystem=void 0;self.webkitRequestFileSystemSync=void 0;self.webkitResolveLocalFileSystemSyncURL=void 0;self.webkitResolveLocalFileSystemURL=void 0;function x$(n,e){if(self.Worker){const t=self.Worker;Worker=function(i,s){if(/^vscode-remote:/i.test(i.toString()))throw new Error("Creating workers from remote extensions is currently not supported.");async function r(a){const[l,c]=await Promise.all([n(a).then(p=>p.toString(!0)),e().then(p=>Object.fromEntries(p.map(([_,w])=>[_.toString(!0),w.toString(!0)])))]),d=`(${(function(_,w){function v(A){return typeof A=="string"||A instanceof URL?(A=String(A).replace(/^file:\/\//i,"vscode-file://vscode-app"),w[A]??A):A}const E=fetch.bind(self);self.fetch=function(A,G){return A instanceof Request?E(A,G):E(v(A),G)},self.XMLHttpRequest=class extends XMLHttpRequest{constructor(){super(...arguments),this.notFound=!1}open(A,G,W,ce,Q){const ne=v(G);return this.notFound=ne.startsWith("extension-file:"),super.open(A,ne,W??!0,ce,Q)}send(A){this.notFound||super.send(A)}get status(){return this.notFound?404:super.status}};const S=importScripts.bind(self);self.importScripts=(...A)=>{S(...A.map(v))},self.importExt=A=>new Function("url","return import(url)")(v(A)),S(_)}).toString()}('${l}', ${JSON.stringify(c)}))`,f=new Blob([d],{type:"application/javascript"});return URL.createObjectURL(f)}s=s||{},s.name=`${name} -> ${s.name||hi(i.toString())}`;class o{constructor(l,c){this._onmessage=null,this._onmessageerror=null,this._onerror=null,this.workerPromise=r(x.parse(l instanceof URL?l.toString():l)).then(u=>new t(u,c))}set onmessage(l){this._onmessage=l,this.workerPromise.then(c=>{c.onmessage=l},console.error)}get onmessage(){return this._onmessage}set onmessageerror(l){this._onmessageerror=l,this.workerPromise.then(c=>{c.onmessageerror=l},console.error)}get onmessageerror(){return this._onmessageerror}set onerror(l){this._onerror=l,this.workerPromise.then(c=>{c.onerror=l},console.error)}get onerror(){return this._onerror}postMessage(l,c){this.workerPromise.then(u=>{u.postMessage(l,c)},console.error)}terminate(){this.workerPromise.then(l=>{l.terminate()},console.error)}addEventListener(l,c,u){this.workerPromise.then(d=>{d.addEventListener(l,c,u)},console.error)}removeEventListener(l,c,u){this.workerPromise.then(d=>{d.removeEventListener(l,c,u)},console.error)}dispatchEvent(l){return this.workerPromise.then(c=>{c.dispatchEvent(l)},console.error),!1}}return new o(i,s)}}else self.Worker=class extends qO{constructor(t,i){super(w5,t,{name:hi(t.toString()),...i})}}}const E$=new class{constructor(){this.pid=void 0}exit(n){v5()}};class S${constructor(){const e=new MessageChannel,t=new N;let i=!1;w5(e.port2,[e.port2]),e.port1.onmessage=s=>{const{data:r}=s;if(!(r instanceof ArrayBuffer)){console.warn("UNKNOWN data received",r);return}const o=ue.wrap(new Uint8Array(r,0,r.byteLength));if(mA(o,ls.Terminate)){i=!0,b5("received terminate message from renderer");return}t.fire(o)},this.protocol={onMessage:t.event,send:s=>{if(!i){const r=s.buffer.buffer.slice(s.buffer.byteOffset,s.buffer.byteOffset+s.buffer.byteLength);e.port1.postMessage(r,[r])}}}}}function k$(n){return new Promise(e=>{const t=n.onMessage(i=>{t.dispose();const s=JSON.parse(i.toString());n.send(qE(ls.Initialized)),e({protocol:n,initData:s})});n.send(qE(ls.Ready))})}let b5=n=>v5();function D$(n){return!!n&&typeof n=="object"&&n.type==="vscode.init"&&n.data instanceof Map}function I$(){ri("code/extHost/willConnectToRenderer");const n=new S$;return{onmessage(e){D$(e)&&k$(n.protocol).then(t=>{ri("code/extHost/didWaitForInitData");const i=new yE(t.protocol,t.initData,E$,null,e.data);y$(s=>i.asBrowserUri(s)),x$(s=>i.asBrowserUri(s),()=>i.getAllStaticBrowserUris()),b5=s=>i.terminate(s)})}}}const C$=I$();self.onmessage=n=>C$.onmessage(n.data);
|