@dimina-kit/devtools 0.4.0-dev.20260625063832 → 0.4.0-dev.20260629114208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main/app/app.js +2 -0
- package/dist/main/index.bundle.js +230 -144
- package/dist/main/ipc/bridge-router.d.ts +21 -0
- package/dist/main/ipc/bridge-router.js +63 -3
- package/dist/main/services/automation/index.js +0 -1
- package/dist/main/services/elements-forward/index.js +81 -72
- package/dist/main/services/mcp/target-manager.d.ts +3 -3
- package/dist/main/services/views/miniapp-partition.d.ts +18 -8
- package/dist/main/services/views/miniapp-partition.js +34 -13
- package/dist/main/services/views/view-manager.js +59 -36
- package/dist/main/services/workbench-coi-server.d.ts +7 -0
- package/dist/main/services/workbench-coi-server.js +6 -0
- package/dist/main/services/workbench-context.d.ts +4 -2
- package/dist/main/services/workbench-context.js +1 -0
- package/dist/main/services/workspace/op-lock.d.ts +26 -0
- package/dist/main/services/workspace/op-lock.js +23 -0
- package/dist/main/services/workspace/workspace-service.d.ts +7 -0
- package/dist/main/services/workspace/workspace-service.js +197 -103
- package/dist/main/windows/service-host-window/create.d.ts +5 -1
- package/dist/main/windows/service-host-window/create.js +6 -3
- package/dist/native-host/render/render.js +485 -449
- package/dist/native-host/service/service.js +1 -1
- package/dist/renderer/assets/index-BMwmmaSp.js +46 -0
- package/dist/renderer/entries/main/index.html +1 -1
- package/dist/shared/types.d.ts +15 -0
- package/dist/vscode-workbench/assets/__vite-browser-external-B0DTNerG.js +1 -0
- package/dist/vscode-workbench/assets/__vite-browser-external-BuLjVMfN.js +1 -0
- package/dist/vscode-workbench/assets/__vite-browser-external-thkx7I19.js +1 -0
- package/dist/vscode-workbench/assets/{dist-SFZ2HNEz.js → dist-CS7SQP3K.js} +4 -4
- package/dist/vscode-workbench/assets/dist-VSgdjUlW.js +8 -0
- package/dist/vscode-workbench/assets/editor.worker-DmMg51ee.js +41 -0
- package/dist/vscode-workbench/assets/extensionHost.worker-BMpl1cpB.js +207 -0
- package/dist/vscode-workbench/assets/{iconv-lite-umd-izd5l6fa.js → iconv-lite-umd-D3q-1-o6.js} +1 -1
- package/dist/vscode-workbench/assets/{iconv-lite-umd-COfjYshr.js → iconv-lite-umd-Jn9RTrsv.js} +2 -2
- package/dist/vscode-workbench/assets/index-zjigpZ25.js +2842 -0
- package/dist/vscode-workbench/assets/{jschardet-Bf-VMK4F.js → jschardet-CjCVc2Gw.js} +1 -1
- package/dist/vscode-workbench/assets/{jschardet-Dh5TyKsQ.js → jschardet-Cu4ufeHq.js} +1 -1
- package/dist/vscode-workbench/assets/{layout.contribution.darwin-cz2ttHTW.js → layout.contribution.darwin-CoH1BZtz.js} +1 -1
- package/dist/vscode-workbench/assets/{layout.contribution.linux-fEtdzbcY.js → layout.contribution.linux-Di2FF-CG.js} +1 -1
- package/dist/vscode-workbench/assets/{layout.contribution.win-BFyOKI8c.js → layout.contribution.win-moiNStil.js} +1 -1
- package/dist/vscode-workbench/assets/{main-Bh8TI5LP.js → main-DzHL45xo.js} +4 -4
- package/dist/vscode-workbench/assets/{main2-Bds9Fhfn.js → main2-CWVd-Hyp.js} +1 -1
- package/dist/vscode-workbench/assets/{worker-D9ti6A0r.js → worker-CRTb-Arc.js} +7 -7
- package/dist/vscode-workbench/assets/{worker-DQtXDXIZ.js → worker-CVB8WPuM.js} +2 -2
- package/dist/vscode-workbench/index.html +1 -4
- package/package.json +7 -37
- package/dist/renderer/assets/index-6XUSo6Su.js +0 -46
- package/dist/vscode-workbench/assets/__vite-browser-external-BUwiolNy.js +0 -1
- package/dist/vscode-workbench/assets/__vite-browser-external-CmG9GjjO.js +0 -1
- package/dist/vscode-workbench/assets/__vite-browser-external-DGJPTKLg.js +0 -1
- package/dist/vscode-workbench/assets/_commonjsHelpers-qcUHfnrg.js +0 -1
- package/dist/vscode-workbench/assets/chunk-B3K2TuZy.js +0 -1
- package/dist/vscode-workbench/assets/chunk-DECur_0Z.js +0 -1
- package/dist/vscode-workbench/assets/dist-tesJ1Kd2.js +0 -8
- package/dist/vscode-workbench/assets/editor.worker-BC1qOyXG.js +0 -41
- package/dist/vscode-workbench/assets/extension.api-BWA2aPAU.js +0 -1
- package/dist/vscode-workbench/assets/extensionHost.worker-Dvu35anN.js +0 -207
- package/dist/vscode-workbench/assets/index-CQ5xP0pp.js +0 -1656
- package/dist/vscode-workbench/assets/localExtensionHost-Ccz7QUdA.js +0 -1188
- package/dist/vscode-workbench/assets/main-BDgdQmvs.js +0 -4
- package/dist/vscode-workbench/assets/main2-DwfDVleQ.js +0 -1
- package/dist/vscode-workbench/assets/preload-helper-xBbMyY7u.js +0 -1
- /package/dist/vscode-workbench/assets/{_.contribution-C9aS_G-o.js → _.contribution-B46wcGKQ.js} +0 -0
- /package/dist/vscode-workbench/assets/{_commonjsHelpers-BPKu-ps5.js → _commonjsHelpers-DMmVv2OA.js} +0 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Running=1]=`Running`,e[e.Completed=2]=`Completed`})(l||={});var u=class{constructor(e){this.executor=e,this._state=l.Uninitialized}get hasValue(){return this._state===l.Completed}get value(){if(this._state===l.Uninitialized){this._state=l.Running;try{this._value=this.executor()}catch(e){this._error=e}finally{this._state=l.Completed}}else if(this._state===l.Running)throw Error(`Cannot read the value of a lazy that is being initialized`);if(this._error)throw this._error;return this._value}get rawValue(){return this._value}};const d=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?pe.isErrorNoTelemetry(e)?new pe(e.message+`
|
|
2
|
+
|
|
3
|
+
`+e.stack):Error(e.message+`
|
|
4
|
+
|
|
5
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function f(e){d.setUnexpectedErrorHandler(e)}function p(e){d.onUnexpectedError(e)}function m(e){re(e)||d.onUnexpectedError(e)}function ee(e){re(e)||d.onUnexpectedExternalError(e)}function te(e){if(e instanceof Error){let{name:t,message:n,cause:r}=e;return{$isError:!0,name:t,message:n,stack:e.stacktrace||e.stack,noTelemetry:pe.isErrorNoTelemetry(e),cause:r?te(r):void 0,code:e.code}}return e}function ne(e){let t;return e.noTelemetry?t=new pe:(t=Error(),t.name=e.name),t.message=e.message,t.stack=e.stack,e.code&&(t.code=e.code),e.cause&&(t.cause=ne(e.cause)),t}const h=`Canceled`;function re(e){return e instanceof ie?!0:e instanceof Error&&e.name===`Canceled`&&e.message===`Canceled`}var ie=class extends Error{constructor(){super(h),this.name=this.message}},ae=class e extends Error{static{this._name=`PendingMigrationError`}static is(t){return t instanceof e||t instanceof Error&&t.name===e._name}constructor(t){super(t),this.name=e._name}};function oe(){let e=Error(h);return e.name=e.message,e}function se(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}function ce(e){return Error(e?`Illegal state: ${e}`:`Illegal state`)}var le=class extends TypeError{constructor(e){super(e?`${e} is read-only and cannot be changed`:`Cannot change read-only property`)}};function ue(e){return e?e.message?e.message:e.stack?e.stack.split(`
|
|
6
|
+
`)[0]:String(e):`Error`}var de=class extends Error{constructor(e){super(`NotImplemented`),e&&(this.message=e)}},fe=class extends Error{constructor(e){super(`NotSupported`),e&&(this.message=e)}},pe=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},me=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function he(e,t,n=0,r=e.length){let i=n,a=r;for(;i<a;){let n=Math.floor((i+a)/2);t(e[n])?i=n+1:a=n}return i-1}(class e{static{this.assertInvariants=!1}constructor(e){this._array=e,this._findLastMonotonousLastIdx=0}findLastMonotonous(t){if(e.assertInvariants){if(this._prevFindLastPredicate){for(let e of this._array)if(this._prevFindLastPredicate(e)&&!t(e))throw Error(`MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.`)}this._prevFindLastPredicate=t}let n=he(this._array,t,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=n+1,n===-1?void 0:this._array[n]}});function ge(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}function _e(e,t,n){return ve(e.length,r=>n(e[r],t))}function ve(e,t){let n=0,r=e-1;for(;n<=r;){let e=(n+r)/2|0,i=t(e);if(i<0)n=e+1;else if(i>0)r=e-1;else return e}return-(n+1)}function ye(e,t){let n=[],r;for(let i of e.slice(0).sort(t))!r||t(r[0],i)!==0?(r=[i],n.push(r)):r.push(i);return n}function be(e,t,n){let r=[];function i(e,t,n){if(t===0&&n.length===0)return;let i=r[r.length-1];i&&i.start+i.deleteCount===e?(i.deleteCount+=t,i.toInsert.push(...n)):r.push({start:e,deleteCount:t,toInsert:n})}let a=0,o=0;for(;;){if(a===e.length){i(a,0,t.slice(o));break}if(o===t.length){i(a,e.length-a,[]);break}let r=e[a],s=t[o],c=n(r,s);c===0?(a+=1,o+=1):c<0?(i(a,1,[]),a+=1):c>0&&(i(a,0,[s]),o+=1)}return r}function xe(e,t,n){let r=be(e,t,n),i=[],a=[];for(let t of r)i.push(...e.slice(t.start,t.start+t.deleteCount)),a.push(...t.toInsert);return{removed:i,added:a}}function Se(e){return e.filter(e=>!!e)}function Ce(e){let t=0;for(let n=0;n<e.length;n++)e[n]&&(e[t]=e[n],t+=1);e.length=t}function we(e){return!Array.isArray(e)||e.length===0}function Te(e){return Array.isArray(e)&&e.length>0}function Ee(e,t=e=>e){let n=new Set;return e.filter(e=>{let r=t(e);return n.has(r)?!1:(n.add(r),!0)})}function De(e,t){let n;if(typeof t==`number`){let e=t;n=()=>{let t=Math.sin(e++)*179426549;return t-Math.floor(t)}}else n=Math.random;for(let t=e.length-1;t>0;--t){let r=Math.floor(n()*(t+1)),i=e[t];e[t]=e[r],e[r]=i}}function Oe(e,t){return Array.isArray(e)?e.map(t):t(e)}function ke(e){return Array.isArray(e)?e:[e]}var Ae;(function(e){function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Ae||={});function je(e,t){return(n,r)=>t(e(n),e(r))}const Me=(e,t)=>e-t;(class e{static{this.empty=new e(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||Ae.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}});var Ne;function Pe(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}function Fe(e,t){let n=[],r=[];for(let r of e)t.has(r)||n.push(r);for(let n of t)e.has(n)||r.push(n);return{removed:n,added:r}}(class{static{Ne=Symbol.toStringTag}constructor(e,t){this.toKey=t,this._map=new Map,this[Ne]=`SetWithKey`;for(let t of e)this.add(t)}get size(){return this._map.size}add(e){let t=this.toKey(e);return this._map.set(t,e),this}delete(e){return this._map.delete(this.toKey(e))}has(e){return this._map.has(this.toKey(e))}*entries(){for(let e of this._map.values())yield[e,e]}keys(){return this.values()}*values(){for(let e of this._map.values())yield e}clear(){this._map.clear()}forEach(e,t){this._map.forEach(n=>e.call(t,n,n,this))}[Symbol.iterator](){return this.values()}});var Ie,Le,Re;function ze(e,t,n){let r=e.get(t);return r===void 0&&(r=n,e.set(t,r)),r}var Be=class{constructor(e,t){this.uri=e,this.value=t}};function Ve(e){return Array.isArray(e)}var He=class e{static{this.defaultToKey=e=>e.toString()}constructor(t,n){if(this[Ie]=`ResourceMap`,t instanceof e)this.map=new Map(t.map),this.toKey=n??e.defaultToKey;else if(Ve(t)){this.map=new Map,this.toKey=n??e.defaultToKey;for(let[e,n]of t)this.set(e,n)}else this.map=new Map,this.toKey=t??e.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new Be(e,t)),this}get(e){return this.map.get(this.toKey(e))?.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){t!==void 0&&(e=e.bind(t));for(let[t,n]of this.map)e(n.value,n.uri,this)}*values(){for(let e of this.map.values())yield e.value}*keys(){for(let e of this.map.values())yield e.uri}*entries(){for(let e of this.map.values())yield[e.uri,e.value]}*[(Ie=Symbol.toStringTag,Symbol.iterator)](){for(let[,e]of this.map)yield[e.uri,e.value]}},Ue=class{constructor(e,t){this[Le]=`ResourceSet`,!e||typeof e==`function`?this._map=new He(e):(this._map=new He(t),e.forEach(this.add,this))}get size(){return this._map.size}add(e){return this._map.set(e,e),this}clear(){this._map.clear()}delete(e){return this._map.delete(e)}forEach(e,t){this._map.forEach((n,r)=>e.call(t,r,r,this))}has(e){return this._map.has(e)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(Le=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},We;(function(e){e[e.None=0]=`None`,e[e.AsOld=1]=`AsOld`,e[e.AsNew=2]=`AsNew`})(We||={});var Ge=class{constructor(){this[Re]=`LinkedMap`,this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=We.None){let n=this._map.get(e);if(n)return t!==We.None&&this.touch(n,t),n.value}set(e,t,n=We.None){let r=this._map.get(e);if(r)r.value=t,n!==We.None&&this.touch(r,n);else{switch(r={key:e,value:t,next:void 0,previous:void 0},n){case We.None:this.addItemLast(r);break;case We.AsOld:this.addItemFirst(r);break;case We.AsNew:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw Error(`Invalid list`);let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let n=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw Error(`LinkedMap got modified during iteration.`);r=r.next}}keys(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},[Symbol.dispose](){},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:n.key,done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}values(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},[Symbol.dispose](){},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:n.value,done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}entries(){let e=this,t=this._state,n=this._head,r={[Symbol.iterator](){return r},[Symbol.dispose](){},next(){if(e._state!==t)throw Error(`LinkedMap got modified during iteration.`);if(n){let e={value:[n.key,n.value],done:!1};return n=n.next,e}else return{value:void 0,done:!0}}};return r}[(Re=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}trimNew(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._tail,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.previous,n--;this._tail=t,this._size=n,t&&(t.next=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw Error(`Invalid list`);this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw Error(`Invalid list`);this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw Error(`Invalid list`);e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw Error(`Invalid list`);e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,n=e.previous;if(!t||!n)throw Error(`Invalid list`);t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw Error(`Invalid list`);if(!(t!==We.AsOld&&t!==We.AsNew)){if(t===We.AsOld){if(e===this._head)return;let t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===We.AsNew){if(e===this._tail)return;let t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,n)=>{e.push([n,t])}),e}fromJSON(e){this.clear();for(let[t,n]of e)this.set(t,n)}},Ke=class extends Ge{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=We.AsNew){return super.get(e,t)}peek(e){return super.get(e,We.None)}set(e,t){return super.set(e,t,We.AsNew),this}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},qe=class extends Ke{constructor(e,t=1){super(e,t)}trim(e){this.trimOld(e)}set(e,t){return super.set(e,t),this.checkTrim(),this}},Je=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};function Ye(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}function Xe(e,t){if(!e)throw Error(t?`Assertion failed (${t})`:`Assertion Failed`)}function Ze(e,t=`Unreachable`){throw Error(t)}function Qe(e,t=`unexpected state`){if(!e)throw typeof t==`string`?new me(`Assertion Failed: ${t}`):t}function $e(e){e()||(e(),m(new me(`Assertion Failed`)))}function et(e){return typeof e==`string`}function tt(e){return nt(e,et)}function nt(e,t){return Array.isArray(e)&&e.every(t)}function rt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function it(e){return typeof e==`object`&&e instanceof Object.getPrototypeOf(Uint8Array)}function at(e){return typeof e==`number`&&!isNaN(e)}function ot(e){return!!e&&typeof e[Symbol.iterator]==`function`}function st(e){return e===void 0}function ct(e){return!lt(e)}function lt(e){return st(e)||e===null}function ut(e,t){if(!e)throw Error(t?`Unexpected type, expected '${t}'`:`Unexpected type`)}function dt(e){return Qe(e!=null,"Argument is `undefined` or `null`."),e}const ft=Object.prototype.hasOwnProperty;function pt(e){if(!rt(e))return!1;for(let t in e)if(ft.call(e,t))return!1;return!0}function mt(e){return typeof e==`function`}function ht(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)gt(e[r],t[r])}function gt(e,t){if(et(t)){if(typeof e!==t)throw Error(`argument does not match constraint: typeof ${t}`)}else if(mt(t)){try{if(e instanceof t)return}catch{}if(!lt(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`)}}function _t(e,t){for(let n in t)if(!(n in e))return!1;return!0}var vt;(function(e){function t(e){return!!e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e??n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){let n=0;for(let r of e)if(!t(r,n++))return!1;return!0}e.every=d;function f(e,t){for(let n of e)if(t(n))return n}e.find=f;function*p(e,t){for(let n of e)t(n)&&(yield n)}e.filter=p;function*m(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=m;function*ee(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=ee;function*te(...e){for(let t of e)ot(t)?yield*t:yield t}e.concat=te;function ne(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=ne;function h(e){let t=0;for(let n of e)t++;return t}e.length=h;function*re(e,t,n=e.length){for(t<-e.length&&(t=0),t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=re;function ie(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=ie;async function ae(e){let t=[];for await(let n of e)t.push(n);return t}e.asyncToArray=ae;async function oe(e){let t=[];for await(let n of e)t=t.concat(n);return t}e.asyncToArrayFlat=oe})(vt||={}),class e{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(t){let n=this.livingDisposables.get(t);return n||(n={parent:null,source:null,isSingleton:!1,value:t,idx:e.idx++},this.livingDisposables.set(t,n)),n}trackDisposable(e){let t=this.getDisposableData(e);t.source||=Error().stack}setParent(e,t){let n=this.getDisposableData(e);n.parent=t}markAsDisposed(e){this.livingDisposables.delete(e)}markAsSingleton(e){this.getDisposableData(e).isSingleton=!0}getRootParent(e,t){let n=t.get(e);if(n)return n;let r=e.parent?this.getRootParent(this.getDisposableData(e.parent),t):e;return t.set(e,r),r}getTrackedDisposables(){let e=new Map;return[...this.livingDisposables.entries()].filter(([,t])=>t.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(`
|
|
7
|
+
`).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new Je;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(`
|
|
8
|
+
`),e)}n.sort(je(e=>e.idx,Me));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;t<e.length;t++){let a=e[t];a=`(shared with ${i.get(e.slice(0,t+1).join(`
|
|
9
|
+
`)).size}/${n.length} leaks) at ${a}`;let o=Pe([...i.get(e.slice(0,t).join(`
|
|
10
|
+
`))].map(e=>r(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))t&&s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=`\n\n\n==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ====================\n${s.join(`
|
|
11
|
+
`)}\n============================================================\n\n`}return n.length>e&&(a+=`\n\n\n... and ${n.length-e} more leaking disposables\n\n`),{leaks:n,details:a}}};function yt(e){return e}function bt(e){return typeof e==`object`&&!!e&&typeof e.dispose==`function`&&e.dispose.length===0}function xt(e){if(vt.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function St(...e){return g(()=>xt(e))}var Ct=class{constructor(e){this._isDisposed=!1,this._fn=e}dispose(){if(!this._isDisposed){if(!this._fn)throw Error(`Unbound disposable context: Need to use an arrow function to preserve the value of this`);this._isDisposed=!0,this._fn()}}};function g(e){return new Ct(e)}var _=class e{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{xt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t||t===v.None)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.delete(e)}assertNotDisposed(){this._isDisposed&&m(new me(`Object disposed`))}},v=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this._store=new _,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}},wt=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Tt=class{constructor(e=new Map){this._isDisposed=!1,this._store=e}dispose(){this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{xt(this._store.values())}finally{this._store.clear()}}has(e){return this._store.has(e)}get size(){return this._store.size}get(e){return this._store.get(e)}set(e,t,n=!1){this._isDisposed&&console.warn(Error(`Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!`).stack),n||this._store.get(e)?.dispose(),this._store.set(e,t)}deleteAndDispose(e){this._store.get(e)?.dispose(),this._store.delete(e)}deleteAndLeak(e){let t=this._store.get(e);return this._store.delete(e),t}keys(){return this._store.keys()}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}},Et=class extends Tt{constructor(){super(new He)}};function Dt(e,t){return new Ot(e,t)}var Ot=class{constructor(e,t){this.reducer=e,this.options=t,this.state={flowing:!1,ended:!1,destroyed:!1},this.buffer={data:[],error:[]},this.listeners={data:[],error:[],end:[]},this.pendingWritePromises=[]}pause(){this.state.destroyed||(this.state.flowing=!1)}resume(){this.state.destroyed||this.state.flowing||(this.state.flowing=!0,this.flowData(),this.flowErrors(),this.flowEnd())}write(e){if(!this.state.destroyed){if(this.state.flowing)this.emitData(e);else if(this.buffer.data.push(e),typeof this.options?.highWaterMark==`number`&&this.buffer.data.length>this.options.highWaterMark)return new Promise(e=>this.pendingWritePromises.push(e))}}error(e){this.state.destroyed||(this.state.flowing?this.emitError(e):this.buffer.error.push(e))}end(e){this.state.destroyed||(e!==void 0&&this.write(e),this.state.flowing?(this.emitEnd(),this.destroy()):this.state.ended=!0)}emitData(e){this.listeners.data.slice(0).forEach(t=>t(e))}emitError(e){this.listeners.error.length===0?m(e):this.listeners.error.slice(0).forEach(t=>t(e))}emitEnd(){this.listeners.end.slice(0).forEach(e=>e())}on(e,t){if(!this.state.destroyed)switch(e){case`data`:this.listeners.data.push(t),this.resume();break;case`end`:this.listeners.end.push(t),this.state.flowing&&this.flowEnd()&&this.destroy();break;case`error`:this.listeners.error.push(t),this.state.flowing&&this.flowErrors();break}}removeListener(e,t){if(this.state.destroyed)return;let n;switch(e){case`data`:n=this.listeners.data;break;case`end`:n=this.listeners.end;break;case`error`:n=this.listeners.error;break}if(n){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}flowData(){if(this.buffer.data.length===0)return;if(typeof this.reducer==`function`){let e=this.reducer(this.buffer.data);this.emitData(e)}else for(let e of this.buffer.data)this.emitData(e);this.buffer.data.length=0;let e=[...this.pendingWritePromises];this.pendingWritePromises.length=0,e.forEach(e=>e())}flowErrors(){if(this.listeners.error.length>0){for(let e of this.buffer.error)this.emitError(e);this.buffer.error.length=0}}flowEnd(){return this.state.ended?(this.emitEnd(),this.listeners.end.length>0):!1}destroy(){this.state.destroyed||(this.state.destroyed=!0,this.state.ended=!0,this.buffer.data.length=0,this.buffer.error.length=0,this.listeners.data.length=0,this.listeners.error.length=0,this.listeners.end.length=0,this.pendingWritePromises.length=0)}};function kt(e,t){let n=[],r;for(;(r=e.read())!==null;)n.push(r);return t(n)}function At(e,t){return new Promise((n,r)=>{let i=[];jt(e,{onData:e=>{t&&i.push(e)},onError:e=>{t?r(e):n(void 0)},onEnd:()=>{n(t?t(i):void 0)}})})}function jt(e,t,n){e.on(`error`,e=>{n?.isCancellationRequested||t.onError(e)}),e.on(`end`,()=>{n?.isCancellationRequested||t.onEnd()}),e.on(`data`,e=>{n?.isCancellationRequested||t.onData(e)})}function Mt(e,t){let n=Dt(t);return n.end(e),n}const Nt=typeof Buffer<`u`,Pt=new u(()=>new Uint8Array(256));let Ft,It;var y=class e{static alloc(t){return Nt?new e(Buffer.allocUnsafe(t)):new e(new Uint8Array(t))}static wrap(t){return Nt&&!Buffer.isBuffer(t)&&(t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)),new e(t)}static fromString(t,n){return!n?.dontUseNodeBuffer&&Nt?new e(Buffer.from(t)):(Ft||=new TextEncoder,new e(Ft.encode(t)))}static fromByteArray(t){let n=e.alloc(t.length);for(let e=0,r=t.length;e<r;e++)n.buffer[e]=t[e];return n}static concat(t,n){if(n===void 0){n=0;for(let e=0,r=t.length;e<r;e++)n+=t[e].byteLength}let r=e.alloc(n),i=0;for(let e=0,n=t.length;e<n;e++){let n=t[e];r.set(n,i),i+=n.byteLength}return r}static isNativeBuffer(e){return Nt&&Buffer.isBuffer(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}clone(){let t=e.alloc(this.byteLength);return t.set(this),t}toString(){return Nt?this.buffer.toString():(It||=new TextDecoder(void 0,{ignoreBOM:!0}),It.decode(this.buffer))}slice(t,n){return new e(this.buffer.subarray(t,n))}set(t,n){if(t instanceof e)this.buffer.set(t.buffer,n);else if(t instanceof Uint8Array)this.buffer.set(t,n);else if(t instanceof ArrayBuffer)this.buffer.set(new Uint8Array(t),n);else if(ArrayBuffer.isView(t))this.buffer.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n);else throw Error(`Unknown argument 'array'`)}readUInt32BE(e){return Bt(this.buffer,e)}writeUInt32BE(e,t){Vt(this.buffer,e,t)}readUInt32LE(e){return Ht(this.buffer,e)}writeUInt32LE(e,t){Ut(this.buffer,e,t)}readUInt8(e){return Wt(this.buffer,e)}writeUInt8(e,t){Gt(this.buffer,e,t)}indexOf(t,n=0){return Lt(this.buffer,t instanceof e?t.buffer:t,n)}equals(e){return this===e?!0:this.byteLength===e.byteLength?this.buffer.every((t,n)=>t===e.buffer[n]):!1}};function Lt(e,t,n=0){let r=t.byteLength,i=e.byteLength;if(r===0)return 0;if(r===1)return e.indexOf(t[0],n);if(r>i-n)return-1;let a=Pt.value;a.fill(t.length);for(let e=0;e<t.length;e++)a[t[e]]=t.length-e-1;let o=n+t.length-1,s=o,c=-1;for(;o<i;)if(e[o]===t[s]){if(s===0){c=o;break}o--,s--}else o+=Math.max(t.length-s,a[e[o]]),s=t.length-1;return c}function Rt(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0}function zt(e,t,n){e[n+0]=t&255,t>>>=8,e[n+1]=t&255}function Bt(e,t){return e[t]*2**24+e[t+1]*2**16+e[t+2]*2**8+e[t+3]}function Vt(e,t,n){e[n+3]=t,t>>>=8,e[n+2]=t,t>>>=8,e[n+1]=t,t>>>=8,e[n]=t}function Ht(e,t){return e[t+0]<<0>>>0|e[t+1]<<8>>>0|e[t+2]<<16>>>0|e[t+3]<<24>>>0}function Ut(e,t,n){e[n+0]=t&255,t>>>=8,e[n+1]=t&255,t>>>=8,e[n+2]=t&255,t>>>=8,e[n+3]=t&255}function Wt(e,t){return e[t]}function Gt(e,t,n){e[n]=t}function Kt(e){return kt(e,e=>y.concat(e))}function qt(e){return At(e,e=>y.concat(e))}function Jt(e){return Mt(e,e=>y.concat(e))}function Yt(e){let t=0,n=0,r=0,i=new Uint8Array(Math.floor(e.length/4*3)),a=e=>{switch(n){case 3:i[r++]=t|e,n=0;break;case 2:i[r++]=t|e>>>2,t=e<<6,n=3;break;case 1:i[r++]=t|e>>>4,t=e<<4,n=2;break;default:t=e<<2,n=1}};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=65&&n<=90)a(n-65);else if(n>=97&&n<=122)a(n-97+26);else if(n>=48&&n<=57)a(n-48+52);else if(n===43||n===45)a(62);else if(n===47||n===95)a(63);else if(n===61)break;else throw SyntaxError(`Unexpected base64 character ${e[t]}`)}let o=r;for(;n>0;)a(0);return y.wrap(i).slice(0,o)}function Xt({buffer:e},t=!0,n=!1){let r=n?`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_`:`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,i=``,a=e.byteLength%3,o=0;for(;o<e.byteLength-a;o+=3){let t=e[o+0],n=e[o+1],a=e[o+2];i+=r[t>>>2],i+=r[(t<<4|n>>>4)&63],i+=r[(n<<2|a>>>6)&63],i+=r[a&63]}if(a===1){let n=e[o+0];i+=r[n>>>2],i+=r[n<<4&63],t&&(i+=`==`)}else if(a===2){let n=e[o+0],a=e[o+1];i+=r[n>>>2],i+=r[(n<<4|a>>>4)&63],i+=r[a<<2&63],t&&(i+=`=`)}return i}const Zt=`0123456789abcdef`;function Qt({buffer:e}){let t=``;for(let n=0;n<e.length;n++){let r=e[n];t+=Zt[r>>>4],t+=Zt[r&15]}return t}function $t(e){if(e.length%2!=0)throw SyntaxError(`Hex string must have an even length`);let t=new Uint8Array(e.length>>1);for(let n=0;n<e.length;)t[n>>1]=en(e,n++)<<4|en(e,n++);return y.wrap(t)}function en(e,t){let n=e.charCodeAt(t);if(n>=48&&n<=57)return n-48;if(n>=97&&n<=102)return n-87;if(n>=65&&n<=70)return n-55;throw SyntaxError(`Invalid hex character at position ${t}`)}var tn=class e{static{this.Undefined=new e(void 0)}constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}},nn=class{constructor(){this._first=tn.Undefined,this._last=tn.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===tn.Undefined}clear(){let e=this._first;for(;e!==tn.Undefined;){let t=e.next;e.prev=tn.Undefined,e.next=tn.Undefined,e=t}this._first=tn.Undefined,this._last=tn.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new tn(e);if(this._first===tn.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==tn.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==tn.Undefined){let e=this._last.element;return this._remove(this._last),e}}peek(){if(this._last!==tn.Undefined)return this._last.element}_remove(e){if(e.prev!==tn.Undefined&&e.next!==tn.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===tn.Undefined&&e.next===tn.Undefined?(this._first=tn.Undefined,this._last=tn.Undefined):e.next===tn.Undefined?(this._last=this._last.prev,this._last.next=tn.Undefined):e.prev===tn.Undefined&&(this._first=this._first.next,this._first.prev=tn.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==tn.Undefined;)yield e.element,e=e.next}};function rn(){return globalThis._VSCODE_NLS_MESSAGES}function an(){return globalThis._VSCODE_NLS_LANGUAGE}const on=an()===`pseudo`||typeof document<`u`&&document.location&&typeof document.location.hash==`string`&&document.location.hash.indexOf(`pseudo=true`)>=0;function sn(e,t){let n;return n=t.length===0?e:e.replace(/\{(\d+)\}/g,(e,n)=>{let r=t[n[0]],i=e;return typeof r==`string`?i=r:(typeof r==`number`||typeof r==`boolean`||r==null)&&(i=String(r)),i}),on&&(n=`[`+n.replace(/[aouei]/g,`$&$&`)+`]`),n}function b(e,t,...n){return sn(typeof e==`number`?cn(e,t):t,n)}function cn(e,t){let n=rn()?.[e];if(typeof n!=`string`){if(typeof t==`string`)return t;throw Error(`!!! NLS MISSING: ${e} !!!`)}return n}function ln(e,t,...n){let r;r=typeof e==`number`?cn(e,t):t;let i=sn(r,n);return{value:i,original:t===r?i:sn(t,n)}}let un=!1,dn=!1,fn=!1,pn=!1,mn=!1,hn=!1,gn=!1,_n=!1,vn=`en`,yn;const bn=globalThis;let xn;bn.vscode!==void 0&&bn.vscode.process!==void 0?xn=bn.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(xn=process);const Sn=typeof xn?.versions?.electron==`string`&&xn?.type===`renderer`;if(typeof xn==`object`){un=xn.platform===`win32`,dn=xn.platform===`darwin`,fn=xn.platform===`linux`,fn&&xn.env.SNAP&&xn.env.SNAP_REVISION,gn=!!xn.env.CI||!!xn.env.BUILD_ARTIFACTSTAGINGDIRECTORY||!!xn.env.GITHUB_WORKSPACE,vn=`en`;let e=xn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,vn=t.resolvedLanguage||`en`,t.languagePack?.translationsConfigFile}catch{}pn=!0}else typeof navigator==`object`&&!Sn?(yn=navigator.userAgent,un=yn.indexOf(`Windows`)>=0,dn=yn.indexOf(`Macintosh`)>=0,hn=(yn.indexOf(`Macintosh`)>=0||yn.indexOf(`iPad`)>=0||yn.indexOf(`iPhone`)>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,fn=yn.indexOf(`Linux`)>=0,_n=yn?.indexOf(`Mobi`)>=0,mn=!0,vn=an()||`en`,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var Cn;(function(e){e[e.Web=0]=`Web`,e[e.Mac=1]=`Mac`,e[e.Linux=2]=`Linux`,e[e.Windows=3]=`Windows`})(Cn||={});function wn(e){switch(e){case Cn.Web:return`Web`;case Cn.Mac:return`Mac`;case Cn.Linux:return`Linux`;case Cn.Windows:return`Windows`}}Cn.Web,dn?Cn.Mac:un?Cn.Windows:fn&&Cn.Linux;const Tn=un,En=dn,Dn=fn,On=pn,kn=mn,An=mn&&typeof bn.importScripts==`function`,jn=An?bn.origin:void 0,Mn=hn,Nn=_n,Pn=gn,Fn=yn,In=vn;var Ln;(function(e){function t(){return In}e.value=t;function n(){return In.length===2?In===`en`:In.length>=3?In[0]===`e`&&In[1]===`n`&&In[2]===`-`:!1}e.isDefaultVariant=n;function r(){return In===`en`}e.isDefault=r})(Ln||={});const Rn=typeof bn.postMessage==`function`&&!bn.importScripts,zn=(()=>{if(Rn){let e=[];bn.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),bn.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var Bn;(function(e){e[e.Windows=1]=`Windows`,e[e.Macintosh=2]=`Macintosh`,e[e.Linux=3]=`Linux`})(Bn||={});const Vn=dn||hn?Bn.Macintosh:un?Bn.Windows:Bn.Linux;let Hn=!0,Un=!1;function Wn(){if(!Un){Un=!0;let e=new Uint8Array(2);e[0]=1,e[1]=2,Hn=new Uint16Array(e.buffer)[0]===513}return Hn}const Gn=!!(Fn&&Fn.indexOf(`Chrome`)>=0),Kn=!!(Fn&&Fn.indexOf(`Firefox`)>=0),qn=!!(!Gn&&Fn&&Fn.indexOf(`Safari`)>=0),Jn=!!(Fn&&Fn.indexOf(`Edg/`)>=0);Fn&&Fn.indexOf(`Android`);let Yn;const Xn=globalThis.vscode;if(Xn!==void 0&&Xn.process!==void 0){let e=Xn.process;Yn={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd(){return e.cwd()}}}else Yn=typeof process<`u`&&typeof process?.versions?.node==`string`?{get platform(){return process.platform},get arch(){return process.arch},get env(){return{}},cwd(){return{}.VSCODE_CWD||process.cwd()}}:{get platform(){return Tn?`win32`:En?`darwin`:`linux`},get arch(){},get env(){return{}},cwd(){return`/`}};const Zn=Yn.cwd,Qn=Yn.env,$n=Yn.platform;Yn.arch;const er=globalThis.performance.now.bind(globalThis.performance);var tr=class e{static create(t){return new e(t)}constructor(e){this._now=e===!1?Date.now:er,this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}};const nr=6e4;function rr(){return!!Qn.VSCODE_DEV}var ir;(function(e){e.None=()=>v.None;function t(e,t,n){return f(e,()=>void 0,0,void 0,t??!0,void 0,n)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(t,n){return e.once(e.filter(t,n))}e.onceIf=r;function i(e,t,n){return u((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=i;function a(e,t,n){return u((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=a;function o(e,t,n){return u((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=o;function s(e){return e}e.signal=s;function c(...e){return(t,n=null,r)=>d(St(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=c;function l(e,t,n,r){let a=n;return i(e,e=>(a=t(a,e),a),r)}e.reduce=l;function u(e,t){let n,r=new x({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function d(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function f(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new x({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(l&&clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=null,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=f;function p(t,n=0,r,i){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,r??!0,void 0,i)}e.accumulate=p;function m(e,t,n=100,r=!0,i=!0,a,o){let s,c,l,u=0,d=new x({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),l===void 0&&(r&&(d.fire(c),c=void 0,u=0),typeof n==`number`?l=setTimeout(()=>{i&&u>0&&d.fire(c),c=void 0,l=void 0,u=0},n):(l=0,queueMicrotask(()=>{i&&u>0&&d.fire(c),c=void 0,l=void 0,u=0})))})},onDidRemoveLastListener(){s.dispose()}});return o?.add(d),d.event}e.throttle=m;function ee(e,t=(e,t)=>e===t,n){let r=!0,i;return o(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=ee;function te(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=te;function ne(e,t,n=!1,r=[],i){let a=r.slice(),o;rr()&&(o={stack:sr.create(),timerId:setTimeout(()=>{a&&a.length>0&&o&&!o.warned&&(o.warned=!0,console.warn(`[Event.buffer][${t}] potential LEAK detected: ${a.length} events buffered for ${nr/1e3}s without being consumed. Buffered here:`),o.stack.print())},nr),warned:!1},i&&i.add(g(()=>clearTimeout(o.timerId))));let s=()=>{o&&clearTimeout(o.timerId)},c=e(e=>{a?(a.push(e),rr()&&o&&!o.warned&&a.length>=100&&(o.warned=!0,console.warn(`[Event.buffer][${t}] potential LEAK detected: ${a.length} events buffered without being consumed. Buffered here:`),o.stack.print())):u.fire(e)});i&&i.add(c);let l=()=>{a?.forEach(e=>u.fire(e)),a=null,s()},u=new x({onWillAddFirstListener(){c||(c=e(e=>u.fire(e)),i&&i.add(c))},onDidAddFirstListener(){a&&(n?setTimeout(l):l())},onDidRemoveLastListener(){c&&c.dispose(),c=null,s()}});return i&&i.add(u),u.event}e.buffer=ne;function h(e,t){return(n,r,i)=>{let a=t(new ie);return e(function(e){let t=a.evaluate(e);t!==re&&n.call(r,t)},void 0,i)}}e.chain=h;let re=Symbol(`HaltChainable`);class ie{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:re),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:re}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===re)break;return e}}function ae(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new x({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=ae;function oe(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new x({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=oe;function se(e,t){let r,i,a=new Promise(a=>{i=n(e)(a),vr(i,t),r=()=>{yr(i,t)}});return a.cancel=r,t&&a.finally(()=>yr(i,t)),a}e.toPromise=se;function ce(e,t){return e(e=>t.fire(e))}e.forward=ce;function le(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=le;class ue{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new x(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function de(e,t){return new ue(e,t).emitter.event}e.fromObservable=de;function fe(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return vr(s,r),s}}e.fromObservableLight=fe})(ir||={});var ar=class e{static{this.all=new Set}static{this._idPool=0}constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new tr,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}},or=class e{static{this._idPool=1}constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=/^[0-9a-f]+$/i.test(this.name)?void 0:this.name,a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(a),console.warn(e);let o=new cr(r/t>.3?`dominated`:`popular`,a,e,t,i);this._errorHandler(o)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}},sr=class e{static create(){return new e(Error().stack??``)}constructor(e){this.value=e}print(){console.warn(this.value.split(`
|
|
12
|
+
`).slice(2).join(`
|
|
13
|
+
`))}},cr=class e extends Error{constructor(e,t,n,r,i){super(i?`[${i}] potential listener LEAK detected, ${e}`:`potential listener LEAK detected, ${e}`),this.name=`ListenerLeakError`,this.kind=e,this.listenerCount=r,this.details=t,this.stack=n}static is(t){return t instanceof e||t instanceof Error&&typeof t.kind==`string`&&typeof t.listenerCount==`number`}},lr=class extends cr{constructor(e,t,n,r,i){super(e,t,n,r,i),this.name=`ListenerRefusalError`}};let ur=0;var dr=class{constructor(e){this.value=e,this.id=ur++}};const fr=(e,t)=>{if(e instanceof dr)t(e);else for(let n=0;n<e.length;n++){let r=e[n];r&&t(r)}};var x=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new or(e?.onListenerError??m,this._options?.leakWarningThreshold??-1,this._options?.leakWarningName):void 0,this._perfMon=this._options?._profName?new ar(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new lr(t[1]/this._size>.3?`dominated`:`popular`,`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0],this._size,this._options?.leakWarningName);return(this._options?.onListenerError||m)(n),v.None}if(this._disposed)return v.None;t&&(e=e.bind(t));let r=new dr(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=sr.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof dr?(this._deliveryQueue??=new pr,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._options?.onDidAddListener?.(this),this._size++;let a=g(()=>{i?.(),this._removeListener(r)});return vr(a,n),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*2<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&e<this._deliveryQueue.end&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||m;if(!n){e.value(t);return}try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof dr)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}this._perfMon?.stop()}hasListeners(){return this._size>0}},pr=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},mr=class extends x{async fireAsync(e,t,n){if(this._listeners)for(this._asyncDeliveryQueue||=new nn,fr(this._listeners,t=>this._asyncDeliveryQueue.push([t.value,e]));this._asyncDeliveryQueue.size>0&&!t.isCancellationRequested;){let[e,r]=this._asyncDeliveryQueue.shift(),i=[],a={...r,token:t,waitUntil:t=>{if(Object.isFrozen(i))throw Error(`waitUntil can NOT be called asynchronous`);n&&(t=n(t,e)),i.push(t)}};try{e(a)}catch(e){m(e);continue}await Promise.allSettled(i).then(e=>{for(let t of e)t.status===`rejected`&&m(t.reason)})}}},hr=class extends x{get isPaused(){return this._isPaused!==0}constructor(e){super(e),this._isPaused=0,this._eventQueue=new nn,this._mergeFn=e?.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){if(this._eventQueue.size>0){let e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(this._isPaused===0?super.fire(e):this._eventQueue.push(e))}},gr=class extends hr{constructor(e){super(e),this._delay=e.delay??100}fire(e){this._handle||=(this.pause(),setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(e)}},_r=class extends x{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=e?.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),this._queuedEvents.length===1&&queueMicrotask(()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach(e=>super.fire(e)),this._queuedEvents=[]}))}};function vr(e,t){t instanceof _?t.add(e):Array.isArray(t)&&t.push(e)}function yr(e,t){if(t instanceof _)t.delete(e);else if(Array.isArray(t)){let n=t.indexOf(e);n!==-1&&t.splice(n,1)}e.dispose()}var br;(function(e){e[e.Desktop=1]=`Desktop`,e[e.Web=2]=`Web`})(br||={});var xr;(function(e){e[e.VersionMismatch=55]=`VersionMismatch`,e[e.UnexpectedError=81]=`UnexpectedError`})(xr||={});var Sr;(function(e){e[e.Initialized=0]=`Initialized`,e[e.Ready=1]=`Ready`,e[e.Terminate=2]=`Terminate`})(Sr||={});function Cr(e){let t=y.alloc(1);switch(e){case Sr.Initialized:t.writeUInt8(1,0);break;case Sr.Ready:t.writeUInt8(2,0);break;case Sr.Terminate:t.writeUInt8(3,0);break}return t}function wr(e,t){if(e.byteLength!==1)return!1;switch(e.readUInt8(0)){case 1:return t===Sr.Initialized;case 2:return t===Sr.Ready;case 3:return t===Sr.Terminate;default:return!1}}var Tr;(function(e){e.Start=`START_NATIVE_LOG`,e.End=`END_NATIVE_LOG`})(Tr||={});function Er(e){let t=[];typeof e==`number`&&t.push(`code/timeOrigin`,e);function n(e,n){t.push(e,n?.startTime??Date.now())}function r(){let e=[];for(let n=0;n<t.length;n+=2)e.push({name:t[n],startTime:t[n+1]});return e}function i(e){if(e===void 0){let e=t.length>=2&&t[0]===`code/timeOrigin`,n=e?t[1]:void 0;t.length=0,e&&t.push(`code/timeOrigin`,n)}else for(let n=t.length-2;n>=0;n-=2)t[n]===e&&t.splice(n,2)}return{mark:n,getMarks:r,clearMarks:i}}function Dr(){if(typeof performance==`object`&&typeof performance.mark==`function`&&!performance.nodeTiming)return typeof performance.timeOrigin!=`number`&&!performance.timing?Er():{mark(e,t){performance.mark(e,t)},clearMarks(e){performance.clearMarks(e)},getMarks(){let e=performance.timeOrigin;typeof e!=`number`&&(e=(performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart)??0);let t=[{name:`code/timeOrigin`,startTime:Math.round(e)}];for(let n of performance.getEntriesByType(`mark`))t.push({name:n.name,startTime:Math.round(e+n.startTime)});return t}};if(typeof process==`object`){let e=performance?.timeOrigin;return Er(e)}else return console.trace(`perf-util loaded in UNKNOWN environment`),Er()}function Or(e){return e.MonacoPerformanceMarks||=Dr(),e.MonacoPerformanceMarks}const kr=Or(globalThis),Ar=kr.mark;kr.clearMarks;const jr=kr.getMarks;var S;(function(e){e[e.Null=0]=`Null`,e[e.Backspace=8]=`Backspace`,e[e.Tab=9]=`Tab`,e[e.LineFeed=10]=`LineFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Hash=35]=`Hash`,e[e.DollarSign=36]=`DollarSign`,e[e.PercentSign=37]=`PercentSign`,e[e.Ampersand=38]=`Ampersand`,e[e.SingleQuote=39]=`SingleQuote`,e[e.OpenParen=40]=`OpenParen`,e[e.CloseParen=41]=`CloseParen`,e[e.Asterisk=42]=`Asterisk`,e[e.Plus=43]=`Plus`,e[e.Comma=44]=`Comma`,e[e.Dash=45]=`Dash`,e[e.Period=46]=`Period`,e[e.Slash=47]=`Slash`,e[e.Digit0=48]=`Digit0`,e[e.Digit1=49]=`Digit1`,e[e.Digit2=50]=`Digit2`,e[e.Digit3=51]=`Digit3`,e[e.Digit4=52]=`Digit4`,e[e.Digit5=53]=`Digit5`,e[e.Digit6=54]=`Digit6`,e[e.Digit7=55]=`Digit7`,e[e.Digit8=56]=`Digit8`,e[e.Digit9=57]=`Digit9`,e[e.Colon=58]=`Colon`,e[e.Semicolon=59]=`Semicolon`,e[e.LessThan=60]=`LessThan`,e[e.Equals=61]=`Equals`,e[e.GreaterThan=62]=`GreaterThan`,e[e.QuestionMark=63]=`QuestionMark`,e[e.AtSign=64]=`AtSign`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.OpenSquareBracket=91]=`OpenSquareBracket`,e[e.Backslash=92]=`Backslash`,e[e.CloseSquareBracket=93]=`CloseSquareBracket`,e[e.Caret=94]=`Caret`,e[e.Underline=95]=`Underline`,e[e.BackTick=96]=`BackTick`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.OpenCurlyBrace=123]=`OpenCurlyBrace`,e[e.Pipe=124]=`Pipe`,e[e.CloseCurlyBrace=125]=`CloseCurlyBrace`,e[e.Tilde=126]=`Tilde`,e[e.NoBreakSpace=160]=`NoBreakSpace`,e[e.U_Combining_Grave_Accent=768]=`U_Combining_Grave_Accent`,e[e.U_Combining_Acute_Accent=769]=`U_Combining_Acute_Accent`,e[e.U_Combining_Circumflex_Accent=770]=`U_Combining_Circumflex_Accent`,e[e.U_Combining_Tilde=771]=`U_Combining_Tilde`,e[e.U_Combining_Macron=772]=`U_Combining_Macron`,e[e.U_Combining_Overline=773]=`U_Combining_Overline`,e[e.U_Combining_Breve=774]=`U_Combining_Breve`,e[e.U_Combining_Dot_Above=775]=`U_Combining_Dot_Above`,e[e.U_Combining_Diaeresis=776]=`U_Combining_Diaeresis`,e[e.U_Combining_Hook_Above=777]=`U_Combining_Hook_Above`,e[e.U_Combining_Ring_Above=778]=`U_Combining_Ring_Above`,e[e.U_Combining_Double_Acute_Accent=779]=`U_Combining_Double_Acute_Accent`,e[e.U_Combining_Caron=780]=`U_Combining_Caron`,e[e.U_Combining_Vertical_Line_Above=781]=`U_Combining_Vertical_Line_Above`,e[e.U_Combining_Double_Vertical_Line_Above=782]=`U_Combining_Double_Vertical_Line_Above`,e[e.U_Combining_Double_Grave_Accent=783]=`U_Combining_Double_Grave_Accent`,e[e.U_Combining_Candrabindu=784]=`U_Combining_Candrabindu`,e[e.U_Combining_Inverted_Breve=785]=`U_Combining_Inverted_Breve`,e[e.U_Combining_Turned_Comma_Above=786]=`U_Combining_Turned_Comma_Above`,e[e.U_Combining_Comma_Above=787]=`U_Combining_Comma_Above`,e[e.U_Combining_Reversed_Comma_Above=788]=`U_Combining_Reversed_Comma_Above`,e[e.U_Combining_Comma_Above_Right=789]=`U_Combining_Comma_Above_Right`,e[e.U_Combining_Grave_Accent_Below=790]=`U_Combining_Grave_Accent_Below`,e[e.U_Combining_Acute_Accent_Below=791]=`U_Combining_Acute_Accent_Below`,e[e.U_Combining_Left_Tack_Below=792]=`U_Combining_Left_Tack_Below`,e[e.U_Combining_Right_Tack_Below=793]=`U_Combining_Right_Tack_Below`,e[e.U_Combining_Left_Angle_Above=794]=`U_Combining_Left_Angle_Above`,e[e.U_Combining_Horn=795]=`U_Combining_Horn`,e[e.U_Combining_Left_Half_Ring_Below=796]=`U_Combining_Left_Half_Ring_Below`,e[e.U_Combining_Up_Tack_Below=797]=`U_Combining_Up_Tack_Below`,e[e.U_Combining_Down_Tack_Below=798]=`U_Combining_Down_Tack_Below`,e[e.U_Combining_Plus_Sign_Below=799]=`U_Combining_Plus_Sign_Below`,e[e.U_Combining_Minus_Sign_Below=800]=`U_Combining_Minus_Sign_Below`,e[e.U_Combining_Palatalized_Hook_Below=801]=`U_Combining_Palatalized_Hook_Below`,e[e.U_Combining_Retroflex_Hook_Below=802]=`U_Combining_Retroflex_Hook_Below`,e[e.U_Combining_Dot_Below=803]=`U_Combining_Dot_Below`,e[e.U_Combining_Diaeresis_Below=804]=`U_Combining_Diaeresis_Below`,e[e.U_Combining_Ring_Below=805]=`U_Combining_Ring_Below`,e[e.U_Combining_Comma_Below=806]=`U_Combining_Comma_Below`,e[e.U_Combining_Cedilla=807]=`U_Combining_Cedilla`,e[e.U_Combining_Ogonek=808]=`U_Combining_Ogonek`,e[e.U_Combining_Vertical_Line_Below=809]=`U_Combining_Vertical_Line_Below`,e[e.U_Combining_Bridge_Below=810]=`U_Combining_Bridge_Below`,e[e.U_Combining_Inverted_Double_Arch_Below=811]=`U_Combining_Inverted_Double_Arch_Below`,e[e.U_Combining_Caron_Below=812]=`U_Combining_Caron_Below`,e[e.U_Combining_Circumflex_Accent_Below=813]=`U_Combining_Circumflex_Accent_Below`,e[e.U_Combining_Breve_Below=814]=`U_Combining_Breve_Below`,e[e.U_Combining_Inverted_Breve_Below=815]=`U_Combining_Inverted_Breve_Below`,e[e.U_Combining_Tilde_Below=816]=`U_Combining_Tilde_Below`,e[e.U_Combining_Macron_Below=817]=`U_Combining_Macron_Below`,e[e.U_Combining_Low_Line=818]=`U_Combining_Low_Line`,e[e.U_Combining_Double_Low_Line=819]=`U_Combining_Double_Low_Line`,e[e.U_Combining_Tilde_Overlay=820]=`U_Combining_Tilde_Overlay`,e[e.U_Combining_Short_Stroke_Overlay=821]=`U_Combining_Short_Stroke_Overlay`,e[e.U_Combining_Long_Stroke_Overlay=822]=`U_Combining_Long_Stroke_Overlay`,e[e.U_Combining_Short_Solidus_Overlay=823]=`U_Combining_Short_Solidus_Overlay`,e[e.U_Combining_Long_Solidus_Overlay=824]=`U_Combining_Long_Solidus_Overlay`,e[e.U_Combining_Right_Half_Ring_Below=825]=`U_Combining_Right_Half_Ring_Below`,e[e.U_Combining_Inverted_Bridge_Below=826]=`U_Combining_Inverted_Bridge_Below`,e[e.U_Combining_Square_Below=827]=`U_Combining_Square_Below`,e[e.U_Combining_Seagull_Below=828]=`U_Combining_Seagull_Below`,e[e.U_Combining_X_Above=829]=`U_Combining_X_Above`,e[e.U_Combining_Vertical_Tilde=830]=`U_Combining_Vertical_Tilde`,e[e.U_Combining_Double_Overline=831]=`U_Combining_Double_Overline`,e[e.U_Combining_Grave_Tone_Mark=832]=`U_Combining_Grave_Tone_Mark`,e[e.U_Combining_Acute_Tone_Mark=833]=`U_Combining_Acute_Tone_Mark`,e[e.U_Combining_Greek_Perispomeni=834]=`U_Combining_Greek_Perispomeni`,e[e.U_Combining_Greek_Koronis=835]=`U_Combining_Greek_Koronis`,e[e.U_Combining_Greek_Dialytika_Tonos=836]=`U_Combining_Greek_Dialytika_Tonos`,e[e.U_Combining_Greek_Ypogegrammeni=837]=`U_Combining_Greek_Ypogegrammeni`,e[e.U_Combining_Bridge_Above=838]=`U_Combining_Bridge_Above`,e[e.U_Combining_Equals_Sign_Below=839]=`U_Combining_Equals_Sign_Below`,e[e.U_Combining_Double_Vertical_Line_Below=840]=`U_Combining_Double_Vertical_Line_Below`,e[e.U_Combining_Left_Angle_Below=841]=`U_Combining_Left_Angle_Below`,e[e.U_Combining_Not_Tilde_Above=842]=`U_Combining_Not_Tilde_Above`,e[e.U_Combining_Homothetic_Above=843]=`U_Combining_Homothetic_Above`,e[e.U_Combining_Almost_Equal_To_Above=844]=`U_Combining_Almost_Equal_To_Above`,e[e.U_Combining_Left_Right_Arrow_Below=845]=`U_Combining_Left_Right_Arrow_Below`,e[e.U_Combining_Upwards_Arrow_Below=846]=`U_Combining_Upwards_Arrow_Below`,e[e.U_Combining_Grapheme_Joiner=847]=`U_Combining_Grapheme_Joiner`,e[e.U_Combining_Right_Arrowhead_Above=848]=`U_Combining_Right_Arrowhead_Above`,e[e.U_Combining_Left_Half_Ring_Above=849]=`U_Combining_Left_Half_Ring_Above`,e[e.U_Combining_Fermata=850]=`U_Combining_Fermata`,e[e.U_Combining_X_Below=851]=`U_Combining_X_Below`,e[e.U_Combining_Left_Arrowhead_Below=852]=`U_Combining_Left_Arrowhead_Below`,e[e.U_Combining_Right_Arrowhead_Below=853]=`U_Combining_Right_Arrowhead_Below`,e[e.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]=`U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below`,e[e.U_Combining_Right_Half_Ring_Above=855]=`U_Combining_Right_Half_Ring_Above`,e[e.U_Combining_Dot_Above_Right=856]=`U_Combining_Dot_Above_Right`,e[e.U_Combining_Asterisk_Below=857]=`U_Combining_Asterisk_Below`,e[e.U_Combining_Double_Ring_Below=858]=`U_Combining_Double_Ring_Below`,e[e.U_Combining_Zigzag_Above=859]=`U_Combining_Zigzag_Above`,e[e.U_Combining_Double_Breve_Below=860]=`U_Combining_Double_Breve_Below`,e[e.U_Combining_Double_Breve=861]=`U_Combining_Double_Breve`,e[e.U_Combining_Double_Macron=862]=`U_Combining_Double_Macron`,e[e.U_Combining_Double_Macron_Below=863]=`U_Combining_Double_Macron_Below`,e[e.U_Combining_Double_Tilde=864]=`U_Combining_Double_Tilde`,e[e.U_Combining_Double_Inverted_Breve=865]=`U_Combining_Double_Inverted_Breve`,e[e.U_Combining_Double_Rightwards_Arrow_Below=866]=`U_Combining_Double_Rightwards_Arrow_Below`,e[e.U_Combining_Latin_Small_Letter_A=867]=`U_Combining_Latin_Small_Letter_A`,e[e.U_Combining_Latin_Small_Letter_E=868]=`U_Combining_Latin_Small_Letter_E`,e[e.U_Combining_Latin_Small_Letter_I=869]=`U_Combining_Latin_Small_Letter_I`,e[e.U_Combining_Latin_Small_Letter_O=870]=`U_Combining_Latin_Small_Letter_O`,e[e.U_Combining_Latin_Small_Letter_U=871]=`U_Combining_Latin_Small_Letter_U`,e[e.U_Combining_Latin_Small_Letter_C=872]=`U_Combining_Latin_Small_Letter_C`,e[e.U_Combining_Latin_Small_Letter_D=873]=`U_Combining_Latin_Small_Letter_D`,e[e.U_Combining_Latin_Small_Letter_H=874]=`U_Combining_Latin_Small_Letter_H`,e[e.U_Combining_Latin_Small_Letter_M=875]=`U_Combining_Latin_Small_Letter_M`,e[e.U_Combining_Latin_Small_Letter_R=876]=`U_Combining_Latin_Small_Letter_R`,e[e.U_Combining_Latin_Small_Letter_T=877]=`U_Combining_Latin_Small_Letter_T`,e[e.U_Combining_Latin_Small_Letter_V=878]=`U_Combining_Latin_Small_Letter_V`,e[e.U_Combining_Latin_Small_Letter_X=879]=`U_Combining_Latin_Small_Letter_X`,e[e.LINE_SEPARATOR=8232]=`LINE_SEPARATOR`,e[e.PARAGRAPH_SEPARATOR=8233]=`PARAGRAPH_SEPARATOR`,e[e.NEXT_LINE=133]=`NEXT_LINE`,e[e.U_CIRCUMFLEX=94]=`U_CIRCUMFLEX`,e[e.U_GRAVE_ACCENT=96]=`U_GRAVE_ACCENT`,e[e.U_DIAERESIS=168]=`U_DIAERESIS`,e[e.U_MACRON=175]=`U_MACRON`,e[e.U_ACUTE_ACCENT=180]=`U_ACUTE_ACCENT`,e[e.U_CEDILLA=184]=`U_CEDILLA`,e[e.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]=`U_MODIFIER_LETTER_LEFT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]=`U_MODIFIER_LETTER_RIGHT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_UP_ARROWHEAD=708]=`U_MODIFIER_LETTER_UP_ARROWHEAD`,e[e.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]=`U_MODIFIER_LETTER_DOWN_ARROWHEAD`,e[e.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]=`U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING`,e[e.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]=`U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING`,e[e.U_MODIFIER_LETTER_UP_TACK=724]=`U_MODIFIER_LETTER_UP_TACK`,e[e.U_MODIFIER_LETTER_DOWN_TACK=725]=`U_MODIFIER_LETTER_DOWN_TACK`,e[e.U_MODIFIER_LETTER_PLUS_SIGN=726]=`U_MODIFIER_LETTER_PLUS_SIGN`,e[e.U_MODIFIER_LETTER_MINUS_SIGN=727]=`U_MODIFIER_LETTER_MINUS_SIGN`,e[e.U_BREVE=728]=`U_BREVE`,e[e.U_DOT_ABOVE=729]=`U_DOT_ABOVE`,e[e.U_RING_ABOVE=730]=`U_RING_ABOVE`,e[e.U_OGONEK=731]=`U_OGONEK`,e[e.U_SMALL_TILDE=732]=`U_SMALL_TILDE`,e[e.U_DOUBLE_ACUTE_ACCENT=733]=`U_DOUBLE_ACUTE_ACCENT`,e[e.U_MODIFIER_LETTER_RHOTIC_HOOK=734]=`U_MODIFIER_LETTER_RHOTIC_HOOK`,e[e.U_MODIFIER_LETTER_CROSS_ACCENT=735]=`U_MODIFIER_LETTER_CROSS_ACCENT`,e[e.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]=`U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR`,e[e.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]=`U_MODIFIER_LETTER_HIGH_TONE_BAR`,e[e.U_MODIFIER_LETTER_MID_TONE_BAR=743]=`U_MODIFIER_LETTER_MID_TONE_BAR`,e[e.U_MODIFIER_LETTER_LOW_TONE_BAR=744]=`U_MODIFIER_LETTER_LOW_TONE_BAR`,e[e.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]=`U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR`,e[e.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]=`U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK`,e[e.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]=`U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK`,e[e.U_MODIFIER_LETTER_UNASPIRATED=749]=`U_MODIFIER_LETTER_UNASPIRATED`,e[e.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]=`U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]=`U_MODIFIER_LETTER_LOW_UP_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]=`U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]=`U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD`,e[e.U_MODIFIER_LETTER_LOW_RING=755]=`U_MODIFIER_LETTER_LOW_RING`,e[e.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]=`U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT`,e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]=`U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT`,e[e.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]=`U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT`,e[e.U_MODIFIER_LETTER_LOW_TILDE=759]=`U_MODIFIER_LETTER_LOW_TILDE`,e[e.U_MODIFIER_LETTER_RAISED_COLON=760]=`U_MODIFIER_LETTER_RAISED_COLON`,e[e.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]=`U_MODIFIER_LETTER_BEGIN_HIGH_TONE`,e[e.U_MODIFIER_LETTER_END_HIGH_TONE=762]=`U_MODIFIER_LETTER_END_HIGH_TONE`,e[e.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]=`U_MODIFIER_LETTER_BEGIN_LOW_TONE`,e[e.U_MODIFIER_LETTER_END_LOW_TONE=764]=`U_MODIFIER_LETTER_END_LOW_TONE`,e[e.U_MODIFIER_LETTER_SHELF=765]=`U_MODIFIER_LETTER_SHELF`,e[e.U_MODIFIER_LETTER_OPEN_SHELF=766]=`U_MODIFIER_LETTER_OPEN_SHELF`,e[e.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]=`U_MODIFIER_LETTER_LOW_LEFT_ARROW`,e[e.U_GREEK_LOWER_NUMERAL_SIGN=885]=`U_GREEK_LOWER_NUMERAL_SIGN`,e[e.U_GREEK_TONOS=900]=`U_GREEK_TONOS`,e[e.U_GREEK_DIALYTIKA_TONOS=901]=`U_GREEK_DIALYTIKA_TONOS`,e[e.U_GREEK_KORONIS=8125]=`U_GREEK_KORONIS`,e[e.U_GREEK_PSILI=8127]=`U_GREEK_PSILI`,e[e.U_GREEK_PERISPOMENI=8128]=`U_GREEK_PERISPOMENI`,e[e.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]=`U_GREEK_DIALYTIKA_AND_PERISPOMENI`,e[e.U_GREEK_PSILI_AND_VARIA=8141]=`U_GREEK_PSILI_AND_VARIA`,e[e.U_GREEK_PSILI_AND_OXIA=8142]=`U_GREEK_PSILI_AND_OXIA`,e[e.U_GREEK_PSILI_AND_PERISPOMENI=8143]=`U_GREEK_PSILI_AND_PERISPOMENI`,e[e.U_GREEK_DASIA_AND_VARIA=8157]=`U_GREEK_DASIA_AND_VARIA`,e[e.U_GREEK_DASIA_AND_OXIA=8158]=`U_GREEK_DASIA_AND_OXIA`,e[e.U_GREEK_DASIA_AND_PERISPOMENI=8159]=`U_GREEK_DASIA_AND_PERISPOMENI`,e[e.U_GREEK_DIALYTIKA_AND_VARIA=8173]=`U_GREEK_DIALYTIKA_AND_VARIA`,e[e.U_GREEK_DIALYTIKA_AND_OXIA=8174]=`U_GREEK_DIALYTIKA_AND_OXIA`,e[e.U_GREEK_VARIA=8175]=`U_GREEK_VARIA`,e[e.U_GREEK_OXIA=8189]=`U_GREEK_OXIA`,e[e.U_GREEK_DASIA=8190]=`U_GREEK_DASIA`,e[e.U_IDEOGRAPHIC_FULL_STOP=12290]=`U_IDEOGRAPHIC_FULL_STOP`,e[e.U_LEFT_CORNER_BRACKET=12300]=`U_LEFT_CORNER_BRACKET`,e[e.U_RIGHT_CORNER_BRACKET=12301]=`U_RIGHT_CORNER_BRACKET`,e[e.U_LEFT_BLACK_LENTICULAR_BRACKET=12304]=`U_LEFT_BLACK_LENTICULAR_BRACKET`,e[e.U_RIGHT_BLACK_LENTICULAR_BRACKET=12305]=`U_RIGHT_BLACK_LENTICULAR_BRACKET`,e[e.U_OVERLINE=8254]=`U_OVERLINE`,e[e.UTF8_BOM=65279]=`UTF8_BOM`,e[e.U_FULLWIDTH_SEMICOLON=65307]=`U_FULLWIDTH_SEMICOLON`,e[e.U_FULLWIDTH_COMMA=65292]=`U_FULLWIDTH_COMMA`})(S||={});var Mr;(function(e){e[e.Uri=1]=`Uri`,e[e.Regexp=2]=`Regexp`,e[e.ScmResource=3]=`ScmResource`,e[e.ScmResourceGroup=4]=`ScmResourceGroup`,e[e.ScmProvider=5]=`ScmProvider`,e[e.CommentController=6]=`CommentController`,e[e.CommentThread=7]=`CommentThread`,e[e.CommentThreadInstance=8]=`CommentThreadInstance`,e[e.CommentThreadReply=9]=`CommentThreadReply`,e[e.CommentNode=10]=`CommentNode`,e[e.CommentThreadNode=11]=`CommentThreadNode`,e[e.TimelineActionContext=12]=`TimelineActionContext`,e[e.NotebookCellActionContext=13]=`NotebookCellActionContext`,e[e.NotebookActionContext=14]=`NotebookActionContext`,e[e.TerminalContext=15]=`TerminalContext`,e[e.TestItemContext=16]=`TestItemContext`,e[e.Date=17]=`Date`,e[e.TestMessageMenuArgs=18]=`TestMessageMenuArgs`,e[e.ChatViewContext=19]=`ChatViewContext`,e[e.LanguageModelToolResult=20]=`LanguageModelToolResult`,e[e.LanguageModelTextPart=21]=`LanguageModelTextPart`,e[e.LanguageModelThinkingPart=22]=`LanguageModelThinkingPart`,e[e.LanguageModelPromptTsxPart=23]=`LanguageModelPromptTsxPart`,e[e.LanguageModelDataPart=24]=`LanguageModelDataPart`,e[e.AgentSessionContext=25]=`AgentSessionContext`,e[e.ChatResponsePullRequestPart=26]=`ChatResponsePullRequestPart`})(Mr||={});var Nr=class extends Error{constructor(e,t,n){let r;typeof t==`string`&&t.indexOf(`not `)===0?(r=`must not be`,t=t.replace(/^not /,``)):r=`must be`;let i=`The "${e}" ${e.indexOf(`.`)===-1?`argument`:`property`} ${r} of type ${t}`;i+=`. Received type ${typeof n}`,super(i),this.code=`ERR_INVALID_ARG_TYPE`}};function Pr(e,t){if(typeof e!=`object`||!e)throw new Nr(t,`Object`,e)}function Fr(e,t){if(typeof e!=`string`)throw new Nr(t,`string`,e)}const Ir=$n===`win32`;function Lr(e){return e===47||e===92}function Rr(e){return e===47}function zr(e){return e>=65&&e<=90||e>=97&&e<=122}function Br(e,t,n,r){let i=``,a=0,o=-1,s=0,c=0;for(let l=0;l<=e.length;++l){if(l<e.length)c=e.charCodeAt(l);else if(r(c))break;else c=47;if(r(c)){if(!(o===l-1||s===1))if(s===2){if(i.length<2||a!==2||i.charCodeAt(i.length-1)!==46||i.charCodeAt(i.length-2)!==46){if(i.length>2){let e=i.lastIndexOf(n);e===-1?(i=``,a=0):(i=i.slice(0,e),a=i.length-1-i.lastIndexOf(n)),o=l,s=0;continue}else if(i.length!==0){i=``,a=0,o=l,s=0;continue}}t&&(i+=i.length>0?`${n}..`:`..`,a=2)}else i.length>0?i+=`${n}${e.slice(o+1,l)}`:i=e.slice(o+1,l),a=l-o-1;o=l,s=0}else c===46&&s!==-1?++s:s=-1}return i}function Vr(e){return e?`${e[0]===`.`?``:`.`}${e}`:``}function Hr(e,t){Pr(t,`pathObject`);let n=t.dir||t.root,r=t.base||`${t.name||``}${Vr(t.ext)}`;return n?n===t.root?`${n}${r}`:`${n}${e}${r}`:r}const Ur={resolve(...e){let t=``,n=``,r=!1;for(let i=e.length-1;i>=-1;i--){let a;if(i>=0){if(a=e[i],Fr(a,`paths[${i}]`),a.length===0)continue}else t.length===0?a=Zn():(a=Qn[`=${t}`]||Zn(),(a===void 0||a.slice(0,2).toLowerCase()!==t.toLowerCase()&&a.charCodeAt(2)===92)&&(a=`${t}\\`));let o=a.length,s=0,c=``,l=!1,u=a.charCodeAt(0);if(o===1)Lr(u)&&(s=1,l=!0);else if(Lr(u))if(l=!0,Lr(a.charCodeAt(1))){let e=2,t=e;for(;e<o&&!Lr(a.charCodeAt(e));)e++;if(e<o&&e!==t){let n=a.slice(t,e);for(t=e;e<o&&Lr(a.charCodeAt(e));)e++;if(e<o&&e!==t){for(t=e;e<o&&!Lr(a.charCodeAt(e));)e++;(e===o||e!==t)&&(c=`\\\\${n}\\${a.slice(t,e)}`,s=e)}}}else s=1;else zr(u)&&a.charCodeAt(1)===58&&(c=a.slice(0,2),s=2,o>2&&Lr(a.charCodeAt(2))&&(l=!0,s=3));if(c.length>0)if(t.length>0){if(c.toLowerCase()!==t.toLowerCase())continue}else t=c;if(r){if(t.length>0)break}else if(n=`${a.slice(s)}\\${n}`,r=l,l&&t.length>0)break}return n=Br(n,!r,`\\`,Lr),r?`${t}\\${n}`:`${t}${n}`||`.`},normalize(e){Fr(e,`path`);let t=e.length;if(t===0)return`.`;let n=0,r,i=!1,a=e.charCodeAt(0);if(t===1)return Rr(a)?`\\`:e;if(Lr(a))if(i=!0,Lr(e.charCodeAt(1))){let i=2,a=i;for(;i<t&&!Lr(e.charCodeAt(i));)i++;if(i<t&&i!==a){let o=e.slice(a,i);for(a=i;i<t&&Lr(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&!Lr(e.charCodeAt(i));)i++;if(i===t)return`\\\\${o}\\${e.slice(a)}\\`;i!==a&&(r=`\\\\${o}\\${e.slice(a,i)}`,n=i)}}}else n=1;else zr(a)&&e.charCodeAt(1)===58&&(r=e.slice(0,2),n=2,t>2&&Lr(e.charCodeAt(2))&&(i=!0,n=3));let o=n<t?Br(e.slice(n),!i,`\\`,Lr):``;if(o.length===0&&!i&&(o=`.`),o.length>0&&Lr(e.charCodeAt(t-1))&&(o+=`\\`),!i&&r===void 0&&e.includes(`:`)){if(o.length>=2&&zr(o.charCodeAt(0))&&o.charCodeAt(1)===58)return`.\\${o}`;let n=e.indexOf(`:`);do if(n===t-1||Lr(e.charCodeAt(n+1)))return`.\\${o}`;while((n=e.indexOf(`:`,n+1))!==-1)}return r===void 0?i?`\\${o}`:o:i?`${r}\\${o}`:`${r}${o}`},isAbsolute(e){Fr(e,`path`);let t=e.length;if(t===0)return!1;let n=e.charCodeAt(0);return Lr(n)||t>2&&zr(n)&&e.charCodeAt(1)===58&&Lr(e.charCodeAt(2))},join(...e){if(e.length===0)return`.`;let t,n;for(let r=0;r<e.length;++r){let i=e[r];Fr(i,`path`),i.length>0&&(t===void 0?t=n=i:t+=`\\${i}`)}if(t===void 0)return`.`;let r=!0,i=0;if(typeof n==`string`&&Lr(n.charCodeAt(0))){++i;let e=n.length;e>1&&Lr(n.charCodeAt(1))&&(++i,e>2&&(Lr(n.charCodeAt(2))?++i:r=!1))}if(r){for(;i<t.length&&Lr(t.charCodeAt(i));)i++;i>=2&&(t=`\\${t.slice(i)}`)}return Ur.normalize(t)},relative(e,t){if(Fr(e,`from`),Fr(t,`to`),e===t)return``;let n=Ur.resolve(e),r=Ur.resolve(t);if(n===r||(e=n.toLowerCase(),t=r.toLowerCase(),e===t))return``;if(n.length!==e.length||r.length!==t.length){let e=n.split(`\\`),t=r.split(`\\`);e[e.length-1]===``&&e.pop(),t[t.length-1]===``&&t.pop();let i=e.length,a=t.length,o=i<a?i:a,s;for(s=0;s<o&&e[s].toLowerCase()===t[s].toLowerCase();s++);return s===0?r:s===o?a>o?t.slice(s).join(`\\`):i>o?`..\\`.repeat(i-1-s)+`..`:``:`..\\`.repeat(i-s)+t.slice(s).join(`\\`)}let i=0;for(;i<e.length&&e.charCodeAt(i)===92;)i++;let a=e.length;for(;a-1>i&&e.charCodeAt(a-1)===92;)a--;let o=a-i,s=0;for(;s<t.length&&t.charCodeAt(s)===92;)s++;let c=t.length;for(;c-1>s&&t.charCodeAt(c-1)===92;)c--;let l=c-s,u=o<l?o:l,d=-1,f=0;for(;f<u;f++){let n=e.charCodeAt(i+f);if(n!==t.charCodeAt(s+f))break;n===92&&(d=f)}if(f!==u){if(d===-1)return r}else{if(l>u){if(t.charCodeAt(s+f)===92)return r.slice(s+f+1);if(f===2)return r.slice(s+f)}o>u&&(e.charCodeAt(i+f)===92?d=f:f===2&&(d=3)),d===-1&&(d=0)}let p=``;for(f=i+d+1;f<=a;++f)(f===a||e.charCodeAt(f)===92)&&(p+=p.length===0?`..`:`\\..`);return s+=d,p.length>0?`${p}${r.slice(s,c)}`:(r.charCodeAt(s)===92&&++s,r.slice(s,c))},toNamespacedPath(e){if(typeof e!=`string`||e.length===0)return e;let t=Ur.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===92){if(t.charCodeAt(1)===92){let e=t.charCodeAt(2);if(e!==63&&e!==46)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(zr(t.charCodeAt(0))&&t.charCodeAt(1)===58&&t.charCodeAt(2)===92)return`\\\\?\\${t}`;return t},dirname(e){Fr(e,`path`);let t=e.length;if(t===0)return`.`;let n=-1,r=0,i=e.charCodeAt(0);if(t===1)return Lr(i)?e:`.`;if(Lr(i)){if(n=r=1,Lr(e.charCodeAt(1))){let i=2,a=i;for(;i<t&&!Lr(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&Lr(e.charCodeAt(i));)i++;if(i<t&&i!==a){for(a=i;i<t&&!Lr(e.charCodeAt(i));)i++;if(i===t)return e;i!==a&&(n=r=i+1)}}}}else zr(i)&&e.charCodeAt(1)===58&&(n=t>2&&Lr(e.charCodeAt(2))?3:2,r=n);let a=-1,o=!0;for(let n=t-1;n>=r;--n)if(Lr(e.charCodeAt(n))){if(!o){a=n;break}}else o=!1;if(a===-1){if(n===-1)return`.`;a=n}return e.slice(0,a)},basename(e,t){t!==void 0&&Fr(t,`suffix`),Fr(e,`path`);let n=0,r=-1,i=!0,a;if(e.length>=2&&zr(e.charCodeAt(0))&&e.charCodeAt(1)===58&&(n=2),t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=n;--a){let c=e.charCodeAt(a);if(Lr(c)){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=n;--a)if(Lr(e.charCodeAt(a))){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){Fr(e,`path`);let t=0,n=-1,r=0,i=-1,a=!0,o=0;e.length>=2&&e.charCodeAt(1)===58&&zr(e.charCodeAt(0))&&(t=r=2);for(let s=e.length-1;s>=t;--s){let t=e.charCodeAt(s);if(Lr(t)){if(!a){r=s+1;break}continue}i===-1&&(a=!1,i=s+1),t===46?n===-1?n=s:o!==1&&(o=1):n!==-1&&(o=-1)}return n===-1||i===-1||o===0||o===1&&n===i-1&&n===r+1?``:e.slice(n,i)},format:Hr.bind(null,`\\`),parse(e){Fr(e,`path`);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.length,r=0,i=e.charCodeAt(0);if(n===1)return Lr(i)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Lr(i)){if(r=1,Lr(e.charCodeAt(1))){let t=2,i=t;for(;t<n&&!Lr(e.charCodeAt(t));)t++;if(t<n&&t!==i){for(i=t;t<n&&Lr(e.charCodeAt(t));)t++;if(t<n&&t!==i){for(i=t;t<n&&!Lr(e.charCodeAt(t));)t++;t===n?r=t:t!==i&&(r=t+1)}}}}else if(zr(i)&&e.charCodeAt(1)===58){if(n<=2)return t.root=t.dir=e,t;if(r=2,Lr(e.charCodeAt(2))){if(n===3)return t.root=t.dir=e,t;r=3}}r>0&&(t.root=e.slice(0,r));let a=-1,o=r,s=-1,c=!0,l=e.length-1,u=0;for(;l>=r;--l){if(i=e.charCodeAt(l),Lr(i)){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),i===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return s!==-1&&(a===-1||u===0||u===1&&a===s-1&&a===o+1?t.base=t.name=e.slice(o,s):(t.name=e.slice(o,a),t.base=e.slice(o,s),t.ext=e.slice(a,s))),o>0&&o!==r?t.dir=e.slice(0,o-1):t.dir=t.root,t},sep:`\\`,delimiter:`;`,win32:null,posix:null},Wr=(()=>{if(Ir){let e=/\\/g;return()=>{let t=Zn().replace(e,`/`);return t.slice(t.indexOf(`/`))}}return()=>Zn()})(),Gr={resolve(...e){let t=``,n=!1;for(let r=e.length-1;r>=0&&!n;r--){let i=e[r];Fr(i,`paths[${r}]`),i.length!==0&&(t=`${i}/${t}`,n=i.charCodeAt(0)===47)}if(!n){let e=Wr();t=`${e}/${t}`,n=e.charCodeAt(0)===47}return t=Br(t,!n,`/`,Rr),n?`/${t}`:t.length>0?t:`.`},normalize(e){if(Fr(e,`path`),e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=Br(e,!t,`/`,Rr),e.length===0?t?`/`:n?`./`:`.`:(n&&(e+=`/`),t?`/${e}`:e)},isAbsolute(e){return Fr(e,`path`),e.length>0&&e.charCodeAt(0)===47},join(...e){if(e.length===0)return`.`;let t=[];for(let n=0;n<e.length;++n){let r=e[n];Fr(r,`path`),r.length>0&&t.push(r)}return t.length===0?`.`:Gr.normalize(t.join(`/`))},relative(e,t){if(Fr(e,`from`),Fr(t,`to`),e===t||(e=Gr.resolve(e),t=Gr.resolve(t),e===t))return``;let n=e.length,r=n-1,i=t.length-1,a=r<i?r:i,o=-1,s=0;for(;s<a;s++){let n=e.charCodeAt(1+s);if(n!==t.charCodeAt(1+s))break;n===47&&(o=s)}if(s===a)if(i>a){if(t.charCodeAt(1+s)===47)return t.slice(1+s+1);if(s===0)return t.slice(1+s)}else r>a&&(e.charCodeAt(1+s)===47?o=s:s===0&&(o=0));let c=``;for(s=1+o+1;s<=n;++s)(s===n||e.charCodeAt(s)===47)&&(c+=c.length===0?`..`:`/..`);return`${c}${t.slice(1+o)}`},toNamespacedPath(e){return e},dirname(e){if(Fr(e,`path`),e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=-1,r=!0;for(let t=e.length-1;t>=1;--t)if(e.charCodeAt(t)===47){if(!r){n=t;break}}else r=!1;return n===-1?t?`/`:`.`:t&&n===1?`//`:e.slice(0,n)},basename(e,t){t!==void 0&&Fr(t,`suffix`),Fr(e,`path`);let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){Fr(e,`path`);let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e[o];if(s===`/`){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===`.`?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},format:Hr.bind(null,`/`),parse(e){Fr(e,`path`);let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.charCodeAt(0)===47,r;n?(t.root=`/`,r=1):r=0;let i=-1,a=0,o=-1,s=!0,c=e.length-1,l=0;for(;c>=r;--c){let t=e.charCodeAt(c);if(t===47){if(!s){a=c+1;break}continue}o===-1&&(s=!1,o=c+1),t===46?i===-1?i=c:l!==1&&(l=1):i!==-1&&(l=-1)}if(o!==-1){let r=a===0&&n?1:a;i===-1||l===0||l===1&&i===o-1&&i===a+1?t.base=t.name=e.slice(r,o):(t.name=e.slice(r,i),t.base=e.slice(r,o),t.ext=e.slice(i,o))}return a>0?t.dir=e.slice(0,a-1):n&&(t.dir=`/`),t},sep:`/`,delimiter:`:`,win32:null,posix:null};Gr.win32=Ur.win32=Ur,Gr.posix=Ur.posix=Gr;const Kr=Ir?Ur.normalize:Gr.normalize,qr=Ir?Ur.isAbsolute:Gr.isAbsolute,Jr=Ir?Ur.join:Gr.join,Yr=Ir?Ur.resolve:Gr.resolve,Xr=Ir?Ur.relative:Gr.relative,Zr=Ir?Ur.dirname:Gr.dirname,Qr=Ir?Ur.basename:Gr.basename,$r=Ir?Ur.extname:Gr.extname;Ir?Ur.parse:Gr.parse;const ei=Ir?Ur.sep:Gr.sep,ti=/^\w[\w\d+.-]*$/,ni=/^\//,ri=/^\/\//;function ii(e,t){if(!e.scheme&&t)throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!ti.test(e.scheme)){let t=[...e.scheme.matchAll(/[^\w\d+.-]/gu)],n=t.length>0?` Found '${t[0][0]}' at index ${t[0].index} (${t.length} total)`:``;throw Error(`[UriError]: Scheme contains illegal characters.${n} (len:${e.scheme.length})`)}if(e.path){if(e.authority){if(!ni.test(e.path))throw Error(`[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character`)}else if(ri.test(e.path))throw Error(`[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")`)}}function ai(e,t){return!e&&!t?`file`:e}function oi(e,t){switch(e){case`https`:case`http`:case`file`:t?t[0]!==si&&(t=si+t):t=si;break}return t}const si=`/`,ci=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;var C=class e{static isUri(t){return t instanceof e?!0:!t||typeof t!=`object`?!1:typeof t.authority==`string`&&typeof t.fragment==`string`&&typeof t.path==`string`&&typeof t.query==`string`&&typeof t.scheme==`string`&&typeof t.fsPath==`string`&&typeof t.with==`function`&&typeof t.toString==`function`}constructor(e,t,n,r,i,a=!1){typeof e==`object`?(this.scheme=e.scheme||``,this.authority=e.authority||``,this.path=e.path||``,this.query=e.query||``,this.fragment=e.fragment||``):(this.scheme=ai(e,a),this.authority=t||``,this.path=oi(this.scheme,n||``),this.query=r||``,this.fragment=i||``,ii(this,a))}get fsPath(){return hi(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:a}=e;return t===void 0?t=this.scheme:t===null&&(t=``),n===void 0?n=this.authority:n===null&&(n=``),r===void 0?r=this.path:r===null&&(r=``),i===void 0?i=this.query:i===null&&(i=``),a===void 0?a=this.fragment:a===null&&(a=``),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&a===this.fragment?this:new di(t,n,r,i,a)}static parse(e,t=!1){let n=ci.exec(e);return n?new di(n[2]||``,yi(n[4]||``),yi(n[5]||``),yi(n[7]||``),yi(n[9]||``),t):new di(``,``,``,``,``)}static file(e){let t=``;if(Tn&&(e=e.replace(/\\/g,`/`)),e[0]===`/`&&e[1]===`/`){let n=e.indexOf(`/`,2);n===-1?(t=e.substring(2),e=`/`):(t=e.substring(2,n),e=e.substring(n)||`/`)}return new di(`file`,t,e,``,``)}static from(e,t){return new di(e.scheme,e.authority,e.path,e.query,e.fragment,t)}static joinPath(t,...n){if(!t.path)throw Error(`[UriError]: cannot call joinPath on URI without path: ${t.toString()}`);let r;return r=Tn&&t.scheme===`file`?e.file(Ur.join(hi(t,!0),...n)).path:Gr.join(t.path,...n),t.with({path:r})}toString(e=!1){return gi(this,e)}toJSON(){return this}static revive(t){if(!t||t instanceof e)return t;{let e=new di(t);return e._formatted=t.external??null,e._fsPath=t._sep===ui?t.fsPath??null:null,e}}[Symbol.for(`debug.description`)](){return`URI(${this.toString()})`}};function li(e){return!e||typeof e!=`object`?!1:typeof e.scheme==`string`&&(typeof e.authority==`string`||e.authority===void 0)&&(typeof e.path==`string`||e.path===void 0)&&(typeof e.query==`string`||e.query===void 0)&&(typeof e.fragment==`string`||e.fragment===void 0)}const ui=Tn?1:void 0;var di=class extends C{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||=hi(this,!1),this._fsPath}toString(e=!1){return e?gi(this,!0):(this._formatted||=gi(this,!1),this._formatted)}toJSON(){let e={$mid:Mr.Uri};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ui),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}};const fi={[S.Colon]:`%3A`,[S.Slash]:`%2F`,[S.QuestionMark]:`%3F`,[S.Hash]:`%23`,[S.OpenSquareBracket]:`%5B`,[S.CloseSquareBracket]:`%5D`,[S.AtSign]:`%40`,[S.ExclamationMark]:`%21`,[S.DollarSign]:`%24`,[S.Ampersand]:`%26`,[S.SingleQuote]:`%27`,[S.OpenParen]:`%28`,[S.CloseParen]:`%29`,[S.Asterisk]:`%2A`,[S.Plus]:`%2B`,[S.Comma]:`%2C`,[S.Semicolon]:`%3B`,[S.Equals]:`%3D`,[S.Space]:`%20`};function pi(e,t,n){let r,i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);if(o>=S.a&&o<=S.z||o>=S.A&&o<=S.Z||o>=S.Digit0&&o<=S.Digit9||o===S.Dash||o===S.Period||o===S.Underline||o===S.Tilde||t&&o===S.Slash||n&&o===S.OpenSquareBracket||n&&o===S.CloseSquareBracket||n&&o===S.Colon)i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r!==void 0&&(r+=e.charAt(a));else{r===void 0&&(r=e.substr(0,a));let t=fi[o];t===void 0?i===-1&&(i=a):(i!==-1&&(r+=encodeURIComponent(e.substring(i,a)),i=-1),r+=t)}}return i!==-1&&(r+=encodeURIComponent(e.substring(i))),r===void 0?e:r}function mi(e){let t;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r===S.Hash||r===S.QuestionMark?(t===void 0&&(t=e.substr(0,n)),t+=fi[r]):t!==void 0&&(t+=e[n])}return t===void 0?e:t}function hi(e,t){let n;return n=e.authority&&e.path.length>1&&e.scheme===`file`?`//${e.authority}${e.path}`:e.path.charCodeAt(0)===S.Slash&&(e.path.charCodeAt(1)>=S.A&&e.path.charCodeAt(1)<=S.Z||e.path.charCodeAt(1)>=S.a&&e.path.charCodeAt(1)<=S.z)&&e.path.charCodeAt(2)===S.Colon?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,Tn&&(n=n.replace(/\//g,`\\`)),n}function gi(e,t){let n=t?mi:pi,r=``,{scheme:i,authority:a,path:o,query:s,fragment:c}=e;if(i&&(r+=i,r+=`:`),(a||i===`file`)&&(r+=`/`,r+=`/`),a){let e=a.indexOf(`@`);if(e!==-1){let t=a.substr(0,e);a=a.substr(e+1),e=t.lastIndexOf(`:`),e===-1?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=`:`,r+=n(t.substr(e+1),!1,!0)),r+=`@`}a=a.toLowerCase(),e=a.lastIndexOf(`:`),e===-1?r+=n(a,!1,!0):(r+=n(a.substr(0,e),!1,!0),r+=a.substr(e))}if(o){if(o.length>=3&&o.charCodeAt(0)===S.Slash&&o.charCodeAt(2)===S.Colon){let e=o.charCodeAt(1);e>=S.A&&e<=S.Z&&(o=`/${String.fromCharCode(e+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===S.Colon){let e=o.charCodeAt(0);e>=S.A&&e<=S.Z&&(o=`${String.fromCharCode(e+32)}:${o.substr(2)}`)}r+=n(o,!0,!1)}return s&&(r+=`?`,r+=n(s,!1,!1)),c&&(r+=`#`,r+=t?c:pi(c,!1,!1)),r}function _i(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+_i(e.substr(3)):e}}const vi=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function yi(e){return e.match(vi)?e.replace(vi,e=>_i(e)):e}var bi=class e{static{this.count=0}constructor(t){this._proxyIdentifierBrand=void 0,this.sid=t,this.nid=++e.count}};const xi=[];function w(e){let t=new bi(e);return xi[t.nid]=t,t}function Si(e){return xi[e].sid}var Ci=class{constructor(e){this.value=e}},wi;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(wi||={});var Ti;(function(e){e[e.UnknownInput=0]=`UnknownInput`,e[e.TextInput=1]=`TextInput`,e[e.TextDiffInput=2]=`TextDiffInput`,e[e.TextMergeInput=3]=`TextMergeInput`,e[e.NotebookInput=4]=`NotebookInput`,e[e.NotebookDiffInput=5]=`NotebookDiffInput`,e[e.CustomEditorInput=6]=`CustomEditorInput`,e[e.WebviewEditorInput=7]=`WebviewEditorInput`,e[e.TerminalEditorInput=8]=`TerminalEditorInput`,e[e.InteractiveEditorInput=9]=`InteractiveEditorInput`,e[e.ChatEditorInput=10]=`ChatEditorInput`,e[e.MultiDiffEditorInput=11]=`MultiDiffEditorInput`})(Ti||={});var Ei;(function(e){e[e.TAB_OPEN=0]=`TAB_OPEN`,e[e.TAB_CLOSE=1]=`TAB_CLOSE`,e[e.TAB_UPDATE=2]=`TAB_UPDATE`,e[e.TAB_MOVE=3]=`TAB_MOVE`})(Ei||={});var Di;(function(e){e[e.Editable=0]=`Editable`,e[e.SupportsHotExit=1]=`SupportsHotExit`})(Di||={});var Oi;(function(e){e[e.Int8Array=1]=`Int8Array`,e[e.Uint8Array=2]=`Uint8Array`,e[e.Uint8ClampedArray=3]=`Uint8ClampedArray`,e[e.Int16Array=4]=`Int16Array`,e[e.Uint16Array=5]=`Uint16Array`,e[e.Int32Array=6]=`Int32Array`,e[e.Uint32Array=7]=`Uint32Array`,e[e.Float32Array=8]=`Float32Array`,e[e.Float64Array=9]=`Float64Array`,e[e.BigInt64Array=10]=`BigInt64Array`,e[e.BigUint64Array=11]=`BigUint64Array`})(Oi||={});var ki;(function(e){e[e.Text=1]=`Text`,e[e.Error=2]=`Error`,e[e.Rich=3]=`Rich`})(ki||={});var Ai;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(Ai||={});var ji;(function(e){e[e.None=0]=`None`,e[e.Process=1]=`Process`,e[e.Output=2]=`Output`,e[e.Hybrid=3]=`Hybrid`})(ji||={});var Mi;(function(e){e.label=`a`,e.kind=`b`,e.detail=`c`,e.documentation=`d`,e.sortText=`e`,e.filterText=`f`,e.preselect=`g`,e.insertText=`h`,e.insertTextRules=`i`,e.range=`j`,e.commitCharacters=`k`,e.additionalTextEdits=`l`,e.kindModifier=`m`,e.commandIdent=`n`,e.commandId=`o`,e.commandArguments=`p`})(Mi||={});var Ni;(function(e){e.defaultRanges=`a`,e.completions=`b`,e.isIncomplete=`c`,e.duration=`d`})(Ni||={});var Pi;(function(e){e[e.Workspace=0]=`Workspace`,e[e.TextDocument=1]=`TextDocument`})(Pi||={});var Fi;(function(e){e.Header=`header`,e.WellKnown=`wellKnown`,e.None=`none`})(Fi||={});var Ii;(function(e){e.ResourceMetadata=`resourceMetadata`,e.WellKnown=`wellKnown`,e.Default=`default`})(Ii||={});var Li;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(Li||={});var Ri;(function(e){e[e.Head=0]=`Head`,e[e.RemoteHead=1]=`RemoteHead`,e[e.Tag=2]=`Tag`})(Ri||={});const T={MainThreadAuthentication:w(`MainThreadAuthentication`),MainThreadBulkEdits:w(`MainThreadBulkEdits`),MainThreadLanguageModels:w(`MainThreadLanguageModels`),MainThreadEmbeddings:w(`MainThreadEmbeddings`),MainThreadChatAgents2:w(`MainThreadChatAgents2`),MainThreadCodeMapper:w(`MainThreadCodeMapper`),MainThreadLanguageModelTools:w(`MainThreadChatSkills`),MainThreadGitExtension:w(`MainThreadGitExtension`),MainThreadClipboard:w(`MainThreadClipboard`),MainThreadCommands:w(`MainThreadCommands`),MainThreadComments:w(`MainThreadComments`),MainThreadConfiguration:w(`MainThreadConfiguration`),MainThreadConsole:w(`MainThreadConsole`),MainThreadDebugService:w(`MainThreadDebugService`),MainThreadDecorations:w(`MainThreadDecorations`),MainThreadDiagnostics:w(`MainThreadDiagnostics`),MainThreadDialogs:w(`MainThreadDiaglogs`),MainThreadDocuments:w(`MainThreadDocuments`),MainThreadDocumentContentProviders:w(`MainThreadDocumentContentProviders`),MainThreadTextEditors:w(`MainThreadTextEditors`),MainThreadEditorInsets:w(`MainThreadEditorInsets`),MainThreadEditorTabs:w(`MainThreadEditorTabs`),MainThreadErrors:w(`MainThreadErrors`),MainThreadTreeViews:w(`MainThreadTreeViews`),MainThreadDownloadService:w(`MainThreadDownloadService`),MainThreadLanguageFeatures:w(`MainThreadLanguageFeatures`),MainThreadLanguages:w(`MainThreadLanguages`),MainThreadLogger:w(`MainThreadLogger`),MainThreadMessageService:w(`MainThreadMessageService`),MainThreadOutputService:w(`MainThreadOutputService`),MainThreadProgress:w(`MainThreadProgress`),MainThreadQuickDiff:w(`MainThreadQuickDiff`),MainThreadDocumentDiff:w(`MainThreadDocumentDiff`),MainThreadQuickOpen:w(`MainThreadQuickOpen`),MainThreadStatusBar:w(`MainThreadStatusBar`),MainThreadSecretState:w(`MainThreadSecretState`),MainThreadStorage:w(`MainThreadStorage`),MainThreadSpeech:w(`MainThreadSpeechProvider`),MainThreadTelemetry:w(`MainThreadTelemetry`),MainThreadMeteredConnection:w(`MainThreadMeteredConnection`),MainThreadTerminalService:w(`MainThreadTerminalService`),MainThreadTerminalShellIntegration:w(`MainThreadTerminalShellIntegration`),MainThreadWebviews:w(`MainThreadWebviews`),MainThreadWebviewPanels:w(`MainThreadWebviewPanels`),MainThreadWebviewViews:w(`MainThreadWebviewViews`),MainThreadCustomEditors:w(`MainThreadCustomEditors`),MainThreadUrls:w(`MainThreadUrls`),MainThreadUriOpeners:w(`MainThreadUriOpeners`),MainThreadProfileContentHandlers:w(`MainThreadProfileContentHandlers`),MainThreadWorkspace:w(`MainThreadWorkspace`),MainThreadFileSystem:w(`MainThreadFileSystem`),MainThreadFileSystemEventService:w(`MainThreadFileSystemEventService`),MainThreadExtensionService:w(`MainThreadExtensionService`),MainThreadSCM:w(`MainThreadSCM`),MainThreadSearch:w(`MainThreadSearch`),MainThreadShare:w(`MainThreadShare`),MainThreadTask:w(`MainThreadTask`),MainThreadWindow:w(`MainThreadWindow`),MainThreadPower:w(`MainThreadPower`),MainThreadLabelService:w(`MainThreadLabelService`),MainThreadNotebook:w(`MainThreadNotebook`),MainThreadNotebookDocuments:w(`MainThreadNotebookDocumentsShape`),MainThreadNotebookEditors:w(`MainThreadNotebookEditorsShape`),MainThreadNotebookKernels:w(`MainThreadNotebookKernels`),MainThreadNotebookRenderers:w(`MainThreadNotebookRenderers`),MainThreadInteractive:w(`MainThreadInteractive`),MainThreadTheming:w(`MainThreadTheming`),MainThreadTunnelService:w(`MainThreadTunnelService`),MainThreadManagedSockets:w(`MainThreadManagedSockets`),MainThreadTimeline:w(`MainThreadTimeline`),MainThreadTesting:w(`MainThreadTesting`),MainThreadLocalization:w(`MainThreadLocalizationShape`),MainThreadMcp:w(`MainThreadMcpShape`),MainThreadAiRelatedInformation:w(`MainThreadAiRelatedInformation`),MainThreadAiEmbeddingVector:w(`MainThreadAiEmbeddingVector`),MainThreadChatStatus:w(`MainThreadChatStatus`),MainThreadChatQuota:w(`MainThreadChatQuota`),MainThreadChatInputNotification:w(`MainThreadChatInputNotification`),MainThreadAiSettingsSearch:w(`MainThreadAiSettingsSearch`),MainThreadDataChannels:w(`MainThreadDataChannels`),MainThreadChatSessions:w(`MainThreadChatSessions`),MainThreadChatOutputRenderer:w(`MainThreadChatOutputRenderer`),MainThreadChatContext:w(`MainThreadChatContext`),MainThreadChatDebug:w(`MainThreadChatDebug`),MainThreadBrowsers:w(`MainThreadBrowsers`)},E={ExtHostCodeMapper:w(`ExtHostCodeMapper`),ExtHostCommands:w(`ExtHostCommands`),ExtHostConfiguration:w(`ExtHostConfiguration`),ExtHostDiagnostics:w(`ExtHostDiagnostics`),ExtHostDebugService:w(`ExtHostDebugService`),ExtHostDecorations:w(`ExtHostDecorations`),ExtHostDocumentsAndEditors:w(`ExtHostDocumentsAndEditors`),ExtHostDocuments:w(`ExtHostDocuments`),ExtHostDocumentContentProviders:w(`ExtHostDocumentContentProviders`),ExtHostDocumentSaveParticipant:w(`ExtHostDocumentSaveParticipant`),ExtHostEditors:w(`ExtHostEditors`),ExtHostTreeViews:w(`ExtHostTreeViews`),ExtHostFileSystem:w(`ExtHostFileSystem`),ExtHostFileSystemInfo:w(`ExtHostFileSystemInfo`),ExtHostFileSystemEventService:w(`ExtHostFileSystemEventService`),ExtHostLanguages:w(`ExtHostLanguages`),ExtHostLanguageFeatures:w(`ExtHostLanguageFeatures`),ExtHostQuickOpen:w(`ExtHostQuickOpen`),ExtHostQuickDiff:w(`ExtHostQuickDiff`),ExtHostStatusBar:w(`ExtHostStatusBar`),ExtHostShare:w(`ExtHostShare`),ExtHostExtensionService:w(`ExtHostExtensionService`),ExtHostLogLevelServiceShape:w(`ExtHostLogLevelServiceShape`),ExtHostTerminalService:w(`ExtHostTerminalService`),ExtHostTerminalShellIntegration:w(`ExtHostTerminalShellIntegration`),ExtHostSCM:w(`ExtHostSCM`),ExtHostSearch:w(`ExtHostSearch`),ExtHostTask:w(`ExtHostTask`),ExtHostWorkspace:w(`ExtHostWorkspace`),ExtHostWindow:w(`ExtHostWindow`),ExtHostPower:w(`ExtHostPower`),ExtHostWebviews:w(`ExtHostWebviews`),ExtHostWebviewPanels:w(`ExtHostWebviewPanels`),ExtHostCustomEditors:w(`ExtHostCustomEditors`),ExtHostWebviewViews:w(`ExtHostWebviewViews`),ExtHostEditorInsets:w(`ExtHostEditorInsets`),ExtHostEditorTabs:w(`ExtHostEditorTabs`),ExtHostProgress:w(`ExtHostProgress`),ExtHostComments:w(`ExtHostComments`),ExtHostSecretState:w(`ExtHostSecretState`),ExtHostStorage:w(`ExtHostStorage`),ExtHostUrls:w(`ExtHostUrls`),ExtHostUriOpeners:w(`ExtHostUriOpeners`),ExtHostChatOutputRenderer:w(`ExtHostChatOutputRenderer`),ExtHostProfileContentHandlers:w(`ExtHostProfileContentHandlers`),ExtHostOutputService:w(`ExtHostOutputService`),ExtHostLabelService:w(`ExtHostLabelService`),ExtHostNotebook:w(`ExtHostNotebook`),ExtHostNotebookDocuments:w(`ExtHostNotebookDocuments`),ExtHostNotebookEditors:w(`ExtHostNotebookEditors`),ExtHostNotebookKernels:w(`ExtHostNotebookKernels`),ExtHostNotebookRenderers:w(`ExtHostNotebookRenderers`),ExtHostNotebookDocumentSaveParticipant:w(`ExtHostNotebookDocumentSaveParticipant`),ExtHostInteractive:w(`ExtHostInteractive`),ExtHostChatAgents2:w(`ExtHostChatAgents`),ExtHostLanguageModelTools:w(`ExtHostChatSkills`),ExtHostChatProvider:w(`ExtHostChatProvider`),ExtHostChatContext:w(`ExtHostChatContext`),ExtHostChatDebug:w(`ExtHostChatDebug`),ExtHostSpeech:w(`ExtHostSpeech`),ExtHostEmbeddings:w(`ExtHostEmbeddings`),ExtHostAiRelatedInformation:w(`ExtHostAiRelatedInformation`),ExtHostAiEmbeddingVector:w(`ExtHostAiEmbeddingVector`),ExtHostAiSettingsSearch:w(`ExtHostAiSettingsSearch`),ExtHostTheming:w(`ExtHostTheming`),ExtHostTunnelService:w(`ExtHostTunnelService`),ExtHostManagedSockets:w(`ExtHostManagedSockets`),ExtHostAuthentication:w(`ExtHostAuthentication`),ExtHostTimeline:w(`ExtHostTimeline`),ExtHostTesting:w(`ExtHostTesting`),ExtHostTelemetry:w(`ExtHostTelemetry`),ExtHostMeteredConnection:w(`ExtHostMeteredConnection`),ExtHostLocalization:w(`ExtHostLocalization`),ExtHostMcp:w(`ExtHostMcp`),ExtHostDataChannels:w(`ExtHostDataChannels`),ExtHostChatSessions:w(`ExtHostChatSessions`),ExtHostChatQuota:w(`ExtHostChatQuota`),ExtHostGitExtension:w(`ExtHostGitExtension`),ExtHostBrowsers:w(`ExtHostBrowsers`)},zi=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}});var Bi;(function(e){function t(t){return t===e.None||t===e.Cancelled||t instanceof Vi?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ir.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zi})})(Bi||={});var Vi=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?zi:(this._emitter||=new x,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},Hi=class{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||=new Vi,this._token}cancel(){this._token?this._token instanceof Vi&&this._token.cancel():this._token=Bi.Cancelled}dispose(e=!1){e&&this.cancel(),this._parentListener?.dispose(),this._token?this._token instanceof Vi&&this._token.dispose():this._token=Bi.None}};function Ui(e){return e}var Wi=class{constructor(e,t){this.lastCache=void 0,this.lastArgKey=void 0,typeof e==`function`?(this._fn=e,this._computeKey=Ui):(this._fn=t,this._computeKey=e.getCacheKey)}get(e){let t=this._computeKey(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this._fn(e)),this.lastCache}},Gi;(function(e){e[e.MAX_SAFE_SMALL_INTEGER=1073741824]=`MAX_SAFE_SMALL_INTEGER`,e[e.MIN_SAFE_SMALL_INTEGER=-1073741824]=`MIN_SAFE_SMALL_INTEGER`,e[e.MAX_UINT_8=255]=`MAX_UINT_8`,e[e.MAX_UINT_16=65535]=`MAX_UINT_16`,e[e.MAX_UINT_32=4294967295]=`MAX_UINT_32`,e[e.UNICODE_SUPPLEMENTARY_PLANE_BEGIN=65536]=`UNICODE_SUPPLEMENTARY_PLANE_BEGIN`})(Gi||={});function Ki(e){return e<0?0:e>Gi.MAX_UINT_8?Gi.MAX_UINT_8:e|0}function qi(e){return e<0?0:e>Gi.MAX_UINT_32?Gi.MAX_UINT_32:e|0}function Ji(e){return!e||typeof e!=`string`?!0:e.trim().length===0}const Yi=/{(\d+)}/g;function Xi(e,...t){return t.length===0?e:e.replace(Yi,function(e,n){let r=parseInt(n,10);return isNaN(r)||r<0||r>=t.length?e:t[r]})}const Zi=/{([^}]+)}/g;function Qi(e,t){return Object.keys(t).length===0?e:e.replace(Zi,(e,n)=>t[n]??e)}function $i(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,`\\$&`)}function ea(e,t){let n=0,r=e.indexOf(t);for(;r!==-1;)n++,r=e.indexOf(t,r+t.length);return n}function ta(e,t){if(!e||!t)return e;let n=t.length,r=0;if(n===1){let n=t.charCodeAt(0);for(;r<e.length&&e.charCodeAt(r)===n;)r++}else for(;e.startsWith(t,r);)r+=n;return e.substring(r)}function na(e,t){if(!e||!t)return e;let n=t.length,r=e.length;if(n===1){let n=r,i=t.charCodeAt(0);for(;n>0&&e.charCodeAt(n-1)===i;)n--;return e.substring(0,n)}let i=r;for(;i>0&&e.endsWith(t,i);)i-=n;return e.substring(0,i)}function ra(e,t,n={}){if(!e)throw Error(`Cannot create regex from empty string`);t||(e=$i(e)),n.wholeWord&&(/\B/.test(e.charAt(0))||(e=`\\b`+e),/\B/.test(e.charAt(e.length-1))||(e+=`\\b`));let r=``;return n.global&&(r+=`g`),n.matchCase||(r+=`i`),n.multiline&&(r+=`m`),n.unicode&&(r+=`u`),new RegExp(e,r)}function ia(e){return e.source===`^`||e.source===`^$`||e.source===`$`||e.source===`^\\s*$`?!1:!!(e.exec(``)&&e.lastIndex===0)}function aa(e){return e.split(/\r\n|\r|\n/)}function oa(e){for(let t=0,n=e.length;t<n;t++){let n=e.charCodeAt(t);if(n!==S.Space&&n!==S.Tab)return t}return-1}function sa(e,t=e.length-1){for(let n=t;n>=0;n--){let t=e.charCodeAt(n);if(t!==S.Space&&t!==S.Tab)return n}return-1}function ca(e,t){return e<t?-1:+(e>t)}function la(e,t,n=0,r=e.length,i=0,a=t.length){for(;n<r&&i<a;n++,i++){let r=e.charCodeAt(n),a=t.charCodeAt(i);if(r<a)return-1;if(r>a)return 1}let o=r-n,s=a-i;return o<s?-1:+(o>s)}function ua(e,t){return da(e,t,0,e.length,0,t.length)}function da(e,t,n=0,r=e.length,i=0,a=t.length){for(;n<r&&i<a;n++,i++){let o=e.charCodeAt(n),s=t.charCodeAt(i);if(o===s)continue;if(o>=128||s>=128)return la(e.toLowerCase(),t.toLowerCase(),n,r,i,a);fa(o)&&(o-=32),fa(s)&&(s-=32);let c=o-s;if(c!==0)return c}let o=r-n,s=a-i;return o<s?-1:+(o>s)}function fa(e){return e>=S.a&&e<=S.z}function pa(e,t){return e.length===t.length&&da(e,t)===0}function ma(e,t,n){return e===t||!!n&&e!==void 0&&t!==void 0&&pa(e,t)}function ha(e,t){let n=t.length;return n<=e.length&&da(e,t,0,n)===0}function ga(e,t){let n=e.length,r=n-t.length;return r>=0&&da(e,t,r,n)===0}function _a(e,t){let n=Math.min(e.length,t.length),r;for(r=0;r<n;r++)if(e.charCodeAt(r)!==t.charCodeAt(r))return r;return n}function va(e){return 55296<=e&&e<=56319}function ya(e){return 56320<=e&&e<=57343}function ba(e,t){return(e-55296<<10)+(t-56320)+65536}function xa(e,t,n){let r=e.charCodeAt(n);if(va(r)&&n+1<t){let t=e.charCodeAt(n+1);if(ya(t))return ba(r,t)}return r}function Sa(e,t){let n=e.charCodeAt(t-1);if(ya(n)&&t>1){let r=e.charCodeAt(t-2);if(va(r))return ba(r,n)}return n}var Ca=class{get offset(){return this._offset}constructor(e,t=0){this._str=e,this._len=e.length,this._offset=t}setOffset(e){this._offset=e}prevCodePoint(){let e=Sa(this._str,this._offset);return this._offset-=e>=Gi.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,e}nextCodePoint(){let e=xa(this._str,this._len,this._offset);return this._offset+=e>=Gi.UNICODE_SUPPLEMENTARY_PLANE_BEGIN?2:1,e}eol(){return this._offset>=this._len}},wa=class{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new Ca(e,t)}nextGraphemeLength(){let e=za.getInstance(),t=this._iterator,n=t.offset,r=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){let n=t.offset,i=e.getGraphemeBreakType(t.nextCodePoint());if(La(r,i)){t.setOffset(n);break}r=i}return t.offset-n}prevGraphemeLength(){let e=za.getInstance(),t=this._iterator,n=t.offset,r=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){let n=t.offset,i=e.getGraphemeBreakType(t.prevCodePoint());if(La(i,r)){t.setOffset(n);break}r=i}return n-t.offset}eol(){return this._iterator.eol()}};function Ta(e,t){return new wa(e,t).nextGraphemeLength()}let Ea;function Da(){return/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/}function Oa(e){return Ea||=Da(),Ea.test(e)}const ka=/^[\t\n\r\x20-\x7E]*$/;function Aa(e){return ka.test(e)}const ja=/[\u2028\u2029]/;function Ma(e){return ja.test(e)}RegExp(`(?:`+[`(?:\\x1b\\[|\\x9b)[=?>!]?[\\d;:]*["$#'* ]?[a-zA-Z@^\`{}|~]`,`(?:\\x1b\\]|\\x9d).*?(?:\\x1b\\\\|\\x07|\\x9c)`,`\\x1b(?:[ #%\\(\\)\\*\\+\\-\\.\\/]?[a-zA-Z0-9\\|}~@])`].join(`|`)+`)`,`g`);const Na=String.fromCharCode(S.UTF8_BOM);function Pa(e){return!!(e&&e.length>0&&e.charCodeAt(0)===S.UTF8_BOM)}function Fa(e,t=!1){return e?(t&&(e=e.replace(/\\./g,``)),e.toLowerCase()!==e):!1}function Ia(e,t=1){if(t===0)return``;let n=-1;do n=e.indexOf(`
|
|
14
|
+
`,n+1),t--;while(t>0&&n>=0);return n===-1?e:(e[n-1]===`\r`&&n--,e.substr(0,n))}function La(e,t){return e===Ra.Other?t!==Ra.Extend&&t!==Ra.SpacingMark:e===Ra.CR&&t===Ra.LF?!1:e===Ra.Control||e===Ra.CR||e===Ra.LF||t===Ra.Control||t===Ra.CR||t===Ra.LF?!0:!(e===Ra.L&&(t===Ra.L||t===Ra.V||t===Ra.LV||t===Ra.LVT)||(e===Ra.LV||e===Ra.V)&&(t===Ra.V||t===Ra.T)||(e===Ra.LVT||e===Ra.T)&&t===Ra.T||t===Ra.Extend||t===Ra.ZWJ||t===Ra.SpacingMark||e===Ra.Prepend||e===Ra.ZWJ&&t===Ra.Extended_Pictographic||e===Ra.Regional_Indicator&&t===Ra.Regional_Indicator)}var Ra;(function(e){e[e.Other=0]=`Other`,e[e.Prepend=1]=`Prepend`,e[e.CR=2]=`CR`,e[e.LF=3]=`LF`,e[e.Control=4]=`Control`,e[e.Extend=5]=`Extend`,e[e.Regional_Indicator=6]=`Regional_Indicator`,e[e.SpacingMark=7]=`SpacingMark`,e[e.L=8]=`L`,e[e.V=9]=`V`,e[e.T=10]=`T`,e[e.LV=11]=`LV`,e[e.LVT=12]=`LVT`,e[e.ZWJ=13]=`ZWJ`,e[e.Extended_Pictographic=14]=`Extended_Pictographic`})(Ra||={});var za=class e{static{this._INSTANCE=null}static getInstance(){return e._INSTANCE||=new e,e._INSTANCE}constructor(){this._data=Ba()}getGraphemeBreakType(e){if(e<32)return e===S.LineFeed?Ra.LF:e===S.CarriageReturn?Ra.CR:Ra.Control;if(e<127)return Ra.Other;let t=this._data,n=t.length/3,r=1;for(;r<=n;)if(e<t[3*r])r=2*r;else if(e>t[3*r+1])r=2*r+1;else return t[3*r+2];return Ra.Other}};function Ba(){return JSON.parse(`[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]`)}var Va;(function(e){e[e.zwj=8205]=`zwj`,e[e.emojiVariantSelector=65039]=`emojiVariantSelector`,e[e.enclosingKeyCap=8419]=`enclosingKeyCap`,e[e.space=32]=`space`})(Va||={}),class e{static{this.ambiguousCharacterData=new u(()=>JSON.parse(`{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}`))}static{this.cache=new Wi(t=>{let n=t.split(`,`);function r(e){let t=new Map;for(let n=0;n<e.length;n+=2)t.set(e[n],e[n+1]);return t}function i(e,t){let n=new Map(e);for(let[e,r]of t)n.set(e,r);return n}function a(e,t){if(!e)return t;let n=new Map;for(let[r,i]of e)t.has(r)&&n.set(r,i);return n}let o=this.ambiguousCharacterData.value,s=n.filter(e=>!e.startsWith(`_`)&&Object.hasOwn(o,e));s.length===0&&(s=[`_default`]);let c;for(let e of s){let t=r(o[e]);c=a(c,t)}return new e(i(r(o._common),c))})}static getInstance(t){return e.cache.get(Array.from(t).join(`,`))}static{this._locales=new u(()=>Object.keys(e.ambiguousCharacterData.value).filter(e=>!e.startsWith(`_`)))}static getLocales(){return e._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}containsAmbiguousCharacter(e){for(let t=0;t<e.length;t++){let n=e.codePointAt(t);if(typeof n==`number`&&this.isAmbiguous(n))return!0}return!1}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}},class e{static getRawData(){return JSON.parse(`{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}`)}static{this._data=void 0}static getData(){return this._data||=new Set([...Object.values(e.getRawData())].flat()),this._data}static isInvisibleCharacter(t){return e.getData().has(t)}static containsInvisibleCharacter(t){for(let n=0;n<t.length;n++){let r=t.codePointAt(n);if(typeof r==`number`&&(e.isInvisibleCharacter(r)||r===Va.space))return!0}return!1}static get codePoints(){return e.getData()}};function Ha(e){return e===S.Slash||e===S.Backslash}function Ua(e){return e.replace(/[\\/]/g,Gr.sep)}function Wa(e){return e.indexOf(`/`)===-1&&(e=Ua(e)),/^[a-zA-Z]:(\/|$)/.test(e)&&(e=`/`+e),e}function Ga(e,t=Gr.sep){if(!e)return``;let n=e.length,r=e.charCodeAt(0);if(Ha(r)){if(Ha(e.charCodeAt(1))&&!Ha(e.charCodeAt(2))){let r=3,i=r;for(;r<n&&!Ha(e.charCodeAt(r));r++);if(i!==r&&!Ha(e.charCodeAt(r+1))){for(r+=1;r<n;r++)if(Ha(e.charCodeAt(r)))return e.slice(0,r+1).replace(/[\\/]/g,t)}}return t}else if(qa(r)&&e.charCodeAt(1)===S.Colon)return Ha(e.charCodeAt(2))?e.slice(0,2)+t:e.slice(0,2);let i=e.indexOf(`://`);if(i!==-1){for(i+=3;i<n;i++)if(Ha(e.charCodeAt(i)))return e.slice(0,i+1)}return``}function Ka(e,t,n,r=!1){let i=r?Gr.sep:ei;if(e===t)return!0;if(!e||!t||((e.indexOf(`..`)>=0||t.indexOf(`..`)>=0)&&(e=r?Gr.normalize(e):Kr(e),t=r?Gr.normalize(t):Kr(t)),t.length>e.length))return!1;if(n){if(!ha(e,t))return!1;if(t.length===e.length)return!0;let n=t.length;return t.charAt(t.length-1)===i&&n--,e.charAt(n)===i}return t.charAt(t.length-1)!==i&&(t+=i),e.indexOf(t)===0}function qa(e){return e>=S.A&&e<=S.Z||e>=S.a&&e<=S.z}function Ja(e,t=Tn){return t?qa(e.charCodeAt(0))&&e.charCodeAt(1)===S.Colon:!1}var D;(function(e){e.inMemory=`inmemory`,e.vscode=`vscode`,e.internal=`private`,e.walkThrough=`walkThrough`,e.walkThroughSnippet=`walkThroughSnippet`,e.http=`http`,e.https=`https`,e.file=`file`,e.mailto=`mailto`,e.untitled=`untitled`,e.data=`data`,e.command=`command`,e.vscodeRemote=`vscode-remote`,e.vscodeRemoteResource=`vscode-remote-resource`,e.vscodeManagedRemoteResource=`vscode-managed-remote-resource`,e.vscodeUserData=`vscode-userdata`,e.vscodeCustomEditor=`vscode-custom-editor`,e.vscodeNotebookCell=`vscode-notebook-cell`,e.vscodeNotebookCellMetadata=`vscode-notebook-cell-metadata`,e.vscodeNotebookCellMetadataDiff=`vscode-notebook-cell-metadata-diff`,e.vscodeNotebookCellOutput=`vscode-notebook-cell-output`,e.vscodeNotebookCellOutputDiff=`vscode-notebook-cell-output-diff`,e.vscodeNotebookMetadata=`vscode-notebook-metadata`,e.vscodeInteractiveInput=`vscode-interactive-input`,e.vscodeSettings=`vscode-settings`,e.vscodeWorkspaceTrust=`vscode-workspace-trust`,e.vscodeTerminal=`vscode-terminal`,e.vscodeImageCarousel=`vscode-image-carousel`,e.vscodeChatCodeBlock=`vscode-chat-code-block`,e.vscodeChatCodeCompareBlock=`vscode-chat-code-compare-block`,e.vscodeChatEditor=`vscode-chat-editor`,e.vscodeChatInput=`chatSessionInput`,e.vscodeLocalChatSession=`vscode-chat-session`,e.webviewPanel=`webview-panel`,e.vscodeWebview=`vscode-webview`,e.vscodeBrowser=`vscode-browser`,e.extension=`extension`,e.vscodeFileResource=`vscode-file`,e.tmp=`tmp`,e.vsls=`vsls`,e.vscodeSourceControl=`vscode-scm`,e.commentsInput=`comment`,e.codeSetting=`code-setting`,e.outputChannel=`output`,e.accessibleView=`accessible-view`,e.chatEditingSnapshotScheme=`chat-editing-snapshot-text-model`,e.chatEditingModel=`chat-editing-text-model`,e.copilotPr=`copilot-pr`})(D||={});function Ya(e,t){return C.isUri(e)?pa(e.scheme,t):ha(e,t+`:`)}function Xa(e,...t){return t.some(t=>Ya(e,t))}const Za=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema=`http`,this._delegate=null,this._serverRootPath=`/`}setPreferredWebSchema(e){this._preferredWebSchema=e}setDelegate(e){this._delegate=e}setServerRootPath(e,t){this._serverRootPath=Gr.join(t??`/`,Qa(e))}getServerRootPath(){return this._serverRootPath}get _remoteResourcesPath(){return Gr.join(this._serverRootPath,D.vscodeRemoteResource)}set(e,t,n){this._hosts[e]=t,this._ports[e]=n}setConnectionToken(e,t){this._connectionTokens[e]=t}getPreferredWebSchema(){return this._preferredWebSchema}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(t){return ee(t),e}let t=e.authority,n=this._hosts[t];n&&n.indexOf(`:`)!==-1&&n.indexOf(`[`)===-1&&(n=`[${n}]`);let r=this._ports[t],i=this._connectionTokens[t],a=`path=${encodeURIComponent(e.path)}`;return typeof i==`string`&&(a+=`&tkn=${encodeURIComponent(i)}`),C.from({scheme:kn?this._preferredWebSchema:D.vscodeRemoteResource,authority:`${n}:${r}`,path:this._remoteResourcesPath,query:a})}};function Qa(e){return`${e.quality??`oss`}-${e.commit??`dev`}`}new class e{constructor(){this.staticBrowserUris=new He,this.appResourcePathUrls=new Map,this.appResourceUrlMapper=[]}static{this.FALLBACK_AUTHORITY=`vscode-app`}registerAppResourcePathUrl(e,t){this.appResourcePathUrls.set(e,t)}registerAppResourceLoader(e){this.appResourceUrlMapper.push(e)}toUrl(e){let t=this.appResourcePathUrls.get(e);typeof t==`function`&&(t=t());for(let t of this.appResourceUrlMapper){let n=t(e);if(n)return n}return new URL(t??e,globalThis.location?.href??import.meta.url).toString()}asBrowserUri(e){let t=this.toUri(e);return this.uriToBrowserUri(t)}uriToBrowserUri(t){return t.scheme===D.vscodeRemote?Za.rewrite(t):t.scheme===D.file&&(On||jn===`${D.vscodeFileResource}://${e.FALLBACK_AUTHORITY}`)?t.with({scheme:D.vscodeFileResource,authority:t.authority||e.FALLBACK_AUTHORITY,query:null,fragment:null}):this.staticBrowserUris.get(t)??t}asFileUri(e){let t=this.toUri(e);return this.uriToFileUri(t)}uriToFileUri(t){return t.scheme===D.vscodeFileResource?t.with({scheme:D.file,authority:t.authority===e.FALLBACK_AUTHORITY?null:t.authority,query:null,fragment:null}):t}toUri(e){if(C.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){let t=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(t))return C.joinPath(C.parse(t,!0),e);let n=Jr(t,e);return C.file(n)}return C.parse(this.toUrl(e))}registerStaticBrowserUri(e,t){return this.staticBrowserUris.set(e,t),g(()=>{this.staticBrowserUris.get(e)===t&&this.staticBrowserUris.delete(e)})}getRegisteredBrowserUris(){return this.staticBrowserUris.keys()}};var $a;(function(e){let t=new Map([[`1`,{"Cross-Origin-Opener-Policy":`same-origin`}],[`2`,{"Cross-Origin-Embedder-Policy":`require-corp`}],[`3`,{"Cross-Origin-Opener-Policy":`same-origin`,"Cross-Origin-Embedder-Policy":`require-corp`}]]);e.CoopAndCoep=Object.freeze(t.get(`3`));let n=`vscode-coi`;function r(e){let r;typeof e==`string`?r=new URL(e).searchParams:e instanceof URL?r=e.searchParams:C.isUri(e)&&(r=new URL(e.toString(!0)).searchParams);let i=r?.get(n);if(i)return t.get(i)}e.getHeadersFromQuery=r;function i(e,t,r){if(!globalThis.crossOriginIsolated)return;let i=t&&r?`3`:r?`2`:`1`;e instanceof URLSearchParams?e.set(n,i):e[n]=i}e.addSearchParam=i})($a||={});function eo(e){return hi(e,!0)}var to=class{constructor(e){this._ignorePathCasing=e}compare(e,t,n=!1){return e===t?0:ca(this.getComparisonKey(e,n),this.getComparisonKey(t,n))}isEqual(e,t,n=!1){return e===t?!0:!e||!t?!1:this.getComparisonKey(e,n)===this.getComparisonKey(t,n)}getComparisonKey(e,t=!1){return e.with({path:this._ignorePathCasing(e)?e.path.toLowerCase():void 0,fragment:t?null:void 0}).toString()}ignorePathCasing(e){return this._ignorePathCasing(e)}isEqualOrParent(e,t,n=!1){if(e.scheme===t.scheme){if(e.scheme===D.file)return Ka(eo(e),eo(t),this._ignorePathCasing(e))&&e.query===t.query&&(n||e.fragment===t.fragment);if(mo(e.authority,t.authority))return Ka(e.path,t.path,this._ignorePathCasing(e),!0)&&e.query===t.query&&(n||e.fragment===t.fragment)}return!1}joinPath(e,...t){return C.joinPath(e,...t)}basenameOrAuthority(e){return so(e)||e.authority}basename(e,t){return Gr.basename(e.path,t)}extname(e){return Gr.extname(e.path)}dirname(e){if(e.path.length===0)return e;let t;return e.scheme===D.file?t=C.file(Zr(eo(e))).path:(t=Gr.dirname(e.path),e.authority&&t.length&&t.charCodeAt(0)!==S.Slash&&(console.error(`dirname("${e.toString})) resulted in a relative path`),t=`/`)),e.with({path:t})}normalizePath(e){if(!e.path.length)return e;let t;return t=e.scheme===D.file?C.file(Kr(eo(e))).path:Gr.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!mo(e.authority,t.authority))return;if(e.scheme===D.file){let n=Xr(eo(e),eo(t));return Tn?Ua(n):n}let n=e.path||`/`,r=t.path||`/`;if(this._ignorePathCasing(e)){let e=0;for(let t=Math.min(n.length,r.length);e<t&&!(n.charCodeAt(e)!==r.charCodeAt(e)&&n.charAt(e).toLowerCase()!==r.charAt(e).toLowerCase());e++);n=r.substr(0,e)+n.substr(e)}return Gr.relative(n,r)}resolvePath(e,t){if(e.scheme===D.file){let n=C.file(Yr(eo(e),t));return e.with({authority:n.authority,path:n.path})}return t=Wa(t),e.with({path:Gr.resolve(e.path,t)})}isAbsolutePath(e){return!!e.path&&e.path[0]===`/`}isEqualAuthority(e,t){return e===t||e!==void 0&&t!==void 0&&pa(e,t)}hasTrailingPathSeparator(e,t=ei){if(e.scheme===D.file){let n=eo(e);return n.length>Ga(n).length&&n[n.length-1]===t}else{let t=e.path;return t.length>1&&t.charCodeAt(t.length-1)===S.Slash&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=ei){return ho(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=ei){let n=!1;if(e.scheme===D.file){let r=eo(e);n=r!==void 0&&r.length===Ga(r).length&&r[r.length-1]===t}else{t=`/`;let r=e.path;n=r.length===1&&r.charCodeAt(r.length-1)===S.Slash}return!n&&!ho(e,t)?e.with({path:e.path+`/`}):e}};const no=new to(()=>!1),ro=new to(e=>e.scheme===D.file?!Dn:!0),io=new to(e=>!0),ao=no.isEqual.bind(no);no.isEqualOrParent.bind(no),no.getComparisonKey.bind(no);const oo=no.basenameOrAuthority.bind(no),so=no.basename.bind(no),co=no.extname.bind(no),lo=no.dirname.bind(no),uo=no.joinPath.bind(no);no.normalizePath.bind(no);const fo=no.relativePath.bind(no);no.resolvePath.bind(no);const po=no.isAbsolutePath.bind(no),mo=no.isEqualAuthority.bind(no),ho=no.hasTrailingPathSeparator.bind(no);no.removeTrailingPathSeparator.bind(no),no.addTrailingPathSeparator.bind(no);var go;(function(e){e.META_DATA_LABEL=`label`,e.META_DATA_DESCRIPTION=`description`,e.META_DATA_SIZE=`size`,e.META_DATA_MIME=`mime`;function t(t){let n=new Map;t.path.substring(t.path.indexOf(`;`)+1,t.path.lastIndexOf(`;`)).split(`;`).forEach(e=>{let[t,r]=e.split(`:`);t&&r&&n.set(t,r)});let r=t.path.substring(0,t.path.indexOf(`;`));return r&&n.set(e.META_DATA_MIME,r),n}e.parseMetaData=t})(go||={});const _o=Symbol(`MicrotaskDelay`);function vo(e){return!!e&&typeof e.then==`function`}function yo(e){let t=new Hi,n=e(t.token),r=!1,i=new Promise((e,i)=>{let a=t.token.onCancellationRequested(()=>{r=!0,a.dispose(),i(new ie)});Promise.resolve(n).then(n=>{a.dispose(),t.dispose(),r?bt(n)&&n.dispose():e(n)},e=>{a.dispose(),t.dispose(),i(e)})});return new class{cancel(){t.cancel(),t.dispose()}then(e,t){return i.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return i.finally(e)}}}function bo(e,t,n){return new Promise((r,i)=>{let a=t.onCancellationRequested(()=>{a.dispose(),r(n)});e.then(r,i).finally(()=>a.dispose())})}function xo(e,t){return new Promise((n,r)=>{let i=t.onCancellationRequested(()=>{i.dispose(),r(new ie)});e.then(n,r).finally(()=>i.dispose())})}function So(e){return new Promise((t,n)=>{let r=e();vo(r)?r.then(t,n):t(r)})}function Co(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var wo=class{constructor(){this.activePromise=null,this.queuedPromise=null,this.queuedPromiseFactory=null,this.cancellationTokenSource=new Hi}queue(e){if(this.cancellationTokenSource.token.isCancellationRequested)return Promise.reject(Error(`Throttler is disposed`));if(this.activePromise){if(this.queuedPromiseFactory=e,!this.queuedPromise){let e=()=>{if(this.queuedPromise=null,this.cancellationTokenSource.token.isCancellationRequested)return;let e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise(t=>{this.activePromise.then(e,e).then(t)})}return new Promise((e,t)=>{this.queuedPromise.then(e,t)})}return this.activePromise=e(this.cancellationTokenSource.token),new Promise((e,t)=>{this.activePromise.then(t=>{this.activePromise=null,e(t)},e=>{this.activePromise=null,t(e)})})}dispose(){this.cancellationTokenSource.cancel()}},To=class{constructor(){this.current=Promise.resolve(null)}queue(e){return this.current=this.current.then(()=>e(),()=>e())}},Eo=class{constructor(){this.promiseMap=new Map}queue(e,t){let n=(this.promiseMap.get(e)??Promise.resolve()).catch(()=>{}).then(t).finally(()=>{this.promiseMap.get(e)===n&&this.promiseMap.delete(e)});return this.promiseMap.set(e,n),n}peek(e){return this.promiseMap.get(e)||void 0}keys(){return this.promiseMap.keys()}};const Do=(e,t)=>{let n=!0,r=setTimeout(()=>{n=!1,t()},e);return{isTriggered:()=>n,dispose:()=>{clearTimeout(r),n=!1}}},Oo=e=>{let t=!0;return queueMicrotask(()=>{t&&(t=!1,e())}),{isTriggered:()=>t,dispose:()=>{t=!1}}};var ko=class{constructor(e){this.defaultDelay=e,this.deferred=null,this.completionPromise=null,this.doResolve=null,this.doReject=null,this.task=null}trigger(e,t=this.defaultDelay){this.task=e,this.cancelTimeout(),this.completionPromise||=new Promise((e,t)=>{this.doResolve=e,this.doReject=t}).then(()=>{if(this.completionPromise=null,this.doResolve=null,this.task){let e=this.task;return this.task=null,e()}});let n=()=>{this.deferred=null,this.doResolve?.(null)};return this.deferred=t===_o?Oo(n):Do(t,n),this.completionPromise}isTriggered(){return!!this.deferred?.isTriggered()}cancel(){this.cancelTimeout(),this.completionPromise&&=(this.doReject?.(new ie),null)}cancelTimeout(){this.deferred?.dispose(),this.deferred=null}dispose(){this.cancel()}},Ao=class{constructor(e){this.delayer=new ko(e),this.throttler=new wo}trigger(e,t){return this.delayer.trigger(()=>this.throttler.queue(e),t)}isTriggered(){return this.delayer.isTriggered()}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}},jo=class{constructor(){this._isOpen=!1,this._promise=new Promise((e,t)=>{this._completePromise=e})}isOpen(){return this._isOpen}open(){this._isOpen=!0,this._completePromise(!0)}wait(){return this._promise}};function Mo(e,t){return t?new Promise((n,r)=>{let i=setTimeout(()=>{a.dispose(),n()},e),a=t.onCancellationRequested(()=>{clearTimeout(i),a.dispose(),r(new ie)})}):yo(t=>Mo(e,t))}function No(e,t=0,n){let r=setTimeout(()=>{e(),n&&i.dispose()},t),i=g(()=>{clearTimeout(r),n?.delete(i)});return n?.add(i),i}var Po=class{constructor(e){this._size=0,this._isDisposed=!1,this.maxDegreeOfParalellism=e,this.outstandingPromises=[],this.runningPromises=0,this._onDrained=new x}whenIdle(){return this.size>0?ir.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this._onDrained.event}get size(){return this._size}queue(e){if(this._isDisposed)throw Error(`Object has been disposed`);return this._size++,new Promise((t,n)=>{this.outstandingPromises.push({factory:e,c:t,e:n}),this.consume()})}consume(){for(;this.outstandingPromises.length&&this.runningPromises<this.maxDegreeOfParalellism;){let e=this.outstandingPromises.shift();this.runningPromises++;let t=e.factory();t.then(e.c,e.e),t.then(()=>this.consumed(),()=>this.consumed())}}consumed(){this._isDisposed||(this.runningPromises--,--this._size===0&&this._onDrained.fire(),this.outstandingPromises.length>0&&this.consume())}clear(){if(this._isDisposed)throw Error(`Object has been disposed`);this.outstandingPromises.length=0,this._size=this.runningPromises}dispose(){this._isDisposed=!0,this.outstandingPromises.length=0,this._size=0,this._onDrained.dispose()}},Fo=class extends Po{constructor(){super(1)}},Io=class{constructor(){this.queues=new Map,this.drainers=new Set,this.drainListeners=void 0,this.drainListenerCount=0}async whenDrained(){if(this.isDrained())return;let e=new Wo;return this.drainers.add(e),e.p}isDrained(){for(let[,e]of this.queues)if(e.size>0)return!1;return!0}queueSize(e,t=no){let n=t.getComparisonKey(e);return this.queues.get(n)?.size??0}queueFor(e,t,n=no){let r=n.getComparisonKey(e),i=this.queues.get(r);if(!i){i=new Fo;let e=this.drainListenerCount++,t=ir.once(i.onDrained)(()=>{i?.dispose(),this.queues.delete(r),this.onDidQueueDrain(),this.drainListeners?.deleteAndDispose(e),this.drainListeners?.size===0&&(this.drainListeners.dispose(),this.drainListeners=void 0)});this.drainListeners||=new Tt,this.drainListeners.set(e,t),this.queues.set(r,i)}return i.queue(t)}onDidQueueDrain(){this.isDrained()&&this.releaseDrainers()}releaseDrainers(){for(let e of this.drainers)e.complete();this.drainers.clear()}dispose(){for(let[,e]of this.queues)e.dispose();this.queues.clear(),this.releaseDrainers(),this.drainListeners?.dispose()}},Lo=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new me(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=g(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Ro=class{constructor(e,t){this.timeoutToken=void 0,this.runner=e,this.timeout=t,this.timeoutHandler=this.onTimeout.bind(this)}dispose(){this.cancel(),this.runner=null}cancel(){this.isScheduled()&&(clearTimeout(this.timeoutToken),this.timeoutToken=void 0)}schedule(e=this.timeout){this.cancel(),this.timeoutToken=setTimeout(this.timeoutHandler,e)}get delay(){return this.timeout}set delay(e){this.timeout=e}isScheduled(){return this.timeoutToken!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.doRun())}onTimeout(){this.timeoutToken=void 0,this.runner&&this.doRun()}doRun(){this.runner?.()}};let zo,Bo;(function(){let e=globalThis;Bo=typeof e.requestIdleCallback!=`function`||typeof e.cancelIdleCallback!=`function`?(e,t,n)=>{zn(()=>{if(r)return;let e=Date.now()+15;t(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,e-Date.now())}}))});let r=!1;return{dispose(){r||=!0}}}:(e,t,n)=>{let r=e.requestIdleCallback(t,typeof n==`number`?{timeout:n}:void 0),i=!1;return{dispose(){i||(i=!0,e.cancelIdleCallback(r))}}},zo=(e,t)=>Bo(globalThis,e,t)})();var Vo=class{constructor(e,t){this._didRun=!1,this._executor=()=>{try{this._value=t()}catch(e){this._error=e}finally{this._didRun=!0}},this._handle=Bo(e,()=>this._executor())}dispose(){this._handle.dispose()}get value(){if(this._didRun||(this._handle.dispose(),this._executor()),this._error)throw this._error;return this._value}get isInitialized(){return this._didRun}},Ho=class extends Vo{constructor(e){super(globalThis,e)}},Uo;(function(e){e[e.Resolved=0]=`Resolved`,e[e.Rejected=1]=`Rejected`})(Uo||={});var Wo=class e{static fromPromise(t){let n=new e;return n.settleWith(t),n}get isRejected(){return this.outcome?.outcome===Uo.Rejected}get isResolved(){return this.outcome?.outcome===Uo.Resolved}get isSettled(){return!!this.outcome}get value(){return this.outcome?.outcome===Uo.Resolved?this.outcome?.value:void 0}constructor(){this.p=new Promise((e,t)=>{this.completeCallback=e,this.errorCallback=t})}complete(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.completeCallback(e),this.outcome={outcome:Uo.Resolved,value:e},t()})}error(e){return this.isSettled?Promise.resolve():new Promise(t=>{this.errorCallback(e),this.outcome={outcome:Uo.Rejected,value:e},t()})}settleWith(e){return e.then(e=>this.complete(e),e=>this.error(e))}cancel(){return this.error(new ie)}},Go;(function(e){async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(t!==void 0)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Go||={});var Ko;(function(e){e[e.Initial=0]=`Initial`,e[e.DoneOK=1]=`DoneOK`,e[e.DoneError=2]=`DoneError`})(Ko||={});var qo=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}static{this.EMPTY=e.fromArray([])}constructor(e,t){this._state=Ko.Initial,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new x,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===Ko.DoneError)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===Ko.DoneOK)return{done:!0,value:void 0};await ir.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===Ko.Initial&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===Ko.Initial&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===Ko.Initial&&(this._state=Ko.DoneOK,this._onStateChanged.fire())}reject(e){this._state===Ko.Initial&&(this._state=Ko.DoneError,this._error=e,this._onStateChanged.fire())}},Jo=class{constructor(e){this._deferred=new Wo,this._asyncIterable=new qo(e=>{if(t){e.reject(t);return}return n&&e.emitMany(n),this._errorFn=t=>e.reject(t),this._emitOneFn=t=>e.emitOne(t),this._emitManyFn=t=>e.emitMany(t),this._deferred.p},e);let t,n;this._errorFn=e=>{t||=e},this._emitOneFn=e=>{n||=[],n.push(e)},this._emitManyFn=e=>{n?e.forEach(e=>n.push(e)):n=e.slice()}}get asyncIterable(){return this._asyncIterable}resolve(){this._deferred.complete()}reject(e){this._errorFn(e),this._deferred.complete()}emitOne(e){this._emitOneFn(e)}emitMany(e){this._emitManyFn(e)}},Yo=class{constructor(){this._unsatisfiedConsumers=[],this._unconsumedValues=[]}get hasFinalValue(){return!!this._finalValue}produce(e){if(this._ensureNoFinalValue(),this._unsatisfiedConsumers.length>0){let t=this._unsatisfiedConsumers.shift();this._resolveOrRejectDeferred(t,e)}else this._unconsumedValues.push(e)}produceFinal(e){this._ensureNoFinalValue(),this._finalValue=e;for(let t of this._unsatisfiedConsumers)this._resolveOrRejectDeferred(t,e);this._unsatisfiedConsumers.length=0}_ensureNoFinalValue(){if(this._finalValue)throw new me(`ProducerConsumer: cannot produce after final value has been set`)}_resolveOrRejectDeferred(e,t){t.ok?e.complete(t.value):e.error(t.error)}consume(){if(this._unconsumedValues.length>0||this._finalValue){let e=this._unconsumedValues.length>0?this._unconsumedValues.shift():this._finalValue;return e.ok?Promise.resolve(e.value):Promise.reject(e.error)}else{let e=new Wo;return this._unsatisfiedConsumers.push(e),e.p}}},Xo=class e{constructor(e,t){this._onReturn=t,this._producerConsumer=new Yo,this._iterator={next:()=>this._producerConsumer.consume(),return:()=>(this._onReturn?.(),Promise.resolve({done:!0,value:void 0})),throw:async e=>(this._finishError(e),{done:!0,value:void 0})},queueMicrotask(async()=>{let t=e({emitOne:e=>this._producerConsumer.produce({ok:!0,value:{done:!1,value:e}}),emitMany:e=>{for(let t of e)this._producerConsumer.produce({ok:!0,value:{done:!1,value:t}})},reject:e=>this._finishError(e)});if(!this._producerConsumer.hasFinalValue)try{await t,this._finishOk()}catch(e){this._finishError(e)}})}static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromisesResolveOrder(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}static{this.EMPTY=e.fromArray([])}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}static tee(t){let n,r,i=new Wo,a=async()=>{if(!(!n||!r))try{for await(let e of t)n.emitOne(e),r.emitOne(e)}catch(e){n.reject(e),r.reject(e)}finally{i.complete()}};return[new e(async e=>(n=e,a(),i.p)),new e(async e=>(r=e,a(),i.p))]}map(t){return e.map(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}_finishOk(){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!0,value:{done:!0,value:void 0}})}_finishError(e){this._producerConsumer.hasFinalValue||this._producerConsumer.produceFinal({ok:!1,error:e})}[Symbol.asyncIterator](){return this._iterator}};new class{transformIncoming(e){return e}transformOutgoing(e){return e}transformOutgoingURI(e){return e}transformOutgoingScheme(e){return e}};function Zo(e,t,n,r){if(!e||r>200)return null;if(typeof e==`object`){if(e.$mid===Mr.Uri)return n?C.revive(t.transformIncoming(e)):t.transformIncoming(e);if(e instanceof y)return null;for(let i in e)if(Object.hasOwnProperty.call(e,i)){let a=Zo(e[i],t,n,r+1);a!==null&&(e[i]=a)}}return null}function Qo(e,t){let n=Zo(e,t,!1,0);return n===null?e:n}var $o=class{constructor(){this._actual=null,this._actualOk=null,this._actualErr=null,this._hasValue=!1,this._value=null,this._hasErr=!1,this._err=null}get[Symbol.toStringTag](){return this.toString()}_ensureActual(){return this._actual||=new Promise((e,t)=>{this._actualOk=e,this._actualErr=t,this._hasValue&&this._actualOk(this._value),this._hasErr&&this._actualErr(this._err)}),this._actual}resolveOk(e){this._hasValue||this._hasErr||(this._hasValue=!0,this._value=e,this._actual&&this._actualOk(e))}resolveErr(e){this._hasValue||this._hasErr||(this._hasErr=!0,this._err=e,this._actual?this._actualErr(e):m(e))}then(e,t){return this._ensureActual().then(e,t)}catch(e){return this._ensureActual().then(void 0,e)}finally(e){return this._ensureActual().finally(e)}},es=class extends $o{constructor(){super(),this._hasErr=!0,this._err=new ie}},ts;function ns(e,t){try{return JSON.stringify(e,t)}catch{return`null`}}const rs=`$$ref$$`,is={[rs]:-1};function as(e,t=null,n=!1){let r=[];return{jsonString:(n?ns:JSON.stringify)(e,(e,n)=>{if(n===void 0)return is;if(typeof n==`object`){if(n instanceof y){let e=r.push(n)-1;return{[rs]:e}}if(t)return t(e,n)}return n}),referencedBuffers:r}}function os(e,t,n){return JSON.parse(e,(e,r)=>{if(r){let e=r[rs];if(typeof e==`number`)return t[e];if(n&&r.$mid===Mr.Uri)return n.transformIncoming(r)}return r})}function ss(e,t){return JSON.stringify(e,t)}function cs(e){return e?(t,n)=>n&&n.$mid===Mr.Uri?e.transformOutgoing(n):n:null}var ls;(function(e){e[e.LocalSide=0]=`LocalSide`,e[e.OtherSide=1]=`OtherSide`})(ls||={});var us;(function(e){e[e.Responsive=0]=`Responsive`,e[e.Unresponsive=1]=`Unresponsive`})(us||={});const ds=()=>{},fs=Symbol.for(`rpcProtocol`),ps=Symbol.for(`rpcProxy`);var ms=class e extends v{static{ts=fs}static{this.UNRESPONSIVE_TIME=3*1e3}constructor(e,t=null,n=null){super(),this[ts]=!0,this._onDidChangeResponsiveState=this._register(new x),this.onDidChangeResponsiveState=this._onDidChangeResponsiveState.event,this._protocol=e,this._logger=t,this._uriTransformer=n,this._uriReplacer=cs(this._uriTransformer),this._isDisposed=!1,this._locals=[],this._proxies=[];for(let e=0,t=bi.count;e<t;e++)this._locals[e]=null,this._proxies[e]=null;this._lastMessageId=0,this._cancelInvokedHandlers=Object.create(null),this._pendingRPCReplies={},this._responsiveState=us.Responsive,this._unacknowledgedCount=0,this._unresponsiveTime=0,this._asyncCheckUresponsive=this._register(new Ro(()=>this._checkUnresponsive(),1e3)),this._register(this._protocol.onMessage(e=>this._receiveOneMessage(e)))}dispose(){this._isDisposed=!0,Object.keys(this._pendingRPCReplies).forEach(e=>{let t=this._pendingRPCReplies[e];delete this._pendingRPCReplies[e],t.resolveErr(oe())}),super.dispose()}drain(){return typeof this._protocol.drain==`function`?this._protocol.drain():Promise.resolve()}_onWillSendRequest(t){this._unacknowledgedCount===0&&(this._unresponsiveTime=Date.now()+e.UNRESPONSIVE_TIME),this._unacknowledgedCount++,this._asyncCheckUresponsive.isScheduled()||this._asyncCheckUresponsive.schedule()}_onDidReceiveAcknowledge(t){this._unresponsiveTime=Date.now()+e.UNRESPONSIVE_TIME,this._unacknowledgedCount--,this._unacknowledgedCount===0&&this._asyncCheckUresponsive.cancel(),this._setResponsiveState(us.Responsive)}_checkUnresponsive(){this._unacknowledgedCount!==0&&(Date.now()>this._unresponsiveTime?this._setResponsiveState(us.Unresponsive):this._asyncCheckUresponsive.schedule())}_setResponsiveState(e){this._responsiveState!==e&&(this._responsiveState=e,this._onDidChangeResponsiveState.fire(this._responsiveState))}get responsiveState(){return this._responsiveState}transformIncomingURIs(e){return this._uriTransformer?Qo(e,this._uriTransformer):e}getProxy(e){let{nid:t,sid:n}=e;return this._proxies[t]||(this._proxies[t]=this._createProxy(t,n)),this._proxies[t]}_createProxy(e,t){return new Proxy(Object.create(null),{get:(n,r)=>(typeof r==`string`&&!n[r]&&r.charCodeAt(0)===S.DollarSign&&(n[r]=(...t)=>this._remoteCall(e,r,t)),r===ps?t:n[r])})}set(e,t){return this._locals[e.nid]=t,t}assertRegistered(e){for(let t=0,n=e.length;t<n;t++){let n=e[t];if(!this._locals[n.nid])throw Error(`Missing proxy instance ${n.sid}`)}}_receiveOneMessage(e){if(this._isDisposed)return;let t=e.byteLength,n=gs.read(e,0),r=n.readUInt8(),i=n.readUInt32();switch(r){case ys.RequestJSONArgs:case ys.RequestJSONArgsWithCancellation:{let{rpcId:e,method:a,args:o}=vs.deserializeRequestJSONArgs(n);this._uriTransformer&&(o=Qo(o,this._uriTransformer)),this._receiveRequest(t,i,e,a,o,r===ys.RequestJSONArgsWithCancellation);break}case ys.RequestMixedArgs:case ys.RequestMixedArgsWithCancellation:{let{rpcId:e,method:a,args:o}=vs.deserializeRequestMixedArgs(n);this._uriTransformer&&(o=Qo(o,this._uriTransformer)),this._receiveRequest(t,i,e,a,o,r===ys.RequestMixedArgsWithCancellation);break}case ys.Acknowledged:this._logger?.logIncoming(t,i,ls.LocalSide,`ack`),this._onDidReceiveAcknowledge(i);break;case ys.Cancel:this._receiveCancel(t,i);break;case ys.ReplyOKEmpty:this._receiveReply(t,i,void 0);break;case ys.ReplyOKJSON:{let e=vs.deserializeReplyOKJSON(n);this._uriTransformer&&(e=Qo(e,this._uriTransformer)),this._receiveReply(t,i,e);break}case ys.ReplyOKJSONWithBuffers:{let e=vs.deserializeReplyOKJSONWithBuffers(n,this._uriTransformer);this._receiveReply(t,i,e);break}case ys.ReplyOKVSBuffer:{let e=vs.deserializeReplyOKVSBuffer(n);this._receiveReply(t,i,e);break}case ys.ReplyErrError:{let e=vs.deserializeReplyErrError(n);this._uriTransformer&&(e=Qo(e,this._uriTransformer)),this._receiveReplyErr(t,i,e);break}case ys.ReplyErrEmpty:this._receiveReplyErr(t,i,void 0);break;default:console.error(`received unexpected message`),console.error(e)}}_receiveRequest(e,t,n,r,i,a){this._logger?.logIncoming(e,t,ls.OtherSide,`receiveRequest ${Si(n)}.${r}(`,i);let o=String(t),s,c;if(a){let e=new Hi;i.push(e.token),s=this._invokeHandler(n,r,i),c=()=>e.cancel()}else s=this._invokeHandler(n,r,i),c=ds;this._cancelInvokedHandlers[o]=c;let l=vs.serializeAcknowledged(t);this._logger?.logOutgoing(l.byteLength,t,ls.OtherSide,`ack`),this._protocol.send(l),s.then(e=>{delete this._cancelInvokedHandlers[o];let n=vs.serializeReplyOK(t,e,this._uriReplacer);this._logger?.logOutgoing(n.byteLength,t,ls.OtherSide,`reply:`,e),this._protocol.send(n)},e=>{delete this._cancelInvokedHandlers[o];let n=vs.serializeReplyErr(t,e);this._logger?.logOutgoing(n.byteLength,t,ls.OtherSide,`replyErr:`,e),this._protocol.send(n)})}_receiveCancel(e,t){this._logger?.logIncoming(e,t,ls.OtherSide,`receiveCancel`);let n=String(t);this._cancelInvokedHandlers[n]?.()}_receiveReply(e,t,n){this._logger?.logIncoming(e,t,ls.LocalSide,`receiveReply:`,n);let r=String(t);if(!this._pendingRPCReplies.hasOwnProperty(r))return;let i=this._pendingRPCReplies[r];delete this._pendingRPCReplies[r],i.resolveOk(n)}_receiveReplyErr(e,t,n){this._logger?.logIncoming(e,t,ls.LocalSide,`receiveReplyErr:`,n);let r=String(t);if(!this._pendingRPCReplies.hasOwnProperty(r))return;let i=this._pendingRPCReplies[r];delete this._pendingRPCReplies[r];let a;n&&(n.$isError?(a=Error(),a.name=n.name,a.message=n.message,a.stack=n.stack):a=n),i.resolveErr(a)}_invokeHandler(e,t,n){try{return Promise.resolve(this._doInvokeHandler(e,t,n))}catch(e){return Promise.reject(e)}}_doInvokeHandler(e,t,n){let r=this._locals[e];if(!r)throw Error(`Unknown actor `+Si(e));let i=r[t];if(typeof i!=`function`)throw Error(`Unknown method `+t+` on actor `+Si(e));return i.apply(r,n)}_remoteCall(e,t,n){if(this._isDisposed)return new es;let r=null;if(n.length>0&&Bi.isCancellationToken(n[n.length-1])&&(r=n.pop()),r&&r.isCancellationRequested)return Promise.reject(oe());let i=vs.serializeRequestArguments(n,this._uriReplacer),a=++this._lastMessageId,o=String(a),s=new $o,c=new _;r&&c.add(r.onCancellationRequested(()=>{let e=vs.serializeCancel(a);this._logger?.logOutgoing(e.byteLength,a,ls.LocalSide,`cancel`),this._protocol.send(e)})),this._pendingRPCReplies[o]=new hs(s,c),this._onWillSendRequest(a);let l=vs.serializeRequest(a,e,t,i,!!r);return this._logger?.logOutgoing(l.byteLength,a,ls.LocalSide,`request: ${Si(e)}.${t}(`,n),this._protocol.send(l),s}},hs=class{constructor(e,t){this._promise=e,this._disposable=t}resolveOk(e){this._promise.resolveOk(e),this._disposable.dispose()}resolveErr(e){this._promise.resolveErr(e),this._disposable.dispose()}},gs=class e{static alloc(t,n,r){let i=new e(y.alloc(r+1+4),0);return i.writeUInt8(t),i.writeUInt32(n),i}static read(t,n){return new e(t,n)}get buffer(){return this._buff}constructor(e,t){this._buff=e,this._offset=t}static sizeUInt8(){return 1}static{this.sizeUInt32=4}writeUInt8(e){this._buff.writeUInt8(e,this._offset),this._offset+=1}readUInt8(){let e=this._buff.readUInt8(this._offset);return this._offset+=1,e}writeUInt32(e){this._buff.writeUInt32BE(e,this._offset),this._offset+=4}readUInt32(){let e=this._buff.readUInt32BE(this._offset);return this._offset+=4,e}static sizeShortString(e){return 1+e.byteLength}writeShortString(e){this._buff.writeUInt8(e.byteLength,this._offset),this._offset+=1,this._buff.set(e,this._offset),this._offset+=e.byteLength}readShortString(){let e=this._buff.readUInt8(this._offset);this._offset+=1;let t=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,t}static sizeLongString(e){return 4+e.byteLength}writeLongString(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readLongString(){let e=this._buff.readUInt32BE(this._offset);this._offset+=4;let t=this._buff.slice(this._offset,this._offset+e).toString();return this._offset+=e,t}writeBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}static sizeVSBuffer(e){return 4+e.byteLength}writeVSBuffer(e){this._buff.writeUInt32BE(e.byteLength,this._offset),this._offset+=4,this._buff.set(e,this._offset),this._offset+=e.byteLength}readVSBuffer(){let e=this._buff.readUInt32BE(this._offset);this._offset+=4;let t=this._buff.slice(this._offset,this._offset+e);return this._offset+=e,t}static sizeMixedArray(e){let t=0;t+=1;for(let n=0,r=e.length;n<r;n++){let r=e[n];switch(t+=1,r.type){case bs.String:t+=this.sizeLongString(r.value);break;case bs.VSBuffer:t+=this.sizeVSBuffer(r.value);break;case bs.SerializedObjectWithBuffers:t+=this.sizeUInt32,t+=this.sizeLongString(r.value);for(let e=0;e<r.buffers.length;++e)t+=this.sizeVSBuffer(r.buffers[e]);break}}return t}writeMixedArray(e){this._buff.writeUInt8(e.length,this._offset),this._offset+=1;for(let t=0,n=e.length;t<n;t++){let n=e[t];switch(n.type){case bs.String:this.writeUInt8(bs.String),this.writeLongString(n.value);break;case bs.VSBuffer:this.writeUInt8(bs.VSBuffer),this.writeVSBuffer(n.value);break;case bs.SerializedObjectWithBuffers:this.writeUInt8(bs.SerializedObjectWithBuffers),this.writeUInt32(n.buffers.length),this.writeLongString(n.value);for(let e=0;e<n.buffers.length;++e)this.writeBuffer(n.buffers[e]);break;case bs.Undefined:this.writeUInt8(bs.Undefined);break}}}readMixedArray(){let e=this._buff.readUInt8(this._offset);this._offset+=1;let t=Array(e);for(let n=0;n<e;n++)switch(this.readUInt8()){case bs.String:t[n]=this.readLongString();break;case bs.VSBuffer:t[n]=this.readVSBuffer();break;case bs.SerializedObjectWithBuffers:{let e=this.readUInt32(),r=this.readLongString(),i=[];for(let t=0;t<e;++t)i.push(this.readVSBuffer());t[n]=new Ci(os(r,i,null));break}case bs.Undefined:t[n]=void 0;break}return t}},_s;(function(e){e[e.Simple=0]=`Simple`,e[e.Mixed=1]=`Mixed`})(_s||={});var vs=class{static _useMixedArgSerialization(e){for(let t=0,n=e.length;t<n;t++)if(e[t]instanceof y||e[t]instanceof Ci||e[t]===void 0)return!0;return!1}static serializeRequestArguments(e,t){if(this._useMixedArgSerialization(e)){let n=[];for(let r=0,i=e.length;r<i;r++){let i=e[r];if(i instanceof y)n[r]={type:bs.VSBuffer,value:i};else if(i===void 0)n[r]={type:bs.Undefined};else if(i instanceof Ci){let{jsonString:e,referencedBuffers:a}=as(i.value,t);n[r]={type:bs.SerializedObjectWithBuffers,value:y.fromString(e),buffers:a}}else n[r]={type:bs.String,value:y.fromString(ss(i,t))}}return{type:_s.Mixed,args:n}}return{type:_s.Simple,args:ss(e,t)}}static serializeRequest(e,t,n,r,i){switch(r.type){case _s.Simple:return this._requestJSONArgs(e,t,n,r.args,i);case _s.Mixed:return this._requestMixedArgs(e,t,n,r.args,i)}}static _requestJSONArgs(e,t,n,r,i){let a=y.fromString(n),o=y.fromString(r),s=0;s+=gs.sizeUInt8(),s+=gs.sizeShortString(a),s+=gs.sizeLongString(o);let c=gs.alloc(i?ys.RequestJSONArgsWithCancellation:ys.RequestJSONArgs,e,s);return c.writeUInt8(t),c.writeShortString(a),c.writeLongString(o),c.buffer}static deserializeRequestJSONArgs(e){let t=e.readUInt8(),n=e.readShortString(),r=e.readLongString();return{rpcId:t,method:n,args:JSON.parse(r)}}static _requestMixedArgs(e,t,n,r,i){let a=y.fromString(n),o=0;o+=gs.sizeUInt8(),o+=gs.sizeShortString(a),o+=gs.sizeMixedArray(r);let s=gs.alloc(i?ys.RequestMixedArgsWithCancellation:ys.RequestMixedArgs,e,o);return s.writeUInt8(t),s.writeShortString(a),s.writeMixedArray(r),s.buffer}static deserializeRequestMixedArgs(e){let t=e.readUInt8(),n=e.readShortString(),r=e.readMixedArray(),i=Array(r.length);for(let e=0,t=r.length;e<t;e++){let t=r[e];typeof t==`string`?i[e]=JSON.parse(t):i[e]=t}return{rpcId:t,method:n,args:i}}static serializeAcknowledged(e){return gs.alloc(ys.Acknowledged,e,0).buffer}static serializeCancel(e){return gs.alloc(ys.Cancel,e,0).buffer}static serializeReplyOK(e,t,n){if(t===void 0)return this._serializeReplyOKEmpty(e);if(t instanceof y)return this._serializeReplyOKVSBuffer(e,t);if(t instanceof Ci){let{jsonString:r,referencedBuffers:i}=as(t.value,n,!0);return this._serializeReplyOKJSONWithBuffers(e,r,i)}else return this._serializeReplyOKJSON(e,ns(t,n))}static _serializeReplyOKEmpty(e){return gs.alloc(ys.ReplyOKEmpty,e,0).buffer}static _serializeReplyOKVSBuffer(e,t){let n=0;n+=gs.sizeVSBuffer(t);let r=gs.alloc(ys.ReplyOKVSBuffer,e,n);return r.writeVSBuffer(t),r.buffer}static deserializeReplyOKVSBuffer(e){return e.readVSBuffer()}static _serializeReplyOKJSON(e,t){let n=y.fromString(t),r=0;r+=gs.sizeLongString(n);let i=gs.alloc(ys.ReplyOKJSON,e,r);return i.writeLongString(n),i.buffer}static _serializeReplyOKJSONWithBuffers(e,t,n){let r=y.fromString(t),i=0;i+=gs.sizeUInt32,i+=gs.sizeLongString(r);for(let e of n)i+=gs.sizeVSBuffer(e);let a=gs.alloc(ys.ReplyOKJSONWithBuffers,e,i);a.writeUInt32(n.length),a.writeLongString(r);for(let e of n)a.writeBuffer(e);return a.buffer}static deserializeReplyOKJSON(e){let t=e.readLongString();return JSON.parse(t)}static deserializeReplyOKJSONWithBuffers(e,t){let n=e.readUInt32(),r=e.readLongString(),i=[];for(let t=0;t<n;++t)i.push(e.readVSBuffer());return new Ci(os(r,i,t))}static serializeReplyErr(e,t){let n=t?ns(te(t),null):void 0;if(typeof n!=`string`)return this._serializeReplyErrEmpty(e);let r=y.fromString(n),i=0;i+=gs.sizeLongString(r);let a=gs.alloc(ys.ReplyErrError,e,i);return a.writeLongString(r),a.buffer}static deserializeReplyErrError(e){let t=e.readLongString();return JSON.parse(t)}static _serializeReplyErrEmpty(e){return gs.alloc(ys.ReplyErrEmpty,e,0).buffer}},ys;(function(e){e[e.RequestJSONArgs=1]=`RequestJSONArgs`,e[e.RequestJSONArgsWithCancellation=2]=`RequestJSONArgsWithCancellation`,e[e.RequestMixedArgs=3]=`RequestMixedArgs`,e[e.RequestMixedArgsWithCancellation=4]=`RequestMixedArgsWithCancellation`,e[e.Acknowledged=5]=`Acknowledged`,e[e.Cancel=6]=`Cancel`,e[e.ReplyOKEmpty=7]=`ReplyOKEmpty`,e[e.ReplyOKVSBuffer=8]=`ReplyOKVSBuffer`,e[e.ReplyOKJSON=9]=`ReplyOKJSON`,e[e.ReplyOKJSONWithBuffers=10]=`ReplyOKJSONWithBuffers`,e[e.ReplyErrError=11]=`ReplyErrError`,e[e.ReplyErrEmpty=12]=`ReplyErrEmpty`})(ys||={});var bs;(function(e){e[e.String=1]=`String`,e[e.VSBuffer=2]=`VSBuffer`,e[e.SerializedObjectWithBuffers=3]=`SerializedObjectWithBuffers`,e[e.Undefined=4]=`Undefined`})(bs||={});function xs(e){if(!e)return;let t=e.indexOf(`+`);return t<0?e:e.substr(0,t)}const Ss=[`AI`,`Azure`,`Chat`,`Data Science`,`Debuggers`,`Extension Packs`,`Education`,`Formatters`,`Keymaps`,`Language Packs`,`Linters`,`Machine Learning`,`Notebooks`,`Programming Languages`,`SCM Providers`,`Snippets`,`Testing`,`Themes`,`Visualization`,`Other`];var Cs;(function(e){e[e.System=0]=`System`,e[e.User=1]=`User`})(Cs||={});var ws;(function(e){e.WIN32_X64=`win32-x64`,e.WIN32_ARM64=`win32-arm64`,e.LINUX_X64=`linux-x64`,e.LINUX_ARM64=`linux-arm64`,e.LINUX_ARMHF=`linux-armhf`,e.ALPINE_X64=`alpine-x64`,e.ALPINE_ARM64=`alpine-arm64`,e.DARWIN_X64=`darwin-x64`,e.DARWIN_ARM64=`darwin-arm64`,e.WEB=`web`,e.UNIVERSAL=`universal`,e.UNKNOWN=`unknown`,e.UNDEFINED=`undefined`})(ws||={});var Ts=class{constructor(e){this.value=e,this._lower=e.toLowerCase()}static equals(e,t){return e==null?t==null:t==null?!1:typeof e==`string`||typeof t==`string`?pa(typeof e==`string`?e:e.value,typeof t==`string`?t:t.value):e._lower===t._lower}static toKey(e){return typeof e==`string`?e.toLowerCase():e._lower}},Es=class{get size(){return this._set.size}constructor(e){if(this._set=new Set,e)for(let t of e)this.add(t)}add(e){this._set.add(Ts.toKey(e))}delete(e){return this._set.delete(Ts.toKey(e))}has(e){return this._set.has(Ts.toKey(e))}},Ds=class{constructor(){this._map=new Map}clear(){this._map.clear()}delete(e){this._map.delete(Ts.toKey(e))}get(e){return this._map.get(Ts.toKey(e))}has(e){return this._map.has(Ts.toKey(e))}set(e,t){this._map.set(Ts.toKey(e),t)}values(){return this._map.values()}forEach(e){this._map.forEach(e)}[Symbol.iterator](){return this._map[Symbol.iterator]()}},Os=class extends Error{constructor(e,t,n){super(`Error in extension ${Ts.toKey(e)}: ${n??t.message}`,{cause:t}),this.name=`ExtensionError`,this.extension=e}},ks;(function(e){e.serviceIds=new Map,e.DI_TARGET=`$di$target`,e.DI_DEPENDENCIES=`$di$dependencies`;function t(t){return t[e.DI_DEPENDENCIES]||[]}e.getServiceDependencies=t})(ks||={});const As=O(`instantiationService`);function js(e,t,n){t[ks.DI_TARGET]===t?t[ks.DI_DEPENDENCIES].push({id:e,index:n}):(t[ks.DI_DEPENDENCIES]=[{id:e,index:n}],t[ks.DI_TARGET]=t)}function O(e){if(ks.serviceIds.has(e))return ks.serviceIds.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);js(t,e,r)};return t.toString=()=>e,ks.serviceIds.set(e,t),t}function Ms(e){return e}const Ns=O(`logService`),Ps=O(`loggerService`);var Fs=class{constructor(e,t=[],n=!1){this.ctor=e,this.staticArguments=t,this.supportsDelayedInstantiation=n}};const Is=[];var Ls;(function(e){e[e.Eager=0]=`Eager`,e[e.Delayed=1]=`Delayed`})(Ls||={});function Rs(e,t,n){t instanceof Fs||(t=new Fs(t,[],!!n)),Is.push([e,t])}function zs(){return Is}var Bs=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}};const Vs=O(`IExtHostInitDataService`);var Hs=class{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}},Us=class{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){let e=[];for(let t of this._nodes.values())t.outgoing.size===0&&e.push(t);return e}insertEdge(e,t){let n=this.lookupOrInsertNode(e),r=this.lookupOrInsertNode(t);n.outgoing.set(r.key,r),r.incoming.set(n.key,n)}removeNode(e){let t=this._hashFn(e);this._nodes.delete(t);for(let e of this._nodes.values())e.outgoing.delete(t),e.incoming.delete(t)}lookupOrInsertNode(e){let t=this._hashFn(e),n=this._nodes.get(t);return n||(n=new Hs(t,e),this._nodes.set(t,n)),n}lookup(e){return this._nodes.get(this._hashFn(e))}isEmpty(){return this._nodes.size===0}toString(){let e=[];for(let[t,n]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...n.incoming.keys()].join(`, `)}]\n\t(outgoing ->)[${[...n.outgoing.keys()].join(`,`)}]\n`);return e.join(`
|
|
15
|
+
`)}findCycleSlow(){for(let[e,t]of this._nodes){let n=new Set([e]),r=this._findCycle(t,n);if(r)return r}}_findCycle(e,t){for(let[n,r]of e.outgoing){if(t.has(n))return[...t,n].join(` -> `);t.add(n);let e=this._findCycle(r,t);if(e)return e;t.delete(n)}}},Ws=class extends Error{constructor(e){super(`cyclic dependency between services`),this.message=e.findCycleSlow()??`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}},Gs=class e{constructor(e=new Bs,t=!1,n,r=!1){this._services=e,this._strict=t,this._parent=n,this._enableTracing=r,this._isDisposed=!1,this._servicesToMaybeDispose=new Set,this._children=new Set,this._activeInstantiations=new Set,this._services.set(As,this),this._globalGraph=r?n?._globalGraph??new Us(e=>e):void 0}dispose(){if(!this._isDisposed){this._isDisposed=!0,xt(this._children),this._children.clear();for(let e of this._servicesToMaybeDispose)bt(e)&&e.dispose();this._servicesToMaybeDispose.clear()}}_throwIfDisposed(){if(this._isDisposed)throw Error(`InstantiationService has been disposed`)}createChild(t,n){this._throwIfDisposed();let r=this,i=new class extends e{dispose(){r._children.delete(i),super.dispose()}}(t,this._strict,this,this._enableTracing);return this._children.add(i),n?.add(i),i}invokeFunction(e,...t){this._throwIfDisposed();let n=qs.traceInvocation(this._enableTracing,e),r=!1;try{return e({get:e=>{if(r)throw ce(`service accessor is only valid during the invocation of its target method`);let t=this._getOrCreateServiceInstance(e,n);return t||this._throwIfStrict(`[invokeFunction] unknown service '${e}'`,!1),t}},...t)}finally{r=!0,n.stop()}}createInstance(e,...t){this._throwIfDisposed();let n,r;return e instanceof Fs?(n=qs.traceCreation(this._enableTracing,e.ctor),r=this._createInstance(e.ctor,e.staticArguments.concat(t),n)):(n=qs.traceCreation(this._enableTracing,e),r=this._createInstance(e,t,n)),n.stop(),r}_createInstance(e,t=[],n){let r=ks.getServiceDependencies(e).sort((e,t)=>e.index-t.index),i=[];for(let t of r){let r=this._getOrCreateServiceInstance(t.id,n);r||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id}.`,!1),i.push(r)}let a=r.length>0?r[0].index:t.length;if(t.length!==a){console.trace(`[createInstance] First service dependency of ${e.name} at position ${a+1} conflicts with ${t.length} static arguments`);let n=a-t.length;t=n>0?t.concat(Array(n)):t.slice(0,a)}return Reflect.construct(e,t.concat(i))}_setCreatedServiceInstance(e,t){if(this._services.get(e)instanceof Fs)this._services.set(e,t);else if(this._parent)this._parent._setCreatedServiceInstance(e,t);else throw Error(`illegalState - setting UNKNOWN service instance`)}_getServiceInstanceOrDescriptor(e){let t=this._services.get(e);return!t&&this._parent?this._parent._getServiceInstanceOrDescriptor(e):t}_getOrCreateServiceInstance(e,t){this._globalGraph&&this._globalGraphImplicitDependency&&this._globalGraph.insertEdge(this._globalGraphImplicitDependency,String(e));let n=this._getServiceInstanceOrDescriptor(e);return n instanceof Fs?this._safeCreateAndCacheServiceInstance(e,n,t.branch(e,!0)):(t.branch(e,!1),n)}_safeCreateAndCacheServiceInstance(e,t,n){if(this._activeInstantiations.has(e))throw Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this._activeInstantiations.add(e);try{return this._createAndCacheServiceInstance(e,t,n)}finally{this._activeInstantiations.delete(e)}}_createAndCacheServiceInstance(e,t,n){let r=new Us(e=>e.id.toString()),i=0,a=[{id:e,desc:t,_trace:n}],o=new Set;for(;a.length;){let t=a.pop();if(!o.has(String(t.id))){if(o.add(String(t.id)),r.lookupOrInsertNode(t),i++>1e3)throw new Ws(r);for(let n of ks.getServiceDependencies(t.desc.ctor)){let i=this._getServiceInstanceOrDescriptor(n.id);if(i||this._throwIfStrict(`[createInstance] ${e} depends on ${n.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(t.id),String(n.id)),i instanceof Fs){let e={id:n.id,desc:i,_trace:t._trace.branch(n.id,!0)};r.lookup(e)||a.push(e),r.insertEdge(t,e)}}}}for(;;){let e=r.roots();if(e.length===0){if(!r.isEmpty())throw new Ws(r);break}for(let{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof Fs){let e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setCreatedServiceInstance(t.id,e)}r.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,n=[],r,i){if(this._services.get(e)instanceof Fs)return this._createServiceInstance(e,t,n,r,i,this._servicesToMaybeDispose);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,n,r,i);throw Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(t,n,r=[],i,a,o){if(i){let i=new e(void 0,this._strict,this,this._enableTracing);i._globalGraphImplicitDependency=String(t);let s=new Map,c=new Ho(()=>{let e=i._createInstance(n,r,a);for(let[t,n]of s){let r=e[t];if(typeof r==`function`)for(let t of n)t.disposable=r.apply(e,t.listener)}return s.clear(),o.add(e),e});return new Proxy(Object.create(null),{get(e,t){if(!c.isInitialized&&typeof t==`string`&&(t.startsWith(`onDid`)||t.startsWith(`onWill`))){let e=s.get(t);return e||(e=new nn,s.set(t,e)),(n,r,i)=>{if(c.isInitialized)return c.value[t](n,r,i);{let t={listener:[n,r,i],disposable:void 0},a=e.push(t);return g(()=>{a(),t.disposable?.dispose()})}}}if(t in e)return e[t];let n=c.value,r=n[t];return typeof r==`function`?(r=r.bind(n),e[t]=r,r):r},set(e,t,n){return c.value[t]=n,!0},getPrototypeOf(e){return n.prototype}})}else{let e=this._createInstance(n,r,a);return o.add(e),e}}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw Error(e)}},Ks;(function(e){e[e.None=0]=`None`,e[e.Creation=1]=`Creation`,e[e.Invocation=2]=`Invocation`,e[e.Branch=3]=`Branch`})(Ks||={});var qs=class e{static{this.all=new Set}static{this._None=new class extends e{constructor(){super(Ks.None,null)}stop(){}branch(){return this}}}static traceInvocation(t,n){return t?new e(Ks.Invocation,n.name||Error().stack.split(`
|
|
16
|
+
`).slice(3,4).join(`
|
|
17
|
+
`)):e._None}static traceCreation(t,n){return t?new e(Ks.Creation,n.name):e._None}static{this._totals=0}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(t,n){let r=new e(Ks.Branch,t.toString());return this._dep.push([t,n,r]),r}stop(){let t=Date.now()-this._start;e._totals+=t;let n=!1;function r(e,t){let i=[],a=Array(e+1).join(` `);for(let[o,s,c]of t._dep)if(s&&c){n=!0,i.push(`${a}CREATES -> ${o}`);let t=r(e+1,c);t&&i.push(t)}else i.push(`${a}uses -> ${o}`);return i.join(`
|
|
18
|
+
`)}let i=[`${this.type===Ks.Creation?`CREATE`:`CALL`} ${this.name}`,`${r(1,this)}`,`DONE, took ${t.toFixed(2)}ms (grand total ${e._totals.toFixed(2)}ms)`];(t>2||n)&&e.all.add(i.join(`
|
|
19
|
+
`))}};const Js=O(`IExtHostRpcService`);var Ys=class{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 Xs=O(`IURITransformerService`);var Zs=class{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=e=>e,this.transformOutgoing=e=>e,this.transformOutgoingURI=e=>e,this.transformOutgoingScheme=e=>e)}};function k(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function A(e,t){return function(n,r){t(n,r,e)}}var Qs=class{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){return e.charCodeAt(0)-this._value.charCodeAt(this._pos)}value(){return this._value[this._pos]}},$s=class{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)===S.Period)if(e)this._from++;else break;else e=!1;return this}cmp(e){return this._caseSensitive?la(e,this._value,0,e.length,this._from,this._to):da(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},ec=class{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--){let e=this._value.charCodeAt(t);if(!(e===S.Slash||this._splitOnBackslash&&e===S.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++){let t=this._value.charCodeAt(this._to);if(t===S.Slash||this._splitOnBackslash&&t===S.Backslash)if(e)this._from++;else break;else e=!1}return this}cmp(e){return this._caseSensitive?la(e,this._value,0,e.length,this._from,this._to):da(e,this._value,0,e.length,this._from,this._to)}value(){return this._value.substring(this._from,this._to)}},tc;(function(e){e[e.Scheme=1]=`Scheme`,e[e.Authority=2]=`Authority`,e[e.Path=3]=`Path`,e[e.Query=4]=`Query`,e[e.Fragment=5]=`Fragment`})(tc||={});var nc=class{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(tc.Scheme),this._value.authority&&this._states.push(tc.Authority),this._value.path&&(this._pathIterator=new ec(!1,!this._ignorePathCasing(e)),this._pathIterator.reset(e.path),this._pathIterator.value()&&this._states.push(tc.Path)),this._ignoreQueryAndFragment(e)||(this._value.query&&this._states.push(tc.Query),this._value.fragment&&this._states.push(tc.Fragment)),this._stateIdx=0,this}next(){return this._states[this._stateIdx]===tc.Path&&this._pathIterator.hasNext()?this._pathIterator.next():this._stateIdx+=1,this}hasNext(){return this._states[this._stateIdx]===tc.Path&&this._pathIterator.hasNext()||this._stateIdx<this._states.length-1}cmp(e){if(this._states[this._stateIdx]===tc.Scheme)return ua(e,this._value.scheme);if(this._states[this._stateIdx]===tc.Authority)return ua(e,this._value.authority);if(this._states[this._stateIdx]===tc.Path)return this._pathIterator.cmp(e);if(this._states[this._stateIdx]===tc.Query)return ca(e,this._value.query);if(this._states[this._stateIdx]===tc.Fragment)return ca(e,this._value.fragment);throw Error()}value(){if(this._states[this._stateIdx]===tc.Scheme)return this._value.scheme;if(this._states[this._stateIdx]===tc.Authority)return this._value.authority;if(this._states[this._stateIdx]===tc.Path)return this._pathIterator.value();if(this._states[this._stateIdx]===tc.Query)return this._value.query;if(this._states[this._stateIdx]===tc.Fragment)return this._value.fragment;throw Error()}},rc=class e{static{this.Val=Symbol(`undefined_placeholder`)}static wrap(t){return t===void 0?e.Val:t}static unwrap(t){return t===e.Val?void 0:t}},ic=class{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(){let e=this.right;return this.right=e.left,e.left=this,this.updateHeight(),e.updateHeight(),e}rotateRight(){let 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}},ac;(function(e){e[e.Left=-1]=`Left`,e[e.Mid=0]=`Mid`,e[e.Right=1]=`Right`})(ac||={});var oc=class e{static forUris(t=()=>!1,n=()=>!1){return new e(new nc(t,n))}static forPaths(t=!1){return new e(new ec(void 0,!t))}static forStrings(){return new e(new Qs)}static forConfigKeys(){return new e(new $s)}constructor(e){this._iter=e}clear(){this._root=void 0}fill(e,t){if(t){let n=t.slice(0);De(n);for(let t of n)this.set(t,e)}else{let t=e.slice(0);De(t);for(let e of t)this.set(e[0],e[1])}}set(e,t){let n=this._iter.reset(e),r;this._root||(this._root=new ic,this._root.segment=n.value());let i=[];for(r=this._root;;){let e=n.cmp(r.segment);if(e>0)r.left||(r.left=new ic,r.left.segment=n.value()),i.push([ac.Left,r]),r=r.left;else if(e<0)r.right||(r.right=new ic,r.right.segment=n.value()),i.push([ac.Right,r]),r=r.right;else if(n.hasNext())n.next(),r.mid||(r.mid=new ic,r.mid.segment=n.value()),i.push([ac.Mid,r]),r=r.mid;else break}let a=rc.unwrap(r.value);r.value=rc.wrap(t),r.key=e;for(let e=i.length-1;e>=0;e--){let t=i[e][1];t.updateHeight();let n=t.balanceFactor();if(n<-1||n>1){let n=i[e][0],r=i[e+1][0];if(n===ac.Right&&r===ac.Right)i[e][1]=t.rotateLeft();else if(n===ac.Left&&r===ac.Left)i[e][1]=t.rotateRight();else if(n===ac.Right&&r===ac.Left)t.right=i[e+1][1]=i[e+1][1].rotateRight(),i[e][1]=t.rotateLeft();else if(n===ac.Left&&r===ac.Right)t.left=i[e+1][1]=i[e+1][1].rotateLeft(),i[e][1]=t.rotateRight();else throw Error();if(e>0)switch(i[e-1][0]){case ac.Left:i[e-1][1].left=i[e][1];break;case ac.Right:i[e-1][1].right=i[e][1];break;case ac.Mid:i[e-1][1].mid=i[e][1];break}else this._root=i[0][1]}}return a}get(e){return rc.unwrap(this._getNode(e)?.value)}_getNode(e){let t=this._iter.reset(e),n=this._root;for(;n;){let e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else if(t.hasNext())t.next(),n=n.mid;else break}return n}has(e){let 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){let n=this._iter.reset(e),r=[],i=this._root;for(;i;){let e=n.cmp(i.segment);if(e>0)r.push([ac.Left,i]),i=i.left;else if(e<0)r.push([ac.Right,i]),i=i.right;else if(n.hasNext())n.next(),r.push([ac.Mid,i]),i=i.mid;else break}if(i){if(t?(i.left=void 0,i.mid=void 0,i.right=void 0,i.height=1):(i.key=void 0,i.value=void 0),!i.mid&&!i.value)if(i.left&&i.right){let e=[[ac.Right,i]],t=this._min(i.right,e);if(t.key){i.key=t.key,i.value=t.value,i.segment=t.segment;let n=t.right;if(e.length>1){let[t,r]=e[e.length-1];switch(t){case ac.Left:r.left=n;break;case ac.Mid:Qe(!1);case ac.Right:Qe(!1)}}else i.right=n;let a=this._balanceByStack(e);if(r.length>0){let[e,t]=r[r.length-1];switch(e){case ac.Left:t.left=a;break;case ac.Mid:t.mid=a;break;case ac.Right:t.right=a;break}}else this._root=a}}else{let e=i.left??i.right;if(r.length>0){let[t,n]=r[r.length-1];switch(t){case ac.Left:n.left=e;break;case ac.Mid:n.mid=e;break;case ac.Right:n.right=e;break}}else this._root=e}this._root=this._balanceByStack(r)??this._root}}_min(e,t){for(;e.left;)t.push([ac.Left,e]),e=e.left;return e}_balanceByStack(e){for(let t=e.length-1;t>=0;t--){let n=e[t][1];n.updateHeight();let r=n.balanceFactor();if(r>1?(n.right.balanceFactor()>=0||(n.right=n.right.rotateRight()),e[t][1]=n.rotateLeft()):r<-1&&(n.left.balanceFactor()<=0||(n.left=n.left.rotateLeft()),e[t][1]=n.rotateRight()),t>0)switch(e[t-1][0]){case ac.Left:e[t-1][1].left=e[t][1];break;case ac.Right:e[t-1][1].right=e[t][1];break;case ac.Mid:e[t-1][1].mid=e[t][1];break}else return e[0][1]}}findSubstr(e){let t=this._iter.reset(e),n=this._root,r;for(;n;){let e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else if(t.hasNext())t.next(),r=rc.unwrap(n.value)||r,n=n.mid;else break}return n&&rc.unwrap(n.value)||r}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){let n=this._iter.reset(e),r=this._root;for(;r;){let e=n.cmp(r.segment);if(e>0)r=r.left;else if(e<0)r=r.right;else if(n.hasNext())n.next(),r=r.mid;else if(r.mid)return this._entries(r.mid);else return t?rc.unwrap(r.value):void 0}}hasElementOrSubtree(e){return this._findSuperstrOrElement(e,!0)!==void 0}forEach(e){for(let[t,n]of this)e(n,t)}*[Symbol.iterator](){yield*this._entries(this._root)}_entries(e){let 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,rc.unwrap(e.value)]),e.mid&&this._dfsEntries(e.mid,t),e.right&&this._dfsEntries(e.right,t))}_isBalanced(){let e=t=>{if(!t)return!0;let n=t.balanceFactor();return n<-1||n>1?!1:e(t.left)&&e(t.right)};return e(this._root)}};function sc(e){if(!e||typeof e!=`object`||e instanceof RegExp)return e;let t=Array.isArray(e)?[]:{};return Object.entries(e).forEach(([e,n])=>{t[e]=n&&typeof n==`object`?sc(n):n}),t}function cc(e){if(!e||typeof e!=`object`)return e;let t=[e];for(;t.length>0;){let e=t.shift();for(let n in e)if(lc.call(e,n)){let r=e[n];typeof r==`object`&&!Object.isFrozen(r)&&!it(r)&&t.push(r)}}return e}const lc=Object.prototype.hasOwnProperty;function uc(e,t){return dc(e,t,new Set)}function dc(e,t,n){if(lt(e))return e;let r=t(e);if(r!==void 0)return r;if(Array.isArray(e)){let r=[];for(let i of e)r.push(dc(i,t,n));return r}if(rt(e)){if(n.has(e))throw Error(`Cannot clone recursive data-structure`);n.add(e);let r={};for(let i in e)lc.call(e,i)&&(r[i]=dc(e[i],t,n));return n.delete(e),r}return e}function fc(e,t,n=!0){return rt(e)?(rt(t)&&Object.keys(t).forEach(r=>{r in e?n&&(rt(e[r])&&rt(t[r])?fc(e[r],t[r],n):e[r]=t[r]):e[r]=t[r]}),e):t}function pc(e,t){if(e===t)return!0;if(e==null||t==null||typeof e!=typeof t||typeof e!=`object`||Array.isArray(e)!==Array.isArray(t))return!1;let n,r;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(n=0;n<e.length;n++)if(!pc(e[n],t[n]))return!1}else{let i=[];for(r in e)i.push(r);i.sort();let a=[];for(r in t)a.push(r);if(a.sort(),!pc(i,a))return!1;for(n=0;n<i.length;n++)if(!pc(e[i[n]],t[i[n]]))return!1}return!0}function mc(e){let t=new Set;return JSON.stringify(e,(e,n)=>{if(rt(n)||Array.isArray(n)){if(t.has(n))return`[Circular]`;t.add(n)}return typeof n==`bigint`?`[BigInt ${n.toString()}]`:n})}function hc(e,t){let n=Object.create(null);for(let[r,i]of Object.entries(e))t(r,i)&&(n[r]=i);return n}var gc=class{constructor(){this._next=0}getNext(){return this._next++}},_c;(function(e){e[e.Unknown=0]=`Unknown`,e[e.File=1]=`File`,e[e.Directory=2]=`Directory`,e[e.SymbolicLink=64]=`SymbolicLink`})(_c||={});var vc;(function(e){e[e.Readonly=1]=`Readonly`,e[e.Locked=2]=`Locked`,e[e.Executable=4]=`Executable`})(vc||={});var yc;(function(e){e[e.UPDATED=2]=`UPDATED`,e[e.ADDED=4]=`ADDED`,e[e.DELETED=8]=`DELETED`})(yc||={});var bc;(function(e){e[e.None=0]=`None`,e[e.FileReadWrite=2]=`FileReadWrite`,e[e.FileOpenReadWriteClose=4]=`FileOpenReadWriteClose`,e[e.FileReadStream=16]=`FileReadStream`,e[e.FileFolderCopy=8]=`FileFolderCopy`,e[e.PathCaseSensitive=1024]=`PathCaseSensitive`,e[e.Readonly=2048]=`Readonly`,e[e.Trash=4096]=`Trash`,e[e.FileWriteUnlock=8192]=`FileWriteUnlock`,e[e.FileAtomicRead=16384]=`FileAtomicRead`,e[e.FileAtomicWrite=32768]=`FileAtomicWrite`,e[e.FileAtomicDelete=65536]=`FileAtomicDelete`,e[e.FileClone=131072]=`FileClone`,e[e.FileRealpath=262144]=`FileRealpath`,e[e.FileAppend=524288]=`FileAppend`})(bc||={});var xc;(function(e){e.FileExists=`EntryExists`,e.FileNotFound=`EntryNotFound`,e.FileNotADirectory=`EntryNotADirectory`,e.FileIsADirectory=`EntryIsADirectory`,e.FileExceedsStorageQuota=`EntryExceedsStorageQuota`,e.FileTooLarge=`EntryTooLarge`,e.FileWriteLocked=`EntryWriteLocked`,e.NoPermissions=`NoPermissions`,e.Unavailable=`Unavailable`,e.Unknown=`Unknown`})(xc||={});var Sc=class e extends Error{static create(t,n){let r=new e(t.toString(),n);return Cc(r,n),r}constructor(e,t){super(e),this.code=t}};function Cc(e,t){return e.name=t?`${t} (FileSystemError)`:`FileSystemError`,e}function wc(e){if(!e)return xc.Unknown;if(e instanceof Sc)return e.code;let t=/^(.+) \(FileSystemError\)$/.exec(e.name);if(!t)return xc.Unknown;switch(t[1]){case xc.FileExists:return xc.FileExists;case xc.FileIsADirectory:return xc.FileIsADirectory;case xc.FileNotADirectory:return xc.FileNotADirectory;case xc.FileNotFound:return xc.FileNotFound;case xc.FileTooLarge:return xc.FileTooLarge;case xc.FileWriteLocked:return xc.FileWriteLocked;case xc.NoPermissions:return xc.NoPermissions;case xc.Unavailable:return xc.Unavailable}return xc.Unknown}function Tc(e){if(e instanceof Oc)return e.fileOperationResult;switch(wc(e)){case xc.FileNotFound:return kc.FILE_NOT_FOUND;case xc.FileIsADirectory:return kc.FILE_IS_DIRECTORY;case xc.FileNotADirectory:return kc.FILE_NOT_DIRECTORY;case xc.FileWriteLocked:return kc.FILE_WRITE_LOCKED;case xc.NoPermissions:return kc.FILE_PERMISSION_DENIED;case xc.FileExists:return kc.FILE_MOVE_CONFLICT;case xc.FileTooLarge:return kc.FILE_TOO_LARGE;default:return kc.FILE_OTHER_ERROR}}var Ec;(function(e){e[e.CREATE=0]=`CREATE`,e[e.DELETE=1]=`DELETE`,e[e.MOVE=2]=`MOVE`,e[e.COPY=3]=`COPY`,e[e.WRITE=4]=`WRITE`})(Ec||={});var Dc;(function(e){e[e.UPDATED=0]=`UPDATED`,e[e.ADDED=1]=`ADDED`,e[e.DELETED=2]=`DELETED`})(Dc||={}),class e{static{this.MIXED_CORRELATION=null}constructor(t,n){this.ignorePathCasing=n,this.correlationId=void 0,this.added=new u(()=>{let e=oc.forUris(()=>this.ignorePathCasing);return e.fill(this.rawAdded.map(e=>[e,!0])),e}),this.updated=new u(()=>{let e=oc.forUris(()=>this.ignorePathCasing);return e.fill(this.rawUpdated.map(e=>[e,!0])),e}),this.deleted=new u(()=>{let e=oc.forUris(()=>this.ignorePathCasing);return e.fill(this.rawDeleted.map(e=>[e,!0])),e}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(let n of t){switch(n.type){case Dc.ADDED:this.rawAdded.push(n.resource);break;case Dc.UPDATED:this.rawUpdated.push(n.resource);break;case Dc.DELETED:this.rawDeleted.push(n.resource);break}this.correlationId!==e.MIXED_CORRELATION&&(typeof n.cId==`number`?this.correlationId===void 0?this.correlationId=n.cId:this.correlationId!==n.cId&&(this.correlationId=e.MIXED_CORRELATION):this.correlationId!==void 0&&(this.correlationId=e.MIXED_CORRELATION))}}contains(e,...t){return this.doContains(e,{includeChildren:!1},...t)}affects(e,...t){return this.doContains(e,{includeChildren:!0},...t)}doContains(e,t,...n){if(!e)return!1;let r=n.length>0;return!!((!r||n.includes(Dc.ADDED))&&(this.added.value.get(e)||t.includeChildren&&this.added.value.findSuperstr(e))||(!r||n.includes(Dc.UPDATED))&&(this.updated.value.get(e)||t.includeChildren&&this.updated.value.findSuperstr(e))||(!r||n.includes(Dc.DELETED))&&(this.deleted.value.findSubstr(e)||t.includeChildren&&this.deleted.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.correlationId===e}hasCorrelation(){return typeof this.correlationId==`number`}};var Oc=class extends Error{constructor(e,t,n){super(e),this.fileOperationResult=t,this.options=n}},kc;(function(e){e[e.FILE_IS_DIRECTORY=0]=`FILE_IS_DIRECTORY`,e[e.FILE_NOT_FOUND=1]=`FILE_NOT_FOUND`,e[e.FILE_NOT_MODIFIED_SINCE=2]=`FILE_NOT_MODIFIED_SINCE`,e[e.FILE_MODIFIED_SINCE=3]=`FILE_MODIFIED_SINCE`,e[e.FILE_MOVE_CONFLICT=4]=`FILE_MOVE_CONFLICT`,e[e.FILE_WRITE_LOCKED=5]=`FILE_WRITE_LOCKED`,e[e.FILE_PERMISSION_DENIED=6]=`FILE_PERMISSION_DENIED`,e[e.FILE_TOO_LARGE=7]=`FILE_TOO_LARGE`,e[e.FILE_INVALID_PATH=8]=`FILE_INVALID_PATH`,e[e.FILE_NOT_DIRECTORY=9]=`FILE_NOT_DIRECTORY`,e[e.FILE_OTHER_ERROR=10]=`FILE_OTHER_ERROR`})(kc||={});var Ac;(function(e){e[e.FILE=0]=`FILE`,e[e.FOLDER=1]=`FOLDER`,e[e.ROOT_FOLDER=2]=`ROOT_FOLDER`})(Ac||={});function jc(e){if(!(typeof e.size!=`number`||typeof e.mtime!=`number`))return e.mtime.toString(29)+e.size.toString(31)}(class e{static{this.KB=1024}static{this.MB=e.KB*e.KB}static{this.GB=e.MB*e.KB}static{this.TB=e.GB*e.KB}static formatSize(t){return at(t)||(t=0),t<e.KB?b(2045,`{0}B`,t.toFixed(0)):t<e.MB?b(2046,`{0}KB`,(t/e.KB).toFixed(2)):t<e.GB?b(2047,`{0}MB`,(t/e.MB).toFixed(2)):t<e.TB?b(2048,`{0}GB`,(t/e.GB).toFixed(2)):b(2049,`{0}TB`,(t/e.TB).toFixed(2))}});var Mc;(function(e){e[e.Ignore=0]=`Ignore`,e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(Mc||={}),(function(e){let t=`error`,n=`warning`,r=`info`;function i(i){return i?pa(t,i)?e.Error:pa(n,i)||pa(`warn`,i)?e.Warning:pa(r,i)?e.Info:e.Ignore:e.Ignore}e.fromValue=i;function a(i){switch(i){case e.Error:return t;case e.Warning:return n;case e.Info:return r;default:return`ignore`}}e.toString=a})(Mc||={});var Nc=Mc,Pc;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.OPTIONAL=1]=`OPTIONAL`,e[e.SILENT=2]=`SILENT`,e[e.URGENT=3]=`URGENT`})(Pc||={});var Fc;(function(e){e[e.WORKSPACE=0]=`WORKSPACE`,e[e.PROFILE=1]=`PROFILE`,e[e.APPLICATION=2]=`APPLICATION`})(Fc||={});var Ic;(function(e){e[e.OFF=0]=`OFF`,e[e.ERROR=1]=`ERROR`})(Ic||={});function Lc(e){let t=e;return typeof t?.id==`string`&&C.isUri(t.uri)}function Rc(e){let t=e;return typeof t?.id==`string`&&C.isUri(t.configPath)}var zc;(function(e){e[e.EMPTY=1]=`EMPTY`,e[e.FOLDER=2]=`FOLDER`,e[e.WORKSPACE=3]=`WORKSPACE`})(zc||={});let Bc=class{get folders(){return this._folders}set folders(e){this._folders=e,this.updateFoldersMap()}constructor(e,t,n,r,i,a){this._id=e,this._transient=n,this._configuration=r,this.ignorePathCasing=i,this._workspaceName=a,this.foldersMap=oc.forUris(this.ignorePathCasing,()=>!0),this.folders=t}update(e){this._id=e.id,this._configuration=e.configuration,this._transient=e.transient,this._workspaceName=e.name,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}get name(){return this._workspaceName}getFolder(e){return e&&this.foldersMap.findSubstr(e)||null}updateFoldersMap(){this.foldersMap=oc.forUris(this.ignorePathCasing,()=>!0);for(let e of this.folders)this.foldersMap.set(e.uri,e)}toJSON(){return{id:this.id,folders:this.folders,transient:this.transient,configuration:this.configuration,name:this.name}}};var Vc=class{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toResource(e){return uo(this.uri,e)}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}};function Hc(e){return new Vc({uri:e,index:0,name:oo(e)},{uri:e.toString()})}b(2607,`Code Workspace`);var Uc=class{constructor(){this._systemSchemes=new Set(Object.keys(D)),this._providerInfo=new Map,this.extUri=new to(e=>{let t=this._providerInfo.get(e.scheme);return!(t===void 0||t&bc.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 Wc=O(`IExtHostFileSystemInfo`),Gc=(function(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID.bind(crypto);let e=new Uint8Array(16),t=[];for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,`0`));return function(){crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,r=``;return r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=`-`,r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r+=t[e[n++]],r}})(),Kc=Object.freeze({create:e=>Ee(e.map(e=>e.toString())).join(`\r
|
|
20
|
+
`),split:e=>e.split(`\r
|
|
21
|
+
`),parse:e=>Kc.split(e).filter(e=>!e.startsWith(`#`))});var qc;(function(e){e[e.InitialConsonant=4352]=`InitialConsonant`,e[e.Vowel=4449]=`Vowel`,e[e.FinalConsonant=4520]=`FinalConsonant`,e[e.CompatibilityJamo=12593]=`CompatibilityJamo`})(qc||={});var j;(function(e){e[e.NUL=0]=`NUL`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`})(j||={});var Jc;(function(e){e[e.fa=24934]=`fa`,e[e.fg=26470]=`fg`,e[e.fq=29030]=`fq`,e[e.fr=29286]=`fr`,e[e.ft=29798]=`ft`,e[e.fv=30310]=`fv`,e[e.fx=30822]=`fx`,e[e.hk=27496]=`hk`,e[e.hl=27752]=`hl`,e[e.ho=28520]=`ho`,e[e.ml=27757]=`ml`,e[e.nj=27246]=`nj`,e[e.nl=27758]=`nl`,e[e.np=28782]=`np`,e[e.qt=29809]=`qt`,e[e.rt=29810]=`rt`,e[e.sg=26483]=`sg`,e[e.sw=30579]=`sw`})(Jc||={}),new Uint8Array([j.r,j.R,j.s,j.e,j.E,j.f,j.a,j.q,j.Q,j.t,j.T,j.d,j.w,j.W,j.c,j.z,j.x,j.v,j.g]),new Uint16Array([j.k,j.o,j.i,j.O,j.j,j.p,j.u,j.P,j.h,Jc.hk,Jc.ho,Jc.hl,j.y,j.n,Jc.nj,Jc.np,Jc.nl,j.b,j.m,Jc.ml,j.l]),new Uint16Array([j.r,j.R,Jc.rt,j.s,Jc.sw,Jc.sg,j.e,j.f,Jc.fr,Jc.fa,Jc.fq,Jc.ft,Jc.fx,Jc.fv,Jc.fg,j.a,j.q,Jc.qt,j.t,j.T,j.d,j.w,j.c,j.z,j.x,j.v,j.g]),new Uint16Array([j.r,j.R,Jc.rt,j.s,Jc.sw,Jc.sg,j.e,j.E,j.f,Jc.fr,Jc.fa,Jc.fq,Jc.ft,Jc.fx,Jc.fv,Jc.fg,j.a,j.q,j.Q,Jc.qt,j.t,j.T,j.d,j.w,j.W,j.c,j.z,j.x,j.v,j.g,j.k,j.o,j.i,j.O,j.j,j.p,j.u,j.P,j.h,Jc.hk,Jc.ho,Jc.hl,j.y,j.n,Jc.nj,Jc.np,Jc.nl,j.b,j.m,Jc.ml,j.l]);const Yc=new qe(1e4);function Xc(e){return Qc(e,`NFD`,Yc)}const Zc=/[^\u0000-\u0080]/;function Qc(e,t,n){if(!e)return e;let r=n.get(e);if(r)return r;let i;return i=Zc.test(e)?e.normalize(t):e,n.set(e,i),i}(function(){let e=new qe(1e4),t=/[\u0300-\u036f]/g;return function(n){let r=e.get(n);if(r)return r;let i=Xc(n).replace(t,``),a=(i.length===n.length?i:n).toLowerCase();return e.set(n,a),a}})(),$c.bind(void 0,!1),$c.bind(void 0,!0);function $c(e,t,n){if(!n||n.length<t.length)return null;let r;return r=e?ha(n,t):n.indexOf(t)===0,r?t.length>0?[{start:0,end:t.length}]:[]:null}function el(e,t,n,r){if(n===e.length)return[];if(r===t.length)return null;if(e[n]===t[r]){let i=null;return(i=el(e,t,n+1,r+1))?ol({start:r,end:r+1},i):null}return el(e,t,n,r+1)}function tl(e){return S.a<=e&&e<=S.z}function nl(e){return S.A<=e&&e<=S.Z}function rl(e){return S.Digit0<=e&&e<=S.Digit9}const il=new Set;`()[]{}<>\`'"-/;:,.?!`.split(``).forEach(e=>il.add(e.charCodeAt(0)));function al(e){return tl(e)||nl(e)||rl(e)}function ol(e,t){return t.length===0?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function sl(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(nl(t)||rl(t)||n>0&&!al(e.charCodeAt(n-1)))return n}return e.length}function cl(e,t,n,r){if(n===e.length)return[];if(r===t.length||e[n]!==t[r].toLowerCase())return null;{let i=null,a=r+1;for(i=cl(e,t,n+1,r+1);!i&&(a=sl(t,a))<t.length;)i=cl(e,t,n+1,a),a++;return i===null?null:ol({start:r,end:r+1},i)}}new qe(1e4);function ll(){let e=[],t=[];for(let e=0;e<=128;e++)t[e]=0;for(let n=0;n<=128;n++)e.push(t.slice(0));return e}function ul(e){let t=[];for(let n=0;n<=e;n++)t[n]=0;return t}ul(256),ul(256),ll(),ll(),ll();var dl;(function(e){e[e.Diag=1]=`Diag`,e[e.Left=2]=`Left`,e[e.LeftLeft=3]=`LeftLeft`})(dl||={});var fl;(function(e){e.Default=[-100,0];function t(e){return!e||e.length===2&&e[0]===-100&&e[1]===0}e.isDefault=t})(fl||={}),class{static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}};const pl=Object.create(null);function M(e,t){if(et(t)){let n=pl[t];if(n===void 0)throw Error(`${e} references an unknown codicon: ${t}`);t=n}return pl[e]=t,{id:e}}function ml(){return pl}const hl={add:M(`add`,6e4),plus:M(`plus`,6e4),gistNew:M(`gist-new`,6e4),repoCreate:M(`repo-create`,6e4),lightbulb:M(`lightbulb`,60001),lightBulb:M(`light-bulb`,60001),repo:M(`repo`,60002),repoDelete:M(`repo-delete`,60002),gistFork:M(`gist-fork`,60003),repoForked:M(`repo-forked`,60003),gitPullRequest:M(`git-pull-request`,60004),gitPullRequestAbandoned:M(`git-pull-request-abandoned`,60004),recordKeys:M(`record-keys`,60005),keyboard:M(`keyboard`,60005),tag:M(`tag`,60006),gitPullRequestLabel:M(`git-pull-request-label`,60006),tagAdd:M(`tag-add`,60006),tagRemove:M(`tag-remove`,60006),person:M(`person`,60007),personFollow:M(`person-follow`,60007),personOutline:M(`person-outline`,60007),personFilled:M(`person-filled`,60007),sourceControl:M(`source-control`,60008),mirror:M(`mirror`,60009),mirrorPublic:M(`mirror-public`,60009),star:M(`star`,60010),starAdd:M(`star-add`,60010),starDelete:M(`star-delete`,60010),starEmpty:M(`star-empty`,60010),comment:M(`comment`,60011),commentAdd:M(`comment-add`,60011),alert:M(`alert`,60012),warning:M(`warning`,60012),search:M(`search`,60013),searchSave:M(`search-save`,60013),logOut:M(`log-out`,60014),signOut:M(`sign-out`,60014),logIn:M(`log-in`,60015),signIn:M(`sign-in`,60015),eye:M(`eye`,60016),eyeUnwatch:M(`eye-unwatch`,60016),eyeWatch:M(`eye-watch`,60016),circleFilled:M(`circle-filled`,60017),primitiveDot:M(`primitive-dot`,60017),closeDirty:M(`close-dirty`,60017),debugBreakpoint:M(`debug-breakpoint`,60017),debugBreakpointDisabled:M(`debug-breakpoint-disabled`,60017),debugHint:M(`debug-hint`,60017),terminalDecorationSuccess:M(`terminal-decoration-success`,60017),primitiveSquare:M(`primitive-square`,60018),edit:M(`edit`,60019),pencil:M(`pencil`,60019),info:M(`info`,60020),issueOpened:M(`issue-opened`,60020),gistPrivate:M(`gist-private`,60021),gitForkPrivate:M(`git-fork-private`,60021),lock:M(`lock`,60021),mirrorPrivate:M(`mirror-private`,60021),close:M(`close`,60022),removeClose:M(`remove-close`,60022),x:M(`x`,60022),repoSync:M(`repo-sync`,60023),sync:M(`sync`,60023),clone:M(`clone`,60024),desktopDownload:M(`desktop-download`,60024),beaker:M(`beaker`,60025),microscope:M(`microscope`,60025),vm:M(`vm`,60026),deviceDesktop:M(`device-desktop`,60026),file:M(`file`,60027),more:M(`more`,60028),ellipsis:M(`ellipsis`,60028),kebabHorizontal:M(`kebab-horizontal`,60028),mailReply:M(`mail-reply`,60029),reply:M(`reply`,60029),organization:M(`organization`,60030),organizationFilled:M(`organization-filled`,60030),organizationOutline:M(`organization-outline`,60030),newFile:M(`new-file`,60031),fileAdd:M(`file-add`,60031),newFolder:M(`new-folder`,60032),fileDirectoryCreate:M(`file-directory-create`,60032),trash:M(`trash`,60033),trashcan:M(`trashcan`,60033),history:M(`history`,60034),clock:M(`clock`,60034),folder:M(`folder`,60035),fileDirectory:M(`file-directory`,60035),symbolFolder:M(`symbol-folder`,60035),logoGithub:M(`logo-github`,60036),markGithub:M(`mark-github`,60036),github:M(`github`,60036),terminal:M(`terminal`,60037),console:M(`console`,60037),repl:M(`repl`,60037),zap:M(`zap`,60038),symbolEvent:M(`symbol-event`,60038),error:M(`error`,60039),stop:M(`stop`,60039),variable:M(`variable`,60040),symbolVariable:M(`symbol-variable`,60040),array:M(`array`,60042),symbolArray:M(`symbol-array`,60042),symbolModule:M(`symbol-module`,60043),symbolPackage:M(`symbol-package`,60043),symbolNamespace:M(`symbol-namespace`,60043),symbolObject:M(`symbol-object`,60043),symbolMethod:M(`symbol-method`,60044),symbolFunction:M(`symbol-function`,60044),symbolConstructor:M(`symbol-constructor`,60044),symbolBoolean:M(`symbol-boolean`,60047),symbolNull:M(`symbol-null`,60047),symbolNumeric:M(`symbol-numeric`,60048),symbolNumber:M(`symbol-number`,60048),symbolStructure:M(`symbol-structure`,60049),symbolStruct:M(`symbol-struct`,60049),symbolParameter:M(`symbol-parameter`,60050),symbolTypeParameter:M(`symbol-type-parameter`,60050),symbolKey:M(`symbol-key`,60051),symbolText:M(`symbol-text`,60051),symbolReference:M(`symbol-reference`,60052),goToFile:M(`go-to-file`,60052),symbolEnum:M(`symbol-enum`,60053),symbolValue:M(`symbol-value`,60053),symbolRuler:M(`symbol-ruler`,60054),symbolUnit:M(`symbol-unit`,60054),activateBreakpoints:M(`activate-breakpoints`,60055),archive:M(`archive`,60056),arrowBoth:M(`arrow-both`,60057),arrowDown:M(`arrow-down`,60058),arrowLeft:M(`arrow-left`,60059),arrowRight:M(`arrow-right`,60060),arrowSmallDown:M(`arrow-small-down`,60061),arrowSmallLeft:M(`arrow-small-left`,60062),arrowSmallRight:M(`arrow-small-right`,60063),arrowSmallUp:M(`arrow-small-up`,60064),arrowUp:M(`arrow-up`,60065),bell:M(`bell`,60066),bold:M(`bold`,60067),book:M(`book`,60068),bookmark:M(`bookmark`,60069),debugBreakpointConditionalUnverified:M(`debug-breakpoint-conditional-unverified`,60070),debugBreakpointConditional:M(`debug-breakpoint-conditional`,60071),debugBreakpointConditionalDisabled:M(`debug-breakpoint-conditional-disabled`,60071),debugBreakpointDataUnverified:M(`debug-breakpoint-data-unverified`,60072),debugBreakpointData:M(`debug-breakpoint-data`,60073),debugBreakpointDataDisabled:M(`debug-breakpoint-data-disabled`,60073),debugBreakpointLogUnverified:M(`debug-breakpoint-log-unverified`,60074),debugBreakpointLog:M(`debug-breakpoint-log`,60075),debugBreakpointLogDisabled:M(`debug-breakpoint-log-disabled`,60075),briefcase:M(`briefcase`,60076),broadcast:M(`broadcast`,60077),browser:M(`browser`,60078),bug:M(`bug`,60079),calendar:M(`calendar`,60080),caseSensitive:M(`case-sensitive`,60081),check:M(`check`,60082),checklist:M(`checklist`,60083),chevronDown:M(`chevron-down`,60084),chevronLeft:M(`chevron-left`,60085),chevronRight:M(`chevron-right`,60086),chevronUp:M(`chevron-up`,60087),chromeClose:M(`chrome-close`,60088),chromeMaximize:M(`chrome-maximize`,60089),chromeMinimize:M(`chrome-minimize`,60090),chromeRestore:M(`chrome-restore`,60091),circleOutline:M(`circle-outline`,60092),circle:M(`circle`,60092),debugBreakpointUnverified:M(`debug-breakpoint-unverified`,60092),terminalDecorationIncomplete:M(`terminal-decoration-incomplete`,60092),circleSlash:M(`circle-slash`,60093),circuitBoard:M(`circuit-board`,60094),clearAll:M(`clear-all`,60095),clippy:M(`clippy`,60096),closeAll:M(`close-all`,60097),cloudDownload:M(`cloud-download`,60098),cloudUpload:M(`cloud-upload`,60099),code:M(`code`,60100),collapseAll:M(`collapse-all`,60101),colorMode:M(`color-mode`,60102),commentDiscussion:M(`comment-discussion`,60103),creditCard:M(`credit-card`,60105),dash:M(`dash`,60108),dashboard:M(`dashboard`,60109),database:M(`database`,60110),debugContinue:M(`debug-continue`,60111),debugDisconnect:M(`debug-disconnect`,60112),debugPause:M(`debug-pause`,60113),debugRestart:M(`debug-restart`,60114),debugStart:M(`debug-start`,60115),debugStepInto:M(`debug-step-into`,60116),debugStepOut:M(`debug-step-out`,60117),debugStepOver:M(`debug-step-over`,60118),debugStop:M(`debug-stop`,60119),debug:M(`debug`,60120),deviceCameraVideo:M(`device-camera-video`,60121),deviceCamera:M(`device-camera`,60122),deviceMobile:M(`device-mobile`,60123),diffAdded:M(`diff-added`,60124),diffIgnored:M(`diff-ignored`,60125),diffModified:M(`diff-modified`,60126),diffRemoved:M(`diff-removed`,60127),diffRenamed:M(`diff-renamed`,60128),diff:M(`diff`,60129),diffSidebyside:M(`diff-sidebyside`,60129),discard:M(`discard`,60130),editorLayout:M(`editor-layout`,60131),emptyWindow:M(`empty-window`,60132),exclude:M(`exclude`,60133),extensions:M(`extensions`,60134),eyeClosed:M(`eye-closed`,60135),fileBinary:M(`file-binary`,60136),fileCode:M(`file-code`,60137),fileMedia:M(`file-media`,60138),filePdf:M(`file-pdf`,60139),fileSubmodule:M(`file-submodule`,60140),fileSymlinkDirectory:M(`file-symlink-directory`,60141),fileSymlinkFile:M(`file-symlink-file`,60142),fileZip:M(`file-zip`,60143),files:M(`files`,60144),filter:M(`filter`,60145),flame:M(`flame`,60146),foldDown:M(`fold-down`,60147),foldUp:M(`fold-up`,60148),fold:M(`fold`,60149),folderActive:M(`folder-active`,60150),folderOpened:M(`folder-opened`,60151),gear:M(`gear`,60152),gift:M(`gift`,60153),gistSecret:M(`gist-secret`,60154),gist:M(`gist`,60155),gitCommit:M(`git-commit`,60156),gitCompare:M(`git-compare`,60157),compareChanges:M(`compare-changes`,60157),gitMerge:M(`git-merge`,60158),githubAction:M(`github-action`,60159),githubAlt:M(`github-alt`,60160),globe:M(`globe`,60161),grabber:M(`grabber`,60162),graph:M(`graph`,60163),gripper:M(`gripper`,60164),heart:M(`heart`,60165),home:M(`home`,60166),horizontalRule:M(`horizontal-rule`,60167),hubot:M(`hubot`,60168),inbox:M(`inbox`,60169),issueReopened:M(`issue-reopened`,60171),issues:M(`issues`,60172),italic:M(`italic`,60173),jersey:M(`jersey`,60174),json:M(`json`,60175),bracket:M(`bracket`,60175),kebabVertical:M(`kebab-vertical`,60176),key:M(`key`,60177),law:M(`law`,60178),lightbulbAutofix:M(`lightbulb-autofix`,60179),linkExternal:M(`link-external`,60180),link:M(`link`,60181),listOrdered:M(`list-ordered`,60182),listUnordered:M(`list-unordered`,60183),liveShare:M(`live-share`,60184),loading:M(`loading`,60185),location:M(`location`,60186),mailRead:M(`mail-read`,60187),mail:M(`mail`,60188),markdown:M(`markdown`,60189),megaphone:M(`megaphone`,60190),mention:M(`mention`,60191),milestone:M(`milestone`,60192),gitPullRequestMilestone:M(`git-pull-request-milestone`,60192),mortarBoard:M(`mortar-board`,60193),move:M(`move`,60194),multipleWindows:M(`multiple-windows`,60195),mute:M(`mute`,60196),noNewline:M(`no-newline`,60197),note:M(`note`,60198),octoface:M(`octoface`,60199),openPreview:M(`open-preview`,60200),package:M(`package`,60201),paintcan:M(`paintcan`,60202),pin:M(`pin`,60203),play:M(`play`,60204),run:M(`run`,60204),plug:M(`plug`,60205),preserveCase:M(`preserve-case`,60206),preview:M(`preview`,60207),project:M(`project`,60208),pulse:M(`pulse`,60209),question:M(`question`,60210),quote:M(`quote`,60211),radioTower:M(`radio-tower`,60212),reactions:M(`reactions`,60213),references:M(`references`,60214),refresh:M(`refresh`,60215),regex:M(`regex`,60216),remoteExplorer:M(`remote-explorer`,60217),remote:M(`remote`,60218),remove:M(`remove`,60219),replaceAll:M(`replace-all`,60220),replace:M(`replace`,60221),repoClone:M(`repo-clone`,60222),repoForcePush:M(`repo-force-push`,60223),repoPull:M(`repo-pull`,60224),repoPush:M(`repo-push`,60225),report:M(`report`,60226),requestChanges:M(`request-changes`,60227),rocket:M(`rocket`,60228),rootFolderOpened:M(`root-folder-opened`,60229),rootFolder:M(`root-folder`,60230),rss:M(`rss`,60231),ruby:M(`ruby`,60232),saveAll:M(`save-all`,60233),saveAs:M(`save-as`,60234),save:M(`save`,60235),screenFull:M(`screen-full`,60236),screenNormal:M(`screen-normal`,60237),searchStop:M(`search-stop`,60238),server:M(`server`,60240),settingsGear:M(`settings-gear`,60241),settings:M(`settings`,60242),shield:M(`shield`,60243),smiley:M(`smiley`,60244),sortPrecedence:M(`sort-precedence`,60245),splitHorizontal:M(`split-horizontal`,60246),splitVertical:M(`split-vertical`,60247),squirrel:M(`squirrel`,60248),starFull:M(`star-full`,60249),starHalf:M(`star-half`,60250),symbolClass:M(`symbol-class`,60251),symbolColor:M(`symbol-color`,60252),symbolConstant:M(`symbol-constant`,60253),symbolEnumMember:M(`symbol-enum-member`,60254),symbolField:M(`symbol-field`,60255),symbolFile:M(`symbol-file`,60256),symbolInterface:M(`symbol-interface`,60257),symbolKeyword:M(`symbol-keyword`,60258),symbolMisc:M(`symbol-misc`,60259),symbolOperator:M(`symbol-operator`,60260),symbolProperty:M(`symbol-property`,60261),wrench:M(`wrench`,60261),wrenchSubaction:M(`wrench-subaction`,60261),symbolSnippet:M(`symbol-snippet`,60262),tasklist:M(`tasklist`,60263),telescope:M(`telescope`,60264),textSize:M(`text-size`,60265),threeBars:M(`three-bars`,60266),thumbsdown:M(`thumbsdown`,60267),thumbsup:M(`thumbsup`,60268),tools:M(`tools`,60269),triangleDown:M(`triangle-down`,60270),triangleLeft:M(`triangle-left`,60271),triangleRight:M(`triangle-right`,60272),triangleUp:M(`triangle-up`,60273),twitter:M(`twitter`,60274),unfold:M(`unfold`,60275),unlock:M(`unlock`,60276),unmute:M(`unmute`,60277),unverified:M(`unverified`,60278),verified:M(`verified`,60279),versions:M(`versions`,60280),vmActive:M(`vm-active`,60281),vmOutline:M(`vm-outline`,60282),vmRunning:M(`vm-running`,60283),watch:M(`watch`,60284),whitespace:M(`whitespace`,60285),wholeWord:M(`whole-word`,60286),window:M(`window`,60287),wordWrap:M(`word-wrap`,60288),zoomIn:M(`zoom-in`,60289),zoomOut:M(`zoom-out`,60290),listFilter:M(`list-filter`,60291),listFlat:M(`list-flat`,60292),listSelection:M(`list-selection`,60293),selection:M(`selection`,60293),listTree:M(`list-tree`,60294),debugBreakpointFunctionUnverified:M(`debug-breakpoint-function-unverified`,60295),debugBreakpointFunction:M(`debug-breakpoint-function`,60296),debugBreakpointFunctionDisabled:M(`debug-breakpoint-function-disabled`,60296),debugStackframeActive:M(`debug-stackframe-active`,60297),circleSmallFilled:M(`circle-small-filled`,60298),debugStackframeDot:M(`debug-stackframe-dot`,60298),terminalDecorationMark:M(`terminal-decoration-mark`,60298),debugStackframe:M(`debug-stackframe`,60299),debugStackframeFocused:M(`debug-stackframe-focused`,60299),debugBreakpointUnsupported:M(`debug-breakpoint-unsupported`,60300),symbolString:M(`symbol-string`,60301),debugReverseContinue:M(`debug-reverse-continue`,60302),debugStepBack:M(`debug-step-back`,60303),debugRestartFrame:M(`debug-restart-frame`,60304),debugAlt:M(`debug-alt`,60305),callIncoming:M(`call-incoming`,60306),callOutgoing:M(`call-outgoing`,60307),menu:M(`menu`,60308),expandAll:M(`expand-all`,60309),feedback:M(`feedback`,60310),gitPullRequestReviewer:M(`git-pull-request-reviewer`,60310),groupByRefType:M(`group-by-ref-type`,60311),ungroupByRefType:M(`ungroup-by-ref-type`,60312),account:M(`account`,60313),gitPullRequestAssignee:M(`git-pull-request-assignee`,60313),bellDot:M(`bell-dot`,60314),debugConsole:M(`debug-console`,60315),library:M(`library`,60316),output:M(`output`,60317),runAll:M(`run-all`,60318),syncIgnored:M(`sync-ignored`,60319),pinned:M(`pinned`,60320),githubInverted:M(`github-inverted`,60321),serverProcess:M(`server-process`,60322),serverEnvironment:M(`server-environment`,60323),pass:M(`pass`,60324),issueClosed:M(`issue-closed`,60324),stopCircle:M(`stop-circle`,60325),playCircle:M(`play-circle`,60326),record:M(`record`,60327),debugAltSmall:M(`debug-alt-small`,60328),vmConnect:M(`vm-connect`,60329),cloud:M(`cloud`,60330),merge:M(`merge`,60331),export:M(`export`,60332),graphLeft:M(`graph-left`,60333),magnet:M(`magnet`,60334),notebook:M(`notebook`,60335),redo:M(`redo`,60336),checkAll:M(`check-all`,60337),pinnedDirty:M(`pinned-dirty`,60338),passFilled:M(`pass-filled`,60339),circleLargeFilled:M(`circle-large-filled`,60340),circleLarge:M(`circle-large`,60341),circleLargeOutline:M(`circle-large-outline`,60341),combine:M(`combine`,60342),gather:M(`gather`,60342),table:M(`table`,60343),variableGroup:M(`variable-group`,60344),typeHierarchy:M(`type-hierarchy`,60345),typeHierarchySub:M(`type-hierarchy-sub`,60346),typeHierarchySuper:M(`type-hierarchy-super`,60347),gitPullRequestCreate:M(`git-pull-request-create`,60348),runAbove:M(`run-above`,60349),runBelow:M(`run-below`,60350),notebookTemplate:M(`notebook-template`,60351),debugRerun:M(`debug-rerun`,60352),workspaceTrusted:M(`workspace-trusted`,60353),workspaceUntrusted:M(`workspace-untrusted`,60354),workspaceUnknown:M(`workspace-unknown`,60355),terminalCmd:M(`terminal-cmd`,60356),terminalDebian:M(`terminal-debian`,60357),terminalLinux:M(`terminal-linux`,60358),terminalPowershell:M(`terminal-powershell`,60359),terminalTmux:M(`terminal-tmux`,60360),terminalUbuntu:M(`terminal-ubuntu`,60361),terminalBash:M(`terminal-bash`,60362),arrowSwap:M(`arrow-swap`,60363),copy:M(`copy`,60364),personAdd:M(`person-add`,60365),filterFilled:M(`filter-filled`,60366),wand:M(`wand`,60367),debugLineByLine:M(`debug-line-by-line`,60368),inspect:M(`inspect`,60369),layers:M(`layers`,60370),layersDot:M(`layers-dot`,60371),layersActive:M(`layers-active`,60372),compass:M(`compass`,60373),compassDot:M(`compass-dot`,60374),compassActive:M(`compass-active`,60375),azure:M(`azure`,60376),issueDraft:M(`issue-draft`,60377),gitPullRequestClosed:M(`git-pull-request-closed`,60378),gitPullRequestDraft:M(`git-pull-request-draft`,60379),debugAll:M(`debug-all`,60380),debugCoverage:M(`debug-coverage`,60381),runErrors:M(`run-errors`,60382),folderLibrary:M(`folder-library`,60383),debugContinueSmall:M(`debug-continue-small`,60384),beakerStop:M(`beaker-stop`,60385),graphLine:M(`graph-line`,60386),graphScatter:M(`graph-scatter`,60387),pieChart:M(`pie-chart`,60388),bracketDot:M(`bracket-dot`,60389),bracketError:M(`bracket-error`,60390),lockSmall:M(`lock-small`,60391),azureDevops:M(`azure-devops`,60392),verifiedFilled:M(`verified-filled`,60393),newline:M(`newline`,60394),layout:M(`layout`,60395),layoutActivitybarLeft:M(`layout-activitybar-left`,60396),layoutActivitybarRight:M(`layout-activitybar-right`,60397),layoutPanelLeft:M(`layout-panel-left`,60398),layoutPanelCenter:M(`layout-panel-center`,60399),layoutPanelJustify:M(`layout-panel-justify`,60400),layoutPanelRight:M(`layout-panel-right`,60401),layoutPanel:M(`layout-panel`,60402),layoutSidebarLeft:M(`layout-sidebar-left`,60403),layoutSidebarRight:M(`layout-sidebar-right`,60404),layoutStatusbar:M(`layout-statusbar`,60405),layoutMenubar:M(`layout-menubar`,60406),layoutCentered:M(`layout-centered`,60407),target:M(`target`,60408),indent:M(`indent`,60409),recordSmall:M(`record-small`,60410),errorSmall:M(`error-small`,60411),terminalDecorationError:M(`terminal-decoration-error`,60411),arrowCircleDown:M(`arrow-circle-down`,60412),arrowCircleLeft:M(`arrow-circle-left`,60413),arrowCircleRight:M(`arrow-circle-right`,60414),arrowCircleUp:M(`arrow-circle-up`,60415),layoutSidebarRightOff:M(`layout-sidebar-right-off`,60416),layoutPanelOff:M(`layout-panel-off`,60417),layoutSidebarLeftOff:M(`layout-sidebar-left-off`,60418),blank:M(`blank`,60419),heartFilled:M(`heart-filled`,60420),map:M(`map`,60421),mapHorizontal:M(`map-horizontal`,60421),foldHorizontal:M(`fold-horizontal`,60421),mapFilled:M(`map-filled`,60422),mapHorizontalFilled:M(`map-horizontal-filled`,60422),foldHorizontalFilled:M(`fold-horizontal-filled`,60422),circleSmall:M(`circle-small`,60423),bellSlash:M(`bell-slash`,60424),bellSlashDot:M(`bell-slash-dot`,60425),commentUnresolved:M(`comment-unresolved`,60426),gitPullRequestGoToChanges:M(`git-pull-request-go-to-changes`,60427),gitPullRequestNewChanges:M(`git-pull-request-new-changes`,60428),searchFuzzy:M(`search-fuzzy`,60429),commentDraft:M(`comment-draft`,60430),send:M(`send`,60431),sparkle:M(`sparkle`,60432),insert:M(`insert`,60433),mic:M(`mic`,60434),thumbsdownFilled:M(`thumbsdown-filled`,60435),thumbsupFilled:M(`thumbsup-filled`,60436),coffee:M(`coffee`,60437),snake:M(`snake`,60438),game:M(`game`,60439),vr:M(`vr`,60440),chip:M(`chip`,60441),piano:M(`piano`,60442),music:M(`music`,60443),micFilled:M(`mic-filled`,60444),repoFetch:M(`repo-fetch`,60445),copilot:M(`copilot`,60446),lightbulbSparkle:M(`lightbulb-sparkle`,60447),robot:M(`robot`,60448),sparkleFilled:M(`sparkle-filled`,60449),diffSingle:M(`diff-single`,60450),diffMultiple:M(`diff-multiple`,60451),surroundWith:M(`surround-with`,60452),share:M(`share`,60453),gitStash:M(`git-stash`,60454),gitStashApply:M(`git-stash-apply`,60455),gitStashPop:M(`git-stash-pop`,60456),vscode:M(`vscode`,60457),vscodeInsiders:M(`vscode-insiders`,60458),codeOss:M(`code-oss`,60459),runCoverage:M(`run-coverage`,60460),runAllCoverage:M(`run-all-coverage`,60461),coverage:M(`coverage`,60462),githubProject:M(`github-project`,60463),mapVertical:M(`map-vertical`,60464),foldVertical:M(`fold-vertical`,60464),mapVerticalFilled:M(`map-vertical-filled`,60465),foldVerticalFilled:M(`fold-vertical-filled`,60465),goToSearch:M(`go-to-search`,60466),percentage:M(`percentage`,60467),sortPercentage:M(`sort-percentage`,60467),attach:M(`attach`,60468),goToEditingSession:M(`go-to-editing-session`,60469),editSession:M(`edit-session`,60470),codeReview:M(`code-review`,60471),copilotWarning:M(`copilot-warning`,60472),python:M(`python`,60473),copilotLarge:M(`copilot-large`,60474),copilotWarningLarge:M(`copilot-warning-large`,60475),keyboardTab:M(`keyboard-tab`,60476),copilotBlocked:M(`copilot-blocked`,60477),copilotNotConnected:M(`copilot-not-connected`,60478),flag:M(`flag`,60479),lightbulbEmpty:M(`lightbulb-empty`,60480),symbolMethodArrow:M(`symbol-method-arrow`,60481),copilotUnavailable:M(`copilot-unavailable`,60482),repoPinned:M(`repo-pinned`,60483),keyboardTabAbove:M(`keyboard-tab-above`,60484),keyboardTabBelow:M(`keyboard-tab-below`,60485),gitPullRequestDone:M(`git-pull-request-done`,60486),mcp:M(`mcp`,60487),extensionsLarge:M(`extensions-large`,60488),layoutPanelDock:M(`layout-panel-dock`,60489),layoutSidebarLeftDock:M(`layout-sidebar-left-dock`,60490),layoutSidebarRightDock:M(`layout-sidebar-right-dock`,60491),copilotInProgress:M(`copilot-in-progress`,60492),copilotError:M(`copilot-error`,60493),copilotSuccess:M(`copilot-success`,60494),chatSparkle:M(`chat-sparkle`,60495),searchSparkle:M(`search-sparkle`,60496),editSparkle:M(`edit-sparkle`,60497),copilotSnooze:M(`copilot-snooze`,60498),sendToRemoteAgent:M(`send-to-remote-agent`,60499),commentDiscussionSparkle:M(`comment-discussion-sparkle`,60500),chatSparkleWarning:M(`chat-sparkle-warning`,60501),chatSparkleError:M(`chat-sparkle-error`,60502),collection:M(`collection`,60503),newCollection:M(`new-collection`,60504),thinking:M(`thinking`,60505),build:M(`build`,60506),commentDiscussionQuote:M(`comment-discussion-quote`,60507),cursor:M(`cursor`,60508),eraser:M(`eraser`,60509),fileText:M(`file-text`,60510),quotes:M(`quotes`,60512),rename:M(`rename`,60513),runWithDeps:M(`run-with-deps`,60514),debugConnected:M(`debug-connected`,60515),strikethrough:M(`strikethrough`,60516),openInProduct:M(`open-in-product`,60517),indexZero:M(`index-zero`,60518),agent:M(`agent`,60519),editCode:M(`edit-code`,60520),repoSelected:M(`repo-selected`,60521),skip:M(`skip`,60522),mergeInto:M(`merge-into`,60523),gitBranchChanges:M(`git-branch-changes`,60524),gitBranchStagedChanges:M(`git-branch-staged-changes`,60525),gitBranchConflicts:M(`git-branch-conflicts`,60526),gitBranch:M(`git-branch`,60527),gitBranchCreate:M(`git-branch-create`,60527),gitBranchDelete:M(`git-branch-delete`,60527),searchLarge:M(`search-large`,60528),terminalGitBash:M(`terminal-git-bash`,60529),windowActive:M(`window-active`,60530),forward:M(`forward`,60531),download:M(`download`,60532),clockface:M(`clockface`,60533),unarchive:M(`unarchive`,60534),sessionInProgress:M(`session-in-progress`,60535),collectionSmall:M(`collection-small`,60536),vmSmall:M(`vm-small`,60537),cloudSmall:M(`cloud-small`,60538),addSmall:M(`add-small`,60539),removeSmall:M(`remove-small`,60540),worktreeSmall:M(`worktree-small`,60541),worktree:M(`worktree`,60542),screenCut:M(`screen-cut`,60543),ask:M(`ask`,60544),openai:M(`openai`,60545),claude:M(`claude`,60546),openInWindow:M(`open-in-window`,60547),newSession:M(`new-session`,60548),terminalSecure:M(`terminal-secure`,60549),chatImport:M(`chat-import`,60550),chatExport:M(`chat-export`,60551),shareWindow:M(`share-window`,60552),circleSlashCompact:M(`circle-slash-compact`,60553),copilotCompact:M(`copilot-compact`,60554),folderOpenedCompact:M(`folder-opened-compact`,60555),folderCompact:M(`folder-compact`,60556),gearCompact:M(`gear-compact`,60557),gitBranchCompact:M(`git-branch-compact`,60558),libraryCompact:M(`library-compact`,60559),recordKeysCompact:M(`record-keys-compact`,60560),remoteCompact:M(`remote-compact`,60561),repoForkedCompact:M(`repo-forked-compact`,60562),repoCompact:M(`repo-compact`,60563),shieldCompact:M(`shield-compact`,60564),sparkleCompact:M(`sparkle-compact`,60565),symbolColorCompact:M(`symbol-color-compact`,60566),windowCompact:M(`window-compact`,60567),errorCompact:M(`error-compact`,60568),warningCompact:M(`warning-compact`,60569),passCompact:M(`pass-compact`,60570),important:M(`important`,60571),importantCompact:M(`important-compact`,60572),rocketCompact:M(`rocket-compact`,60573),unpin:M(`unpin`,60574),addCompact:M(`add-compact`,60575),attachCompact:M(`attach-compact`,60576),beakerCompact:M(`beaker-compact`,60577),checkCompact:M(`check-compact`,60578),checklistCompact:M(`checklist-compact`,60579),chevronDownCompact:M(`chevron-down-compact`,60580),chevronLeftCompact:M(`chevron-left-compact`,60581),chevronRightCompact:M(`chevron-right-compact`,60582),chevronUpCompact:M(`chevron-up-compact`,60583),circleFilledCompact:M(`circle-filled-compact`,60584),circleSmallFilledCompact:M(`circle-small-filled-compact`,60585),closeCompact:M(`close-compact`,60586),collapseAllCompact:M(`collapse-all-compact`,60587),commentCompact:M(`comment-compact`,60588),commentUnresolvedCompact:M(`comment-unresolved-compact`,60589),debugConnectedCompact:M(`debug-connected-compact`,60590),debugDisconnectCompact:M(`debug-disconnect-compact`,60591),editCompact:M(`edit-compact`,60592),fileMediaCompact:M(`file-media-compact`,60593),gitFetch:M(`git-fetch`,60594),lightbulbCompact:M(`lightbulb-compact`,60595),loadingCompact:M(`loading-compact`,60596),passFilledCompact:M(`pass-filled-compact`,60597),projectCompact:M(`project-compact`,60598),refreshCompact:M(`refresh-compact`,60599),searchCompact:M(`search-compact`,60600),sessionInProgressCompact:M(`session-in-progress-compact`,60601),syncCompact:M(`sync-compact`,60602),terminalCompact:M(`terminal-compact`,60603),vmPending:M(`vm-pending`,60604),worktreeCompact:M(`worktree-compact`,60605),developerTools:M(`developer-tools`,60606),cloudCompact:M(`cloud-compact`,60607),agentCompact:M(`agent-compact`,60608),askCompact:M(`ask-compact`,60609),settingsCompact:M(`settings-compact`,60610),vmCompact:M(`vm-compact`,60611)},gl={dialogError:M(`dialog-error`,`error`),dialogWarning:M(`dialog-warning`,`warning`),dialogInfo:M(`dialog-info`,`info`),dialogClose:M(`dialog-close`,`close`),treeItemExpanded:M(`tree-item-expanded`,`chevron-down`),treeFilterOnTypeOn:M(`tree-filter-on-type-on`,`list-filter`),treeFilterOnTypeOff:M(`tree-filter-on-type-off`,`list-selection`),treeFilterClear:M(`tree-filter-clear`,`close`),treeItemLoading:M(`tree-item-loading`,`loading`),menuSelection:M(`menu-selection`,`check`),menuSubmenu:M(`menu-submenu`,`chevron-right`),menuBarMore:M(`menubar-more`,`more`),scrollbarButtonLeft:M(`scrollbar-button-left`,`triangle-left`),scrollbarButtonRight:M(`scrollbar-button-right`,`triangle-right`),scrollbarButtonUp:M(`scrollbar-button-up`,`triangle-up`),scrollbarButtonDown:M(`scrollbar-button-down`,`triangle-down`),toolBarMore:M(`toolbar-more`,`more`),quickInputBack:M(`quick-input-back`,`arrow-left`),dropDownButton:M(`drop-down-button`,60084),symbolCustomColor:M(`symbol-customcolor`,60252),exportIcon:M(`export`,60332),workspaceUnspecified:M(`workspace-unspecified`,60355),newLine:M(`newline`,60394),thumbsDownFilled:M(`thumbsdown-filled`,60435),thumbsUpFilled:M(`thumbsup-filled`,60436),gitFetch:M(`git-fetch`,60445),lightbulbSparkleAutofix:M(`lightbulb-sparkle-autofix`,60447),debugBreakpointPending:M(`debug-breakpoint-pending`,60377),chatImport:M(`chat-import`,60550),chatExport:M(`chat-export`,60551)},N={...hl,...gl};var _l;(function(e){function t(e){return!!e&&typeof e==`object`&&typeof e.id==`string`}e.isThemeColor=t})(_l||={});var vl;(function(e){e.iconNameSegment=`[A-Za-z0-9]+`,e.iconNameExpression=`[A-Za-z0-9-]+`,e.iconModifierExpression=`~[A-Za-z]+`,e.iconNameCharacter=`[A-Za-z0-9~-]`;let t=RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function n(e){let r=t.exec(e.id);if(!r)return n(N.error);let[,i,a]=r,o=[`codicon`,`codicon-`+i];return a&&o.push(`codicon-modifier-`+a.substring(1)),o}e.asClassNameArray=n;function r(e){return n(e).join(` `)}e.asClassName=r;function i(e){return`.`+n(e).join(`.`)}e.asCSSSelector=i;function a(e){return!!e&&typeof e==`object`&&typeof e.id==`string`&&(e.color===void 0||_l.isThemeColor(e.color))}e.isThemeIcon=a;let o=RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);function s(e){let t=o.exec(e);if(!t)return;let[,n]=t;return{id:n}}e.fromString=s;function c(e){return{id:e}}e.fromId=c;function l(e,t){let n=e.id,r=n.lastIndexOf(`~`);return r!==-1&&(n=n.substring(0,r)),t&&(n=`${n}~${t}`),{id:n}}e.modify=l;function u(e){let t=e.id.lastIndexOf(`~`);if(t!==-1)return e.id.substring(t+1)}e.getModifier=u;function d(e,t){return e.id===t.id&&e.color?.id===t.color?.id}e.isEqual=d;function f(e){return e?.id===N.file.id}e.isFile=f;function p(e){return e?.id===N.folder.id}e.isFolder=p})(vl||={});const yl=RegExp(`\\$\\(${vl.iconNameExpression}(?:${vl.iconModifierExpression})?\\)`,`g`),bl=RegExp(`(\\\\)?${yl.source}`,`g`);function xl(e){return e.replace(bl,(e,t)=>t?e:`\\${e}`)}RegExp(`\\\\${yl.source}`,`g`),RegExp(`(\\s)?(\\\\)?${yl.source}(\\s)?`,`g`),RegExp(`\\$\\(${vl.iconNameCharacter}+\\)`,`g`);var Sl;(function(e){e[e.Paragraph=0]=`Paragraph`,e[e.Break=1]=`Break`})(Sl||={});var Cl=class e{static lift(t){let n=new e(t.value,t);return n.uris=t.uris,n.baseUri=t.baseUri?C.revive(t.baseUri):void 0,n}constructor(e=``,t=!1){if(this.value=e,typeof this.value!=`string`)throw se(`value`);typeof t==`boolean`?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1,this.supportAlertSyntax=!1):(this.isTrusted=t.isTrusted??void 0,this.supportThemeIcons=t.supportThemeIcons??!1,this.supportHtml=t.supportHtml??!1,this.supportAlertSyntax=t.supportAlertSyntax??!1)}appendText(e,t=Sl.Paragraph){return this.value+=Tl(this.supportThemeIcons?xl(e):e).replace(/([ \t]+)/g,(e,t)=>` `.repeat(t.length)).replace(/\>/gm,`\\>`).replace(/\n/g,t===Sl.Break?`\\
|
|
22
|
+
`:`
|
|
23
|
+
|
|
24
|
+
`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+=`\n${El(t,e)}\n`,this}appendLink(e,t,n){return this.value+=`[`,this.value+=this._escape(t,`]`),this.value+=`](`,this.value+=this._escape(String(e),`)`),n&&(this.value+=` "${this._escape(this._escape(n,`"`),`)`)}"`),this.value+=`)`,this}_escape(e,t){let n=new RegExp($i(t),`g`);return e.replace(n,(t,n)=>e.charAt(n-1)===`\\`?t:`\\${t}`)}};function wl(e){return e instanceof Cl?!0:e&&typeof e==`object`?typeof e.value==`string`&&(typeof e.isTrusted==`boolean`||typeof e.isTrusted==`object`||e.isTrusted===void 0)&&(typeof e.supportThemeIcons==`boolean`||e.supportThemeIcons===void 0)&&(typeof e.supportAlertSyntax==`boolean`||e.supportAlertSyntax===void 0):!1}function Tl(e){return e.replace(/[\\`*_{}[\]()#+!~]/g,`\\$&`).replace(/^([ \t]*)-/gm,`$1\\-`)}function El(e,t){let n=e.match(/^`+/gm)?.reduce((e,t)=>e.length>t.length?e:t).length??0,r=n>=3?n+1:3;return[`${"`".repeat(r)}${t}`,e,`${"`".repeat(r)}`].join(`
|
|
25
|
+
`)}function Dl(e){let t=[],n=e.split(`|`).map(e=>e.trim());e=n[0];let r=n[1];if(r){let e=/height=(\d+)/.exec(r),n=/width=(\d+)/.exec(r),i=e?e[1]:``,a=n?n[1]:``,o=isFinite(parseInt(a)),s=isFinite(parseInt(i));o&&t.push(`width="${a}"`),s&&t.push(`height="${i}"`)}return{href:e,dimensions:t}}function Ol(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let kl=Ol();function Al(e){kl=e}const jl=/[&<>"']/,Ml=new RegExp(jl.source,`g`),Nl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Pl=new RegExp(Nl.source,`g`),Fl={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Il=e=>Fl[e];function Ll(e,t){if(t){if(jl.test(e))return e.replace(Ml,Il)}else if(Nl.test(e))return e.replace(Pl,Il);return e}const Rl=/(^|[^\[])\^/g;function zl(e,t){let n=typeof e==`string`?e:e.source;t||=``;let r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Rl,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function Bl(e){try{e=encodeURI(e).replace(/%25/g,`%`)}catch{return null}return e}const Vl={exec:()=>null};function Hl(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function Ul(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Wl(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function Gl(e,t,n,r){let i=t.href,a=t.title?Ll(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:Ll(o)}}function Kl(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
|
|
26
|
+
`).map(e=>{let t=e.match(/^\s+/);if(t===null)return e;let[n]=t;return n.length>=r.length?e.slice(r.length):e}).join(`
|
|
27
|
+
`)}var ql=class{options;rules;lexer;constructor(e){this.options=e||kl}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Ul(e,`
|
|
28
|
+
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=Kl(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=Ul(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Ul(t[0],`
|
|
29
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Ul(t[0],`
|
|
30
|
+
`).split(`
|
|
31
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(/^ {0,3}>/.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
32
|
+
`),c=s.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
|
|
33
|
+
$1`).replace(/^ {0,3}>[ \t]?/gm,``);n=n?`${n}\n${s}`:s,r=r?`${r}\n${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i[i.length-1];if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
34
|
+
`+e.join(`
|
|
35
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
36
|
+
`+e.join(`
|
|
37
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i[i.length-1].raw.length).split(`
|
|
38
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=t[2].split(`
|
|
39
|
+
`,1)[0].replace(/^\t+/,e=>` `.repeat(3*e.length)),l=e.split(`
|
|
40
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=t[2].search(/[^ ]/),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&/^ *$/.test(l)&&(r+=l+`
|
|
41
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=RegExp(`^ {0,${Math.min(3,d-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),n=RegExp(`^ {0,${Math.min(3,d-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),i=RegExp(`^ {0,${Math.min(3,d-1)}}(?:\`\`\`|~~~)`),a=RegExp(`^ {0,${Math.min(3,d-1)}}#`);for(;e;){let o=e.split(`
|
|
42
|
+
`,1)[0];if(l=o,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `)),i.test(l)||a.test(l)||t.test(l)||n.test(e))break;if(l.search(/[^ ]/)>=d||!l.trim())s+=`
|
|
43
|
+
`+l.slice(d);else{if(u||c.search(/[^ ]/)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
44
|
+
`+l}!u&&!l.trim()&&(u=!0),r+=o+`
|
|
45
|
+
`,e=e.substring(o.length+1),c=l.slice(d)}}i.loose||(o?i.loose=!0:/\n *\n *$/.test(r)&&(o=!0));let f=null,p;this.options.gfm&&(f=/^\[[ xX]\] /.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(/^\[[ xX]\] +/,``))),i.items.push({type:`list_item`,raw:r,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=r}i.items[i.items.length-1].raw=i.items[i.items.length-1].raw.trimEnd(),i.items[i.items.length-1].text=i.items[i.items.length-1].text.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g,` `),n=t[2]?t[2].replace(/^<(.*)>$/,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=Hl(t[1]),r=t[2].replace(/^\||\| *$/g,``).split(`|`),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
|
|
46
|
+
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?a.align.push(`right`):/^ *:-+: *$/.test(e)?a.align.push(`center`):/^ *:-+ *$/.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Hl(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
47
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:Ll(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=Ul(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Wl(t[2],`()`);if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),Gl(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(/\s+/g,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Gl(n,e,n[0],this.lexer)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g,` `),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=Ll(e,!0),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=Ll(t[1]),n=`mailto:`+e):(e=Ll(t[1]),n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=Ll(t[0]),n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=Ll(t[0]),n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:Ll(t[0]),{type:`text`,raw:t[0],text:e}}}};const Jl=/^(?: *(?:\n|$))+/,Yl=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,Xl=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Zl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ql=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,$l=/(?:[*+-]|\d{1,9}[.)])/,eu=zl(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,$l).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),tu=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,nu=/^[^\n]+/,ru=/(?!\s*\])(?:\\.|[^\[\]\\])+/,iu=zl(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace(`label`,ru).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),au=zl(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,$l).getRegex(),ou=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,su=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cu=zl(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`,`i`).replace(`comment`,su).replace(`tag`,ou).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),lu=zl(tu).replace(`hr`,Zl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ou).getRegex(),uu={blockquote:zl(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,lu).getRegex(),code:Yl,def:iu,fences:Xl,heading:Ql,hr:Zl,html:cu,lheading:eu,list:au,newline:Jl,paragraph:lu,table:Vl,text:nu},du=zl(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Zl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,` {4}[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ou).getRegex(),fu={...uu,table:du,paragraph:zl(tu).replace(`hr`,Zl).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,du).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ou).getRegex()},pu={...uu,html:zl(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,su).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Vl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:zl(tu).replace(`hr`,Zl).replace(`heading`,` *#{1,6} *[^
|
|
48
|
+
]`).replace(`lheading`,eu).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},mu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,gu=/^( {2,}|\\)\n(?!\s*$)/,_u=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,vu=`\\p{P}\\p{S}`,yu=zl(/^((?![*_])[\spunctuation])/,`u`).replace(/punctuation/g,vu).getRegex(),bu=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,xu=zl(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,`u`).replace(/punct/g,vu).getRegex(),Su=zl(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`,`gu`).replace(/punct/g,vu).getRegex(),Cu=zl(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`,`gu`).replace(/punct/g,vu).getRegex(),wu=zl(/\\([punct])/,`gu`).replace(/punct/g,vu).getRegex(),Tu=zl(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Eu=zl(su).replace(`(?:-->|$)`,`-->`).getRegex(),Du=zl(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Eu).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ou=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ku=zl(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`,Ou).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Au=zl(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ou).replace(`ref`,ru).getRegex(),ju=zl(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ru).getRegex(),Mu={_backpedal:Vl,anyPunctuation:wu,autolink:Tu,blockSkip:bu,br:gu,code:hu,del:Vl,emStrongLDelim:xu,emStrongRDelimAst:Su,emStrongRDelimUnd:Cu,escape:mu,link:ku,nolink:ju,punctuation:yu,reflink:Au,reflinkSearch:zl(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Au).replace(`nolink`,ju).getRegex(),tag:Du,text:_u,url:Vl},Nu={...Mu,link:zl(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ou).getRegex(),reflink:zl(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ou).getRegex()},Pu={...Mu,escape:zl(mu).replace(`])`,`~|])`).getRegex(),url:zl(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Fu={...Pu,br:zl(gu).replace(`{2,}`,`*`).getRegex(),text:zl(Pu.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Iu={normal:uu,gfm:fu,pedantic:pu},Lu={normal:Mu,gfm:Pu,breaks:Fu,pedantic:Nu};var Ru=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||kl,this.options.tokenizer=this.options.tokenizer||new ql,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={block:Iu.normal,inline:Lu.normal};this.options.pedantic?(t.block=Iu.pedantic,t.inline=Lu.pedantic):this.options.gfm&&(t.block=Iu.gfm,this.options.breaks?t.inline=Lu.breaks:t.inline=Lu.gfm),this.tokenizer.rules=t}static get rules(){return{block:Iu,inline:Lu}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,`
|
|
49
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){e=this.options.pedantic?e.replace(/\t/g,` `).replace(/^ +$/gm,``):e.replace(/^( *)(\t+)/gm,(e,t,n)=>t+` `.repeat(n.length));let r,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))){if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length),r.raw.length===1&&t.length>0?t[t.length-1].raw+=`
|
|
50
|
+
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
|
|
51
|
+
`+r.raw,i.text+=`
|
|
52
|
+
`+r.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&(i.type===`paragraph`||i.type===`text`)?(i.raw+=`
|
|
53
|
+
`+r.raw,i.text+=`
|
|
54
|
+
`+r.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(a))){i=t[t.length-1],n&&i?.type===`paragraph`?(i.raw+=`
|
|
55
|
+
`+r.raw,i.text+=`
|
|
56
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r),n=a.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length),i=t[t.length-1],i&&i.type===`text`?(i.raw+=`
|
|
57
|
+
`+r.raw,i.text+=`
|
|
58
|
+
`+r.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,a=e,o,s,c;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)e.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(c=``),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,a,c)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i)){e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}else throw Error(t)}}return t}},zu=class{options;parser;constructor(e){this.options=e||kl}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(/^\S*/)?.[0],i=e.replace(/\n$/,``)+`
|
|
59
|
+
`;return r?`<pre><code class="language-`+Ll(r)+`">`+(n?i:Ll(i,!0))+`</code></pre>
|
|
60
|
+
`:`<pre><code>`+(n?i:Ll(i,!0))+`</code></pre>
|
|
61
|
+
`}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return`<hr>
|
|
62
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
63
|
+
`+r+`</`+i+`>
|
|
64
|
+
`}listitem(e){let t=``;if(e.task){let n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type===`paragraph`?(e.tokens[0].text=n+` `+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type===`text`&&(e.tokens[0].tokens[0].text=n+` `+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:`text`,raw:n+` `,text:n+` `}):t+=n+` `}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox">`}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
65
|
+
<thead>
|
|
66
|
+
`+t+`</thead>
|
|
67
|
+
`+r+`</table>
|
|
68
|
+
`}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${e}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Bl(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+t+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n}){let r=Bl(e);if(r===null)return n;e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=`>`,i}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):e.text}},Bu=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}},Vu=class e{options;renderer;textRenderer;constructor(e){this.options=e||kl,this.options.renderer=this.options.renderer||new zu,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Bu}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}let a=i;switch(a.type){case`space`:n+=this.renderer.space(a);continue;case`hr`:n+=this.renderer.hr(a);continue;case`heading`:n+=this.renderer.heading(a);continue;case`code`:n+=this.renderer.code(a);continue;case`table`:n+=this.renderer.table(a);continue;case`blockquote`:n+=this.renderer.blockquote(a);continue;case`list`:n+=this.renderer.list(a);continue;case`html`:n+=this.renderer.html(a);continue;case`paragraph`:n+=this.renderer.paragraph(a);continue;case`text`:{let i=a,o=this.renderer.text(i);for(;r+1<e.length&&e[r+1].type===`text`;)i=e[++r],o+=`
|
|
69
|
+
`+this.renderer.text(i);t?n+=this.renderer.paragraph({type:`paragraph`,raw:o,text:o,tokens:[{type:`text`,raw:o,text:o}]}):n+=o;continue}default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t){t||=this.renderer;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Hu=class{options;constructor(e){this.options=e||kl}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}};const Uu=new class{defaults=Ol();options=this.setOptions;parse=this.parseMarkdown(Ru.lex,Vu.parse);parseInline=this.parseMarkdown(Ru.lexInline,Vu.parseInline);Parser=Vu;Renderer=zu;TextRenderer=Bu;Lexer=Ru;Tokenizer=ql;Hooks=Hu;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new zu(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new ql(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Hu;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if(n===`options`)continue;let r=n,i=e.hooks[r],a=t[r];Hu.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ru.lex(e,t??this.defaults)}parser(e,t){return Vu.parse(e,t??this.defaults)}parseMarkdown(e,t){return(n,r)=>{let i={...r},a={...this.defaults,...i},o=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)return o(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(n==null)return o(Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return o(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(t=>e(t,a)).then(e=>a.hooks?a.hooks.processAllTokens(e):e).then(e=>a.walkTokens?Promise.all(this.walkTokens(e,a.walkTokens)).then(()=>e):e).then(e=>t(e,a)).then(e=>a.hooks?a.hooks.postprocess(e):e).catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let r=e(n,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let i=t(r,a);return a.hooks&&(i=a.hooks.postprocess(i)),i}catch(e){return o(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
70
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Ll(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Wu(e,t){return Uu.parse(e,t)}Wu.options=Wu.setOptions=function(e){return Uu.setOptions(e),Wu.defaults=Uu.defaults,Al(Wu.defaults),Wu},Wu.getDefaults=Ol,Wu.defaults=kl,Wu.use=function(...e){return Uu.use(...e),Wu.defaults=Uu.defaults,Al(Wu.defaults),Wu},Wu.walkTokens=function(e,t){return Uu.walkTokens(e,t)},Wu.parseInline=Uu.parseInline,Wu.Parser=Vu,Wu.parser=Vu.parse,Wu.Renderer=zu,Wu.TextRenderer=Bu,Wu.Lexer=Ru,Wu.lexer=Ru.lex,Wu.Tokenizer=ql,Wu.Hooks=Hu,Wu.parse=Wu,Wu.options,Wu.setOptions,Wu.use,Wu.walkTokens,Wu.parseInline,Vu.parse,Ru.lex;function Gu(e){return JSON.stringify(e,qu)}function Ku(e){let t=JSON.parse(e);return t=Ju(t),t}function qu(e,t){return t instanceof RegExp?{$mid:Mr.Regexp,source:t.source,flags:t.flags}:t}function Ju(e,t=0){if(!e||t>200)return e;if(typeof e==`object`){switch(e.$mid){case Mr.Uri:return C.revive(e);case Mr.Regexp:return new RegExp(e.source,e.flags);case Mr.Date:return new Date(e.source)}if(e instanceof y||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let n=0;n<e.length;++n)e[n]=Ju(e[n],t+1);else for(let n in e)Object.hasOwnProperty.call(e,n)&&(e[n]=Ju(e[n],t+1))}return e}const Yu=Object.freeze({text:`text/plain`,binary:`application/octet-stream`,unknown:`application/unknown`,markdown:`text/markdown`,latex:`text/latex`,uriList:`text/uri-list`,html:`text/html`}),Xu=/^(.+)\/(.+?)(;.+)?$/;function Zu(e,t){let n=Xu.exec(e);return n?`${n[1].toLowerCase()}/${n[2].toLowerCase()}${n[3]??``}`:t?void 0:e}function Qu(e){return[`application/vnd.code.notebook.stdout`,`application/vnd.code.notebook.stderr`].includes(e)}const $u=Symbol(`unset`);var ed=class{constructor(){this.root=new nd,this._size=0}get size(){return this._size}get nodes(){return this.root.children?.values()||vt.empty()}get entries(){return this.root.children?.entries()||vt.empty()}insert(e,t,n){this.opNode(e,e=>e._value=t,n)}mutate(e,t){this.opNode(e,e=>e._value=t(e._value===$u?void 0:e._value))}mutatePath(e,t){this.opNode(e,()=>{},e=>t(e))}delete(e){let t=this.getPathToKey(e);if(!t)return;let n=t.length-1,r=t[n].node._value;if(r!==$u){for(this._size--,t[n].node._value=$u;n>0;n--){let{node:e,part:r}=t[n];if(e.children?.size||e._value!==$u)break;t[n-1].node.children.delete(r)}return r}}*deleteRecursive(e){let t=this.getPathToKey(e);if(!t)return;let n=t[t.length-1].node;for(let e=t.length-1;e>0;e--){let n=t[e-1];if(n.node.children.delete(t[e].part),n.node.children.size>0||n.node._value!==$u)break}for(let e of td(n))e._value!==$u&&(this._size--,yield e._value);n===this.root&&(this.root._value=$u,this.root.children=void 0)}find(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return;t=e}return t._value===$u?void 0:t._value}hasKeyOrParent(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return!1;if(e._value!==$u)return!0;t=e}return!1}hasKeyOrChildren(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return!1;t=e}return!0}hasKey(e){let t=this.root;for(let n of e){let e=t.children?.get(n);if(!e)return!1;t=e}return t._value!==$u}getPathToKey(e){let t=[{part:``,node:this.root}],n=0;for(let r of e){let e=t[n].node.children?.get(r);if(!e)return;t.push({part:r,node:e}),n++}return t}opNode(e,t,n){let r=this.root;for(let t of e){if(!r.children){let e=new nd;r.children=new Map([[t,e]]),r=e}else if(r.children.has(t))r=r.children.get(t);else{let e=new nd;r.children.set(t,e),r=e}n?.(r)}let i=r._value===$u?0:1;t(r);let a=r._value===$u?0:1;this._size+=a-i}*values(){for(let{_value:e}of td(this.root))e!==$u&&(yield e)}};function*td(e){let t=[e];for(;t.length>0;){let e=t.pop();if(yield e,e.children)for(let n of e.children.values())t.push(n)}}var nd=class{constructor(){this._value=$u}get value(){return this._value===$u?void 0:this._value}set value(e){this._value=e===void 0?$u:e}},rd;(function(e){e[e.Auto=1]=`Auto`,e[e.Hidden=2]=`Hidden`,e[e.Visible=3]=`Visible`})(rd||={});const id=new class{constructor(){this._zoomLevel=0,this._onDidChangeZoomLevel=new x,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event}getZoomLevel(){return this._zoomLevel}setZoomLevel(e){e=Math.min(Math.max(-5,e),20),this._zoomLevel!==e&&(this._zoomLevel=e,this._onDidChangeZoomLevel.fire(this._zoomLevel))}},ad=En?1.5:1.35;var od=class e{static _create(t,n,r,i,a,o,s,c,l){o===0?o=ad*r:o<8&&(o*=r),o=Math.round(o),o<8&&(o=8);let u=1+(l?0:id.getZoomLevel()*.1);return r*=u,o*=u,a===`translate`&&(n===`normal`||n===`bold`?a=cd:(a=`'wght' ${parseInt(n,10)}`,n=`normal`)),new e({pixelRatio:c,fontFamily:t,fontWeight:n,fontSize:r,fontFeatureSettings:i,fontVariationSettings:a,lineHeight:o,letterSpacing:s})}constructor(e){this._bareFontInfoBrand=void 0,this.pixelRatio=e.pixelRatio,this.fontFamily=String(e.fontFamily),this.fontWeight=String(e.fontWeight),this.fontSize=e.fontSize,this.fontFeatureSettings=e.fontFeatureSettings,this.fontVariationSettings=e.fontVariationSettings,this.lineHeight=e.lineHeight|0,this.letterSpacing=e.letterSpacing}getId(){return`${this.pixelRatio}-${this.fontFamily}-${this.fontWeight}-${this.fontSize}-${this.fontFeatureSettings}-${this.fontVariationSettings}-${this.lineHeight}-${this.letterSpacing}`}getMassagedFontFamily(){let t=ld.fontFamily,n=e._wrapInQuotes(this.fontFamily);return this.fontFamily===t?n:`${n}, ${t}`}static _wrapInQuotes(e){return/[,"']/.test(e)?e:/[+ ]/.test(e)?`"${e}"`:e}},sd=class extends od{constructor(e,t){super(e),this._editorStylingBrand=void 0,this.version=2,this.isTrusted=t,this.isMonospace=e.isMonospace,this.typicalHalfwidthCharacterWidth=e.typicalHalfwidthCharacterWidth,this.typicalFullwidthCharacterWidth=e.typicalFullwidthCharacterWidth,this.canUseHalfwidthRightwardsArrow=e.canUseHalfwidthRightwardsArrow,this.spaceWidth=e.spaceWidth,this.middotWidth=e.middotWidth,this.wsmiddotWidth=e.wsmiddotWidth,this.maxDigitWidth=e.maxDigitWidth}equals(e){return this.fontFamily===e.fontFamily&&this.fontWeight===e.fontWeight&&this.fontSize===e.fontSize&&this.fontFeatureSettings===e.fontFeatureSettings&&this.fontVariationSettings===e.fontVariationSettings&&this.lineHeight===e.lineHeight&&this.letterSpacing===e.letterSpacing&&this.typicalHalfwidthCharacterWidth===e.typicalHalfwidthCharacterWidth&&this.typicalFullwidthCharacterWidth===e.typicalFullwidthCharacterWidth&&this.canUseHalfwidthRightwardsArrow===e.canUseHalfwidthRightwardsArrow&&this.spaceWidth===e.spaceWidth&&this.middotWidth===e.middotWidth&&this.wsmiddotWidth===e.wsmiddotWidth&&this.maxDigitWidth===e.maxDigitWidth}};const cd=`normal`,ld={fontFamily:En?`Menlo, Monaco, 'Courier New', monospace`:Tn?`Consolas, 'Courier New', monospace`:`'Droid Sans Mono', monospace`,fontWeight:`normal`,fontSize:En?12:14,lineHeight:0,letterSpacing:0},ud={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},dd=`\`~!@#$%^&*()-=+[{]}\\|;:'",.<>/?`;function fd(e=``){let t=`(-?\\d*\\.\\d\\w*)|([^`;for(let n of dd)e.indexOf(n)>=0||(t+=`\\`+n);return t+=`\\s]+)`,new RegExp(t,`g`)}const pd=fd();function md(e){let t=pd;if(e&&e instanceof RegExp)if(e.global)t=e;else{let n=`g`;e.ignoreCase&&(n+=`i`),e.multiline&&(n+=`m`),e.unicode&&(n+=`u`),t=new RegExp(e.source,n)}return t.lastIndex=0,t}const hd=new nn;hd.unshift({maxLen:1e3,windowSize:15,timeBudget:150});function gd(e,t,n,r,i){if(t=md(t),i||=vt.first(hd),n.length>i.maxLen){let a=e-i.maxLen/2;return a<0?a=0:r+=a,n=n.substring(a,e+i.maxLen/2),gd(e,t,n,r,i)}let a=Date.now(),o=e-1-r,s=-1,c=null;for(let e=1;!(Date.now()-a>=i.timeBudget);e++){let r=o-i.windowSize*e;t.lastIndex=Math.max(0,r);let a=_d(t,n,o,s);if(!a&&c||(c=a,r<=0))break;s=r}if(c){let e={word:c[0],startColumn:r+1+c.index,endColumn:r+1+c.index+c[0].length};return t.lastIndex=0,e}return null}function _d(e,t,n,r){let i;for(;i=e.exec(t);){let t=i.index||0;if(t<=n&&e.lastIndex>=n)return i;if(r>0&&t>r)return null}return null}var P;(function(e){e[e.LParen=0]=`LParen`,e[e.RParen=1]=`RParen`,e[e.Neg=2]=`Neg`,e[e.Eq=3]=`Eq`,e[e.NotEq=4]=`NotEq`,e[e.Lt=5]=`Lt`,e[e.LtEq=6]=`LtEq`,e[e.Gt=7]=`Gt`,e[e.GtEq=8]=`GtEq`,e[e.RegexOp=9]=`RegexOp`,e[e.RegexStr=10]=`RegexStr`,e[e.True=11]=`True`,e[e.False=12]=`False`,e[e.In=13]=`In`,e[e.Not=14]=`Not`,e[e.And=15]=`And`,e[e.Or=16]=`Or`,e[e.Str=17]=`Str`,e[e.QuotedStr=18]=`QuotedStr`,e[e.Error=19]=`Error`,e[e.EOF=20]=`EOF`})(P||={});function vd(...e){switch(e.length){case 1:return b(1900,`Did you mean {0}?`,e[0]);case 2:return b(1901,`Did you mean {0} or {1}?`,e[0],e[1]);case 3:return b(1902,`Did you mean {0}, {1} or {2}?`,e[0],e[1],e[2]);default:return}}const yd=b(1903,`Did you forget to open or close the quote?`),bd=b(1904,`Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.`);var xd=class e{constructor(){this._input=``,this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case P.LParen:return`(`;case P.RParen:return`)`;case P.Neg:return`!`;case P.Eq:return e.isTripleEq?`===`:`==`;case P.NotEq:return e.isTripleEq?`!==`:`!=`;case P.Lt:return`<`;case P.LtEq:return`<=`;case P.Gt:return`>`;case P.GtEq:return`>=`;case P.RegexOp:return`=~`;case P.RegexStr:return e.lexeme;case P.True:return`true`;case P.False:return`false`;case P.In:return`in`;case P.Not:return`not`;case P.And:return`&&`;case P.Or:return`||`;case P.Str:return e.lexeme;case P.QuotedStr:return e.lexeme;case P.Error:return e.lexeme;case P.EOF:return`EOF`;default:throw ce(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this._regexFlags=new Set([`i`,`g`,`s`,`m`,`y`,`u`].map(e=>e.charCodeAt(0)))}static{this._keywords=new Map([[`not`,P.Not],[`in`,P.In],[`false`,P.False],[`true`,P.True]])}get errors(){return this._errors}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();)switch(this._start=this._current,this._advance()){case S.OpenParen:this._addToken(P.LParen);break;case S.CloseParen:this._addToken(P.RParen);break;case S.ExclamationMark:if(this._match(S.Equals)){let e=this._match(S.Equals);this._tokens.push({type:P.NotEq,offset:this._start,isTripleEq:e})}else this._addToken(P.Neg);break;case S.SingleQuote:this._quotedString();break;case S.Slash:this._regex();break;case S.Equals:if(this._match(S.Equals)){let e=this._match(S.Equals);this._tokens.push({type:P.Eq,offset:this._start,isTripleEq:e})}else this._match(S.Tilde)?this._addToken(P.RegexOp):this._error(vd(`==`,`=~`));break;case S.LessThan:this._addToken(this._match(S.Equals)?P.LtEq:P.Lt);break;case S.GreaterThan:this._addToken(this._match(S.Equals)?P.GtEq:P.Gt);break;case S.Ampersand:this._match(S.Ampersand)?this._addToken(P.And):this._error(vd(`&&`));break;case S.Pipe:this._match(S.Pipe)?this._addToken(P.Or):this._error(vd(`||`));break;case S.Space:case S.CarriageReturn:case S.Tab:case S.LineFeed:case S.NoBreakSpace:break;default:this._string()}return this._start=this._current,this._addToken(P.EOF),Array.from(this._tokens)}_match(e){return this._isAtEnd()||this._input.charCodeAt(this._current)!==e?!1:(this._current++,!0)}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?S.Null:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){let t=this._start,n=this._input.substring(this._start,this._current),r={type:P.Error,offset:this._start,lexeme:n};this._errors.push({offset:t,lexeme:n,additionalInfo:e}),this._tokens.push(r)}_string(){this.stringRe.lastIndex=this._start;let t=this.stringRe.exec(this._input);if(t){this._current=this._start+t[0].length;let n=this._input.substring(this._start,this._current),r=e._keywords.get(n);r?this._addToken(r):this._tokens.push({type:P.Str,lexeme:n,offset:this._start})}}_quotedString(){for(;this._peek()!==S.SingleQuote&&!this._isAtEnd();)this._advance();if(this._isAtEnd()){this._error(yd);return}this._advance(),this._tokens.push({type:P.QuotedStr,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1})}_regex(){let t=this._current,n=!1,r=!1;for(;;){if(t>=this._input.length){this._current=t,this._error(bd);return}let e=this._input.charCodeAt(t);if(n)n=!1;else if(e===S.Slash&&!r){t++;break}else e===S.OpenSquareBracket?r=!0:e===S.Backslash?n=!0:e===S.CloseSquareBracket&&(r=!1);t++}for(;t<this._input.length&&e._regexFlags.has(this._input.charCodeAt(t));)t++;this._current=t;let i=this._input.substring(this._start,this._current);this._tokens.push({type:P.RegexStr,lexeme:i,offset:this._start})}_isAtEnd(){return this._current>=this._input.length}};const Sd=new Map;Sd.set(`false`,!1),Sd.set(`true`,!0),Sd.set(`isMac`,En),Sd.set(`isLinux`,Dn),Sd.set(`isWindows`,Tn),Sd.set(`isWeb`,kn),Sd.set(`isMacNative`,En&&!kn),Sd.set(`isEdge`,Jn),Sd.set(`isFirefox`,Kn),Sd.set(`isChrome`,Gn),Sd.set(`isSafari`,qn);const Cd=Object.prototype.hasOwnProperty;var wd;(function(e){e[e.False=0]=`False`,e[e.True=1]=`True`,e[e.Defined=2]=`Defined`,e[e.Not=3]=`Not`,e[e.Equals=4]=`Equals`,e[e.NotEquals=5]=`NotEquals`,e[e.And=6]=`And`,e[e.Regex=7]=`Regex`,e[e.NotRegex=8]=`NotRegex`,e[e.Or=9]=`Or`,e[e.In=10]=`In`,e[e.NotIn=11]=`NotIn`,e[e.Greater=12]=`Greater`,e[e.GreaterEquals=13]=`GreaterEquals`,e[e.Smaller=14]=`Smaller`,e[e.SmallerEquals=15]=`SmallerEquals`})(wd||={});const Td={regexParsingWithErrorRecovery:!0},Ed=b(1880,`Empty context key expression`),Dd=b(1881,`Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively.`),Od=b(1882,`'in' after 'not'.`),kd=b(1883,`closing parenthesis ')'`),Ad=b(1884,`Unexpected token`),jd=b(1885,`Did you forget to put && or || before the token?`),Md=b(1886,`Unexpected end of expression`),Nd=b(1887,`Did you forget to put a context key?`);var Pd=class e{static{this._parseError=Error()}get lexingErrors(){return this._scanner.errors}get parsingErrors(){return this._parsingErrors}constructor(e=Td){this._config=e,this._scanner=new xd,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(t){if(t===``){this._parsingErrors.push({message:Ed,offset:0,lexeme:``,additionalInfo:Dd});return}this._tokens=this._scanner.reset(t).scan(),this._current=0,this._parsingErrors=[];try{let t=this._expr();if(!this._isAtEnd()){let t=this._peek(),n=t.type===P.Str?jd:void 0;throw this._parsingErrors.push({message:Ad,offset:t.offset,lexeme:xd.getLexeme(t),additionalInfo:n}),e._parseError}return t}catch(t){if(t!==e._parseError)throw t;return}}_expr(){return this._or()}_or(){let e=[this._and()];for(;this._matchOne(P.Or);){let t=this._and();e.push(t)}return e.length===1?e[0]:Fd.or(...e)}_and(){let e=[this._term()];for(;this._matchOne(P.And);){let t=this._term();e.push(t)}return e.length===1?e[0]:Fd.and(...e)}_term(){if(this._matchOne(P.Neg)){let e=this._peek();switch(e.type){case P.True:return this._advance(),Rd.INSTANCE;case P.False:return this._advance(),zd.INSTANCE;case P.LParen:{this._advance();let e=this._expr();return this._consume(P.RParen,kd),e?.negate()}case P.Str:return this._advance(),Gd.create(e.lexeme);default:throw this._errExpectedButGot(`KEY | true | false | '(' expression ')'`,e)}}return this._primary()}_primary(){let t=this._peek();switch(t.type){case P.True:return this._advance(),Fd.true();case P.False:return this._advance(),Fd.false();case P.LParen:{this._advance();let e=this._expr();return this._consume(P.RParen,kd),e}case P.Str:{let e=t.lexeme;if(this._advance(),this._matchOne(P.RegexOp)){let t=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),t.type!==P.RegexStr)throw this._errExpectedButGot(`REGEX`,t);let n=t.lexeme,r=n.lastIndexOf(`/`),i=r===n.length-1?void 0:this._removeFlagsGY(n.substring(r+1)),a;try{a=new RegExp(n.substring(1,r),i)}catch{throw this._errExpectedButGot(`REGEX`,t)}return Zd.create(e,a)}switch(t.type){case P.RegexStr:case P.Error:{let n=[t.lexeme];this._advance();let r=this._peek(),i=0;for(let e=0;e<t.lexeme.length;e++)t.lexeme.charCodeAt(e)===S.OpenParen?i++:t.lexeme.charCodeAt(e)===S.CloseParen&&i--;for(;!this._isAtEnd()&&r.type!==P.And&&r.type!==P.Or;){switch(r.type){case P.LParen:i++;break;case P.RParen:i--;break;case P.RegexStr:case P.QuotedStr:for(let e=0;e<r.lexeme.length;e++)r.lexeme.charCodeAt(e)===S.OpenParen?i++:t.lexeme.charCodeAt(e)===S.CloseParen&&i--}if(i<0)break;n.push(xd.getLexeme(r)),this._advance(),r=this._peek()}let a=n.join(``),o=a.lastIndexOf(`/`),s=o===a.length-1?void 0:this._removeFlagsGY(a.substring(o+1)),c;try{c=new RegExp(a.substring(1,o),s)}catch{throw this._errExpectedButGot(`REGEX`,t)}return Fd.regex(e,c)}case P.QuotedStr:{let n=t.lexeme;this._advance();let r=null;if(!Ji(n)){let e=n.indexOf(`/`),i=n.lastIndexOf(`/`);if(e!==i&&e>=0){let a=n.slice(e+1,i),o=n[i+1]===`i`?`i`:``;try{r=new RegExp(a,o)}catch{throw this._errExpectedButGot(`REGEX`,t)}}}if(r===null)throw this._errExpectedButGot(`REGEX`,t);return Zd.create(e,r)}default:throw this._errExpectedButGot(`REGEX`,this._peek())}}if(this._matchOne(P.Not)){this._consume(P.In,Od);let t=this._value();return Fd.notIn(e,t)}switch(this._peek().type){case P.Eq:{this._advance();let t=this._value();if(this._previous().type===P.QuotedStr)return Fd.equals(e,t);switch(t){case`true`:return Fd.has(e);case`false`:return Fd.not(e);default:return Fd.equals(e,t)}}case P.NotEq:{this._advance();let t=this._value();if(this._previous().type===P.QuotedStr)return Fd.notEquals(e,t);switch(t){case`true`:return Fd.not(e);case`false`:return Fd.has(e);default:return Fd.notEquals(e,t)}}case P.Lt:return this._advance(),Yd.create(e,this._value());case P.LtEq:return this._advance(),Xd.create(e,this._value());case P.Gt:return this._advance(),qd.create(e,this._value());case P.GtEq:return this._advance(),Jd.create(e,this._value());case P.In:return this._advance(),Fd.in(e,this._value());default:return Fd.has(e)}}case P.EOF:throw this._parsingErrors.push({message:Md,offset:t.offset,lexeme:``,additionalInfo:Nd}),e._parseError;default:throw this._errExpectedButGot(`true | false | KEY
|
|
71
|
+
| KEY '=~' REGEX
|
|
72
|
+
| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this._peek())}}_value(){let e=this._peek();switch(e.type){case P.Str:case P.QuotedStr:return this._advance(),e.lexeme;case P.True:return this._advance(),`true`;case P.False:return this._advance(),`false`;case P.In:return this._advance(),`in`;default:return``}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,``)}_previous(){return this._tokens[this._current-1]}_matchOne(e){return this._check(e)?(this._advance(),!0):!1}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(t,n,r){let i=b(1888,`Expected: {0}
|
|
73
|
+
Received: '{1}'.`,t,xd.getLexeme(n)),a=n.offset,o=xd.getLexeme(n);return this._parsingErrors.push({message:i,offset:a,lexeme:o,additionalInfo:r}),e._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return this._peek().type===P.EOF}},Fd=class{static false(){return Rd.INSTANCE}static true(){return zd.INSTANCE}static has(e){return Bd.create(e)}static equals(e,t){return Vd.create(e,t)}static notEquals(e,t){return Wd.create(e,t)}static regex(e,t){return Zd.create(e,t)}static in(e,t){return Hd.create(e,t)}static notIn(e,t){return Ud.create(e,t)}static not(e){return Gd.create(e)}static and(...e){return ef.create(e,null,!0)}static or(...e){return tf.create(e,null,!0)}static greater(e,t){return qd.create(e,t)}static greaterEquals(e,t){return Jd.create(e,t)}static smaller(e,t){return Yd.create(e,t)}static smallerEquals(e,t){return Xd.create(e,t)}static{this._parser=new Pd({regexParsingWithErrorRecovery:!1})}static deserialize(e){if(e!=null)return this._parser.parse(e)}};function Id(e){let t=new Pd({regexParsingWithErrorRecovery:!1});return e.map(e=>(t.parse(e),t.lexingErrors.length>0?t.lexingErrors.map(e=>({errorMessage:e.additionalInfo?b(1889,`Unexpected token. Hint: {0}`,e.additionalInfo):b(1890,`Unexpected token.`),offset:e.offset,length:e.lexeme.length})):t.parsingErrors.length>0?t.parsingErrors.map(e=>({errorMessage:e.additionalInfo?`${e.message}. ${e.additionalInfo}`:e.message,offset:e.offset,length:e.lexeme.length})):[]))}function Ld(e,t){return e.cmp(t)}var Rd=class e{static{this.INSTANCE=new e}constructor(){this.type=wd.False}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return`false`}keys(){return[]}map(e){return this}negate(){return zd.INSTANCE}},zd=class e{static{this.INSTANCE=new e}constructor(){this.type=wd.True}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return`true`}keys(){return[]}map(e){return this}negate(){return Rd.INSTANCE}},Bd=class e{static create(t,n=null){let r=Sd.get(t);return typeof r==`boolean`?r?zd.INSTANCE:Rd.INSTANCE:new e(t,n)}constructor(e,t){this.key=e,this.negated=t,this.type=wd.Defined}cmp(e){return e.type===this.type?nf(this.key,e.key):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=Sd.get(this.key);return typeof e==`boolean`?e?zd.INSTANCE:Rd.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(e){return e.mapDefined(this.key)}negate(){return this.negated||=Gd.create(this.key,this),this.negated}},Vd=class e{static create(t,n,r=null){if(typeof n==`boolean`)return n?Bd.create(t,r):Gd.create(t,r);let i=Sd.get(t);return typeof i==`boolean`?n===(i?`true`:`false`)?zd.INSTANCE:Rd.INSTANCE:new e(t,n,r)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=wd.Equals}cmp(e){return e.type===this.type?rf(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=Sd.get(this.key);if(typeof e==`boolean`){let t=e?`true`:`false`;return this.value===t?zd.INSTANCE:Rd.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}map(e){return e.mapEquals(this.key,this.value)}negate(){return this.negated||=Wd.create(this.key,this.value,this),this.negated}},Hd=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.valueKey=t,this.type=wd.In,this.negated=null}cmp(e){return e.type===this.type?rf(this.key,this.valueKey,e.key,e.valueKey):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.valueKey===e.valueKey:!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.valueKey),n=e.getValue(this.key);if(Array.isArray(t)){if(t.includes(n))return!0;if(Tn&&typeof n==`string`&&n.startsWith(`file:///`)){let e=n.toLowerCase();return t.some(t=>typeof t==`string`&&t.toLowerCase()===e)}return!1}if(typeof n==`string`&&typeof t==`object`&&t){if(Cd.call(t,n))return!0;if(Tn&&n.startsWith(`file:///`)){let e=n.toLowerCase();return Object.keys(t).some(t=>t.toLowerCase()===e)}return!1}return!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}map(e){return e.mapIn(this.key,this.valueKey)}negate(){return this.negated||=Ud.create(this.key,this.valueKey),this.negated}},Ud=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.valueKey=t,this.type=wd.NotIn,this._negated=Hd.create(e,t)}cmp(e){return e.type===this.type?this._negated.cmp(e._negated):this.type-e.type}equals(e){return e.type===this.type?this._negated.equals(e._negated):!1}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}map(e){return e.mapNotIn(this.key,this.valueKey)}negate(){return this._negated}},Wd=class e{static create(t,n,r=null){if(typeof n==`boolean`)return n?Gd.create(t,r):Bd.create(t,r);let i=Sd.get(t);return typeof i==`boolean`?n===(i?`true`:`false`)?Rd.INSTANCE:zd.INSTANCE:new e(t,n,r)}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=wd.NotEquals}cmp(e){return e.type===this.type?rf(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){let e=Sd.get(this.key);if(typeof e==`boolean`){let t=e?`true`:`false`;return this.value===t?Rd.INSTANCE:zd.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}map(e){return e.mapNotEquals(this.key,this.value)}negate(){return this.negated||=Vd.create(this.key,this.value,this),this.negated}},Gd=class e{static create(t,n=null){let r=Sd.get(t);return typeof r==`boolean`?r?Rd.INSTANCE:zd.INSTANCE:new e(t,n)}constructor(e,t){this.key=e,this.negated=t,this.type=wd.Not}cmp(e){return e.type===this.type?nf(this.key,e.key):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){let e=Sd.get(this.key);return typeof e==`boolean`?e?Rd.INSTANCE:zd.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}map(e){return e.mapNot(this.key)}negate(){return this.negated||=Bd.create(this.key,this),this.negated}};function Kd(e,t){if(typeof e==`string`){let t=parseFloat(e);isNaN(t)||(e=t)}return typeof e==`string`||typeof e==`number`?t(e):Rd.INSTANCE}var qd=class e{static create(t,n,r=null){return Kd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=wd.Greater}cmp(e){return e.type===this.type?rf(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreater(this.key,this.value)}negate(){return this.negated||=Xd.create(this.key,this.value,this),this.negated}},Jd=class e{static create(t,n,r=null){return Kd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=wd.GreaterEquals}cmp(e){return e.type===this.type?rf(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}map(e){return e.mapGreaterEquals(this.key,this.value)}negate(){return this.negated||=Yd.create(this.key,this.value,this),this.negated}},Yd=class e{static create(t,n,r=null){return Kd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=wd.Smaller}cmp(e){return e.type===this.type?rf(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmaller(this.key,this.value)}negate(){return this.negated||=Jd.create(this.key,this.value,this),this.negated}},Xd=class e{static create(t,n,r=null){return Kd(n,n=>new e(t,n,r))}constructor(e,t,n){this.key=e,this.value=t,this.negated=n,this.type=wd.SmallerEquals}cmp(e){return e.type===this.type?rf(this.key,this.value,e.key,e.value):this.type-e.type}equals(e){return e.type===this.type?this.key===e.key&&this.value===e.value:!1}substituteConstants(){return this}evaluate(e){return typeof this.value==`string`?!1:parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}map(e){return e.mapSmallerEquals(this.key,this.value)}negate(){return this.negated||=qd.create(this.key,this.value,this),this.negated}},Zd=class e{static create(t,n){return new e(t,n)}constructor(e,t){this.key=e,this.regexp=t,this.type=wd.Regex,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.key<e.key)return-1;if(this.key>e.key)return 1;let t=this.regexp?this.regexp.source:``,n=e.regexp?e.regexp.source:``;return t<n?-1:+(t>n)}equals(e){if(e.type===this.type){let t=this.regexp?this.regexp.source:``,n=e.regexp?e.regexp.source:``;return this.key===e.key&&t===n}return!1}substituteConstants(){return this}evaluate(e){let t=e.getValue(this.key);return this.regexp?this.regexp.test(t):!1}serialize(){let e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:`/invalid/`;return`${this.key} =~ ${e}`}keys(){return[this.key]}map(e){return e.mapRegex(this.key,this.regexp)}negate(){return this.negated||=Qd.create(this),this.negated}},Qd=class e{static create(t){return new e(t)}constructor(e){this._actual=e,this.type=wd.NotRegex}cmp(e){return e.type===this.type?this._actual.cmp(e._actual):this.type-e.type}equals(e){return e.type===this.type?this._actual.equals(e._actual):!1}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}map(t){return new e(this._actual.map(t))}negate(){return this._actual}};function $d(e){let t=null;for(let n=0,r=e.length;n<r;n++){let r=e[n].substituteConstants();if(e[n]!==r&&t===null){t=[];for(let r=0;r<n;r++)t[r]=e[r]}t!==null&&(t[n]=r)}return t===null?e:t}var ef=class e{static create(t,n,r){return e._normalizeArr(t,n,r)}constructor(e,t){this.expr=e,this.negated=t,this.type=wd.And}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let n=Ld(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let t=$d(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].evaluate(e))return!1;return!0}static _normalizeArr(t,n,r){let i=[],a=!1;for(let e of t)if(e){if(e.type===wd.True){a=!0;continue}if(e.type===wd.False)return Rd.INSTANCE;if(e.type===wd.And){i.push(...e.expr);continue}i.push(e)}if(i.length===0&&a)return zd.INSTANCE;if(i.length!==0){if(i.length===1)return i[0];i.sort(Ld);for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(i.length===1)return i[0];for(;i.length>1;){let t=i[i.length-1];if(t.type!==wd.Or)break;i.pop();let n=i.pop(),a=i.length===0,o=tf.create(t.expr.map(t=>e.create([t,n],null,r)),null,a);o&&(i.push(o),i.sort(Ld))}if(i.length===1)return i[0];if(r){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if(i[e].negate().equals(i[t]))return Rd.INSTANCE;if(i.length===1)return i[0]}return new e(i,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(` && `)}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}map(t){return new e(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let e=[];for(let t of this.expr)e.push(t.negate());this.negated=tf.create(e,this,!0)}return this.negated}},tf=class e{static create(t,n,r){return e._normalizeArr(t,n,r)}constructor(e,t){this.expr=e,this.negated=t,this.type=wd.Or}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let t=0,n=this.expr.length;t<n;t++){let n=Ld(this.expr[t],e.expr[t]);if(n!==0)return n}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let t=0,n=this.expr.length;t<n;t++)if(!this.expr[t].equals(e.expr[t]))return!1;return!0}return!1}substituteConstants(){let t=$d(this.expr);return t===this.expr?this:e.create(t,this.negated,!1)}evaluate(e){for(let t=0,n=this.expr.length;t<n;t++)if(this.expr[t].evaluate(e))return!0;return!1}static _normalizeArr(t,n,r){let i=[],a=!1;if(t){for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n){if(n.type===wd.False){a=!0;continue}if(n.type===wd.True)return zd.INSTANCE;if(n.type===wd.Or){i=i.concat(n.expr);continue}i.push(n)}}if(i.length===0&&a)return Rd.INSTANCE;i.sort(Ld)}if(i.length!==0){if(i.length===1)return i[0];for(let e=1;e<i.length;e++)i[e-1].equals(i[e])&&(i.splice(e,1),e--);if(i.length===1)return i[0];if(r){for(let e=0;e<i.length;e++)for(let t=e+1;t<i.length;t++)if(i[e].negate().equals(i[t]))return zd.INSTANCE;if(i.length===1)return i[0]}return new e(i,n)}}serialize(){return this.expr.map(e=>e.serialize()).join(` || `)}keys(){let e=[];for(let t of this.expr)e.push(...t.keys());return e}map(t){return new e(this.expr.map(e=>e.map(t)),null)}negate(){if(!this.negated){let t=[];for(let e of this.expr)t.push(e.negate());for(;t.length>1;){let n=t.shift(),r=t.shift(),i=[];for(let e of af(n))for(let t of af(r))i.push(ef.create([e,t],null,!1));t.unshift(e.create(i,null,!1))}this.negated=e.create(t,this,!0)}return this.negated}},F=class e extends Bd{static{this._info=[]}static all(){return e._info.values()}constructor(t,n,r){super(t,null),this._defaultValue=n,typeof r==`object`?e._info.push({...r,key:t}):r!==!0&&e._info.push({key:t,description:r,type:n==null?void 0:typeof n})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Vd.create(this.key,e)}notEqualsTo(e){return Wd.create(this.key,e)}greater(e){return qd.create(this.key,e)}};function nf(e,t){return e<t?-1:+(e>t)}function rf(e,t,n,r){return e<n?-1:e>n?1:t<r?-1:+(t>r)}function af(e){return e.type===wd.Or?e.expr:[e]}var of;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Disabled=1]=`Disabled`,e[e.Enabled=2]=`Enabled`})(of||={}),new F(`accessibilityModeEnabled`,!1);var sf;(function(e){e[e.None=0]=`None`,e[e.Keep=1]=`Keep`,e[e.Brackets=2]=`Brackets`,e[e.Advanced=3]=`Advanced`,e[e.Full=4]=`Full`})(sf||={});var cf=class{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}},lf=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return df(e,t)}compute(e,t,n){return n}},uf=class{constructor(e,t){this.newValue=e,this.didChange=t}};function df(e,t){if(typeof e!=`object`||typeof t!=`object`||!e||!t)return new uf(t,e!==t);if(Array.isArray(e)||Array.isArray(t))return new uf(t,!(Array.isArray(e)&&Array.isArray(t)&&ge(e,t)));let n=!1;for(let r in t)if(t.hasOwnProperty(r)){let i=df(e[r],t[r]);i.didChange&&(e[r]=i.newValue,n=!0)}return new uf(e,n)}var ff=class{constructor(e,t){this.schema=void 0,this.id=e,this.name=`_never_`,this.defaultValue=t}applyUpdate(e,t){return df(e,t)}validate(e){return this.defaultValue}},pf=class{constructor(e,t,n,r){this.id=e,this.name=t,this.defaultValue=n,this.schema=r}applyUpdate(e,t){return df(e,t)}compute(e,t,n){return n}};function I(e,t){return e===void 0?t:e===`false`?!1:!!e}var L=class extends pf{constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`boolean`,r.default=n),super(e,t,n,r)}validate(e){return I(e,this.defaultValue)}};function mf(e,t,n,r){if(typeof e==`string`&&(e=parseInt(e,10)),typeof e!=`number`||isNaN(e))return t;let i=e;return i=Math.max(n,i),i=Math.min(r,i),i|0}var hf=class e extends pf{static clampedInt(e,t,n,r){return mf(e,t,n,r)}constructor(e,t,n,r,i,a=void 0){a!==void 0&&(a.type=`integer`,a.default=n,a.minimum=r,a.maximum=i),super(e,t,n,a),this.minimum=r,this.maximum=i}validate(t){return e.clampedInt(t,this.defaultValue,this.minimum,this.maximum)}},gf=class e extends pf{static clamp(e,t,n){return e<t?t:e>n?n:e}static float(e,t){return typeof e==`string`&&(e=parseFloat(e)),typeof e!=`number`||isNaN(e)?t:e}constructor(e,t,n,r,i,a,o){i!==void 0&&(i.type=`number`,i.default=n,i.minimum=a,i.maximum=o),super(e,t,n,i),this.validationFn=r,this.minimum=a,this.maximum=o}validate(t){return this.validationFn(e.float(t,this.defaultValue))}},_f=class e extends pf{static string(e,t){return typeof e==`string`?e:t}constructor(e,t,n,r=void 0){r!==void 0&&(r.type=`string`,r.default=n),super(e,t,n,r)}validate(t){return e.string(t,this.defaultValue)}};function vf(e,t,n,r){return typeof e==`string`?r&&e in r?r[e]:n.indexOf(e)===-1?t:e:t}var yf=class extends pf{constructor(e,t,n,r,i=void 0){i!==void 0&&(i.type=`string`,i.enum=r.slice(0),i.default=n),super(e,t,n,i),this._allowedValues=r}validate(e){return vf(e,this.defaultValue,this._allowedValues)}},bf=class extends lf{constructor(e,t,n,r,i,a,o=void 0){o!==void 0&&(o.type=`string`,o.enum=i,o.default=r),super(e,t,n,o),this._allowedValues=i,this._convert=a}validate(e){return typeof e!=`string`||this._allowedValues.indexOf(e)===-1?this.defaultValue:this._convert(e)}};function xf(e){switch(e){case`none`:return sf.None;case`keep`:return sf.Keep;case`brackets`:return sf.Brackets;case`advanced`:return sf.Advanced;case`full`:return sf.Full}}var Sf=class extends lf{constructor(){super(z.accessibilitySupport,`accessibilitySupport`,of.Unknown,{type:`string`,enum:[`auto`,`on`,`off`],enumDescriptions:[b(295,`Use platform APIs to detect when a Screen Reader is attached.`),b(296,`Optimize for usage with a Screen Reader.`),b(297,`Assume a screen reader is not attached.`)],default:`auto`,tags:[`accessibility`],description:b(298,`Controls if the UI should run in a mode where it is optimized for screen readers.`)})}validate(e){switch(e){case`auto`:return of.Unknown;case`off`:return of.Disabled;case`on`:return of.Enabled}return this.defaultValue}compute(e,t,n){return n===of.Unknown?e.accessibilitySupport:n}},Cf=class extends lf{constructor(){let e={insertSpace:!0,ignoreEmptyLines:!0};super(z.comments,`comments`,e,{"editor.comments.insertSpace":{type:`boolean`,default:e.insertSpace,description:b(299,`Controls whether a space character is inserted when commenting.`)},"editor.comments.ignoreEmptyLines":{type:`boolean`,default:e.ignoreEmptyLines,description:b(300,`Controls if empty lines should be ignored with toggle, add or remove actions for line comments.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertSpace:I(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:I(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}},wf;(function(e){e[e.Hidden=0]=`Hidden`,e[e.Blink=1]=`Blink`,e[e.Smooth=2]=`Smooth`,e[e.Phase=3]=`Phase`,e[e.Expand=4]=`Expand`,e[e.Solid=5]=`Solid`})(wf||={});function Tf(e){switch(e){case`blink`:return wf.Blink;case`smooth`:return wf.Smooth;case`phase`:return wf.Phase;case`expand`:return wf.Expand;case`solid`:return wf.Solid}}var Ef;(function(e){e[e.Line=1]=`Line`,e[e.Block=2]=`Block`,e[e.Underline=3]=`Underline`,e[e.LineThin=4]=`LineThin`,e[e.BlockOutline=5]=`BlockOutline`,e[e.UnderlineThin=6]=`UnderlineThin`})(Ef||={});function Df(e){switch(e){case`line`:return Ef.Line;case`block`:return Ef.Block;case`underline`:return Ef.Underline;case`line-thin`:return Ef.LineThin;case`block-outline`:return Ef.BlockOutline;case`underline-thin`:return Ef.UnderlineThin}}var Of=class extends ff{constructor(){super(z.editorClassName,``)}compute(e,t,n){let r=[`monaco-editor`];return t.get(z.extraEditorClassName)&&r.push(t.get(z.extraEditorClassName)),e.extraEditorClassName&&r.push(e.extraEditorClassName),t.get(z.mouseStyle)==="default"?r.push(`mouse-default`):t.get(z.mouseStyle)===`copy`&&r.push(`mouse-copy`),t.get(z.showUnused)&&r.push(`showUnused`),t.get(z.showDeprecated)&&r.push(`showDeprecated`),r.join(` `)}},kf=class extends L{constructor(){super(z.emptySelectionClipboard,`emptySelectionClipboard`,!0,{description:b(301,`Controls whether copying without a selection copies the current line.`)})}compute(e,t,n){return n&&e.emptySelectionClipboard}},Af=class extends lf{constructor(){let e={cursorMoveOnType:!0,findOnType:!0,seedSearchStringFromSelection:`always`,autoFindInSelection:`never`,globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0,closeOnResult:!1,history:`workspace`,replaceHistory:`workspace`};super(z.find,`find`,e,{"editor.find.cursorMoveOnType":{type:`boolean`,default:e.cursorMoveOnType,description:b(302,`Controls whether the cursor should jump to find matches while typing.`)},"editor.find.seedSearchStringFromSelection":{type:`string`,enum:[`never`,`always`,`selection`],default:e.seedSearchStringFromSelection,enumDescriptions:[b(303,`Never seed search string from the editor selection.`),b(304,`Always seed search string from the editor selection, including word at cursor position.`),b(305,`Only seed search string from the editor selection.`)],description:b(306,`Controls whether the search string in the Find Widget is seeded from the editor selection.`)},"editor.find.autoFindInSelection":{type:`string`,enum:[`never`,`always`,`multiline`],default:e.autoFindInSelection,enumDescriptions:[b(307,`Never turn on Find in Selection automatically (default).`),b(308,`Always turn on Find in Selection automatically.`),b(309,`Turn on Find in Selection automatically when multiple lines of content are selected.`)],description:b(310,`Controls the condition for turning on Find in Selection automatically.`)},"editor.find.globalFindClipboard":{type:`boolean`,default:e.globalFindClipboard,description:b(311,`Controls whether the Find Widget should read or modify the shared find clipboard on macOS.`),included:En},"editor.find.addExtraSpaceOnTop":{type:`boolean`,default:e.addExtraSpaceOnTop,description:b(312,`Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.`)},"editor.find.loop":{type:`boolean`,default:e.loop,description:b(313,`Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.`)},"editor.find.closeOnResult":{type:`boolean`,default:e.closeOnResult,description:b(314,`Controls whether the Find Widget closes after an explicit find navigation command lands on a result.`)},"editor.find.history":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[b(315,`Do not store search history from the find widget.`),b(316,`Store search history across the active workspace`)],description:b(317,`Controls how the find widget history should be stored`)},"editor.find.replaceHistory":{type:`string`,enum:[`never`,`workspace`],default:`workspace`,enumDescriptions:[b(318,`Do not store history from the replace widget.`),b(319,`Store replace history across the active workspace`)],description:b(320,`Controls how the replace widget history should be stored`)},"editor.find.findOnType":{type:`boolean`,default:e.findOnType,description:b(321,`Controls whether the Find Widget should search as you type.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{cursorMoveOnType:I(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),findOnType:I(t.findOnType,this.defaultValue.findOnType),seedSearchStringFromSelection:typeof t.seedSearchStringFromSelection==`boolean`?t.seedSearchStringFromSelection?`always`:`never`:vf(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,[`never`,`always`,`selection`]),autoFindInSelection:typeof t.autoFindInSelection==`boolean`?t.autoFindInSelection?`always`:`never`:vf(t.autoFindInSelection,this.defaultValue.autoFindInSelection,[`never`,`always`,`multiline`]),globalFindClipboard:I(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:I(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:I(t.loop,this.defaultValue.loop),closeOnResult:I(t.closeOnResult,this.defaultValue.closeOnResult),history:vf(t.history,this.defaultValue.history,[`never`,`workspace`]),replaceHistory:vf(t.replaceHistory,this.defaultValue.replaceHistory,[`never`,`workspace`])}}},jf=class e extends lf{static{this.OFF=`"liga" off, "calt" off`}static{this.ON=`"liga" on, "calt" on`}constructor(){super(z.fontLigatures,`fontLigatures`,e.OFF,{anyOf:[{type:`boolean`,description:b(322,`Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.`)},{type:`string`,description:b(323,`Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.`)}],description:b(324,`Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property.`),default:!1})}validate(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`||t.length===0?e.OFF:t===`true`?e.ON:t:t?e.ON:e.OFF}},Mf=class e extends lf{static{this.OFF=cd}static{this.TRANSLATE=`translate`}constructor(){super(z.fontVariations,`fontVariations`,e.OFF,{anyOf:[{type:`boolean`,description:b(325,`Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.`)},{type:`string`,description:b(326,`Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.`)}],description:b(327,`Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property.`),default:!1})}validate(t){return t===void 0?this.defaultValue:typeof t==`string`?t===`false`?e.OFF:t===`true`?e.TRANSLATE:t:t?e.TRANSLATE:e.OFF}compute(e,t,n){return e.fontInfo.fontVariationSettings}},Nf=class extends ff{constructor(){super(z.fontInfo,new sd({pixelRatio:0,fontFamily:``,fontWeight:``,fontSize:0,fontFeatureSettings:``,fontVariationSettings:``,lineHeight:0,letterSpacing:0,isMonospace:!1,typicalHalfwidthCharacterWidth:0,typicalFullwidthCharacterWidth:0,canUseHalfwidthRightwardsArrow:!1,spaceWidth:0,middotWidth:0,wsmiddotWidth:0,maxDigitWidth:0},!1))}compute(e,t,n){return e.fontInfo}},Pf=class extends ff{constructor(){super(z.effectiveCursorStyle,Ef.Line)}compute(e,t,n){return e.inputMode===`overtype`?t.get(z.overtypeCursorStyle):t.get(z.cursorStyle)}},Ff=class extends ff{constructor(){super(z.effectiveEditContext,!1)}compute(e,t){return e.editContextSupported&&t.get(z.editContext)}},If=class extends ff{constructor(){super(z.effectiveAllowVariableFonts,!1)}compute(e,t){return e.accessibilitySupport===of.Enabled?t.get(z.allowVariableFontsInAccessibilityMode):t.get(z.allowVariableFonts)}},Lf=class extends pf{constructor(){super(z.fontSize,`fontSize`,ld.fontSize,{type:`number`,minimum:6,maximum:100,default:ld.fontSize,description:b(328,`Controls the font size in pixels.`)})}validate(e){let t=gf.float(e,this.defaultValue);return t===0?ld.fontSize:gf.clamp(t,6,100)}compute(e,t,n){return e.fontInfo.fontSize}},Rf=class e extends lf{static{this.SUGGESTION_VALUES=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`]}static{this.MINIMUM_VALUE=1}static{this.MAXIMUM_VALUE=1e3}constructor(){super(z.fontWeight,`fontWeight`,ld.fontWeight,{anyOf:[{type:`number`,minimum:e.MINIMUM_VALUE,maximum:e.MAXIMUM_VALUE,errorMessage:b(329,`Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.`)},{type:`string`,pattern:`^(normal|bold|1000|[1-9][0-9]{0,2})$`},{enum:e.SUGGESTION_VALUES}],default:ld.fontWeight,description:b(330,`Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.`)})}validate(t){return t===`normal`||t===`bold`?t:String(hf.clampedInt(t,ld.fontWeight,e.MINIMUM_VALUE,e.MAXIMUM_VALUE))}},zf=class extends lf{constructor(){let e={multiple:`peek`,multipleDefinitions:`peek`,multipleTypeDefinitions:`peek`,multipleDeclarations:`peek`,multipleImplementations:`peek`,multipleReferences:`peek`,multipleTests:`peek`,alternativeDefinitionCommand:`editor.action.goToReferences`,alternativeTypeDefinitionCommand:`editor.action.goToReferences`,alternativeDeclarationCommand:`editor.action.goToReferences`,alternativeImplementationCommand:``,alternativeReferenceCommand:``,alternativeTestsCommand:``},t={type:`string`,enum:[`peek`,`gotoAndPeek`,`goto`],default:e.multiple,enumDescriptions:[b(331,`Show Peek view of the results (default)`),b(332,`Go to the primary result and show a Peek view`),b(333,`Go to the primary result and enable Peek-less navigation to others`)]},n=[``,`editor.action.referenceSearch.trigger`,`editor.action.goToReferences`,`editor.action.peekImplementation`,`editor.action.goToImplementation`,`editor.action.peekTypeDefinition`,`editor.action.goToTypeDefinition`,`editor.action.peekDeclaration`,`editor.action.revealDeclaration`,`editor.action.peekDefinition`,`editor.action.revealDefinitionAside`,`editor.action.revealDefinition`];super(z.gotoLocation,`gotoLocation`,e,{"editor.gotoLocation.multiple":{deprecationMessage:b(334,`This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.`)},"editor.gotoLocation.multipleDefinitions":{description:b(335,`Controls the behavior the 'Go to Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleTypeDefinitions":{description:b(336,`Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleDeclarations":{description:b(337,`Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleImplementations":{description:b(338,`Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.`),...t},"editor.gotoLocation.multipleReferences":{description:b(339,`Controls the behavior the 'Go to References'-command when multiple target locations exist.`),...t},"editor.gotoLocation.alternativeDefinitionCommand":{type:`string`,default:e.alternativeDefinitionCommand,enum:n,description:b(340,`Alternative command id that is being executed when the result of 'Go to Definition' is the current location.`)},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:`string`,default:e.alternativeTypeDefinitionCommand,enum:n,description:b(341,`Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.`)},"editor.gotoLocation.alternativeDeclarationCommand":{type:`string`,default:e.alternativeDeclarationCommand,enum:n,description:b(342,`Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.`)},"editor.gotoLocation.alternativeImplementationCommand":{type:`string`,default:e.alternativeImplementationCommand,enum:n,description:b(343,`Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.`)},"editor.gotoLocation.alternativeReferenceCommand":{type:`string`,default:e.alternativeReferenceCommand,enum:n,description:b(344,`Alternative command id that is being executed when the result of 'Go to Reference' is the current location.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{multiple:vf(t.multiple,this.defaultValue.multiple,[`peek`,`gotoAndPeek`,`goto`]),multipleDefinitions:vf(t.multipleDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTypeDefinitions:vf(t.multipleTypeDefinitions,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleDeclarations:vf(t.multipleDeclarations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleImplementations:vf(t.multipleImplementations,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleReferences:vf(t.multipleReferences,`peek`,[`peek`,`gotoAndPeek`,`goto`]),multipleTests:vf(t.multipleTests,`peek`,[`peek`,`gotoAndPeek`,`goto`]),alternativeDefinitionCommand:_f.string(t.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:_f.string(t.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:_f.string(t.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:_f.string(t.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:_f.string(t.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand),alternativeTestsCommand:_f.string(t.alternativeTestsCommand,this.defaultValue.alternativeTestsCommand)}}},Bf=class extends lf{constructor(){let e={enabled:`on`,delay:300,hidingDelay:300,sticky:!0,above:!0,showLongLineWarning:!0};super(z.hover,`hover`,e,{"editor.hover.enabled":{type:`string`,enum:[`on`,`off`,`onKeyboardModifier`],default:e.enabled,markdownEnumDescriptions:[b(345,`Hover is enabled.`),b(346,`Hover is disabled.`),b(347,"Hover is shown when holding `{0}` or `Alt` (the opposite modifier of `#editor.multiCursorModifier#`)",En?`Command`:`Control`)],description:b(348,`Controls whether the hover is shown.`),keywords:[`hint`,`info`,`tooltip`]},"editor.hover.delay":{type:`number`,default:e.delay,minimum:0,maximum:1e4,description:b(349,`Controls the delay in milliseconds after which the hover is shown.`)},"editor.hover.sticky":{type:`boolean`,default:e.sticky,description:b(350,`Controls whether the hover should remain visible when mouse is moved over it.`)},"editor.hover.hidingDelay":{type:`integer`,minimum:0,default:e.hidingDelay,markdownDescription:b(351,"Controls the delay in milliseconds after which the hover is hidden. Requires `#editor.hover.sticky#` to be enabled.")},"editor.hover.above":{type:`boolean`,default:e.above,description:b(352,`Prefer showing hovers above the line, if there's space.`)},"editor.hover.showLongLineWarning":{type:`boolean`,default:e.showLongLineWarning,description:b(353,`Controls whether long line warning hovers are shown, such as when tokenization is skipped or rendering is paused.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:vf(t.enabled,this.defaultValue.enabled,[`on`,`off`,`onKeyboardModifier`]),delay:hf.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:I(t.sticky,this.defaultValue.sticky),hidingDelay:hf.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:I(t.above,this.defaultValue.above),showLongLineWarning:I(t.showLongLineWarning,this.defaultValue.showLongLineWarning)}}},Vf;(function(e){e[e.None=0]=`None`,e[e.Text=1]=`Text`,e[e.Blocks=2]=`Blocks`})(Vf||={});var Hf=class e extends ff{constructor(){super(z.layoutInfo,{width:0,height:0,glyphMarginLeft:0,glyphMarginWidth:0,glyphMarginDecorationLaneCount:0,lineNumbersLeft:0,lineNumbersWidth:0,decorationsLeft:0,decorationsWidth:0,contentLeft:0,contentWidth:0,minimap:{renderMinimap:Vf.None,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:0,minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:0},viewportColumn:0,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1,verticalScrollbarWidth:0,horizontalScrollbarHeight:0,overviewRuler:{top:0,width:0,height:0,right:0}})}compute(t,n,r){return e.computeLayout(n,{memory:t.memory,outerWidth:t.outerWidth,outerHeight:t.outerHeight,isDominatedByLongLines:t.isDominatedByLongLines,lineHeight:t.fontInfo.lineHeight,viewLineCount:t.viewLineCount,lineNumbersDigitCount:t.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:t.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:t.fontInfo.maxDigitWidth,pixelRatio:t.pixelRatio,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){let t=e.height/e.lineHeight,n=Math.floor(e.paddingTop/e.lineHeight),r=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(r=Math.max(r,t-1));let i=(n+e.viewLineCount+r)/(e.pixelRatio*e.height),a=Math.floor(e.viewLineCount/i);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:n,extraLinesBeyondLastLine:r,desiredRatio:i,minimapLineCount:a}}static _computeMinimapLayout(t,n){let r=t.outerWidth,i=t.outerHeight,a=t.pixelRatio;if(!t.minimap.enabled)return{renderMinimap:Vf.None,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(a*i),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:i};let o=n.stableMinimapLayoutInput,s=o&&t.outerHeight===o.outerHeight&&t.lineHeight===o.lineHeight&&t.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&t.pixelRatio===o.pixelRatio&&t.scrollBeyondLastLine===o.scrollBeyondLastLine&&t.paddingTop===o.paddingTop&&t.paddingBottom===o.paddingBottom&&t.minimap.enabled===o.minimap.enabled&&t.minimap.side===o.minimap.side&&t.minimap.size===o.minimap.size&&t.minimap.showSlider===o.minimap.showSlider&&t.minimap.renderCharacters===o.minimap.renderCharacters&&t.minimap.maxColumn===o.minimap.maxColumn&&t.minimap.scale===o.minimap.scale&&t.verticalScrollbarWidth===o.verticalScrollbarWidth&&t.isViewportWrapping===o.isViewportWrapping,c=t.lineHeight,l=t.typicalHalfwidthCharacterWidth,u=t.scrollBeyondLastLine,d=t.minimap.renderCharacters,f=a>=2?Math.round(t.minimap.scale*2):t.minimap.scale,p=t.minimap.maxColumn,m=t.minimap.size,ee=t.minimap.side,te=t.verticalScrollbarWidth,ne=t.viewLineCount,h=t.remainingWidth,re=t.isViewportWrapping,ie=d?2:3,ae=Math.floor(a*i),oe=ae/a,se=!1,ce=!1,le=ie*f,ue=f/a,de=1;if(m===`fill`||m===`fit`){let{typicalViewportLineCount:r,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:p}=e.computeContainedMinimapLineCount({viewLineCount:ne,scrollBeyondLastLine:u,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,height:i,lineHeight:c,pixelRatio:a});if(ne/p>1)se=!0,ce=!0,f=1,le=1,ue=f/a;else{let e=!1,i=f+1;if(m===`fit`){let t=Math.ceil((o+ne+l)*le);re&&s&&h<=n.stableFitRemainingWidth?(e=!0,i=n.stableFitMaxMinimapScale):e=t>ae}if(m===`fill`||e){se=!0;let e=f;le=Math.min(c*a,Math.max(1,Math.floor(1/d))),re&&s&&h<=n.stableFitRemainingWidth&&(i=n.stableFitMaxMinimapScale),f=Math.min(i,Math.max(1,Math.floor(le/ie))),f>e&&(de=Math.min(2,f/e)),ue=f/a/de,ae=Math.ceil(Math.max(r,o+ne+l)*le),re?(n.stableMinimapLayoutInput=t,n.stableFitRemainingWidth=h,n.stableFitMaxMinimapScale=f):(n.stableMinimapLayoutInput=null,n.stableFitRemainingWidth=0)}}}let fe=Math.floor(p*ue),pe=Math.min(fe,Math.max(0,Math.floor((h-te-2)*ue/(l+ue)))+8),me=Math.floor(a*pe),he=me/a;return me=Math.floor(me*de),{renderMinimap:d?Vf.Text:Vf.Blocks,minimapLeft:ee===`left`?0:r-pe-te,minimapWidth:pe,minimapHeightIsEditorHeight:se,minimapIsSampling:ce,minimapScale:f,minimapLineHeight:le,minimapCanvasInnerWidth:me,minimapCanvasInnerHeight:ae,minimapCanvasOuterWidth:he,minimapCanvasOuterHeight:oe}}static computeLayout(t,n){let r=n.outerWidth|0,i=n.outerHeight|0,a=n.lineHeight|0,o=n.lineNumbersDigitCount|0,s=n.typicalHalfwidthCharacterWidth,c=n.maxDigitWidth,l=n.pixelRatio,u=n.viewLineCount,d=t.get(z.wordWrapOverride2),f=d===`inherit`?t.get(z.wordWrapOverride1):d,p=f===`inherit`?t.get(z.wordWrap):f,m=t.get(z.wordWrapColumn),ee=n.isDominatedByLongLines,te=t.get(z.glyphMargin),ne=t.get(z.lineNumbers).renderType!==rp.Off,h=t.get(z.lineNumbersMinChars),re=t.get(z.scrollBeyondLastLine),ie=t.get(z.padding),ae=t.get(z.minimap),oe=t.get(z.scrollbar),se=oe.verticalScrollbarSize,ce=oe.verticalHasArrows,le=oe.arrowSize,ue=oe.horizontalScrollbarSize,de=t.get(z.folding),fe=t.get(z.showFoldingControls)!==`never`,pe=t.get(z.lineDecorationsWidth);de&&fe&&(pe+=16);let me=0;ne&&(me=Math.round(Math.max(o,h)*c));let he=0;te&&(he=a*n.glyphMarginDecorationLaneCount);let ge=0,_e=ge+he,ve=_e+me,ye=ve+pe,be=r-he-me-pe,xe=!1,Se=!1,Ce=-1;t.get(z.accessibilitySupport)===of.Enabled&&f===`inherit`&&ee?(xe=!0,Se=!0):p===`on`||p===`bounded`?Se=!0:p===`wordWrapColumn`&&(Ce=m);let we=e._computeMinimapLayout({outerWidth:r,outerHeight:i,lineHeight:a,typicalHalfwidthCharacterWidth:s,pixelRatio:l,scrollBeyondLastLine:re,paddingTop:ie.top,paddingBottom:ie.bottom,minimap:ae,verticalScrollbarWidth:se,viewLineCount:u,remainingWidth:be,isViewportWrapping:Se},n.memory||new cf);we.renderMinimap!==Vf.None&&we.minimapLeft===0&&(ge+=we.minimapWidth,_e+=we.minimapWidth,ve+=we.minimapWidth,ye+=we.minimapWidth);let Te=be-we.minimapWidth,Ee=Math.max(1,Math.floor((Te-se-2)/s)),De=ce?le:0;return Se&&(Ce=Math.max(1,Ee),p===`bounded`&&(Ce=Math.min(Ce,m))),{width:r,height:i,glyphMarginLeft:ge,glyphMarginWidth:he,glyphMarginDecorationLaneCount:n.glyphMarginDecorationLaneCount,lineNumbersLeft:_e,lineNumbersWidth:me,decorationsLeft:ve,decorationsWidth:pe,contentLeft:ye,contentWidth:Te,minimap:we,viewportColumn:Ee,isWordWrapMinified:xe,isViewportWrapping:Se,wrappingColumn:Ce,verticalScrollbarWidth:se,horizontalScrollbarHeight:ue,overviewRuler:{top:De,width:se,height:i-2*De,right:0}}}},Uf=class extends lf{constructor(){super(z.wrappingStrategy,`wrappingStrategy`,`simple`,{"editor.wrappingStrategy":{enumDescriptions:[b(354,`Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.`),b(355,`Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.`)],type:`string`,enum:[`simple`,`advanced`],default:`simple`,description:b(356,`Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.`)}})}validate(e){return vf(e,`simple`,[`simple`,`advanced`])}compute(e,t,n){return t.get(z.accessibilitySupport)===of.Enabled?`advanced`:n}},Wf;(function(e){e.Off=`off`,e.OnCode=`onCode`,e.On=`on`})(Wf||={});var Gf=class extends lf{constructor(){let e={enabled:Wf.OnCode};super(z.lightbulb,`lightbulb`,e,{"editor.lightbulb.enabled":{type:`string`,enum:[Wf.Off,Wf.OnCode,Wf.On],default:e.enabled,enumDescriptions:[b(357,`Disable the code action menu.`),b(358,`Show the code action menu when the cursor is on lines with code.`),b(359,`Show the code action menu when the cursor is on lines with code or on empty lines.`)],description:b(360,`Enables the Code Action lightbulb in the editor.`)}})}validate(e){return!e||typeof e!=`object`?this.defaultValue:{enabled:vf(e.enabled,this.defaultValue.enabled,[Wf.Off,Wf.OnCode,Wf.On])}}},Kf=class extends lf{constructor(){let e={enabled:!0,maxLineCount:5,defaultModel:`outlineModel`,scrollWithEditor:!0};super(z.stickyScroll,`stickyScroll`,e,{"editor.stickyScroll.enabled":{type:`boolean`,default:e.enabled,description:b(361,`Shows the nested current scopes during the scroll at the top of the editor.`)},"editor.stickyScroll.maxLineCount":{type:`number`,default:e.maxLineCount,minimum:1,maximum:20,description:b(362,`Defines the maximum number of sticky lines to show.`)},"editor.stickyScroll.defaultModel":{type:`string`,enum:[`outlineModel`,`foldingProviderModel`,`indentationModel`],default:e.defaultModel,description:b(363,`Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.`)},"editor.stickyScroll.scrollWithEditor":{type:`boolean`,default:e.scrollWithEditor,description:b(364,`Enable scrolling of Sticky Scroll with the editor's horizontal scrollbar.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:I(t.enabled,this.defaultValue.enabled),maxLineCount:hf.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,20),defaultModel:vf(t.defaultModel,this.defaultValue.defaultModel,[`outlineModel`,`foldingProviderModel`,`indentationModel`]),scrollWithEditor:I(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}},qf=class extends lf{constructor(){let e={enabled:`on`,fontSize:0,fontFamily:``,padding:!1,maximumLength:43};super(z.inlayHints,`inlayHints`,e,{"editor.inlayHints.enabled":{type:`string`,default:e.enabled,description:b(365,`Enables the inlay hints in the editor.`),enum:[`on`,`onUnlessPressed`,`offUnlessPressed`,`off`],markdownEnumDescriptions:[b(366,`Inlay hints are enabled`),b(367,`Inlay hints are showing by default and hide when holding {0}`,En?`Ctrl+Option`:`Ctrl+Alt`),b(368,`Inlay hints are hidden by default and show when holding {0}`,En?`Ctrl+Option`:`Ctrl+Alt`),b(369,`Inlay hints are disabled`)]},"editor.inlayHints.fontSize":{type:`number`,default:e.fontSize,markdownDescription:b(370,`Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.`,"`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:`string`,default:e.fontFamily,markdownDescription:b(371,`Controls font family of inlay hints in the editor. When set to empty, the {0} is used.`,"`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:`boolean`,default:e.padding,description:b(372,`Enables the padding around the inlay hints in the editor.`)},"editor.inlayHints.maximumLength":{type:`number`,default:e.maximumLength,markdownDescription:b(373,"Maximum overall length of inlay hints, for a single line, before they get truncated by the editor. Set to `0` to never truncate")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return typeof t.enabled==`boolean`&&(t.enabled=t.enabled?`on`:`off`),{enabled:vf(t.enabled,this.defaultValue.enabled,[`on`,`off`,`offUnlessPressed`,`onUnlessPressed`]),fontSize:hf.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:_f.string(t.fontFamily,this.defaultValue.fontFamily),padding:I(t.padding,this.defaultValue.padding),maximumLength:hf.clampedInt(t.maximumLength,this.defaultValue.maximumLength,0,2**53-1)}}},Jf=class extends lf{constructor(){super(z.lineDecorationsWidth,`lineDecorationsWidth`,10)}validate(e){return typeof e==`string`&&/^\d+(\.\d+)?ch$/.test(e)?-parseFloat(e.substring(0,e.length-2)):hf.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,n){return n<0?hf.clampedInt(-n*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):n}},Yf=class extends gf{constructor(){super(z.lineHeight,`lineHeight`,ld.lineHeight,e=>gf.clamp(e,0,150),{markdownDescription:b(374,`Controls the line height.
|
|
74
|
+
- Use 0 to automatically compute the line height from the font size.
|
|
75
|
+
- Values between 0 and 8 will be used as a multiplier with the font size.
|
|
76
|
+
- Values greater than or equal to 8 will be used as effective values.`)},0,150)}compute(e,t,n){return e.fontInfo.lineHeight}},Xf=class extends lf{constructor(){let e={enabled:!0,size:`proportional`,side:`right`,showSlider:`mouseover`,autohide:`none`,renderCharacters:!0,maxColumn:120,scale:1,showRegionSectionHeaders:!0,showMarkSectionHeaders:!0,markSectionHeaderRegex:`\\bMARK:\\s*(?<separator>-?)\\s*(?<label>.*)$`,sectionHeaderFontSize:9,sectionHeaderLetterSpacing:1};super(z.minimap,`minimap`,e,{"editor.minimap.enabled":{type:`boolean`,default:e.enabled,description:b(375,`Controls whether the minimap is shown.`)},"editor.minimap.autohide":{type:`string`,enum:[`none`,`mouseover`,`scroll`],enumDescriptions:[b(376,`The minimap is always shown.`),b(377,`The minimap is hidden when mouse is not over the minimap and shown when mouse is over the minimap.`),b(378,`The minimap is only shown when the editor is scrolled`)],default:e.autohide,description:b(379,`Controls whether the minimap is hidden automatically.`)},"editor.minimap.size":{type:`string`,enum:[`proportional`,`fill`,`fit`],enumDescriptions:[b(380,`The minimap has the same size as the editor contents (and might scroll).`),b(381,`The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling).`),b(382,`The minimap will shrink as necessary to never be larger than the editor (no scrolling).`)],default:e.size,description:b(383,`Controls the size of the minimap.`)},"editor.minimap.side":{type:`string`,enum:[`left`,`right`],default:e.side,description:b(384,`Controls the side where to render the minimap.`)},"editor.minimap.showSlider":{type:`string`,enum:[`always`,`mouseover`],default:e.showSlider,description:b(385,`Controls when the minimap slider is shown.`)},"editor.minimap.scale":{type:`number`,default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:b(386,`Scale of content drawn in the minimap: 1, 2 or 3.`)},"editor.minimap.renderCharacters":{type:`boolean`,default:e.renderCharacters,description:b(387,`Render the actual characters on a line as opposed to color blocks.`)},"editor.minimap.maxColumn":{type:`number`,default:e.maxColumn,description:b(388,`Limit the width of the minimap to render at most a certain number of columns.`)},"editor.minimap.showRegionSectionHeaders":{type:`boolean`,default:e.showRegionSectionHeaders,description:b(389,`Controls whether named regions are shown as section headers in the minimap.`)},"editor.minimap.showMarkSectionHeaders":{type:`boolean`,default:e.showMarkSectionHeaders,description:b(390,`Controls whether MARK: comments are shown as section headers in the minimap.`)},"editor.minimap.markSectionHeaderRegex":{type:`string`,default:e.markSectionHeaderRegex,description:b(391,"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:b(392,`Controls the font size of section headers in the minimap.`)},"editor.minimap.sectionHeaderLetterSpacing":{type:`number`,default:e.sectionHeaderLetterSpacing,description:b(393,`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;let t=e,n=this.defaultValue.markSectionHeaderRegex,r=t.markSectionHeaderRegex;if(typeof r==`string`)try{new RegExp(r,`d`),n=r}catch{}return{enabled:I(t.enabled,this.defaultValue.enabled),autohide:vf(t.autohide,this.defaultValue.autohide,[`none`,`mouseover`,`scroll`]),size:vf(t.size,this.defaultValue.size,[`proportional`,`fill`,`fit`]),side:vf(t.side,this.defaultValue.side,[`right`,`left`]),showSlider:vf(t.showSlider,this.defaultValue.showSlider,[`always`,`mouseover`]),renderCharacters:I(t.renderCharacters,this.defaultValue.renderCharacters),scale:hf.clampedInt(t.scale,1,1,3),maxColumn:hf.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4),showRegionSectionHeaders:I(t.showRegionSectionHeaders,this.defaultValue.showRegionSectionHeaders),showMarkSectionHeaders:I(t.showMarkSectionHeaders,this.defaultValue.showMarkSectionHeaders),markSectionHeaderRegex:n,sectionHeaderFontSize:gf.clamp(gf.float(t.sectionHeaderFontSize,this.defaultValue.sectionHeaderFontSize),4,32),sectionHeaderLetterSpacing:gf.clamp(gf.float(t.sectionHeaderLetterSpacing,this.defaultValue.sectionHeaderLetterSpacing),0,5)}}};function Zf(e){return e===`ctrlCmd`?En?`metaKey`:`ctrlKey`:`altKey`}var Qf=class extends lf{constructor(){super(z.padding,`padding`,{top:0,bottom:0},{"editor.padding.top":{type:`number`,default:0,minimum:0,maximum:1e3,description:b(394,`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:b(395,`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;let t=e;return{top:hf.clampedInt(t.top,0,0,1e3),bottom:hf.clampedInt(t.bottom,0,0,1e3)}}},$f=class extends lf{constructor(){let e={enabled:!0,cycle:!0};super(z.parameterHints,`parameterHints`,e,{"editor.parameterHints.enabled":{type:`boolean`,default:e.enabled,description:b(396,`Enables a pop-up that shows parameter documentation and type information as you type.`)},"editor.parameterHints.cycle":{type:`boolean`,default:e.cycle,description:b(397,`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;let t=e;return{enabled:I(t.enabled,this.defaultValue.enabled),cycle:I(t.cycle,this.defaultValue.cycle)}}},ep=class extends ff{constructor(){super(z.pixelRatio,1)}compute(e,t,n){return e.pixelRatio}},tp=class extends lf{constructor(){super(z.placeholder,`placeholder`,void 0)}validate(e){return e===void 0?this.defaultValue:typeof e==`string`?e:this.defaultValue}},np=class extends lf{constructor(){let e={other:`offWhenInlineCompletions`,comments:`off`,strings:`off`},t=[{type:`boolean`},{type:`string`,enum:[`on`,`inline`,`off`,`offWhenInlineCompletions`],enumDescriptions:[b(398,`Quick suggestions show inside the suggest widget`),b(399,`Quick suggestions show as ghost text`),b(400,`Quick suggestions are disabled`),b(401,`Quick suggestions are disabled when inline completions are showing`)]}];super(z.quickSuggestions,`quickSuggestions`,e,{anyOf:[{type:`boolean`},{type:`string`,enum:[`on`,`inline`,`off`,`offWhenInlineCompletions`],enumDescriptions:[b(402,`Quick suggestions are enabled for all token types`),b(403,`Quick suggestions show as ghost text for all token types`),b(404,`Quick suggestions are disabled for all token types`),b(405,`Quick suggestions are disabled for all token types when inline completions are showing`)]},{type:`object`,additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:b(406,`Enable quick suggestions inside strings.`)},comments:{anyOf:t,default:e.comments,description:b(407,`Enable quick suggestions inside comments.`)},other:{anyOf:t,default:e.other,description:b(408,`Enable quick suggestions outside of strings and comments.`)}}}],default:e,markdownDescription:b(409,`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#`"),experiment:{mode:`auto`}}),this.defaultValue=e}validate(e){if(typeof e==`boolean`){let t=e?`on`:`off`;return{comments:t,strings:t,other:t}}if(typeof e==`string`){let t=vf(e,this.defaultValue.other,[`on`,`inline`,`off`,`offWhenInlineCompletions`]);return{comments:t,strings:t,other:t}}if(!e||typeof e!=`object`)return this.defaultValue;let{other:t,comments:n,strings:r}=e,i=[`on`,`inline`,`off`,`offWhenInlineCompletions`],a,o,s;return a=typeof t==`boolean`?t?`on`:`off`:vf(t,this.defaultValue.other,i),o=typeof n==`boolean`?n?`on`:`off`:vf(n,this.defaultValue.comments,i),s=typeof r==`boolean`?r?`on`:`off`:vf(r,this.defaultValue.strings,i),{other:a,comments:o,strings:s}}},rp;(function(e){e[e.Off=0]=`Off`,e[e.On=1]=`On`,e[e.Relative=2]=`Relative`,e[e.Interval=3]=`Interval`,e[e.Custom=4]=`Custom`})(rp||={});var ip=class extends lf{constructor(){super(z.lineNumbers,`lineNumbers`,{renderType:rp.On,renderFn:null},{type:`string`,enum:[`off`,`on`,`relative`,`interval`],enumDescriptions:[b(410,`Line numbers are not rendered.`),b(411,`Line numbers are rendered as absolute number.`),b(412,`Line numbers are rendered as distance in lines to cursor position.`),b(413,`Line numbers are rendered every 10 lines.`)],default:`on`,description:b(414,`Controls the display of line numbers.`)})}validate(e){let t=this.defaultValue.renderType,n=this.defaultValue.renderFn;return e!==void 0&&(typeof e==`function`?(t=rp.Custom,n=e):t=e===`interval`?rp.Interval:e===`relative`?rp.Relative:e===`on`?rp.On:rp.Off),{renderType:t,renderFn:n}}},ap=class extends lf{constructor(){let e=[],t={type:`number`,description:b(415,`Number of monospace characters at which this editor ruler will render.`)};super(z.rulers,`rulers`,e,{type:`array`,items:{anyOf:[t,{type:[`object`],properties:{column:t,color:{type:`string`,description:b(416,`Color of this editor ruler.`),format:`color-hex`}}}]},default:e,description:b(417,`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)){let t=[];for(let n of e)if(typeof n==`number`)t.push({column:hf.clampedInt(n,0,0,1e4),color:null});else if(n&&typeof n==`object`){let e=n;t.push({column:hf.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort((e,t)=>e.column-t.column),t}return this.defaultValue}},op=class extends lf{constructor(){super(z.readOnlyMessage,`readOnlyMessage`,void 0)}validate(e){return!e||typeof e!=`object`?this.defaultValue:e}};function sp(e,t){if(typeof e!=`string`)return t;switch(e){case`hidden`:return rd.Hidden;case`visible`:return rd.Visible;default:return rd.Auto}}var cp=class extends lf{constructor(){let e={vertical:rd.Auto,horizontal:rd.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(z.scrollbar,`scrollbar`,e,{"editor.scrollbar.vertical":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[b(418,`The vertical scrollbar will be visible only when necessary.`),b(419,`The vertical scrollbar will always be visible.`),b(420,`The vertical scrollbar will always be hidden.`)],default:`auto`,description:b(421,`Controls the visibility of the vertical scrollbar.`)},"editor.scrollbar.horizontal":{type:`string`,enum:[`auto`,`visible`,`hidden`],enumDescriptions:[b(422,`The horizontal scrollbar will be visible only when necessary.`),b(423,`The horizontal scrollbar will always be visible.`),b(424,`The horizontal scrollbar will always be hidden.`)],default:`auto`,description:b(425,`Controls the visibility of the horizontal scrollbar.`)},"editor.scrollbar.verticalScrollbarSize":{type:`number`,default:e.verticalScrollbarSize,description:b(426,`The width of the vertical scrollbar.`)},"editor.scrollbar.horizontalScrollbarSize":{type:`number`,default:e.horizontalScrollbarSize,description:b(427,`The height of the horizontal scrollbar.`)},"editor.scrollbar.scrollByPage":{type:`boolean`,default:e.scrollByPage,description:b(428,`Controls whether clicks scroll by page or jump to click position.`)},"editor.scrollbar.ignoreHorizontalScrollbarInContentHeight":{type:`boolean`,default:e.ignoreHorizontalScrollbarInContentHeight,description:b(429,`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;let t=e,n=hf.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),r=hf.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:hf.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:sp(t.vertical,this.defaultValue.vertical),horizontal:sp(t.horizontal,this.defaultValue.horizontal),useShadows:I(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:I(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:I(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:I(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:I(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:n,horizontalSliderSize:hf.clampedInt(t.horizontalSliderSize,n,0,1e3),verticalScrollbarSize:r,verticalSliderSize:hf.clampedInt(t.verticalSliderSize,r,0,1e3),scrollByPage:I(t.scrollByPage,this.defaultValue.scrollByPage),ignoreHorizontalScrollbarInContentHeight:I(t.ignoreHorizontalScrollbarInContentHeight,this.defaultValue.ignoreHorizontalScrollbarInContentHeight)}}};const lp=`inUntrustedWorkspace`,up={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`};var dp=class extends lf{constructor(){let e={nonBasicASCII:lp,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:lp,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(z.unicodeHighlighting,`unicodeHighlight`,e,{[up.nonBasicASCII]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,lp],default:e.nonBasicASCII,description:b(430,`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.`)},[up.invisibleCharacters]:{restricted:!0,type:`boolean`,default:e.invisibleCharacters,description:b(431,`Controls whether characters that just reserve space or have no width at all are highlighted.`)},[up.ambiguousCharacters]:{restricted:!0,type:`boolean`,default:e.ambiguousCharacters,description:b(432,`Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.`)},[up.includeComments]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,lp],default:e.includeComments,description:b(433,`Controls whether characters in comments should also be subject to Unicode highlighting.`)},[up.includeStrings]:{restricted:!0,type:[`boolean`,`string`],enum:[!0,!1,lp],default:e.includeStrings,description:b(434,`Controls whether characters in strings should also be subject to Unicode highlighting.`)},[up.allowedCharacters]:{restricted:!0,type:`object`,default:e.allowedCharacters,description:b(435,`Defines allowed characters that are not being highlighted.`),additionalProperties:{type:`boolean`}},[up.allowedLocales]:{restricted:!0,type:`object`,additionalProperties:{type:`boolean`},default:e.allowedLocales,description:b(436,`Unicode characters that are common in allowed locales are not being highlighted.`)}})}applyUpdate(e,t){let n=!1;t.allowedCharacters&&e&&(pc(e.allowedCharacters,t.allowedCharacters)||(e={...e,allowedCharacters:t.allowedCharacters},n=!0)),t.allowedLocales&&e&&(pc(e.allowedLocales,t.allowedLocales)||(e={...e,allowedLocales:t.allowedLocales},n=!0));let r=super.applyUpdate(e,t);return n?new uf(r.newValue,!0):r}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{nonBasicASCII:hp(t.nonBasicASCII,lp,[!0,!1,lp]),invisibleCharacters:I(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:I(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:hp(t.includeComments,lp,[!0,!1,lp]),includeStrings:hp(t.includeStrings,lp,[!0,!1,lp]),allowedCharacters:this.validateBooleanMap(t.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(t.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if(typeof e!=`object`||!e)return t;let n={};for(let[t,r]of Object.entries(e))r===!0&&(n[t]=!0);return n}},fp=class extends lf{constructor(){let e={enabled:!0,mode:`subwordSmart`,showToolbar:`onHover`,suppressSuggestions:!1,keepOnBlur:!1,fontFamily:`default`,syntaxHighlightingEnabled:!0,minShowDelay:0,suppressInSnippetMode:!0,edits:{enabled:!0,showCollapsed:!1,renderSideBySide:`auto`,allowCodeShifting:`always`,showLongDistanceHint:!0},triggerCommandOnProviderChange:!1,experimental:{suppressInlineSuggestions:``,showOnSuggestConflict:`never`,emptyResponseInformation:!0}};super(z.inlineSuggest,`inlineSuggest`,e,{"editor.inlineSuggest.enabled":{type:`boolean`,default:e.enabled,description:b(437,`Controls whether to automatically show inline suggestions in the editor.`)},"editor.inlineSuggest.showToolbar":{type:`string`,default:e.showToolbar,enum:[`always`,`onHover`,`never`],enumDescriptions:[b(438,`Show the inline suggestion toolbar whenever an inline suggestion is shown.`),b(439,`Show the inline suggestion toolbar when hovering over an inline suggestion.`),b(440,`Never show the inline suggestion toolbar.`)],description:b(441,`Controls when to show the inline suggestion toolbar.`)},"editor.inlineSuggest.syntaxHighlightingEnabled":{type:`boolean`,default:e.syntaxHighlightingEnabled,description:b(442,`Controls whether to show syntax highlighting for inline suggestions in the editor.`)},"editor.inlineSuggest.suppressSuggestions":{type:`boolean`,default:e.suppressSuggestions,description:b(443,`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.suppressInSnippetMode":{type:`boolean`,default:e.suppressInSnippetMode,description:b(444,`Controls whether inline suggestions are suppressed when in snippet mode.`)},"editor.inlineSuggest.minShowDelay":{type:`number`,default:0,minimum:0,maximum:1e4,description:b(445,`Controls the minimal delay in milliseconds after which inline suggestions are shown after typing.`)},"editor.inlineSuggest.experimental.suppressInlineSuggestions":{type:`string`,default:e.experimental.suppressInlineSuggestions,tags:[`experimental`],description:b(446,`Suppresses inline completions for specified extension IDs -- comma separated.`),experiment:{mode:`auto`}},"editor.inlineSuggest.experimental.emptyResponseInformation":{type:`boolean`,default:e.experimental.emptyResponseInformation,tags:[`experimental`],description:b(447,`Controls whether to send request information from the inline suggestion provider.`),experiment:{mode:`auto`}},"editor.inlineSuggest.triggerCommandOnProviderChange":{type:`boolean`,default:e.triggerCommandOnProviderChange,tags:[`experimental`],description:b(448,`Controls whether to trigger a command when the inline suggestion provider changes.`),experiment:{mode:`auto`}},"editor.inlineSuggest.experimental.showOnSuggestConflict":{type:`string`,default:e.experimental.showOnSuggestConflict,tags:[`experimental`],enum:[`always`,`never`,`whenSuggestListIsIncomplete`],description:b(449,`Controls whether to show inline suggestions when there is a suggest conflict.`),experiment:{mode:`auto`}},"editor.inlineSuggest.fontFamily":{type:`string`,default:e.fontFamily,description:b(450,`Controls the font family of the inline suggestions.`)},"editor.inlineSuggest.edits.allowCodeShifting":{type:`string`,default:e.edits.allowCodeShifting,description:b(451,`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.showLongDistanceHint":{type:`boolean`,default:e.edits.showLongDistanceHint,description:b(452,`Controls whether long distance inline suggestions are shown.`),tags:[`nextEditSuggestions`,`experimental`]},"editor.inlineSuggest.edits.renderSideBySide":{type:`string`,default:e.edits.renderSideBySide,description:b(453,`Controls whether larger suggestions can be shown side by side.`),enum:[`auto`,`never`],enumDescriptions:[b(454,`Larger suggestions will show side by side if there is enough space, otherwise they will be shown below.`),b(455,`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:b(456,`Controls whether the suggestion will show as collapsed until jumping to it.`),tags:[`nextEditSuggestions`]}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:I(t.enabled,this.defaultValue.enabled),mode:vf(t.mode,this.defaultValue.mode,[`prefix`,`subword`,`subwordSmart`]),showToolbar:vf(t.showToolbar,this.defaultValue.showToolbar,[`always`,`onHover`,`never`]),suppressSuggestions:I(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:I(t.keepOnBlur,this.defaultValue.keepOnBlur),fontFamily:_f.string(t.fontFamily,this.defaultValue.fontFamily),syntaxHighlightingEnabled:I(t.syntaxHighlightingEnabled,this.defaultValue.syntaxHighlightingEnabled),minShowDelay:hf.clampedInt(t.minShowDelay,0,0,1e4),suppressInSnippetMode:I(t.suppressInSnippetMode,this.defaultValue.suppressInSnippetMode),edits:this._validateEdits(t.edits),triggerCommandOnProviderChange:I(t.triggerCommandOnProviderChange,this.defaultValue.triggerCommandOnProviderChange),experimental:this._validateExperimental(t.experimental)}}_validateEdits(e){if(!e||typeof e!=`object`)return this.defaultValue.edits;let t=e;return{enabled:I(t.enabled,this.defaultValue.edits.enabled),showCollapsed:I(t.showCollapsed,this.defaultValue.edits.showCollapsed),allowCodeShifting:vf(t.allowCodeShifting,this.defaultValue.edits.allowCodeShifting,[`always`,`horizontal`,`never`]),showLongDistanceHint:I(t.showLongDistanceHint,this.defaultValue.edits.showLongDistanceHint),renderSideBySide:vf(t.renderSideBySide,this.defaultValue.edits.renderSideBySide,[`never`,`auto`])}}_validateExperimental(e){if(!e||typeof e!=`object`)return this.defaultValue.experimental;let t=e;return{suppressInlineSuggestions:_f.string(t.suppressInlineSuggestions,this.defaultValue.experimental.suppressInlineSuggestions),showOnSuggestConflict:vf(t.showOnSuggestConflict,this.defaultValue.experimental.showOnSuggestConflict,[`always`,`never`,`whenSuggestListIsIncomplete`]),emptyResponseInformation:I(t.emptyResponseInformation,this.defaultValue.experimental.emptyResponseInformation)}}},pp=class extends lf{constructor(){let e={enabled:ud.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:ud.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(z.bracketPairColorization,`bracketPairColorization`,e,{"editor.bracketPairColorization.enabled":{type:`boolean`,default:e.enabled,markdownDescription:b(457,`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:b(458,`Controls whether each bracket type has its own independent color pool.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{enabled:I(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:I(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}},mp=class extends lf{constructor(){let e={bracketPairs:!1,bracketPairsHorizontal:`active`,highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(z.guides,`guides`,e,{"editor.guides.bracketPairs":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[b(459,`Enables bracket pair guides.`),b(460,`Enables bracket pair guides only for the active bracket pair.`),b(461,`Disables bracket pair guides.`)],default:e.bracketPairs,description:b(462,`Controls whether bracket pair guides are enabled or not.`)},"editor.guides.bracketPairsHorizontal":{type:[`boolean`,`string`],enum:[!0,`active`,!1],enumDescriptions:[b(463,`Enables horizontal guides as addition to vertical bracket pair guides.`),b(464,`Enables horizontal guides only for the active bracket pair.`),b(465,`Disables horizontal bracket pair guides.`)],default:e.bracketPairsHorizontal,description:b(466,`Controls whether horizontal bracket pair guides are enabled or not.`)},"editor.guides.highlightActiveBracketPair":{type:`boolean`,default:e.highlightActiveBracketPair,description:b(467,`Controls whether the editor should highlight the active bracket pair.`)},"editor.guides.indentation":{type:`boolean`,default:e.indentation,description:b(468,`Controls whether the editor should render indent guides.`)},"editor.guides.highlightActiveIndentation":{type:[`boolean`,`string`],enum:[!0,`always`,!1],enumDescriptions:[b(469,`Highlights the active indent guide.`),b(470,`Highlights the active indent guide even if bracket guides are highlighted.`),b(471,`Do not highlight the active indent guide.`)],default:e.highlightActiveIndentation,description:b(472,`Controls whether the editor should highlight the active indent guide.`)}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{bracketPairs:hp(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,`active`]),bracketPairsHorizontal:hp(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,`active`]),highlightActiveBracketPair:I(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:I(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:hp(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,`always`])}}};function hp(e,t,n){let r=n.indexOf(e);return r===-1?t:n[r]}var gp=class extends lf{constructor(){let 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(z.suggest,`suggest`,e,{"editor.suggest.insertMode":{type:`string`,enum:[`insert`,`replace`],enumDescriptions:[b(473,`Insert suggestion without overwriting text right of the cursor.`),b(474,`Insert suggestion and overwrite text right of the cursor.`)],default:e.insertMode,description:b(475,`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:b(476,`Controls whether filtering and sorting suggestions accounts for small typos.`)},"editor.suggest.localityBonus":{type:`boolean`,default:e.localityBonus,description:b(477,`Controls whether sorting favors words that appear close to the cursor.`)},"editor.suggest.shareSuggestSelections":{type:`boolean`,default:e.shareSuggestSelections,markdownDescription:b(478,"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:[b(479,`Always select a suggestion when automatically triggering IntelliSense.`),b(480,`Never select a suggestion when automatically triggering IntelliSense.`),b(481,`Select a suggestion only when triggering IntelliSense from a trigger character.`),b(482,`Select a suggestion only when triggering IntelliSense as you type.`)],default:e.selectionMode,markdownDescription:b(483,"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:b(484,`Controls whether an active snippet prevents quick suggestions.`)},"editor.suggest.showIcons":{type:`boolean`,default:e.showIcons,description:b(485,`Controls whether to show or hide icons in suggestions.`)},"editor.suggest.showStatusBar":{type:`boolean`,default:e.showStatusBar,description:b(486,`Controls the visibility of the status bar at the bottom of the suggest widget.`)},"editor.suggest.preview":{type:`boolean`,default:e.preview,description:b(487,`Controls whether to preview the suggestion outcome in the editor.`)},"editor.suggest.showInlineDetails":{type:`boolean`,default:e.showInlineDetails,description:b(488,`Controls whether suggest details show inline with the label or only in the details widget.`)},"editor.suggest.maxVisibleSuggestions":{type:`number`,deprecationMessage:b(489,`This setting is deprecated. The suggest widget can now be resized.`)},"editor.suggest.filteredTypes":{type:`object`,deprecationMessage:b(490,`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:b(491,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:`boolean`,default:!0,markdownDescription:b(492,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:`boolean`,default:!0,markdownDescription:b(493,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:`boolean`,default:!0,markdownDescription:b(494,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:`boolean`,default:!0,markdownDescription:b(495,"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:b(496,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:`boolean`,default:!0,markdownDescription:b(497,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:`boolean`,default:!0,markdownDescription:b(498,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:`boolean`,default:!0,markdownDescription:b(499,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:`boolean`,default:!0,markdownDescription:b(500,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:`boolean`,default:!0,markdownDescription:b(501,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:`boolean`,default:!0,markdownDescription:b(502,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:`boolean`,default:!0,markdownDescription:b(503,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:`boolean`,default:!0,markdownDescription:b(504,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:`boolean`,default:!0,markdownDescription:b(505,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:`boolean`,default:!0,markdownDescription:b(506,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:`boolean`,default:!0,markdownDescription:b(507,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:`boolean`,default:!0,markdownDescription:b(508,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:`boolean`,default:!0,markdownDescription:b(509,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:`boolean`,default:!0,markdownDescription:b(510,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:`boolean`,default:!0,markdownDescription:b(511,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:`boolean`,default:!0,markdownDescription:b(512,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:`boolean`,default:!0,markdownDescription:b(513,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:`boolean`,default:!0,markdownDescription:b(514,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:`boolean`,default:!0,markdownDescription:b(515,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:`boolean`,default:!0,markdownDescription:b(516,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:`boolean`,default:!0,markdownDescription:b(517,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:`boolean`,default:!0,markdownDescription:b(518,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:`boolean`,default:!0,markdownDescription:b(519,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:`boolean`,default:!0,markdownDescription:b(520,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||typeof e!=`object`)return this.defaultValue;let t=e;return{insertMode:vf(t.insertMode,this.defaultValue.insertMode,[`insert`,`replace`]),filterGraceful:I(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:I(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:I(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:I(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:vf(t.selectionMode,this.defaultValue.selectionMode,[`always`,`never`,`whenQuickSuggestion`,`whenTriggerCharacter`]),showIcons:I(t.showIcons,this.defaultValue.showIcons),showStatusBar:I(t.showStatusBar,this.defaultValue.showStatusBar),preview:I(t.preview,this.defaultValue.preview),previewMode:vf(t.previewMode,this.defaultValue.previewMode,[`prefix`,`subword`,`subwordSmart`]),showInlineDetails:I(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:I(t.showMethods,this.defaultValue.showMethods),showFunctions:I(t.showFunctions,this.defaultValue.showFunctions),showConstructors:I(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:I(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:I(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:I(t.showFields,this.defaultValue.showFields),showVariables:I(t.showVariables,this.defaultValue.showVariables),showClasses:I(t.showClasses,this.defaultValue.showClasses),showStructs:I(t.showStructs,this.defaultValue.showStructs),showInterfaces:I(t.showInterfaces,this.defaultValue.showInterfaces),showModules:I(t.showModules,this.defaultValue.showModules),showProperties:I(t.showProperties,this.defaultValue.showProperties),showEvents:I(t.showEvents,this.defaultValue.showEvents),showOperators:I(t.showOperators,this.defaultValue.showOperators),showUnits:I(t.showUnits,this.defaultValue.showUnits),showValues:I(t.showValues,this.defaultValue.showValues),showConstants:I(t.showConstants,this.defaultValue.showConstants),showEnums:I(t.showEnums,this.defaultValue.showEnums),showEnumMembers:I(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:I(t.showKeywords,this.defaultValue.showKeywords),showWords:I(t.showWords,this.defaultValue.showWords),showColors:I(t.showColors,this.defaultValue.showColors),showFiles:I(t.showFiles,this.defaultValue.showFiles),showReferences:I(t.showReferences,this.defaultValue.showReferences),showFolders:I(t.showFolders,this.defaultValue.showFolders),showTypeParameters:I(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:I(t.showSnippets,this.defaultValue.showSnippets),showUsers:I(t.showUsers,this.defaultValue.showUsers),showIssues:I(t.showIssues,this.defaultValue.showIssues)}}},_p=class extends lf{constructor(){super(z.smartSelect,`smartSelect`,{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:b(521,`Whether leading and trailing whitespace should always be selected.`),default:!0,type:`boolean`},"editor.smartSelect.selectSubwords":{description:b(522,`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:I(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:I(e.selectSubwords,this.defaultValue.selectSubwords)}}},vp=class extends lf{constructor(){let e=[];super(z.wordSegmenterLocales,`wordSegmenterLocales`,e,{anyOf:[{type:`string`},{type:`array`,items:{type:`string`}}],description:b(523,`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`},default:e})}validate(e){if(typeof e==`string`&&(e=[e]),Array.isArray(e)){let t=[];for(let n of e)if(typeof n==`string`)try{Intl.Segmenter.supportedLocalesOf(n).length>0&&t.push(n)}catch{}return t}return this.defaultValue}},yp;(function(e){e[e.None=0]=`None`,e[e.Same=1]=`Same`,e[e.Indent=2]=`Indent`,e[e.DeepIndent=3]=`DeepIndent`})(yp||={});var bp=class extends lf{constructor(){super(z.wrappingIndent,`wrappingIndent`,yp.Same,{"editor.wrappingIndent":{type:`string`,enum:[`none`,`same`,`indent`,`deepIndent`],enumDescriptions:[b(524,`No indentation. Wrapped lines begin at column 1.`),b(525,`Wrapped lines get the same indentation as the parent.`),b(526,`Wrapped lines get +1 indentation toward the parent.`),b(527,`Wrapped lines get +2 indentation toward the parent.`)],description:b(528,`Controls the indentation of wrapped lines.`),default:`same`}})}validate(e){switch(e){case`none`:return yp.None;case`same`:return yp.Same;case`indent`:return yp.Indent;case`deepIndent`:return yp.DeepIndent}return yp.Same}compute(e,t,n){return t.get(z.accessibilitySupport)===of.Enabled?yp.None:n}},xp=class extends ff{constructor(){super(z.wrappingInfo,{isDominatedByLongLines:!1,isWordWrapMinified:!1,isViewportWrapping:!1,wrappingColumn:-1})}compute(e,t,n){let r=t.get(z.layoutInfo);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:r.isWordWrapMinified,isViewportWrapping:r.isViewportWrapping,wrappingColumn:r.wrappingColumn}}},Sp=class extends lf{constructor(){let e={enabled:!0,showDropSelector:`afterDrop`};super(z.dropIntoEditor,`dropIntoEditor`,e,{"editor.dropIntoEditor.enabled":{type:`boolean`,default:e.enabled,markdownDescription:b(529,"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:b(530,`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:[b(531,`Show the drop selector widget after a file is dropped into the editor.`),b(532,`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;let t=e;return{enabled:I(t.enabled,this.defaultValue.enabled),showDropSelector:vf(t.showDropSelector,this.defaultValue.showDropSelector,[`afterDrop`,`never`])}}},Cp=class extends lf{constructor(){let e={enabled:!0,showPasteSelector:`afterPaste`};super(z.pasteAs,`pasteAs`,e,{"editor.pasteAs.enabled":{type:`boolean`,default:e.enabled,markdownDescription:b(533,`Controls whether you can paste content in different ways.`)},"editor.pasteAs.showPasteSelector":{type:`string`,markdownDescription:b(534,`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:[b(535,`Show the paste selector widget after content is pasted into the editor.`),b(536,`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;let t=e;return{enabled:I(t.enabled,this.defaultValue.enabled),showPasteSelector:vf(t.showPasteSelector,this.defaultValue.showPasteSelector,[`afterPaste`,`never`])}}};const wp=[];function R(e){return wp[e.id]=e,e}var z;(function(e){e[e.acceptSuggestionOnCommitCharacter=0]=`acceptSuggestionOnCommitCharacter`,e[e.acceptSuggestionOnEnter=1]=`acceptSuggestionOnEnter`,e[e.accessibilitySupport=2]=`accessibilitySupport`,e[e.accessibilityPageSize=3]=`accessibilityPageSize`,e[e.allowOverflow=4]=`allowOverflow`,e[e.allowVariableLineHeights=5]=`allowVariableLineHeights`,e[e.allowVariableFonts=6]=`allowVariableFonts`,e[e.allowVariableFontsInAccessibilityMode=7]=`allowVariableFontsInAccessibilityMode`,e[e.ariaLabel=8]=`ariaLabel`,e[e.ariaRequired=9]=`ariaRequired`,e[e.autoClosingBrackets=10]=`autoClosingBrackets`,e[e.autoClosingComments=11]=`autoClosingComments`,e[e.screenReaderAnnounceInlineSuggestion=12]=`screenReaderAnnounceInlineSuggestion`,e[e.autoClosingDelete=13]=`autoClosingDelete`,e[e.autoClosingOvertype=14]=`autoClosingOvertype`,e[e.autoClosingQuotes=15]=`autoClosingQuotes`,e[e.autoIndent=16]=`autoIndent`,e[e.autoIndentOnPaste=17]=`autoIndentOnPaste`,e[e.autoIndentOnPasteWithinString=18]=`autoIndentOnPasteWithinString`,e[e.automaticLayout=19]=`automaticLayout`,e[e.autoSurround=20]=`autoSurround`,e[e.bracketPairColorization=21]=`bracketPairColorization`,e[e.guides=22]=`guides`,e[e.codeLens=23]=`codeLens`,e[e.codeLensFontFamily=24]=`codeLensFontFamily`,e[e.codeLensFontSize=25]=`codeLensFontSize`,e[e.colorDecorators=26]=`colorDecorators`,e[e.colorDecoratorsLimit=27]=`colorDecoratorsLimit`,e[e.columnSelection=28]=`columnSelection`,e[e.comments=29]=`comments`,e[e.contextmenu=30]=`contextmenu`,e[e.copyWithSyntaxHighlighting=31]=`copyWithSyntaxHighlighting`,e[e.cursorBlinking=32]=`cursorBlinking`,e[e.cursorSmoothCaretAnimation=33]=`cursorSmoothCaretAnimation`,e[e.cursorStyle=34]=`cursorStyle`,e[e.cursorSurroundingLines=35]=`cursorSurroundingLines`,e[e.cursorSurroundingLinesStyle=36]=`cursorSurroundingLinesStyle`,e[e.cursorWidth=37]=`cursorWidth`,e[e.cursorHeight=38]=`cursorHeight`,e[e.disableLayerHinting=39]=`disableLayerHinting`,e[e.disableMonospaceOptimizations=40]=`disableMonospaceOptimizations`,e[e.domReadOnly=41]=`domReadOnly`,e[e.dragAndDrop=42]=`dragAndDrop`,e[e.dropIntoEditor=43]=`dropIntoEditor`,e[e.editContext=44]=`editContext`,e[e.emptySelectionClipboard=45]=`emptySelectionClipboard`,e[e.experimentalGpuAcceleration=46]=`experimentalGpuAcceleration`,e[e.experimentalWhitespaceRendering=47]=`experimentalWhitespaceRendering`,e[e.extraEditorClassName=48]=`extraEditorClassName`,e[e.fastScrollSensitivity=49]=`fastScrollSensitivity`,e[e.find=50]=`find`,e[e.fixedOverflowWidgets=51]=`fixedOverflowWidgets`,e[e.folding=52]=`folding`,e[e.foldingStrategy=53]=`foldingStrategy`,e[e.foldingHighlight=54]=`foldingHighlight`,e[e.foldingImportsByDefault=55]=`foldingImportsByDefault`,e[e.foldingMaximumRegions=56]=`foldingMaximumRegions`,e[e.unfoldOnClickAfterEndOfLine=57]=`unfoldOnClickAfterEndOfLine`,e[e.fontFamily=58]=`fontFamily`,e[e.fontInfo=59]=`fontInfo`,e[e.fontLigatures=60]=`fontLigatures`,e[e.fontSize=61]=`fontSize`,e[e.fontWeight=62]=`fontWeight`,e[e.fontVariations=63]=`fontVariations`,e[e.formatOnPaste=64]=`formatOnPaste`,e[e.formatOnType=65]=`formatOnType`,e[e.glyphMargin=66]=`glyphMargin`,e[e.gotoLocation=67]=`gotoLocation`,e[e.hideCursorInOverviewRuler=68]=`hideCursorInOverviewRuler`,e[e.hover=69]=`hover`,e[e.inDiffEditor=70]=`inDiffEditor`,e[e.inlineSuggest=71]=`inlineSuggest`,e[e.letterSpacing=72]=`letterSpacing`,e[e.lightbulb=73]=`lightbulb`,e[e.lineDecorationsWidth=74]=`lineDecorationsWidth`,e[e.lineHeight=75]=`lineHeight`,e[e.lineNumbers=76]=`lineNumbers`,e[e.lineNumbersMinChars=77]=`lineNumbersMinChars`,e[e.linkedEditing=78]=`linkedEditing`,e[e.links=79]=`links`,e[e.matchBrackets=80]=`matchBrackets`,e[e.minimap=81]=`minimap`,e[e.mouseStyle=82]=`mouseStyle`,e[e.mouseWheelScrollSensitivity=83]=`mouseWheelScrollSensitivity`,e[e.mouseWheelZoom=84]=`mouseWheelZoom`,e[e.multiCursorMergeOverlapping=85]=`multiCursorMergeOverlapping`,e[e.multiCursorModifier=86]=`multiCursorModifier`,e[e.mouseMiddleClickAction=87]=`mouseMiddleClickAction`,e[e.multiCursorPaste=88]=`multiCursorPaste`,e[e.multiCursorLimit=89]=`multiCursorLimit`,e[e.occurrencesHighlight=90]=`occurrencesHighlight`,e[e.occurrencesHighlightDelay=91]=`occurrencesHighlightDelay`,e[e.overtypeCursorStyle=92]=`overtypeCursorStyle`,e[e.overtypeOnPaste=93]=`overtypeOnPaste`,e[e.overviewRulerBorder=94]=`overviewRulerBorder`,e[e.overviewRulerLanes=95]=`overviewRulerLanes`,e[e.padding=96]=`padding`,e[e.pasteAs=97]=`pasteAs`,e[e.parameterHints=98]=`parameterHints`,e[e.peekWidgetDefaultFocus=99]=`peekWidgetDefaultFocus`,e[e.placeholder=100]=`placeholder`,e[e.definitionLinkOpensInPeek=101]=`definitionLinkOpensInPeek`,e[e.quickSuggestions=102]=`quickSuggestions`,e[e.quickSuggestionsDelay=103]=`quickSuggestionsDelay`,e[e.readOnly=104]=`readOnly`,e[e.readOnlyMessage=105]=`readOnlyMessage`,e[e.renameOnType=106]=`renameOnType`,e[e.renderRichScreenReaderContent=107]=`renderRichScreenReaderContent`,e[e.renderControlCharacters=108]=`renderControlCharacters`,e[e.renderFinalNewline=109]=`renderFinalNewline`,e[e.renderLineHighlight=110]=`renderLineHighlight`,e[e.renderLineHighlightOnlyWhenFocus=111]=`renderLineHighlightOnlyWhenFocus`,e[e.renderValidationDecorations=112]=`renderValidationDecorations`,e[e.renderWhitespace=113]=`renderWhitespace`,e[e.revealHorizontalRightPadding=114]=`revealHorizontalRightPadding`,e[e.roundedSelection=115]=`roundedSelection`,e[e.rulers=116]=`rulers`,e[e.scrollbar=117]=`scrollbar`,e[e.scrollBeyondLastColumn=118]=`scrollBeyondLastColumn`,e[e.scrollBeyondLastLine=119]=`scrollBeyondLastLine`,e[e.scrollPredominantAxis=120]=`scrollPredominantAxis`,e[e.selectionClipboard=121]=`selectionClipboard`,e[e.selectionHighlight=122]=`selectionHighlight`,e[e.selectionHighlightMaxLength=123]=`selectionHighlightMaxLength`,e[e.selectionHighlightMultiline=124]=`selectionHighlightMultiline`,e[e.selectOnLineNumbers=125]=`selectOnLineNumbers`,e[e.showFoldingControls=126]=`showFoldingControls`,e[e.showUnused=127]=`showUnused`,e[e.snippetSuggestions=128]=`snippetSuggestions`,e[e.smartSelect=129]=`smartSelect`,e[e.smoothScrolling=130]=`smoothScrolling`,e[e.stickyScroll=131]=`stickyScroll`,e[e.stickyTabStops=132]=`stickyTabStops`,e[e.stopRenderingLineAfter=133]=`stopRenderingLineAfter`,e[e.suggest=134]=`suggest`,e[e.suggestFontSize=135]=`suggestFontSize`,e[e.suggestLineHeight=136]=`suggestLineHeight`,e[e.suggestOnTriggerCharacters=137]=`suggestOnTriggerCharacters`,e[e.suggestSelection=138]=`suggestSelection`,e[e.tabCompletion=139]=`tabCompletion`,e[e.tabIndex=140]=`tabIndex`,e[e.trimWhitespaceOnDelete=141]=`trimWhitespaceOnDelete`,e[e.unicodeHighlighting=142]=`unicodeHighlighting`,e[e.unusualLineTerminators=143]=`unusualLineTerminators`,e[e.useShadowDOM=144]=`useShadowDOM`,e[e.useTabStops=145]=`useTabStops`,e[e.wordBreak=146]=`wordBreak`,e[e.wordSegmenterLocales=147]=`wordSegmenterLocales`,e[e.wordSeparators=148]=`wordSeparators`,e[e.wordWrap=149]=`wordWrap`,e[e.wordWrapBreakAfterCharacters=150]=`wordWrapBreakAfterCharacters`,e[e.wordWrapBreakBeforeCharacters=151]=`wordWrapBreakBeforeCharacters`,e[e.wordWrapColumn=152]=`wordWrapColumn`,e[e.wordWrapOverride1=153]=`wordWrapOverride1`,e[e.wordWrapOverride2=154]=`wordWrapOverride2`,e[e.wrappingIndent=155]=`wrappingIndent`,e[e.wrappingStrategy=156]=`wrappingStrategy`,e[e.showDeprecated=157]=`showDeprecated`,e[e.inertialScroll=158]=`inertialScroll`,e[e.inlayHints=159]=`inlayHints`,e[e.wrapOnEscapedLineFeeds=160]=`wrapOnEscapedLineFeeds`,e[e.effectiveCursorStyle=161]=`effectiveCursorStyle`,e[e.editorClassName=162]=`editorClassName`,e[e.pixelRatio=163]=`pixelRatio`,e[e.tabFocusMode=164]=`tabFocusMode`,e[e.layoutInfo=165]=`layoutInfo`,e[e.wrappingInfo=166]=`wrappingInfo`,e[e.defaultColorDecorators=167]=`defaultColorDecorators`,e[e.colorDecoratorsActivatedOn=168]=`colorDecoratorsActivatedOn`,e[e.inlineCompletionsAccessibilityVerbose=169]=`inlineCompletionsAccessibilityVerbose`,e[e.effectiveEditContext=170]=`effectiveEditContext`,e[e.scrollOnMiddleClick=171]=`scrollOnMiddleClick`,e[e.effectiveAllowVariableFonts=172]=`effectiveAllowVariableFonts`,e[e.doubleClickSelectsBlock=173]=`doubleClickSelectsBlock`})(z||={}),R(new L(z.acceptSuggestionOnCommitCharacter,`acceptSuggestionOnCommitCharacter`,!0,{markdownDescription:b(537,"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.")})),R(new yf(z.acceptSuggestionOnEnter,`acceptSuggestionOnEnter`,`on`,[`on`,`smart`,`off`],{markdownEnumDescriptions:[``,b(538,"Only accept a suggestion with `Enter` when it makes a textual change."),``],markdownDescription:b(539,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),R(new Sf),R(new hf(z.accessibilityPageSize,`accessibilityPageSize`,500,1,Gi.MAX_SAFE_SMALL_INTEGER,{description:b(540,`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`]})),R(new L(z.allowOverflow,`allowOverflow`,!0)),R(new L(z.allowVariableLineHeights,`allowVariableLineHeights`,!0,{description:b(541,`Controls whether to allow using variable line heights in the editor.`)})),R(new L(z.allowVariableFonts,`allowVariableFonts`,!0,{description:b(542,`Controls whether to allow using variable fonts in the editor.`)})),R(new L(z.allowVariableFontsInAccessibilityMode,`allowVariableFontsInAccessibilityMode`,!1,{description:b(543,`Controls whether to allow using variable fonts in the editor in the accessibility mode.`),tags:[`accessibility`]})),R(new _f(z.ariaLabel,`ariaLabel`,b(544,`Editor content`))),R(new L(z.ariaRequired,`ariaRequired`,!1,void 0)),R(new L(z.screenReaderAnnounceInlineSuggestion,`screenReaderAnnounceInlineSuggestion`,!0,{description:b(545,`Control whether inline suggestions are announced by a screen reader.`),tags:[`accessibility`]})),R(new yf(z.autoClosingBrackets,`autoClosingBrackets`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,b(546,`Use language configurations to determine when to autoclose brackets.`),b(547,`Autoclose brackets only when the cursor is to the left of whitespace.`),``],description:b(548,`Controls whether the editor should automatically close brackets after the user adds an opening bracket.`)})),R(new yf(z.autoClosingComments,`autoClosingComments`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,b(549,`Use language configurations to determine when to autoclose comments.`),b(550,`Autoclose comments only when the cursor is to the left of whitespace.`),``],description:b(551,`Controls whether the editor should automatically close comments after the user adds an opening comment.`)})),R(new yf(z.autoClosingDelete,`autoClosingDelete`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,b(552,`Remove adjacent closing quotes or brackets only if they were automatically inserted.`),``],description:b(553,`Controls whether the editor should remove adjacent closing quotes or brackets when deleting.`)})),R(new yf(z.autoClosingOvertype,`autoClosingOvertype`,`auto`,[`always`,`auto`,`never`],{enumDescriptions:[``,b(554,`Type over closing quotes or brackets only if they were automatically inserted.`),``],description:b(555,`Controls whether the editor should type over closing quotes or brackets.`)})),R(new yf(z.autoClosingQuotes,`autoClosingQuotes`,`languageDefined`,[`always`,`languageDefined`,`beforeWhitespace`,`never`],{enumDescriptions:[``,b(556,`Use language configurations to determine when to autoclose quotes.`),b(557,`Autoclose quotes only when the cursor is to the left of whitespace.`),``],description:b(558,`Controls whether the editor should automatically close quotes after the user adds an opening quote.`)})),R(new bf(z.autoIndent,`autoIndent`,sf.Full,`full`,[`none`,`keep`,`brackets`,`advanced`,`full`],xf,{enumDescriptions:[b(559,`The editor will not insert indentation automatically.`),b(560,`The editor will keep the current line's indentation.`),b(561,`The editor will keep the current line's indentation and honor language defined brackets.`),b(562,`The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages.`),b(563,`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:b(564,`Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.`)})),R(new L(z.autoIndentOnPaste,`autoIndentOnPaste`,!1,{description:b(565,`Controls whether the editor should automatically auto-indent the pasted content.`)})),R(new L(z.autoIndentOnPasteWithinString,`autoIndentOnPasteWithinString`,!0,{description:b(566,`Controls whether the editor should automatically auto-indent the pasted content when pasted within a string. This takes effect when autoIndentOnPaste is true.`)})),R(new L(z.automaticLayout,`automaticLayout`,!1)),R(new yf(z.autoSurround,`autoSurround`,`languageDefined`,[`languageDefined`,`quotes`,`brackets`,`never`],{enumDescriptions:[b(567,`Use language configurations to determine when to automatically surround selections.`),b(568,`Surround with quotes but not brackets.`),b(569,`Surround with brackets but not quotes.`),``],description:b(570,`Controls whether the editor should automatically surround selections when typing quotes or brackets.`)})),R(new pp),R(new mp),R(new L(z.stickyTabStops,`stickyTabStops`,!1,{description:b(571,`Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.`)})),R(new L(z.codeLens,`codeLens`,!0,{description:b(572,`Controls whether the editor shows CodeLens.`)})),R(new _f(z.codeLensFontFamily,`codeLensFontFamily`,``,{description:b(573,`Controls the font family for CodeLens.`)})),R(new hf(z.codeLensFontSize,`codeLensFontSize`,0,0,100,{type:`number`,default:0,minimum:0,maximum:100,markdownDescription:b(574,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),R(new L(z.colorDecorators,`colorDecorators`,!0,{description:b(575,`Controls whether the editor should render the inline color decorators and color picker.`)})),R(new yf(z.colorDecoratorsActivatedOn,`colorDecoratorsActivatedOn`,`clickAndHover`,[`clickAndHover`,`hover`,`click`],{enumDescriptions:[b(576,`Make the color picker appear both on click and hover of the color decorator`),b(577,`Make the color picker appear on hover of the color decorator`),b(578,`Make the color picker appear on click of the color decorator`)],description:b(579,`Controls the condition to make a color picker appear from a color decorator.`)})),R(new hf(z.colorDecoratorsLimit,`colorDecoratorsLimit`,500,1,1e6,{markdownDescription:b(580,`Controls the max number of color decorators that can be rendered in an editor at once.`)})),R(new L(z.columnSelection,`columnSelection`,!1,{description:b(581,`Enable that the selection with the mouse and keys is doing column selection.`)})),R(new Cf),R(new L(z.contextmenu,`contextmenu`,!0)),R(new L(z.copyWithSyntaxHighlighting,`copyWithSyntaxHighlighting`,!0,{description:b(582,`Controls whether syntax highlighting should be copied into the clipboard.`)})),R(new bf(z.cursorBlinking,`cursorBlinking`,wf.Blink,`blink`,[`blink`,`smooth`,`phase`,`expand`,`solid`],Tf,{description:b(583,`Control the cursor animation style.`)})),R(new yf(z.cursorSmoothCaretAnimation,`cursorSmoothCaretAnimation`,`off`,[`off`,`explicit`,`on`],{enumDescriptions:[b(584,`Smooth caret animation is disabled.`),b(585,`Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture.`),b(586,`Smooth caret animation is always enabled.`)],description:b(587,`Controls whether the smooth caret animation should be enabled.`)})),R(new bf(z.cursorStyle,`cursorStyle`,Ef.Line,`line`,[`line`,`block`,`underline`,`line-thin`,`block-outline`,`underline-thin`],Df,{description:b(588,`Controls the cursor style in insert input mode.`)})),R(new bf(z.overtypeCursorStyle,`overtypeCursorStyle`,Ef.Block,`block`,[`line`,`block`,`underline`,`line-thin`,`block-outline`,`underline-thin`],Df,{description:b(589,`Controls the cursor style in overtype input mode.`)})),R(new hf(z.cursorSurroundingLines,`cursorSurroundingLines`,0,0,Gi.MAX_SAFE_SMALL_INTEGER,{description:b(590,`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.`)})),R(new yf(z.cursorSurroundingLinesStyle,`cursorSurroundingLinesStyle`,`default`,[`default`,`all`],{enumDescriptions:[b(591,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),b(592,"`cursorSurroundingLines` is enforced always.")],markdownDescription:b(593,"Controls when `#editor.cursorSurroundingLines#` should be enforced.")})),R(new hf(z.cursorWidth,`cursorWidth`,0,0,Gi.MAX_SAFE_SMALL_INTEGER,{markdownDescription:b(594,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),R(new hf(z.cursorHeight,`cursorHeight`,0,0,Gi.MAX_SAFE_SMALL_INTEGER,{markdownDescription:b(595,"Controls the height of the cursor when `#editor.cursorStyle#` is set to `line`. Cursor's max height depends on line height.")})),R(new L(z.disableLayerHinting,`disableLayerHinting`,!1)),R(new L(z.disableMonospaceOptimizations,`disableMonospaceOptimizations`,!1)),R(new L(z.domReadOnly,`domReadOnly`,!1)),R(new L(z.doubleClickSelectsBlock,`doubleClickSelectsBlock`,!0,{description:b(596,`Controls whether double-clicking next to a bracket or quote selects the content inside.`)})),R(new L(z.dragAndDrop,`dragAndDrop`,!0,{description:b(597,`Controls whether the editor should allow moving selections via drag and drop.`)})),R(new kf),R(new Sp),R(new L(z.editContext,`editContext`,!0,{description:b(598,`Sets whether the EditContext API should be used instead of the text area to power input in the editor.`),included:Gn||Jn||On})),R(new L(z.renderRichScreenReaderContent,`renderRichScreenReaderContent`,!1,{markdownDescription:b(599,"Whether to render rich screen reader content when the `#editor.editContext#` setting is enabled.")})),R(new Kf),R(new yf(z.experimentalGpuAcceleration,`experimentalGpuAcceleration`,`off`,[`off`,`on`],{tags:[`experimental`],enumDescriptions:[b(600,`Use regular DOM-based rendering.`),b(601,`Use GPU acceleration.`)],description:b(602,`Controls whether to use the experimental GPU acceleration to render the editor.`)})),R(new yf(z.experimentalWhitespaceRendering,`experimentalWhitespaceRendering`,`svg`,[`svg`,`font`,`off`],{enumDescriptions:[b(603,`Use a new rendering method with svgs.`),b(604,`Use a new rendering method with font characters.`),b(605,`Use the stable rendering method.`)],description:b(606,`Controls whether whitespace is rendered with a new, experimental method.`)})),R(new _f(z.extraEditorClassName,`extraEditorClassName`,``)),R(new gf(z.fastScrollSensitivity,`fastScrollSensitivity`,5,e=>e<=0?5:e,{markdownDescription:b(607,"Scrolling speed multiplier when pressing `Alt`.")})),R(new Af),R(new L(z.fixedOverflowWidgets,`fixedOverflowWidgets`,!1)),R(new L(z.folding,`folding`,!0,{description:b(608,`Controls whether the editor has code folding enabled.`)})),R(new yf(z.foldingStrategy,`foldingStrategy`,`auto`,[`auto`,`indentation`],{enumDescriptions:[b(609,`Use a language-specific folding strategy if available, else the indentation-based one.`),b(610,`Use the indentation-based folding strategy.`)],description:b(611,`Controls the strategy for computing folding ranges.`)})),R(new L(z.foldingHighlight,`foldingHighlight`,!0,{description:b(612,`Controls whether the editor should highlight folded ranges.`)})),R(new L(z.foldingImportsByDefault,`foldingImportsByDefault`,!1,{description:b(613,`Controls whether the editor automatically collapses import ranges.`)})),R(new hf(z.foldingMaximumRegions,`foldingMaximumRegions`,5e3,10,65e3,{description:b(614,`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.`)})),R(new L(z.unfoldOnClickAfterEndOfLine,`unfoldOnClickAfterEndOfLine`,!1,{description:b(615,`Controls whether clicking on the empty content after a folded line will unfold the line.`)})),R(new _f(z.fontFamily,`fontFamily`,ld.fontFamily,{description:b(616,`Controls the font family.`)})),R(new Nf),R(new jf),R(new Lf),R(new Rf),R(new Mf),R(new L(z.formatOnPaste,`formatOnPaste`,!1,{description:b(617,`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.`)})),R(new L(z.formatOnType,`formatOnType`,!1,{description:b(618,`Controls whether the editor should automatically format the line after typing.`)})),R(new L(z.glyphMargin,`glyphMargin`,!0,{description:b(619,`Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.`)})),R(new zf),R(new L(z.hideCursorInOverviewRuler,`hideCursorInOverviewRuler`,!1,{description:b(620,`Controls whether the cursor should be hidden in the overview ruler.`)})),R(new Bf),R(new L(z.inDiffEditor,`inDiffEditor`,!1)),R(new L(z.inertialScroll,`inertialScroll`,!1,{description:b(621,`Make scrolling inertial - mostly useful with touchpad on linux.`)})),R(new gf(z.letterSpacing,`letterSpacing`,ld.letterSpacing,e=>gf.clamp(e,-5,20),{description:b(622,`Controls the letter spacing in pixels.`)})),R(new Gf),R(new Jf),R(new Yf),R(new ip),R(new hf(z.lineNumbersMinChars,`lineNumbersMinChars`,5,1,300)),R(new L(z.linkedEditing,`linkedEditing`,!1,{description:b(623,`Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.`)})),R(new L(z.links,`links`,!0,{description:b(624,`Controls whether the editor should detect links and make them clickable.`)})),R(new yf(z.matchBrackets,`matchBrackets`,`always`,[`always`,`near`,`never`],{description:b(625,`Highlight matching brackets.`)})),R(new Xf),R(new yf(z.mouseStyle,`mouseStyle`,`text`,[`text`,`default`,`copy`])),R(new gf(z.mouseWheelScrollSensitivity,`mouseWheelScrollSensitivity`,1,e=>e===0?1:e,{markdownDescription:b(626,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),R(new L(z.mouseWheelZoom,`mouseWheelZoom`,!1,{markdownDescription:En?b(627,"Zoom the font of the editor when using mouse wheel and holding `Cmd`."):b(628,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),R(new L(z.multiCursorMergeOverlapping,`multiCursorMergeOverlapping`,!0,{description:b(629,`Merge multiple cursors when they are overlapping.`)})),R(new bf(z.multiCursorModifier,`multiCursorModifier`,`altKey`,`alt`,[`ctrlCmd`,`alt`],Zf,{markdownEnumDescriptions:[b(630,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),b(631,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:b(632,`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).`)})),R(new yf(z.mouseMiddleClickAction,`mouseMiddleClickAction`,`default`,[`default`,`openLink`,`ctrlLeftClick`],{description:b(633,`Controls what happens when middle mouse button is clicked in the editor.`)})),R(new yf(z.multiCursorPaste,`multiCursorPaste`,`spread`,[`spread`,`full`],{markdownEnumDescriptions:[b(634,`Each cursor pastes a single line of the text.`),b(635,`Each cursor pastes the full text.`)],markdownDescription:b(636,`Controls pasting when the line count of the pasted text matches the cursor count.`)})),R(new hf(z.multiCursorLimit,`multiCursorLimit`,1e4,1,1e5,{markdownDescription:b(637,`Controls the max number of cursors that can be in an active editor at once.`)})),R(new yf(z.occurrencesHighlight,`occurrencesHighlight`,`singleFile`,[`off`,`singleFile`,`multiFile`],{markdownEnumDescriptions:[b(638,`Does not highlight occurrences.`),b(639,`Highlights occurrences only in the current file.`),b(640,`Experimental: Highlights occurrences across all valid open files.`)],markdownDescription:b(641,`Controls whether occurrences should be highlighted across open files.`)})),R(new hf(z.occurrencesHighlightDelay,`occurrencesHighlightDelay`,0,0,2e3,{description:b(642,`Controls the delay in milliseconds after which occurrences are highlighted.`),tags:[`preview`]})),R(new L(z.overtypeOnPaste,`overtypeOnPaste`,!0,{description:b(643,`Controls whether pasting should overtype.`)})),R(new L(z.overviewRulerBorder,`overviewRulerBorder`,!0,{description:b(644,`Controls whether a border should be drawn around the overview ruler.`)})),R(new hf(z.overviewRulerLanes,`overviewRulerLanes`,3,0,3)),R(new Qf),R(new Cp),R(new $f),R(new yf(z.peekWidgetDefaultFocus,`peekWidgetDefaultFocus`,`tree`,[`tree`,`editor`],{enumDescriptions:[b(645,`Focus the tree when opening peek`),b(646,`Focus the editor when opening peek`)],description:b(647,`Controls whether to focus the inline editor or the tree in the peek widget.`)})),R(new tp),R(new L(z.definitionLinkOpensInPeek,`definitionLinkOpensInPeek`,!1,{description:b(648,`Controls whether the Go to Definition mouse gesture always opens the peek widget.`)})),R(new np),R(new hf(z.quickSuggestionsDelay,`quickSuggestionsDelay`,10,0,Gi.MAX_SAFE_SMALL_INTEGER,{description:b(649,`Controls the delay in milliseconds after which quick suggestions will show up.`),experiment:{mode:`auto`}})),R(new L(z.readOnly,`readOnly`,!1)),R(new op),R(new L(z.renameOnType,`renameOnType`,!1,{description:b(650,`Controls whether the editor auto renames on type.`),markdownDeprecationMessage:b(651,"Deprecated, use `#editor.linkedEditing#` instead.")})),R(new L(z.renderControlCharacters,`renderControlCharacters`,!0,{description:b(652,`Controls whether the editor should render control characters.`),restricted:!0})),R(new yf(z.renderFinalNewline,`renderFinalNewline`,Dn?`dimmed`:`on`,[`off`,`on`,`dimmed`],{description:b(653,`Render last line number when the file ends with a newline.`)})),R(new yf(z.renderLineHighlight,`renderLineHighlight`,`line`,[`none`,`gutter`,`line`,`all`],{enumDescriptions:[``,``,``,b(654,`Highlights both the gutter and the current line.`)],description:b(655,`Controls how the editor should render the current line highlight.`)})),R(new L(z.renderLineHighlightOnlyWhenFocus,`renderLineHighlightOnlyWhenFocus`,!1,{description:b(656,`Controls if the editor should render the current line highlight only when the editor is focused.`)})),R(new yf(z.renderValidationDecorations,`renderValidationDecorations`,`editable`,[`editable`,`on`,`off`])),R(new yf(z.renderWhitespace,`renderWhitespace`,`selection`,[`none`,`boundary`,`selection`,`trailing`,`all`],{enumDescriptions:[``,b(657,`Render whitespace characters except for single spaces between words.`),b(658,`Render whitespace characters only on selected text.`),b(659,`Render only trailing whitespace characters.`),``],description:b(660,`Controls how the editor should render whitespace characters.`)})),R(new hf(z.revealHorizontalRightPadding,`revealHorizontalRightPadding`,15,0,1e3)),R(new L(z.roundedSelection,`roundedSelection`,!0,{description:b(661,`Controls whether selections should have rounded corners.`)})),R(new ap),R(new cp),R(new hf(z.scrollBeyondLastColumn,`scrollBeyondLastColumn`,4,0,Gi.MAX_SAFE_SMALL_INTEGER,{description:b(662,`Controls the number of extra characters beyond which the editor will scroll horizontally.`)})),R(new L(z.scrollBeyondLastLine,`scrollBeyondLastLine`,!0,{description:b(663,`Controls whether the editor will scroll beyond the last line.`)})),R(new L(z.scrollOnMiddleClick,`scrollOnMiddleClick`,!1,{description:b(664,`Controls whether the editor will scroll when the middle button is pressed.`)})),R(new L(z.scrollPredominantAxis,`scrollPredominantAxis`,!0,{description:b(665,`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.`)})),R(new L(z.selectionClipboard,`selectionClipboard`,!0,{description:b(666,`Controls whether the Linux primary clipboard should be supported.`),included:Dn})),R(new L(z.selectionHighlight,`selectionHighlight`,!0,{description:b(667,`Controls whether the editor should highlight matches similar to the selection.`)})),R(new hf(z.selectionHighlightMaxLength,`selectionHighlightMaxLength`,200,0,Gi.MAX_SAFE_SMALL_INTEGER,{description:b(668,`Controls how many characters can be in the selection before similiar matches are not highlighted. Set to zero for unlimited.`)})),R(new L(z.selectionHighlightMultiline,`selectionHighlightMultiline`,!1,{description:b(669,`Controls whether the editor should highlight selection matches that span multiple lines.`)})),R(new L(z.selectOnLineNumbers,`selectOnLineNumbers`,!0)),R(new yf(z.showFoldingControls,`showFoldingControls`,`mouseover`,[`always`,`never`,`mouseover`],{enumDescriptions:[b(670,`Always show the folding controls.`),b(671,`Never show the folding controls and reduce the gutter size.`),b(672,`Only show the folding controls when the mouse is over the gutter.`)],description:b(673,`Controls when the folding controls on the gutter are shown.`)})),R(new L(z.showUnused,`showUnused`,!0,{description:b(674,`Controls fading out of unused code.`)})),R(new L(z.showDeprecated,`showDeprecated`,!0,{description:b(675,`Controls strikethrough deprecated variables.`)})),R(new qf),R(new yf(z.snippetSuggestions,`snippetSuggestions`,`inline`,[`top`,`bottom`,`inline`,`none`],{enumDescriptions:[b(676,`Show snippet suggestions on top of other suggestions.`),b(677,`Show snippet suggestions below other suggestions.`),b(678,`Show snippets suggestions with other suggestions.`),b(679,`Do not show snippet suggestions.`)],description:b(680,`Controls whether snippets are shown with other suggestions and how they are sorted.`)})),R(new _p),R(new L(z.smoothScrolling,`smoothScrolling`,!1,{description:b(681,`Controls whether the editor will scroll using an animation.`)})),R(new hf(z.stopRenderingLineAfter,`stopRenderingLineAfter`,1e4,-1,Gi.MAX_SAFE_SMALL_INTEGER)),R(new gp),R(new fp),R(new L(z.inlineCompletionsAccessibilityVerbose,`inlineCompletionsAccessibilityVerbose`,!1,{description:b(682,`Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.`)})),R(new hf(z.suggestFontSize,`suggestFontSize`,0,0,1e3,{markdownDescription:b(683,`Font size for the suggest widget. When set to {0}, the value of {1} is used.`,"`0`","`#editor.fontSize#`")})),R(new hf(z.suggestLineHeight,`suggestLineHeight`,0,0,1e3,{markdownDescription:b(684,`Line height for the suggest widget. When set to {0}, the value of {1} is used. The minimum value is 8.`,"`0`","`#editor.lineHeight#`")})),R(new L(z.suggestOnTriggerCharacters,`suggestOnTriggerCharacters`,!0,{description:b(685,`Controls whether suggestions should automatically show up when typing trigger characters.`)})),R(new yf(z.suggestSelection,`suggestSelection`,`first`,[`first`,`recentlyUsed`,`recentlyUsedByPrefix`],{markdownEnumDescriptions:[b(686,`Always select the first suggestion.`),b(687,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),b(688,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:b(689,`Controls how suggestions are pre-selected when showing the suggest list.`)})),R(new yf(z.tabCompletion,`tabCompletion`,`off`,[`on`,`off`,`onlySnippets`],{enumDescriptions:[b(690,`Tab complete will insert the best matching suggestion when pressing tab.`),b(691,`Disable tab completions.`),b(692,`Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.`)],description:b(693,`Enables tab completions.`)})),R(new hf(z.tabIndex,`tabIndex`,0,-1,Gi.MAX_SAFE_SMALL_INTEGER)),R(new L(z.trimWhitespaceOnDelete,`trimWhitespaceOnDelete`,!1,{description:b(694,`Controls whether the editor will also delete the next line's indentation whitespace when deleting a newline.`)})),R(new dp),R(new yf(z.unusualLineTerminators,`unusualLineTerminators`,`prompt`,[`auto`,`off`,`prompt`],{enumDescriptions:[b(695,`Unusual line terminators are automatically removed.`),b(696,`Unusual line terminators are ignored.`),b(697,`Unusual line terminators prompt to be removed.`)],description:b(698,`Remove unusual line terminators that might cause problems.`)})),R(new L(z.useShadowDOM,`useShadowDOM`,!0)),R(new L(z.useTabStops,`useTabStops`,!0,{description:b(699,`Spaces and tabs are inserted and deleted in alignment with tab stops.`)})),R(new yf(z.wordBreak,`wordBreak`,`normal`,[`normal`,`keepAll`],{markdownEnumDescriptions:[b(700,`Use the default line break rule.`),b(701,`Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.`)],description:b(702,`Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.`)})),R(new vp),R(new _f(z.wordSeparators,`wordSeparators`,dd,{description:b(703,`Characters that will be used as word separators when doing word related navigations or operations.`)})),R(new yf(z.wordWrap,`wordWrap`,`off`,[`off`,`on`,`wordWrapColumn`,`bounded`],{markdownEnumDescriptions:[b(704,`Lines will never wrap.`),b(705,`Lines will wrap at the viewport width.`),b(706,"Lines will wrap at `#editor.wordWrapColumn#`."),b(707,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:b(708,`Controls how lines should wrap.`)})),R(new _f(z.wordWrapBreakAfterCharacters,`wordWrapBreakAfterCharacters`,` })]?|/&.,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー”〉》」』】〕)]}」`)),R(new _f(z.wordWrapBreakBeforeCharacters,`wordWrapBreakBeforeCharacters`,`([{‘“〈《「『【〔([{「£¥$£¥++`)),R(new hf(z.wordWrapColumn,`wordWrapColumn`,80,1,Gi.MAX_SAFE_SMALL_INTEGER,{markdownDescription:b(709,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),R(new yf(z.wordWrapOverride1,`wordWrapOverride1`,`inherit`,[`off`,`on`,`inherit`])),R(new yf(z.wordWrapOverride2,`wordWrapOverride2`,`inherit`,[`off`,`on`,`inherit`])),R(new L(z.wrapOnEscapedLineFeeds,`wrapOnEscapedLineFeeds`,!1,{markdownDescription:b(710,'Controls whether literal `\\n` shall trigger a wordWrap when `#editor.wordWrap#` is enabled.\n\nFor example:\n```c\nchar* str="hello\\nworld"\n```\nwill be displayed as\n```c\nchar* str="hello\\n\n world"\n```')})),R(new Pf),R(new Of),R(new yf(z.defaultColorDecorators,`defaultColorDecorators`,`auto`,[`auto`,`always`,`never`],{enumDescriptions:[b(711,`Show default color decorators only when no extension provides colors decorators.`),b(712,`Always show default color decorators.`),b(713,`Never show default color decorators.`)],description:b(714,`Controls whether inline color decorations should be shown using the default document color provider.`)})),R(new ep),R(new L(z.tabFocusMode,`tabFocusMode`,!1,{markdownDescription:b(715,`Controls whether the editor receives tabs or defers them to the workbench for navigation.`)})),R(new Hf),R(new xp),R(new bp),R(new Uf),R(new Ff),R(new If);var Tp=class e{constructor(e,t){this.lineNumber=e,this.column=t}with(t=this.lineNumber,n=this.column){return t===this.lineNumber&&n===this.column?this:new e(t,n)}delta(e=0,t=0){return this.with(Math.max(1,this.lineNumber+e),Math.max(1,this.column+t))}equals(t){return e.equals(this,t)}static equals(e,t){return!e&&!t?!0:!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(t){return e.isBefore(this,t)}static isBefore(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<t.column}isBeforeOrEqual(t){return e.isBeforeOrEqual(this,t)}static isBeforeOrEqual(e,t){return e.lineNumber<t.lineNumber?!0:t.lineNumber<e.lineNumber?!1:e.column<=t.column}static compare(e,t){let n=e.lineNumber|0,r=t.lineNumber|0;return n===r?(e.column|0)-(t.column|0):n-r}clone(){return new e(this.lineNumber,this.column)}toString(){return`(`+this.lineNumber+`,`+this.column+`)`}static lift(t){return new e(t.lineNumber,t.column)}static isIPosition(e){return!!e&&typeof e.lineNumber==`number`&&typeof e.column==`number`}toJSON(){return{lineNumber:this.lineNumber,column:this.column}}},Ep=class e{constructor(e,t,n,r){e>n||e===n&&t>r?(this.startLineNumber=n,this.startColumn=r,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r)}isEmpty(){return e.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(t){return e.containsPosition(this,t)}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(t){return e.containsRange(this,t)}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(t){return e.strictContainsRange(this,t)}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(t){return e.plusRange(this,t)}static plusRange(t,n){let r,i,a,o;return n.startLineNumber<t.startLineNumber?(r=n.startLineNumber,i=n.startColumn):n.startLineNumber===t.startLineNumber?(r=n.startLineNumber,i=Math.min(n.startColumn,t.startColumn)):(r=t.startLineNumber,i=t.startColumn),n.endLineNumber>t.endLineNumber?(a=n.endLineNumber,o=n.endColumn):n.endLineNumber===t.endLineNumber?(a=n.endLineNumber,o=Math.max(n.endColumn,t.endColumn)):(a=t.endLineNumber,o=t.endColumn),new e(r,i,a,o)}intersectRanges(t){return e.intersectRanges(this,t)}static intersectRanges(t,n){let r=t.startLineNumber,i=t.startColumn,a=t.endLineNumber,o=t.endColumn,s=n.startLineNumber,c=n.startColumn,l=n.endLineNumber,u=n.endColumn;return r<s?(r=s,i=c):r===s&&(i=Math.max(i,c)),a>l?(a=l,o=u):a===l&&(o=Math.min(o,u)),r>a||r===a&&i>o?null:new e(r,i,a,o)}equalsRange(t){return e.equalsRange(this,t)}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 e.getEndPosition(this)}static getEndPosition(e){return new Tp(e.endLineNumber,e.endColumn)}getStartPosition(){return e.getStartPosition(this)}static getStartPosition(e){return new Tp(e.startLineNumber,e.startColumn)}toString(){return`[`+this.startLineNumber+`,`+this.startColumn+` -> `+this.endLineNumber+`,`+this.endColumn+`]`}setEndPosition(t,n){return new e(this.startLineNumber,this.startColumn,t,n)}setStartPosition(t,n){return new e(t,n,this.endLineNumber,this.endColumn)}collapseToStart(){return e.collapseToStart(this)}static collapseToStart(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)}collapseToEnd(){return e.collapseToEnd(this)}static collapseToEnd(t){return new e(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)}delta(t){return new e(this.startLineNumber+t,this.startColumn,this.endLineNumber+t,this.endColumn)}isSingleLine(){return this.startLineNumber===this.endLineNumber}static fromPositions(t,n=t){return new e(t.lineNumber,t.column,n.lineNumber,n.column)}static lift(t){return t?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.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){let n=e.startLineNumber|0,r=t.startLineNumber|0;if(n===r){let n=e.startColumn|0,r=t.startColumn|0;if(n===r){let n=e.endLineNumber|0,r=t.endLineNumber|0;return n===r?(e.endColumn|0)-(t.endColumn|0):n-r}return n-r}return n-r}return!!e-+!!t}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}},Dp;(function(e){e[e.Null=0]=`Null`,e[e.PlainText=1]=`PlainText`})(Dp||={});var Op;(function(e){e[e.NotSet=-1]=`NotSet`,e[e.None=0]=`None`,e[e.Italic=1]=`Italic`,e[e.Bold=2]=`Bold`,e[e.Underline=4]=`Underline`,e[e.Strikethrough=8]=`Strikethrough`})(Op||={});var kp;(function(e){e[e.None=0]=`None`,e[e.DefaultForeground=1]=`DefaultForeground`,e[e.DefaultBackground=2]=`DefaultBackground`})(kp||={});var Ap;(function(e){e[e.Other=0]=`Other`,e[e.Comment=1]=`Comment`,e[e.String=2]=`String`,e[e.RegEx=3]=`RegEx`})(Ap||={});var jp;(function(e){e[e.LANGUAGEID_MASK=255]=`LANGUAGEID_MASK`,e[e.TOKEN_TYPE_MASK=768]=`TOKEN_TYPE_MASK`,e[e.BALANCED_BRACKETS_MASK=1024]=`BALANCED_BRACKETS_MASK`,e[e.FONT_STYLE_MASK=30720]=`FONT_STYLE_MASK`,e[e.FOREGROUND_MASK=16744448]=`FOREGROUND_MASK`,e[e.BACKGROUND_MASK=4278190080]=`BACKGROUND_MASK`,e[e.ITALIC_MASK=2048]=`ITALIC_MASK`,e[e.BOLD_MASK=4096]=`BOLD_MASK`,e[e.UNDERLINE_MASK=8192]=`UNDERLINE_MASK`,e[e.STRIKETHROUGH_MASK=16384]=`STRIKETHROUGH_MASK`,e[e.SEMANTIC_USE_ITALIC=1]=`SEMANTIC_USE_ITALIC`,e[e.SEMANTIC_USE_BOLD=2]=`SEMANTIC_USE_BOLD`,e[e.SEMANTIC_USE_UNDERLINE=4]=`SEMANTIC_USE_UNDERLINE`,e[e.SEMANTIC_USE_STRIKETHROUGH=8]=`SEMANTIC_USE_STRIKETHROUGH`,e[e.SEMANTIC_USE_FOREGROUND=16]=`SEMANTIC_USE_FOREGROUND`,e[e.SEMANTIC_USE_BACKGROUND=32]=`SEMANTIC_USE_BACKGROUND`,e[e.LANGUAGEID_OFFSET=0]=`LANGUAGEID_OFFSET`,e[e.TOKEN_TYPE_OFFSET=8]=`TOKEN_TYPE_OFFSET`,e[e.BALANCED_BRACKETS_OFFSET=10]=`BALANCED_BRACKETS_OFFSET`,e[e.FONT_STYLE_OFFSET=11]=`FONT_STYLE_OFFSET`,e[e.FOREGROUND_OFFSET=15]=`FOREGROUND_OFFSET`,e[e.BACKGROUND_OFFSET=24]=`BACKGROUND_OFFSET`})(jp||={});var Mp=class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new x,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]),g(()=>{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();let n=new Np(this,e,t);return this._factories.set(e,n),g(()=>{let t=this._factories.get(e);!t||t!==n||(this._factories.delete(e),t.dispose())})}async getOrCreate(e){let t=this.get(e);if(t)return t;let n=this._factories.get(e);return!n||n.isResolved?null:(await n.resolve(),this.get(e))}isResolved(e){if(this.get(e))return!0;let t=this._factories.get(e);return!!(!t||t.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>kp.DefaultBackground?this._colorMap[kp.DefaultBackground]:null}},Np=class extends v{get isResolved(){return this._isResolved}constructor(e,t,n){super(),this._registry=e,this._languageId=t,this._factory=n,this._isDisposed=!1,this._resolvePromise=null,this._isResolved=!1}dispose(){this._isDisposed=!0,super.dispose()}async resolve(){return this._resolvePromise||=this._create(),this._resolvePromise}async _create(){let e=await this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}},Pp;(function(e){e[e.Increase=0]=`Increase`,e[e.Decrease=1]=`Decrease`})(Pp||={});var B;(function(e){e[e.Method=0]=`Method`,e[e.Function=1]=`Function`,e[e.Constructor=2]=`Constructor`,e[e.Field=3]=`Field`,e[e.Variable=4]=`Variable`,e[e.Class=5]=`Class`,e[e.Struct=6]=`Struct`,e[e.Interface=7]=`Interface`,e[e.Module=8]=`Module`,e[e.Property=9]=`Property`,e[e.Event=10]=`Event`,e[e.Operator=11]=`Operator`,e[e.Unit=12]=`Unit`,e[e.Value=13]=`Value`,e[e.Constant=14]=`Constant`,e[e.Enum=15]=`Enum`,e[e.EnumMember=16]=`EnumMember`,e[e.Keyword=17]=`Keyword`,e[e.Text=18]=`Text`,e[e.Color=19]=`Color`,e[e.File=20]=`File`,e[e.Reference=21]=`Reference`,e[e.Customcolor=22]=`Customcolor`,e[e.Folder=23]=`Folder`,e[e.TypeParameter=24]=`TypeParameter`,e[e.User=25]=`User`,e[e.Issue=26]=`Issue`,e[e.Tool=27]=`Tool`,e[e.Snippet=28]=`Snippet`})(B||={});var Fp;(function(e){let t=new Map;t.set(B.Method,N.symbolMethod),t.set(B.Function,N.symbolFunction),t.set(B.Constructor,N.symbolConstructor),t.set(B.Field,N.symbolField),t.set(B.Variable,N.symbolVariable),t.set(B.Class,N.symbolClass),t.set(B.Struct,N.symbolStruct),t.set(B.Interface,N.symbolInterface),t.set(B.Module,N.symbolModule),t.set(B.Property,N.symbolProperty),t.set(B.Event,N.symbolEvent),t.set(B.Operator,N.symbolOperator),t.set(B.Unit,N.symbolUnit),t.set(B.Value,N.symbolValue),t.set(B.Enum,N.symbolEnum),t.set(B.Constant,N.symbolConstant),t.set(B.Enum,N.symbolEnum),t.set(B.EnumMember,N.symbolEnumMember),t.set(B.Keyword,N.symbolKeyword),t.set(B.Snippet,N.symbolSnippet),t.set(B.Text,N.symbolText),t.set(B.Color,N.symbolColor),t.set(B.File,N.symbolFile),t.set(B.Reference,N.symbolReference),t.set(B.Customcolor,N.symbolCustomColor),t.set(B.Folder,N.symbolFolder),t.set(B.TypeParameter,N.symbolTypeParameter),t.set(B.User,N.account),t.set(B.Issue,N.issues),t.set(B.Tool,N.tools);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for CompletionItemKind `+e),N.symbolProperty),n}e.toIcon=n;function r(e){switch(e){case B.Method:return b(837,`Method`);case B.Function:return b(838,`Function`);case B.Constructor:return b(839,`Constructor`);case B.Field:return b(840,`Field`);case B.Variable:return b(841,`Variable`);case B.Class:return b(842,`Class`);case B.Struct:return b(843,`Struct`);case B.Interface:return b(844,`Interface`);case B.Module:return b(845,`Module`);case B.Property:return b(846,`Property`);case B.Event:return b(847,`Event`);case B.Operator:return b(848,`Operator`);case B.Unit:return b(849,`Unit`);case B.Value:return b(850,`Value`);case B.Constant:return b(851,`Constant`);case B.Enum:return b(852,`Enum`);case B.EnumMember:return b(853,`Enum Member`);case B.Keyword:return b(854,`Keyword`);case B.Text:return b(855,`Text`);case B.Color:return b(856,`Color`);case B.File:return b(857,`File`);case B.Reference:return b(858,`Reference`);case B.Customcolor:return b(859,`Custom Color`);case B.Folder:return b(860,`Folder`);case B.TypeParameter:return b(861,`Type Parameter`);case B.User:return b(862,`User`);case B.Issue:return b(863,`Issue`);case B.Tool:return b(864,`Tool`);case B.Snippet:return b(865,`Snippet`);default:return``}}e.toLabel=r;let i=new Map;i.set(`method`,B.Method),i.set(`function`,B.Function),i.set(`constructor`,B.Constructor),i.set(`field`,B.Field),i.set(`variable`,B.Variable),i.set(`class`,B.Class),i.set(`struct`,B.Struct),i.set(`interface`,B.Interface),i.set(`module`,B.Module),i.set(`property`,B.Property),i.set(`event`,B.Event),i.set(`operator`,B.Operator),i.set(`unit`,B.Unit),i.set(`value`,B.Value),i.set(`constant`,B.Constant),i.set(`enum`,B.Enum),i.set(`enum-member`,B.EnumMember),i.set(`enumMember`,B.EnumMember),i.set(`keyword`,B.Keyword),i.set(`snippet`,B.Snippet),i.set(`text`,B.Text),i.set(`color`,B.Color),i.set(`file`,B.File),i.set(`reference`,B.Reference),i.set(`customcolor`,B.Customcolor),i.set(`folder`,B.Folder),i.set(`type-parameter`,B.TypeParameter),i.set(`typeParameter`,B.TypeParameter),i.set(`account`,B.User),i.set(`issue`,B.Issue),i.set(`tool`,B.Tool);function a(e,t){let n=i.get(e);return n===void 0&&!t&&(n=B.Property),n}e.fromString=a})(Fp||={});var Ip;(function(e){e[e.Deprecated=1]=`Deprecated`})(Ip||={});var Lp;(function(e){e[e.None=0]=`None`,e[e.KeepWhitespace=1]=`KeepWhitespace`,e[e.InsertAsSnippet=4]=`InsertAsSnippet`})(Lp||={});var Rp;(function(e){e[e.Word=0]=`Word`,e[e.Line=1]=`Line`,e[e.Suggest=2]=`Suggest`})(Rp||={});var zp;(function(e){e[e.Invoke=0]=`Invoke`,e[e.TriggerCharacter=1]=`TriggerCharacter`,e[e.TriggerForIncompleteCompletions=2]=`TriggerForIncompleteCompletions`})(zp||={});var Bp;(function(e){e[e.Automatic=0]=`Automatic`,e[e.Explicit=1]=`Explicit`})(Bp||={});var Vp;(function(e){e[e.Code=1]=`Code`,e[e.Label=2]=`Label`})(Vp||={});var Hp;(function(e){e[e.Accepted=0]=`Accepted`,e[e.Rejected=1]=`Rejected`,e[e.Ignored=2]=`Ignored`})(Hp||={});var Up;(function(e){e[e.Invoke=1]=`Invoke`,e[e.Auto=2]=`Auto`})(Up||={});var Wp;(function(e){e[e.Automatic=0]=`Automatic`,e[e.PasteAs=1]=`PasteAs`})(Wp||={});var Gp;(function(e){e[e.Invoke=1]=`Invoke`,e[e.TriggerCharacter=2]=`TriggerCharacter`,e[e.ContentChange=3]=`ContentChange`})(Gp||={});var Kp;(function(e){e[e.Text=0]=`Text`,e[e.Read=1]=`Read`,e[e.Write=2]=`Write`})(Kp||={});function qp(e){return!!e&&C.isUri(e.uri)&&Ep.isIRange(e.range)&&(Ep.isIRange(e.originSelectionRange)||Ep.isIRange(e.targetSelectionRange))}function Jp(e){return!!e&&C.isUri(e.uri)&&Ep.isIRange(e.range)}var V;(function(e){e[e.File=0]=`File`,e[e.Module=1]=`Module`,e[e.Namespace=2]=`Namespace`,e[e.Package=3]=`Package`,e[e.Class=4]=`Class`,e[e.Method=5]=`Method`,e[e.Property=6]=`Property`,e[e.Field=7]=`Field`,e[e.Constructor=8]=`Constructor`,e[e.Enum=9]=`Enum`,e[e.Interface=10]=`Interface`,e[e.Function=11]=`Function`,e[e.Variable=12]=`Variable`,e[e.Constant=13]=`Constant`,e[e.String=14]=`String`,e[e.Number=15]=`Number`,e[e.Boolean=16]=`Boolean`,e[e.Array=17]=`Array`,e[e.Object=18]=`Object`,e[e.Key=19]=`Key`,e[e.Null=20]=`Null`,e[e.EnumMember=21]=`EnumMember`,e[e.Struct=22]=`Struct`,e[e.Event=23]=`Event`,e[e.Operator=24]=`Operator`,e[e.TypeParameter=25]=`TypeParameter`})(V||={}),V.Array,b(866,`array`),V.Boolean,b(867,`boolean`),V.Class,b(868,`class`),V.Constant,b(869,`constant`),V.Constructor,b(870,`constructor`),V.Enum,b(871,`enumeration`),V.EnumMember,b(872,`enumeration member`),V.Event,b(873,`event`),V.Field,b(874,`field`),V.File,b(875,`file`),V.Function,b(876,`function`),V.Interface,b(877,`interface`),V.Key,b(878,`key`),V.Method,b(879,`method`),V.Module,b(880,`module`),V.Namespace,b(881,`namespace`),V.Null,b(882,`null`),V.Number,b(883,`number`),V.Object,b(884,`object`),V.Operator,b(885,`operator`),V.Package,b(886,`package`),V.Property,b(887,`property`),V.String,b(888,`string`),V.Struct,b(889,`struct`),V.TypeParameter,b(890,`type parameter`),V.Variable,b(891,`variable`);var Yp;(function(e){e[e.Deprecated=1]=`Deprecated`})(Yp||={});var Xp;(function(e){let t=new Map;t.set(V.File,N.symbolFile),t.set(V.Module,N.symbolModule),t.set(V.Namespace,N.symbolNamespace),t.set(V.Package,N.symbolPackage),t.set(V.Class,N.symbolClass),t.set(V.Method,N.symbolMethod),t.set(V.Property,N.symbolProperty),t.set(V.Field,N.symbolField),t.set(V.Constructor,N.symbolConstructor),t.set(V.Enum,N.symbolEnum),t.set(V.Interface,N.symbolInterface),t.set(V.Function,N.symbolFunction),t.set(V.Variable,N.symbolVariable),t.set(V.Constant,N.symbolConstant),t.set(V.String,N.symbolString),t.set(V.Number,N.symbolNumber),t.set(V.Boolean,N.symbolBoolean),t.set(V.Array,N.symbolArray),t.set(V.Object,N.symbolObject),t.set(V.Key,N.symbolKey),t.set(V.Null,N.symbolNull),t.set(V.EnumMember,N.symbolEnumMember),t.set(V.Struct,N.symbolStruct),t.set(V.Event,N.symbolEvent),t.set(V.Operator,N.symbolOperator),t.set(V.TypeParameter,N.symbolTypeParameter);function n(e){let n=t.get(e);return n||=(console.info(`No codicon found for SymbolKind `+e),N.symbolProperty),n}e.toIcon=n;let r=new Map;r.set(V.File,B.File),r.set(V.Module,B.Module),r.set(V.Namespace,B.Module),r.set(V.Package,B.Module),r.set(V.Class,B.Class),r.set(V.Method,B.Method),r.set(V.Property,B.Property),r.set(V.Field,B.Field),r.set(V.Constructor,B.Constructor),r.set(V.Enum,B.Enum),r.set(V.Interface,B.Interface),r.set(V.Function,B.Function),r.set(V.Variable,B.Variable),r.set(V.Constant,B.Constant),r.set(V.String,B.Text),r.set(V.Number,B.Value),r.set(V.Boolean,B.Value),r.set(V.Array,B.Value),r.set(V.Object,B.Value),r.set(V.Key,B.Keyword),r.set(V.Null,B.Value),r.set(V.EnumMember,B.EnumMember),r.set(V.Struct,B.Struct),r.set(V.Event,B.Event),r.set(V.Operator,B.Operator),r.set(V.TypeParameter,B.TypeParameter);function i(e){let t=r.get(e);return t===void 0&&(console.info(`No completion kind found for SymbolKind `+e),t=B.File),t}e.toCompletionKind=i})(Xp||={});var Zp=class e{static{this.Comment=new e(`comment`)}static{this.Imports=new e(`imports`)}static{this.Region=new e(`region`)}static fromValue(t){switch(t){case`comment`:return e.Comment;case`imports`:return e.Imports;case`region`:return e.Region}return new e(t)}constructor(e){this.value=e}},Qp;(function(e){e[e.AIGenerated=1]=`AIGenerated`})(Qp||={});var $p;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})($p||={});var em;(function(e){function t(e){return!e||typeof e!=`object`?!1:typeof e.id==`string`&&typeof e.title==`string`}e.is=t})(em||={});var tm;(function(e){e[e.Collapsed=0]=`Collapsed`,e[e.Expanded=1]=`Expanded`})(tm||={});var nm;(function(e){e[e.Unresolved=0]=`Unresolved`,e[e.Resolved=1]=`Resolved`})(nm||={});var rm;(function(e){e[e.Current=0]=`Current`,e[e.Outdated=1]=`Outdated`})(rm||={});var im;(function(e){e[e.Editing=0]=`Editing`,e[e.Preview=1]=`Preview`})(im||={});var am;(function(e){e[e.Published=0]=`Published`,e[e.Draft=1]=`Draft`})(am||={});var om;(function(e){e[e.Type=1]=`Type`,e[e.Parameter=2]=`Parameter`})(om||={}),new Mp;var sm;(function(e){e[e.None=0]=`None`,e[e.Option=1]=`Option`,e[e.Default=2]=`Default`,e[e.Preferred=3]=`Preferred`})(sm||={});var cm;(function(e){e[e.Left=1]=`Left`,e[e.Center=2]=`Center`,e[e.Right=4]=`Right`,e[e.Full=7]=`Full`})(cm||={});var lm;(function(e){e[e.Left=1]=`Left`,e[e.Center=2]=`Center`,e[e.Right=3]=`Right`})(lm||={});var um;(function(e){e[e.Inline=1]=`Inline`,e[e.Gutter=2]=`Gutter`})(um||={});var dm;(function(e){e[e.Normal=1]=`Normal`,e[e.Underlined=2]=`Underlined`})(dm||={});var fm;(function(e){e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`})(fm||={});var pm;(function(e){e[e.Both=0]=`Both`,e[e.Right=1]=`Right`,e[e.Left=2]=`Left`,e[e.None=3]=`None`})(pm||={});var mm;(function(e){e[e.TextDefined=0]=`TextDefined`,e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(mm||={});var hm;(function(e){e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(hm||={});var gm;(function(e){e[e.LF=0]=`LF`,e[e.CRLF=1]=`CRLF`})(gm||={});var _m=class{constructor(e,t){this._findMatchBrand=void 0,this.range=e,this.matches=t}},vm;(function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]=`AlwaysGrowsWhenTypingAtEdges`,e[e.NeverGrowsWhenTypingAtEdges=1]=`NeverGrowsWhenTypingAtEdges`,e[e.GrowsOnlyWhenTypingBefore=2]=`GrowsOnlyWhenTypingBefore`,e[e.GrowsOnlyWhenTypingAfter=3]=`GrowsOnlyWhenTypingAfter`})(vm||={});var ym;(function(e){e[e.Left=0]=`Left`,e[e.Right=1]=`Right`,e[e.None=2]=`None`,e[e.LeftOfInjectedText=3]=`LeftOfInjectedText`,e[e.RightOfInjectedText=4]=`RightOfInjectedText`})(ym||={});var bm;(function(e){e[e.FIRST_LINE_DETECTION_LENGTH_LIMIT=1e3]=`FIRST_LINE_DETECTION_LENGTH_LIMIT`})(bm||={});var xm=class{constructor(e,t,n){this.regex=e,this.wordSeparators=t,this.simpleSearch=n}},Sm=class{constructor(e,t,n){this.reverseEdits=e,this.changes=t,this.trimAutoWhitespaceLineNumbers=n}},Cm;(function(e){e[e.Unnecessary=1]=`Unnecessary`,e[e.Deprecated=2]=`Deprecated`})(Cm||={});var wm;(function(e){e[e.Hint=1]=`Hint`,e[e.Info=2]=`Info`,e[e.Warning=4]=`Warning`,e[e.Error=8]=`Error`})(wm||={}),(function(e){function t(e,t){return t-e}e.compare=t;let n=Object.create(null);n[e.Error]=b(2100,`Error`),n[e.Warning]=b(2101,`Warning`),n[e.Info]=b(2102,`Info`);function r(e){return n[e]||``}e.toString=r;let i=Object.create(null);i[e.Error]=b(2103,`Errors`),i[e.Warning]=b(2104,`Warnings`),i[e.Info]=b(2105,`Infos`);function a(e){return i[e]||``}e.toStringPlural=a;function o(t){switch(t){case Nc.Error:return e.Error;case Nc.Warning:return e.Warning;case Nc.Info:return e.Info;case Nc.Ignore:return e.Hint}}e.fromSeverity=o;function s(t){switch(t){case e.Error:return Nc.Error;case e.Warning:return Nc.Warning;case e.Info:return Nc.Info;case e.Hint:return Nc.Ignore}}e.toSeverity=s})(wm||={});var Tm;(function(e){function t(e){return n(e,!0)}e.makeKey=t;function n(e,t){let n=[``];return e.source?n.push(e.source.replace(`¦`,`\\¦`)):n.push(``),e.code?typeof e.code==`string`?n.push(e.code.replace(`¦`,`\\¦`)):n.push(e.code.value.replace(`¦`,`\\¦`)):n.push(``),e.severity!==void 0&&e.severity!==null?n.push(wm.toString(e.severity)):n.push(``),e.message&&t?n.push(e.message.replace(`¦`,`\\¦`)):n.push(``),e.startLineNumber!==void 0&&e.startLineNumber!==null?n.push(e.startLineNumber.toString()):n.push(``),e.startColumn!==void 0&&e.startColumn!==null?n.push(e.startColumn.toString()):n.push(``),e.endLineNumber!==void 0&&e.endLineNumber!==null?n.push(e.endLineNumber.toString()):n.push(``),e.endColumn!==void 0&&e.endColumn!==null?n.push(e.endColumn.toString()):n.push(``),n.push(``),n.join(`¦`)}e.makeKeyOptionalMessage=n})(Tm||={});const Em=O(`progressService`);O(`editorProgressService`);var Dm;(function(e){e[e.Explorer=1]=`Explorer`,e[e.Scm=3]=`Scm`,e[e.Extensions=5]=`Extensions`,e[e.Window=10]=`Window`,e[e.Notification=15]=`Notification`,e[e.Dialog=20]=`Dialog`})(Dm||={}),Object.freeze({total(){},worked(){},done(){}});var Om=class{static{this.None=Object.freeze({report(){}})}get value(){return this._value}constructor(e){this.callback=e}report(e){this._value=e,this.callback(this._value)}};let km=class extends v{constructor(e,t){super(),this.deferred=new Wo,t.withProgress(e,e=>(this.reporter=e,this.lastStep&&e.report(this.lastStep),this.deferred.p)),this._register(g(()=>this.deferred.complete()))}report(e){this.reporter?this.reporter.report(e):this.lastStep=e}};km=k([A(1,Em)],km);const Am=new class{constructor(){this.data=new Map}add(e,t){Xe(et(e)),Xe(rt(t)),Xe(!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=>{mt(e.dispose)&&e.dispose()}),this.data.clear()}};function jm(e,t){return t&&(e.stack||e.stacktrace)?b(112,`{0}: {1}`,Nm(e),Mm(e.stack)||Mm(e.stacktrace)):Nm(e)}function Mm(e){return Array.isArray(e)?e.join(`
|
|
77
|
+
`):e}function Nm(e){return e.code===`ERR_UNC_HOST_NOT_ALLOWED`?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof e.code==`string`&&typeof e.errno==`number`&&typeof e.syscall==`string`?b(113,`A system error occurred ({0})`,e.message):e.message||b(114,`An unknown error occurred. Please consult the log for more details.`)}function Pm(e=null,t=!1){if(!e)return b(114,`An unknown error occurred. Please consult the log for more details.`);if(Array.isArray(e)){let n=Se(e),r=Pm(n[0],t);return n.length>1?b(115,`{0} ({1} errors in total)`,r,n.length):r}if(et(e))return e;if(e.detail){let n=e.detail;if(n.error)return jm(n.error,t);if(n.exception)return jm(n.exception,t)}return e.stack?jm(e,t):e.message?e.message:b(114,`An unknown error occurred. Please consult the log for more details.`)}var Fm=class extends v{get onDidChange(){return this._onDidChange.event}constructor(e,t=``,n=``,r=!0,i){super(),this._onDidChange=this._register(new x),this._enabled=!0,this._id=e,this._label=t,this._cssClass=n,this._enabled=r,this._actionCallback=i}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)}};(class e{constructor(){this.id=e.ID,this.label=``,this.tooltip=``,this.class=`separator`,this.enabled=!1,this.checked=void 0}static join(...t){let n=[];for(let r of t)r.length&&(n=n.length?[...n,new e,...r]:r);return n}static clean(t){for(;t.length>0&&t[0].id===e.ID;)t.shift();for(;t.length>0&&t[t.length-1].id===e.ID;)t.pop();for(let n=t.length-2;n>=0;n--)t[n].id===e.ID&&t[n+1].id===e.ID&&t.splice(n+1,1);return t}static{this.ID=`vs.actions.separator`}async run(){}});var Im=class{get actions(){return this._actions}constructor(e,t,n,r){this.tooltip=``,this.enabled=!0,this.checked=void 0,this.id=e,this.label=t,this.class=r,this._actions=n}async run(){}};(class e extends Fm{static{this.ID=`vs.actions.empty`}constructor(){super(e.ID,b(47,`(empty)`),void 0,!1)}});const Lm={EditorPane:`workbench.contributions.editors`,EditorFactory:`workbench.contributions.editor.inputFactories`},Rm={id:`default`,displayName:b(4290,`Text Editor`),providerDisplayName:b(4291,`Built-in`)};var zm;(function(e){e[e.PROGRAMMATIC=1]=`PROGRAMMATIC`,e[e.USER=2]=`USER`,e[e.EDIT=3]=`EDIT`,e[e.NAVIGATION=4]=`NAVIGATION`,e[e.JUMP=5]=`JUMP`})(zm||={});var Bm;(function(e){e[e.IDENTICAL=1]=`IDENTICAL`,e[e.SIMILAR=2]=`SIMILAR`,e[e.DIFFERENT=3]=`DIFFERENT`})(Bm||={});function Vm(e){if(Ym(e))return!1;let t=e;return t?.original!==void 0&&t.modified!==void 0}function Hm(e){if(Ym(e))return!1;let t=e;return!t||t.resources&&!Array.isArray(t.resources)?!1:!!t.resources||!!t.multiDiffSource}function Um(e){if(Ym(e)||Vm(e))return!1;let t=e;return t?.primary!==void 0&&t.secondary!==void 0}function Wm(e){if(Ym(e))return!1;let t=e;return C.isUri(t?.base?.resource)&&C.isUri(t?.input1?.resource)&&C.isUri(t?.input2?.resource)&&C.isUri(t?.result?.resource)}var Gm;(function(e){e[e.SHORT=0]=`SHORT`,e[e.MEDIUM=1]=`MEDIUM`,e[e.LONG=2]=`LONG`})(Gm||={});var Km;(function(e){e[e.EXPLICIT=1]=`EXPLICIT`,e[e.AUTO=2]=`AUTO`,e[e.FOCUS_CHANGE=3]=`FOCUS_CHANGE`,e[e.WINDOW_CHANGE=4]=`WINDOW_CHANGE`})(Km||={}),new class{constructor(){this.mapIdToSaveSource=new Map}registerSource(e,t){let n=this.mapIdToSaveSource.get(e);return n||(n={source:e,label:t},this.mapIdToSaveSource.set(e,n)),n.source}getSourceLabel(e){return this.mapIdToSaveSource.get(e)?.label??e}};var qm;(function(e){e[e.None=0]=`None`,e[e.Readonly=2]=`Readonly`,e[e.Untitled=4]=`Untitled`,e[e.Singleton=8]=`Singleton`,e[e.RequiresTrust=16]=`RequiresTrust`,e[e.CanSplitInGroup=32]=`CanSplitInGroup`,e[e.ForceDescription=64]=`ForceDescription`,e[e.CanDropIntoEditor=128]=`CanDropIntoEditor`,e[e.MultipleEditors=256]=`MultipleEditors`,e[e.Scratchpad=512]=`Scratchpad`,e[e.ForceReveal=1024]=`ForceReveal`,e[e.RequiresModal=2048]=`RequiresModal`})(qm||={});var Jm=class extends v{};function Ym(e){return e instanceof Jm}function Xm(e){let t=e;return C.isUri(t?.preferredResource)}function Zm(e){let t=e;return Ym(t?.primary)&&Ym(t?.secondary)}function Qm(e){let t=e;return Ym(t?.modified)&&Ym(t?.original)}var $m;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.REPLACE=1]=`REPLACE`,e[e.MOVE=2]=`MOVE`,e[e.UNPIN=3]=`UNPIN`})($m||={});var eh;(function(e){e[e.GROUP_ACTIVE=0]=`GROUP_ACTIVE`,e[e.GROUP_INDEX=1]=`GROUP_INDEX`,e[e.GROUP_LABEL=2]=`GROUP_LABEL`,e[e.GROUP_LOCKED=3]=`GROUP_LOCKED`,e[e.EDITORS_SELECTION=4]=`EDITORS_SELECTION`,e[e.EDITOR_OPEN=5]=`EDITOR_OPEN`,e[e.EDITOR_CLOSE=6]=`EDITOR_CLOSE`,e[e.EDITOR_MOVE=7]=`EDITOR_MOVE`,e[e.EDITOR_ACTIVE=8]=`EDITOR_ACTIVE`,e[e.EDITOR_LABEL=9]=`EDITOR_LABEL`,e[e.EDITOR_CAPABILITIES=10]=`EDITOR_CAPABILITIES`,e[e.EDITOR_PIN=11]=`EDITOR_PIN`,e[e.EDITOR_TRANSIENT=12]=`EDITOR_TRANSIENT`,e[e.EDITOR_STICKY=13]=`EDITOR_STICKY`,e[e.EDITOR_DIRTY=14]=`EDITOR_DIRTY`,e[e.EDITOR_WILL_DISPOSE=15]=`EDITOR_WILL_DISPOSE`})(eh||={});var th;(function(e){e[e.PRIMARY=1]=`PRIMARY`,e[e.SECONDARY=2]=`SECONDARY`,e[e.BOTH=3]=`BOTH`,e[e.ANY=4]=`ANY`})(th||={});var nh=class{getOriginalUri(e,t){if(!e)return;if(Wm(e))return ih.getOriginalUri(e.result,t);if(t?.supportSideBySide){let{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===th.BOTH)return{primary:this.getOriginalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getOriginalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===th.ANY)return this.getOriginalUri(n,{filterByScheme:t.filterByScheme})??this.getOriginalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===th.PRIMARY?n:r}}if(Vm(e)||Hm(e)||Um(e)||Wm(e))return;let n=Xm(e)?e.preferredResource:e.resource;return!n||!t?.filterByScheme?n:this.filterUri(n,t.filterByScheme)}getSideEditors(e){return Zm(e)||Um(e)?{primary:e.primary,secondary:e.secondary}:Qm(e)||Vm(e)?{primary:e.modified,secondary:e.original}:{primary:void 0,secondary:void 0}}getCanonicalUri(e,t){if(!e)return;if(Wm(e))return ih.getCanonicalUri(e.result,t);if(t?.supportSideBySide){let{primary:n,secondary:r}=this.getSideEditors(e);if(n&&r){if(t?.supportSideBySide===th.BOTH)return{primary:this.getCanonicalUri(n,{filterByScheme:t.filterByScheme}),secondary:this.getCanonicalUri(r,{filterByScheme:t.filterByScheme})};if(t?.supportSideBySide===th.ANY)return this.getCanonicalUri(n,{filterByScheme:t.filterByScheme})??this.getCanonicalUri(r,{filterByScheme:t.filterByScheme});e=t.supportSideBySide===th.PRIMARY?n:r}}if(Vm(e)||Hm(e)||Um(e)||Wm(e))return;let n=e.resource;return!n||!t?.filterByScheme?n:this.filterUri(n,t.filterByScheme)}filterUri(e,t){if(Array.isArray(t)){if(t.some(t=>e.scheme===t))return e}else if(t===e.scheme)return e}},rh;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.KEYBOARD=1]=`KEYBOARD`,e[e.MOUSE=2]=`MOUSE`})(rh||={});const ih=new nh;var ah;(function(e){e[e.LEFT=0]=`LEFT`,e[e.RIGHT=1]=`RIGHT`})(ah||={});var oh=class{constructor(){this.editorSerializerConstructors=new Map,this.editorSerializerInstances=new Map}start(e){let t=this.instantiationService=e.get(As);for(let[e,n]of this.editorSerializerConstructors)this.createEditorSerializer(e,n,t);this.editorSerializerConstructors.clear()}createEditorSerializer(e,t,n){let r=n.createInstance(t);this.editorSerializerInstances.set(e,r)}registerFileEditorFactory(e){if(this.fileEditorFactory)throw Error(`Can only register one file editor factory.`);this.fileEditorFactory=e}getFileEditorFactory(){return dt(this.fileEditorFactory)}registerEditorSerializer(e,t){if(this.editorSerializerConstructors.has(e)||this.editorSerializerInstances.has(e))throw 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),g(()=>{this.editorSerializerConstructors.delete(e),this.editorSerializerInstances.delete(e)})}getEditorSerializer(e){return this.editorSerializerInstances.get(typeof e==`string`?e:e.typeId)}};Am.add(Lm.EditorFactory,new oh);var sh;(function(e){e[e.MOST_RECENTLY_ACTIVE=0]=`MOST_RECENTLY_ACTIVE`,e[e.SEQUENTIAL=1]=`SEQUENTIAL`})(sh||={});var ch;(function(e){e[e.Failed=0]=`Failed`,e[e.Completed=1]=`Completed`,e[e.InProgress=2]=`InProgress`,e[e.NeedsInput=3]=`NeedsInput`})(ch||={});var lh;(function(e){e.CopilotCLI=`copilotcli`,e.CopilotCloud=`copilot-cloud-agent`,e.Local=`local`,e.ClaudeCode=`claude-code`,e.Codex=`openai-codex`,e.Growth=`copilot-growth`,e.AgentHostCopilot=`agent-host-copilotcli`})(lh||={});const uh=lh.Local;var dh;(function(e){function t(e){return new Map(Object.entries(e))}e.fromRecord=t;function n(e){let t=Object.create(null),n=i(e);for(let[e,r]of n)t[e]=r;return t}e.toRecord=n;function r(e){if(!e)return;let t=i(e);return Array.from(t,([e,t])=>({optionId:e,value:typeof t==`string`?t:t.id}))}e.toStrValueArray=r;function i(e){return e instanceof Map?e:Object.entries(e)}})(dh||={});var fh;(function(e){e.scheme=D.vscodeLocalChatSession;function t(t){let n=Xt(y.wrap(new TextEncoder().encode(t)),!1,!0);return C.from({scheme:e.scheme,authority:uh,path:`/`+n})}e.forSession=t;function n(){return t(`chat-${Math.floor(Math.random()*1e9)}`)}e.getNewSessionUri=n;function r(e){let t=a(e);return t?.chatSessionType===uh?t.sessionId:void 0}e.parseLocalSessionId=r;function i(e){return!!r(e)}e.isLocalSession=i;function a(t){if(t.scheme!==e.scheme||!t.authority)return;let n=t.path.split(`/`);if(n.length!==2)return;let r=t.authority,i=Yt(n[1]);return{chatSessionType:r,sessionId:new TextDecoder().decode(i.buffer)}}})(fh||={});function ph(e){return e.scheme===D.vscodeChatEditor?uh:e.scheme===fh.scheme?e.authority||uh:e.scheme}function mh(e){return e.path.startsWith(`/untitled-`)}var hh;(function(e){e[e.NotOmitted=0]=`NotOmitted`,e[e.Partial=1]=`Partial`,e[e.Full=2]=`Full`,e[e.ImageLimitExceeded=3]=`ImageLimitExceeded`})(hh||={});var gh;(function(e){e.icon=N.error;function t(e){return{filterUri:e.resource,owner:e.owner,problemMessage:e.message,filterRange:{startLineNumber:e.startLineNumber,endLineNumber:e.endLineNumber,startColumn:e.startColumn,endColumn:e.endColumn}}}e.fromMarker=t;function n(t){return{id:r(t),name:i(t),icon:e.icon,value:t,kind:`diagnostic`,...t}}e.toEntry=n;function r(e){return[e.filterUri,e.owner,e.filterSeverity,e.filterRange?.startLineNumber,e.filterRange?.startColumn].join(`:`)}e.id=r;function i(e){let t;if((function(e){e[e.MaxChars=30]=`MaxChars`,e[e.MaxSpaceLookback=10]=`MaxSpaceLookback`})(t||={}),e.problemMessage){if(e.problemMessage.length<30)return e.problemMessage;let t=e.problemMessage.lastIndexOf(` `,30);return t===-1||t+10<30?e.problemMessage.substring(0,30)+`…`:e.problemMessage.substring(0,t)+`…`}let n=b(7916,`All Problems`);return e.filterUri&&(n=b(7917,`Problems in {0}`,so(e.filterUri))),n}e.label=i})(gh||={});var _h;(function(e){function t(e){return C.isUri(e.value)?e.value:Jp(e.value)?e.value.uri:void 0}e.toUri=t;function n(e){if(e.value instanceof Uint8Array){let t={...e};return t.value={$base64:Xt(y.wrap(e.value))},t}return e}e.toExport=n;function r(e){if(e&&`values`in e&&Array.isArray(e.values))return{kind:`generic`,id:e.id??``,name:e.name,value:e.values[0]?.value,range:e.range,modelDescription:e.modelDescription,references:e.references};if(e.value&&typeof e.value==`object`&&`$base64`in e.value&&typeof e.value.$base64==`string`){let t={...e};return t.value=Yt(e.value.$base64).buffer,t}return e}e.fromExport=r})(_h||={});function vh(e){return e.kind===`image`}function yh(e){return e.kind===`promptFile`}function bh(e){return e.kind===`promptText`}var xh;(function(e){e.Instruction=`vscode.instructions.file.root`,e.InstructionReference=`vscode.instructions.file.reference`,e.PromptFile=`vscode.prompt.file`})(xh||={});function Sh(e,t,n,r=!1,i){return{id:`${t}__${e.toString()}`,name:`prompt:${so(e)}`,value:e,kind:`promptFile`,modelDescription:`Prompt instructions file`,isRoot:t!==xh.InstructionReference,originLabel:n,toolReferences:i,automaticallyAdded:r}}var Ch;(function(e){e.CustomizationsIndex=`vscode.customizations.index`})(Ch||={});function wh(e,t=!1,n){return{id:Ch.CustomizationsIndex,name:`prompt:customizationsIndex`,value:e,kind:`promptText`,modelDescription:`Chat customizations index`,automaticallyAdded:t,toolReferences:n}}function Th(e,t){return{kind:`tool`,id:e.id,icon:vl.isThemeIcon(e.icon)?e.icon:void 0,name:e.displayName,value:void 0,range:t}}var Eh=class{constructor(e){this._ids=new Set,this._entries=[],e&&this.add(...e)}add(...e){for(let t of e)this._ids.has(t.id)||(this._ids.add(t.id),this._entries.push(t))}insertFirst(e){this._ids.has(e.id)||(this._ids.add(e.id),this._entries.unshift(e))}remove(e){this._ids.delete(e.id),this._entries=this._entries.filter(t=>t.id!==e.id)}has(e){return this._ids.has(e.id)}asArray(){return this._entries.slice(0)}get length(){return this._entries.length}};O(`chatSessionsService`);var Dh={nameShort:`Code - OSS`,nameLong:`Code - OSS`,applicationName:`code-oss`,dataFolderName:`.vscode-oss`,sharedDataFolderName:`.vscode-oss-shared`,win32MutexName:`vscodeoss`,licenseName:`MIT`,licenseUrl:`https://github.com/microsoft/vscode/blob/main/LICENSE.txt`,serverLicenseUrl:`https://github.com/microsoft/vscode/blob/main/LICENSE.txt`,serverGreeting:[],serverLicense:[],serverLicensePrompt:``,serverApplicationName:`code-server-oss`,serverDataFolderName:`.vscode-server-oss`,tunnelApplicationName:`code-tunnel-oss`,win32DirName:`Microsoft Code OSS`,win32NameVersion:`Microsoft Code OSS`,win32RegValueName:`CodeOSS`,win32x64AppId:`{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}`,win32arm64AppId:`{{D1ACE434-89C5-48D1-88D3-E2991DF85475}`,win32x64UserAppId:`{{CC6B787D-37A0-49E8-AE24-8559A032BE0C}`,win32arm64UserAppId:`{{3AEBF0C8-F733-4AD4-BADE-FDB816D53D7B}`,win32AppUserModelId:`Microsoft.CodeOSS`,win32ShellNameShort:`C&ode - OSS`,win32TunnelServiceMutex:`vscodeoss-tunnelservice`,win32TunnelMutex:`vscodeoss-tunnel`,darwinBundleIdentifier:`com.visualstudio.code.oss`,darwinProfileUUID:`47827DD9-4734-49A0-AF80-7E19B11495CC`,darwinProfilePayloadUUID:`CF808BE7-53F3-46C6-A7E2-7EDB98A5E959`,linuxIconName:`code-oss`,licenseFileName:`LICENSE.txt`,reportIssueUrl:`https://github.com/microsoft/vscode/issues/new`,nodejsRepository:`https://nodejs.org`,urlProtocol:`code-oss`,agentsTelemetryAppName:`agents`,webviewContentExternalBaseUrlTemplate:`https://{{uuid}}.vscode-cdn.net/insider/ef65ac1ba57f57f2a3961bfe94aa20481caca4c6/out/vs/workbench/contrib/webview/browser/pre/`,builtInExtensions:[{name:`ms-vscode.js-debug-companion`,version:`1.1.3`,sha256:`7380a890787452f14b2db7835dfa94de538caf358ebc263f9d46dd68ac52de93`,repo:`https://github.com/microsoft/vscode-js-debug-companion`,metadata:{id:`99cb0b7f-7354-4278-b8da-6cc79972169d`,publisherId:{publisherId:`5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee`,publisherName:`ms-vscode`,displayName:`Microsoft`,flags:`verified`},publisherDisplayName:`Microsoft`}},{name:`ms-vscode.js-debug`,version:`1.117.0`,sha256:`854eeb8a785b1f41ba2bd02d7ccd4fdbe10021b61473293973c7e96d036c7fb8`,repo:`https://github.com/microsoft/vscode-js-debug`,metadata:{id:`25629058-ddac-4e17-abba-74678e126c5d`,publisherId:{publisherId:`5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee`,publisherName:`ms-vscode`,displayName:`Microsoft`,flags:`verified`},publisherDisplayName:`Microsoft`}},{name:`ms-vscode.vscode-js-profile-table`,version:`1.0.10`,sha256:`7361748ddf9fd09d8a2ed1f2a2d7376a2cf9aae708692820b799708385c38e08`,repo:`https://github.com/microsoft/vscode-js-profile-visualizer`,metadata:{id:`7e52b41b-71ad-457b-ab7e-0620f1fc4feb`,publisherId:{publisherId:`5f5636e7-69ed-4afe-b5d6-8d231fb3d3ee`,publisherName:`ms-vscode`,displayName:`Microsoft`,flags:`verified`},publisherDisplayName:`Microsoft`}}],defaultChatAgent:{extensionId:`GitHub.copilot`,chatExtensionId:`GitHub.copilot-chat`,chatExtensionOutputId:`GitHub.copilot-chat.GitHub Copilot Chat.log`,chatExtensionOutputExtensionStateCommand:`github.copilot.debug.extensionState`,documentationUrl:`https://aka.ms/github-copilot-overview`,termsStatementUrl:`https://aka.ms/github-copilot-terms-statement`,privacyStatementUrl:`https://aka.ms/github-copilot-privacy-statement`,skusDocumentationUrl:`https://aka.ms/github-copilot-plans`,publicCodeMatchesUrl:`https://aka.ms/github-copilot-match-public-code`,managePlanUrl:`https://aka.ms/github-copilot-manage-plan`,upgradePlanUrl:`https://aka.ms/github-copilot-upgrade-plan`,signUpUrl:`https://aka.ms/github-sign-up`,provider:{default:{id:`github`,name:`GitHub`},enterprise:{id:`github-enterprise`,name:`GHE`},google:{id:`google`,name:`Google`},apple:{id:`apple`,name:`Apple`}},providerExtensionId:`vscode.github-authentication`,providerUriSetting:`github-enterprise.uri`,providerScopes:[[`read:user`,`user:email`,`repo`,`workflow`],[`user:email`],[`read:user`]],entitlementUrl:`https://api.github.com/copilot_internal/user`,entitlementSignupLimitedUrl:`https://api.github.com/copilot_internal/subscribe_limited_user`,chatQuotaExceededContext:`github.copilot.chat.quotaExceeded`,completionsQuotaExceededContext:`github.copilot.completions.quotaExceeded`,walkthroughCommand:`github.copilot.open.walkthrough`,completionsMenuCommand:`github.copilot.toggleStatusMenu`,chatRefreshTokenCommand:`github.copilot.refreshToken`,generateCommitMessageCommand:`github.copilot.git.generateCommitMessage`,resolveMergeConflictsCommand:`github.copilot.git.resolveMergeConflicts`,completionsAdvancedSetting:`github.copilot.advanced`,completionsEnablementSetting:`github.copilot.enable`,nextEditSuggestionsSetting:`github.copilot.nextEditSuggestions.enabled`,tokenEntitlementUrl:`https://api.github.com/copilot_internal/v2/token`,mcpRegistryDataUrl:`https://api.github.com/copilot/mcp_registry`,managedSettingsUrl:`https://api.github.com/copilot_internal/managed_settings`},trustedExtensionAuthAccess:{github:[`GitHub.copilot-chat`],"github-enterprise":[`GitHub.copilot-chat`]},onboardingKeymaps:[{id:`vscode`,label:`VS Code`,description:`Default keyboard mapping`},{id:`sublime`,label:`Sublime Text`,extensionId:`ms-vscode.sublime-keybindings`,description:`Keyboard mapping from Sublime Text`},{id:`intellij`,label:`IntelliJ / JetBrains`,extensionId:`k--kato.intellij-idea-keybindings`,description:`Keyboard mapping from IntelliJ IDEA`},{id:`vim`,label:`Vim`,extensionId:`vscodevim.vim`,description:`Vim modal editing`},{id:`eclipse`,label:`Eclipse`,extensionId:`alphabotsec.vscode-eclipse-keybindings`,description:`Keyboard mapping from Eclipse`},{id:`notepadpp`,label:`Notepad++`,extensionId:`ms-vscode.notepadplusplus-keybindings`,description:`Keyboard mapping from Notepad++`}],onboardingThemes:[{id:`dark-2026`,label:`Dark 2026`,themeId:`Dark 2026`,type:`dark`},{id:`hc-dark`,label:`Dark High Contrast`,themeId:`Default High Contrast`,type:`hcDark`},{id:`solarized-dark`,label:`Solarized Dark`,themeId:`Solarized Dark`,type:`dark`},{id:`light-2026`,label:`Light 2026`,themeId:`Light 2026`,type:`light`},{id:`hc-light`,label:`Light High Contrast`,themeId:`Default High Contrast Light`,type:`hcLight`},{id:`solarized-light`,label:`Solarized Light`,themeId:`Solarized Light`,type:`light`}],builtInExtensionsEnabledWithAutoUpdates:[`GitHub.copilot-chat`],sessionsWindowAllowedExtensions:[],quality:`stable`,version:`1.124.2`,commit:`6928394f91b684055b873eecb8bc281365131f1c`,date:`2026-06-18T13:34:00.227Z`,...globalThis._VSCODE_PRODUCT_JSON??{}};const Oh=O(`configurationService`),kh=O(`contextKeyService`),Ah=O(`dialogService`);O(`fileDialogService`);function jh(e){return Mh(e,0)}function Mh(e,t){switch(typeof e){case`object`:return e===null?Nh(349,t):Array.isArray(e)?Ih(e,t):Lh(e,t);case`string`:return Fh(e,t);case`boolean`:return Ph(e,t);case`number`:return Nh(e,t);case`undefined`:return Nh(937,t);default:return Nh(617,t)}}function Nh(e,t){return(t<<5)-t+e|0}function Ph(e,t){return Nh(e?433:863,t)}function Fh(e,t){t=Nh(149417,t);for(let n=0,r=e.length;n<r;n++)t=Nh(e.charCodeAt(n),t);return t}function Ih(e,t){return t=Nh(104579,t),e.reduce((e,t)=>Mh(t,e),t)}function Lh(e,t){return t=Nh(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=Fh(n,t),Mh(e[n],t)),t)}var Rh;(function(e){e[e.BLOCK_SIZE=64]=`BLOCK_SIZE`,e[e.UNICODE_REPLACEMENT=65533]=`UNICODE_REPLACEMENT`})(Rh||={});function zh(e,t,n=32){let r=n-t,i=~((1<<r)-1);return(e<<t|(i&e)>>>r)>>>0}function Bh(e,t=32){return e instanceof ArrayBuffer?Qt(y.wrap(new Uint8Array(e))):(e>>>0).toString(16).padStart(t/4,`0`)}(class e{static{this._bigBlock32=new DataView(new ArrayBuffer(320))}constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(Rh.BLOCK_SIZE+3),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,a,o;for(i===0?(a=e.charCodeAt(0),o=0):(a=i,o=-1,i=0);;){let s=a;if(va(a))if(o+1<t){let t=e.charCodeAt(o+1);ya(t)?(o++,s=ba(a,t)):s=Rh.UNICODE_REPLACEMENT}else{i=a;break}else ya(a)&&(s=Rh.UNICODE_REPLACEMENT);if(r=this._push(n,r,s),o++,o<t)a=e.charCodeAt(o);else break}this._buffLen=r,this._leftoverHighSurrogate=i}_push(e,t,n){return n<128?e[t++]=n:n<2048?(e[t++]=192|(n&1984)>>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=Rh.BLOCK_SIZE&&(this._step(),t-=Rh.BLOCK_SIZE,this._totalLen+=Rh.BLOCK_SIZE,e[0]=e[Rh.BLOCK_SIZE+0],e[1]=e[Rh.BLOCK_SIZE+1],e[2]=e[Rh.BLOCK_SIZE+2]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,Rh.UNICODE_REPLACEMENT)),this._totalLen+=this._buffLen,this._wrapUp()),Bh(this._h0)+Bh(this._h1)+Bh(this._h2)+Bh(this._h3)+Bh(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,this._buff.subarray(this._buffLen).fill(0),this._buffLen>56&&(this._step(),this._buff.fill(0));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,n.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,zh(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let r=this._h0,i=this._h1,a=this._h2,o=this._h3,s=this._h4,c,l,u;for(let e=0;e<80;e++)e<20?(c=i&a|~i&o,l=1518500249):e<40?(c=i^a^o,l=1859775393):e<60?(c=i&a|i&o|a&o,l=2400959708):(c=i^a^o,l=3395469782),u=zh(r,5)+c+s+l+t.getUint32(e*4,!1)&4294967295,s=o,o=a,a=zh(i,30),i=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}});var H;(function(e){e[e.Off=0]=`Off`,e[e.Trace=1]=`Trace`,e[e.Debug=2]=`Debug`,e[e.Info=3]=`Info`,e[e.Warning=4]=`Warning`,e[e.Error=5]=`Error`})(H||={});const Vh=H.Info;function Hh(e,t){return e!==H.Off&&e<=t}function Uh(e,t,n){switch(t){case H.Trace:e.trace(n);break;case H.Debug:e.debug(n);break;case H.Info:e.info(n);break;case H.Warning:e.warn(n);break;case H.Error:e.error(n);break;case H.Off:break;default:throw Error(`Invalid log level ${t}`)}}function Wh(e,t=!1){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(i instanceof Error&&(i=Pm(i,t)),typeof i==`object`)try{i=JSON.stringify(i)}catch{}n+=(r>0?` `:``)+i}return n}var Gh=class extends v{constructor(){super(...arguments),this.level=Vh,this._onDidChangeLogLevel=this._register(new x)}get onDidChangeLogLevel(){return this._onDidChangeLogLevel.event}setLevel(e){this.level!==e&&(this.level=e,this._onDidChangeLogLevel.fire(this.level))}getLevel(){return this.level}checkLogLevel(e){return Hh(this.level,e)}canLog(e){return this._store.isDisposed?!1:this.checkLogLevel(e)}},Kh=class extends Gh{constructor(e){super(),this.logAlways=e}checkLogLevel(e){return this.logAlways||super.checkLogLevel(e)}trace(e,...t){this.canLog(H.Trace)&&this.log(H.Trace,Wh([e,...t],!0))}debug(e,...t){this.canLog(H.Debug)&&this.log(H.Debug,Wh([e,...t]))}info(e,...t){this.canLog(H.Info)&&this.log(H.Info,Wh([e,...t]))}warn(e,...t){this.canLog(H.Warning)&&this.log(H.Warning,Wh([e,...t]))}error(e,...t){if(this.canLog(H.Error))if(e instanceof Error){let t=Array.prototype.slice.call(arguments);t[0]=e.stack,this.log(H.Error,Wh(t))}else this.log(H.Error,Wh([e,...t]))}flush(){}},qh=class extends Gh{constructor(e){super(),this.loggers=e,e.length&&this.setLevel(e[0].getLevel())}setLevel(e){for(let t of this.loggers)t.setLevel(e);super.setLevel(e)}trace(e,...t){for(let n of this.loggers)n.trace(e,...t)}debug(e,...t){for(let n of this.loggers)n.debug(e,...t)}info(e,...t){for(let n of this.loggers)n.info(e,...t)}warn(e,...t){for(let n of this.loggers)n.warn(e,...t)}error(e,...t){for(let n of this.loggers)n.error(e,...t)}flush(){for(let e of this.loggers)e.flush()}dispose(){for(let e of this.loggers)e.dispose();super.dispose()}},Jh=class extends v{constructor(e,t,n){if(super(),this.logLevel=e,this.logsHome=t,this._loggers=new He,this._onDidChangeLoggers=this._register(new x),this.onDidChangeLoggers=this._onDidChangeLoggers.event,this._onDidChangeLogLevel=this._register(new x),this.onDidChangeLogLevel=this._onDidChangeLogLevel.event,this._onDidChangeVisibility=this._register(new x),this.onDidChangeVisibility=this._onDidChangeVisibility.event,n)for(let e of n)this._loggers.set(e.resource,{logger:void 0,info:e})}getLoggerEntry(e){return et(e)?[...this._loggers.values()].find(t=>t.info.id===e):this._loggers.get(e)}getLogger(e){return this.getLoggerEntry(e)?.logger}createLogger(e,t){let n=this.toResource(e),r=et(e)?e:t?.id??jh(n.toString()).toString(16),i=this._loggers.get(n)?.logger,a=t?.logLevel===`always`?H.Trace:t?.logLevel;i||=this.doCreateLogger(n,a??this.getLogLevel(n)??this.logLevel,{...t,id:r});let o={logger:i,info:{resource:n,id:r,logLevel:a,name:t?.name,hidden:t?.hidden,group:t?.group,extensionId:t?.extensionId,when:t?.when}};return this.registerLogger(o.info),this._loggers.set(n,o),i}toResource(e){return et(e)?uo(this.logsHome,`${e.replace(/[\\/:\*\?"<>\|]/g,``)}.log`):e}setLogLevel(e,t){if(C.isUri(e)){let n=e,r=t,i=this._loggers.get(n);i&&r!==i.info.logLevel&&(i.info.logLevel=r===this.logLevel?void 0:r,i.logger?.setLevel(r),this._loggers.set(i.info.resource,i),this._onDidChangeLogLevel.fire([n,r]))}else{this.logLevel=e;for(let[e,t]of this._loggers.entries())this._loggers.get(e)?.info.logLevel===void 0&&t.logger?.setLevel(this.logLevel);this._onDidChangeLogLevel.fire(this.logLevel)}}setVisibility(e,t){let n=this.getLoggerEntry(e);n&&t!==!n.info.hidden&&(n.info.hidden=!t,this._loggers.set(n.info.resource,n),this._onDidChangeVisibility.fire([n.info.resource,t]))}getLogLevel(e){let t;return e&&(t=this._loggers.get(e)?.info.logLevel),t??this.logLevel}registerLogger(e){let t=this._loggers.get(e.resource);t?t.info.hidden!==e.hidden&&this.setVisibility(e.resource,!e.hidden):(this._loggers.set(e.resource,{info:e,logger:void 0}),this._onDidChangeLoggers.fire({added:[e],removed:[]}))}deregisterLogger(e){let t=this.toResource(e),n=this._loggers.get(t);n&&(n.logger&&n.logger.dispose(),this._loggers.delete(t),this._onDidChangeLoggers.fire({added:[],removed:[n.info]}))}*getRegisteredLoggers(){for(let e of this._loggers.values())yield e.info}getRegisteredLogger(e){return this._loggers.get(e)?.info}dispose(){this._loggers.forEach(e=>e.logger?.dispose()),this._loggers.clear(),super.dispose()}};function Yh(e){switch(e){case H.Trace:return`trace`;case H.Debug:return`debug`;case H.Info:return`info`;case H.Warning:return`warn`;case H.Error:return`error`;case H.Off:return`off`}}new F(`logLevel`,Yh(H.Info));const Xh=O(`productService`);var Zh;(function(e){e[e.APPLICATION=1]=`APPLICATION`,e[e.USER=2]=`USER`,e[e.USER_LOCAL=3]=`USER_LOCAL`,e[e.USER_REMOTE=4]=`USER_REMOTE`,e[e.WORKSPACE=5]=`WORKSPACE`,e[e.WORKSPACE_FOLDER=6]=`WORKSPACE_FOLDER`,e[e.DEFAULT=7]=`DEFAULT`,e[e.MEMORY=8]=`MEMORY`})(Zh||={});function Qh(e,t){let n=Object.create(null);for(let r in e)$h(n,r,e[r],t);return n}function $h(e,t,n,r){let i=t.split(`.`),a=i.pop(),o=e;for(let e=0;e<i.length;e++){let n=i[e],a=o[n];switch(typeof a){case`undefined`:a=o[n]=Object.create(null);break;case`object`:if(a===null){r(`Ignoring ${t} as ${i.slice(0,e+1).join(`.`)} is null`);return}break;default:r(`Ignoring ${t} as ${i.slice(0,e+1).join(`.`)} is ${JSON.stringify(a)}`);return}o=a}if(typeof o==`object`&&o)try{o[a]=n}catch{r(`Ignoring ${t} as ${i.join(`.`)} is ${JSON.stringify(o)}`)}else r(`Ignoring ${t} as ${i.join(`.`)} is ${JSON.stringify(o)}`)}function eg(e,t){tg(e,t.split(`.`))}function tg(e,t){if(!e)return;let n=e,r=t.shift();if(t.length===0){delete n[r];return}if(Object.keys(n).indexOf(r)!==-1){let e=n[r];typeof e==`object`&&e&&!Array.isArray(e)&&(tg(e,t),Object.keys(e).length===0&&delete n[r])}}function ng(e,t,n){function r(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}let i=r(e,t.split(`.`));return i===void 0?n:i}function rg(e){return e.replace(/^\[/,``).replace(/]$/g,``).replace(/\]\[/g,`, `)}function ig(e){let t=!1,n=new Map,r=new Map;if(og(e,i=>{if(e===i)return!0;let a=JSON.stringify(i);if(a.length<30)return!0;let o=n.get(a);if(!o){let e={schemas:[i]};return n.set(a,e),r.set(i,e),!0}return o.schemas.push(i),r.set(i,o),t=!0,!1}),n.clear(),!t)return JSON.stringify(e);let i=`$defs`;for(;e.hasOwnProperty(i);)i+=`_`;let a=[];function o(e){return JSON.stringify(e,(t,n)=>{if(n!==e){let e=r.get(n);if(e&&e.schemas.length>1)return e.id||(e.id=`_${a.length}`,a.push(e.schemas[0])),{$ref:`#/${i}/${e.id}`}}return n})}let s=o(e),c=[];for(let e=0;e<a.length;e++)c.push(`"_${e}":${o(a[e])}`);return c.length?`${s.substring(0,s.length-1)},"${i}":{${c.join(`,`)}}}`:s}function ag(e){return typeof e==`object`&&!!e}function og(e,t){if(!e||typeof e!=`object`)return;let n=(...e)=>{for(let t of e)ag(t)&&o.push(t)},r=(...e)=>{for(let t of e)if(ag(t))for(let e in t){let n=t[e];ag(n)&&o.push(n)}},i=(...e)=>{for(let t of e)if(Array.isArray(t))for(let e of t)ag(e)&&o.push(e)},a=e=>{if(Array.isArray(e))for(let t of e)ag(t)&&o.push(t);else ag(e)&&o.push(e)},o=[e],s=o.pop();for(;s;)t(s)&&(n(s.additionalItems,s.additionalProperties,s.not,s.contains,s.propertyNames,s.if,s.then,s.else,s.unevaluatedItems,s.unevaluatedProperties),r(s.definitions,s.$defs,s.properties,s.patternProperties,s.dependencies,s.dependentSchemas),i(s.anyOf,s.allOf,s.oneOf,s.prefixItems),a(s.items)),s=o.pop()}const sg={JSONContribution:`base.contributions.json`};function cg(e){return e.length>0&&e.charAt(e.length-1)===`#`?e.substring(0,e.length-1):e}const lg=new class extends v{constructor(){super(...arguments),this.schemasById={},this.schemaAssociations={},this._onDidChangeSchema=this._register(new x),this.onDidChangeSchema=this._onDidChangeSchema.event,this._onDidChangeSchemaAssociations=this._register(new x),this.onDidChangeSchemaAssociations=this._onDidChangeSchemaAssociations.event}registerSchema(e,t,n){let r=cg(e);this.schemasById[r]=t,this._onDidChangeSchema.fire(e),n&&n.add(g(()=>{delete this.schemasById[r],this._onDidChangeSchema.fire(e)}))}registerSchemaAssociation(e,t){let n=cg(e);return this.schemaAssociations[n]||(this.schemaAssociations[n]=[]),this.schemaAssociations[n].includes(t)||(this.schemaAssociations[n].push(t),this._onDidChangeSchemaAssociations.fire()),g(()=>{let e=this.schemaAssociations[n];if(e){let r=e.indexOf(t);r!==-1&&(e.splice(r,1),e.length===0&&delete this.schemaAssociations[n],this._onDidChangeSchemaAssociations.fire())}})}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}getSchemaContributions(){return{schemas:this.schemasById}}getSchemaContent(e){let t=this.schemasById[e];return t?ig(t):void 0}hasSchemaContent(e){return!!this.schemasById[e]}getSchemaAssociations(){return this.schemaAssociations}};Am.add(sg.JSONContribution,lg);var ug;(function(e){e.Multiline=`multilineText`,e.Singleline=`singlelineText`})(ug||={});const dg={Configuration:`base.contributions.configuration`};var fg;(function(e){e[e.APPLICATION=1]=`APPLICATION`,e[e.MACHINE=2]=`MACHINE`,e[e.APPLICATION_MACHINE=3]=`APPLICATION_MACHINE`,e[e.WINDOW=4]=`WINDOW`,e[e.RESOURCE=5]=`RESOURCE`,e[e.LANGUAGE_OVERRIDABLE=6]=`LANGUAGE_OVERRIDABLE`,e[e.MACHINE_OVERRIDABLE=7]=`MACHINE_OVERRIDABLE`})(fg||={});function pg(e,t){return e===t?!0:!e||!t?!1:typeof e==`string`||typeof t==`string`?e===t:e.id===t.id}const mg={properties:{},patternProperties:{}},hg={properties:{},patternProperties:{}},gg={properties:{},patternProperties:{}},_g={properties:{},patternProperties:{}},vg={properties:{},patternProperties:{}},yg={properties:{},patternProperties:{}},bg={properties:{},patternProperties:{}},xg=`vscode://schemas/settings/resourceLanguage`,Sg=Am.as(sg.JSONContribution);var Cg=class extends v{constructor(){super(),this.registeredConfigurationDefaults=[],this.overrideIdentifiers=new Set,this._onDidSchemaChange=this._register(new x),this.onDidSchemaChange=this._onDidSchemaChange.event,this._onDidUpdateConfiguration=this._register(new x),this.onDidUpdateConfiguration=this._onDidUpdateConfiguration.event,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:`defaultOverrides`,title:b(1871,`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={},Sg.registerSchema(xg,this.resourceLanguageSettingsSchema),this.registerOverridePropertyPatternKey()}registerConfiguration(e,t=!0){return this.registerConfigurations([e],t),e}registerConfigurations(e,t=!0){let n=new Set;this.doRegisterConfigurations(e,t,n),Sg.registerSchema(xg,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}deregisterConfigurations(e){let t=new Set;this.doDeregisterConfigurations(e,t),Sg.registerSchema(xg,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t})}updateConfigurations({add:e,remove:t}){let n=new Set;this.doDeregisterConfigurations(t,n),this.doRegisterConfigurations(e,!1,n),Sg.registerSchema(xg,this.resourceLanguageSettingsSchema),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n})}registerDefaultConfigurations(e){let t=new Set;this.doRegisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doRegisterDefaultConfigurations(e,t){this.registeredConfigurationDefaults.push(...e);let n=[];for(let{overrides:r,source:i}of e)for(let e in r){t.add(e);let a=this.configurationDefaultsOverrides.get(e)??this.configurationDefaultsOverrides.set(e,{configurationDefaultOverrides:[]}).get(e),o=r[e];if(a.configurationDefaultOverrides.push({value:o,source:i}),Dg.test(e)){let t=this.mergeDefaultConfigurationsForOverrideIdentifier(e,o,i,a.configurationDefaultOverrideValue);if(!t)continue;a.configurationDefaultOverrideValue=t,this.updateDefaultOverrideProperty(e,t,i),n.push(...Og(e))}else{let t=this.mergeDefaultConfigurationsForConfigurationProperty(e,o,i,a.configurationDefaultOverrideValue);if(!t)continue;a.configurationDefaultOverrideValue=t;let n=this.configurationProperties[e];n&&(this.updatePropertyDefaultValue(e,n),this.updateSchema(e,n))}}this.doRegisterOverrideIdentifiers(n)}deregisterDefaultConfigurations(e){let t=new Set;this.doDeregisterDefaultConfigurations(e,t),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:t,defaultsOverrides:!0})}doDeregisterDefaultConfigurations(e,t){for(let t of e){let e=this.registeredConfigurationDefaults.indexOf(t);e!==-1&&this.registeredConfigurationDefaults.splice(e,1)}for(let{overrides:n,source:r}of e)for(let e in n){let i=this.configurationDefaultsOverrides.get(e);if(!i)continue;let a=i.configurationDefaultOverrides.findIndex(t=>r?pg(t.source,r):t.value===n[e]);if(a!==-1){if(i.configurationDefaultOverrides.splice(a,1),i.configurationDefaultOverrides.length===0&&this.configurationDefaultsOverrides.delete(e),Dg.test(e)){let t;for(let n of i.configurationDefaultOverrides)t=this.mergeDefaultConfigurationsForOverrideIdentifier(e,n.value,n.source,t);t&&!pt(t.value)?(i.configurationDefaultOverrideValue=t,this.updateDefaultOverrideProperty(e,t,r)):(this.configurationDefaultsOverrides.delete(e),delete this.configurationProperties[e],delete this.defaultLanguageConfigurationOverridesNode.properties[e])}else{let t;for(let n of i.configurationDefaultOverrides)t=this.mergeDefaultConfigurationsForConfigurationProperty(e,n.value,n.source,t);i.configurationDefaultOverrideValue=t;let n=this.configurationProperties[e];n&&(this.updatePropertyDefaultValue(e,n),this.updateSchema(e,n))}t.add(e)}}this.updateOverridePropertyPatternKey()}updateDefaultOverrideProperty(e,t,n){let r={section:{id:this.defaultLanguageConfigurationOverridesNode.id,title:this.defaultLanguageConfigurationOverridesNode.title,order:this.defaultLanguageConfigurationOverridesNode.order,extensionInfo:this.defaultLanguageConfigurationOverridesNode.extensionInfo},type:`object`,default:t.value,description:b(1872,`Configure settings to be overridden for {0}.`,rg(e)),$ref:xg,defaultDefaultValue:t.value,source:n,defaultValueSource:n};this.configurationProperties[e]=r,this.defaultLanguageConfigurationOverridesNode.properties[e]=r}mergeDefaultConfigurationsForOverrideIdentifier(e,t,n,r){let i=r?.value||{},a=r?.source??new Map;if(!(a instanceof Map)){console.error(`objectConfigurationSources is not a Map`);return}for(let e of Object.keys(t)){let r=t[e];if(rt(r)&&(st(i[e])||rt(i[e]))){if(i[e]={...i[e]??{},...r},n)for(let t in r)a.set(`${e}.${t}`,n)}else i[e]=r,n?a.set(e,n):a.delete(e)}return{value:i,source:a}}mergeDefaultConfigurationsForConfigurationProperty(e,t,n,r){let i=this.configurationProperties[e],a=r?.value??i?.defaultDefaultValue,o=n;if(rt(t)&&(i!==void 0&&i.type===`object`||i===void 0&&(st(a)||rt(a)))){if(o=r?.source??new Map,!(o instanceof Map)){console.error(`defaultValueSource is not a Map`);return}for(let r in t)n&&o.set(`${e}.${r}`,n);t={...rt(a)?a:{},...t}}return{value:t,source:o}}deltaConfiguration(e){let t=!1,n=new Set;e.removedDefaults&&(this.doDeregisterDefaultConfigurations(e.removedDefaults,n),t=!0),e.addedDefaults&&(this.doRegisterDefaultConfigurations(e.addedDefaults,n),t=!0),e.removedConfigurations&&this.doDeregisterConfigurations(e.removedConfigurations,n),e.addedConfigurations&&this.doRegisterConfigurations(e.addedConfigurations,!1,n),this._onDidSchemaChange.fire(),this._onDidUpdateConfiguration.fire({properties:n,defaultsOverrides:t})}notifyConfigurationSchemaUpdated(...e){this._onDidSchemaChange.fire()}registerOverrideIdentifiers(e){this.doRegisterOverrideIdentifiers(e),this._onDidSchemaChange.fire()}doRegisterOverrideIdentifiers(e){for(let t of e)this.overrideIdentifiers.add(t);this.updateOverridePropertyPatternKey()}doRegisterConfigurations(e,t,n){e.forEach(e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,n),this.configurationContributors.push(e),this.registerJSONConfiguration(e)})}doDeregisterConfigurations(e,t){let n=e=>{if(e.properties)for(let n in e.properties){t.add(n);let r=this.configurationProperties[n];r?.policy?.name&&this.policyConfigurations.delete(r.policy.name),delete this.configurationProperties[n],this.removeFromSchema(n,e.properties[n])}e.allOf?.forEach(e=>n(e))};for(let t of e){n(t);let e=this.configurationContributors.indexOf(t);e!==-1&&this.configurationContributors.splice(e,1)}}validateAndRegisterProperties(e,t=!0,n,r,i=fg.WINDOW,a){i=lt(e.scope)?i:e.scope;let o=e.properties;if(o)for(let s in o){let c=o[s];if(c.section={id:e.id,title:e.title,order:e.order,extensionInfo:e.extensionInfo},t&&jg(s,c,n?.id)){delete o[s];continue}c.source=n,c.defaultDefaultValue=o[s].default,this.updatePropertyDefaultValue(s,c),Dg.test(s)?c.scope=void 0:(c.scope=lt(c.scope)?i:c.scope,c.restricted=lt(c.restricted)?!!r?.includes(s):c.restricted),c.experiment?c.tags?.some(e=>e.toLowerCase()===`onexp`)||(c.tags=c.tags??[],c.tags.push(`onExP`)):c.tags?.some(e=>e.toLowerCase()===`onexp`)&&(console.error(`Invalid tag 'onExP' found for property '${s}'. Please use 'experiment' property instead.`),c.experiment={mode:`startup`});let l=o[s].hasOwnProperty(`included`)&&!o[s].included,u=o[s].policy?.name;l?(this.excludedConfigurationProperties[s]=o[s],u&&(this.policyConfigurations.set(u,s),a.add(s)),delete o[s]):(a.add(s),u&&this.policyConfigurations.set(u,s),this.configurationProperties[s]=o[s],!o[s].deprecationMessage&&o[s].markdownDeprecationMessage&&(o[s].deprecationMessage=o[s].markdownDeprecationMessage))}let s=e.allOf;if(s)for(let e of s)this.validateAndRegisterProperties(e,t,n,r,i,a)}getConfigurations(){return this.configurationContributors}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}getExcludedConfigurationProperties(){return this.excludedConfigurationProperties}getRegisteredDefaultConfigurations(){return[...this.registeredConfigurationDefaults]}getConfigurationDefaultsOverrides(){let e=new Map;for(let[t,n]of this.configurationDefaultsOverrides)n.configurationDefaultOverrideValue&&e.set(t,n.configurationDefaultOverrideValue);return e}registerJSONConfiguration(e){let t=e=>{let n=e.properties;if(n)for(let e in n)this.updateSchema(e,n[e]);e.allOf?.forEach(t)};t(e)}updateSchema(e,t){switch(mg.properties[e]=t,t.scope){case fg.APPLICATION:hg.properties[e]=t;break;case fg.MACHINE:_g.properties[e]=t;break;case fg.APPLICATION_MACHINE:gg.properties[e]=t;break;case fg.MACHINE_OVERRIDABLE:vg.properties[e]=t;break;case fg.WINDOW:yg.properties[e]=t;break;case fg.RESOURCE:bg.properties[e]=t;break;case fg.LANGUAGE_OVERRIDABLE:bg.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t;break}}removeFromSchema(e,t){switch(delete mg.properties[e],t.scope){case fg.APPLICATION:delete hg.properties[e];break;case fg.MACHINE:delete _g.properties[e];break;case fg.APPLICATION_MACHINE:delete gg.properties[e];break;case fg.MACHINE_OVERRIDABLE:delete vg.properties[e];break;case fg.WINDOW:delete yg.properties[e];break;case fg.RESOURCE:case fg.LANGUAGE_OVERRIDABLE:delete bg.properties[e],delete this.resourceLanguageSettingsSchema.properties[e];break}}updateOverridePropertyPatternKey(){for(let e of this.overrideIdentifiers.values()){let t=`[${e}]`,n={type:`object`,description:b(1873,`Configure editor settings to be overridden for a language.`),errorMessage:b(1874,`This setting does not support per-language configuration.`),$ref:xg};this.updatePropertyDefaultValue(t,n),mg.properties[t]=n,hg.properties[t]=n,gg.properties[t]=n,_g.properties[t]=n,vg.properties[t]=n,yg.properties[t]=n,bg.properties[t]=n}}registerOverridePropertyPatternKey(){let e={type:`object`,description:b(1873,`Configure editor settings to be overridden for a language.`),errorMessage:b(1874,`This setting does not support per-language configuration.`),$ref:xg};mg.patternProperties[Eg]=e,hg.patternProperties[Eg]=e,gg.patternProperties[Eg]=e,_g.patternProperties[Eg]=e,vg.patternProperties[Eg]=e,yg.patternProperties[Eg]=e,bg.patternProperties[Eg]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){let n=this.configurationDefaultsOverrides.get(e)?.configurationDefaultOverrideValue,r,i;n&&(!t.disallowConfigurationDefault||!n.source)&&(r=n.value,i=n.source),st(r)&&(r=t.defaultDefaultValue,i=void 0),st(r)&&(r=kg(t.type)),t.default=r,t.defaultValueSource=i}};const wg=`\\[([^\\]]+)\\]`,Tg=RegExp(wg,`g`),Eg=`^(${wg})+$`,Dg=new RegExp(Eg);function Og(e){let t=[];if(Dg.test(e)){let n=Tg.exec(e);for(;n?.length;){let r=n[1].trim();r&&t.push(r),n=Tg.exec(e)}}return Ee(t)}function kg(e){switch(Array.isArray(e)?e[0]:e){case`boolean`:return!1;case`integer`:case`number`:return 0;case`string`:return``;case`array`:return[];case`object`:return{};default:return null}}const Ag=new Cg;Am.add(dg.Configuration,Ag);function jg(e,t,n){return e.trim()?Dg.test(e)?b(1876,`Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.`,e):Ag.getConfigurationProperties()[e]!==void 0&&(!n||!Mg.has(n.toLowerCase()))?b(1877,`Cannot register '{0}'. This property is already registered.`,e):t.policy?.name&&Ag.getPolicyConfigurations().get(t.policy?.name)!==void 0?b(1878,`Cannot register '{0}'. The associated policy {1} is already registered with {2}.`,e,t.policy?.name,Ag.getPolicyConfigurations().get(t.policy?.name)):null:b(1875,`Cannot register an empty property`)}const Mg=new Set(Dh.defaultChatAgent?[Dh.defaultChatAgent.extensionId,Dh.defaultChatAgent.chatExtensionId].map(e=>e.toLowerCase()):[]);function Ng(e){return e.res.statusCode&&e.res.statusCode>=200&&e.res.statusCode<300||e.res.statusCode===1223}function Pg(e){return e.res.statusCode===204}async function Fg(e){return Pg(e)?null:(await qt(e.stream)).toString()}async function Ig(e){if(!Ng(e))throw Error(`Server returned `+e.res.statusCode);if(Pg(e))return null;let t=(await qt(e.stream)).toString();try{return JSON.parse(t)}catch(e){throw e.message+=`:
|
|
78
|
+
`+t,e}}let Lg=[],Rg,zg;function Bg(e=!0,t=!0){if(Rg===e&&zg===t)return;Rg=e,zg=t;let n=Am.as(dg.Configuration),r=Lg;Lg=[{id:`http`,order:15,title:b(2156,`HTTP`),type:`object`,scope:fg.MACHINE,properties:{"http.useLocalProxyConfiguration":{type:`boolean`,default:t,markdownDescription:b(2157,`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:b(2156,`HTTP`),type:`object`,scope:fg.APPLICATION,properties:{"http.electronFetch":{type:`boolean`,default:!1,description:b(2158,`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:b(2156,`HTTP`),type:`object`,scope:e?fg.APPLICATION:fg.MACHINE,properties:{"http.proxy":{type:`string`,pattern:`^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$`,markdownDescription:b(2159,"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:b(2160,`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:b(2161,`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:b(2162,`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:b(2163,"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:[b(2164,`Disable proxy support for extensions.`),b(2165,`Enable proxy support for extensions.`),b(2166,`Enable proxy support for extensions, fall back to request options, when no proxy found.`),b(2167,`Enable proxy support for extensions, override request options.`)],default:`override`,markdownDescription:b(2168,`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:b(2169,`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.systemCertificatesNode":{type:`boolean`,tags:[`experimental`],default:!1,markdownDescription:b(2170,`Controls whether system certificates should be loaded using Node.js built-in support. Reload the window after changing this setting. 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,experiment:{mode:`auto`}},"http.experimental.systemCertificatesV2":{type:`boolean`,tags:[`experimental`],default:!1,markdownDescription:b(2171,`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:b(2172,`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},"http.webSocketAdditionalSupport":{type:`boolean`,default:!0,markdownDescription:b(2173,`Controls whether the built-in WebSocket 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},"http.experimental.networkInterfaceCheckInterval":{type:`number`,default:300,minimum:-1,tags:[`experimental`],markdownDescription:b(2174,`Controls the interval in seconds for checking network interface changes to invalidate the proxy cache. Set to -1 to disable. 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,experiment:{mode:`auto`}}}}],n.updateConfigurations({add:Lg,remove:r})}Bg();const Vg=O(`requestService`);var Hg;(function(e){e[e.STORAGE_DOES_NOT_EXIST=0]=`STORAGE_DOES_NOT_EXIST`,e[e.STORAGE_IN_MEMORY=1]=`STORAGE_IN_MEMORY`})(Hg||={});var Ug;(function(e){e[e.None=0]=`None`,e[e.Initialized=1]=`Initialized`,e[e.Closed=2]=`Closed`})(Ug||={});var Wg=class e extends v{static{this.DEFAULT_FLUSH_DELAY=100}constructor(t,n=Object.create(null)){super(),this.database=t,this.options=n,this._onDidChangeStorage=this._register(new hr),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=Ug.None,this.cache=new Map,this.flushDelayer=this._register(new Ao(e.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((e,t)=>this.acceptExternal(t,e)),e.deleted?.forEach(e=>this.acceptExternal(e,void 0))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===Ug.Closed)return;let n=!1;lt(t)?n=this.cache.delete(e):this.cache.get(e)!==t&&(this.cache.set(e,t),n=!0),n&&this._onDidChangeStorage.fire({key:e,external:!0})}get items(){return this.cache}get size(){return this.cache.size}async init(){this.state===Ug.None&&(this.state=Ug.Initialized,this.options.hint!==Hg.STORAGE_DOES_NOT_EXIST&&(this.cache=await this.database.getItems()))}get(e,t){let n=this.cache.get(e);return lt(n)?t:n}getBoolean(e,t){let n=this.get(e);return lt(n)?t:n===`true`}getNumber(e,t){let n=this.get(e);return lt(n)?t:parseInt(n,10)}getObject(e,t){let n=this.get(e);return lt(n)?t:Ku(n)}async set(e,t,n=!1){if(this.state===Ug.Closed)return;if(lt(t))return this.delete(e,n);let r=rt(t)||Array.isArray(t)?Gu(t):String(t);if(this.cache.get(e)!==r)return this.cache.set(e,r),this.pendingInserts.set(e,r),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:n}),this.doFlush()}async delete(e,t=!1){if(this.state!==Ug.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!==Ug.Closed)return await this.flush(0),this.database.optimize()}async close(){return this.pendingClose||=this.doClose(),this.pendingClose}async doClose(){this.state=Ug.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;let 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===Ug.Closed||this.pendingClose))return this.doFlush(e)}async doFlush(e){return this.options.hint===Hg.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===Hg.STORAGE_IN_MEMORY}};const Gg=`__$__migratedStorageMarker`;(class e extends Wg{constructor(){super(...arguments),this.migratedKeys=new Set,this.fallbackStorage=void 0,this.isFallbackStorageReadonly=!1}async init(){await super.init(),this.migratedKeys=this.loadMigratedKeys()}setFallbackStorage(e,t){this.fallbackStorage=e,this.isFallbackStorageReadonly=t}static{this.INTERNAL_KEY_PREFIX=`__$__`}get(t,n){if(!t.startsWith(e.INTERNAL_KEY_PREFIX)&&!this.migratedKeys.has(t)&&st(super.get(t))){this.migratedKeys.add(t);let e=this.fallbackStorage?.items.get(t);st(e)||(this.set(t,e),this.isFallbackStorageReadonly||this.fallbackStorage?.delete(t),this.persistMigratedKeys())}return super.get(t,n)}loadMigratedKeys(){let e=super.get(Gg);if(e)try{return new Set(JSON.parse(e))}catch{}return new Set}persistMigratedKeys(){this.set(Gg,JSON.stringify([...this.migratedKeys]))}});const Kg=O(`environmentService`),qg=O(`fileService`),Jg=O(`IUriIdentityService`),Yg={settings:!0,keybindings:!0,prompts:!0,mcp:!0,languageModels:!0,snippets:!0,tasks:!0,extensions:!0};var Xg;(function(e){e.Settings=`settings`,e.Keybindings=`keybindings`,e.Snippets=`snippets`,e.Prompts=`prompts`,e.Tasks=`tasks`,e.Extensions=`extensions`,e.GlobalState=`globalState`,e.Mcp=`mcp`,e.LanguageModels=`languageModels`})(Xg||={});function Zg(e){let t=e;return!!(t&&typeof t==`object`&&typeof t.id==`string`&&typeof t.isDefault==`boolean`&&typeof t.name==`string`&&C.isUri(t.location)&&C.isUri(t.globalStorageHome)&&C.isUri(t.settingsResource)&&C.isUri(t.keybindingsResource)&&C.isUri(t.tasksResource)&&C.isUri(t.snippetsHome)&&C.isUri(t.promptsHome)&&C.isUri(t.extensionsResource)&&C.isUri(t.mcpResource)&&C.isUri(t.languageModelsResource)&&C.isUri(t.agentPluginsHome))}function Qg(e,t,n,r,i,a){let o=e===`agents`;return{id:e,name:t,location:n,isDefault:!1,icon:i?.icon,globalStorageHome:a&&i?.useDefaultFlags?.globalState?a.globalStorageHome:uo(n,`globalStorage`),settingsResource:a&&i?.useDefaultFlags?.settings?a.settingsResource:uo(n,`settings.json`),keybindingsResource:a&&i?.useDefaultFlags?.keybindings?a.keybindingsResource:uo(n,`keybindings.json`),tasksResource:a&&i?.useDefaultFlags?.tasks?a.tasksResource:uo(n,`tasks.json`),snippetsHome:a&&i?.useDefaultFlags?.snippets?a.snippetsHome:uo(n,`snippets`),promptsHome:a&&i?.useDefaultFlags?.prompts?a.promptsHome:uo(n,`prompts`),extensionsResource:a&&i?.useDefaultFlags?.extensions?a.extensionsResource:uo(n,`extensions.json`),mcpResource:a&&i?.useDefaultFlags?.mcp?a.mcpResource:uo(n,`mcp.json`),languageModelsResource:a&&i?.useDefaultFlags?.languageModels?a.languageModelsResource:uo(n,`chatLanguageModels.json`),agentPluginsHome:a?a.agentPluginsHome:uo(n,`agent-plugins`),cacheHome:uo(r,e),useDefaultFlags:i?.useDefaultFlags,isTransient:i?.transient,isInternal:o||i?.transient,isAgentsWindowProfile:o,workspaces:i?.workspaces}}const $g=`builtin`;let e_=class extends v{static{this.PROFILES_KEY=`userDataProfiles`}static{this.PROFILE_ASSOCIATIONS_KEY=`profileAssociations`}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.profilesObject.profiles,...this.transientProfilesObject.profiles]}constructor(e,t,n,r){super(),this.environmentService=e,this.fileService=t,this.uriIdentityService=n,this.logService=r,this._onDidChangeProfiles=this._register(new x),this.onDidChangeProfiles=this._onDidChangeProfiles.event,this._onWillCreateProfile=this._register(new x),this.onWillCreateProfile=this._onWillCreateProfile.event,this._onWillRemoveProfile=this._register(new x),this.onWillRemoveProfile=this._onWillRemoveProfile.event,this._onDidResetWorkspaces=this._register(new x),this.onDidResetWorkspaces=this._onDidResetWorkspaces.event,this.profileCreationPromises=new Map,this.transientProfilesObject={profiles:[],emptyWindows:new Map},this.profilesHome=uo(this.environmentService.userRoamingDataHome,`profiles`),this.profilesCacheHome=uo(this.environmentService.cacheHome,`CachedProfilesData`)}init(){this._profilesObject=void 0}get profilesObject(){if(!this._profilesObject){let e=this.createDefaultProfile(),t=[e];try{for(let n of this.getStoredProfiles()){if(this.isInvalidProfile(n)){this.logService.warn(`Skipping the invalid stored profile`,n.location||n.name);continue}let r=so(n.location);t.push(Qg(r,n.name,n.location,this.profilesCacheHome,{icon:n.icon,useDefaultFlags:r===`agents`?Yg:n.useDefaultFlags},e))}}catch(e){this.logService.error(e)}let n=new Map;if(t.length)try{let e=this.getStoredProfileAssociations();if(e.workspaces)for(let[n,r]of Object.entries(e.workspaces)){let e=C.parse(n),i=t.find(e=>e.id===r);if(i){let t=i.workspaces?i.workspaces.slice(0):[];t.push(e),i.workspaces=t}}if(e.emptyWindows)for(let[r,i]of Object.entries(e.emptyWindows)){let e=t.find(e=>e.id===i);e&&n.set(r,e)}}catch(e){this.logService.error(e)}this._profilesObject={profiles:t,emptyWindows:n}}return this._profilesObject}isInvalidProfile(e){return!e.name||!et(e.name)||!e.location}createDefaultProfile(){let e=Qg(`__default__profile__`,b(2589,`Default`),this.environmentService.userRoamingDataHome,this.profilesCacheHome);return{...e,extensionsResource:this.getDefaultProfileExtensionsLocation()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){let t=`Temp`,n=RegExp(`${$i(t)}\\s(\\d+)`),r=0;for(let e of this.profiles){let t=n.exec(e.name),i=t?parseInt(t[1]):0;r=i>r?i:r}let i=`${t} ${r+1}`;return this.createProfile(jh(Gc()).toString(16),i,{transient:!0},e)}async createNamedProfile(e,t,n){return this.createProfile(jh(Gc()).toString(16),e,t,n)}async createProfile(e,t,n,r){return await this.doCreateProfile(e,t,n,r)}async doCreateProfile(e,t,n,r){if(!et(t)||!t)throw Error("Name of the profile is mandatory and must be of type `string`");let i=this.profileCreationPromises.get(t);return i||(i=(async()=>{try{if(this.profiles.find(r=>r.id===e||e!==`agents`&&!r.isTransient&&!n?.transient&&r.name===t))throw Error(`Profile with ${t} name already exists`);let i=r?this.getWorkspace(r):void 0;C.isUri(i)&&(n={...n,workspaces:[i]});let a=Qg(e,t,this.uriIdentityService.extUri.joinPath(this.profilesHome,...e===`agents`?[$g,e]:[e]),this.profilesCacheHome,e===`agents`?{}:n,this.defaultProfile);await this.fileService.createFolder(a.location);let o=[];return this._onWillCreateProfile.fire({profile:a,join(e){o.push(e)}}),await Go.settled(o),i&&!C.isUri(i)&&this.updateEmptyWindowAssociation(i,a,!!a.isTransient),this.updateProfiles([a],[],[]),this.profiles.find(e=>e.id===a.id)??a}finally{this.profileCreationPromises.delete(t)}})(),this.profileCreationPromises.set(t,i)),i}async updateProfile(e,t){if(e.isAgentsWindowProfile)throw Error(`Cannot update agents window profile`);let n=[];for(let r of this.profiles){let i;if(e.id===r.id)r.isDefault?t.workspaces&&(i=r,i.workspaces=t.workspaces):i=Qg(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){let e=r.workspaces?.filter(e=>!t.workspaces?.some(t=>this.uriIdentityService.extUri.isEqual(e,t)));r.workspaces?.length!==e?.length&&(i=r,i.workspaces=e)}i&&n.push(i)}if(!n.length)throw e.isDefault?Error(`Cannot update default profile`):Error(`Profile '${e.name}' does not exist`);this.updateProfiles([],[],n);let r=this.profiles.find(t=>t.id===e.id);if(!r)throw Error(`Profile '${e.name}' was not updated`);return r}async removeProfile(e){if(e.isDefault)throw Error(`Cannot remove default profile`);let t=this.profiles.find(t=>t.id===e.id);if(!t)throw Error(`Profile '${e.name}' does not exist`);let n=[];this._onWillRemoveProfile.fire({profile:t,join(e){n.push(e)}});try{await Promise.allSettled(n)}catch(e){this.logService.error(e)}this.updateProfiles([],[t],[]);try{await this.fileService.del(t.cacheHome,{recursive:!0})}catch(e){Tc(e)!==kc.FILE_NOT_FOUND&&this.logService.error(e)}}async setProfileForWorkspace(e,t){let n=this.profiles.find(e=>e.id===t.id);if(!n)throw Error(`Profile '${t.name}' does not exist`);let r=this.getWorkspace(e);if(C.isUri(r)){let e=n.workspaces?[...n.workspaces]:[];e.some(e=>this.uriIdentityService.extUri.isEqual(e,r))||(e.push(r),await this.updateProfile(n,{workspaces:e}))}else this.updateEmptyWindowAssociation(r,n,!1),this.updateStoredProfiles(this.profiles)}unsetWorkspace(e,t=!1){let n=this.getWorkspace(e);if(C.isUri(n)){let t=this.getProfileForWorkspace(e);t&&this.updateProfile(t,{workspaces:t.workspaces?.filter(e=>!this.uriIdentityService.extUri.isEqual(e,n))})}else this.updateEmptyWindowAssociation(n,void 0,t),this.updateStoredProfiles(this.profiles)}async resetWorkspaces(){this.transientProfilesObject.emptyWindows.clear(),this.profilesObject.emptyWindows.clear();for(let e of this.profiles)e.workspaces=void 0;this.updateProfiles([],[],this.profiles),this._onDidResetWorkspaces.fire()}async cleanUp(){try{if(await this.fileService.exists(this.profilesHome)){let e=await this.fileService.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(e=>e.isDirectory&&e.name!==$g&&this.profiles.every(t=>!this.uriIdentityService.extUri.isEqual(t.location,e.resource))).map(e=>this.fileService.del(e.resource,{recursive:!0})))}}catch(e){this.logService.error(`Error deleting redundant profile folders`,e)}try{let e=this.getStoredProfiles(),t=[];for(let e of this.getStoredProfiles())this.isInvalidProfile(e)?this.logService.warn(`Invalid user data profile found: ${e.name}`):t.push(e);e.length!==t.length&&this.saveStoredProfiles(t)}catch(e){this.logService.error(`Error removing invalid stored profiles`,e)}}async cleanUpTransientProfiles(){let e=this.transientProfilesObject.profiles.filter(e=>!this.isProfileAssociatedToWorkspace(e));await Promise.allSettled(e.map(e=>this.removeProfile(e)))}getProfileForWorkspace(e){let t=this.getWorkspace(e);return C.isUri(t)&&this.uriIdentityService.extUri.isEqual(t,this.environmentService.agentSessionsWorkspace)?this.profiles.find(e=>e.isAgentsWindowProfile):C.isUri(t)?this.profiles.find(e=>e.workspaces?.some(e=>this.uriIdentityService.extUri.isEqual(e,t))):this.profilesObject.emptyWindows.get(t)??this.transientProfilesObject.emptyWindows.get(t)}getWorkspace(e){return Lc(e)?e.uri:Rc(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,n,r=!1){let i=[...this.profiles,...e],a=this.transientProfilesObject.profiles;this.transientProfilesObject.profiles=[];let o=[];for(let e of i){if(t.some(t=>e.id===t.id)){for(let t of[...this.profilesObject.emptyWindows.keys()])e.id===this.profilesObject.emptyWindows.get(t)?.id&&this.profilesObject.emptyWindows.delete(t);continue}if(!e.isDefault){e=n.find(t=>e.id===t.id)??e;let t=a.find(t=>e.id===t.id);if(e.isTransient)this.transientProfilesObject.profiles.push(e);else if(t){for(let[t,n]of this.transientProfilesObject.emptyWindows.entries())if(e.id===n.id){this.transientProfilesObject.emptyWindows.delete(t),this.profilesObject.emptyWindows.set(t,e);break}}}e.workspaces?.length===0&&(e.workspaces=void 0),o.push(e)}this.updateStoredProfiles(o),r||this.triggerProfilesChanges(e,t,n)}triggerProfilesChanges(e,t,n){this._onDidChangeProfiles.fire({added:e,removed:t,updated:n,all:this.profiles})}updateEmptyWindowAssociation(e,t,n){n=t?.isTransient?!0:n,n?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){let t=[],n={},r={};for(let 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(let e of r.workspaces)n[e.toString()]=r.id;for(let[e,t]of this.profilesObject.emptyWindows.entries())r[e.toString()]=t.id;this.saveStoredProfileAssociations({workspaces:n,emptyWindows:r}),this.saveStoredProfiles(t),this._profilesObject=void 0}getStoredProfiles(){return[]}saveStoredProfiles(e){throw Error(`not implemented`)}getStoredProfileAssociations(){return{}}saveStoredProfileAssociations(e){throw Error(`not implemented`)}getDefaultProfileExtensionsLocation(){}};e_=k([A(0,Kg),A(1,qg),A(2,Jg),A(3,Ns)],e_);const t_=`__$__targetStorageMarker`;var n_;(function(e){e[e.NONE=0]=`NONE`,e[e.SHUTDOWN=1]=`SHUTDOWN`})(n_||={});var r_;(function(e){e[e.APPLICATION_SHARED=-2]=`APPLICATION_SHARED`,e[e.APPLICATION=-1]=`APPLICATION`,e[e.PROFILE=0]=`PROFILE`,e[e.WORKSPACE=1]=`WORKSPACE`})(r_||={});var i_;(function(e){e[e.USER=0]=`USER`,e[e.MACHINE=1]=`MACHINE`})(i_||={});function a_(e){let t=e.get(t_);if(t)try{return JSON.parse(t)}catch{}return Object.create(null)}(class e extends v{static{this.DEFAULT_FLUSH_INTERVAL=60*1e3}constructor(t={flushInterval:e.DEFAULT_FLUSH_INTERVAL}){super(),this._onDidChangeValue=this._register(new hr),this._onDidChangeTarget=this._register(new hr),this.onDidChangeTarget=this._onDidChangeTarget.event,this._onWillSaveState=this._register(new x),this.onWillSaveState=this._onWillSaveState.event,this.runFlushWhenIdle=this._register(new wt),this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0,this._applicationSharedKeyTargets=void 0,this.flushWhenIdleScheduler=this._register(new Ro(()=>this.doFlushWhenIdle(),t.flushInterval))}onDidChangeValue(e,t,n){return ir.filter(this._onDidChangeValue.event,n=>n.scope===e&&(t===void 0||n.key===t),n)}doFlushWhenIdle(){this.runFlushWhenIdle.value=zo(()=>{this.shouldFlushWhenIdle()&&this.flush(),this.flushWhenIdleScheduler.schedule()})}shouldFlushWhenIdle(){return!0}stopFlushWhenIdle(){xt([this.runFlushWhenIdle,this.flushWhenIdleScheduler])}initialize(){return this.initializationPromise||=(async()=>{Ar(`code/willInitStorage`);try{await this.doInitialize()}finally{Ar(`code/didInitStorage`)}this.flushWhenIdleScheduler.schedule()})(),this.initializationPromise}emitDidChangeValue(e,t){let{key:n,external:r}=t;if(n===`__$__targetStorageMarker`){switch(e){case r_.APPLICATION_SHARED:this._applicationSharedKeyTargets=void 0;break;case r_.APPLICATION:this._applicationKeyTargets=void 0;break;case r_.PROFILE:this._profileKeyTargets=void 0;break;case r_.WORKSPACE:this._workspaceKeyTargets=void 0;break}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:n,target:this.getKeyTargets(e)[n],external:r})}emitWillSaveState(e){this._onWillSaveState.fire({reason:e})}get(e,t,n){return this.getStorage(t)?.get(e,n)}getBoolean(e,t,n){return this.getStorage(t)?.getBoolean(e,n)}getNumber(e,t,n){return this.getStorage(t)?.getNumber(e,n)}getObject(e,t,n){return this.getStorage(t)?.getObject(e,n)}storeAll(e,t){this.withPausedEmitters(()=>{for(let n of e)this.store(n.key,n.value,n.scope,n.target,t)})}store(e,t,n,r,i=!1){if(lt(t)){this.remove(e,n,i);return}this.withPausedEmitters(()=>{this.updateKeyTarget(e,n,r),this.getStorage(n)?.set(e,t,i)})}remove(e,t,n=!1){this.withPausedEmitters(()=>{this.updateKeyTarget(e,t,void 0),this.getStorage(t)?.delete(e,n)})}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}keys(e,t){let n=[],r=this.getKeyTargets(e);for(let e of Object.keys(r))r[e]===t&&n.push(e);return n}updateKeyTarget(e,t,n,r=!1){let i=this.getKeyTargets(t);typeof n==`number`?i[e]!==n&&(i[e]=n,this.getStorage(t)?.set(t_,JSON.stringify(i),r)):typeof i[e]==`number`&&(delete i[e],this.getStorage(t)?.set(t_,JSON.stringify(i),r))}get workspaceKeyTargets(){return this._workspaceKeyTargets||=this.loadKeyTargets(r_.WORKSPACE),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||=this.loadKeyTargets(r_.PROFILE),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||=this.loadKeyTargets(r_.APPLICATION),this._applicationKeyTargets}get applicationSharedKeyTargets(){return this._applicationSharedKeyTargets||=this.loadKeyTargets(r_.APPLICATION_SHARED),this._applicationSharedKeyTargets}getKeyTargets(e){switch(e){case r_.APPLICATION_SHARED:return this.applicationSharedKeyTargets;case r_.APPLICATION:return this.applicationKeyTargets;case r_.PROFILE:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){let t=this.getStorage(e);return t?a_(t):Object.create(null)}isNew(e){return this.getBoolean(`__$__isNewStorageMarker`,e)===!0}async flush(e=n_.NONE){this._onWillSaveState.fire({reason:e});let t=this.getStorage(r_.APPLICATION),n=this.getStorage(r_.APPLICATION_SHARED),r=this.getStorage(r_.PROFILE),i=this.getStorage(r_.WORKSPACE);switch(e){case n_.NONE:await Go.settled([t?.whenFlushed()??Promise.resolve(),n?.whenFlushed()??Promise.resolve(),r?.whenFlushed()??Promise.resolve(),i?.whenFlushed()??Promise.resolve()]);break;case n_.SHUTDOWN:await Go.settled([t?.flush(0)??Promise.resolve(),n?.flush(0)??Promise.resolve(),r?.flush(0)??Promise.resolve(),i?.flush(0)??Promise.resolve()]);break}}async log(){return s_(this.getStorage(r_.APPLICATION)?.items??new Map,this.getStorage(r_.APPLICATION_SHARED)?.items??new Map,this.getStorage(r_.PROFILE)?.items??new Map,this.getStorage(r_.WORKSPACE)?.items??new Map,this.getLogDetails(r_.APPLICATION)??``,this.getLogDetails(r_.APPLICATION_SHARED)??``,this.getLogDetails(r_.PROFILE)??``,this.getLogDetails(r_.WORKSPACE)??``)}async optimize(e){return await this.flush(),this.getStorage(e)?.optimize()}async switch(e,t){return this.emitWillSaveState(n_.NONE),Zg(e)?this.switchToProfile(e,t):this.switchToWorkspace(e,t)}canSwitchProfile(e,t){return!(e.id===t.id||o_(t)&&o_(e))}switchData(e,t,n){this.withPausedEmitters(()=>{let r=new Set;for(let[i,a]of e)r.add(i),t.get(i)!==a&&this.emitDidChangeValue(n,{key:i,external:!0});for(let[e]of t.items)r.has(e)||this.emitDidChangeValue(n,{key:e,external:!0})})}});function o_(e){return e.isDefault||!!e.useDefaultFlags?.globalState}async function s_(e,t,n,r,i,a,o,s){let c=e=>{try{return JSON.parse(e)}catch{return e}},l=new Map,u=new Map;e.forEach((e,t)=>{l.set(t,e),u.set(t,c(e))});let d=new Map,f=new Map;t.forEach((e,t)=>{d.set(t,e),f.set(t,c(e))});let p=new Map,m=new Map;n.forEach((e,t)=>{p.set(t,e),m.set(t,c(e))});let ee=new Map,te=new Map;r.forEach((e,t)=>{ee.set(t,e),te.set(t,c(e))}),console.group(i===o?`Storage: Application & Profile (path: ${i}, default profile)`:`Storage: Application (path: ${i})`);let ne=[];l.forEach((e,t)=>{ne.push({key:t,value:e})}),console.table(ne),console.groupEnd(),console.log(u),console.group(`Storage: Application Shared (path: ${a})`);let h=[];if(d.forEach((e,t)=>{h.push({key:t,value:e})}),console.table(h),console.groupEnd(),console.log(f),i!==o){console.group(`Storage: Profile (path: ${o}, profile specific)`);let e=[];p.forEach((t,n)=>{e.push({key:n,value:t})}),console.table(e),console.groupEnd(),console.log(m)}console.group(`Storage: Workspace (path: ${s})`);let re=[];ee.forEach((e,t)=>{re.push({key:t,value:e})}),console.table(re),console.groupEnd(),console.log(te)}const c_=O(`storageService`);var l_;(function(e){e[e.NONE=0]=`NONE`,e[e.CRASH=1]=`CRASH`,e[e.ERROR=2]=`ERROR`,e[e.USAGE=3]=`USAGE`})(l_||={});var u_;(function(e){e.OFF=`off`,e.CRASH=`crash`,e.ERROR=`error`,e.ON=`all`})(u_||={});const d_=O(`telemetryService`);O(`customEndpointTelemetryService`);const f_=O(`IAuthenticationService`);O(`IAuthenticationExtensionsService`);const p_=O(`openerService`),m_=Ms(Kg),h_=O(`lifecycleService`);function g_(e,t){return e===t}function __(){return(e,t)=>e===t}function v_(e,t,n){return ge(e,t,n??g_)}function y_(e){return(t,n)=>ge(t,n,e??g_)}function b_(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!b_(e[n],t[n]))return!1;return!0}if(e&&typeof e==`object`&&t&&typeof t==`object`&&Object.getPrototypeOf(e)===Object.prototype&&Object.getPrototypeOf(t)===Object.prototype){let n=e,r=t,i=Object.keys(n),a=Object.keys(r),o=new Set(a);if(i.length!==a.length)return!1;for(let e of i)if(!o.has(e)||!b_(n[e],r[e]))return!1;return!0}return!1}function x_(){return(e,t)=>b_(e,t)}function S_(e,t){return JSON.stringify(e)===JSON.stringify(t)}function C_(){return(e,t)=>JSON.stringify(e)===JSON.stringify(t)}function w_(){return(e,t)=>e.equals(t)}function T_(e,t,n){return e==null||t==null?t===e:n(e,t)}function E_(e){return(t,n)=>t==null||n==null?n===t:e(t,n)}var D_;(function(e){e.strict=g_,e.strictC=__,e.array=v_,e.arrayC=y_,e.structural=b_,e.structuralC=x_,e.jsonStringify=S_,e.jsonStringifyC=C_,e.thisC=w_,e.ifDefined=T_,e.ifDefinedC=E_})(D_||={});let O_;function k_(e){O_?O_ instanceof P_?O_.loggers.push(e):O_=new P_([O_,e]):O_=e}function A_(){return O_}let j_;function M_(e){j_=e}function N_(e){j_&&j_(e)}var P_=class{constructor(e){this.loggers=e}handleObservableCreated(e,t){for(let n of this.loggers)n.handleObservableCreated(e,t)}handleOnListenerCountChanged(e,t){for(let n of this.loggers)n.handleOnListenerCountChanged(e,t)}handleObservableUpdated(e,t){for(let n of this.loggers)n.handleObservableUpdated(e,t)}handleAutorunCreated(e,t){for(let n of this.loggers)n.handleAutorunCreated(e,t)}handleAutorunDisposed(e){for(let t of this.loggers)t.handleAutorunDisposed(e)}handleAutorunDependencyChanged(e,t,n){for(let r of this.loggers)r.handleAutorunDependencyChanged(e,t,n)}handleAutorunStarted(e){for(let t of this.loggers)t.handleAutorunStarted(e)}handleAutorunFinished(e){for(let t of this.loggers)t.handleAutorunFinished(e)}handleDerivedDependencyChanged(e,t,n){for(let r of this.loggers)r.handleDerivedDependencyChanged(e,t,n)}handleDerivedCleared(e){for(let t of this.loggers)t.handleDerivedCleared(e)}handleBeginTransaction(e){for(let t of this.loggers)t.handleBeginTransaction(e)}handleEndTransaction(e){for(let t of this.loggers)t.handleEndTransaction(e)}},F_;(function(e){let t=!1;function n(){t=!0}e.enable=n;function r(){if(!t)return;let e=Error,n=e.stackTraceLimit;e.stackTraceLimit=3;let r=Error().stack;return e.stackTraceLimit=n,I_.fromStack(r,2)}e.ofCaller=r})(F_||={});var I_=class e{static fromStack(t,n){let r=L_(t.split(`
|
|
79
|
+
`)[n+1]);if(r)return new e(r.fileName,r.line,r.column,r.id)}constructor(e,t,n,r){this.fileName=e,this.line=t,this.column=n,this.id=r}};function L_(e){let t=e.match(/\((.*):(\d+):(\d+)\)/);if(t)return{fileName:t[1],line:parseInt(t[2]),column:parseInt(t[3]),id:e};let n=e.match(/at ([^\(\)]*):(\d+):(\d+)/);if(n)return{fileName:n[1],line:parseInt(n[2]),column:parseInt(n[3]),id:e}}var R_=class{constructor(e,t,n){this.owner=e,this.debugNameSource=t,this.referenceFn=n}getDebugName(e){return V_(e,this)}};const z_=new Map,B_=new WeakMap;function V_(e,t){let n=B_.get(e);if(n)return n;let r=H_(e,t);if(r){let t=z_.get(r)??0;t++,z_.set(r,t);let n=t===1?r:`${r}#${t}`;return B_.set(e,n),n}}function H_(e,t){let n=B_.get(e);if(n)return n;let r=t.owner?K_(t.owner)+`.`:``,i,a=t.debugNameSource;if(a!==void 0)if(typeof a==`function`){if(i=a(),i!==void 0)return r+i}else return r+a;let o=t.referenceFn;if(o!==void 0&&(i=J_(o),i!==void 0))return r+i;if(t.owner!==void 0){let n=U_(t.owner,e);if(n!==void 0)return r+n}}function U_(e,t){for(let n in e)if(e[n]===t)return n}const W_=new Map,G_=new WeakMap;function K_(e){let t=G_.get(e);if(t)return t;let n=q_(e)??`Object`,r=W_.get(n)??0;r++,W_.set(n,r);let i=r===1?n:`${n}#${r}`;return G_.set(e,i),i}function q_(e){let t=e.constructor;if(t)return t.name===`Object`?void 0:t.name}function J_(e){let t=e.toString(),n=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t);return(n?n[1]:void 0)?.trim()}let Y_;function X_(e){Y_=e}let Z_;function Q_(e){Z_=e}let $_;function ev(e){$_=e}let tv;function nv(e){tv=e}var rv=class{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t,n=F_.ofCaller()){let r=t===void 0?void 0:e,i=t===void 0?e:t;return Y_({owner:r,debugName:()=>{let e=J_(i);if(e!==void 0)return e;let t=/^\s*\(?\s*([a-zA-Z_$][a-zA-Z_$0-9]*)\s*\)?\s*=>\s*\1(?:\??)\.([a-zA-Z_$][a-zA-Z_$0-9]*)\s*$/.exec(i.toString());if(t)return`${this.debugName}.${t[2]}`;if(!r)return`${this.debugName} (mapped)`},debugReferenceFn:i},e=>i(this.read(e),e),n)}flatten(){return Y_({owner:void 0,debugName:()=>`${this.debugName} (flattened)`},e=>this.read(e).read(e))}recomputeInitiallyAndOnChange(e,t){return e.add(Z_(this,t)),this}keepObserved(e){return e.add($_(this)),this}get debugValue(){return this.get()}get debug(){return new iv(this)}},iv=class{constructor(e){this.observable=e}getDependencyGraph(){return tv(this.observable,{type:`dependencies`})}getObserverGraph(){return tv(this.observable,{type:`observers`})}},av=class extends rv{constructor(e){super(),this._observers=new Set,A_()?.handleObservableCreated(this,e)}addObserver(e){let t=this._observers.size;this._observers.add(e),t===0&&this.onFirstObserverAdded(),t!==this._observers.size&&A_()?.handleOnListenerCountChanged(this,this._observers.size)}removeObserver(e){let t=this._observers.delete(e);t&&this._observers.size===0&&this.onLastObserverRemoved(),t&&A_()?.handleOnListenerCountChanged(this,this._observers.size)}onFirstObserverAdded(){}onLastObserverRemoved(){}log(){let e=!!A_();return N_(this),e||A_()?.handleObservableCreated(this,F_.ofCaller()),this}debugGetObservers(){return this._observers}},ov;(function(e){e[e.dependenciesMightHaveChanged=1]=`dependenciesMightHaveChanged`,e[e.stale=2]=`stale`,e[e.upToDate=3]=`upToDate`})(ov||={});function sv(e){switch(e){case ov.dependenciesMightHaveChanged:return`dependenciesMightHaveChanged`;case ov.stale:return`stale`;case ov.upToDate:return`upToDate`;default:return`<unknown>`}}var cv=class{get debugName(){return this._debugNameData.getDebugName(this)??`(anonymous)`}constructor(e,t,n,r){this._debugNameData=e,this._runFn=t,this._changeTracker=n,this._state=ov.stale,this._updateCount=0,this._disposed=!1,this._dependencies=new Set,this._dependenciesToBeRemoved=new Set,this._isRunning=!1,this._iteration=0,this._store=void 0,this._delayedStore=void 0,this._changeSummary=this._changeTracker?.createChangeSummary(void 0),A_()?.handleAutorunCreated(this,r),this._run()}dispose(){if(!this._disposed){this._disposed=!0;for(let e of this._dependencies)e.removeObserver(this);this._dependencies.clear(),this._store!==void 0&&this._store.dispose(),this._delayedStore!==void 0&&this._delayedStore.dispose(),A_()?.handleAutorunDisposed(this)}}_run(){let e=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=e,this._state=ov.upToDate;try{if(!this._disposed){A_()?.handleAutorunStarted(this);let e=this._changeSummary,t=this._delayedStore;t!==void 0&&(this._delayedStore=void 0);try{this._isRunning=!0,this._changeTracker&&(this._changeTracker.beforeUpdate?.(this,e),this._changeSummary=this._changeTracker.createChangeSummary(e)),this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._runFn(this,e)}catch(e){p(e)}finally{this._isRunning=!1,t!==void 0&&t.dispose()}}}finally{this._disposed||A_()?.handleAutorunFinished(this);for(let e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(e){this._state===ov.upToDate&&(this._checkIterations(),this._state=ov.dependenciesMightHaveChanged),this._updateCount++}endUpdate(e){try{if(this._updateCount===1){this._iteration=1;do{if(this._checkIterations())return;if(this._state===ov.dependenciesMightHaveChanged){this._state=ov.upToDate;for(let e of this._dependencies)if(e.reportChanges(),this._state===ov.stale)break}this._iteration++,this._state!==ov.upToDate&&this._run()}while(this._state!==ov.upToDate)}}finally{this._updateCount--}$e(()=>this._updateCount>=0)}handlePossibleChange(e){this._state===ov.upToDate&&this._isDependency(e)&&(this._checkIterations(),this._state=ov.dependenciesMightHaveChanged)}handleChange(e,t){if(this._isDependency(e)){A_()?.handleAutorunDependencyChanged(this,e,t);try{(!this._changeTracker||this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary))&&(this._checkIterations(),this._state=ov.stale)}catch(e){p(e)}}}_isDependency(e){return this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)}_ensureNoRunning(){if(!this._isRunning)throw new me(`The reader object cannot be used outside its compute function!`)}readObservable(e){if(this._ensureNoRunning(),this._disposed)return e.get();e.addObserver(this);let t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}get store(){if(this._ensureNoRunning(),this._disposed)throw new me(`Cannot access store after dispose`);return this._store===void 0&&(this._store=new _),this._store}get delayedStore(){if(this._ensureNoRunning(),this._disposed)throw new me(`Cannot access store after dispose`);return this._delayedStore===void 0&&(this._delayedStore=new _),this._delayedStore}debugGetState(){return{isRunning:this._isRunning,updateCount:this._updateCount,dependencies:this._dependencies,state:this._state,stateStr:sv(this._state)}}debugRerun(){this._isRunning?this._state=ov.stale:this._run()}_checkIterations(){return this._iteration>100?(p(new me(`Autorun '${this.debugName}' is stuck in an infinite update loop.`)),!0):!1}},lv;(function(e){e[e.initial=0]=`initial`,e[e.dependenciesMightHaveChanged=1]=`dependenciesMightHaveChanged`,e[e.stale=2]=`stale`,e[e.upToDate=3]=`upToDate`})(lv||={});function uv(e){switch(e){case lv.initial:return`initial`;case lv.dependenciesMightHaveChanged:return`dependenciesMightHaveChanged`;case lv.stale:return`stale`;case lv.upToDate:return`upToDate`;default:return`<unknown>`}}var dv=class extends av{get debugName(){return this._debugNameData.getDebugName(this)??`(anonymous)`}constructor(e,t,n,r=void 0,i,a){super(a),this._debugNameData=e,this._computeFn=t,this._changeTracker=n,this._handleLastObserverRemoved=r,this._equalityComparator=i,this._state=lv.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=lv.initial,this._value=void 0,A_()?.handleDerivedCleared(this);for(let 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===lv.dependenciesMightHaveChanged){for(let e of this._dependencies)if(e.reportChanges(),this._state===lv.stale)break}this._state===lv.dependenciesMightHaveChanged&&(this._state=lv.upToDate),this._state!==lv.upToDate&&this._recompute()}while(this._state!==lv.upToDate);return this._value}}_recompute(){let e=!1;this._isComputing=!0,this._didReportChange=!1;let t=this._dependenciesToBeRemoved;this._dependenciesToBeRemoved=this._dependencies,this._dependencies=t;try{let t=this._changeSummary;this._isReaderValid=!0,this._changeTracker&&(this._isInBeforeUpdate=!0,this._changeTracker.beforeUpdate?.(this,t),this._isInBeforeUpdate=!1,this._changeSummary=this._changeTracker?.createChangeSummary(t));let n=this._state!==lv.initial,r=this._value;this._state=lv.upToDate;let i=this._delayedStore;i!==void 0&&(this._delayedStore=void 0);try{this._store!==void 0&&(this._store.dispose(),this._store=void 0),this._value=this._computeFn(this,t)}finally{this._isReaderValid=!1;for(let e of this._dependenciesToBeRemoved)e.removeObserver(this);this._dependenciesToBeRemoved.clear(),i!==void 0&&i.dispose()}e=this._didReportChange||n&&!this._equalityComparator(r,this._value),A_()?.handleObservableUpdated(this,{oldValue:r,newValue:this._value,change:void 0,didChange:e,hadValue:n})}catch(e){p(e)}if(this._isComputing=!1,!this._didReportChange&&e)for(let e of this._observers)e.handleChange(this,void 0);else this._didReportChange=!1}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){if(this._isUpdating)throw new me(`Cyclic deriveds are not supported yet!`);this._updateCount++,this._isUpdating=!0;try{let e=this._updateCount===1;if(this._state===lv.upToDate&&(this._state=lv.dependenciesMightHaveChanged,!e))for(let e of this._observers)e.handlePossibleChange(this);if(e)for(let e of this._observers)e.beginUpdate(this)}finally{this._isUpdating=!1}}endUpdate(e){if(this._updateCount--,this._updateCount===0){let e=[...this._observers];for(let t of e)t.endUpdate(this);if(this._removedObserverToCallEndUpdateOn){let e=[...this._removedObserverToCallEndUpdateOn];this._removedObserverToCallEndUpdateOn=null;for(let t of e)t.endUpdate(this)}}$e(()=>this._updateCount>=0)}handlePossibleChange(e){if(this._state===lv.upToDate&&this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)){this._state=lv.dependenciesMightHaveChanged;for(let e of this._observers)e.handlePossibleChange(this)}}handleChange(e,t){if(this._dependencies.has(e)&&!this._dependenciesToBeRemoved.has(e)||this._isInBeforeUpdate){A_()?.handleDerivedDependencyChanged(this,e,t);let n=!1;try{n=this._changeTracker?this._changeTracker.handleChange({changedObservable:e,change:t,didChange:t=>t===e},this._changeSummary):!0}catch(e){p(e)}let r=this._state===lv.upToDate;if(n&&(this._state===lv.dependenciesMightHaveChanged||r)&&(this._state=lv.stale,r))for(let e of this._observers)e.handlePossibleChange(this)}}_ensureReaderValid(){if(!this._isReaderValid)throw new me(`The reader object cannot be used outside its compute function!`)}readObservable(e){this._ensureReaderValid(),e.addObserver(this);let t=e.get();return this._dependencies.add(e),this._dependenciesToBeRemoved.delete(e),t}reportChange(e){this._ensureReaderValid(),this._didReportChange=!0;for(let t of this._observers)t.handleChange(this,e)}get store(){return this._ensureReaderValid(),this._store===void 0&&(this._store=new _),this._store}get delayedStore(){return this._ensureReaderValid(),this._delayedStore===void 0&&(this._delayedStore=new _),this._delayedStore}addObserver(e){let t=!this._observers.has(e)&&this._updateCount>0;super.addObserver(e),t&&(this._removedObserverToCallEndUpdateOn?.delete(e)||e.beginUpdate(this))}removeObserver(e){this._observers.has(e)&&this._updateCount>0&&(this._removedObserverToCallEndUpdateOn||=new Set,this._removedObserverToCallEndUpdateOn.add(e)),super.removeObserver(e)}debugGetState(){return{state:this._state,stateStr:uv(this._state),updateCount:this._updateCount,isComputing:this._isComputing,dependencies:this._dependencies,value:this._value}}debugSetValue(e){this._value=e}debugRecompute(){this.beginUpdate(this);try{this._isComputing?this._state=lv.stale:this._recompute()}finally{this.endUpdate(this)}}setValue(e,t,n){this._value=e;let r=this._observers;t.updateObserver(this,this);for(let e of r)e.handleChange(this,n)}};function fv(e,t,n=F_.ofCaller()){return new dv(new R_(e.owner,e.debugName,e.debugReferenceFn),t,void 0,e.onLastObserverRemoved,e.equalsFn??g_,n)}X_(fv);function pv(e,t=F_.ofCaller()){return new cv(new R_(void 0,void 0,e),e,void 0,t)}function mv(e){let t=Error(`BugIndicatingErrorRecovery: `+e);m(t),console.error(`recovered from an error that indicates a bug`,t)}function hv(e,t){let n=new _v(e,t);try{e(n)}finally{n.finish()}}function gv(e,t,n){e?t(e):hv(t,n)}var _v=class{constructor(e,t){this._fn=e,this._getDebugName=t,this._updatingObservers=[],A_()?.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():J_(this._fn)}updateObserver(e,t){if(!this._updatingObservers){mv(`Transaction already finished!`),hv(n=>{n.updateObserver(e,t)});return}this._updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){let e=this._updatingObservers;if(!e){mv(`transaction.finish() has already been called!`);return}for(let t=0;t<e.length;t++){let{observer:n,observable:r}=e[t];n.endUpdate(r)}this._updatingObservers=null,A_()?.handleEndTransaction(this)}debugGetUpdatingObservers(){return this._updatingObservers}};function vv(e,t,n=F_.ofCaller()){let r;return r=typeof e==`string`?new R_(void 0,e,void 0):new R_(e,void 0,void 0),new yv(r,t,g_,n)}var yv=class extends av{get debugName(){return this._debugNameData.getDebugName(this)??`ObservableValue`}constructor(e,t,n,r){super(r),this._debugNameData=e,this._equalityComparator=n,this._value=t,A_()?.handleObservableUpdated(this,{hadValue:!1,newValue:t,change:void 0,didChange:!0,oldValue:void 0})}get(){return this._value}set(e,t,n){if(n===void 0&&this._equalityComparator(this._value,e))return;let r;t||=r=new _v(()=>{},()=>`Setting ${this.debugName}`);try{let r=this._value;this._setValue(e),A_()?.handleObservableUpdated(this,{oldValue:r,newValue:e,change:n,didChange:!0,hadValue:!0});for(let e of this._observers)t.updateObserver(e,this),e.handleChange(this,n)}finally{r&&r.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}debugGetState(){return{value:this._value}}debugSetValue(e){this._value=e}};function bv(...e){let t,n,r,i;return e.length===2?[n,r]=e:[t,n,r,i]=e,new xv(new R_(t,void 0,r),n,r,()=>xv.globalTransaction,g_,i??F_.ofCaller())}var xv=class extends av{constructor(e,t,n,r,i,a){super(a),this._debugNameData=e,this.event=t,this._getValue=n,this._getTransaction=r,this._equalityComparator=i,this._hasValue=!1,this.handleEvent=e=>{let t=this._getValue(e),n=this._value,r=!this._hasValue||!this._equalityComparator(n,t),i=!1;r&&(this._value=t,this._hasValue&&(i=!0,gv(this._getTransaction(),e=>{A_()?.handleObservableUpdated(this,{oldValue:n,newValue:t,change:void 0,didChange:r,hadValue:this._hasValue});for(let t of this._observers)e.updateObserver(t,this),t.handleChange(this,void 0)},()=>{let e=this.getDebugName();return`Event fired`+(e?`: ${e}`:``)})),this._hasValue=!0),i||A_()?.handleObservableUpdated(this,{oldValue:n,newValue:t,change:void 0,didChange:r,hadValue:this._hasValue})}}getDebugName(){return this._debugNameData.getDebugName(this)}get debugName(){let 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}debugGetState(){return{value:this._value,hasValue:this._hasValue}}};(function(e){e.Observer=xv;function t(e,t){let n=!1;xv.globalTransaction===void 0&&(xv.globalTransaction=e,n=!0);try{t()}finally{n&&(xv.globalTransaction=void 0)}}e.batchEventsGlobally=t})(bv||={});function Sv(e){let t=new wv(!1,void 0);return e.addObserver(t),g(()=>{e.removeObserver(t)})}ev(Sv);function Cv(e,t){let n=new wv(!0,t);e.addObserver(n);try{n.beginUpdate(e)}finally{n.endUpdate(e)}return g(()=>{e.removeObserver(n)})}Q_(Cv);var wv=class{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 Tv;function Ev(e){Tv||(Tv=new Dv,k_(Tv)),Tv.addFilteredObj(e)}var Dv=class{constructor(){this.indentation=0,this.changedObservablesSets=new WeakMap}addFilteredObj(e){this._filteredObjects||=new Set,this._filteredObjects.add(e)}_isIncluded(e){return this._filteredObjects?.has(e)??!0}textToConsoleArgs(e){return Ov([kv(Fv(`| `,this.indentation)),e])}formatInfo(e){return e.hadValue?e.didChange?[kv(` `),jv(Mv(e.oldValue,70),{color:`red`,strikeThrough:!0}),kv(` `),jv(Mv(e.newValue,60),{color:`green`})]:[kv(` (unchanged)`)]:[kv(` `),jv(Mv(e.newValue,60),{color:`green`}),kv(` (initial)`)]}handleObservableCreated(e){if(e instanceof dv){let t=e;this.changedObservablesSets.set(t,new Set)}}handleOnListenerCountChanged(e,t){}handleObservableUpdated(e,t){if(this._isIncluded(e)){if(e instanceof dv){this._handleDerivedRecomputed(e,t);return}console.log(...this.textToConsoleArgs([Av(`observable value changed`),jv(e.debugName,{color:`BlueViolet`}),...this.formatInfo(t)]))}}formatChanges(e){if(e.size!==0)return jv(` (changed deps: `+[...e].map(e=>e.debugName).join(`, `)+`)`,{color:`gray`})}handleDerivedDependencyChanged(e,t,n){this._isIncluded(e)&&this.changedObservablesSets.get(e)?.add(t)}_handleDerivedRecomputed(e,t){if(!this._isIncluded(e))return;let n=this.changedObservablesSets.get(e);n&&(console.log(...this.textToConsoleArgs([Av(`derived recomputed`),jv(e.debugName,{color:`BlueViolet`}),...this.formatInfo(t),this.formatChanges(n),{data:[{fn:e._debugNameData.referenceFn??e._computeFn}]}])),n.clear())}handleDerivedCleared(e){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Av(`derived cleared`),jv(e.debugName,{color:`BlueViolet`})]))}handleFromEventObservableTriggered(e,t){this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Av(`observable from event triggered`),jv(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,n){this._isIncluded(e)&&this.changedObservablesSets.get(e).add(t)}handleAutorunStarted(e){let t=this.changedObservablesSets.get(e);t&&(this._isIncluded(e)&&console.log(...this.textToConsoleArgs([Av(`autorun`),jv(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([Av(`transaction`),jv(t,{color:`BlueViolet`}),{data:[{fn:e._fn}]}])),this.indentation++}handleEndTransaction(){this.indentation--}};function Ov(e){let t=[],n=[],r=``;function i(e){if(`length`in e)for(let t of e)t&&i(t);else `text`in e?(r+=`%c${e.text}`,t.push(e.style),e.data&&n.push(...e.data)):`data`in e&&n.push(...e.data)}i(e);let a=[r,...t];return a.push(...n),a}function kv(e){return jv(e,{color:`black`})}function Av(e){return jv(Iv(`${e}: `,10),{color:`black`,bold:!0})}function jv(e,t={color:`black`}){function n(e){return Object.entries(e).reduce((e,[t,n])=>`${e}${t}:${n};`,``)}let r={color:t.color};return t.strikeThrough&&(r[`text-decoration`]=`line-through`),t.bold&&(r[`font-weight`]=`bold`),{text:e,style:n(r)}}function Mv(e,t){switch(typeof e){case`number`:return``+e;case`string`:return e.length+2<=t?`"${e}"`:`"${e.substr(0,t-7)}"+...`;case`boolean`:return e?`true`:`false`;case`undefined`:return`undefined`;case`object`:return e===null?`null`:Array.isArray(e)?Nv(e,t):Pv(e,t);case`symbol`:return e.toString();case`function`:return`[[Function${e.name?` `+e.name:``}]]`;default:return``+e}}function Nv(e,t){let n=`[ `,r=!0;for(let i of e){if(r||(n+=`, `),n.length-5>t){n+=`...`;break}r=!1,n+=`${Mv(i,t-n.length)}`}return n+=` ]`,n}function Pv(e,t){if(typeof e.toString==`function`&&e.toString!==Object.prototype.toString){let n=e.toString();return n.length<=t?n:n.substring(0,t-3)+`...`}let n=q_(e),r=n?n+`(`:`{ `,i=!0;for(let[n,a]of Object.entries(e)){if(i||(r+=`, `),r.length-5>t){r+=`...`;break}i=!1,r+=`${n}: ${Mv(a,t-r.length)}`}return r+=n?`)`:` }`,r}function Fv(e,t){let n=``;for(let r=1;r<=t;r++)n+=e;return n}function Iv(e,t){for(;e.length<t;)e+=` `;return e}var Lv=class e{static createHost(t,n){return new e(t,n)}static createClient(t,n){return new e(t,n)}constructor(e,t){this._channelFactory=e,this._getHandler=t,this._channel=this._channelFactory({handleNotification:e=>{let t=e,n=this._getHandler().notifications[t[0]];if(!n)throw Error(`Unknown notification "${t[0]}"!`);n(...t[1])},handleRequest:e=>{let t=e;try{return{type:`result`,value:this._getHandler().requests[t[0]](...t[1])}}catch(e){return{type:`error`,value:e}}}});let n=new Proxy({},{get:(e,t)=>async(...e)=>{let n=await this._channel.sendRequest([t,e]);if(n.type===`error`)throw n.value;return n.value}}),r=new Proxy({},{get:(e,t)=>(...e)=>{this._channel.sendNotification([t,e])}});this.api={notifications:r,requests:n}}};function Rv(e,t){let n=globalThis,r=[],i,{channel:a,handler:o}=zv({sendNotification:e=>{i?i.sendNotification(e):r.push(e)}}),s;return(n.$$debugValueEditor_debugChannels??={})[e]=e=>{s=t(),i=e;for(let t of r)e.sendNotification(t);return r=[],o},Lv.createClient(a,()=>{if(!s)throw Error(`Not supported`);return s})}function zv(e){let t;return{channel:n=>(t=n,{sendNotification:t=>{e.sendNotification(t)},sendRequest:e=>{throw Error(`not supported`)}}),handler:{handleRequest:e=>e.type===`notification`?t?.handleNotification(e.data):t?.handleRequest(e.data)}}}var Bv=class{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 Vv(e,t){for(let n in t)e[n]&&typeof e[n]==`object`&&t[n]&&typeof t[n]==`object`?Vv(e[n],t[n]):e[n]=t[n]}function Hv(e,t){for(let n in t)t[n]===null?delete e[n]:e[n]&&typeof e[n]==`object`&&t[n]&&typeof t[n]==`object`?Hv(e[n],t[n]):e[n]=t[n]}var Uv=class e{static{this._instance=void 0}static getInstance(){return e._instance===void 0&&(e._instance=new e),e._instance}getTransactionState(){let e=[],t=[...this._activeTransactions];if(t.length===0)return;let n=t.flatMap(e=>e.debugGetUpdatingObservers()??[]).map(e=>e.observer),r=new Set;for(;n.length>0;){let t=n.shift();if(r.has(t))continue;r.add(t);let i=this._getInfo(t,e=>{r.has(e)||n.push(e)});i&&e.push(i)}return{names:t.map(e=>e.getDebugName()??`tx`),affected:e}}_getObservableInfo(e){let t=this._instanceInfos.get(e);if(!t){m(new me(`No info found`));return}return t}_getAutorunInfo(e){let t=this._instanceInfos.get(e);if(!t){m(new me(`No info found`));return}return t}_getInfo(e,t){if(e instanceof dv){let n=[...e.debugGetObservers()];for(let e of n)t(e);let r=this._getObservableInfo(e);if(!r)return;let i=e.debugGetState(),a={name:e.debugName,instanceId:r.instanceId,updateCount:i.updateCount},o=[...r.changedObservables].map(e=>this._instanceInfos.get(e)?.instanceId).filter(ct);if(i.isComputing)return{...a,type:`observable/derived`,state:`updating`,changedDependencies:o,initialComputation:!1};switch(i.state){case lv.initial:return{...a,type:`observable/derived`,state:`noValue`};case lv.upToDate:return{...a,type:`observable/derived`,state:`upToDate`};case lv.stale:return{...a,type:`observable/derived`,state:`stale`,changedDependencies:o};case lv.dependenciesMightHaveChanged:return{...a,type:`observable/derived`,state:`possiblyStale`}}}else if(e instanceof cv){let t=this._getAutorunInfo(e);if(!t)return;let n={name:e.debugName,instanceId:t.instanceId,updateCount:t.updateCount},r=[...t.changedObservables].map(e=>this._instanceInfos.get(e).instanceId);if(e.debugGetState().isRunning)return{...n,type:`autorun`,state:`updating`,changedDependencies:r};switch(e.debugGetState().state){case ov.upToDate:return{...n,type:`autorun`,state:`upToDate`};case ov.stale:return{...n,type:`autorun`,state:`stale`,changedDependencies:r};case ov.dependenciesMightHaveChanged:return{...n,type:`autorun`,state:`possiblyStale`}}}}_formatObservable(e){let t=this._getObservableInfo(e);if(t)return{name:e.debugName,instanceId:t.instanceId}}_formatObserver(e){if(e instanceof dv)return{name:e.toString(),instanceId:this._getObservableInfo(e)?.instanceId};let 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=Rv(`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:()=>{let e={};for(let t of this._declarations.values())e[t.id]=t;return{decls:e}},getSummarizedInstances:()=>null,getObservableValueInfo:e=>({observers:[...this._aliveInstances.get(e).debugGetObservers()].map(e=>this._formatObserver(e)).filter(ct)}),getDerivedInfo:e=>{let t=this._aliveInstances.get(e);return{dependencies:[...t.debugGetState().dependencies].map(e=>this._formatObservable(e)).filter(ct),observers:[...t.debugGetObservers()].map(e=>this._formatObserver(e)).filter(ct)}},getAutorunInfo:e=>({dependencies:[...this._aliveInstances.get(e).debugGetState().dependencies].map(e=>this._formatObservable(e)).filter(ct)}),getTransactionState:()=>this.getTransactionState(),setValue:(e,t)=>{let n=this._aliveInstances.get(e);if(n instanceof dv)n.debugSetValue(t);else if(n instanceof yv)n.debugSetValue(t);else if(n instanceof xv)n.debugSetValue(t);else throw new me(`Observable is not supported`);let r=[...n.debugGetObservers()];for(let e of r)e.beginUpdate(n);for(let e of r)e.handleChange(n,void 0);for(let e of r)e.endUpdate(n)},getValue:e=>{let t=this._aliveInstances.get(e);if(t instanceof dv||t instanceof yv)return Mv(t.debugGetState().value,200)},logValue:e=>{let t=this._aliveInstances.get(e);if(t&&`get`in t)console.log(`Logged Value:`,t.get());else throw new me(`Observable is not supported`)},rerun:e=>{let t=this._aliveInstances.get(e);if(t instanceof dv)t.debugRecompute();else if(t instanceof cv)t.debugRerun();else throw new me(`Observable is not supported`)}}})),this._pendingChanges=null,this._changeThrottler=new Bv,this._fullState={},this._flushUpdates=()=>{this._pendingChanges!==null&&(this._channel.api.notifications.handleChange(this._pendingChanges,!1),this._pendingChanges=null)},F_.enable()}_handleChange(e){Hv(this._fullState,e),this._pendingChanges===null?this._pendingChanges=e:Vv(this._pendingChanges,e),this._changeThrottler.throttle(this._flushUpdates,10)}_getDeclarationId(e,t){if(!t)return-1;let n=this._declarations.get(t.id);return n===void 0&&(n={id:this._declarationId++,type:e,url:t.fileName,line:t.line,column:t.column},this._declarations.set(t.id,n),this._handleChange({decls:{[n.id]:n}})),n.id}handleObservableCreated(e,t){let n={declarationId:this._getDeclarationId(`observable/value`,t),instanceId:this._instanceId++,listenerCount:0,lastValue:void 0,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n)}handleOnListenerCountChanged(e,t){let n=this._getObservableInfo(e);if(n){if(n.listenerCount===0&&t>0){let t=e instanceof dv?`observable/derived`:`observable/value`;this._aliveInstances.set(n.instanceId,e),this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,formattedValue:n.lastValue,type:t,name:e.debugName}}})}else n.listenerCount>0&&t===0&&(this._handleChange({instances:{[n.instanceId]:null}}),this._aliveInstances.delete(n.instanceId));n.listenerCount=t}}handleObservableUpdated(e,t){if(e instanceof dv){this._handleDerivedRecomputed(e,t);return}let n=this._getObservableInfo(e);n&&t.didChange&&(n.lastValue=Mv(t.newValue,30),n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:n.lastValue}}}))}handleAutorunCreated(e,t){let n={declarationId:this._getDeclarationId(`autorun`,t),instanceId:this._instanceId++,updateCount:0,changedObservables:new Set};this._instanceInfos.set(e,n),this._aliveInstances.set(n.instanceId,e),n&&this._handleChange({instances:{[n.instanceId]:{instanceId:n.instanceId,declarationId:n.declarationId,runCount:0,type:`autorun`,name:e.debugName}}})}handleAutorunDisposed(e){let t=this._getAutorunInfo(e);t&&(this._handleChange({instances:{[t.instanceId]:null}}),this._instanceInfos.delete(e),this._aliveInstances.delete(t.instanceId))}handleAutorunDependencyChanged(e,t,n){let r=this._getAutorunInfo(e);r&&r.changedObservables.add(t)}handleAutorunStarted(e){}handleAutorunFinished(e){let t=this._getAutorunInfo(e);t&&(t.changedObservables.clear(),t.updateCount++,this._handleChange({instances:{[t.instanceId]:{runCount:t.updateCount}}}))}handleDerivedDependencyChanged(e,t,n){let r=this._getObservableInfo(e);r&&r.changedObservables.add(t)}_handleDerivedRecomputed(e,t){let n=this._getObservableInfo(e);if(!n)return;let r=Mv(t.newValue,30);n.updateCount++,n.changedObservables.clear(),n.lastValue=r,n.listenerCount>0&&this._handleChange({instances:{[n.instanceId]:{formattedValue:r,recomputationCount:n.updateCount}}})}handleDerivedCleared(e){let 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)}};function Wv(e,t){let n=t?.debugNamePostProcessor??(e=>e),r=qv.from(e,n);if(!r)return``;let i=new Set;return t.type===`observers`?Kv(r,0,i,t).trim():Gv(r,0,i,t).trim()}function Gv(e,t,n,r){let i=` `.repeat(t),a=[];if(n.has(e.sourceObj))return a.push(`${i}* ${e.type} ${e.name} (already listed)`),a.join(`
|
|
80
|
+
`);if(n.add(e.sourceObj),a.push(`${i}* ${e.type} ${e.name}:`),a.push(`${i} value: ${Mv(e.value,50)}`),a.push(`${i} state: ${e.state}`),e.dependencies.length>0){a.push(`${i} dependencies:`);for(let i of e.dependencies){let e=qv.from(i,r.debugNamePostProcessor??(e=>e))??qv.unknown(i);a.push(Gv(e,t+1,n,r))}}return a.join(`
|
|
81
|
+
`)}function Kv(e,t,n,r){let i=` `.repeat(t),a=[];if(n.has(e.sourceObj))return a.push(`${i}* ${e.type} ${e.name} (already listed)`),a.join(`
|
|
82
|
+
`);if(n.add(e.sourceObj),a.push(`${i}* ${e.type} ${e.name}:`),a.push(`${i} value: ${Mv(e.value,50)}`),a.push(`${i} state: ${e.state}`),e.observers.length>0){a.push(`${i} observers:`);for(let i of e.observers){let e=qv.from(i,r.debugNamePostProcessor??(e=>e))??qv.unknown(i);a.push(Kv(e,t+1,n,r))}}return a.join(`
|
|
83
|
+
`)}var qv=class e{static from(t,n){if(t instanceof cv){let r=t.debugGetState();return new e(t,n(t.debugName),`autorun`,void 0,r.stateStr,Array.from(r.dependencies),[])}else if(t instanceof dv){let r=t.debugGetState();return new e(t,n(t.debugName),`derived`,r.value,r.stateStr,Array.from(r.dependencies),Array.from(t.debugGetObservers()))}else if(t instanceof yv){let r=t.debugGetState();return new e(t,n(t.debugName),`observableValue`,r.value,`upToDate`,[],Array.from(t.debugGetObservers()))}else if(t instanceof xv){let r=t.debugGetState();return new e(t,n(t.debugName),`fromEvent`,r.value,r.hasValue?`upToDate`:`initial`,[],Array.from(t.debugGetObservers()))}}static unknown(t){return new e(t,`(unknown)`,`unknown`,void 0,`unknown`,[],[])}constructor(e,t,n,r,i,a,o){this.sourceObj=e,this.name=t,this.type=n,this.value=r,this.state=i,this.dependencies=a,this.observers=o}};nv(Wv),M_(Ev),Qn&&Qn.VSCODE_DEV_DEBUG_OBSERVABLES&&k_(Uv.getInstance());const Jv=O(`defaultAccountService`);var Yv,Xv,U;(function(e){e.Setup={hidden:new F(`chatSetupHidden`,!1,!0),installed:new F(`chatSetupInstalled`,!1,!0),disabled:new F(`chatSetupDisabled`,!1,!0),disabledInWorkspace:new F(`chatSetupDisabledInWorkspace`,!1,!0),untrusted:new F(`chatSetupUntrusted`,!1,!0),later:new F(`chatSetupLater`,!1,!0),registered:new F(`chatSetupRegistered`,!1,!0),completed:new F(`chatSetupCompleted`,!1,!0)},e.Entitlement={signedOut:new F(`chatEntitlementSignedOut`,!1,!0),canSignUp:new F(`chatPlanCanSignUp`,!1,!0),planFree:new F(`chatPlanFree`,!1,!0),planPro:new F(`chatPlanPro`,!1,!0),planEdu:new F(`chatPlanEdu`,!1,!0),planProPlus:new F(`chatPlanProPlus`,!1,!0),planMax:new F(`chatPlanMax`,!1,!0),planBusiness:new F(`chatPlanBusiness`,!1,!0),planEnterprise:new F(`chatPlanEnterprise`,!1,!0),organisations:new F(`chatEntitlementOrganisations`,void 0,!0),internal:new F(`chatEntitlementInternal`,!1,!0),sku:new F(`chatEntitlementSku`,void 0,!0)},e.chatQuotaExceeded=new F(`chatQuotaExceeded`,!1,!0),e.completionsQuotaExceeded=new F(`completionsQuotaExceeded`,!1,!0),e.chatAnonymous=new F(`chatAnonymous`,!1,!0),e.clientByokEnabled=new F(`github.copilot.clientByokEnabled`,!0,!0),e.hasByokModels=new F(`github.copilot.hasByokModels`,!1,!0)})(U||={});var Zv;(function(e){e[e.Unknown=1]=`Unknown`,e[e.Unresolved=2]=`Unresolved`,e[e.Available=3]=`Available`,e[e.Unavailable=4]=`Unavailable`,e[e.Free=5]=`Free`,e[e.EDU=10]=`EDU`,e[e.Pro=6]=`Pro`,e[e.ProPlus=7]=`ProPlus`,e[e.Business=8]=`Business`,e[e.Enterprise=9]=`Enterprise`,e[e.Max=11]=`Max`})(Zv||={});function Qv(e){return e===Zv.EDU||e===Zv.Pro||e===Zv.ProPlus||e===Zv.Max||e===Zv.Business||e===Zv.Enterprise}const $v={upgradePlanUrl:Dh.defaultChatAgent?.upgradePlanUrl??``,entitlementSignupLimitedUrl:Dh.defaultChatAgent?.entitlementSignupLimitedUrl??``,chatQuotaExceededContext:Dh.defaultChatAgent?.chatQuotaExceededContext??``,completionsQuotaExceededContext:Dh.defaultChatAgent?.completionsQuotaExceededContext??``},ey=`chat.allowAnonymousAccess`;function ty(e,t,n){return!(e.getValue(ey)!==!0||t!==Zv.Unknown||n.hidden||n.disabledInWorkspace)}function ny(e,t,n){n.publicLog2(`chatEntitlements`,{chatHidden:!!e.hidden,chatDisabled:!!e.disabled,chatEntitlement:e.entitlement,chatRegistered:!!e.registered,chatAnonymous:ty(t,e.entitlement,e)})}let ry=class extends v{static{Yv=this}static{this.CACHED_UBB_STORAGE_KEY=`chat.usageBasedBilling`}constructor(e,t,n,r,i,a,o,s){super(),this.contextKeyService=r,this.configurationService=i,this.telemetryService=a,this.logService=o,this.storageService=s,this._onDidChangeQuotaExceeded=this._register(new x),this.onDidChangeQuotaExceeded=this._onDidChangeQuotaExceeded.event,this._onDidChangeQuotaRemaining=this._register(new x),this.onDidChangeQuotaRemaining=this._onDidChangeQuotaRemaining.event,this._onDidChangeUsageBasedBilling=this._register(new x),this.onDidChangeUsageBasedBilling=this._onDidChangeUsageBasedBilling.event,this.ExtensionQuotaContextKeys={chatQuotaExceeded:$v.chatQuotaExceededContext,completionsQuotaExceeded:$v.completionsQuotaExceededContext},this._onDidChangeAnonymous=this._register(new x),this.onDidChangeAnonymous=this._onDidChangeAnonymous.event,this.anonymousObs=bv(this.onDidChangeAnonymous,()=>this.anonymous);let c=this.storageService.getBoolean(Yv.CACHED_UBB_STORAGE_KEY,r_.PROFILE);if(this._quotas=c===void 0?{}:{usageBasedBilling:c},this.chatQuotaExceededContextKey=U.chatQuotaExceeded.bindTo(this.contextKeyService),this.completionsQuotaExceededContextKey=U.completionsQuotaExceeded.bindTo(this.contextKeyService),this.anonymousContextKey=U.chatAnonymous.bindTo(this.contextKeyService),this.anonymousContextKey.set(this.anonymous),this.contextKeyService.getContextKeyValue(U.clientByokEnabled.key)===void 0&&U.clientByokEnabled.bindTo(this.contextKeyService),this.onDidChangeEntitlement=ir.map(ir.filter(this.contextKeyService.onDidChangeContext,e=>e.affectsSome(new Set([U.Entitlement.planEdu.key,U.Entitlement.planPro.key,U.Entitlement.planBusiness.key,U.Entitlement.planEnterprise.key,U.Entitlement.planProPlus.key,U.Entitlement.planMax.key,U.Entitlement.planFree.key,U.Entitlement.canSignUp.key,U.Entitlement.signedOut.key,U.Entitlement.organisations.key,U.Entitlement.internal.key,U.Entitlement.sku.key])),this._store),()=>{},this._store),this.entitlementObs=bv(this.onDidChangeEntitlement,()=>this.entitlement),this.onDidChangeSentiment=ir.map(ir.filter(this.contextKeyService.onDidChangeContext,e=>e.affectsSome(new Set([U.Setup.completed.key,U.Setup.hidden.key,U.Setup.disabled.key,U.Setup.untrusted.key,U.Setup.installed.key,U.Setup.later.key,U.Setup.registered.key])),this._store),()=>{},this._store),this.sentimentObs=bv(this.onDidChangeSentiment,()=>this.sentiment),!t.defaultChatAgent)return;let l=this.context=new u(()=>this._register(e.createInstance(oy)));this.requests=new u(()=>this._register(e.createInstance(ay,l.value,{clearQuotas:()=>this.clearQuotas(),acceptQuotas:e=>this.acceptQuotas(e)}))),this.registerListeners()}get entitlement(){return this.contextKeyService.getContextKeyValue(U.Entitlement.planEdu.key)===!0?Zv.EDU:this.contextKeyService.getContextKeyValue(U.Entitlement.planPro.key)===!0?Zv.Pro:this.contextKeyService.getContextKeyValue(U.Entitlement.planBusiness.key)===!0?Zv.Business:this.contextKeyService.getContextKeyValue(U.Entitlement.planEnterprise.key)===!0?Zv.Enterprise:this.contextKeyService.getContextKeyValue(U.Entitlement.planProPlus.key)===!0?Zv.ProPlus:this.contextKeyService.getContextKeyValue(U.Entitlement.planMax.key)===!0?Zv.Max:this.contextKeyService.getContextKeyValue(U.Entitlement.planFree.key)===!0?Zv.Free:this.contextKeyService.getContextKeyValue(U.Entitlement.canSignUp.key)===!0?Zv.Available:this.contextKeyService.getContextKeyValue(U.Entitlement.signedOut.key)===!0?Zv.Unknown:Zv.Unresolved}get isInternal(){return this.contextKeyService.getContextKeyValue(U.Entitlement.internal.key)===!0}get organisations(){return this.contextKeyService.getContextKeyValue(U.Entitlement.organisations.key)}get sku(){return this.contextKeyService.getContextKeyValue(U.Entitlement.sku.key)}get copilotTrackingId(){return this.context?.value.state.copilotTrackingId}get previewFeaturesDisabled(){return this.contextKeyService.getContextKeyValue(`github.copilot.previewFeaturesDisabled`)===!0}get clientByokEnabled(){return this.contextKeyService.getContextKeyValue(`github.copilot.clientByokEnabled`)===!0}get hasByokModels(){return this.contextKeyService.getContextKeyValue(`github.copilot.hasByokModels`)===!0}get quotas(){return this._quotas}registerListeners(){let e=new Set([this.ExtensionQuotaContextKeys.chatQuotaExceeded,this.ExtensionQuotaContextKeys.completionsQuotaExceeded]),t=this._register(new wt);this._register(this.contextKeyService.onDidChangeContext(n=>{n.affectsSome(e)&&(t.value&&t.value.cancel(),t.value=new Hi,this.update(t.value.token))}));let n=this.anonymous,r=()=>{let e=this.anonymous;e!==n&&(n=e,this.anonymousContextKey.set(e),this.context?.hasValue&&ny(this.context.value.state,this.configurationService,this.telemetryService),this._onDidChangeAnonymous.fire())};this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(ey)&&r()})),this._register(this.onDidChangeEntitlement(()=>r())),this._register(this.onDidChangeSentiment(()=>r()))}acceptQuotas(e){let t=this._quotas;this._quotas=e,this.updateContextKeys(),t.usageBasedBilling!==e.usageBasedBilling&&(e.usageBasedBilling===void 0?this.storageService.remove(Yv.CACHED_UBB_STORAGE_KEY,r_.PROFILE):this.storageService.store(Yv.CACHED_UBB_STORAGE_KEY,e.usageBasedBilling,r_.PROFILE,i_.MACHINE)),this.logService.getLevel()===H.Trace&&this.logService.trace(`[chat entitlement]: acceptQuotas: ${JSON.stringify(e)}`);let{changed:n}=this.compareQuotas(t.chat,e.chat),{changed:r}=this.compareQuotas(t.completions,e.completions),{changed:i}=this.compareQuotas(t.premiumChat,e.premiumChat);(n.exceeded||r.exceeded||i.exceeded)&&this._onDidChangeQuotaExceeded.fire();let a=t.sessionRateLimit?.percentRemaining!==e.sessionRateLimit?.percentRemaining,o=t.weeklyRateLimit?.percentRemaining!==e.weeklyRateLimit?.percentRemaining;(n.remaining||r.remaining||i.remaining||a||o||t.usageBasedBilling!==e.usageBasedBilling)&&this._onDidChangeQuotaRemaining.fire(),t.usageBasedBilling!==e.usageBasedBilling&&this._onDidChangeUsageBasedBilling.fire(),t.additionalUsageEnabled!==void 0&&e.additionalUsageEnabled!==void 0&&t.additionalUsageEnabled!==e.additionalUsageEnabled&&this.telemetryService.publicLog2(`chatAdditionalSpendConfiguration`,{enabled:e.additionalUsageEnabled??!1,entitlement:this.entitlement}),e.additionalUsageEnabled&&e.premiumChat?.percentRemaining===0&&t.premiumChat?.percentRemaining!==void 0&&t.premiumChat.percentRemaining>0&&this.telemetryService.publicLog2(`chatAdditionalSpendActive`,{entitlement:this.entitlement,additionalUsageCount:e.additionalUsageCount??0})}compareQuotas(e,t){return{changed:{exceeded:e?.percentRemaining===0!=(t?.percentRemaining===0),remaining:e?.percentRemaining!==t?.percentRemaining||e?.usageBasedBilling!==t?.usageBasedBilling}}}clearQuotas(){this.acceptQuotas({})}updateContextKeys(){let e=this._quotas.chat?.percentRemaining===0,t=this._quotas.premiumChat?.unlimited?this._quotas.premiumChat.hasQuota===!1:this._quotas.premiumChat?.percentRemaining===0,n=this._quotas.additionalUsageEnabled??!1,r=this.entitlement===Zv.Business||this.entitlement===Zv.Enterprise;this.chatQuotaExceededContextKey.set(e||t&&(r||!n)),this.completionsQuotaExceededContextKey.set(this._quotas.completions?.percentRemaining===0)}get sentiment(){return{completed:this.contextKeyService.getContextKeyValue(U.Setup.completed.key)===!0,installed:this.contextKeyService.getContextKeyValue(U.Setup.installed.key)===!0,hidden:this.contextKeyService.getContextKeyValue(U.Setup.hidden.key)===!0,disabledInWorkspace:this.contextKeyService.getContextKeyValue(U.Setup.disabledInWorkspace.key)===!0,disabled:this.contextKeyService.getContextKeyValue(U.Setup.disabled.key)===!0,untrusted:this.contextKeyService.getContextKeyValue(U.Setup.untrusted.key)===!0,later:this.contextKeyService.getContextKeyValue(U.Setup.later.key)===!0,registered:this.contextKeyService.getContextKeyValue(U.Setup.registered.key)===!0}}get anonymous(){return ty(this.configurationService,this.entitlement,this.sentiment)}markAnonymousRateLimited(){this.anonymous&&(this.chatQuotaExceededContextKey.set(!0),this._onDidChangeQuotaExceeded.fire())}markSetupCompleted(){this.context?.value.update({completed:!0})}setForceHidden(e){this.context?this.context.value.setForceHidden(e):U.Setup.hidden.bindTo(this.contextKeyService).set(e)}async update(e){await this.requests?.value.forceResolveEntitlement(e)}};ry=Yv=k([A(0,As),A(1,Xh),A(2,m_),A(3,kh),A(4,Oh),A(5,d_),A(6,Ns),A(7,c_)],ry);function iy(e){let t={resetDate:e.quota_reset_date_utc??e.quota_reset_date??e.limited_user_reset_date,resetDateHasTime:typeof e.quota_reset_date_utc==`string`,usageBasedBilling:e.token_based_billing,canUpgradePlan:e.can_upgrade_plan};if(e.monthly_quotas?.chat&&typeof e.limited_user_quotas?.chat==`number`&&(t.chat={percentRemaining:Math.min(100,Math.max(0,e.limited_user_quotas.chat/e.monthly_quotas.chat*100)),unlimited:!1}),e.monthly_quotas?.completions&&typeof e.limited_user_quotas?.completions==`number`&&(t.completions={percentRemaining:Math.min(100,Math.max(0,e.limited_user_quotas.completions/e.monthly_quotas.completions*100)),unlimited:!1}),e.quota_snapshots){for(let n of[`chat`,`completions`,`premium_interactions`]){let r=e.quota_snapshots[n];if(!r)continue;let i=r.entitlement===void 0?void 0:Number(r.entitlement);if(!r.unlimited&&i===0)continue;let a=r.quota_remaining===void 0?void 0:Number(r.quota_remaining),o={percentRemaining:Math.min(100,Math.max(0,r.percent_remaining)),unlimited:r.unlimited,hasQuota:r.has_quota,usageBasedBilling:e.token_based_billing,resetAt:r.quota_reset_at||void 0,entitlement:i!==void 0&&Number.isFinite(i)&&i>=0?i:void 0,quotaRemaining:a!==void 0&&Number.isFinite(a)&&a>=0?a:void 0};switch(n){case`chat`:t.chat=o;break;case`completions`:t.completions=o;break;case`premium_interactions`:t.premiumChat=o;break}}let n=e.quota_snapshots.premium_interactions;t.additionalUsageEnabled=n?.overage_permitted??!1,t.additionalUsageCount=n?.overage_count??0}return t}let ay=class extends v{constructor(e,t,n,r,i,a,o,s,c,l){super(),this.context=e,this.chatQuotasAccessor=t,this.telemetryService=n,this.logService=r,this.requestService=i,this.dialogService=a,this.openerService=o,this.lifecycleService=s,this.defaultAccountService=c,this.authenticationService=l,this.pendingResolveCts=new Hi,this.state={entitlement:this.context.state.entitlement},this.registerListeners(),this.resolve()}registerListeners(){this._register(this.defaultAccountService.onDidChangeDefaultAccount(()=>this.resolve())),this._register(this.context.onDidChange(()=>{(this.context.state.disabled||this.context.state.entitlement===Zv.Unknown)&&(this.state={entitlement:this.state.entitlement,quotas:void 0},this.chatQuotasAccessor.clearQuotas())}))}async resolve(){this.pendingResolveCts.dispose(!0);let e=this.pendingResolveCts=new Hi,t=await this.defaultAccountService.getDefaultAccount();if(e.token.isCancellationRequested)return;let n;t?this.state.entitlement===Zv.Unknown&&(n={entitlement:Zv.Unresolved}):n={entitlement:Zv.Unknown},n&&this.update(n),t&&await this.resolveEntitlement(t,e.token)}async resolveEntitlement(e,t){let n=await this.doResolveEntitlement(e,t);return typeof n?.entitlement==`number`&&!t.isCancellationRequested&&this.update(n),n}async doResolveEntitlement(e,t){if(t.isCancellationRequested)return;let n=e.entitlementsData;if(!n)return this.logService.trace(`[chat entitlement]: no entitlements data available on default account`),{entitlement:n===null?Zv.Unknown:Zv.Unresolved};let r;r=n.access_type_sku===`free_limited_copilot`?Zv.Free:n.access_type_sku===`free_educational_quota`?Zv.EDU:n.can_signup_for_limited?Zv.Available:n.copilot_plan===`individual_edu`?Zv.EDU:n.copilot_plan===`individual`?Zv.Pro:n.copilot_plan===`individual_pro`?Zv.ProPlus:n.copilot_plan===`individual_max`?Zv.Max:n.copilot_plan===`business`?Zv.Business:n.copilot_plan===`enterprise`?Zv.Enterprise:Zv.Unavailable;let i={entitlement:r,organisations:n.organization_login_list,quotas:this.toQuotas(n),sku:n.access_type_sku,copilotTrackingId:n.analytics_tracking_id};return this.logService.trace(`[chat entitlement]: resolved to ${i.entitlement}, quotas: ${JSON.stringify(i.quotas)}`),this.telemetryService.publicLog2(`chatInstallEntitlement`,{entitlement:i.entitlement,tid:n.analytics_tracking_id,sku:i.sku,quotaChatUnlimited:i.quotas?.chat?.unlimited,quotaChatHasQuota:i.quotas?.chat?.hasQuota,quotaChatEntitlement:i.quotas?.chat?.entitlement,quotaPremiumChat:i.quotas?.premiumChat?.percentRemaining,quotaPremiumChatUnlimited:i.quotas?.premiumChat?.unlimited,quotaPremiumChatHasQuota:i.quotas?.premiumChat?.hasQuota,quotaPremiumChatEntitlement:i.quotas?.premiumChat?.entitlement,quotaCompletions:i.quotas?.completions?.percentRemaining,quotaCompletionsUnlimited:i.quotas?.completions?.unlimited,quotaCompletionsHasQuota:i.quotas?.completions?.hasQuota,quotaCompletionsEntitlement:i.quotas?.completions?.entitlement,quotaResetDate:i.quotas?.resetDate,usageBasedBilling:i.quotas?.usageBasedBilling,additionalUsageEnabled:i.quotas?.additionalUsageEnabled,additionalUsageCount:i.quotas?.additionalUsageCount,canUpgradePlan:i.quotas?.canUpgradePlan}),i}toQuotas(e){return iy(e)}async request(e,t,n,r,i,a){let o;for(let s of r){if(i.isCancellationRequested)return o;try{let r=await this.requestService.request({type:t,url:e,data:t===`POST`?JSON.stringify(n):void 0,disableCache:!0,headers:{Authorization:`Bearer ${s.accessToken}`},callSite:a},i),c=r.res.statusCode;if(c&&c!==200){o=r;continue}return r}catch(e){i.isCancellationRequested||this.logService.error(`[chat entitlement] request: error ${e}`)}}return o}update(e){this.state=e,this.context.update({entitlement:this.state.entitlement,organisations:this.state.organisations,sku:this.state.sku,copilotTrackingId:this.state.copilotTrackingId}),e.quotas&&this.chatQuotasAccessor.acceptQuotas(e.quotas)}async forceResolveEntitlement(e=Bi.None){let t=await this.defaultAccountService.refresh({forceRefresh:!0});if(t)return this.resolveEntitlement(t,e)}async signUpFree(){let e=await this.getSessions();if(e.length!==0)return this.doSignUpFree(e)}async doSignUpFree(e){let t={restricted_telemetry:this.telemetryService.telemetryLevel===l_.NONE?`disabled`:`enabled`,public_code_suggestions:`enabled`},n=await this.request($v.entitlementSignupLimitedUrl,`POST`,t,e,Bi.None,`chatEntitlementService.signUpFree`);if(!n)return await this.onUnknownSignUpError(b(16727,`No response received.`),`[chat entitlement] sign-up: no response`)?this.doSignUpFree(e):{errorCode:1};if(n.res.statusCode&&n.res.statusCode!==200){if(n.res.statusCode===422)try{let e=await Fg(n);if(e){let t=JSON.parse(e);if(typeof t.message==`string`&&t.message)return this.onUnprocessableSignUpError(`[chat entitlement] sign-up: unprocessable entity (${t.message})`,t.message),{errorCode:n.res.statusCode}}}catch{}return await this.onUnknownSignUpError(b(16728,`Unexpected status code {0}.`,n.res.statusCode),`[chat entitlement] sign-up: unexpected status code ${n.res.statusCode}`)?this.doSignUpFree(e):{errorCode:n.res.statusCode}}let r=null;try{r=await Fg(n)}catch{}if(!r)return await this.onUnknownSignUpError(b(16729,`Response has no contents.`),`[chat entitlement] sign-up: response has no content`)?this.doSignUpFree(e):{errorCode:2};let i;try{i=JSON.parse(r),this.logService.trace(`[chat entitlement] sign-up: response is ${r}`)}catch(t){return await this.onUnknownSignUpError(b(16730,`Invalid response contents.`),`[chat entitlement] sign-up: error parsing response (${t})`)?this.doSignUpFree(e):{errorCode:3}}return this.update({entitlement:Zv.Free}),!!i?.subscribed}async getSessions(){let e=await this.defaultAccountService.getDefaultAccount();if(e){let t=(await this.authenticationService.getSessions(e.authenticationProvider.id)).filter(t=>t.id===e.sessionId);if(t.length)return t}return[...await this.authenticationService.getSessions(this.defaultAccountService.getDefaultAccountAuthenticationProvider().id)]}async onUnknownSignUpError(e,t){if(this.logService.error(t),!this.lifecycleService.willShutdown){let{confirmed:t}=await this.dialogService.confirm({type:Nc.Error,message:b(16731,`An error occurred while signing up for the GitHub Copilot Free plan. Would you like to try again?`),detail:e,primaryButton:b(16732,`Retry`)});return t}return!1}onUnprocessableSignUpError(e,t){this.logService.error(e),this.lifecycleService.willShutdown||this.dialogService.prompt({type:Nc.Error,message:b(16733,`An error occurred while signing up for the GitHub Copilot Free plan.`),detail:t,buttons:[{label:b(16734,`OK`),run:()=>{}},{label:b(16735,`Learn More`),run:()=>this.openerService.open(C.parse($v.upgradePlanUrl))}]})}async signIn(e){let t=await this.defaultAccountService.signIn({additionalScopes:e?.additionalScopes,extraAuthorizeParameters:{get_started_with:`copilot-vscode`},provider:e?.useSocialProvider});return t?{defaultAccount:t,entitlements:await this.doResolveEntitlement(t,Bi.None)}:{}}dispose(){this.pendingResolveCts.dispose(!0),super.dispose()}};ay=k([A(2,d_),A(3,Ns),A(4,Vg),A(5,Ah),A(6,p_),A(7,h_),A(8,Jv),A(9,f_)],ay);let oy=class extends v{static{Xv=this}static{this.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY=`chat.setupContext`}static{this.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY=`chat.setupContext.migrated.v1`}static{this.CHAT_DISABLED_CONFIGURATION_KEY=`chat.disableAIFeatures`}get state(){return this.withConfiguration(this.suspendedState??this._state)}constructor(e,t,n,r,i){super(),this.storageService=t,this.logService=n,this.configurationService=r,this.telemetryService=i,this.suspendedState=void 0,this._onDidChange=this._register(new x),this.onDidChange=this._onDidChange.event,this.updateBarrier=void 0,this._forceHidden=!1,this.canSignUpContextKey=U.Entitlement.canSignUp.bindTo(e),this.signedOutContextKey=U.Entitlement.signedOut.bindTo(e),this.freeContextKey=U.Entitlement.planFree.bindTo(e),this.eduContextKey=U.Entitlement.planEdu.bindTo(e),this.proContextKey=U.Entitlement.planPro.bindTo(e),this.proPlusContextKey=U.Entitlement.planProPlus.bindTo(e),this.maxContextKey=U.Entitlement.planMax.bindTo(e),this.businessContextKey=U.Entitlement.planBusiness.bindTo(e),this.enterpriseContextKey=U.Entitlement.planEnterprise.bindTo(e),this.organisationsContextKey=U.Entitlement.organisations.bindTo(e),this.isInternalContextKey=U.Entitlement.internal.bindTo(e),this.skuContextKey=U.Entitlement.sku.bindTo(e),this.completedContext=U.Setup.completed.bindTo(e),this.hiddenContext=U.Setup.hidden.bindTo(e),this.disabledInWorkspaceContext=U.Setup.disabledInWorkspace.bindTo(e),this.laterContext=U.Setup.later.bindTo(e),this.installedContext=U.Setup.installed.bindTo(e),this.disabledContext=U.Setup.disabled.bindTo(e),this.untrustedContext=U.Setup.untrusted.bindTo(e),this.registeredContext=U.Setup.registered.bindTo(e),this._state=this.storageService.getObject(Xv.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,r_.PROFILE)??{entitlement:Zv.Unknown,organisations:void 0,sku:void 0,copilotTrackingId:void 0},this.storageService.getBoolean(Xv.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,r_.PROFILE)!==!0&&(this.storageService.store(Xv.CHAT_ENTITLEMENT_CONTEXT_MIGRATED_STORAGE_KEY,!0,r_.PROFILE,i_.MACHINE),this._state.installed&&!this._state.completed&&(this._state.completed=!0,this.storageService.store(Xv.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,this._state,r_.PROFILE,i_.MACHINE))),this.updateContextSync(),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration(e=>{e.affectsConfiguration(Xv.CHAT_DISABLED_CONFIGURATION_KEY)&&this.updateContext()}))}withConfiguration(e){return this._forceHidden||this.configurationService.getValue(Xv.CHAT_DISABLED_CONFIGURATION_KEY)===!0?{...e,hidden:!0}:e}setForceHidden(e){this._forceHidden!==e&&(this._forceHidden=e,this.updateContext())}async update(e){this.logService.trace(`[chat entitlement context] update(): ${JSON.stringify(e)}`);let t=JSON.stringify(this._state);if(typeof e.installed==`boolean`&&typeof e.disabled==`boolean`&&typeof e.untrusted==`boolean`&&(this._state.installed=e.installed,this._state.disabled=e.disabled,this._state.untrusted=e.untrusted,this._state.disabledInWorkspace=e.disabledInWorkspace,e.installed&&!e.disabled&&(e.hidden=!1)),typeof e.hidden==`boolean`&&(this._state.hidden=e.hidden),typeof e.later==`boolean`&&(this._state.later=e.later),typeof e.completed==`boolean`&&(this._state.completed=e.completed),typeof e.entitlement==`number`&&(this._state.entitlement=e.entitlement,this._state.organisations=e.organisations,this._state.sku=e.sku,this._state.copilotTrackingId=e.copilotTrackingId,this._state.entitlement===Zv.Free||Qv(this._state.entitlement)?this._state.registered=!0:this._state.entitlement===Zv.Available&&(this._state.registered=!1)),ty(this.configurationService,this._state.entitlement,this._state)&&(this._state.sku=`no_auth_limited_copilot`),t!==JSON.stringify(this._state))return this.storageService.store(Xv.CHAT_ENTITLEMENT_CONTEXT_STORAGE_KEY,{...this._state,later:void 0},r_.PROFILE,i_.MACHINE),this.updateContext()}async updateContext(){await this.updateBarrier?.wait(),this.updateContextSync()}updateContextSync(){let e=this.withConfiguration(this._state);this.signedOutContextKey.set(e.entitlement===Zv.Unknown),this.canSignUpContextKey.set(e.entitlement===Zv.Available),this.freeContextKey.set(e.entitlement===Zv.Free),this.eduContextKey.set(e.entitlement===Zv.EDU),this.proContextKey.set(e.entitlement===Zv.Pro),this.proPlusContextKey.set(e.entitlement===Zv.ProPlus),this.maxContextKey.set(e.entitlement===Zv.Max),this.businessContextKey.set(e.entitlement===Zv.Business),this.enterpriseContextKey.set(e.entitlement===Zv.Enterprise),this.organisationsContextKey.set(e.organisations),this.isInternalContextKey.set(!!e.organisations?.some(e=>e===`github`||e===`microsoft`||e===`ms-copilot`||e===`MicrosoftCopilot`)),this.skuContextKey.set(e.sku),this.completedContext.set(!!e.completed),this.hiddenContext.set(!!e.hidden),this.disabledInWorkspaceContext.set(!!e.disabledInWorkspace),this.laterContext.set(!!e.later),this.installedContext.set(!!e.installed),this.disabledContext.set(!!e.disabled),this.untrustedContext.set(!!e.untrusted),this.registeredContext.set(!!e.registered),this.logService.trace(`[chat entitlement context] updateContext(): ${JSON.stringify(e)}`),ny(e,this.configurationService,this.telemetryService),this._onDidChange.fire()}suspend(){this.suspendedState={...this._state},this.updateBarrier=new jo}resume(){this.suspendedState=void 0,this.updateBarrier?.open(),this.updateBarrier=void 0}};oy=Xv=k([A(0,kh),A(1,c_),A(2,Ns),A(3,Oh),A(4,d_)],oy);const sy=O(`languageService`),cy=O(`modelService`);var ly;new F(`workbenchState`,void 0,{type:`string`,description:b(4207,`The kind of workspace opened in the window, either 'empty' (no workspace), 'folder' (single folder) or 'workspace' (multi-root workspace)`)}),new F(`workspaceFolderCount`,0,b(4208,`The number of root folders in the workspace`)),new F(`openFolderWorkspaceSupport`,!0,!0),new F(`enterMultiRootWorkspaceSupport`,!0,!0),new F(`emptyWorkspaceSupport`,!0,!0),new F(`dirtyWorkingCopies`,!1,b(4209,`Whether there are any working copies with unsaved changes`));const uy=new F(`remoteName`,``,b(4210,`The name of the remote the window is connected to or an empty string if not connected to any remote`));new F(`virtualWorkspace`,``,b(4211,`The scheme of the current workspace is from a virtual file system or an empty string.`)),new F(`temporaryWorkspace`,!1,b(4212,`The scheme of the current workspace is from a temporary file system.`));const dy=new F(`isSessionsWindow`,!1,b(4213,`Whether the current window is a agent sessions window.`));new F(`hasWebFileSystemAccess`,!1,!0),new F(`embedderIdentifier`,void 0,b(4214,`The identifier of the embedder according to the product service, if one is defined`)),new F(`inAutomation`,!1,b(4215,`Whether VS Code is running under automation/smoke test`)),new F(`isSandboxWorkspace`,!1,!0),new F(`isFullscreen`,!1,b(4216,`Whether the main window is in fullscreen mode`)),new F(`isAuxiliaryWindowFocusedContext`,!1,b(4217,`Whether an auxiliary window is focused`));const fy=new F(`isAuxiliaryWindow`,!1,b(4218,`Window is an auxiliary window`));new F(`activeEditorIsDirty`,!1,b(4219,`Whether the active editor has unsaved changes`)),new F(`activeEditorIsNotPreview`,!1,b(4220,`Whether the active editor is not in preview mode`)),new F(`activeEditorIsFirstInGroup`,!1,b(4221,`Whether the active editor is the first one in its group`)),new F(`activeEditorIsLastInGroup`,!1,b(4222,`Whether the active editor is the last one in its group`)),new F(`activeEditorIsPinned`,!1,b(4223,`Whether the active editor is pinned`)),new F(`activeEditorIsReadonly`,!1,b(4224,`Whether the active editor is read-only`)),new F(`activeCompareEditorCanSwap`,!1,b(4225,`Whether the active compare editor can swap sides`)),new F(`activeEditorCanToggleReadonly`,!0,b(4226,`Whether the active editor can toggle between being read-only or writeable`)),new F(`activeEditorCanRevert`,!1,b(4227,`Whether the active editor can revert`)),new F(`activeEditorCanSplitInGroup`,!0),new F(`activeEditor`,null,{type:`string`,description:b(4228,`The identifier of the active editor`)}),new F(`activeEditorAvailableEditorIds`,``,b(4229,`The available editor identifiers that are usable for the active editor`)),new F(`textCompareEditorVisible`,!1,b(4230,`Whether a text compare editor is visible`)),new F(`textCompareEditorActive`,!1,b(4231,`Whether a text compare editor is active`)),new F(`sideBySideEditorActive`,!1,b(4232,`Whether a side by side editor is active`)),new F(`activeCustomEditorDiffCanToggleLayout`,!1,b(4233,`Whether the active custom editor diff can toggle between inline and side by side layout`)),new F(`activeCustomEditorTextDiff`,!1,b(4234,`Whether the active custom editor diff is backed by text documents`)),new F(`groupEditorsCount`,0,b(4235,`The number of opened editor groups`)),new F(`isTopRightEditorGroup`,!1,b(4236,`Whether the editor group is the top right editor group in the editor part`)),new F(`activeEditorGroupEmpty`,!1,b(4237,`Whether the active editor group is empty`)),new F(`activeEditorGroupIndex`,0,b(4238,`The index of the active editor group`)),new F(`activeEditorGroupLast`,!1,b(4239,`Whether the active editor group is the last group`)),new F(`activeEditorGroupLocked`,!1,b(4240,`Whether the active editor group is locked`)),new F(`multipleEditorGroups`,!1,b(4241,`Whether there are multiple editor groups opened`)),new F(`multipleEditorsSelectedInGroup`,!1,b(4242,`Whether multiple editors have been selected in an editor group`)),new F(`twoEditorsSelectedInGroup`,!1,b(4243,`Whether exactly two editors have been selected in an editor group`)),new F(`SelectedEditorsInGroupFileOrUntitledResourceContextKey`,!0,b(4244,`Whether all selected editors in a group have a file or untitled resource associated`)),new F(`editorPartMultipleEditorGroups`,!1,b(4245,`Whether there are multiple editor groups opened in an editor part`)),new F(`editorPartMaximizedEditorGroup`,!1,b(4246,`Editor Part has a maximized group`)),new F(`editorPartModal`,!1,b(4247,`Whether focus is in a modal editor part`)),new F(`editorPartModalMaximized`,!1,b(4248,`Whether the modal editor part is maximized`)),new F(`editorPartModalNavigation`,!1,b(4249,`Whether the modal editor part has navigation context`)),new F(`editorPartModalSidebar`,!1,b(4250,`Whether the modal editor part has a sidebar`)),new F(`editorPartModalSidebarVisible`,!1,b(4251,`Whether the modal editor part sidebar is visible`)),new F(`editorIsOpen`,!1,b(4252,`Whether an editor is open`)),new F(`editorAreaFocus`,!1,b(4253,`Whether the editor area (any editor part) has keyboard focus`)),new F(`inZenMode`,!1,b(4254,`Whether Zen mode is enabled`)),new F(`isCenteredLayout`,!1,b(4255,`Whether centered layout is enabled for the main editor`)),new F(`splitEditorsVertically`,!1,b(4256,`Whether editors split vertically`)),new F(`mainEditorAreaVisible`,!0,b(4257,`Whether the editor area in the main window is visible`)),new F(`editorTabsVisible`,!0,b(4258,`Whether editor tabs are visible`)),new F(`sideBarVisible`,!1,b(4259,`Whether the sidebar is visible`)),new F(`sideBarFocus`,!1,b(4260,`Whether the sidebar has keyboard focus`)),new F(`activeViewlet`,``,b(4261,`The identifier of the active viewlet`)),new F(`statusBarFocused`,!1,b(4262,`Whether the status bar has keyboard focus`)),new F(`titleBarStyle`,`custom`,b(4263,`Style of the window title bar`)),new F(`titleBarVisible`,!1,b(4264,`Whether the title bar is visible`)),new F(`isCompactTitleBar`,!1,b(4265,`Title bar is in compact mode`)),new F(`bannerFocused`,!1,b(4266,`Whether the banner has keyboard focus`)),new F(`notificationFocus`,!0,b(4267,`Whether a notification has keyboard focus`)),new F(`notificationCenterVisible`,!1,b(4268,`Whether the notifications center is visible`)),new F(`notificationToastsVisible`,!1,b(4269,`Whether a notification toast is visible`)),new F(`activeAuxiliary`,``,b(4270,`The identifier of the active auxiliary panel`)),new F(`auxiliaryBarFocus`,!1,b(4271,`Whether the auxiliary bar has keyboard focus`)),new F(`auxiliaryBarVisible`,!1,b(4272,`Whether the auxiliary bar is visible`)),new F(`auxiliaryBarMaximized`,!1,b(4273,`Whether the auxiliary bar is maximized`)),new F(`activePanel`,``,b(4274,`The identifier of the active panel`)),new F(`panelFocus`,!1,b(4275,`Whether the panel has keyboard focus`)),new F(`panelPosition`,`bottom`,b(4276,`The position of the panel, always 'bottom'`)),new F(`panelAlignment`,`center`,b(4277,`The alignment of the panel, either 'center', 'left', 'right' or 'justify'`)),new F(`panelVisible`,!1,b(4278,`Whether the panel is visible`)),new F(`panelMaximized`,!1,b(4279,`Whether the panel is maximized`)),new F(`focusedView`,``,b(4280,`The identifier of the view that has keyboard focus`));let py=class{static{ly=this}static{this.Scheme=new F(`resourceScheme`,void 0,{type:`string`,description:b(4281,`The scheme of the resource`)})}static{this.Filename=new F(`resourceFilename`,void 0,{type:`string`,description:b(4282,`The file name of the resource`)})}static{this.Dirname=new F(`resourceDirname`,void 0,{type:`string`,description:b(4283,`The folder name the resource is contained in`)})}static{this.Path=new F(`resourcePath`,void 0,{type:`string`,description:b(4284,`The full path of the resource`)})}static{this.LangId=new F(`resourceLangId`,void 0,{type:`string`,description:b(4285,`The language identifier of the resource`)})}static{this.Resource=new F(`resource`,void 0,{type:`URI`,description:b(4286,`The full value of the resource including scheme and path`)})}static{this.Extension=new F(`resourceExtname`,void 0,{type:`string`,description:b(4287,`The extension name of the resource`)})}static{this.HasResource=new F(`resourceSet`,void 0,{type:`boolean`,description:b(4288,`Whether a resource is present or not`)})}static{this.IsFileSystemResource=new F(`isFileSystemResource`,void 0,{type:`boolean`,description:b(4289,`Whether the resource is backed by a file system provider`)})}constructor(e,t,n,r){this._contextKeyService=e,this._fileService=t,this._languageService=n,this._modelService=r,this._schemeKey=ly.Scheme.bindTo(this._contextKeyService),this._filenameKey=ly.Filename.bindTo(this._contextKeyService),this._dirnameKey=ly.Dirname.bindTo(this._contextKeyService),this._pathKey=ly.Path.bindTo(this._contextKeyService),this._langIdKey=ly.LangId.bindTo(this._contextKeyService),this._resourceKey=ly.Resource.bindTo(this._contextKeyService),this._extensionKey=ly.Extension.bindTo(this._contextKeyService),this._hasResource=ly.HasResource.bindTo(this._contextKeyService),this._isFileSystemResource=ly.IsFileSystemResource.bindTo(this._contextKeyService)}_setLangId(){let e=this.get();if(!e){this._langIdKey.set(null);return}let t=this._modelService.getModel(e)?.getLanguageId()??this._languageService.guessLanguageIdByFilepathOrFirstLine(e);this._langIdKey.set(t)}set(e){e??=void 0,!ao(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?so(e):null),this._dirnameKey.set(e?this.uriToPath(lo(e)):null),this._pathKey.set(e?this.uriToPath(e):null),this._setLangId(),this._extensionKey.set(e?co(e):null),this._hasResource.set(!!e),this._isFileSystemResource.set(e?this._fileService.hasProvider(e):!1)}))}uriToPath(e){return e.scheme===D.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}};py=ly=k([A(0,kh),A(1,qg),A(2,sy),A(3,cy)],py);let my=class extends py{constructor(e,t,n,r){super(e,t,n,r),this._disposables=new _,this._disposables.add(t.onDidChangeFileSystemProviderRegistrations(()=>{let e=this.get();this._isFileSystemResource.set(!!(e&&t.hasProvider(e)))})),this._disposables.add(r.onModelAdded(e=>{ao(e.uri,this.get())&&this._setLangId()})),this._disposables.add(r.onModelLanguageChanged(e=>{ao(e.model.uri,this.get())&&this._setLangId()}))}dispose(){this._disposables.dispose()}};my=k([A(0,kh),A(1,qg),A(2,sy),A(3,cy)],my);var hy;(function(e){e.AIDisabled=`chat.disableAIFeatures`,e.PluginsEnabled=`chat.plugins.enabled`,e.PluginLocations=`chat.pluginLocations`,e.PluginMarketplaces=`chat.plugins.marketplaces`,e.ExtraMarketplaces=`chat.plugins.extraMarketplaces`,e.StrictMarketplaces=`chat.plugins.strictMarketplaces`,e.EnabledPlugins=`chat.plugins.enabledPlugins`,e.AgentEnabled=`chat.agent.enabled`,e.PlanAgentDefaultModel=`chat.planAgent.defaultModel`,e.ExploreAgentDefaultModel=`chat.exploreAgent.defaultModel`,e.UtilityModel=`chat.utilityModel`,e.UtilitySmallModel=`chat.utilitySmallModel`,e.RequestQueueingDefaultAction=`chat.requestQueuing.defaultAction`,e.AgentStatusEnabled=`chat.agentsControl.enabled`,e.EditorAssociations=`chat.editorAssociations`,e.UnifiedAgentsBar=`chat.unifiedAgentsBar.enabled`,e.AgentSessionProjectionEnabled=`chat.agentSessionProjection.enabled`,e.EditModeHidden=`chat.editMode.hidden`,e.ExtensionToolsEnabled=`chat.extensionTools.enabled`,e.RepoInfoEnabled=`chat.repoInfo.enabled`,e.EditRequests=`chat.editRequests`,e.InlineReferencesStyle=`chat.inlineReferences.style`,e.AutoReply=`chat.autoReply`,e.GlobalAutoApprove=`chat.tools.global.autoApprove`,e.AutoApproveEdits=`chat.tools.edits.autoApprove`,e.AutoApprovedUrls=`chat.tools.urls.autoApprove`,e.EligibleForAutoApproval=`chat.tools.eligibleForAutoApproval`,e.EnableMath=`chat.math.enabled`,e.CheckpointsEnabled=`chat.checkpoints.enabled`,e.ThinkingStyle=`chat.agent.thinkingStyle`,e.ThinkingGenerateTitles=`chat.agent.thinking.generateTitles`,e.TerminalToolsInThinking=`chat.agent.thinking.terminalTools`,e.SimpleTerminalCollapsible=`chat.tools.terminal.simpleCollapsible`,e.CompressOutputEnabled=`chat.tools.compressOutput.enabled`,e.ThinkingPhrases=`chat.agent.thinking.phrases`,e.AutoExpandToolFailures=`chat.tools.autoExpandFailures`,e.TodosShowWidget=`chat.tools.todos.showWidget`,e.NotifyWindowOnConfirmation=`chat.notifyWindowOnConfirmation`,e.NotifyWindowOnResponseReceived=`chat.notifyWindowOnResponseReceived`,e.ChatViewSessionsEnabled=`chat.viewSessions.enabled`,e.SessionSyncEnabled=`chat.sessionSync.enabled`,e.SessionSyncExcludeRepositories=`chat.sessionSync.excludeRepositories`,e.ChatViewSessionsGrouping=`chat.viewSessions.grouping`,e.ChatViewSessionsOrientation=`chat.viewSessions.orientation`,e.ChatViewProgressBadgeEnabled=`chat.viewProgressBadge.enabled`,e.ChatContextUsageEnabled=`chat.contextUsage.enabled`,e.ChatPersistentProgressEnabled=`chat.persistentProgress.enabled`,e.ProgressBorder=`chat.progressBorder.enabled`,e.SubagentToolCustomAgents=`chat.customAgentInSubagent.enabled`,e.GeneralPurposeAgentEnabled=`chat.generalPurposeAgent.enabled`,e.SubagentsAllowInvocationsFromSubagents=`chat.subagents.allowInvocationsFromSubagents`,e.ShowCodeBlockProgressAnimation=`chat.agent.codeBlockProgress`,e.RestoreLastPanelSession=`chat.restoreLastPanelSession`,e.ExitAfterDelegation=`chat.exitAfterDelegation`,e.ExplainChangesEnabled=`chat.editing.explainChanges.enabled`,e.RevealNextChangeOnResolve=`chat.editing.revealNextChangeOnResolve`,e.GrowthNotificationEnabled=`chat.growthNotification.enabled`,e.TitleBarSignInEnabled=`chat.titleBar.signIn.enabled`,e.TitleBarOpenInAgentsWindowEnabled=`chat.titleBar.openInAgentsWindow.enabled`,e.ChatCustomizationHarnessSelectorEnabled=`chat.customizations.harnessSelector.enabled`,e.ChatCustomizationsStructuredPreviewEnabled=`chat.customizations.structuredPreview.enabled`,e.AutopilotAdvancedEnabled=`chat.autopilot.advanced.enabled`,e.PlanReviewInlineEditorEnabled=`chat.planReview.inlineEditor.enabled`,e.DefaultPermissionLevel=`chat.permissions.default`,e.ImageCarouselEnabled=`imageCarousel.chat.enabled`,e.ArtifactsEnabled=`chat.artifacts.enabled`,e.ArtifactsRulesByMimeType=`chat.artifacts.rules.byMimeType`,e.ArtifactsRulesByFilePath=`chat.artifacts.rules.byFilePath`,e.ArtifactsRulesByMemoryFilePath=`chat.artifacts.rules.byMemoryFilePath`,e.ToolConfirmationCarousel=`chat.tools.confirmationCarousel.enabled`,e.ToolRiskAssessmentEnabled=`chat.tools.riskAssessment.enabled`,e.ToolRiskAssessmentModel=`chat.tools.riskAssessment.model`,e.DefaultNewSessionMode=`chat.newSession.defaultMode`,e.AgentHostClientTools=`chat.agentHost.clientTools`,e.AgentHostDefaultChatProvider=`chat.agentHost.defaultChatProvider`,e.AgentsHandoffTipMode=`chat.agentsHandoffTip.mode`,e.IncrementalRendering=`chat.experimental.incrementalRendering.enabled`,e.IncrementalRenderingStyle=`chat.experimental.incrementalRendering.animationStyle`,e.IncrementalRenderingBuffering=`chat.experimental.incrementalRendering.buffering`})(hy||={});var gy;(function(e){e.Ask=`ask`,e.Edit=`edit`,e.Agent=`agent`})(gy||={});var _y;(function(e){e.Default=`default`,e.AutoApprove=`autoApprove`,e.Autopilot=`autopilot`})(_y||={}),new Set(Object.values(_y));var vy;(function(e){e.Collapsed=`collapsed`,e.CollapsedPreview=`collapsedPreview`,e.FixedScrolling=`fixedScrolling`})(vy||={});var yy;(function(e){e.Off=`off`,e.WithThinking=`withThinking`,e.Always=`always`})(yy||={});var by;(function(e){e.Off=`off`,e.WindowNotFocused=`windowNotFocused`,e.Always=`always`})(by||={});var xy;(function(e){e.Chat=`panel`,e.Terminal=`terminal`,e.Notebook=`notebook`,e.EditorInline=`editor`})(xy||={}),(function(e){function t(t){switch(t){case`panel`:return e.Chat;case`terminal`:return e.Terminal;case`notebook`:return e.Notebook;case`editor`:return e.EditorInline}return e.Chat}e.fromRaw=t})(xy||={}),new Set([D.vscodeChatEditor,D.walkThrough,D.vscodeLocalChatSession,D.vscodeSettings,D.webviewPanel,D.vscodeUserData,D.extension,`ccreq`,`openai-codex`]),Fd.and(U.Setup.hidden.negate(),U.Setup.disabledInWorkspace.negate(),dy.negate(),Fd.has(`config.${hy.AgentEnabled}`),fy.negate()),new F(`inModelsEditor`,!1),new F(`inModelsSearch`,!1);const Sy=`General Purpose`;function Cy(e,t=Tn){return Ja(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}function wy(e,t){return e.replace(/^~($|\/|\\)/,`${t}$1`)}var Ty;(function(e){e[e.TEXT=0]=`TEXT`,e[e.VARIABLE=1]=`VARIABLE`,e[e.SEPARATOR=2]=`SEPARATOR`})(Ty||={});var Ey;(function(e){e[e.None=0]=`None`,e[e.UnexpectedEndOfComment=1]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=2]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=3]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=4]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=5]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=6]=`InvalidCharacter`})(Ey||={});var W;(function(e){e[e.OpenBraceToken=1]=`OpenBraceToken`,e[e.CloseBraceToken=2]=`CloseBraceToken`,e[e.OpenBracketToken=3]=`OpenBracketToken`,e[e.CloseBracketToken=4]=`CloseBracketToken`,e[e.CommaToken=5]=`CommaToken`,e[e.ColonToken=6]=`ColonToken`,e[e.NullKeyword=7]=`NullKeyword`,e[e.TrueKeyword=8]=`TrueKeyword`,e[e.FalseKeyword=9]=`FalseKeyword`,e[e.StringLiteral=10]=`StringLiteral`,e[e.NumericLiteral=11]=`NumericLiteral`,e[e.LineCommentTrivia=12]=`LineCommentTrivia`,e[e.BlockCommentTrivia=13]=`BlockCommentTrivia`,e[e.LineBreakTrivia=14]=`LineBreakTrivia`,e[e.Trivia=15]=`Trivia`,e[e.Unknown=16]=`Unknown`,e[e.EOF=17]=`EOF`})(W||={});var Dy;(function(e){e[e.InvalidSymbol=1]=`InvalidSymbol`,e[e.InvalidNumberFormat=2]=`InvalidNumberFormat`,e[e.PropertyNameExpected=3]=`PropertyNameExpected`,e[e.ValueExpected=4]=`ValueExpected`,e[e.ColonExpected=5]=`ColonExpected`,e[e.CommaExpected=6]=`CommaExpected`,e[e.CloseBraceExpected=7]=`CloseBraceExpected`,e[e.CloseBracketExpected=8]=`CloseBracketExpected`,e[e.EndOfFileExpected=9]=`EndOfFileExpected`,e[e.InvalidCommentToken=10]=`InvalidCommentToken`,e[e.UnexpectedEndOfComment=11]=`UnexpectedEndOfComment`,e[e.UnexpectedEndOfString=12]=`UnexpectedEndOfString`,e[e.UnexpectedEndOfNumber=13]=`UnexpectedEndOfNumber`,e[e.InvalidUnicode=14]=`InvalidUnicode`,e[e.InvalidEscapeCharacter=15]=`InvalidEscapeCharacter`,e[e.InvalidCharacter=16]=`InvalidCharacter`})(Dy||={});var Oy;(function(e){e.DEFAULT={allowTrailingComma:!0}})(Oy||={});function ky(e,t=!1){let n=0,r=e.length,i=``,a=0,o=W.Unknown,s=Ey.None;function c(t){let r=0,i=0;for(;r<t;){let t=e.charCodeAt(n);if(t>=G._0&&t<=G._9)i=i*16+t-G._0;else if(t>=G.A&&t<=G.F)i=i*16+t-G.A+10;else if(t>=G.a&&t<=G.f)i=i*16+t-G.a+10;else break;n++,r++}return r<t&&(i=-1),i}function l(e){n=e,i=``,a=0,o=W.Unknown,s=Ey.None}function u(){let t=n;if(e.charCodeAt(n)===G._0)n++;else for(n++;n<e.length&&My(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===G.dot)if(n++,n<e.length&&My(e.charCodeAt(n)))for(n++;n<e.length&&My(e.charCodeAt(n));)n++;else return s=Ey.UnexpectedEndOfNumber,e.substring(t,n);let r=n;if(n<e.length&&(e.charCodeAt(n)===G.E||e.charCodeAt(n)===G.e))if(n++,(n<e.length&&e.charCodeAt(n)===G.plus||e.charCodeAt(n)===G.minus)&&n++,n<e.length&&My(e.charCodeAt(n))){for(n++;n<e.length&&My(e.charCodeAt(n));)n++;r=n}else s=Ey.UnexpectedEndOfNumber;return e.substring(t,r)}function d(){let t=``,i=n;for(;;){if(n>=r){t+=e.substring(i,n),s=Ey.UnexpectedEndOfString;break}let a=e.charCodeAt(n);if(a===G.doubleQuote){t+=e.substring(i,n),n++;break}if(a===G.backslash){if(t+=e.substring(i,n),n++,n>=r){s=Ey.UnexpectedEndOfString;break}switch(e.charCodeAt(n++)){case G.doubleQuote:t+=`"`;break;case G.backslash:t+=`\\`;break;case G.slash:t+=`/`;break;case G.b:t+=`\b`;break;case G.f:t+=`\f`;break;case G.n:t+=`
|
|
84
|
+
`;break;case G.r:t+=`\r`;break;case G.t:t+=` `;break;case G.u:{let e=c(4);e>=0?t+=String.fromCharCode(e):s=Ey.InvalidUnicode;break}default:s=Ey.InvalidEscapeCharacter}i=n;continue}if(a>=0&&a<=31)if(jy(a)){t+=e.substring(i,n),s=Ey.UnexpectedEndOfString;break}else s=Ey.InvalidCharacter;n++}return t}function f(){if(i=``,s=Ey.None,a=n,n>=r)return a=r,o=W.EOF;let t=e.charCodeAt(n);if(Ay(t)){do n++,i+=String.fromCharCode(t),t=e.charCodeAt(n);while(Ay(t));return o=W.Trivia}if(jy(t))return n++,i+=String.fromCharCode(t),t===G.carriageReturn&&e.charCodeAt(n)===G.lineFeed&&(n++,i+=`
|
|
85
|
+
`),o=W.LineBreakTrivia;switch(t){case G.openBrace:return n++,o=W.OpenBraceToken;case G.closeBrace:return n++,o=W.CloseBraceToken;case G.openBracket:return n++,o=W.OpenBracketToken;case G.closeBracket:return n++,o=W.CloseBracketToken;case G.colon:return n++,o=W.ColonToken;case G.comma:return n++,o=W.CommaToken;case G.doubleQuote:return n++,i=d(),o=W.StringLiteral;case G.slash:{let a=n-1;if(e.charCodeAt(n+1)===G.slash){for(n+=2;n<r&&!jy(e.charCodeAt(n));)n++;return i=e.substring(a,n),o=W.LineCommentTrivia}if(e.charCodeAt(n+1)===G.asterisk){n+=2;let t=r-1,c=!1;for(;n<t;){if(e.charCodeAt(n)===G.asterisk&&e.charCodeAt(n+1)===G.slash){n+=2,c=!0;break}n++}return c||(n++,s=Ey.UnexpectedEndOfComment),i=e.substring(a,n),o=W.BlockCommentTrivia}return i+=String.fromCharCode(t),n++,o=W.Unknown}case G.minus:if(i+=String.fromCharCode(t),n++,n===r||!My(e.charCodeAt(n)))return o=W.Unknown;case G._0:case G._1:case G._2:case G._3:case G._4:case G._5:case G._6:case G._7:case G._8:case G._9:return i+=u(),o=W.NumericLiteral;default:for(;n<r&&p(t);)n++,t=e.charCodeAt(n);if(a!==n){switch(i=e.substring(a,n),i){case`true`:return o=W.TrueKeyword;case`false`:return o=W.FalseKeyword;case`null`:return o=W.NullKeyword}return o=W.Unknown}return i+=String.fromCharCode(t),n++,o=W.Unknown}}function p(e){if(Ay(e)||jy(e))return!1;switch(e){case G.closeBrace:case G.closeBracket:case G.openBrace:case G.openBracket:case G.doubleQuote:case G.colon:case G.comma:case G.slash:return!1}return!0}function m(){let e;do e=f();while(e>=W.LineCommentTrivia&&e<=W.Trivia);return e}return{setPosition:l,getPosition:()=>n,scan:t?m:f,getToken:()=>o,getTokenValue:()=>i,getTokenOffset:()=>a,getTokenLength:()=>n-a,getTokenError:()=>s}}function Ay(e){return e===G.space||e===G.tab||e===G.verticalTab||e===G.formFeed||e===G.nonBreakingSpace||e===G.ogham||e>=G.enQuad&&e<=G.zeroWidthSpace||e===G.narrowNoBreakSpace||e===G.mathematicalSpace||e===G.ideographicSpace||e===G.byteOrderMark}function jy(e){return e===G.lineFeed||e===G.carriageReturn||e===G.lineSeparator||e===G.paragraphSeparator}function My(e){return e>=G._0&&e<=G._9}var G;(function(e){e[e.nullCharacter=0]=`nullCharacter`,e[e.maxAsciiCharacter=127]=`maxAsciiCharacter`,e[e.lineFeed=10]=`lineFeed`,e[e.carriageReturn=13]=`carriageReturn`,e[e.lineSeparator=8232]=`lineSeparator`,e[e.paragraphSeparator=8233]=`paragraphSeparator`,e[e.nextLine=133]=`nextLine`,e[e.space=32]=`space`,e[e.nonBreakingSpace=160]=`nonBreakingSpace`,e[e.enQuad=8192]=`enQuad`,e[e.emQuad=8193]=`emQuad`,e[e.enSpace=8194]=`enSpace`,e[e.emSpace=8195]=`emSpace`,e[e.threePerEmSpace=8196]=`threePerEmSpace`,e[e.fourPerEmSpace=8197]=`fourPerEmSpace`,e[e.sixPerEmSpace=8198]=`sixPerEmSpace`,e[e.figureSpace=8199]=`figureSpace`,e[e.punctuationSpace=8200]=`punctuationSpace`,e[e.thinSpace=8201]=`thinSpace`,e[e.hairSpace=8202]=`hairSpace`,e[e.zeroWidthSpace=8203]=`zeroWidthSpace`,e[e.narrowNoBreakSpace=8239]=`narrowNoBreakSpace`,e[e.ideographicSpace=12288]=`ideographicSpace`,e[e.mathematicalSpace=8287]=`mathematicalSpace`,e[e.ogham=5760]=`ogham`,e[e._=95]=`_`,e[e.$=36]=`$`,e[e._0=48]=`_0`,e[e._1=49]=`_1`,e[e._2=50]=`_2`,e[e._3=51]=`_3`,e[e._4=52]=`_4`,e[e._5=53]=`_5`,e[e._6=54]=`_6`,e[e._7=55]=`_7`,e[e._8=56]=`_8`,e[e._9=57]=`_9`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.c=99]=`c`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.g=103]=`g`,e[e.h=104]=`h`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.k=107]=`k`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.p=112]=`p`,e[e.q=113]=`q`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.v=118]=`v`,e[e.w=119]=`w`,e[e.x=120]=`x`,e[e.y=121]=`y`,e[e.z=122]=`z`,e[e.A=65]=`A`,e[e.B=66]=`B`,e[e.C=67]=`C`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.G=71]=`G`,e[e.H=72]=`H`,e[e.I=73]=`I`,e[e.J=74]=`J`,e[e.K=75]=`K`,e[e.L=76]=`L`,e[e.M=77]=`M`,e[e.N=78]=`N`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.Q=81]=`Q`,e[e.R=82]=`R`,e[e.S=83]=`S`,e[e.T=84]=`T`,e[e.U=85]=`U`,e[e.V=86]=`V`,e[e.W=87]=`W`,e[e.X=88]=`X`,e[e.Y=89]=`Y`,e[e.Z=90]=`Z`,e[e.ampersand=38]=`ampersand`,e[e.asterisk=42]=`asterisk`,e[e.at=64]=`at`,e[e.backslash=92]=`backslash`,e[e.bar=124]=`bar`,e[e.caret=94]=`caret`,e[e.closeBrace=125]=`closeBrace`,e[e.closeBracket=93]=`closeBracket`,e[e.closeParen=41]=`closeParen`,e[e.colon=58]=`colon`,e[e.comma=44]=`comma`,e[e.dot=46]=`dot`,e[e.doubleQuote=34]=`doubleQuote`,e[e.equals=61]=`equals`,e[e.exclamation=33]=`exclamation`,e[e.greaterThan=62]=`greaterThan`,e[e.lessThan=60]=`lessThan`,e[e.minus=45]=`minus`,e[e.openBrace=123]=`openBrace`,e[e.openBracket=91]=`openBracket`,e[e.openParen=40]=`openParen`,e[e.percent=37]=`percent`,e[e.plus=43]=`plus`,e[e.question=63]=`question`,e[e.semicolon=59]=`semicolon`,e[e.singleQuote=39]=`singleQuote`,e[e.slash=47]=`slash`,e[e.tilde=126]=`tilde`,e[e.backspace=8]=`backspace`,e[e.formFeed=12]=`formFeed`,e[e.byteOrderMark=65279]=`byteOrderMark`,e[e.tab=9]=`tab`,e[e.verticalTab=11]=`verticalTab`})(G||={});function Ny(e,t,n=Oy.DEFAULT){let r=ky(e,!1);function i(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength()):()=>!0}function a(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength()):()=>!0}let o=i(t.onObjectBegin),s=a(t.onObjectProperty),c=i(t.onObjectEnd),l=i(t.onArrayBegin),u=i(t.onArrayEnd),d=a(t.onLiteralValue),f=a(t.onSeparator),p=i(t.onComment),m=a(t.onError),ee=n&&n.disallowComments,te=n&&n.allowTrailingComma;function ne(){for(;;){let e=r.scan();switch(r.getTokenError()){case Ey.InvalidUnicode:h(Dy.InvalidUnicode);break;case Ey.InvalidEscapeCharacter:h(Dy.InvalidEscapeCharacter);break;case Ey.UnexpectedEndOfNumber:h(Dy.UnexpectedEndOfNumber);break;case Ey.UnexpectedEndOfComment:ee||h(Dy.UnexpectedEndOfComment);break;case Ey.UnexpectedEndOfString:h(Dy.UnexpectedEndOfString);break;case Ey.InvalidCharacter:h(Dy.InvalidCharacter);break}switch(e){case W.LineCommentTrivia:case W.BlockCommentTrivia:ee?h(Dy.InvalidCommentToken):p();break;case W.Unknown:h(Dy.InvalidSymbol);break;case W.Trivia:case W.LineBreakTrivia:break;default:return e}}}function h(e,t=[],n=[]){if(m(e),t.length+n.length>0){let e=r.getToken();for(;e!==W.EOF;){if(t.indexOf(e)!==-1){ne();break}else if(n.indexOf(e)!==-1)break;e=ne()}}}function re(e){let t=r.getTokenValue();return e?d(t):s(t),ne(),!0}function ie(){switch(r.getToken()){case W.NumericLiteral:{let e=0;try{e=JSON.parse(r.getTokenValue()),typeof e!=`number`&&(h(Dy.InvalidNumberFormat),e=0)}catch{h(Dy.InvalidNumberFormat)}d(e);break}case W.NullKeyword:d(null);break;case W.TrueKeyword:d(!0);break;case W.FalseKeyword:d(!1);break;default:return!1}return ne(),!0}function ae(){return r.getToken()===W.StringLiteral?(re(!1),r.getToken()===W.ColonToken?(f(`:`),ne(),ce()||h(Dy.ValueExpected,[],[W.CloseBraceToken,W.CommaToken])):h(Dy.ColonExpected,[],[W.CloseBraceToken,W.CommaToken]),!0):(h(Dy.PropertyNameExpected,[],[W.CloseBraceToken,W.CommaToken]),!1)}function oe(){o(),ne();let e=!1;for(;r.getToken()!==W.CloseBraceToken&&r.getToken()!==W.EOF;){if(r.getToken()===W.CommaToken){if(e||h(Dy.ValueExpected,[],[]),f(`,`),ne(),r.getToken()===W.CloseBraceToken&&te)break}else e&&h(Dy.CommaExpected,[],[]);ae()||h(Dy.ValueExpected,[],[W.CloseBraceToken,W.CommaToken]),e=!0}return c(),r.getToken()===W.CloseBraceToken?ne():h(Dy.CloseBraceExpected,[W.CloseBraceToken],[]),!0}function se(){l(),ne();let e=!1;for(;r.getToken()!==W.CloseBracketToken&&r.getToken()!==W.EOF;){if(r.getToken()===W.CommaToken){if(e||h(Dy.ValueExpected,[],[]),f(`,`),ne(),r.getToken()===W.CloseBracketToken&&te)break}else e&&h(Dy.CommaExpected,[],[]);ce()||h(Dy.ValueExpected,[],[W.CloseBracketToken,W.CommaToken]),e=!0}return u(),r.getToken()===W.CloseBracketToken?ne():h(Dy.CloseBracketExpected,[W.CloseBracketToken],[]),!0}function ce(){switch(r.getToken()){case W.OpenBracketToken:return se();case W.OpenBraceToken:return oe();case W.StringLiteral:return re(!0);default:return ie()}}return ne(),r.getToken()===W.EOF?n.allowEmptyContent?!0:(h(Dy.ValueExpected,[],[]),!1):ce()?(r.getToken()!==W.EOF&&h(Dy.EndOfFileExpected,[],[]),!0):(h(Dy.ValueExpected,[],[]),!1)}var Py;(function(e){e[e.Scalar=0]=`Scalar`,e[e.Colon=1]=`Colon`,e[e.Dash=2]=`Dash`,e[e.Comma=3]=`Comma`,e[e.FlowMapStart=4]=`FlowMapStart`,e[e.FlowMapEnd=5]=`FlowMapEnd`,e[e.FlowSeqStart=6]=`FlowSeqStart`,e[e.FlowSeqEnd=7]=`FlowSeqEnd`,e[e.Newline=8]=`Newline`,e[e.Indent=9]=`Indent`,e[e.Comment=10]=`Comment`,e[e.DocumentStart=11]=`DocumentStart`,e[e.DocumentEnd=12]=`DocumentEnd`,e[e.EOF=13]=`EOF`})(Py||={});var Fy;(function(e){e.PROMPT=`promptString`,e.PICK=`pickString`})(Fy||={});var Iy;(function(e){e.LOCAL=`stdio`,e.REMOTE=`http`})(Iy||={});var Ly;(function(e){e.Enabled=`enabled`,e.Disabled=`disabled`,e.Unconfigured=`unconfigured`})(Ly||={});var Ry;(function(e){e.Steering=`steering`,e.Queued=`queued`})(Ry||={});var zy;(function(e){e.Creating=`creating`,e.Ready=`ready`,e.CreationFailed=`creationFailed`})(zy||={});var By;(function(e){e[e.Idle=1]=`Idle`,e[e.Error=2]=`Error`,e[e.InProgress=8]=`InProgress`,e[e.InputNeeded=24]=`InputNeeded`,e[e.IsRead=32]=`IsRead`,e[e.IsArchived=64]=`IsArchived`})(By||={});var Vy;(function(e){e.Accept=`accept`,e.Decline=`decline`,e.Cancel=`cancel`})(Vy||={});var Hy;(function(e){e.Text=`text`,e.Number=`number`,e.Integer=`integer`,e.Boolean=`boolean`,e.SingleSelect=`single-select`,e.MultiSelect=`multi-select`})(Hy||={});var Uy;(function(e){e.Text=`text`,e.Number=`number`,e.Boolean=`boolean`,e.Selected=`selected`,e.SelectedMany=`selected-many`})(Uy||={});var Wy;(function(e){e.Draft=`draft`,e.Submitted=`submitted`,e.Skipped=`skipped`})(Wy||={});var Gy;(function(e){e.Complete=`complete`,e.Cancelled=`cancelled`,e.Error=`error`})(Gy||={});var Ky;(function(e){e.Simple=`simple`,e.EmbeddedResource=`embeddedResource`,e.Resource=`resource`})(Ky||={});var qy;(function(e){e.User=`user`,e.SystemNotification=`systemNotification`})(qy||={});var Jy;(function(e){e.Markdown=`markdown`,e.ContentRef=`contentRef`,e.ToolCall=`toolCall`,e.Reasoning=`reasoning`,e.SystemNotification=`systemNotification`})(Jy||={});var Yy;(function(e){e.Streaming=`streaming`,e.PendingConfirmation=`pending-confirmation`,e.Running=`running`,e.PendingResultConfirmation=`pending-result-confirmation`,e.Completed=`completed`,e.Cancelled=`cancelled`})(Yy||={});var Xy;(function(e){e.NotNeeded=`not-needed`,e.UserAction=`user-action`,e.Setting=`setting`})(Xy||={});var Zy;(function(e){e.Denied=`denied`,e.Skipped=`skipped`,e.ResultDenied=`result-denied`})(Zy||={});var Qy;(function(e){e.Approve=`approve`,e.Deny=`deny`})(Qy||={});var $y;(function(e){e.Client=`client`,e.MCP=`mcp`})($y||={});var eb;(function(e){e.Text=`text`,e.EmbeddedResource=`embeddedResource`,e.Resource=`resource`,e.FileEdit=`fileEdit`,e.Terminal=`terminal`,e.Subagent=`subagent`})(eb||={});var tb;(function(e){e.Plugin=`plugin`,e.Directory=`directory`,e.Agent=`agent`,e.Skill=`skill`,e.Prompt=`prompt`,e.Rule=`rule`,e.Hook=`hook`,e.McpServer=`mcpServer`})(tb||={});var nb;(function(e){e.Loading=`loading`,e.Loaded=`loaded`,e.Degraded=`degraded`,e.Error=`error`})(nb||={});var rb;(function(e){e.Starting=`starting`,e.Ready=`ready`,e.AuthRequired=`authRequired`,e.Error=`error`,e.Stopped=`stopped`})(rb||={});var ib;(function(e){e.Required=`required`,e.Expired=`expired`,e.InsufficientScope=`insufficientScope`})(ib||={});var ab;(function(e){e.Client=`client`,e.Session=`session`})(ab||={});var ob;(function(e){e.Computing=`computing`,e.Ready=`ready`,e.Error=`error`})(ob||={});var sb;(function(e){e.Idle=`idle`,e.Running=`running`,e.Error=`error`})(sb||={});var cb;(function(e){e.Changeset=`changeset`,e.Resource=`resource`,e.Range=`range`})(cb||={});var lb;(function(e){e.Added=`added`,e.Updated=`updated`,e.Deleted=`deleted`})(lb||={});var ub;(function(e){e.Replay=`replay`,e.Snapshot=`snapshot`})(ub||={});var db;(function(e){e.Base64=`base64`,e.Utf8=`utf-8`})(db||={});var fb;(function(e){e.Truncate=`truncate`,e.Append=`append`,e.Insert=`insert`})(fb||={});var pb;(function(e){e.File=`file`,e.Directory=`directory`,e.Symlink=`symlink`})(pb||={});var mb;(function(e){e.UserMessage=`userMessage`})(mb||={});var hb;(function(e){e.Resource=`resource`,e.Range=`range`})(hb||={});var gb;(function(e){e.Edit=`edit`,e.Create=`create`,e.Delete=`delete`,e.Rename=`rename`})(gb||={});var _b;(function(e){e[e.Root=0]=`Root`,e[e.Session=1]=`Session`,e[e.Terminal=2]=`Terminal`,e[e.Changeset=3]=`Changeset`})(_b||={});var vb;(function(e){function t(e,t){return e===t?!0:!e||!t?!1:e.command===t.command&&e.windows===t.windows&&e.linux===t.linux&&e.osx===t.osx&&ao(e.cwd,t.cwd)&&pc(e.env,t.env)&&e.timeout===t.timeout&&ao(e.sourceUri,t.sourceUri)}e.isEquals=t})(vb||={});var yb;(function(e){e[e.Copilot=0]=`Copilot`,e[e.Claude=1]=`Claude`,e[e.OpenPlugin=2]=`OpenPlugin`})(yb||={}),yb.Copilot,yb.Claude,yb.OpenPlugin;var bb;(function(e){e.instructions=`instructions`,e.prompt=`prompt`,e.agent=`agent`,e.skill=`skill`,e.hook=`hook`})(bb||={});var xb;(function(e){e.VSCode=`vscode`,e.GitHubCopilot=`github-copilot`,e.Claude=`claude`,e.Undefined=`undefined`})(xb||={});var Sb;(function(e){e.GitHubWorkspace=`github-workspace`,e.CopilotPersonal=`copilot-personal`,e.ClaudePersonal=`claude-personal`,e.ClaudeWorkspace=`claude-workspace`,e.ClaudeWorkspaceLocal=`claude-workspace-local`,e.AgentsWorkspace=`agents-workspace`,e.AgentsPersonal=`agents-personal`,e.ConfigWorkspace=`config-workspace`,e.ConfigPersonal=`config-personal`,e.UserData=`user-data`,e.ExtensionContribution=`extension-contribution`,e.ExtensionAPI=`extension-api`,e.Plugin=`plugin`})(Sb||={});var Cb;(function(e){e.SessionStart=`SessionStart`,e.SessionEnd=`SessionEnd`,e.UserPromptSubmit=`UserPromptSubmit`,e.PreToolUse=`PreToolUse`,e.PostToolUse=`PostToolUse`,e.PreCompact=`PreCompact`,e.SubagentStart=`SubagentStart`,e.SubagentStop=`SubagentStop`,e.Stop=`Stop`,e.ErrorOccurred=`ErrorOccurred`})(Cb||={});const wb={[xb.VSCode]:{SessionStart:Cb.SessionStart,UserPromptSubmit:Cb.UserPromptSubmit,PreToolUse:Cb.PreToolUse,PostToolUse:Cb.PostToolUse,PreCompact:Cb.PreCompact,SubagentStart:Cb.SubagentStart,SubagentStop:Cb.SubagentStop,Stop:Cb.Stop},[xb.GitHubCopilot]:{sessionStart:Cb.SessionStart,sessionEnd:Cb.SessionEnd,userPromptSubmitted:Cb.UserPromptSubmit,preToolUse:Cb.PreToolUse,postToolUse:Cb.PostToolUse,agentStop:Cb.Stop,subagentStop:Cb.SubagentStop,errorOccurred:Cb.ErrorOccurred},[xb.Claude]:{SessionStart:Cb.SessionStart,UserPromptSubmit:Cb.UserPromptSubmit,PreToolUse:Cb.PreToolUse,PostToolUse:Cb.PostToolUse,PreCompact:Cb.PreCompact,SubagentStart:Cb.SubagentStart,SubagentStop:Cb.SubagentStop,Stop:Cb.Stop},[xb.Undefined]:Object.fromEntries(Object.values(Cb).map(e=>[e,e]))},Tb={[Cb.SessionStart]:{label:b(8046,`Session Start`),description:b(8047,`Executed when a new agent session begins.`)},[Cb.UserPromptSubmit]:{label:b(8048,`User Prompt Submit`),description:b(8049,`Executed when the user submits a prompt to the agent.`)},[Cb.PreToolUse]:{label:b(8050,`Pre-Tool Use`),description:b(8051,`Executed before the agent uses any tool.`)},[Cb.PostToolUse]:{label:b(8052,`Post-Tool Use`),description:b(8053,`Executed after a tool completes execution successfully.`)},[Cb.PreCompact]:{label:b(8054,`Pre-Compact`),description:b(8055,`Executed before the agent compacts the conversation context.`)},[Cb.SubagentStart]:{label:b(8056,`Subagent Start`),description:b(8057,`Executed when a subagent is started.`)},[Cb.SubagentStop]:{label:b(8058,`Subagent Stop`),description:b(8059,`Executed when a subagent stops.`)},[Cb.Stop]:{label:b(8060,`Stop`),description:b(8061,`Executed when the agent stops.`)},[Cb.SessionEnd]:{label:b(8062,`Session End`),description:b(8063,`Executed when an agent session ends.`)},[Cb.ErrorOccurred]:{label:b(8064,`Error Occurred`),description:b(8065,`Executed when an error occurs during the agent session.`)}};var Eb;(function(e){function t(e,t){if(e===t)return!0;if(!e||!t)return!1;for(let n of Object.values(Cb)){let r=e[n],i=t[n];if(r?.length!==i?.length)return!1;if(r&&i){for(let e=0;e<r.length;e++)if(!vb.isEquals(r[e],i[e]))return!1}}return!0}e.isEquals=t})(Eb||={});function Db(e,t){if(!e)return t;let n={...e};for(let r of Object.values(Cb)){let i=e[r],a=t[r];a&&a.length>0&&(n[r]=i?[...i,...a]:a)}return n}const Ob={type:b(8028,`Must be "command".`),command:b(8029,`The command to execute. This is the default cross-platform command.`),windows:b(8030,`Windows-specific command. If specified and running on Windows, this overrides the "command" field.`),linux:b(8031,`Linux-specific command. If specified and running on Linux, this overrides the "command" field.`),osx:b(8032,`macOS-specific command. If specified and running on macOS, this overrides the "command" field.`),bash:b(8033,`Bash command for Linux and macOS.`),powershell:b(8034,`PowerShell command for Windows.`),cwd:b(8035,`Working directory for the script (relative to repository root).`),env:b(8036,`Additional environment variables that are merged with the existing environment.`),timeout:b(8037,`Maximum execution time in seconds (default: 30).`),timeoutSec:b(8038,`Maximum execution time in seconds (default: 10).`)},kb={type:`array`,items:{type:`object`,additionalProperties:!0,required:[`type`],anyOf:[{required:[`command`]},{required:[`windows`]},{required:[`linux`]},{required:[`osx`]},{required:[`bash`]},{required:[`powershell`]}],errorMessage:b(8039,`At least one of "command", "windows", "linux", or "osx" must be specified.`),properties:{type:{type:`string`,enum:[`command`],description:Ob.type},command:{type:`string`,description:Ob.command},windows:{type:`string`,description:Ob.windows},linux:{type:`string`,description:Ob.linux},osx:{type:`string`,description:Ob.osx},cwd:{type:`string`,description:Ob.cwd},env:{type:`object`,additionalProperties:{type:`string`},description:Ob.env},timeout:{type:`number`,default:30,description:Ob.timeout}}}};function Ab(e,t){return Object.fromEntries(Object.entries(wb[e]).map(([e,n])=>[e,{...t,description:Tb[n]?.description}]))}Ab(xb.VSCode,kb);const jb={type:`array`,items:{type:`object`,additionalProperties:!0,required:[`type`],anyOf:[{required:[`bash`]},{required:[`powershell`]}],errorMessage:b(8040,`At least one of "bash" or "powershell" must be specified.`),properties:{type:{type:`string`,enum:[`command`],description:Ob.type},bash:{type:`string`,description:Ob.bash},powershell:{type:`string`,description:Ob.powershell},cwd:{type:`string`,description:Ob.cwd},env:{type:`object`,additionalProperties:{type:`string`},description:Ob.env},timeoutSec:{type:`number`,default:10,description:Ob.timeoutSec}}}};Ab(xb.GitHubCopilot,jb),b(8041,`GitHub Copilot hook configuration file. Hooks enable executing custom shell commands at strategic points in an agent's workflow.`),b(8042,`Hook definitions organized by type.`),b(8043,`Hook configuration format version.`),b(8044,`Basic hook configuration`),b(8045,`A basic hook configuration with common hooks`);function Mb(e,t){return t===Bn.Windows&&e.windows?e.windows:t===Bn.Macintosh&&e.osx?e.osx:t===Bn.Linux&&e.linux?e.linux:e.command}var Nb;(function(e){e[e.Piece=1]=`Piece`,e[e.Text=2]=`Text`})(Nb||={});var Pb;(function(e){e[e.BaseChatMessage=1]=`BaseChatMessage`,e[e.Other=2]=`Other`,e[e.ImageChatMessage=3]=`ImageChatMessage`})(Pb||={});var Fb;(function(e){e.Internal={type:`internal`,label:`Built-In`},e.External={type:`external`,label:`External`};function t(e){switch(e.type){case`extension`:return`extension:${e.extensionId.value}`;case`mcp`:return`mcp:${e.collectionId}:${e.definitionId}`;case`user`:return`user:${e.file.toString()}`;case`internal`:return`internal`;case`external`:return`external`}}e.toKey=t;function n(e,n){return t(e)===t(n)}e.equals=n;function r(e){return e.type===`internal`?{ordinal:1,label:b(8390,`Built-In`)}:e.type===`mcp`?{ordinal:2,label:e.serverLabel||e.label}:e.type===`user`?{ordinal:0,label:b(8391,`User Defined`)}:{ordinal:3,label:e.label}}e.classify=r})(Fb||={});function Ib(e){return typeof e==`object`&&!!e&&C.isUri(e.sessionResource)}var Lb;(function(e){e.Hidden=`hidden`,e.HiddenAfterComplete=`hiddenAfterComplete`})(Lb||={});function Rb(e){return!!e&&e.getTools!==void 0}var zb;(function(e){e.execute=`execute`,e.edit=`edit`,e.search=`search`,e.agent=`agent`,e.read=`read`,e.web=`web`,e.todo=`todo`})(zb||={});var Bb;(function(e){e.runSubagent=`runSubagent`,e.vscode=`vscode`})(Bb||={});var Vb;(function(e){e[e.Blur=1]=`Blur`,e[e.Gesture=2]=`Gesture`,e[e.Other=3]=`Other`})(Vb||={});var Hb;(function(e){e.QuickPick=`quickPick`,e.InputBox=`inputBox`,e.QuickWidget=`quickWidget`,e.QuickTree=`quickTree`})(Hb||={});var Ub;(function(e){e[e.NONE=0]=`NONE`,e[e.FIRST=1]=`FIRST`,e[e.SECOND=2]=`SECOND`,e[e.LAST=3]=`LAST`})(Ub||={});var Wb;(function(e){e[e.First=1]=`First`,e[e.Second=2]=`Second`,e[e.Last=3]=`Last`,e[e.Next=4]=`Next`,e[e.Previous=5]=`Previous`,e[e.NextPage=6]=`NextPage`,e[e.PreviousPage=7]=`PreviousPage`,e[e.NextSeparator=8]=`NextSeparator`,e[e.PreviousSeparator=9]=`PreviousSeparator`})(Wb||={});var Gb;(function(e){e[e.Title=1]=`Title`,e[e.Inline=2]=`Inline`,e[e.Input=3]=`Input`})(Gb||={}),new class{constructor(e){this.options=e}getItemLabel(e){return e.label}getItemDescription(e){if(!this.options?.skipDescription)return e.description}getItemPath(e){if(!this.options?.skipPath)return e.resource?.scheme===D.file?e.resource.fsPath:e.resource?.path}};const Kb=O(`quickInputService`),qb=O(`secretStorageService`),Jb=O(`extensionService`);var Yb;(function(e){e.Extensions=`Extensions`,e.IntegratedTerminal=`IntegratedTerminal`,e.InteractiveSession=`InteractiveSession`,e.Telemetry=`Telemetry`,e.Update=`Update`})(Yb||={});const Xb=`^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$`;RegExp(Xb);var Zb;(function(e){e.COMMAND=`command`,e.SETTINGS_SYNC=`settingsSync`})(Zb||={});var Qb;(function(e){e.NoneOrRelevance=`NoneOrRelevance`,e.LastUpdatedDate=`LastUpdatedDate`,e.Title=`Title`,e.PublisherName=`PublisherName`,e.InstallCount=`InstallCount`,e.PublishedDate=`PublishedDate`,e.AverageRating=`AverageRating`,e.WeightedRating=`WeightedRating`})(Qb||={});var $b;(function(e){e[e.Default=0]=`Default`,e[e.Ascending=1]=`Ascending`,e[e.Descending=2]=`Descending`})($b||={});var ex;(function(e){e.Category=`Category`,e.ExtensionId=`ExtensionId`,e.ExtensionName=`ExtensionName`,e.ExcludeWithFlags=`ExcludeWithFlags`,e.Featured=`Featured`,e.SearchText=`SearchText`,e.Tag=`Tag`,e.Target=`Target`})(ex||={});var tx;(function(e){e.Install=`install`,e.Uninstall=`uninstall`})(tx||={});var nx;(function(e){e[e.None=1]=`None`,e[e.Install=2]=`Install`,e[e.Update=3]=`Update`,e[e.Migrate=4]=`Migrate`})(nx||={});var rx;(function(e){e.Timeout=`Timeout`,e.Cancelled=`Cancelled`,e.ClientError=`ClientError`,e.ServerError=`ServerError`,e.Failed=`Failed`,e.DownloadFailedWriting=`DownloadFailedWriting`,e.Offline=`Offline`})(rx||={});var ix;(function(e){e.NotFound=`NotFound`,e.Unsupported=`Unsupported`,e.Deprecated=`Deprecated`,e.Malicious=`Malicious`,e.Incompatible=`Incompatible`,e.IncompatibleApi=`IncompatibleApi`,e.IncompatibleTargetPlatform=`IncompatibleTargetPlatform`,e.ReleaseVersionNotFound=`ReleaseVersionNotFound`,e.Invalid=`Invalid`,e.Download=`Download`,e.DownloadSignature=`DownloadSignature`,e.DownloadFailedWriting=`DownloadFailedWriting`,e.UpdateMetadata=`UpdateMetadata`,e.Extract=`Extract`,e.Scanning=`Scanning`,e.ScanningExtension=`ScanningExtension`,e.ReadRemoved=`ReadRemoved`,e.UnsetRemoved=`UnsetRemoved`,e.Delete=`Delete`,e.Rename=`Rename`,e.IntializeDefaultProfile=`IntializeDefaultProfile`,e.AddToProfile=`AddToProfile`,e.InstalledExtensionNotFound=`InstalledExtensionNotFound`,e.PostInstall=`PostInstall`,e.CorruptZip=`CorruptZip`,e.IncompleteZip=`IncompleteZip`,e.PackageNotSigned=`PackageNotSigned`,e.SignatureVerificationInternal=`SignatureVerificationInternal`,e.SignatureVerificationFailed=`SignatureVerificationFailed`,e.NotAllowed=`NotAllowed`,e.Gallery=`Gallery`,e.Cancelled=`Cancelled`,e.Unknown=`Unknown`,e.Internal=`Internal`})(ix||={});var ax;(function(e){e.NotSigned=`NotSigned`,e.Success=`Success`,e.RequiredArgumentMissing=`RequiredArgumentMissing`,e.InvalidArgument=`InvalidArgument`,e.PackageIsUnreadable=`PackageIsUnreadable`,e.UnhandledException=`UnhandledException`,e.SignatureManifestIsMissing=`SignatureManifestIsMissing`,e.SignatureManifestIsUnreadable=`SignatureManifestIsUnreadable`,e.SignatureIsMissing=`SignatureIsMissing`,e.SignatureIsUnreadable=`SignatureIsUnreadable`,e.CertificateIsUnreadable=`CertificateIsUnreadable`,e.SignatureArchiveIsUnreadable=`SignatureArchiveIsUnreadable`,e.FileAlreadyExists=`FileAlreadyExists`,e.SignatureArchiveIsInvalidZip=`SignatureArchiveIsInvalidZip`,e.SignatureArchiveHasSameSignatureFile=`SignatureArchiveHasSameSignatureFile`,e.PackageIntegrityCheckFailed=`PackageIntegrityCheckFailed`,e.SignatureIsInvalid=`SignatureIsInvalid`,e.SignatureManifestIsInvalid=`SignatureManifestIsInvalid`,e.SignatureIntegrityCheckFailed=`SignatureIntegrityCheckFailed`,e.EntryIsMissing=`EntryIsMissing`,e.EntryIsTampered=`EntryIsTampered`,e.Untrusted=`Untrusted`,e.CertificateRevoked=`CertificateRevoked`,e.SignatureIsNotValid=`SignatureIsNotValid`,e.UnknownError=`UnknownError`,e.PackageIsInvalidZip=`PackageIsInvalidZip`,e.SignatureArchiveHasTooManyEntries=`SignatureArchiveHasTooManyEntries`})(ax||={}),ln(1931,`Extensions`),ln(1932,`Preferences`),Am.as(dg.Configuration).registerConfiguration({id:`extensions`,order:30,title:b(1933,`Extensions`),type:`object`,properties:{"extensions.allowed":{type:`object`,markdownDescription:b(1934,`Specify a list of extensions that are allowed to use. This helps maintain a secure and consistent development environment by restricting the use of unauthorized extensions. For more information on how to configure this setting, please visit the [Configure Allowed Extensions](https://aka.ms/vscode/enterprise/extensions/allowed) section.`),default:`*`,defaultSnippets:[{body:{},description:b(1935,`No extensions are allowed.`)},{body:{"*":!0},description:b(1936,`All extensions are allowed.`)}],scope:fg.APPLICATION,policy:{name:`AllowedExtensions`,category:Yb.Extensions,minimumVersion:`1.96`,localization:{description:{key:`extensions.allowed.policy`,value:b(1937,`Specify a list of extensions that are allowed to use. This helps maintain a secure and consistent development environment by restricting the use of unauthorized extensions. More information: https://aka.ms/vscode/enterprise/extensions/allowed`)}}},additionalProperties:!1,patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{anyOf:[{type:[`boolean`,`string`],enum:[!0,!1,`stable`],description:b(1938,`Allow or disallow the extension.`),enumDescriptions:[b(1939,`Extension is allowed.`),b(1940,`Extension is not allowed.`),b(1941,`Allow only stable versions of the extension.`)]},{type:`array`,items:{type:`string`},description:b(1942,"Allow or disallow specific versions of the extension. To specifcy a platform specific version, use the format `platform@1.2.3`, e.g. `win32-x64@1.2.3`. Supported platforms are `win32-x64`, `win32-arm64`, `linux-x64`, `linux-arm64`, `linux-armhf`, `alpine-x64`, `alpine-arm64`, `darwin-x64`, `darwin-arm64`")}]},"([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:[`boolean`,`string`],enum:[!0,!1,`stable`],description:b(1943,`Allow or disallow all extensions from the publisher.`),enumDescriptions:[b(1944,`All extensions from the publisher are allowed.`),b(1945,`All extensions from the publisher are not allowed.`),b(1946,`Allow only stable versions of the extensions from the publisher.`)]},"\\*":{type:`boolean`,enum:[!0,!1],description:b(1947,`Allow or disallow all extensions.`),enumDescriptions:[b(1948,`Allow all extensions.`),b(1949,`Disallow all extensions.`)]}}}}});const ox=new class{constructor(){this._generators=new Map,this._cache=new WeakMap}register(e,t){this._generators.set(e,t)}readActivationEvents(e){return this._cache.has(e)||this._cache.set(e,this._readActivationEvents(e)),this._cache.get(e)}createActivationEventsMap(e){let t=Object.create(null);for(let n of e){let e=this.readActivationEvents(n);e.length>0&&(t[Ts.toKey(n.identifier)]=e)}return t}_readActivationEvents(e){if(e.main===void 0&&e.browser===void 0)return[];let t=Array.isArray(e.activationEvents)?e.activationEvents.slice(0):[];for(let n=0;n<t.length;n++)t[n]===`onUri`&&(t[n]=`onUri:${Ts.toKey(e.identifier)}`);if(!e.contributes)return t;for(let n in e.contributes){let r=this._generators.get(n);if(!r)continue;let i=e.contributes[n],a=Array.isArray(i)?i:[i];try{t.push(...r(a))}catch(e){m(e)}}return t}},sx=Object.freeze({activeComment:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts`},agentSessionsWorkspace:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentSessionsWorkspace.d.ts`},agentsWindowConfiguration:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.agentsWindowConfiguration.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`},authProviderSpecific:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authProviderSpecific.d.ts`},authSession:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts`},authSessionAudience:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSessionAudience.d.ts`},authenticationChallenges:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authenticationChallenges.d.ts`},browser:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.browser.d.ts`},canonicalUriProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts`},chatContextProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatContextProvider.d.ts`},chatDebug:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatDebug.d.ts`,version:4},chatHooks:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatHooks.d.ts`,version:6},chatInputNotification:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatInputNotification.d.ts`},chatOutputRenderer:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatOutputRenderer.d.ts`},chatParticipantAdditions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts`,version:3},chatParticipantPrivate:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts`,version:15},chatPromptFiles:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatPromptFiles.d.ts`,version:2},chatProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts`,version:5},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`},chatSessionCustomizationProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionCustomizationProvider.d.ts`},chatSessionsProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts`,version:3},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`},contribChatEditorInlineGutterMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribChatEditorInlineGutterMenu.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`},contribSourceControlArtifactGroupMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactGroupMenu.d.ts`},contribSourceControlArtifactMenu:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlArtifactMenu.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`},css:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.css.d.ts`},customEditorDiffs:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorDiffs.d.ts`},customEditorMove:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts`},customEditorPriority:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorPriority.d.ts`},dataChannels:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.dataChannels.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},devDeviceId:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.devDeviceId.d.ts`},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`},documentDiff:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentDiff.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`},envIsConnectionMetered:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.envIsConnectionMetered.d.ts`},environmentPower:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.environmentPower.d.ts`},extensionAffinity:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionAffinity.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`},inlineCompletionsAdditions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.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`},languageModelPricing:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelPricing.d.ts`},languageModelProxy:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelProxy.d.ts`},languageModelSystem:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts`},languageModelThinkingPart:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelThinkingPart.d.ts`,version:1},languageModelToolResultAudience:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolResultAudience.d.ts`},languageModelToolSupportsModel:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolSupportsModel.d.ts`,version:1},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`},markdownAlertSyntax:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.markdownAlertSyntax.d.ts`},mcpServerDefinitions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpServerDefinitions.d.ts`,version:1},mcpToolDefinitions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mcpToolDefinitions.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`},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`},remoteCodingAgents:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.remoteCodingAgents.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`},scmArtifactProvider:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmArtifactProvider.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`},scmProviderOptions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmProviderOptions.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`},taskExecutionTerminal:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskExecutionTerminal.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`},taskRunOptions:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskRunOptions.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`},terminalTitle:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalTitle.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`},textDocumentChangeReason:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textDocumentChangeReason.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`},toolInvocationApproveCombination:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolInvocationApproveCombination.d.ts`},toolProgress:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolProgress.d.ts`},treeItemMarkdownLabel:{proposal:`https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeItemMarkdownLabel.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`}}),cx=Am.as(sg.JSONContribution);var lx=class e{static _toSet(e){let t=new Es;for(let n=0,r=e.length;n<r;n++)t.add(e[n].description.identifier);return t}static compute(t,n){if(!t||!t.length)return new e(n,[]);if(!n||!n.length)return new e([],t);let r=this._toSet(t),i=this._toSet(n);return new e(n.filter(e=>!r.has(e.description.identifier)),t.filter(e=>!i.has(e.description.identifier)))}constructor(e,t){this.added=e,this.removed=t}},ux=class{constructor(e,t,n){this.name=e,this.defaultExtensionKind=t,this.canHandleResolver=n,this._handler=null,this._users=null,this._delta=null}setHandler(e){if(this._handler!==null)throw Error(`Handler already set!`);return this._handler=e,this._handle(),{dispose:()=>{this._handler=null}}}acceptUsers(e){this._delta=lx.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){m(e)}}};const dx={type:`string`,enum:[`ui`,`workspace`],enumDescriptions:[b(16992,`UI extension kind. In a remote window, such extensions are enabled only when available on the local machine.`),b(16993,`Workspace extension kind. In a remote window, such extensions are enabled only when available on the remote.`)]},fx=`vscode://schemas/vscode-extensions`,px={properties:{engines:{type:`object`,description:b(16994,`Engine compatibility.`),properties:{vscode:{type:`string`,description:b(16995,`For VS Code extensions, specifies the VS Code version that the extension is compatible with. Cannot be *. For example: ^1.105.0 indicates compatibility with a minimum VS Code version of 1.105.0.`),default:`^1.105.0`}}},publisher:{description:b(16996,`The publisher of the VS Code extension.`),type:`string`},displayName:{description:b(16997,`The display name for the extension used in the VS Code gallery.`),type:`string`},categories:{description:b(16998,`The categories used by the VS Code gallery to categorize the extension.`),type:`array`,uniqueItems:!0,items:{oneOf:[{type:`string`,enum:Ss},{type:`string`,const:`Languages`,deprecationMessage:b(16999,`Use 'Programming Languages' instead`)}]}},galleryBanner:{type:`object`,description:b(17e3,`Banner used in the VS Code marketplace.`),properties:{color:{description:b(17001,`The banner color on the VS Code marketplace page header.`),type:`string`},theme:{description:b(17002,`The color theme for the font used in the banner.`),type:`string`,enum:[`dark`,`light`]}}},contributes:{description:b(17003,`All contributions of the VS Code extension represented by this package.`),type:`object`,properties:{},default:{}},preview:{type:`boolean`,description:b(17004,`Sets the extension to be flagged as a Preview in the Marketplace.`)},enableProposedApi:{type:`boolean`,deprecationMessage:b(17005,"Use `enabledApiProposals` instead.")},enabledApiProposals:{markdownDescription:b(17006,`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(sx).map(e=>e),markdownEnumDescriptions:Object.values(sx).map(e=>e.proposal)}},api:{markdownDescription:b(17007,`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:[b(17008,`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:b(17009,`Activation events for the VS Code extension.`),type:`array`,items:{type:`string`,defaultSnippets:[{label:`onWebviewPanel`,description:b(17010,`An activation event emitted when a webview is loaded of a certain viewType`),body:`onWebviewPanel:viewType`},{label:`onLanguage`,description:b(17011,`An activation event emitted whenever a file that resolves to the specified language gets opened.`),body:"onLanguage:${1:languageId}"},{label:`onCommand`,description:b(17012,`An activation event emitted whenever the specified command gets invoked.`),body:"onCommand:${2:commandId}"},{label:`onDebug`,description:b(17013,`An activation event emitted whenever a user is about to start debugging or about to setup debug configurations.`),body:`onDebug`},{label:`onDebugInitialConfigurations`,description:b(17014,`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:b(17015,`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:b(17016,`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:b(17017,`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:b(17018,`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:b(17019,"An activation event emitted after the start-up finished (after all `*` activated extensions have finished activating)."),body:`onStartupFinished`},{label:`onTaskType`,description:b(17020,`An activation event emitted whenever tasks of a certain type need to be listed or resolved.`),body:"onTaskType:${1:taskType}"},{label:`onFileSystem`,description:b(17021,`An activation event emitted whenever a file or folder is accessed with the given scheme.`),body:"onFileSystem:${1:scheme}"},{label:`onEditSession`,description:b(17022,`An activation event emitted whenever an edit session is accessed with the given scheme.`),body:"onEditSession:${1:scheme}"},{label:`onSearch`,description:b(17023,`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:b(17024,`An activation event emitted whenever the specified view is expanded.`)},{label:`onUri`,body:`onUri`,description:b(17025,`An activation event emitted whenever a system-wide Uri directed towards this extension is open.`)},{label:`onOpenExternalUri`,body:`onOpenExternalUri`,description:b(17026,`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:b(17027,`An activation event emitted whenever the specified custom editor becomes visible.`)},{label:`onNotebook`,body:"onNotebook:${1:type}",description:b(17028,`An activation event emitted whenever the specified notebook document is opened.`)},{label:`onAuthenticationRequest`,body:"onAuthenticationRequest:${11:authenticationProviderId}",description:b(17029,`An activation event emitted whenever sessions are requested from the specified authentication provider.`)},{label:`onRenderer`,description:b(17030,`An activation event emitted whenever a notebook output renderer is used.`),body:"onRenderer:${11:rendererId}"},{label:`onTerminalProfile`,body:"onTerminalProfile:${1:terminalId}",description:b(17031,`An activation event emitted when a specific terminal profile is launched.`)},{label:`onTerminalQuickFixRequest`,body:"onTerminalQuickFixRequest:${1:quickFixId}",description:b(17032,`An activation event emitted when a command matches the selector associated with this ID`)},{label:`onWalkthrough`,body:"onWalkthrough:${1:walkthroughID}",description:b(17033,`An activation event emitted when a specified walkthrough is opened.`)},{label:`onIssueReporterOpened`,body:`onIssueReporterOpened`,description:b(17034,`An activation event emitted when the issue reporter is opened.`)},{label:`onChatParticipant`,body:"onChatParticipant:${1:participantId}",description:b(17035,`An activation event emitted when the specified chat participant is invoked.`)},{label:`onChatContextProvider`,body:"onChatContextProvider:${1:contextProviderId}",description:b(17036,`An activation event emitted when the specified chat context provider is invoked.`)},{label:`onLanguageModelChatProvider`,body:"onLanguageModelChatProvider:${1:vendor}",description:b(17037,`An activation event emitted when a chat model provider for the given vendor is requested.`)},{label:`onLanguageModelTool`,body:"onLanguageModelTool:${1:toolId}",description:b(17038,`An activation event emitted when the specified language model tool is invoked.`)},{label:`onTerminal`,body:`onTerminal:{1:shellType}`,description:b(17039,`An activation event emitted when a terminal of the given shell type is opened.`)},{label:`onTerminalShellIntegration`,body:"onTerminalShellIntegration:${1:shellType}",description:b(17040,`An activation event emitted when terminal shell integration is activated for the given shell type.`)},{label:`onMcpCollection`,description:b(17041,`An activation event emitted whenever a tool from the MCP server is requested.`),body:"onMcpCollection:${2:collectionId}"},{label:`*`,description:b(17042,`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:b(17043,`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:b(17044,`Badge image URL.`)},href:{type:`string`,description:b(17045,`Badge link.`)},description:{type:`string`,description:b(17046,`Badge description.`)}}}},markdown:{type:`string`,description:b(17047,`Controls the Markdown rendering engine used in the Marketplace. Either github (default) or standard.`),enum:[`github`,`standard`],default:`github`},qna:{default:`marketplace`,description:b(17048,`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:b(17049,"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:Xb}},extensionAffinity:{description:b(17050,"Extensions that this extension should be colocated with in the same extension host process if possible. The identifier of an extension is always ${publisher}.${name}. For example: vscode.git."),type:`array`,uniqueItems:!0,items:{type:`string`,pattern:Xb}},extensionPack:{description:b(17051,"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:Xb}},extensionKind:{description:b(17052,"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:dx,default:[`workspace`],defaultSnippets:[{body:[`ui`],description:b(17053,`Define an extension which can run only on the local machine when connected to remote window.`)},{body:[`workspace`],description:b(17054,`Define an extension which can run only on the remote machine when connected remote window.`)},{body:[`ui`,`workspace`],description:b(17055,`Define an extension which can run on either side, with a preference towards running on the local machine.`)},{body:[`workspace`,`ui`],description:b(17056,`Define an extension which can run on either side, with a preference towards running on the remote machine.`)},{body:[],description:b(17057,`Define an extension which cannot run in a remote context, neither on the local, nor on the remote machine.`)}]},capabilities:{description:b(17058,`Declare the set of supported capabilities by the extension.`),type:`object`,properties:{virtualWorkspaces:{description:b(17059,`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:b(17060,`Declares the level of support for virtual workspaces by the extension.`),type:[`string`,`boolean`],enum:[`limited`,!0,!1],enumDescriptions:[b(17061,`The extension will be enabled in virtual workspaces with some functionality disabled.`),b(17062,`The extension will be enabled in virtual workspaces with all functionality enabled.`),b(17063,`The extension will not be enabled in virtual workspaces.`)]},description:{type:`string`,markdownDescription:b(17064,"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:b(17065,`Declares how the extension should be handled in untrusted workspaces.`),type:`object`,required:[`supported`],defaultSnippets:[{body:{supported:"${1:limited}",description:"${2}"}}],properties:{supported:{markdownDescription:b(17066,`Declares the level of support for untrusted workspaces by the extension.`),type:[`string`,`boolean`],enum:[`limited`,!0,!1],enumDescriptions:[b(17067,`The extension will be enabled in untrusted workspaces with some functionality disabled.`),b(17068,`The extension will be enabled in untrusted workspaces with all functionality enabled.`),b(17069,`The extension will not be enabled in untrusted workspaces.`)]},restrictedConfigurations:{description:b(17070,`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:b(17071,"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:b(17072,`Specify the location from where users can sponsor your extension.`),type:`object`,defaultSnippets:[{body:{url:"${1:https:}"}}],properties:{url:{description:b(17073,`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:b(17074,`Script executed before the package is published as a VS Code extension.`),type:`string`},"vscode:uninstall":{description:b(17075,`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:b(17076,`The path to a 128x128 pixel icon.`)},l10n:{type:`string`,description:b(17077,`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:b(17078,`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`}}};var mx=class{constructor(){this._extensionPoints=new Map}registerExtensionPoint(e){if(this._extensionPoints.has(e.extensionPoint))throw Error(`Duplicate extension point: `+e.extensionPoint);let t=new ux(e.extensionPoint,e.defaultExtensionKind,e.canHandleResolver);return this._extensionPoints.set(e.extensionPoint,t),e.activationEventsGenerator&&ox.register(e.extensionPoint,e.activationEventsGenerator),px.properties.contributes.properties[e.extensionPoint]=e.jsonSchema,cx.registerSchema(fx,px),t}getExtensionPoints(){return Array.from(this._extensionPoints.values())}};const hx={ExtensionsRegistry:`ExtensionsRegistry`};Am.add(hx.ExtensionsRegistry,new mx);const gx=Am.as(hx.ExtensionsRegistry);cx.registerSchema(fx,px),cx.registerSchema(`vscode://schemas/vscode-product`,{properties:{extensionEnabledApiProposals:{description:b(17079,`API proposals that the respective extensions can freely use.`),type:`object`,properties:{},additionalProperties:{anyOf:[{type:`array`,uniqueItems:!0,items:{type:`string`,enum:Object.keys(sx),markdownEnumDescriptions:Object.values(sx).map(e=>e.proposal)}}]}}}}),new F(`isMac`,En,b(1891,`Whether the operating system is macOS`)),new F(`isLinux`,Dn,b(1892,`Whether the operating system is Linux`)),new F(`isWindows`,Tn,b(1893,`Whether the operating system is Windows`));const _x=new F(`isWeb`,kn,b(1894,`Whether the platform is a web browser`));new F(`isMacNative`,En&&!kn,b(1895,`Whether the operating system is macOS on a non-browser platform`)),new F(`isIOS`,Mn,b(1896,`Whether the operating system is iOS`)),new F(`isMobile`,Nn,b(1897,`Whether the platform is a mobile web browser`)),new F(`isDevelopment`,!1,!0),new F(`productQualityType`,``,b(1898,`Quality type of VS Code`)),new F(`inputFocus`,!1,b(1899,`Whether keyboard focus is inside an input box`));var vx;(function(e){e.Inactive=`inactive`,e.Satisfied=`satisfied`,e.Restricted=`restricted`})(vx||={});var yx;(function(e){e.NoAccount=`noAccount`,e.WrongProvider=`wrongProvider`,e.OrgNotApproved=`orgNotApproved`,e.PolicyNotResolved=`policyNotResolved`})(yx||={});const bx=new F(`chatAccountPolicyGateActive`,!1,{type:`boolean`,description:b(17176,`True when the 'Require Approved Account' policy is in effect and the user is not yet signed into an approved GitHub organization, so all AI features are disabled until they sign in.`)});var xx;(function(e){e.responseVote=new F(`chatSessionResponseVote`,``,{type:`string`,description:b(7828,`When the response has been voted up, is set to 'up'. When voted down, is set to 'down'. Otherwise an empty string.`)}),e.responseDetectedAgentCommand=new F(`chatSessionResponseDetectedAgentOrCommand`,!1,{type:`boolean`,description:b(7829,`When the agent or command was automatically detected`)}),e.responseSupportsIssueReporting=new F(`chatResponseSupportsIssueReporting`,!1,{type:`boolean`,description:b(7830,`True when the current chat response supports issue reporting.`)}),e.responseIsFiltered=new F(`chatSessionResponseFiltered`,!1,{type:`boolean`,description:b(7831,`True when the chat response was filtered out by the server.`)}),e.responseHasError=new F(`chatSessionResponseError`,!1,{type:`boolean`,description:b(7832,`True when the chat response resulted in an error.`)}),e.requestInProgress=new F(`chatSessionRequestInProgress`,!1,{type:`boolean`,description:b(7833,`True when the current request is still in progress.`)}),e.hasActiveRequest=new F(`chatSessionHasActiveRequest`,!1,{type:`boolean`,description:b(7834,`True when the current chat response has not completed, regardless of intermediate states like tool calls or elicitations.`)}),e.currentlyEditing=new F(`chatSessionCurrentlyEditing`,!1,{type:`boolean`,description:b(7835,`True when the current request is being edited.`)}),e.currentlyEditingInput=new F(`chatSessionCurrentlyEditingInput`,!1,{type:`boolean`,description:b(7836,`True when the current request input at the bottom is being edited.`)}),(function(e){e.Sent=`s`,e.Queue=`q`,e.Steer=`st`})(e.EditingRequestType||={}),e.editingRequestType=new F(`chatEditingSentRequest`,void 0,{type:`string`,description:b(7837,`The type of the current editing request.`)}),e.isResponse=new F(`chatResponse`,!1,{type:`boolean`,description:b(7838,`The chat item is a response.`)}),e.isRequest=new F(`chatRequest`,!1,{type:`boolean`,description:b(7839,`The chat item is a request`)}),e.isFirstRequest=new F(`chatFirstRequest`,!1,{type:`boolean`,description:b(7840,`The chat item is the first request in the session.`)}),e.isPendingRequest=new F(`chatRequestIsPending`,!1,{type:`boolean`,description:b(7841,`True when the chat request item is pending in the queue.`)}),e.itemId=new F(`chatItemId`,``,{type:`string`,description:b(7842,`The id of the chat item.`)}),e.lastItemId=new F(`chatLastItemId`,[],{type:`string`,description:b(7843,`The id of the last chat item.`)}),e.editApplied=new F(`chatEditApplied`,!1,{type:`boolean`,description:b(7844,`True when the chat text edits have been applied.`)}),e.inputHasText=new F(`chatInputHasText`,!1,{type:`boolean`,description:b(7845,`True when the chat input has text.`)}),e.inputHasSendableContent=new F(`chatInputHasSendableContent`,!1,{type:`boolean`,description:b(7846,`True when the chat input has text or file attachments that can be sent.`)}),e.inputHasFocus=new F(`chatInputHasFocus`,!1,{type:`boolean`,description:b(7847,`True when the chat input has focus.`)}),e.inChatInput=new F(`inChatInput`,!1,{type:`boolean`,description:b(7848,`True when focus is in the chat input, false otherwise.`)}),e.inChatSession=new F(`inChat`,!1,{type:`boolean`,description:b(7849,`True when focus is in the chat widget, false otherwise.`)}),e.inChatQuestionCarousel=new F(`inChatQuestionCarousel`,!1,{type:`boolean`,description:b(7850,`True when focus is in the chat question carousel.`)}),e.chatQuestionCarouselHasTerminal=new F(`chatQuestionCarouselHasTerminal`,!1,{type:`boolean`,description:b(7851,`True when the chat question carousel was triggered by a terminal and has a terminal to focus.`)}),e.inChatEditor=new F(`inChatEditor`,!1,{type:`boolean`,description:b(7852,`Whether focus is in a chat editor.`)}),e.inChatTodoList=new F(`inChatTodoList`,!1,{type:`boolean`,description:b(7853,`True when focus is in the chat todo list.`)}),e.inChatTip=new F(`inChatTip`,!1,{type:`boolean`,description:b(7854,`True when focus is in a chat tip.`)}),e.multipleChatTips=new F(`multipleChatTips`,!1,{type:`boolean`,description:b(7855,`True when there are multiple chat tips available.`)}),e.inChatTerminalToolOutput=new F(`inChatTerminalToolOutput`,!1,{type:`boolean`,description:b(7856,`True when focus is in the chat terminal output region.`)}),e.chatModeKind=new F(`chatAgentKind`,gy.Ask,{type:`string`,description:b(7857,`The 'kind' of the current agent.`)}),e.chatPermissionLevel=new F(`chatPermissionLevel`,_y.Default,{type:`string`,description:b(7858,`The current permission level for tool auto-approval.`)}),e.chatModeName=new F(`chatModeName`,``,{type:`string`,description:b(7859,`The name of the current chat mode (e.g. 'Plan' for custom modes).`)}),e.chatModelId=new F(`chatModelId`,``,{type:`string`,description:b(7860,`The short id of the currently selected chat model (for example 'gpt-4.1').`)}),e.supported=Fd.or(_x.negate(),uy.notEqualsTo(``),Fd.has(`config.chat.experimental.serverlessWebEnabled`)),e.enabled=new F(`chatIsEnabled`,!1,{type:`boolean`,description:b(7861,`True when chat is enabled because a default chat participant is activated with an implementation.`)}),e.accountPolicyGateActive=bx,e.lockedToCodingAgent=new F(`lockedToCodingAgent`,!1,{type:`boolean`,description:b(7862,`True when the chat widget is locked to the coding agent session.`)}),e.lockedCodingAgentId=new F(`lockedCodingAgentId`,``,{type:`string`,description:b(7863,`The agent ID when the chat widget is locked to a coding agent session.`)}),e.chatSessionHasCustomAgentTarget=new F(`chatSessionHasCustomAgentTarget`,!1,{type:`boolean`,description:b(7864,`True when the chat session has a customAgentTarget defined to filter modes.`)}),e.chatSessionHasTargetedModels=new F(`chatSessionHasTargetedModels`,!1,{type:`boolean`,description:b(7865,`True when the chat session has language models that target it via targetChatSessionType.`)}),e.agentSupportsAttachments=new F(`agentSupportsAttachments`,!1,{type:`boolean`,description:b(7866,`True when the chat agent supports attachments.`)}),e.withinEditSessionDiff=new F(`withinEditSessionDiff`,!1,{type:`boolean`,description:b(7867,`True when the chat widget dispatches to the edit session chat.`)}),e.filePartOfEditSession=new F(`filePartOfEditSession`,!1,{type:`boolean`,description:b(7868,`True when the chat widget is within a file with an edit session.`)}),e.extensionParticipantRegistered=new F(`chatPanelExtensionParticipantRegistered`,!1,{type:`boolean`,description:b(7869,`True when a default chat participant is registered for the panel from an extension.`)}),e.panelParticipantRegistered=new F(`chatPanelParticipantRegistered`,!1,{type:`boolean`,description:b(7870,`True when a default chat participant is registered for the panel.`)}),e.chatEditingCanUndo=new F(`chatEditingCanUndo`,!1,{type:`boolean`,description:b(7871,`True when it is possible to undo an interaction in the editing panel.`)}),e.chatEditingCanRedo=new F(`chatEditingCanRedo`,!1,{type:`boolean`,description:b(7872,`True when it is possible to redo an interaction in the editing panel.`)}),e.languageModelsAreUserSelectable=new F(`chatModelsAreUserSelectable`,!1,{type:`boolean`,description:b(7873,`True when the chat model can be selected manually by the user.`)}),e.nonCopilotLanguageModelsAreUserSelectable=new F(`chatNonCopilotModelsAreUserSelectable`,!1,{type:`boolean`,description:b(7874,`True when a user-selectable chat model from a non-Copilot vendor is available.`)}),e.chatSessionHasModels=new F(`chatSessionHasModels`,!1,{type:`boolean`,description:b(7875,`True when the chat is in a contributed chat session that has available 'models' to display.`)}),e.chatSessionOptionsValid=new F(`chatSessionOptionsValid`,!0,{type:`boolean`,description:b(7876,`True when all selected session options exist in their respective option group items.`)}),e.extensionInvalid=new F(`chatExtensionInvalid`,!1,{type:`boolean`,description:b(7877,`True when the installed chat extension is invalid and needs to be updated.`)}),e.inputCursorAtTop=new F(`chatCursorAtTop`,!1),e.inputHasAgent=new F(`chatInputHasAgent`,!1),e.location=new F(`chatLocation`,void 0),e.inQuickChat=new F(`quickChatHasFocus`,!1,{type:`boolean`,description:b(7878,`True when the quick chat UI has focus, false otherwise.`)}),e.inAgentSessionsWelcome=new F(`inAgentSessionsWelcome`,!1,{type:`boolean`,description:b(7879,`True when the chat input is within the agent sessions welcome page.`)}),e.chatSessionType=new F(`chatSessionType`,``,{type:`string`,description:b(7880,`The type of the current chat session.`)}),e.hasFileAttachments=new F(`chatHasFileAttachments`,!1,{type:`boolean`,description:b(7881,`True when the chat has file attachments.`)}),e.chatSessionIsEmpty=new F(`chatSessionIsEmpty`,!0,{type:`boolean`,description:b(7882,`True when the current chat session has no requests.`)}),e.hasPendingRequests=new F(`chatHasPendingRequests`,!1,{type:`boolean`,description:b(7883,`True when there are pending requests in the queue.`)}),e.chatSessionHasDebugData=new F(`chatSessionHasDebugData`,!1,{type:`boolean`,description:b(7884,`True when the current chat session has debug log data.`)}),e.chatSessionHasDebugTools=new F(`chatSessionHasDebugTools`,!1,{type:`boolean`,description:b(7885,`True when debug tools are enabled in the current chat session.`)}),e.remoteJobCreating=new F(`chatRemoteJobCreating`,!1,{type:`boolean`,description:b(7886,`True when a remote coding agent job is being created.`)}),e.hasRemoteCodingAgent=new F(`hasRemoteCodingAgent`,!1,b(7887,`Whether any remote coding agent is available`)),e.hasCanDelegateProviders=new F(`chatHasCanDelegateProviders`,!1,{type:`boolean`,description:b(7888,`True when there are chat session providers with delegation support available.`)}),e.enableRemoteCodingAgentPromptFileOverlay=new F(`enableRemoteCodingAgentPromptFileOverlay`,!1,b(7889,`Whether the remote coding agent prompt file overlay feature is enabled`)),e.skipChatRequestInProgressMessage=new F(`chatSkipRequestInProgressMessage`,!1,{type:`boolean`,description:b(7890,`True when the chat request in progress message should be skipped.`)}),e.Setup=U.Setup,e.Entitlement=U.Entitlement,e.chatQuotaExceeded=U.chatQuotaExceeded,e.completionsQuotaExceeded=U.completionsQuotaExceeded,e.Editing={hasToolConfirmation:new F(`chatHasToolConfirmation`,!1,{type:`boolean`,description:b(7891,`True when a tool confirmation is present.`)}),hasElicitationRequest:new F(`chatHasElicitationRequest`,!1,{type:`boolean`,description:b(7892,`True when a chat elicitation request is pending.`)}),hasQuestionCarousel:new F(`chatHasQuestionCarousel`,!1,{type:`boolean`,description:b(7893,`True when a question carousel is rendered in the chat input.`)})},e.Tools={toolsCount:new F(`toolsCount`,0,{type:`number`,description:b(7894,`The count of tools available in the chat.`)})},e.foregroundSessionCount=new F(`chatForegroundSessionCount`,0,{type:`number`,description:b(7895,`The number of foreground chat sessions visible across chat surfaces.`)}),e.Modes={hasCustomChatModes:new F(`chatHasCustomAgents`,!1,{type:`boolean`,description:b(7896,`True when the chat has custom agents available.`)}),agentModeDisabledByPolicy:new F(`chatAgentModeDisabledByPolicy`,!1,{type:`boolean`,description:b(7897,`True when agent mode is disabled by organization policy.`)})},e.panelLocation=new F(`chatPanelLocation`,void 0,{type:`number`,description:b(7898,`The location of the chat panel.`)}),e.agentSessionsViewerFocused=new F(`agentSessionsViewerFocused`,!0,{type:`boolean`,description:b(7899,`If the agent sessions view in the chat view is focused.`)}),e.agentSessionsViewerOrientation=new F(`agentSessionsViewerOrientation`,void 0,{type:`number`,description:b(7900,`Orientation of the agent sessions view in the chat view.`)}),e.agentSessionsViewerPosition=new F(`agentSessionsViewerPosition`,void 0,{type:`number`,description:b(7901,`Position of the agent sessions view in the chat view.`)}),e.agentSessionsViewerVisible=new F(`agentSessionsViewerVisible`,void 0,{type:`boolean`,description:b(7902,`Visibility of the agent sessions view in the chat view.`)}),e.agentSessionType=new F(`chatSessionType`,``,{type:`string`,description:b(7903,`The type of the current agent session item.`)}),e.chatSessionSupportsDelegation=new F(`chatSessionSupportsDelegation`,!0,{type:`boolean`,description:b(7904,`True when the current session type supports delegation.`)}),e.chatSessionSupportsFork=new F(`chatSessionSupportsFork`,!1,{type:`boolean`,description:b(7905,`True when the current chat session provider supports forking conversations.`)}),e.agentSessionSection=new F(`agentSessionSection`,``,{type:`string`,description:b(7906,`The section of the current agent session section item.`)}),e.isArchivedAgentSession=new F(`agentSessionIsArchived`,!1,{type:`boolean`,description:b(7907,`True when the agent session item is archived.`)}),e.isPinnedAgentSession=new F(`agentSessionIsPinned`,!1,{type:`boolean`,description:b(7908,`True when the agent session item is pinned.`)}),e.isReadAgentSession=new F(`agentSessionIsRead`,!1,{type:`boolean`,description:b(7909,`True when the agent session item is read.`)}),e.hasMultipleAgentSessionsSelected=new F(`agentSessionHasMultipleSelected`,!1,{type:`boolean`,description:b(7910,`True when multiple agent sessions are selected.`)}),e.hasAgentSessionChanges=new F(`agentSessionHasChanges`,!1,{type:`boolean`,description:b(7911,`True when the current agent session item has changes.`)}),e.isKatexMathElement=new F(`chatIsKatexMathElement`,!1,{type:`boolean`,description:b(7912,`True when focusing a KaTeX math element.`)}),e.hasUsedCreateSlashCommands=new F(`chatHasUsedCreateSlashCommands`,!1,{type:`boolean`,description:b(7913,`True when the user has used any of the /create-* slash commands.`)}),e.contextUsageHasBeenOpened=new F(`chatContextUsageHasBeenOpened`,!1,{type:`boolean`,description:b(7914,`True when the user has opened the context window usage details.`)}),e.newChatButtonExperimentIcon=new F(`chatNewChatButtonExperimentIcon`,``,{type:`string`,description:b(7915,`The icon variant for the new chat button, controlled by experiment. Values: 'copilot', 'new-session', 'comment', or empty for default.`)})})(xx||={});var Sx;(function(e){e.inEditingMode=Fd.or(xx.chatModeKind.isEqualTo(gy.Edit),xx.chatModeKind.isEqualTo(gy.Agent)),e.isAgentHostSession=Fd.or(Fd.regex(xx.lockedCodingAgentId.key,/^agent-host-/),Fd.regex(xx.lockedCodingAgentId.key,/^remote-/)),e.isAgentHostSessionItem=Fd.or(Fd.regex(xx.agentSessionType.key,/^agent-host-/),Fd.regex(xx.agentSessionType.key,/^remote-/))})(Sx||={});const Cx=O(`ILanguageModelsConfigurationService`);var wx,Tx;(function(e){e[e.System=0]=`System`,e[e.User=1]=`User`,e[e.Assistant=2]=`Assistant`})(Tx||={});var Ex;(function(e){e[e.Assistant=0]=`Assistant`,e[e.User=1]=`User`,e[e.Extension=2]=`Extension`})(Ex||={});var Dx;(function(e){e.PNG=`image/png`,e.JPEG=`image/jpeg`,e.GIF=`image/gif`,e.WEBP=`image/webp`,e.BMP=`image/bmp`})(Dx||={});var Ox;(function(e){e.Low=`low`,e.High=`high`})(Ox||={});var kx;(function(e){function t(e){return(e.capabilities?.agentMode===void 0||e.capabilities.agentMode)&&!!e.capabilities?.toolCalling}e.suitableForAgentMode=t;function n(e){return`${e.name} (${e.vendor})`}e.asQualifiedName=n;function r(e,t){return t.vendor===`copilot`&&e===t.name?!0:e===n(t)}e.matchesQualifiedName=r})(kx||={});const Ax={type:`object`,required:[`vendor`,`displayName`],properties:{vendor:{type:`string`,description:b(7948,`A globally unique vendor of language model chat provider.`)},displayName:{type:`string`,description:b(7949,`The display name of the language model chat provider.`)},configuration:{type:`object`,description:b(7950,`Configuration options for the language model chat provider.`),anyOf:[{$ref:`http://json-schema.org/draft-07/schema#`},{properties:{properties:{type:`object`,additionalProperties:{$ref:`http://json-schema.org/draft-07/schema#`,properties:{secret:{type:`boolean`,description:b(7951,`Whether the property is a secret.`)}}}},additionalProperties:{$ref:`http://json-schema.org/draft-07/schema#`,properties:{secret:{type:`boolean`,description:b(7951,`Whether the property is a secret.`)}}}}}]},managementCommand:{type:`string`,description:b(7952,`A command to manage the language model chat provider, e.g. 'Manage Copilot models'. This is used in the chat model picker. If not provided, a gear icon is not rendered during vendor selection.`),deprecated:!0,deprecationMessage:b(7953,`The managementCommand property is deprecated and will be removed in a future release. Use the new configuration property instead.`)},when:{type:`string`,description:b(7954,`Condition which must be true to show this language model chat provider in the Manage Models list.`)}}},jx=gx.registerExtensionPoint({extensionPoint:`languageModelChatProviders`,jsonSchema:{description:b(7955,`Contribute language model chat providers of a specific vendor.`),oneOf:[Ax,{type:`array`,items:Ax}]},activationEventsGenerator:function*(e){for(let t of e)yield`onLanguageModelChatProvider:${t.vendor}`}}),Mx=`chatModelRecentlyUsed`,Nx=`chatModelPinned`,Px=`chatModelVisibility`,Fx=`copilot/auto`,Ix=`chat.participantNameRegistry`,Lx=`chat.modelsControl`;let Rx=class{static{wx=this}static{this.SECRET_KEY_PREFIX=`chat.lm.secret.`}static{this.SECRET_INPUT="${input:{0}}"}constructor(e,t,n,r,i,a,o,s,c){this._extensionService=e,this._logService=t,this._storageService=n,this._contextKeyService=r,this._languageModelsConfigurationService=i,this._quickInputService=a,this._secretStorageService=o,this._productService=s,this._requestService=c,this._store=new _,this._providers=new Map,this._vendors=new Map,this._onDidChangeLanguageModelVendors=this._store.add(new x),this.onDidChangeLanguageModelVendors=this._onDidChangeLanguageModelVendors.event,this._modelsGroups=new Map,this._modelCache=new Map,this._resolveLMSequencer=new Eo,this._modelConfigurations=new Map,this._onLanguageModelChange=this._store.add(new x),this.onDidChangeLanguageModels=this._onLanguageModelChange.event,this._recentlyUsedModelIds=[],this._pinnedModelIds=[],this._hiddenModelIds=new Set,this._onDidChangeModelsControlManifest=this._store.add(new x),this.onDidChangeModelsControlManifest=this._onDidChangeModelsControlManifest.event,this._onDidChangePinnedModels=this._store.add(new x),this.onDidChangePinnedModels=this._onDidChangePinnedModels.event,this._onDidChangeModelVisibility=this._store.add(new x),this.onDidChangeModelVisibility=this._onDidChangeModelVisibility.event,this._modelsControlManifest={free:{},paid:{}},this._chatControlDisposed=!1,this._restrictedChatParticipants=vv(this,Object.create(null)),this.restrictedChatParticipants=this._restrictedChatParticipants,this._hasUserSelectableModels=xx.languageModelsAreUserSelectable.bindTo(r),this._hasNonCopilotUserSelectableModels=xx.nonCopilotLanguageModelsAreUserSelectable.bindTo(r),this._recentlyUsedModelIds=this._readRecentlyUsedModels(),this._pinnedModelIds=this._readPinnedModels(),this._readVisibility(),this._initChatControlData(),this._store.add(this.onDidChangeLanguageModels(()=>{let e=!1,t=!1;for(let n of this._modelCache.values())if(n.isUserSelectable!==!1&&(e=!0,n.vendor!==`copilot`)){t=!0;break}this._hasUserSelectableModels.set(e),this._hasNonCopilotUserSelectableModels.set(t),this._refreshModelsControlManifest()})),this._store.add(this._languageModelsConfigurationService.onDidChangeLanguageModelGroups(e=>this._onDidChangeLanguageModelGroups(e))),this._store.add(jx.setHandler((e,{added:t,removed:n})=>{let r=[],i=[];for(let e of t)for(let t of vt.wrap(e.value)){if(this._vendors.has(t.vendor)){e.collector.error(b(7956,`The vendor '{0}' is already registered and cannot be registered twice`,t.vendor));continue}if(Ji(t.vendor)){e.collector.error(b(7957,`The vendor field cannot be empty.`));continue}if(t.vendor.trim()!==t.vendor){e.collector.error(b(7958,`The vendor field cannot start or end with whitespace.`));continue}r.push(t)}for(let e of n)for(let t of vt.wrap(e.value))i.push(t);this.deltaLanguageModelChatProviderDescriptors(r,i)}))}deltaLanguageModelChatProviderDescriptors(e,t){let n=[],r=[];for(let t of e){if(this._vendors.has(t.vendor)){this._logService.error(`The vendor '${t.vendor}' is already registered and cannot be registered twice`);continue}if(Ji(t.vendor)){this._logService.error(`The vendor field cannot be empty.`);continue}if(t.vendor.trim()!==t.vendor){this._logService.error(`The vendor field cannot start or end with whitespace.`);continue}let e={vendor:t.vendor,displayName:t.displayName,configuration:t.configuration,managementCommand:t.managementCommand,when:t.when,isDefault:t.vendor===`copilot`};this._vendors.set(t.vendor,e),n.push(t.vendor)}for(let e of t)this._vendors.delete(e.vendor),this._providers.delete(e.vendor),this._clearModelCache(e.vendor),this._modelsGroups.delete(e.vendor),r.push(e.vendor);for(let[e,t]of this._providers)this._vendors.has(e)||this._providers.delete(e);if((n.length>0||r.length>0)&&(this._onDidChangeLanguageModelVendors.fire([...n,...r]),r.length>0))for(let e of r)this._onLanguageModelChange.fire(e)}async _onDidChangeLanguageModelGroups(e){let t=new Set(e.map(e=>e.vendor));await Promise.all(Array.from(t).map(e=>this._resolveAllLanguageModels(e,!0)))}getVendors(){return Array.from(this._vendors.values()).filter(e=>{if(!e.when)return!0;let t=Fd.deserialize(e.when);return t?this._contextKeyService.contextMatchesRules(t):!1})}getLanguageModelIds(){return Array.from(this._modelCache.keys())}lookupLanguageModel(e){return this._modelCache.get(e)}lookupLanguageModelByQualifiedName(e){for(let[t,n]of this._modelCache.entries())if(kx.matchesQualifiedName(e,n))return{metadata:n,identifier:t}}async _resolveAllLanguageModels(e,t){let n=this._vendors.get(e);if(!n)return;let r=this._providers.get(e);if(r||=(await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${e}`),this._providers.get(e)),!r){this._logService.warn(`[LM] No provider registered for vendor ${e}`);return}return this._resolveLMSequencer.queue(e,async()=>{let i=[],a=[];try{let e=await r.provideLanguageModelChatInfo({silent:t},Bi.None);if(e.length){i.push(...e);let t=[];for(let r of e)n.isDefault&&r.metadata.isUserSelectable===!1?this._logService.trace(`[LM] Skipping model ${r.identifier} from model picker as it is not user selectable.`):t.push(r.identifier);a.push({modelIdentifiers:t})}}catch(e){a.push({modelIdentifiers:[],status:{message:ue(e),severity:Nc.Error}})}let o=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),s=new Map;for(let c of o){if(c.vendor!==e)continue;if(!n.configuration&&i.length>0){if(c.settings)for(let e of i){let t=c.settings[e.metadata.id];t&&s.set(e.identifier,{...t})}a.push({group:c,modelIdentifiers:[]});continue}let o=await this._resolveConfiguration(c,n.configuration);try{let e=await r.provideLanguageModelChatInfo({group:c.name,silent:t,configuration:o},Bi.None);if(e.length){for(let t=0;t<e.length;t++)e[t].metadata.detail||(e[t]={...e[t],metadata:{...e[t].metadata,detail:c.name}});i.push(...e),a.push({group:c,modelIdentifiers:e.map(e=>e.identifier)})}if(c.settings)for(let t of e){let e=c.settings[t.metadata.id];e&&s.set(t.identifier,{...e})}}catch(e){a.push({group:c,modelIdentifiers:[],status:{message:ue(e),severity:Nc.Error}})}}let c=this._modelsGroups.get(e)??[];this._modelsGroups.set(e,a);let l=this._clearModelCache(e),u=!1;for(let e of i){if(this._modelCache.has(e.identifier)){this._logService.warn(`[LM] Model ${e.identifier} is already registered. Skipping.`);continue}this._modelCache.set(e.identifier,e.metadata),u||=!pc(l.get(e.identifier),e.metadata),l.delete(e.identifier)}this._logService.trace(`[LM] Resolved language models for vendor ${e}`,i),u||=l.size>0,u||=this._hasGroupStructureChanged(c,a),this._clearModelConfigurations(e);for(let[e,t]of s)this._modelCache.has(e)&&this._modelConfigurations.set(e,t);u?this._onLanguageModelChange.fire(e):this._logService.trace(`[LM] No changes in language models for vendor ${e}`)})}_hasGroupStructureChanged(e,t){if(e.length!==t.length)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.group?.name!==i.group?.name||r.group?.vendor!==i.group?.vendor||r.status?.message!==i.status?.message||r.status?.severity!==i.status?.severity||r.modelIdentifiers.length!==i.modelIdentifiers.length)return!0}return!1}getLanguageModelGroups(e){return this._modelsGroups.get(e)??[]}hasResolvedVendor(e){return this._modelsGroups.has(e)}async selectLanguageModels(e){if(e.vendor)await this._resolveAllLanguageModels(e.vendor,!0);else{let e=Array.from(this._vendors.keys());await Promise.all(e.map(e=>this._resolveAllLanguageModels(e,!0)))}let t=[];for(let[n,r]of this._modelCache)(e.vendor===void 0||r.vendor===e.vendor)&&(e.family===void 0||r.family===e.family)&&(e.version===void 0||r.version===e.version)&&(e.id===void 0||r.id===e.id)&&t.push(n);return this._logService.trace(`[LM] selected language models`,e,t),t}registerLanguageModelProvider(e,t){if(this._logService.trace(`[LM] registering language model provider`,e,t),!this._vendors.has(e))throw Error(`Chat model provider uses UNKNOWN vendor ${e}.`);if(this._providers.has(e))throw Error(`Chat model provider for vendor ${e} is already registered.`);this._providers.set(e,t);let n=t.onDidChange(()=>{this._resolveAllLanguageModels(e,!0)});return g(()=>{this._logService.trace(`[LM] UNregistered language model provider`,e),this._clearModelCache(e),this._modelsGroups.delete(e),this._providers.delete(e),n.dispose()})}async sendChatRequest(e,t,n,r,i){let a=this._modelCache.get(e),o=this._providers.get(a?.vendor||``);if(!o)throw Error(`Chat provider for model ${e} is not registered.`);let s=this.getModelConfiguration(e),c=s?{...r,configuration:{...s,...r.configuration}}:r;return o.sendChatRequest(e,n,t,c,i)}_resolveModelConfigurationWithDefaults(e,t){let n=this._modelConfigurations.get(e),r=t?.configurationSchema;if(!r?.properties&&!n)return;let i={};if(r?.properties)for(let[e,t]of Object.entries(r.properties))t.default!==void 0&&(i[e]=t.default);if(!(!n&&Object.keys(i).length===0))return{...i,...n}}computeTokenLength(e,t,n){let r=this._modelCache.get(e);if(!r)throw Error(`Chat model ${e} could not be found.`);let i=this._providers.get(r.vendor);if(!i)throw Error(`Chat provider for model ${e} is not registered.`);return i.provideTokenCount(e,t,n)}getModelConfiguration(e){let t=this._modelCache.get(e);return this._resolveModelConfigurationWithDefaults(e,t)}async setModelConfiguration(e,t){let n=this._modelCache.get(e);if(!n)return;let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i;i=r.find(e=>e.vendor===n.vendor&&e.settings?.[n.id]!==void 0),i||=r.find(e=>e.vendor===n.vendor);let a={...this._modelConfigurations.get(e)??{},...t},o=n.configurationSchema;if(o?.properties)for(let[e,t]of Object.entries(a)){let n=o.properties[e];n?.default!==void 0&&n.default===t&&delete a[e]}if(i){let e=i.settings??{},t;Object.keys(a).length===0?(t={...e},delete t[n.id]):t={...e,[n.id]:a};let r={...i,settings:Object.keys(t).length>0?t:void 0};!r.settings&&Object.keys(r).filter(e=>e!==`name`&&e!==`vendor`&&e!==`range`&&e!==`modelsRange`&&e!==`settings`).length===0?await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(i):await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,r)}else if(Object.keys(a).length>0){let e=this._vendors.get(n.vendor);if(!e)return;let t={name:e.displayName,vendor:n.vendor,settings:{[n.id]:a}};await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(t)}Object.keys(a).length>0?this._modelConfigurations.set(e,a):this._modelConfigurations.delete(e),this._onLanguageModelChange.fire(n.vendor)}getModelConfigurationActions(e){let t=this._modelCache.get(e)?.configurationSchema;if(!t?.properties)return[];let n=[],r=this._modelConfigurations.get(e)??{};for(let[i,a]of Object.entries(t.properties)){if(!a.enum||!Array.isArray(a.enum)||a.enum.length<2)continue;let t=r[i]??a.default,o=(typeof a.title==`string`?a.title:void 0)??i.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/^./,e=>e.toUpperCase()),s=a.default,c=a.enumItemLabels,l=a.enumDescriptions,u=a.enum.map((n,r)=>{let a=c?.[r]??String(n),o=n===s?b(7959,`{0} (default)`,a):a,u=l?.[r]??``;return{id:`configureModel.${i}.${n}`,label:o,class:void 0,enabled:!0,tooltip:u,checked:t===n,run:()=>this.setModelConfiguration(e,{[i]:n})}});n.push(new Im(`configureModel.${i}`,o,u))}return n}async configureLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:t})=>t===e);if(!n)throw Error(`Vendor ${e} not found.`);if(n.managementCommand){await this._resolveAllLanguageModels(n.vendor,!1);return}let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=r.find(n=>n.vendor===e&&n.name===t),a=await this.promptForName(r,n,i);if(!a)return;let o=i?await this._resolveConfiguration(i,n.configuration):void 0;try{let t=n.configuration?await this.promptForConfiguration(a,n.configuration,o):void 0;if(n.configuration&&!t)return;let r=await this._resolveLanguageModelProviderGroup(a,e,t,n.configuration),s=i?await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,r):await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(r);if(n.configuration&&this.requireConfiguring(n.configuration)){let e=this.getSnippetForFirstUnconfiguredProperty(t??{},n.configuration);await this._languageModelsConfigurationService.configureLanguageModels({group:s,snippet:e})}}catch(e){if(re(e))return;throw e}}async renameLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:t})=>t===e);if(!n)throw Error(`Vendor ${e} not found.`);let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups(),i=r.find(n=>n.vendor===e&&n.name===t);if(!i)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);let a=await this.promptForName(r,n,i);!a||a===i.name||await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(i,{...i,name:a})}async updateLanguageModelsProviderGroupApiKey(e,t){let n=this.getVendors().find(({vendor:t})=>t===e),r=n?.configuration,i=r?.properties?.apiKey;if(!n||!r||!i)return;let a=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!a)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);try{let t=await this._resolveConfiguration(a,r),n=await this.promptForValue(a.name,`apiKey`,i,!!r.required?.includes(`apiKey`),t);if(n===void 0||n===t.apiKey)return;let o={...t,apiKey:n},s={...await this._resolveLanguageModelProviderGroup(a.name,e,o,r),settings:a.settings};await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(a,s),await this._deleteSecretsInConfiguration(a,r)}catch(e){if(re(e))return;throw e}}async addLanguageModelsProviderGroupModel(e,t){let n=this.getVendors().find(({vendor:t})=>t===e),r=(n?.configuration)?.properties?.models;if(!n||!r)return;let i=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!i)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);let a=Array.isArray(i.models),o=a?this.getSnippetForArrayItem(r):this.getSnippetForProperty(`models`,r);o&&await this._languageModelsConfigurationService.configureLanguageModels({group:i,snippet:o,snippetTarget:a?`models`:`group`})}async openLanguageModelsProviderGroupSettings(e,t){let n=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!n)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);await this._languageModelsConfigurationService.configureLanguageModels({group:n})}async configureModel(e){let t=this._modelCache.get(e);if(!t||!t.configurationSchema)return;let n=this._modelsGroups.get(t.vendor),r;if(n){for(let t of n)if(t.modelIdentifiers.includes(e)&&t.group){r=t.group;break}}if(!r){let e=this.getVendors().find(e=>e.vendor===t.vendor);if(!e)return;let n={name:e.displayName,vendor:t.vendor,settings:{[t.id]:{}}};r=await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(n),await this._resolveAllLanguageModels(t.vendor,!0)}let i=this._getModelConfigurationSnippet(t.id,t.configurationSchema);await this._languageModelsConfigurationService.configureLanguageModels({group:r,snippet:i})}_getModelConfigurationSnippet(e,t){let n=[];if(t.properties)for(let[e,r]of Object.entries(t.properties))if(r.defaultSnippets?.[0]){let t=r.defaultSnippets[0],i=t.bodyText??JSON.stringify(t.body,null,` `);i=i.replace(/"(\^[^"]*)"/g,(e,t)=>t.substring(1)),n.push(`\t\t\t"${e}": ${i}`)}else r.default===void 0?n.push(`\t\t\t"${e}": $\{${e}\}`):n.push(`\t\t\t"${e}": ${JSON.stringify(r.default)}`);return`"settings": {\n\t\t"${e}": ${n.length>0?`{\n${n.join(`,
|
|
86
|
+
`)}\n\t\t}`:`{
|
|
87
|
+
$0
|
|
88
|
+
}`}\n\t}`}async addLanguageModelsProviderGroup(e,t,n){let r=this.getVendors().find(({vendor:e})=>e===t);if(!r)throw Error(`Vendor ${t} not found.`);let i=await this._resolveLanguageModelProviderGroup(e,t,n,r.configuration);await this._languageModelsConfigurationService.addLanguageModelsProviderGroup(i)}async removeLanguageModelsProviderGroup(e,t){let n=this.getVendors().find(({vendor:t})=>t===e);if(!n)throw Error(`Vendor ${e} not found.`);let r=this._languageModelsConfigurationService.getLanguageModelsProviderGroups().find(n=>n.vendor===e&&n.name===t);if(!r)throw Error(`Language model provider group ${t} for vendor ${e} not found.`);await this._deleteSecretsInConfiguration(r,n.configuration),await this._languageModelsConfigurationService.removeLanguageModelsProviderGroup(r)}requireConfiguring(e){if(e.additionalProperties)return!0;if(!e.properties)return!1;for(let t of Object.keys(e.properties))if(!this.canPromptForProperty(e.properties[t]))return!0;return!1}getSnippetForFirstUnconfiguredProperty(e,t){if(t.properties){for(let n of Object.keys(t.properties))if(e[n]===void 0){let e=t.properties[n],r=this.getSnippetForProperty(n,e);if(r)return r}}}getSnippetForProperty(e,t){let n=this.getDefaultSnippetBodyText(t);return n?`"${e}": ${n}`:void 0}getSnippetForArrayItem(e){return this.getDefaultSnippetBodyText(e,!0)}getDefaultSnippetBodyText(e,t=!1){let n=e.defaultSnippets?.[0];if(!n)return;let r=t?Array.isArray(n.body)&&n.body.length>0?JSON.stringify(n.body[0],null,` `):void 0:n.bodyText??JSON.stringify(n.body,null,` `);if(r)return r.replace(/"(\^[^"]*)"/g,(e,t)=>t.substring(1))}async promptForName(e,t,n){let r=n?.name;if(!r){r=t.displayName;let n=1;for(;e.some(e=>e.vendor===t.vendor&&e.name===r);)n++,r=`${t.displayName} ${n}`}let i,a=new _;try{await new Promise(o=>{let s=a.add(this._quickInputService.createInputBox());s.title=b(7960,`Group Name`),s.placeholder=b(7961,`Enter a name for the group`),s.value=r,s.ignoreFocusOut=!0,a.add(s.onDidChangeValue(r=>{if(!r){s.validationMessage=b(7962,`Please enter a name`),s.severity=Nc.Error;return}if(e.some(e=>e!==n&&e.vendor===t.vendor&&e.name===r)){s.validationMessage=b(7963,`A language models group with this name already exists`),s.severity=Nc.Error;return}s.validationMessage=void 0,s.severity=Nc.Ignore})),a.add(s.onDidAccept(async()=>{i=s.value,s.hide()})),a.add(s.onDidHide(()=>o())),s.show()})}finally{a.dispose()}return i}async promptForConfiguration(e,t,n){if(!t.properties)return;let r=n?{...n}:{};for(let i of Object.keys(t.properties)){let a=t.properties[i],o=!!t.required?.includes(i),s=await this.promptForValue(e,i,a,o,n);s!==void 0&&(r[i]=s)}return r}async promptForValue(e,t,n,r,i){if(!n||!this.canPromptForProperty(n))return;if(n.type===`array`&&n.items&&!Array.isArray(n.items)&&n.items.enum){let r=await this.promptForArray(e,t,n);return r===void 0?void 0:r}if(n.type===`string`&&Array.isArray(n.enum)&&n.enum.length>0)return this.promptForEnum(e,t,n,i);let a=await this.promptForInput(e,t,n,r,i);if(a!==void 0)return a}canPromptForProperty(e){return!e||typeof e==`boolean`?!1:!!(e.type===`array`&&e.items&&!Array.isArray(e.items)&&e.items.enum||e.type===`string`||e.type===`number`||e.type===`integer`||e.type===`boolean`)}getDescriptionPlaintext(e){if(e.description)return e.description;let t=e.markdownDescription;if(t)return t.replace(/`([^`]+)`/g,`$1`).replace(/\*\*([^*]+)\*\*/g,`$1`).replace(/\*([^*]+)\*/g,`$1`).replace(/\[([^\]]+)\]\([^)]+\)/g,`$1`)}async promptForArray(e,t,n){if(!n.items||Array.isArray(n.items)||!n.items.enum)return;let r=n.items.enum,i=new _;try{return await new Promise(a=>{let o=i.add(this._quickInputService.createQuickPick());o.title=`${e}: ${n.title??t}`,o.items=r.map(e=>({label:e})),o.placeholder=this.getDescriptionPlaintext(n)??b(7964,`Select value for {0}`,t),o.canSelectMany=!0,o.ignoreFocusOut=!0,i.add(o.onDidAccept(()=>{a(o.selectedItems.map(e=>e.label)),o.hide()})),i.add(o.onDidHide(()=>{a(void 0)})),o.show()})}finally{i.dispose()}}async promptForEnum(e,t,n,r){let i=n.enum;if(!Array.isArray(i)||i.length===0)return;let a=n.enumDescriptions,o=Array.isArray(n.enumItemLabels)?n.enumItemLabels:void 0,s=r?.[t]===void 0?n.default===void 0?void 0:String(n.default):String(r[t]),c=i.map((e,t)=>({label:o?.[t]??String(e),description:a?.[t],id:String(e)})),l=new _;try{return await new Promise(r=>{let i=l.add(this._quickInputService.createQuickPick());if(i.title=`${e}: ${n.title??t}`,i.items=c,i.placeholder=this.getDescriptionPlaintext(n)??b(7964,`Select value for {0}`,t),i.ignoreFocusOut=!0,s!==void 0){let e=c.find(e=>e.id===s);e&&(i.activeItems=[e])}l.add(i.onDidAccept(()=>{let e=i.selectedItems[0];r(e?.id),i.hide()})),l.add(i.onDidHide(()=>{r(void 0)})),i.show()})}finally{l.dispose()}}async promptForInput(e,t,n,r,i){let a=new _;try{let o=e=>{if(!e&&r)return b(7965,`Value is required`)},s=await new Promise((r,s)=>{let c=a.add(this._quickInputService.createInputBox());c.title=`${e}: ${n.title??t}`,c.placeholder=b(7966,`Enter value for {0}`,t),c.password=!!n.secret,c.ignoreFocusOut=!0,i?.[t]?c.value=String(i?.[t]):n.default&&(c.value=String(n.default));let l=this.getDescriptionPlaintext(n);l&&(c.prompt=l),a.add(c.onDidChangeValue(e=>{let t=o(e);t?(c.validationMessage=t,c.severity=Nc.Error):(c.validationMessage=void 0,c.severity=Nc.Ignore)})),a.add(c.onDidAccept(()=>{let e=o(c.value);if(e){c.validationMessage=e,c.severity=Nc.Error;return}r(c.value),c.hide()})),a.add(c.onDidHide(e=>{e.reason===Vb.Gesture?s(new ie):r(void 0)})),c.show()});return s?n.type===`number`||n.type===`integer`?Number(s):n.type===`boolean`?s===`true`:s:void 0}finally{a.dispose()}}encodeSecretKey(e){return Xi(wx.SECRET_INPUT,e)}decodeSecretKey(e){if(et(e))return e.substring(e.indexOf(`:`)+1,e.length-1)}_clearModelCache(e){let t=new Map;for(let[n,r]of this._modelCache.entries())r.vendor===e&&(t.set(n,r),this._modelCache.delete(n));return t}_clearModelConfigurations(e){for(let[t]of this._modelConfigurations)(this._modelCache.get(t)?.vendor===e||t.startsWith(`${e}/`))&&this._modelConfigurations.delete(t)}async _resolveConfiguration(e,t){if(!t)return{};let n={};for(let r in e){if(r===`vendor`||r===`name`||r===`range`||r===`modelsRange`||r===`settings`)continue;let i=e[r];if(t.properties?.[r]?.secret){let e=this.decodeSecretKey(i);i=e?await this._secretStorageService.get(e):void 0}n[r]=i}return n}async _resolveLanguageModelProviderGroup(e,t,n,r){if(!r)return{name:e,vendor:t};let i={};for(let e in n){let t=n[e];if(r.properties?.[e]?.secret&&et(t)){let e=`${wx.SECRET_KEY_PREFIX}${jh(Gc()).toString(16)}`;await this._secretStorageService.set(e,t),t=this.encodeSecretKey(e)}i[e]=t}return{name:e,vendor:t,...i}}async _deleteSecretsInConfiguration(e,t){if(!t)return;let{vendor:n,name:r,range:i,modelsRange:a,...o}=e;for(let n in o){let r=e[n];if(t.properties?.[n]?.secret){let e=this.decodeSecretKey(r);e&&await this._secretStorageService.delete(e)}}}async migrateLanguageModelsProviderGroup(e){let{vendor:t,name:n,...r}=e;if(!this._vendors.get(t))throw Error(`Vendor ${t} not found.`);await this._extensionService.activateByEvent(`onLanguageModelChatProvider:${t}`);let i=this._providers.get(t);if(!i)throw Error(`Chat model provider for vendor ${t} is not registered.`);await i.provideLanguageModelChatInfo({group:n,silent:!1,configuration:r},Bi.None),await this.addLanguageModelsProviderGroup(n,t,r)}_readRecentlyUsedModels(){return this._storageService.getObject(Mx,r_.PROFILE,[])}_saveRecentlyUsedModels(){this._storageService.store(Mx,this._recentlyUsedModelIds,r_.PROFILE,i_.USER)}getRecentlyUsedModelIds(){return this._recentlyUsedModelIds.filter(e=>this._modelCache.has(e)&&e!==Fx).slice(0,4)}addToRecentlyUsedList(e){if(e===Fx)return;let t=this._recentlyUsedModelIds.indexOf(e);t!==-1&&this._recentlyUsedModelIds.splice(t,1),this._recentlyUsedModelIds.unshift(e),this._recentlyUsedModelIds.length>20&&(this._recentlyUsedModelIds.length=20),this._saveRecentlyUsedModels()}clearRecentlyUsedList(){this._recentlyUsedModelIds=[],this._saveRecentlyUsedModels()}_readPinnedModels(){return this._storageService.getObject(Nx,r_.PROFILE,[])}_savePinnedModels(){this._storageService.store(Nx,this._pinnedModelIds,r_.PROFILE,i_.USER)}getPinnedModelIds(){return this._pinnedModelIds.filter(e=>e!==Fx&&this._modelCache.has(e))}pinModel(e){e===Fx||this._pinnedModelIds.includes(e)||(this._pinnedModelIds.push(e),this._savePinnedModels(),this._onDidChangePinnedModels.fire())}unpinModel(e){let t=this._pinnedModelIds.indexOf(e);t!==-1&&(this._pinnedModelIds.splice(t,1),this._savePinnedModels(),this._onDidChangePinnedModels.fire())}isModelPinned(e){return e!==Fx&&this._pinnedModelIds.includes(e)}_getGroupNameForVendor(e){return this._vendors.get(e)?.displayName??e}_getModelIdsInGroup(e,t){let n=this._modelsGroups.get(e);if(!n)return[];let r=[],i=this._getGroupNameForVendor(e);for(let e of n)(e.group?.name??i)===t&&r.push(...e.modelIdentifiers);return r}_readVisibility(){let e=this._storageService.getObject(Px,r_.PROFILE,{});this._hiddenModelIds=new Set(Array.isArray(e?.hiddenModels)?e.hiddenModels:[])}_saveVisibility(){this._storageService.store(Px,{hiddenModels:Array.from(this._hiddenModelIds)},r_.PROFILE,i_.USER)}isGroupHidden(e,t){let n=this._getModelIdsInGroup(e,t);return n.length>0&&n.every(e=>this._hiddenModelIds.has(e))}isModelHidden(e){return this._hiddenModelIds.has(e)}setGroupHidden(e,t,n){let r=!1,i=this._getModelIdsInGroup(e,t);for(let e of i)n?this._hiddenModelIds.has(e)||(this._hiddenModelIds.add(e),r=!0):this._hiddenModelIds.delete(e)&&(r=!0);r&&(this._saveVisibility(),this._onDidChangeModelVisibility.fire())}setModelHidden(e,t){let n=!1;t?this._hiddenModelIds.has(e)||(this._hiddenModelIds.add(e),n=!0):this._hiddenModelIds.delete(e)&&(n=!0),n&&(this._saveVisibility(),this._onDidChangeModelVisibility.fire())}getHiddenModelIds(){return Array.from(this._hiddenModelIds)}getModelsControlManifest(){return this._modelsControlManifest}_setModelsControlManifest(e){this._modelsControlRawResponse=e,this._refreshModelsControlManifest()}_refreshModelsControlManifest(){let e=this._modelsControlRawResponse,t={},n={};if(e?.free){let n=Array.isArray(e.free)?e.free:Object.values(e.free);for(let e of n)!e||!rt(e)||(t[e.id]={label:e.label,featured:e.featured,exists:this._modelCache.has(`copilot/${e.id}`)})}if(e?.paid){let t=Array.isArray(e.paid)?e.paid:Object.values(e.paid);for(let e of t)!e||!rt(e)||(n[e.id]={label:e.label,featured:e.featured,minVSCodeVersion:e.minVSCodeVersion,exists:this._modelCache.has(`copilot/${e.id}`)})}this._modelsControlManifest={free:t,paid:n},this._onDidChangeModelsControlManifest.fire(this._modelsControlManifest)}_initChatControlData(){if(this._chatControlUrl=this._productService.chatParticipantRegistry,!this._chatControlUrl)return;let e=this._storageService.get(Ix,r_.APPLICATION);try{this._restrictedChatParticipants.set(JSON.parse(e??`{}`),void 0)}catch{this._storageService.remove(Ix,r_.APPLICATION)}let t=this._storageService.get(Lx,r_.APPLICATION);try{let e=JSON.parse(t??`{}`);rt(e)&&this._setModelsControlManifest(e)}catch{this._storageService.remove(Lx,r_.APPLICATION)}this._refreshChatControlData()}_refreshChatControlData(){this._chatControlDisposed||this._fetchChatControlData().catch(e=>this._logService.warn(`Failed to fetch chat control data`,e)).then(()=>Mo(300*1e3)).then(()=>this._refreshChatControlData())}async _fetchChatControlData(){this._logService.trace(`[LM] Fetching chat control data from`,this._chatControlUrl);let e;try{e=await this._requestService.request({type:`GET`,url:this._chatControlUrl,callSite:`languageModels.fetchChatControlData`},Bi.None)}catch(e){this._logService.warn(`[LM] Failed to request chat control data`,ue(e));return}if(e.res.statusCode!==200){this._logService.warn(`[LM] Chat control data request failed with status ${e.res.statusCode}`);return}let t;try{t=await Ig(e)}catch(e){this._logService.warn(`[LM] Failed to parse chat control response`,ue(e));return}if(this._logService.trace(`[LM] Received chat control response`,t?Object.keys(t):`null`),!t||t.version!==1){this._logService.warn(`[LM] Unexpected chat control response version`,t?.version);return}let n=t.restrictedChatParticipants;this._restrictedChatParticipants.set(n,void 0),this._storageService.store(Ix,JSON.stringify(n),r_.APPLICATION,i_.MACHINE),t.models&&(this._logService.trace(`[LM] Updating models control manifest`,{freeCount:Object.keys(t.models.free??{}).length,paidCount:Object.keys(t.models.paid??{}).length}),this._setModelsControlManifest(t.models),this._storageService.store(Lx,JSON.stringify(t.models),r_.APPLICATION,i_.MACHINE))}dispose(){this._chatControlDisposed=!0,this._store.dispose(),this._providers.clear()}};Rx=wx=k([A(0,Jb),A(1,Ns),A(2,c_),A(3,kh),A(4,Cx),A(5,Kb),A(6,qb),A(7,Xh),A(8,Vg)],Rx),new F(`debugType`,void 0,{type:`string`,description:b(9374,`Debug type of the active debug session. For example 'python'.`)}),new F(`debugConfigurationType`,void 0,{type:`string`,description:b(9375,`Debug type of the selected launch configuration. For example 'python'.`)}),new F(`debugState`,`inactive`,{type:`string`,description:b(9376,`State that the focused debug session is in. One of the following: 'inactive', 'initializing', 'stopped' or 'running'.`)}),new F(`debugUx`,`default`,{type:`string`,description:b(9377,`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 F(`hasDebugged`,!1,{type:`boolean`,description:b(9378,`True when a debug session has been started at least once, false otherwise.`)}),new F(`inDebugMode`,!1,{type:`boolean`,description:b(9379,`True when debugging, false otherwise.`)}),new F(`inDebugRepl`,!1,{type:`boolean`,description:b(9380,`True when focus is in the debug console, false otherwise.`)}),new F(`breakpointWidgetVisible`,!1,{type:`boolean`,description:b(9381,`True when breakpoint editor zone widget is visible, false otherwise.`)}),new F(`inBreakpointWidget`,!1,{type:`boolean`,description:b(9382,`True when focus is in the breakpoint editor zone widget, false otherwise.`)}),new F(`breakpointsFocused`,!0,{type:`boolean`,description:b(9383,`True when the BREAKPOINTS view is focused, false otherwise.`)}),new F(`watchExpressionsFocused`,!0,{type:`boolean`,description:b(9384,`True when the WATCH view is focused, false otherwise.`)}),new F(`watchExpressionsExist`,!1,{type:`boolean`,description:b(9385,`True when at least one watch expression exists, false otherwise.`)}),new F(`variablesFocused`,!0,{type:`boolean`,description:b(9386,`True when the VARIABLES views is focused, false otherwise`)}),new F(`expressionSelected`,!1,{type:`boolean`,description:b(9387,`True when an expression input box is open in either the WATCH or the VARIABLES view, false otherwise.`)}),new F(`breakpointInputFocused`,!1,{type:`boolean`,description:b(9388,`True when the input box has focus in the BREAKPOINTS view.`)}),new F(`callStackItemType`,void 0,{type:`string`,description:b(9389,`Represents the item type of the focused element in the CALL STACK view. For example: 'session', 'thread', 'stackFrame'`)}),new F(`callStackSessionIsAttach`,!1,{type:`boolean`,description:b(9390,`True when the session in the CALL STACK view is attach, false otherwise. Used internally for inline menus in the CALL STACK view.`)}),new F(`callStackItemStopped`,!1,{type:`boolean`,description:b(9391,`True when the focused item in the CALL STACK is stopped. Used internally for inline menus in the CALL STACK view.`)}),new F(`callStackSessionHasOneThread`,!1,{type:`boolean`,description:b(9392,`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 F(`callStackFocused`,!0,{type:`boolean`,description:b(9393,`True when the CALLSTACK view is focused, false otherwise.`)}),new F(`watchItemType`,void 0,{type:`string`,description:b(9394,`Represents the item type of the focused element in the WATCH view. For example: 'expression', 'variable'`)}),new F(`canViewMemory`,void 0,{type:`boolean`,description:b(9395,`Indicates whether the item in the view has an associated memory reference.`)}),new F(`breakpointItemType`,void 0,{type:`string`,description:b(9396,`Represents the item type of the focused element in the BREAKPOINTS view. For example: 'breakpoint', 'exceptionBreakpoint', 'functionBreakpoint', 'dataBreakpoint'`)}),new F(`breakpointItemBytes`,void 0,{type:`boolean`,description:b(9397,`Whether the breakpoint item is a data breakpoint on a byte range.`)}),new F(`breakpointHasModes`,!1,{type:`boolean`,description:b(9398,`Whether the breakpoint has multiple modes it can switch to.`)}),new F(`breakpointSupportsCondition`,!1,{type:`boolean`,description:b(9399,`True when the focused breakpoint supports conditions.`)}),new F(`loadedScriptsSupported`,!1,{type:`boolean`,description:b(9400,`True when the focused sessions supports the LOADED SCRIPTS view`)}),new F(`loadedScriptsItemType`,void 0,{type:`string`,description:b(9401,`Represents the item type of the focused element in the LOADED SCRIPTS view.`)}),new F(`focusedSessionIsAttach`,!1,{type:`boolean`,description:b(9402,`True when the focused session is 'attach'.`)}),new F(`focusedSessionIsNoDebug`,!1,{type:`boolean`,description:b(9403,`True when the focused session is run without debugging.`)}),new F(`stepBackSupported`,!1,{type:`boolean`,description:b(9404,`True when the focused session supports 'stepBack' requests.`)}),new F(`restartFrameSupported`,!1,{type:`boolean`,description:b(9405,`True when the focused session supports 'restartFrame' requests.`)}),new F(`stackFrameSupportsRestart`,!1,{type:`boolean`,description:b(9406,`True when the focused stack frame supports 'restartFrame'.`)}),new F(`jumpToCursorSupported`,!1,{type:`boolean`,description:b(9407,`True when the focused session supports 'jumpToCursor' request.`)}),new F(`stepIntoTargetsSupported`,!1,{type:`boolean`,description:b(9408,`True when the focused session supports 'stepIntoTargets' request.`)}),new F(`breakpointsExist`,!1,{type:`boolean`,description:b(9409,`True when at least one breakpoint exists.`)}),new F(`debuggersAvailable`,!1,{type:`boolean`,description:b(9410,`True when there is at least one debug extensions active.`)}),new F(`debugExtensionAvailable`,!0,{type:`boolean`,description:b(9411,`True when there is at least one debug extension installed and enabled.`)}),new F(`debugProtocolVariableMenuContext`,void 0,{type:`string`,description:b(9412,`Represents the context the debug adapter sets on the focused variable in the VARIABLES view.`)}),new F(`debugSetVariableSupported`,!1,{type:`boolean`,description:b(9413,`True when the focused session supports 'setVariable' request.`)}),new F(`debugSetDataBreakpointAddressSupported`,!1,{type:`boolean`,description:b(9414,`True when the focused session supports 'getBreakpointInfo' request on an address.`)}),new F(`debugSetExpressionSupported`,!1,{type:`boolean`,description:b(9415,`True when the focused session supports 'setExpression' request.`)}),new F(`breakWhenValueChangesSupported`,!1,{type:`boolean`,description:b(9416,`True when the focused session supports to break when value changes.`)}),new F(`breakWhenValueIsAccessedSupported`,!1,{type:`boolean`,description:b(9417,`True when the focused breakpoint supports to break when value is accessed.`)}),new F(`breakWhenValueIsReadSupported`,!1,{type:`boolean`,description:b(9418,`True when the focused breakpoint supports to break when value is read.`)}),new F(`terminateDebuggeeSupported`,!1,{type:`boolean`,description:b(9419,`True when the focused session supports the terminate debuggee capability.`)}),new F(`suspendDebuggeeSupported`,!1,{type:`boolean`,description:b(9420,`True when the focused session supports the suspend debuggee capability.`)}),new F(`terminateThreadsSupported`,!1,{type:`boolean`,description:b(9421,`True when the focused session supports the terminate threads capability.`)}),new F(`variableEvaluateNamePresent`,!1,{type:`boolean`,description:b(9422,`True when the focused variable has an 'evaluateName' field set.`)}),new F(`variableIsReadonly`,!1,{type:`boolean`,description:b(9423,`True when the focused variable is read-only.`)}),new F(`variableValue`,!1,{type:`string`,description:b(9424,`Value of the variable, present for debug visualization clauses.`)}),new F(`variableType`,!1,{type:`string`,description:b(9425,`Type of the variable, present for debug visualization clauses.`)}),new F(`variableInterfaces`,!1,{type:`array`,description:b(9426,`Any interfaces or contracts that the variable satisfies, present for debug visualization clauses.`)}),new F(`variableName`,!1,{type:`string`,description:b(9427,`Name of the variable, present for debug visualization clauses.`)}),new F(`variableLanguage`,!1,{type:`string`,description:b(9428,`Language of the variable source, present for debug visualization clauses.`)}),new F(`variableExtensionId`,!1,{type:`string`,description:b(9429,`Extension ID of the variable source, present for debug visualization clauses.`)}),new F(`exceptionWidgetVisible`,!1,{type:`boolean`,description:b(9430,`True when the exception widget is visible.`)}),new F(`multiSessionRepl`,!1,{type:`boolean`,description:b(9431,`True when there is more than 1 debug console.`)}),new F(`multiSessionDebug`,!1,{type:`boolean`,description:b(9432,`True when there is more than 1 active debug session.`)}),new F(`disassembleRequestSupported`,!1,{type:`boolean`,description:b(9433,`True when the focused sessions supports disassemble request.`)}),new F(`disassemblyViewFocus`,!1,{type:`boolean`,description:b(9434,`True when the Disassembly View is focused.`)}),new F(`languageSupportsDisassembleRequest`,!1,{type:`boolean`,description:b(9435,`True when the language in the current editor supports disassemble request.`)}),new F(`focusedStackFrameHasInstructionReference`,!1,{type:`boolean`,description:b(9436,`True when the focused stack frame has instruction pointer reference.`)}),b(9438,`Controls when the internal Debug Console should open.`);var zx;(function(e){e[e.Inactive=0]=`Inactive`,e[e.Initializing=1]=`Initializing`,e[e.Stopped=2]=`Stopped`,e[e.Running=3]=`Running`})(zx||={});var Bx;(function(e){e[e.Valid=0]=`Valid`,e[e.Unreadable=1]=`Unreadable`,e[e.Error=2]=`Error`})(Bx||={});var Vx;(function(e){e[e.Variable=0]=`Variable`,e[e.Address=1]=`Address`})(Vx||={});var Hx;(function(e){e[e.Initial=1]=`Initial`,e[e.Dynamic=2]=`Dynamic`})(Hx||={});var Ux;(function(e){e.UnverifiedBreakpoints=`unverifiedBreakpoints`})(Ux||={});var Wx;(function(e){e[e.CONDITION=0]=`CONDITION`,e[e.HIT_COUNT=1]=`HIT_COUNT`,e[e.LOG_MESSAGE=2]=`LOG_MESSAGE`,e[e.TRIGGER_POINT=3]=`TRIGGER_POINT`})(Wx||={});var Gx;(function(e){e[e.Command=0]=`Command`,e[e.Tree=1]=`Tree`})(Gx||={});var Kx;(function(e){e[e.None=0]=`None`,e[e.Collapsed=1]=`Collapsed`,e[e.Expanded=2]=`Expanded`})(Kx||={});var qx;(function(e){e.deserialize=e=>e,e.serialize=e=>e})(qx||={});var Jx;(function(e){e.deserialize=e=>({id:e.id,name:e.name,iconPath:e.iconPath&&{light:C.revive(e.iconPath.light),dark:C.revive(e.iconPath.dark)},iconClass:e.iconClass,visualization:e.visualization}),e.serialize=e=>e})(Jx||={});var Yx;(function(e){e.McpServersQueryService=`McpServersQueryService`,e.McpServerWebUri=`McpServerWebUriTemplate`,e.McpServerVersionUri=`McpServerVersionUriTemplate`,e.McpServerIdUri=`McpServerIdUriTemplate`,e.McpServerLatestVersionUri=`McpServerLatestVersionUriTemplate`,e.McpServerNamedResourceUri=`McpServerNamedResourceUriTemplate`,e.PublisherUriTemplate=`PublisherUriTemplate`,e.ContactSupportUri=`ContactSupportUri`,e.PrivacyPolicyUri=`PrivacyPolicyUri`,e.TermsOfServiceUri=`TermsOfServiceUri`,e.ReportUri=`ReportUri`})(Yx||={});var Xx;(function(e){e.Available=`available`,e.Unavailable=`unavailable`})(Xx||={});var Zx;(function(e){e.LATEST_PROTOCOL_VERSION=`2025-11-25`,e.JSONRPC_VERSION=`2.0`,e.PARSE_ERROR=-32700,e.INVALID_REQUEST=-32600,e.METHOD_NOT_FOUND=-32601,e.INVALID_PARAMS=-32602,e.INTERNAL_ERROR=-32603,e.URL_ELICITATION_REQUIRED=-32042})(Zx||={}),O(`IMcpService`);const Qx=O(`IMcpWorkbenchService`);O(`IMcpServerSampling`),O(`IMcpElicitationService`);function $x(e,t){return Ts.toKey(e)+`/`+t}var eS;(function(e){e[e.WorkspaceFolder=0]=`WorkspaceFolder`,e[e.Workspace=100]=`Workspace`,e[e.User=200]=`User`,e[e.Extension=300]=`Extension`,e[e.Plugin=350]=`Plugin`,e[e.Filesystem=400]=`Filesystem`,e[e.RemoteBoost=-50]=`RemoteBoost`})(eS||={});var tS;(function(e){function t(e,t){return e.id===t.id&&e.remoteAuthority===t.remoteAuthority&&e.label===t.label&&e.trustBehavior===t.trustBehavior&&pc(e.sandbox,t.sandbox)}e.equals=t})(tS||={});var nS;(function(e){e[e.Initial=0]=`Initial`,e[e.Dynamic=1]=`Dynamic`})(nS||={});var rS;(function(e){function t(e){return e}e.toSerialized=t;function n(e){return{id:e.id,label:e.label,cacheNonce:e.cacheNonce,staticMetadata:e.staticMetadata,launch:dS.fromSerialized(e.launch),sandboxEnabled:e.sandboxEnabled,variableReplacement:e.variableReplacement?iS.fromSerialized(e.variableReplacement):void 0}}e.fromSerialized=n;function r(e,t){return e.id===t.id&&e.label===t.label&&e.cacheNonce===t.cacheNonce&&ge(e.roots,t.roots,(e,t)=>e.toString()===t.toString())&&pc(e.launch,t.launch)&&pc(e.presentation,t.presentation)&&pc(e.variableReplacement,t.variableReplacement)&&pc(e.devMode,t.devMode)&&e.sandboxEnabled===t.sandboxEnabled}e.equals=r})(rS||={});var iS;(function(e){function t(e){return e}e.toSerialized=t;function n(e){return{section:e.section,folder:e.folder?{...e.folder,uri:C.revive(e.folder.uri)}:void 0,target:e.target}}e.fromSerialized=n})(iS||={});var aS;(function(e){e.Empty={working:!1,starting:[],serversRequiringInteraction:[]}})(aS||={});var oS;(function(e){e[e.HasUnknown=0]=`HasUnknown`,e[e.LoadingUnknown=1]=`LoadingUnknown`,e[e.AllKnown=2]=`AllKnown`})(oS||={});var sS;(function(e){(function(e){e[e.Trusted=0]=`Trusted`,e[e.TrustedOnNonce=1]=`TrustedOnNonce`,e[e.Untrusted=2]=`Untrusted`,e[e.Unknown=3]=`Unknown`})(e.Kind||={})})(sS||={});var cS;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Cached=1]=`Cached`,e[e.Outdated=2]=`Outdated`,e[e.RefreshingFromUnknown=3]=`RefreshingFromUnknown`,e[e.RefreshingFromCached=4]=`RefreshingFromCached`,e[e.Live=5]=`Live`})(cS||={});var lS;(function(e){e[e.Model=1]=`Model`,e[e.App=2]=`App`})(lS||={});var uS;(function(e){e[e.Stdio=1]=`Stdio`,e[e.HTTP=2]=`HTTP`})(uS||={});var dS;(function(e){function t(e){return e}e.toSerialized=t;function n(e){switch(e.type){case uS.HTTP:return{type:e.type,uri:C.revive(e.uri),headers:e.headers,oauth:e.oauth,authentication:e.authentication};case uS.Stdio:return{type:e.type,cwd:e.cwd,command:e.command,args:e.args,env:e.env,envFile:e.envFile,sandbox:e.sandbox}}}e.fromSerialized=n;async function r(e){let t=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(JSON.stringify(e)));return Qt(y.wrap(new Uint8Array(t)))}e.hash=r})(dS||={});var fS;(function(e){let t;(function(e){e[e.Stopped=0]=`Stopped`,e[e.Starting=1]=`Starting`,e[e.Running=2]=`Running`,e[e.Error=3]=`Error`})(t=e.Kind||={}),e.toString=e=>{switch(e.state){case t.Stopped:return b(11555,`Stopped`);case t.Starting:return b(11556,`Starting`);case t.Running:return b(11557,`Running`);case t.Error:return b(11558,`Error {0}`,e.message);default:Ze()}},e.toKindString=e=>{switch(e){case t.Stopped:return`stopped`;case t.Starting:return`starting`;case t.Running:return`running`;case t.Error:return`error`;default:Ze()}},e.canBeStarted=e=>e===t.Error||e===t.Stopped,e.isRunning=t=>!e.canBeStarted(t.state)})(fS||={});var pS=class e extends Error{static{this.prefix=`User interaction required: `}static is(e){return e.message.startsWith(this.prefix)}constructor(t){super(`${e.prefix}${t}`),this.reason=t}},mS;(function(e){e[e.Disabled=0]=`Disabled`,e[e.DisabledByAccess=1]=`DisabledByAccess`,e[e.DisabledProfile=2]=`DisabledProfile`,e[e.DisabledWorkspace=3]=`DisabledWorkspace`,e[e.Enabled=4]=`Enabled`})(mS||={});var hS;(function(e){e[e.Installing=0]=`Installing`,e[e.Installed=1]=`Installed`,e[e.Uninstalling=2]=`Uninstalling`,e[e.Uninstalled=3]=`Uninstalled`})(hS||={});var gS;(function(e){e.Readme=`readme`,e.Manifest=`manifest`,e.Configuration=`configuration`})(gS||={});let _S=class extends v{constructor(e,t){super(),this.containers=e,this._register(t.onChange(this.update,this))}set mcpServer(e){this.containers.forEach(t=>t.mcpServer=e)}update(e){for(let t of this.containers)e&&t.mcpServer?e.id===t.mcpServer.id&&(t.mcpServer=e):t.update()}};_S=k([A(1,Qx)],_S),new F(`mcpServersGalleryStatus`,Xx.Unavailable),new F(`hasInstalledMcpServers`,!0);var vS;(function(e){e.scheme=`mcp-resource`;let t=`dylo78gyp`;function n(n,r){return typeof r==`string`&&(r=C.parse(r)),r.with({scheme:e.scheme,authority:Qt(y.fromString(n.id)),path:[``,r.scheme,r.authority||t].join(`/`)+r.path})}e.fromServer=n;function r(n){if(typeof n==`string`&&(n=C.parse(n)),n.scheme!==e.scheme)throw Error(`Invalid MCP resource URI: ${n.toString()}`);let r=n.path.split(`/`);if(r.length<3)throw Error(`Invalid MCP resource URI: ${n.toString()}`);let[,i,a,...o]=r,s=new URL(`${i}://${a.toLowerCase()===t?``:a}`);return s.pathname=o.length?`/`+o.join(`/`):``,s.search=n.query,s.hash=n.fragment,{definitionId:$t(n.authority).toString(),resourceURL:s}}e.toServer=r})(vS||={});var yS;(function(e){e[e.Logging=1]=`Logging`,e[e.Completions=2]=`Completions`,e[e.Prompts=4]=`Prompts`,e[e.PromptsListChanged=8]=`PromptsListChanged`,e[e.Resources=16]=`Resources`,e[e.ResourcesSubscribe=32]=`ResourcesSubscribe`,e[e.ResourcesListChanged=64]=`ResourcesListChanged`,e[e.Tools=128]=`Tools`,e[e.ToolsListChanged=256]=`ToolsListChanged`})(yS||={});var bS;(function(e){e.Prefix=`mcp_`,e[e.MaxPrefixLen=18]=`MaxPrefixLen`,e[e.MaxLength=64]=`MaxLength`})(bS||={});var xS;(function(e){e[e.Form=0]=`Form`,e[e.URL=1]=`URL`})(xS||={});const SS=`[/\\\\]`,CS=`[^/\\\\]`,wS=/\//g;function TS(e,t){switch(e){case 0:return``;case 1:return`${CS}*?`;default:return`(?:${SS}|${CS}+${SS}${t?`|${SS}${CS}+`:``})*?`}}function ES(e,t){if(!e)return[];let n=[],r=!1,i=!1,a=``;for(let o of e){switch(o){case t:if(!r&&!i){n.push(a),a=``;continue}break;case`{`:r=!0;break;case`}`:r=!1;break;case`[`:i=!0;break;case`]`:i=!1;break}a+=o}return a&&n.push(a),n}function DS(e){if(!e)return``;let t=``,n=ES(e,`/`);if(n.every(e=>e===`**`))t=`.*`;else{let e=!1;n.forEach((r,i)=>{if(r===`**`){if(e)return;t+=TS(2,i===n.length-1)}else{let e=!1,a=``,o=!1,s=``;for(let n of r){if(n!==`}`&&e){a+=n;continue}if(o&&(n!==`]`||!s)){let e;e=n===`-`?n:(n===`^`||n===`!`)&&!s?`^`:n===`/`?``:$i(n),s+=e;continue}switch(n){case`{`:e=!0;continue;case`[`:o=!0;continue;case`}`:{let n=`(?:${ES(a,`,`).map(e=>DS(e)).join(`|`)})`;t+=n,e=!1,a=``;break}case`]`:t+=`[`+s+`]`,o=!1,s=``;break;case`?`:t+=CS;continue;case`*`:t+=TS(1);continue;default:t+=$i(n)}}i<n.length-1&&(n[i+1]!==`**`||i+2<n.length)&&(t+=SS)}e=r===`**`})}return t}const OS=/^\*\*\/\*\.[\w\.-]+$/,kS=/^\*\*\/([\w\.-]+)\/?$/,AS=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,jS=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,MS=/^\*\*((\/[\w\.-]+)+)\/?$/,NS=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,PS=new qe(1e4),FS=function(){return!1},IS=function(){return null};function LS(e,t){if(!e)return IS;let n;n=typeof e==`string`?e:e.pattern,n=n.trim();let r=t.ignoreCase??!1,i={...t,equals:r?pa:(e,t)=>e===t,endsWith:r?ga:(e,t)=>e.endsWith(t),isEqualOrParent:(e,n)=>Ka(e,n,t.ignoreCase??!Dn)},a=`${r?n.toLowerCase():n}_${!!t.trimForExclusions}_${r}`,o=PS.get(a);if(o)return RS(o,e,i);let s;return o=OS.test(n)?BS(n.substring(4),n,i):(s=kS.exec(zS(n,i)))?VS(s[1],n,i):(t.trimForExclusions?jS:AS).test(n)?HS(n,i):(s=MS.exec(zS(n,i)))?US(s[1].substring(1),n,!0,i):(s=NS.exec(zS(n,i)))?US(s[1],n,!1,i):WS(n,i),PS.set(a,o),RS(o,e,i)}function RS(e,t,n){if(typeof t==`string`)return e;let r=function(r,i){return n.isEqualOrParent(r,t.base)?e(ta(r.substring(t.base.length),ei),i):null};return r.allBasenames=e.allBasenames,r.allPaths=e.allPaths,r.basenames=e.basenames,r.patterns=e.patterns,r}function zS(e,t){return t.trimForExclusions&&e.endsWith(`/**`)?e.substring(0,e.length-2):e}function BS(e,t,n){return function(r,i){return typeof r==`string`&&n.endsWith(r,e)?t:null}}function VS(e,t,n){let r=`/${e}`,i=`\\${e}`,a=function(a,o){return typeof a==`string`?o?n.equals(o,e)?t:null:n.equals(a,e)||n.endsWith(a,r)||n.endsWith(a,i)?t:null:null},o=[e];return a.basenames=o,a.patterns=[t],a.allBasenames=o,a}function HS(e,t){let n=XS(e.slice(1,-1).split(`,`).map(e=>LS(e,t)).filter(e=>e!==IS),e),r=n.length;if(!r)return IS;if(r===1)return n[0];let i=function(t,r){for(let i=0,a=n.length;i<a;i++)if(n[i](t,r))return e;return null},a=n.find(e=>!!e.allBasenames);a&&(i.allBasenames=a.allBasenames);let o=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(i.allPaths=o),i}function US(e,t,n,r){let i=ei===Gr.sep,a=i?e:e.replace(wS,ei),o=ei+a,s=Gr.sep+e,c;return c=n?function(n,c){return typeof n==`string`&&(r.equals(n,a)||r.endsWith(n,o)||!i&&(r.equals(n,e)||r.endsWith(n,s)))?t:null}:function(n,o){return typeof n==`string`&&(r.equals(n,a)||!i&&r.equals(n,e))?t:null},c.allPaths=[(n?`*/`:`./`)+e],c}function WS(e,t){try{let n=RegExp(`^${DS(e)}$`,t.ignoreCase?`i`:void 0);return function(t){return n.lastIndex=0,typeof t==`string`&&n.test(t)?e:null}}catch{return IS}}function GS(e,t,n){return!e||typeof t!=`string`?!1:KS(e,n)(t)}function KS(e,t={}){if(!e)return FS;if(typeof e==`string`||qS(e)){let n=LS(e,t);if(n===IS)return FS;let r=function(e,t){return!!n(e,t)};return n.allBasenames&&(r.allBasenames=n.allBasenames),n.allPaths&&(r.allPaths=n.allPaths),r}return JS(e,t)}function qS(e){let t=e;return t?typeof t.base==`string`&&typeof t.pattern==`string`:!1}function JS(e,t){let n=XS(Object.getOwnPropertyNames(e).map(n=>YS(n,e[n],t)).filter(e=>e!==IS)),r=n.length;if(!r)return IS;if(!n.some(e=>!!e.requiresSiblings)){if(r===1)return n[0];let e=function(e,t){let r;for(let i=0,a=n.length;i<a;i++){let a=n[i](e,t);if(typeof a==`string`)return a;vo(a)&&(r||=[],r.push(a))}return r?(async()=>{for(let e of r){let t=await e;if(typeof t==`string`)return t}return null})():null},t=n.find(e=>!!e.allBasenames);t&&(e.allBasenames=t.allBasenames);let i=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return i.length&&(e.allPaths=i),e}let i=function(e,t,r){let i,a;for(let o=0,s=n.length;o<s;o++){let s=n[o];s.requiresSiblings&&r&&(t||=Qr(e),i||=t.substring(0,t.length-$r(e).length));let c=s(e,t,i,r);if(typeof c==`string`)return c;vo(c)&&(a||=[],a.push(c))}return a?(async()=>{for(let e of a){let t=await e;if(typeof t==`string`)return t}return null})():null},a=n.find(e=>!!e.allBasenames);a&&(i.allBasenames=a.allBasenames);let o=n.reduce((e,t)=>t.allPaths?e.concat(t.allPaths):e,[]);return o.length&&(i.allPaths=o),i}function YS(e,t,n){if(t===!1)return IS;let r=LS(e,n);if(r===IS)return IS;if(typeof t==`boolean`)return r;if(t){let n=t.when;if(typeof n==`string`){let t=(t,i,a,o)=>{if(!o||!r(t,i))return null;let s=o(n.replace(`$(basename)`,()=>a));return vo(s)?s.then(t=>t?e:null):s?e:null};return t.requiresSiblings=!0,t}}return r}function XS(e,t){let n=e.filter(e=>!!e.basenames);if(n.length<2)return e;let r=n.reduce((e,t)=>{let n=t.basenames;return n?e.concat(n):e},[]),i;if(t){i=[];for(let e=0,n=r.length;e<n;e++)i.push(t)}else i=n.reduce((e,t)=>{let n=t.patterns;return n?e.concat(n):e},[]);let a=function(e,t){if(typeof e!=`string`)return null;if(!t){let n;for(n=e.length;n>0;n--){let t=e.charCodeAt(n-1);if(t===S.Slash||t===S.Backslash)break}t=e.substring(n)}let n=r.indexOf(t);return n===-1?null:i[n]};a.basenames=r,a.patterns=i,a.allBasenames=r;let o=e.filter(e=>!e.basenames);return o.push(a),o}const ZS=[`W`,`X`,`Y`,`Z`,`a`,`b`,`c`,`d`,`e`,`f`],QS=RegExp(`^[${ZS.join(``)}]+`);function $S(e){if(e.scheme!==D.vscodeNotebookCell)return;let t=e.fragment.indexOf(`s`);if(t<0)return;let n=parseInt(e.fragment.substring(0,t).replace(QS,``),7),r=Yt(e.fragment.substring(t+1)).toString();if(!isNaN(n))return{handle:n,notebook:e.with({scheme:r,fragment:null})}}function eC(e,t){let n=t.toString(7),r=`${n.length<ZS.length?ZS[n.length-1]:`z`}${n}s${Xt(y.fromString(e.scheme),!0,!0)}`;return e.with({scheme:D.vscodeNotebookCell,fragment:r})}function tC(e){if(e.scheme!==D.vscodeNotebookMetadata)return;let t=Yt(e.fragment).toString();return e.with({scheme:t,fragment:null})}function nC(e){let t=`${Xt(y.fromString(e.scheme),!0,!0)}`;return e.with({scheme:D.vscodeNotebookMetadata,fragment:t})}function rC(e){if(e.scheme!==D.vscodeNotebookCellOutput)return;let t=new URLSearchParams(e.query),n=t.get(`openIn`);if(!n)return;let r=t.get(`outputId`)??void 0,i=$S(e.with({scheme:D.vscodeNotebookCell,query:null})),a=t.get(`outputIndex`)?parseInt(t.get(`outputIndex`)||``,10):void 0,o=i?i.notebook:e.with({scheme:t.get(`notebookScheme`)||D.file,fragment:null,query:null}),s=t.get(`cellIndex`)?parseInt(t.get(`cellIndex`)||``,10):void 0;return{notebook:o,openIn:n,outputId:r,outputIndex:a,cellHandle:i?.handle,cellFragment:e.fragment,cellIndex:s}}var iC;(function(e){e[e.Markup=1]=`Markup`,e[e.Code=2]=`Code`})(iC||={}),Yu.latex,Yu.markdown,Yu.text,Yu.latex,Yu.markdown,Yu.text;var aC;(function(e){e[e.Running=1]=`Running`,e[e.Idle=2]=`Idle`})(aC||={});var oC;(function(e){e[e.Unconfirmed=1]=`Unconfirmed`,e[e.Pending=2]=`Pending`,e[e.Executing=3]=`Executing`})(oC||={});var sC;(function(e){e[e.Unconfirmed=1]=`Unconfirmed`,e[e.Pending=2]=`Pending`,e[e.Executing=3]=`Executing`})(sC||={});var cC;(function(e){e[e.WithHardKernelDependency=0]=`WithHardKernelDependency`,e[e.WithOptionalKernelDependency=1]=`WithOptionalKernelDependency`,e[e.Pure=2]=`Pure`,e[e.Never=3]=`Never`})(cC||={});var lC;(function(e){e.Always=`always`,e.Never=`never`,e.Optional=`optional`})(lC||={});var uC;(function(e){e[e.ModelChange=1]=`ModelChange`,e[e.Move=2]=`Move`,e[e.ChangeCellLanguage=5]=`ChangeCellLanguage`,e[e.Initialize=6]=`Initialize`,e[e.ChangeCellMetadata=7]=`ChangeCellMetadata`,e[e.Output=8]=`Output`,e[e.OutputItem=9]=`OutputItem`,e[e.ChangeCellContent=10]=`ChangeCellContent`,e[e.ChangeDocumentMetadata=11]=`ChangeDocumentMetadata`,e[e.ChangeCellInternalMetadata=12]=`ChangeCellInternalMetadata`,e[e.ChangeCellMime=13]=`ChangeCellMime`,e[e.Unknown=100]=`Unknown`})(uC||={});var dC;(function(e){e[e.Handle=0]=`Handle`,e[e.Index=1]=`Index`})(dC||={});var fC;(function(e){e[e.Replace=1]=`Replace`,e[e.Output=2]=`Output`,e[e.Metadata=3]=`Metadata`,e[e.CellLanguage=4]=`CellLanguage`,e[e.DocumentMetadata=5]=`DocumentMetadata`,e[e.Move=6]=`Move`,e[e.OutputItems=7]=`OutputItems`,e[e.PartialMetadata=8]=`PartialMetadata`,e[e.PartialInternalMetadata=9]=`PartialInternalMetadata`})(fC||={});var pC;(function(e){e.scheme=D.vscodeNotebookMetadata;function t(e){return nC(e)}e.generate=t;function n(e){return tC(e)}e.parse=n})(pC||={});var mC;(function(e){e.scheme=D.vscodeNotebookCell;function t(e,t){return eC(e,t)}e.generate=t;function n(e){return $S(e)}e.parse=n;function r(e,t){return e.with({scheme:D.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:`editor`,outputId:t??``,notebookScheme:e.scheme===D.file?``:e.scheme}).toString()})}e.generateCellOutputUriWithId=r;function i(e,t,n){return e.with({scheme:D.vscodeNotebookCellOutput,fragment:t.fragment,query:new URLSearchParams({openIn:`notebook`,outputIndex:String(n)}).toString()})}e.generateCellOutputUriWithIndex=i;function a(e,t,n,r,i){return e.with({scheme:D.vscodeNotebookCellOutput,query:new URLSearchParams({openIn:`notebookOutputEditor`,notebook:e.toString(),cellIndex:String(n),outputId:r,outputIndex:String(i)}).toString()})}e.generateOutputEditorUri=a;function o(e){return rC(e)}e.parseCellOutputUri=o;function s(t,n,r){return e.generate(t,n).with({scheme:r})}e.generateCellPropertyUri=s;function c(t,n){if(t.scheme===n)return e.parse(t.with({scheme:e.scheme}))}e.parseCellPropertyUri=c})(mC||={}),new F(`notebookEditorCursorAtBoundary`,`none`),new F(`notebookEditorCursorAtLineBoundary`,`none`);var hC;(function(e){e.default=`default`,e.option=`option`})(hC||={});var gC;(function(e){e.Cells=`cells`,e.Text=`text`,e.None=`none`})(gC||={});var _C;(function(e){e[e.Left=1]=`Left`,e[e.Right=2]=`Right`})(_C||={}),class e{static{this._prefix=`notebook/`}static create(t,n){return`${e._prefix}${t}/${n??t}`}static parse(t){if(t.startsWith(e._prefix)){let n=t.substring(e._prefix.length).split(`/`);if(n.length===2)return{notebookType:n[0],viewType:n[1]}}}};const vC=new TextDecoder;function yC(e){let t=[],n=!1;for(let r of e)(t.length===0||n)&&(t.push(r),n=!0);let r=xC(t),i=y.concat(t.map(e=>y.wrap(e))),a=wC(i);return r||=a.byteLength!==i.byteLength,{data:a,didCompression:r}}const bC=`\x1B[A`.split(``).map(e=>e.charCodeAt(0));function xC(e){let t=!1;return e.forEach((n,r)=>{if(r===0||n.length<3)return;let i=e[r-1],a=n.subarray(0,3);if(a[0]===bC[0]&&a[1]===bC[1]&&a[2]===bC[2]){let a=i.lastIndexOf(10);if(a===-1)return;t=!0,e[r-1]=i.subarray(0,a),e[r]=n.subarray(3)}}),t}function SC(e){let t=e;do e=t,t=e.replace(/[^\n]\x08/gm,``);while(t.length<e.length);return e}function CC(e){for(e=e.replace(/\r+\n/gm,`
|
|
89
|
+
`);e.search(/\r[^$]/g)>-1;){let t=e.match(/^(.*)\r+/m)[1],n=e.match(/\r+(.*)$/m)[1];n+=t.slice(n.length,t.length),e=e.replace(/\r+.*$/m,`\r`).replace(/^.*\r/m,n)}return e}function wC(e){return!e.buffer.includes(8)&&!e.buffer.includes(13)?e:y.fromString(CC(SC(vC.decode(e.buffer))))}var TC;(function(e){e.List=`list`,e.Tree=`tree`})(TC||={});var EC;(function(e){e[e.Error=0]=`Error`,e[e.Warning=1]=`Warning`,e[e.Information=2]=`Information`})(EC||={});var DC;(function(e){e[e.HistoryPrevious=0]=`HistoryPrevious`,e[e.HistoryNext=1]=`HistoryNext`})(DC||={});var OC;(function(e){e.DiscoveryTime=`discoveryTime`,e.Name=`name`,e.Path=`path`})(OC||={});var kC;(function(e){e.Single=`single`,e.Multiple=`multiple`})(kC||={});var AC;(function(e){e.Delimiter=`\0`})(AC||={});var jC;(function(e){e[e.IsSame=0]=`IsSame`,e[e.Disconnected=1]=`Disconnected`,e[e.IsChild=2]=`IsChild`,e[e.IsParent=3]=`IsParent`})(jC||={});var MC=class e{static fromExtHostTestItem(t,n,r=t.parent){if(t._isRoot)return new e([n]);let i=[t.id];for(let e=r;e&&e.id!==n;e=e.parent)i.push(e.id);return i.push(n),new e(i.reverse())}static isRoot(e){return!e.includes(AC.Delimiter)}static root(e){let t=e.indexOf(AC.Delimiter);return t===-1?e:e.slice(0,t)}static fromString(t){return new e(t.split(AC.Delimiter))}static join(t,n){return new e([...t.path,n])}static split(e){return e.split(AC.Delimiter)}static joinToString(e,t){return e.toString()+AC.Delimiter+t}static parentId(e){let t=e.lastIndexOf(AC.Delimiter);return t===-1?void 0:e.slice(0,t)}static localId(e){let t=e.lastIndexOf(AC.Delimiter);return t===-1?e:e.slice(t+AC.Delimiter.length)}static isChild(e,t){return t[e.length]===AC.Delimiter&&t.startsWith(e)}static compare(t,n){return t===n?jC.IsSame:e.isChild(t,n)?jC.IsChild:e.isChild(n,t)?jC.IsParent:jC.Disconnected}static getLengthOfCommonPrefix(e,t){if(e===0)return 0;let n=0;for(;n<e-1;){for(let r=1;r<e;r++){let e=t(r-1),i=t(r);if(e.path[n]!==i.path[n])return n}n++}return n}constructor(e,t=e.length){if(this.path=e,this.viewEnd=t,e.length===0||t<1)throw Error(`cannot create test with empty path`)}get rootId(){return new e(this.path,1)}get parentId(){return this.viewEnd>1?new e(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 t=1;t<=this.viewEnd;t++)yield new e(this.path,t)}*idsToRoot(){for(let t=this.viewEnd;t>0;t--)yield new e(this.path,t)}compare(t){if(typeof t==`string`)return e.compare(this.toString(),t);for(let e=0;e<t.viewEnd&&e<this.viewEnd;e++)if(t.path[e]!==this.path[e])return jC.Disconnected;return t.viewEnd>this.viewEnd?jC.IsChild:t.viewEnd<this.viewEnd?jC.IsParent:jC.IsSame}toJSON(){return this.toString()}toString(){if(!this.stringifed){this.stringifed=this.path[0];for(let e=1;e<this.viewEnd;e++)this.stringifed+=AC.Delimiter,this.stringifed+=this.path[e]}return this.stringifed}},NC;(function(e){e[e.Unset=0]=`Unset`,e[e.Queued=1]=`Queued`,e[e.Running=2]=`Running`,e[e.Passed=3]=`Passed`,e[e.Failed=4]=`Failed`,e[e.Skipped=5]=`Skipped`,e[e.Errored=6]=`Errored`})(NC||={}),NC.Unset,NC.Queued,NC.Running,NC.Passed,NC.Failed,NC.Skipped,NC.Errored;var PC;(function(e){e[e.Run=1]=`Run`,e[e.Debug=2]=`Debug`,e[e.Coverage=3]=`Coverage`})(PC||={});var FC;(function(e){e[e.Refresh=2]=`Refresh`,e[e.CodeRelatedToTest=4]=`CodeRelatedToTest`,e[e.TestRelatedToCode=8]=`TestRelatedToCode`})(FC||={});var IC;(function(e){e[e.Run=2]=`Run`,e[e.Debug=4]=`Debug`,e[e.Coverage=8]=`Coverage`,e[e.HasNonDefaultProfile=16]=`HasNonDefaultProfile`,e[e.HasConfigurable=32]=`HasConfigurable`,e[e.SupportsContinuousRun=64]=`SupportsContinuousRun`})(IC||={}),IC.Run,b(15487,`Run`),IC.Debug,b(15488,`Debug`),IC.Coverage,b(15489,`Coverage`),IC.Run,IC.Debug,IC.Coverage,IC.HasNonDefaultProfile,IC.HasConfigurable,IC.SupportsContinuousRun;const LC=e=>`runId`in e;var RC;(function(e){e.serialize=e=>({range:e.range.toJSON(),uri:e.uri.toJSON()}),e.deserialize=(e,t)=>({range:Ep.lift(t.range),uri:e.asCanonicalUri(C.revive(t.uri))})})(RC||={});var zC;(function(e){e[e.Error=0]=`Error`,e[e.Output=1]=`Output`})(zC||={});var BC;(function(e){e.serialize=e=>({label:e.label,uri:e.uri?.toJSON(),position:e.position?.toJSON()}),e.deserialize=(e,t)=>({label:t.label,uri:t.uri?e.asCanonicalUri(C.revive(t.uri)):void 0,position:t.position?Tp.lift(t.position):void 0})})(BC||={});var VC;(function(e){e.serialize=e=>({message:e.message,type:zC.Error,expected:e.expected,actual:e.actual,contextValue:e.contextValue,location:e.location&&RC.serialize(e.location),stackTrace:e.stackTrace?.map(BC.serialize)}),e.deserialize=(e,t)=>({message:t.message,type:zC.Error,expected:t.expected,actual:t.actual,contextValue:t.contextValue,location:t.location&&RC.deserialize(e,t.location),stackTrace:t.stackTrace&&t.stackTrace.map(t=>BC.deserialize(e,t))})})(VC||={});var HC;(function(e){e.serialize=e=>({message:e.message,type:zC.Output,offset:e.offset,length:e.length,location:e.location&&RC.serialize(e.location)}),e.deserialize=(e,t)=>({message:t.message,type:zC.Output,offset:t.offset,length:t.length,location:t.location&&RC.deserialize(e,t.location)})})(HC||={});var UC;(function(e){e.serialize=e=>e.type===zC.Error?VC.serialize(e):HC.serialize(e),e.deserialize=(e,t)=>t.type===zC.Error?VC.deserialize(e,t):HC.deserialize(e,t),e.isDiffable=e=>e.type===zC.Error&&e.actual!==void 0&&e.expected!==void 0})(UC||={});var WC;(function(e){e.serializeWithoutMessages=e=>({state:e.state,duration:e.duration,messages:[]}),e.serialize=e=>({state:e.state,duration:e.duration,messages:e.messages.map(UC.serialize)}),e.deserialize=(e,t)=>({state:t.state,duration:t.duration,messages:t.messages.map(t=>UC.deserialize(e,t))})})(WC||={});const GC=(e,t)=>e+`\0`+t,KC=e=>{let t=e.indexOf(`\0`);return{ctrlId:e.slice(0,t),tagId:e.slice(t+1)}};var qC;(function(e){e.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}),e.deserialize=(e,t)=>({extId:t.extId,label:t.label,tags:t.tags,busy:t.busy,children:void 0,uri:t.uri?e.asCanonicalUri(C.revive(t.uri)):void 0,range:t.range?Ep.lift(t.range):null,description:t.description,error:t.error,sortText:t.sortText})})(qC||={});var JC;(function(e){e[e.NotExpandable=0]=`NotExpandable`,e[e.Expandable=1]=`Expandable`,e[e.BusyExpanding=2]=`BusyExpanding`,e[e.Expanded=3]=`Expanded`})(JC||={});var YC;(function(e){e.serialize=e=>({expand:e.expand,item:qC.serialize(e.item)}),e.deserialize=(e,t)=>({controllerId:MC.root(t.item.extId),expand:t.expand,item:qC.deserialize(e,t.item)})})(YC||={});var XC;(function(e){e.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}},e.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?Ep.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}}})(XC||={});const ZC=(e,t)=>{t.expand!==void 0&&(e.expand=t.expand),t.item!==void 0&&(e.item=e.item?Object.assign(e.item,t.item):t.item)};var QC;(function(e){e.serializeWithoutMessages=e=>({...YC.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(WC.serializeWithoutMessages)}),e.serialize=e=>({...YC.serialize(e),ownComputedState:e.ownComputedState,computedState:e.computedState,tasks:e.tasks.map(WC.serialize)}),e.deserialize=(e,t)=>({...YC.deserialize(e,t),ownComputedState:t.ownComputedState,computedState:t.computedState,tasks:t.tasks.map(t=>WC.deserialize(e,t)),retired:!0})})(QC||={});var $C;(function(e){e.empty=()=>({covered:0,total:0}),e.sum=(e,t)=>{e.covered+=t.covered,e.total+=t.total}})($C||={});var ew;(function(e){e.serialize=e=>({id:e.id,statement:e.statement,branch:e.branch,declaration:e.declaration,testIds:e.testIds,uri:e.uri.toJSON()}),e.deserialize=(e,t)=>({id:t.id,statement:t.statement,branch:t.branch,declaration:t.declaration,testIds:t.testIds,uri:e.asCanonicalUri(C.revive(t.uri))}),e.empty=(e,t)=>({id:e,uri:t,statement:$C.empty()})})(ew||={});function tw(e){return{...e,location:e.location?.toJSON()}}function nw(e){return e.location=e.location?Tp.isIPosition(e.location)?Tp.lift(e.location):Ep.lift(e.location):void 0,e}var rw;(function(e){e[e.Declaration=0]=`Declaration`,e[e.Statement=1]=`Statement`,e[e.Branch=2]=`Branch`})(rw||={});var iw;(function(e){e.serialize=e=>e.type===rw.Declaration?ow.serialize(e):sw.serialize(e),e.deserialize=e=>e.type===rw.Declaration?ow.deserialize(e):sw.deserialize(e)})(iw||={});var aw;(function(e){e.serialize=tw,e.deserialize=nw})(aw||={});var ow;(function(e){e.serialize=tw,e.deserialize=nw})(ow||={});var sw;(function(e){e.serialize=e=>({...tw(e),branches:e.branches?.map(aw.serialize)}),e.deserialize=e=>({...nw(e),branches:e.branches?.map(aw.deserialize)})})(sw||={});var cw;(function(e){e[e.Add=0]=`Add`,e[e.Update=1]=`Update`,e[e.DocumentSynced=2]=`DocumentSynced`,e[e.Remove=3]=`Remove`,e[e.IncrementPendingExtHosts=4]=`IncrementPendingExtHosts`,e[e.Retire=5]=`Retire`,e[e.AddTag=6]=`AddTag`,e[e.RemoveTag=7]=`RemoveTag`})(cw||={});var lw;(function(e){e.deserialize=(e,t)=>t.op===cw.Add?{op:t.op,item:YC.deserialize(e,t.item)}:t.op===cw.Update?{op:t.op,item:XC.deserialize(t.item)}:t.op===cw.DocumentSynced?{op:t.op,uri:e.asCanonicalUri(C.revive(t.uri)),docv:t.docv}:t,e.serialize=e=>e.op===cw.Add?{op:e.op,item:YC.serialize(e.item)}:e.op===cw.Update?{op:e.op,item:XC.serialize(e.item)}:e})(lw||={});var uw=class{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){let t=this.createChangeCollector();for(let n of e)switch(n.op){case cw.Add:this.add(YC.deserialize(this.uriIdentity,n.item),t);break;case cw.Update:this.update(XC.deserialize(n.item),t);break;case cw.Remove:this.remove(n.itemId,t);break;case cw.Retire:this.retireTest(n.itemId);break;case cw.IncrementPendingExtHosts:this.updatePendingRoots(n.amount);break;case cw.AddTag:this._tags.set(n.tag.id,n.tag);break;case cw.RemoveTag:this._tags.delete(n.id);break}t.complete?.()}add(e,t){let n=MC.parentId(e.item.extId)?.toString(),r;if(!n)r=this.createItem(e),this.roots.add(r),this.items.set(e.item.extId,r);else if(this.items.has(n)){let t=this.items.get(n);t.children.add(e.item.extId),r=this.createItem(e,t),this.items.set(e.item.extId,r)}else{console.error(`Test with unknown parent ID: ${JSON.stringify(e)}`);return}return t.add?.(r),e.expand===JC.BusyExpanding&&this.busyControllerCount++,r}update(e,t){let n=this.items.get(e.extId);if(n)return e.expand!==void 0&&(n.expand===JC.BusyExpanding&&this.busyControllerCount--,e.expand===JC.BusyExpanding&&this.busyControllerCount++),ZC(n,e),t.update?.(n),n}remove(e,t){let n=this.items.get(e);if(!n)return;let r=MC.parentId(n.item.extId)?.toString();r?this.items.get(r).children.delete(n.item.extId):this.roots.delete(n);let i=[[e]];for(;i.length;)for(let e of i.pop()){let r=this.items.get(e);r&&(i.push(r.children),this.items.delete(e),t.remove?.(r,r!==n),r.expand===JC.BusyExpanding&&this.busyControllerCount--)}}retireTest(e){}updatePendingRoots(e){this.pendingRootCount+=e}createChangeCollector(){return{}}},dw;(function(e){e[e.EMBEDDED=1]=`EMBEDDED`,e[e.LLM_RANKED=2]=`LLM_RANKED`,e[e.CANCELED=3]=`CANCELED`})(dw||={});var fw;(function(e){e[e.DEFAULT=0]=`DEFAULT`,e[e.PART_CLOSE=1]=`PART_CLOSE`})(fw||={});var pw;(function(e){e[e.UP=0]=`UP`,e[e.DOWN=1]=`DOWN`,e[e.LEFT=2]=`LEFT`,e[e.RIGHT=3]=`RIGHT`})(pw||={});var mw;(function(e){e[e.HORIZONTAL=0]=`HORIZONTAL`,e[e.VERTICAL=1]=`VERTICAL`})(mw||={});var hw;(function(e){e[e.FIRST=0]=`FIRST`,e[e.LAST=1]=`LAST`,e[e.NEXT=2]=`NEXT`,e[e.PREVIOUS=3]=`PREVIOUS`})(hw||={});var gw;(function(e){e[e.MAXIMIZE=0]=`MAXIMIZE`,e[e.EXPAND=1]=`EXPAND`,e[e.EVEN=2]=`EVEN`})(gw||={});var _w;(function(e){e[e.COPY_EDITORS=0]=`COPY_EDITORS`,e[e.MOVE_EDITORS=1]=`MOVE_EDITORS`})(_w||={});var vw;(function(e){e[e.CREATION_TIME=0]=`CREATION_TIME`,e[e.MOST_RECENTLY_ACTIVE=1]=`MOST_RECENTLY_ACTIVE`,e[e.GRID_APPEARANCE=2]=`GRID_APPEARANCE`})(vw||={});var yw;(function(e){e[e.NEW_EDITOR=1]=`NEW_EDITOR`,e[e.MOVE_EDITOR=2]=`MOVE_EDITOR`,e[e.COPY_EDITOR=3]=`COPY_EDITOR`})(yw||={});var bw=class{constructor(e){this.value=e,this.isTrustedTelemetryValue=!0}};new class{constructor(){this.telemetryLevel=l_.NONE,this.sessionId=`someValue.sessionId`,this.machineId=`someValue.machineId`,this.sqmId=`someValue.sqmId`,this.devDeviceId=`someValue.devDeviceId`,this.firstSessionDate=`someValue.firstSessionDate`,this.sendErrorTelemetry=!1}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}setExperimentProperty(){}setCommonProperty(){}};const xw={id:`telemetry`,name:b(2195,`Telemetry`)};function Sw(e,t){if(!e)return`none`;let n=xs(e),r=t?.remoteExtensionTips;if(r&&Object.prototype.hasOwnProperty.call(r,n))return n;let i=t?.virtualWorkspaceExtensionTips;return i&&Object.prototype.hasOwnProperty.call(i,n)?n:`other`}function Cw(e,t){if(!e||!e.includes(`/`)&&!e.includes(`\\`))return e;let n=e,r=[];for(let n of t)for(;;){let t=n.exec(e);if(!t)break;r.push([t.index,n.lastIndex])}let i=/(?:^|[\\\/])((node_modules|node_modules\.asar)[\\\/].*)$/,a=/^(.*?)((?:\.vscode(?:-[a-z]+)*|resources[\\\/]app)[\\\/]extensions[\\\/].*)$/i,o=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w\-\._@]+(\\\\|\\|\/))+[\w\-\._@]*/g,s=0;for(n=``;;){let t=o.exec(e);if(!t)break;if(!r.some(([e,n])=>t.index<n&&e<o.lastIndex)){let r=a.exec(t[0]);if(r)n+=e.substring(s,t.index)+`<REDACTED: user-file-path>/`+r[2];else{let r=i.exec(t[0]);r?n+=e.substring(s,t.index)+`<REDACTED: user-file-path>/`+r[1]:n+=e.substring(s,t.index)+`<REDACTED: user-file-path>`}s=o.lastIndex}}return s<e.length&&(n+=e.substr(s)),n}const ww=[{label:`URL`,regex:/[a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^\s]*/},{label:`Google API Key`,regex:/AIza[A-Za-z0-9_\\\-]{35}/},{label:`JWT`,regex:/eyJ[0eXAiOiJKV1Qi|hbGci|a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+/},{label:`Slack Token`,regex:/xox[pbar]\-[A-Za-z0-9]/},{label:`GitHub Token`,regex:/(gh[psuro]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})/},{label:`Generic Secret`,regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:`CLI Credentials`,regex:/((login|psexec|(certutil|psexec)\.exe).{1,50}(\s-u(ser(name)?)?\s+.{3,100})?\s-(admin|user|vm|root)?p(ass(word)?)?\s+["']?[^$\-\/\s]|(^|[\s\r\n\\])net(\.exe)?.{1,5}(user\s+|share\s+\/user:| user -? secrets ? set) \s + [^ $\s \/])/},{label:`Microsoft Entra ID`,regex:/eyJ(?:0eXAiOiJKV1Qi|hbGci|[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.)/},{label:`Email`,regex:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/}];function Tw(e,t=e){for(let e of ww)if(e.regex.test(t))return`<REDACTED: ${e.label}>`;return e}function Ew(e){if(!e)return e;let t=!1;for(let n of ww)if(n.regex.test(e)){t=!0;break}if(!t)return e;if(!e.includes(`
|
|
90
|
+
`))return Tw(e);let n=e.split(`
|
|
91
|
+
`);for(let e=0;e<n.length;e++){let t=e<n.length-1?n[e]+`
|
|
92
|
+
`:n[e];n[e]=Tw(n[e],t)}return n.join(`
|
|
93
|
+
`)}function Dw(e,t){return e?uc(e,e=>{if(e instanceof bw||Object.hasOwnProperty.call(e,`isTrustedTelemetryValue`))return e.value;if(typeof e==`string`){let n=e.replaceAll(`%20`,` `);n=Cw(n,t);for(let e of t)n=n.replace(e,``);return n=Ew(n),n}}):{}}function Ow(e,t){return e.uuid&&t.uuid?e.uuid===t.uuid:e.id===t.id?!0:ua(e.id,t.id)===0}new Ts(`pprice.better-merge`);const kw=Object.freeze({identifier:new Ts(`nullExtensionDescription`),name:`Null Extension Description`,version:`0.0.0`,publisher:`vscode`,engines:{vscode:``},extensionLocation:C.parse(`void:location`),isBuiltin:!1,targetPlatform:ws.UNDEFINED,isUserBuiltin:!1,isUnderDevelopment:!1,preRelease:!1});var Aw=class{constructor(e){this.dependency=e}},jw;(function(e){e[e.EagerAutoStart=1]=`EagerAutoStart`,e[e.EagerManualStart=2]=`EagerManualStart`,e[e.LazyAutoStart=3]=`LazyAutoStart`})(jw||={});function Mw(e,t){return!!e.enabledApiProposals}function K(e,t){if(!Mw(e))throw Error(`Extension '${e.identifier.value}' CANNOT use API proposal: ${t}.\nIts package.json#enabledApiProposals-property declares: ${e.enabledApiProposals?.join(`, `)??`[]`} but NOT ${t}.\n The missing proposal MUST be added and you must start in extension development mode or use the following command line switch: --enable-proposed-api ${e.identifier.value}`)}var Nw;(function(e){e[e.Normal=0]=`Normal`,e[e.Immediate=1]=`Immediate`})(Nw||={});var Pw;(function(e){e[e.Upsert=0]=`Upsert`,e[e.SetTags=1]=`SetTags`,e[e.UpdateCanResolveChildren=2]=`UpdateCanResolveChildren`,e[e.RemoveChild=3]=`RemoveChild`,e[e.SetProp=4]=`SetProp`,e[e.Bulk=5]=`Bulk`,e[e.DocumentSynced=6]=`DocumentSynced`})(Pw||={});const Fw=(e,t)=>e===t,Iw=Object.entries({range:(e,t)=>e===t?!0:!e||!t?!1:e.equalsRange(t),busy:Fw,label:Fw,description:Fw,error:Fw,sortText:Fw,tags:(e,t)=>!(e.length!==t.length||e.some(e=>!t.includes(e)))}),Lw=(e,t)=>{let n;for(let[r,i]of Iw)i(e[r],t[r])||(n?n[r]=t[r]:n={[r]:t[r]});return n};var Rw=class extends v{get root(){return this.options.root}constructor(e){super(),this.options=e,this.debounceSendDiff=this._register(new Ro(()=>this.flushDiff(),200)),this.diffOpEmitter=this._register(new x),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(let e of this.tree.values())this.updateExpandability(e)}get resolveHandler(){return this._resolveHandler}collectDiff(){let e=this.diff;return this.diff=[],e}pushDiff(e){switch(e.op){case cw.DocumentSynced:for(let t of this.diff)if(t.op===cw.DocumentSynced&&t.uri===e.uri){t.docv=e.docv;return}break;case cw.Update:{let t=this.diff[this.diff.length-1];if(t){if(t.op===cw.Update&&t.item.extId===e.item.extId){ZC(t.item,e.item);return}if(t.op===cw.Add&&t.item.item.extId===e.item.extId){ZC(t.item,e.item);return}}break}}this.diff.push(e),this.debounceSendDiff.isScheduled()||this.debounceSendDiff.schedule()}expand(e,t){let n=this.tree.get(e);if(n){if((n.expandLevels===void 0||t>n.expandLevels)&&(n.expandLevels=t),n.expand===JC.Expandable){let e=this.resolveChildren(n);return e.isOpen()?this.expandChildren(n,t-1):e.wait().then(()=>this.expandChildren(n,t-1))}else if(n.expand===JC.Expanded)return n.resolveBarrier?.isOpen()===!1?n.resolveBarrier.wait().then(()=>this.expandChildren(n,t-1)):this.expandChildren(n,t-1)}}dispose(){for(let 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 Pw.RemoveChild:this.removeItem(MC.joinToString(e.fullId,t.id));break;case Pw.Upsert:this.upsertItem(t.item,e);break;case Pw.Bulk:for(let n of t.ops)this.onTestItemEvent(e,n);break;case Pw.SetTags:this.diffTagRefs(t.new,t.old,e.fullId.toString());break;case Pw.UpdateCanResolveChildren:this.updateExpandability(e);break;case Pw.SetProp:this.pushDiff({op:cw.Update,item:{extId:e.fullId.toString(),item:t.update}});break;case Pw.DocumentSynced:this.documentSynced(e.actual.uri);break;default:Ze()}}documentSynced(e){e&&this.pushDiff({op:cw.DocumentSynced,uri:e,docv:this.options.getDocumentVersion(e)})}upsertItem(e,t){let n=MC.fromExtHostTestItem(e,this.root.id,t?.actual),r=this.options.getApiFor(e);r.parent&&r.parent!==t?.actual&&this.options.getChildren(r.parent).delete(e.id);let i=this.tree.get(n.toString());if(!i){i={fullId:n,actual:e,expandLevels:t?.expandLevels?t.expandLevels-1:void 0,expand:JC.NotExpandable},e.tags.forEach(this.incrementTagRefs,this),this.tree.set(i.fullId.toString(),i),this.setItemParent(e,t),this.pushDiff({op:cw.Add,item:{controllerId:this.options.controllerId,expand:i.expand,item:this.options.toITestItem(e)}}),this.connectItemAndChildren(e,i,t);return}if(i.actual===e){this.connectItem(e,i,t);return}if(i.actual.uri?.toString()!==e.uri?.toString())return this.removeItem(n.toString()),this.upsertItem(e,t);let a=this.options.getChildren(i.actual),o=i.actual,s=Lw(this.options.toITestItem(o),this.options.toITestItem(e));this.options.getApiFor(o).listener=void 0,i.actual=e,i.resolveBarrier=void 0,i.expand=JC.NotExpandable,s&&(s.hasOwnProperty(`tags`)&&(this.diffTagRefs(e.tags,o.tags,n.toString()),delete s.tags),this.onTestItemEvent(i,{op:Pw.SetProp,update:s})),this.connectItemAndChildren(e,i,t);for(let[t,r]of a)this.options.getChildren(e).get(r.id)||this.removeItem(MC.joinToString(n,r.id));let c=i.expandLevels;c!==void 0&&queueMicrotask(()=>{i.expand===JC.Expandable&&(i.expandLevels=void 0,this.expand(n.toString(),c))}),this.documentSynced(i.actual.uri)}diffTagRefs(e,t,n){let r=new Set(t.map(e=>e.id));for(let t of e)r.delete(t.id)||this.incrementTagRefs(t);this.pushDiff({op:cw.Update,item:{extId:n,item:{tags:e.map(e=>GC(this.options.controllerId,e.id))}}}),r.forEach(this.decrementTagRefs,this)}incrementTagRefs(e){let t=this.tags.get(e.id);t?t.refCount++:(this.tags.set(e.id,{refCount:1}),this.pushDiff({op:cw.AddTag,tag:{id:GC(this.options.controllerId,e.id)}}))}decrementTagRefs(e){let t=this.tags.get(e);t&&!--t.refCount&&(this.tags.delete(e),this.pushDiff({op:cw.RemoveTag,id:GC(this.options.controllerId,e)}))}setItemParent(e,t){this.options.getApiFor(e).parent=t&&t.actual!==this.root?t.actual:void 0}connectItem(e,t,n){this.setItemParent(e,n);let r=this.options.getApiFor(e);r.parent=n?.actual,r.listener=e=>this.onTestItemEvent(t,e),this.updateExpandability(t)}connectItemAndChildren(e,t,n){this.connectItem(e,t,n);for(let[n,r]of this.options.getChildren(e))this.upsertItem(r,t)}updateExpandability(e){let t;t=this._resolveHandler?e.resolveBarrier?e.resolveBarrier.isOpen()?JC.Expanded:JC.BusyExpanding:e.actual.canResolveChildren?JC.Expandable:JC.NotExpandable:JC.NotExpandable,t!==e.expand&&(e.expand=t,this.pushDiff({op:cw.Update,item:{extId:e.fullId.toString(),expand:t}}),t===JC.Expandable&&e.expandLevels!==void 0&&this.resolveChildren(e))}expandChildren(e,t){if(t<0)return;let n=[];for(let[r,i]of this.options.getChildren(e.actual)){let r=this.expand(MC.joinToString(e.fullId,i.id),t);vo(r)&&n.push(r)}if(n.length)return Promise.all(n).then(()=>{})}resolveChildren(e){if(e.resolveBarrier)return e.resolveBarrier;if(!this._resolveHandler){let e=new jo;return e.open(),e}e.expand=JC.BusyExpanding,this.pushExpandStateUpdate(e);let t=e.resolveBarrier=new jo,n=e=>{console.error(`Unhandled error in resolveHandler of test controller "${this.options.controllerId}"`,e)},r;try{r=this._resolveHandler(e.actual===this.root?void 0:e.actual)}catch(e){n(e)}return vo(r)?r.catch(n).then(()=>{t.open(),this.updateExpandability(e)}):(t.open(),this.updateExpandability(e)),e.resolveBarrier}pushExpandStateUpdate(e){this.pushDiff({op:cw.Update,item:{extId:e.fullId.toString(),expand:e.expand}})}removeItem(e){let t=this.tree.get(e);if(!t)throw Error(`attempting to remove non-existent child`);this.pushDiff({op:cw.Remove,itemId:e});let n=[t];for(;n.length;){let e=n.pop();if(e){this.options.getApiFor(e.actual).listener=void 0;for(let t of e.actual.tags)this.decrementTagRefs(t.id);this.tree.delete(e.fullId.toString());for(let[t,r]of this.options.getChildren(e.actual))n.push(this.tree.get(MC.joinToString(e.fullId,r.id)))}}}flushDiff(){let e=this.collectDiff();e.length&&this.diffOpEmitter.fire(e)}},zw=class extends Error{constructor(e){super(`Attempted to insert a duplicate test item ID ${e}`)}},Bw=class extends Error{constructor(e){super(`TestItem with ID "${e}" is invalid. Make sure to create it from the createTestItem method.`)}},Vw=class extends Error{constructor(e,t,n){super(`TestItem with ID "${e}" is from controller "${t}" and cannot be added as a child of an item from controller "${n}".`)}};const Hw=(e,t,n)=>{let r=new Map;return{get size(){return r.size},forEach(e,t){for(let n of r.values())e.call(t,n,this)},[Symbol.iterator](){return r.entries()},replace(i){let a=new Map,o=new Set(r.keys()),s={op:Pw.Bulk,ops:[]};for(let r of i){if(!(r instanceof n))throw new Bw(r.id);let i=t(r).controllerId;if(i!==e.controllerId)throw new Vw(r.id,i,e.controllerId);if(a.has(r.id))throw new zw(r.id);a.set(r.id,r),o.delete(r.id),s.ops.push({op:Pw.Upsert,item:r})}for(let e of o.keys())s.ops.push({op:Pw.RemoveChild,id:e});e.listener?.(s),r=a},add(t){if(!(t instanceof n))throw new Bw(t.id);r.set(t.id,t),e.listener?.({op:Pw.Upsert,item:t})},delete(t){r.delete(t)&&e.listener?.({op:Pw.RemoveChild,id:t})},get(e){return r.get(e)},toJSON(){return Array.from(r.values())}}},Uw=new WeakMap,Ww=(e,t)=>{let n={controllerId:t};return Uw.set(e,n),n},Gw=e=>{let t=Uw.get(e);if(!t)throw new Bw(e?.id||`<unknown>`);return t};var Kw;(function(e){e[e.ACTIVATE=1]=`ACTIVATE`,e[e.RESTORE=2]=`RESTORE`,e[e.PRESERVE=3]=`PRESERVE`})(Kw||={});var qw;(function(e){e[e.PICK=0]=`PICK`,e[e.EXCLUSIVE_ONLY=1]=`EXCLUSIVE_ONLY`})(qw||={});var Jw;(function(e){e[e.API=0]=`API`,e[e.USER=1]=`USER`})(Jw||={});var Yw;(function(e){e[e.Center=0]=`Center`,e[e.CenterIfOutsideViewport=1]=`CenterIfOutsideViewport`,e[e.NearTop=2]=`NearTop`,e[e.NearTopIfOutsideViewport=3]=`NearTopIfOutsideViewport`})(Yw||={});var Xw;(function(e){e.PROGRAMMATIC=`api`,e.NAVIGATION=`code.navigation`,e.JUMP=`code.jump`})(Xw||={});var Zw;(function(e){e[e.WebSocket=0]=`WebSocket`,e[e.Managed=1]=`Managed`})(Zw||={});var Qw=class{constructor(e){this.id=e,this.type=Zw.Managed}toString(){return`Managed(${this.id})`}},$w=class{constructor(e,t){this.host=e,this.port=t,this.type=Zw.WebSocket}toString(){return`WebSocket(${this.host}:${this.port})`}},eT;(function(e){e.Unknown=`Unknown`,e.NotAvailable=`NotAvailable`,e.TemporarilyNotAvailable=`TemporarilyNotAvailable`,e.NoResolverFound=`NoResolverFound`,e.InvalidAuthority=`InvalidAuthority`})(eT||={});function tT(e){let t=e.indexOf(`+`);return t===-1?e:e.substring(0,t)}function q(e){return Object.assign(e,{apply:function(...t){if(t.length===0)return Reflect.construct(e,[]);{let n=t.length===1?[]:t[1];return Reflect.construct(e,n,t[0].constructor)}},call:function(...t){if(t.length===0)return Reflect.construct(e,[]);{let[n,...r]=t;return Reflect.construct(e,r,n.constructor)}}})}var nT;let rT=nT=class{#e;static isMarkdownString(e){return e instanceof nT?!0:!e||typeof e!=`object`?!1:e.appendCodeblock&&e.appendMarkdown&&e.appendText&&e.value!==void 0}constructor(e,t=!1){this.#e=new Cl(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 supportAlertSyntax(){return this.#e.supportAlertSyntax}set supportAlertSyntax(e){this.#e.supportAlertSyntax=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}};rT=nT=k([q],rT);var iT;let aT=iT=class{static Min(...e){if(e.length===0)throw TypeError();let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];r.isBefore(t)&&(t=r)}return t}static Max(...e){if(e.length===0)throw TypeError();let t=e[0];for(let n=1;n<e.length;n++){let r=e[n];r.isAfter(t)&&(t=r)}return t}static isPosition(e){if(!e)return!1;if(e instanceof iT)return!0;let{line:t,character:n}=e;return typeof t==`number`&&typeof n==`number`}static of(e){if(e instanceof iT)return e;if(this.isPosition(e))return new iT(e.line,e.character);throw 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 se(`line must be non-negative`);if(t<0)throw se(`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)}translate(e,t=0){if(e===null||t===null)throw se();let n;return e===void 0?n=0:typeof e==`number`?n=e:(n=typeof e.lineDelta==`number`?e.lineDelta:0,t=typeof e.characterDelta==`number`?e.characterDelta:0),n===0&&t===0?this:new iT(this.line+n,this.character+t)}with(e,t=this.character){if(e===null||t===null)throw se();let n;return e===void 0?n=this.line:typeof e==`number`?n=e:(n=typeof e.line==`number`?e.line:this.line,t=typeof e.character==`number`?e.character:this.character),n===this.line&&t===this.character?this:new iT(n,t)}toJSON(){return{line:this.line,character:this.character}}[Symbol.for(`debug.description`)](){return`(${this.line}:${this.character})`}};aT=iT=k([q],aT);var oT;let sT=oT=class{static isRange(e){return e instanceof oT?!0:!e||typeof e!=`object`?!1:aT.isPosition(e.start)&&aT.isPosition(e.end)}static of(e){if(e instanceof oT)return e;if(this.isRange(e))return new oT(e.start,e.end);throw Error(`Invalid argument, is NOT a range-like object`)}get start(){return this._start}get end(){return this._end}constructor(e,t,n,r){let i,a;if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`?(i=new aT(e,t),a=new aT(n,r)):aT.isPosition(e)&&aT.isPosition(t)&&(i=aT.of(e),a=aT.of(t)),!i||!a)throw Error(`Invalid arguments`);i.isBefore(a)?(this._start=i,this._end=a):(this._start=a,this._end=i)}contains(e){return oT.isRange(e)?this.contains(e.start)&&this.contains(e.end):aT.isPosition(e)?!(aT.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){let t=aT.Max(e.start,this._start),n=aT.Min(e.end,this._end);if(!t.isAfter(n))return new oT(t,n)}union(e){if(this.contains(e))return this;if(e.contains(this))return e;let t=aT.Min(e.start,this._start),n=aT.Max(e.end,this.end);return new oT(t,n)}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 se();let n;return e?aT.isPosition(e)?n=e:(n=e.start||this.start,t=e.end||this.end):n=this.start,n.isEqual(this._start)&&t.isEqual(this.end)?this:new oT(n,t)}toJSON(){return[this.start,this.end]}[Symbol.for(`debug.description`)](){return cT(this)}};sT=oT=k([q],sT);function cT(e){return e.isEmpty?`[${e.start.line}:${e.start.character})`:`[${e.start.line}:${e.start.character} -> ${e.end.line}:${e.end.character})`}var lT;let uT=class{static{lT=this}static{this.sep=`.`}constructor(e){this.value=e}append(e){return new lT(this.value?this.value+lT.sep+e:e)}intersects(e){return this.contains(e)||e.contains(this)}contains(e){return this.value===e.value||e.value.startsWith(this.value+lT.sep)}};uT=lT=k([q],uT),uT.Empty=new uT(``),uT.QuickFix=uT.Empty.append(`quickfix`),uT.Refactor=uT.Empty.append(`refactor`),uT.RefactorExtract=uT.Refactor.append(`extract`),uT.RefactorInline=uT.Refactor.append(`inline`),uT.RefactorMove=uT.Refactor.append(`move`),uT.RefactorRewrite=uT.Refactor.append(`rewrite`),uT.Source=uT.Empty.append(`source`),uT.SourceOrganizeImports=uT.Source.append(`organizeImports`),uT.SourceFixAll=uT.Source.append(`fixAll`),uT.Notebook=uT.Empty.append(`notebook`);var dT;(function(e){e[e.Unnecessary=1]=`Unnecessary`,e[e.Deprecated=2]=`Deprecated`})(dT||={});var fT;(function(e){e[e.Hint=3]=`Hint`,e[e.Information=2]=`Information`,e[e.Warning=1]=`Warning`,e[e.Error=0]=`Error`})(fT||={});let pT=class{static is(e){return e?typeof e.message==`string`&&e.location&&sT.isRange(e.location.range)&&C.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()}};pT=k([q],pT);let mT=class{constructor(e,t,n=fT.Error){if(!sT.isRange(e))throw TypeError(`range must be set`);if(!t)throw TypeError(`message must be set`);this.range=e,this.message=t,this.severity=n}toJSON(){return{severity:fT[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)&&ge(e.tags,t.tags)&&ge(e.relatedInformation,t.relatedInformation,pT.isEqual)}};mT=k([q],mT);var hT;let gT=hT=class{static isLocation(e){return e instanceof hT?!0:e?sT.isRange(e.range)&&C.isUri(e.uri):!1}constructor(e,t){if(this.uri=e,t)if(sT.isRange(t))this.range=sT.of(t);else if(aT.isPosition(t))this.range=new sT(t,t);else throw Error(`Illegal argument`)}toJSON(){return{uri:this.uri,range:this.range}}};gT=hT=k([q],gT);var _T,vT;(function(e){e[e.Markup=1]=`Markup`,e[e.Code=2]=`Code`})(vT||={});var yT=class e{static isNotebookRange(t){return t instanceof e?!0:t?typeof t.start==`number`&&typeof t.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 se(`start must be positive`);if(t<0)throw se(`end must be positive`);e<=t?(this._start=e,this._end=t):(this._start=t,this._end=e)}with(t){let n=this._start,r=this._end;return t.start!==void 0&&(n=t.start),t.end!==void 0&&(r=t.end),n===this._start&&r===this._end?this:new e(n,r)}},bT=class e{static validate(e){if(typeof e.kind!=`number`)throw Error(`NotebookCellData MUST have 'kind' property`);if(typeof e.value!=`string`)throw Error(`NotebookCellData MUST have 'value' property`);if(typeof e.languageId!=`string`)throw Error(`NotebookCellData MUST have 'languageId' property`)}static isNotebookCellDataArray(t){return Array.isArray(t)&&t.every(t=>e.isNotebookCellData(t))}static isNotebookCellData(e){return!0}constructor(t,n,r,i,a,o,s){this.kind=t,this.value=n,this.languageId=r,this.mime=i,this.outputs=a??[],this.metadata=o,this.executionSummary=s,e.validate(this)}},xT=class{constructor(e){this.cells=e}};let ST=_T=class{static isNotebookCellEdit(e){return e instanceof _T?!0:e?yT.isNotebookRange(e)&&Array.isArray(e.newCells):!1}static replaceCells(e,t){return new _T(e,t)}static insertCells(e,t){return new _T(new yT(e,e),t)}static deleteCells(e){return new _T(e,[])}static updateCellMetadata(e,t){let n=new _T(new yT(e,e),[]);return n.newCellMetadata=t,n}static updateNotebookMetadata(e){let t=new _T(new yT(0,0),[]);return t.newNotebookMetadata=e,t}constructor(e,t){this.range=e,this.newCells=t}};ST=_T=k([q],ST);var CT=class e{static isNotebookCellOutputItem(t){return t instanceof e?!0:t?typeof t.mime==`string`&&t.data instanceof Uint8Array:!1}static error(t){let n={name:t.name,message:t.message,stack:t.stack};return e.json(n,`application/vnd.code.notebook.error`)}static stdout(t){return e.text(t,`application/vnd.code.notebook.stdout`)}static stderr(t){return e.text(t,`application/vnd.code.notebook.stderr`)}static bytes(t,n=`application/octet-stream`){return new e(t,n)}static#e=new TextEncoder;static text(t,n=Yu.text){return new e(e.#e.encode(String(t)),n)}static json(t,n=`text/x-json`){let r=JSON.stringify(t,void 0,` `);return e.text(r,n)}constructor(e,t){this.data=e,this.mime=t;let n=Zu(t,!0);if(!n)throw Error(`INVALID mime type: ${t}. Must be in the format "type/subtype[;optionalparameter]"`);this.mime=n}},wT=class e{static isNotebookCellOutput(t){return t instanceof e?!0:!t||typeof t!=`object`?!1:typeof t.id==`string`&&Array.isArray(t.items)}static ensureUniqueMimeTypes(e,t=!1){let n=new Set,r=new Set;for(let i=0;i<e.length;i++){let a=e[i],o=Zu(a.mime);if(!n.has(o)||Qu(o)){n.add(o);continue}r.add(i),t&&console.warn(`DUPLICATED mime type '${a.mime}' will be dropped`)}return r.size===0?e:e.filter((e,t)=>!r.has(t))}constructor(t,n,r){this.items=e.ensureUniqueMimeTypes(t,!0),typeof n==`string`?(this.id=n,this.metadata=r):(this.id=Gc(),this.metadata=n??r)}},TT;let ET=TT=class extends sT{static isSelection(e){return e instanceof TT?!0:!e||typeof e!=`object`?!1:sT.isRange(e)&&aT.isPosition(e.anchor)&&aT.isPosition(e.active)&&typeof e.isReversed==`boolean`}get anchor(){return this._anchor}get active(){return this._active}constructor(e,t,n,r){let i,a;if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`?(i=new aT(e,t),a=new aT(n,r)):aT.isPosition(e)&&aT.isPosition(t)&&(i=aT.of(e),a=aT.of(t)),!i||!a)throw Error(`Invalid arguments`);super(i,a),this._anchor=i,this._active=a}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 DT(this)}};ET=TT=k([q],ET);function DT(e){let t=cT(e);return e.isEmpty||(t=e.active.isEqual(e.start)?`|${t}`:`${t}|`),t}var OT;let kT=OT=class{static isSnippetString(e){return e instanceof OT?!0:!e||typeof e!=`object`?!1:typeof e.value==`string`}static _escape(e){return e.replace(/\$|}|\\/g,`\\$&`)}constructor(e){this._tabstop=1,this.value=e||``}appendText(e){return this.value+=OT._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+=`$`,this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if(typeof e==`function`){let t=new OT;t._tabstop=this._tabstop,e(t),this._tabstop=t._tabstop,e=t.value}else e=OT._escape(e);return this.value+="${",this.value+=t,this.value+=`:`,this.value+=e,this.value+=`}`,this}appendChoice(e,t=this._tabstop++){let n=e.map(e=>e.replaceAll(/[|\\,]/g,`\\$&`)).join(`,`);return this.value+="${",this.value+=t,this.value+=`|`,this.value+=n,this.value+=`|}`,this}appendVariable(e,t){if(typeof t==`function`){let e=new OT;e._tabstop=this._tabstop,t(e),this._tabstop=e._tabstop,t=e.value}else typeof t==`string`&&(t=t.replace(/\$|}/g,`\\$&`));return this.value+="${",this.value+=e,t&&(this.value+=`:`,this.value+=t),this.value+=`}`,this}};kT=OT=k([q],kT);var AT,jT;(function(e){e[e.File=0]=`File`,e[e.Module=1]=`Module`,e[e.Namespace=2]=`Namespace`,e[e.Package=3]=`Package`,e[e.Class=4]=`Class`,e[e.Method=5]=`Method`,e[e.Property=6]=`Property`,e[e.Field=7]=`Field`,e[e.Constructor=8]=`Constructor`,e[e.Enum=9]=`Enum`,e[e.Interface=10]=`Interface`,e[e.Function=11]=`Function`,e[e.Variable=12]=`Variable`,e[e.Constant=13]=`Constant`,e[e.String=14]=`String`,e[e.Number=15]=`Number`,e[e.Boolean=16]=`Boolean`,e[e.Array=17]=`Array`,e[e.Object=18]=`Object`,e[e.Key=19]=`Key`,e[e.Null=20]=`Null`,e[e.EnumMember=21]=`EnumMember`,e[e.Struct=22]=`Struct`,e[e.Event=23]=`Event`,e[e.Operator=24]=`Operator`,e[e.TypeParameter=25]=`TypeParameter`})(jT||={});var MT;(function(e){e[e.Deprecated=1]=`Deprecated`})(MT||={});let NT=AT=class{static validate(e){if(!e.name)throw Error(`name must not be falsy`)}constructor(e,t,n,r,i){this.name=e,this.kind=t,this.containerName=i,typeof n==`string`&&(this.containerName=n),r instanceof gT?this.location=r:n instanceof sT&&(this.location=new gT(r,n)),AT.validate(this)}toJSON(){return{name:this.name,kind:jT[this.kind],location:this.location,containerName:this.containerName}}};NT=AT=k([q],NT);var PT,FT;(function(e){e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(FT||={});let IT=PT=class{static isTextEdit(e){return e instanceof PT?!0:!e||typeof e!=`object`?!1:sT.isRange(e)&&typeof e.newText==`string`}static replace(e,t){return new PT(e,t)}static insert(e,t){return PT.replace(new sT(e,e),t)}static delete(e){return PT.replace(e,``)}static setEndOfLine(e){let t=new PT(new sT(new aT(0,0),new aT(0,0)),``);return t.newEol=e,t}get range(){return this._range}set range(e){if(e&&!sT.isRange(e))throw se(`range`);this._range=e}get newText(){return this._newText||``}set newText(e){if(e&&typeof e!=`string`)throw se(`newText`);this._newText=e}get newEol(){return this._newEol}set newEol(e){if(e&&typeof e!=`number`)throw se(`newEol`);this._newEol=e}constructor(e,t){this._range=e,this._newText=t}toJSON(){return{range:this.range,newText:this.newText,newEol:this._newEol}}};IT=PT=k([q],IT);var LT=class e{static isSnippetTextEdit(t){return t instanceof e?!0:t?sT.isRange(t.range)&&kT.isSnippetString(t.snippet):!1}static replace(t,n){return new e(t,n)}static insert(t,n){return e.replace(new sT(t,t),n)}constructor(e,t){this.range=e,this.snippet=t}},RT;(function(e){e[e.File=1]=`File`,e[e.Text=2]=`Text`,e[e.Cell=3]=`Cell`,e[e.CellReplace=5]=`CellReplace`,e[e.Snippet=6]=`Snippet`})(RT||={});let zT=class{constructor(){this._edits=[]}_allEntries(){return this._edits}renameFile(e,t,n,r){this._edits.push({_type:RT.File,from:e,to:t,options:n,metadata:r})}createFile(e,t,n){this._edits.push({_type:RT.File,from:void 0,to:e,options:t,metadata:n})}deleteFile(e,t,n){this._edits.push({_type:RT.File,from:e,to:void 0,options:t,metadata:n})}replaceNotebookMetadata(e,t,n){this._edits.push({_type:RT.Cell,metadata:n,uri:e,edit:{editType:fC.DocumentMetadata,metadata:t}})}replaceNotebookCells(e,t,n,r){let i=t.start,a=t.end;(i!==a||n.length>0)&&this._edits.push({_type:RT.CellReplace,uri:e,index:i,count:a-i,cells:n,metadata:r})}replaceNotebookCellMetadata(e,t,n,r){this._edits.push({_type:RT.Cell,metadata:r,uri:e,edit:{editType:fC.Metadata,index:t,metadata:n}})}replace(e,t,n,r){this._edits.push({_type:RT.Text,uri:e,edit:new IT(t,n),metadata:r})}insert(e,t,n,r){this.replace(e,new sT(t,t),n,r)}delete(e,t,n){this.replace(e,t,``,n)}has(e){return this._edits.some(t=>t._type===RT.Text&&t.uri.toString()===e.toString())}set(e,t){if(t)for(let n of t){if(!n)continue;let t,r;Array.isArray(n)?(t=n[0],r=n[1]):t=n,ST.isNotebookCellEdit(t)?t.newCellMetadata?this.replaceNotebookCellMetadata(e,t.range.start,t.newCellMetadata,r):t.newNotebookMetadata?this.replaceNotebookMetadata(e,t.newNotebookMetadata,r):this.replaceNotebookCells(e,t.range,t.newCells,r):LT.isSnippetTextEdit(t)?this._edits.push({_type:RT.Snippet,uri:e,range:t.range,edit:t.snippet,metadata:r,keepWhitespace:t.keepWhitespace}):this._edits.push({_type:RT.Text,uri:e,edit:t,metadata:r})}else{for(let t=0;t<this._edits.length;t++){let n=this._edits[t];switch(n._type){case RT.Text:case RT.Snippet:case RT.Cell:case RT.CellReplace:n.uri.toString()===e.toString()&&(this._edits[t]=void 0);break}}Ce(this._edits)}}get(e){let t=[];for(let n of this._edits)n._type===RT.Text&&n.uri.toString()===e.toString()&&t.push(n.edit);return t}entries(){let e=new He;for(let t of this._edits)if(t._type===RT.Text){let n=e.get(t.uri);n||(n=[t.uri,[]],e.set(t.uri,n)),n[1].push(t.edit)}return[...e.values()]}get size(){return this.entries().length}toJSON(){return this.entries()}};zT=k([q],zT);var BT,VT,HT,UT,WT,GT,KT,qT;(function(e){e[e.Top=0]=`Top`,e[e.Bottom=1]=`Bottom`})(qT||={});var JT;(function(e){e[e.TerminalCommand=0]=`TerminalCommand`,e[e.Opener=1]=`Opener`,e[e.Command=3]=`Command`})(JT||={});let YT=BT=class{static from(...e){let t=e;return new BT(function(){if(t){for(let e of t)e&&typeof e.dispose==`function`&&e.dispose();t=void 0}})}#e;constructor(e){this.#e=e}dispose(){typeof this.#e==`function`&&(this.#e(),this.#e=void 0)}};YT=BT=k([q],YT);const XT=e=>{if(typeof e!=`string`||e.length===0||!/^[0-9A-Za-z_\-]+$/.test(e))throw se(`connectionToken`)};var ZT=class{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,n){if(typeof e!=`string`||e.length===0)throw se(`host`);if(typeof t!=`number`||t===0||Math.round(t)!==t)throw se(`port`);n!==void 0&&XT(n),this.host=e,this.port=Math.round(t),this.connectionToken=n}},QT=class{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,t!==void 0&&XT(t)}},$T=class e extends Error{static NotAvailable(t,n){return new e(t,eT.NotAvailable,n)}static TemporarilyNotAvailable(t){return new e(t,eT.TemporarilyNotAvailable)}constructor(t,n=eT.Unknown,r){super(t),this._message=t,this._code=n,this._detail=r,Object.setPrototypeOf(this,e.prototype)}},eE;(function(e){e[e.Replace=1]=`Replace`,e[e.Append=2]=`Append`,e[e.Prepend=3]=`Prepend`})(eE||={});let tE=class{constructor(e,t){if(!e)throw Error(`Illegal argument, contents must be defined`);Array.isArray(e)?this.contents=e:this.contents=[e],this.range=t}};tE=k([q],tE);let nE=class extends tE{constructor(e,t,n,r){super(e,t),this.canIncreaseVerbosity=n,this.canDecreaseVerbosity=r}};nE=k([q],nE);var rE;(function(e){e[e.Increase=0]=`Increase`,e[e.Decrease=1]=`Decrease`})(rE||={});var iE;(function(e){e[e.Text=0]=`Text`,e[e.Read=1]=`Read`,e[e.Write=2]=`Write`})(iE||={});let aE=class{constructor(e,t=iE.Text){this.range=e,this.kind=t}toJSON(){return{range:this.range,kind:iE[this.kind]}}};aE=k([q],aE);let oE=class{constructor(e,t){this.uri=e,this.highlights=t}toJSON(){return{uri:this.uri,highlights:this.highlights.map(e=>e.toJSON())}}};oE=k([q],oE);let sE=VT=class{static validate(e){if(!e.name)throw Error(`name must not be falsy`);if(!e.range.contains(e.selectionRange))throw Error(`selectionRange must be contained in fullRange`);e.children?.forEach(VT.validate)}constructor(e,t,n,r,i){this.name=e,this.detail=t,this.kind=n,this.range=r,this.selectionRange=i,this.children=[],VT.validate(this)}};sE=VT=k([q],sE);var cE;(function(e){e[e.Invoke=1]=`Invoke`,e[e.Automatic=2]=`Automatic`})(cE||={});let lE=class{constructor(e,t){this.title=e,this.kind=t}};lE=k([q],lE);let uE=class{constructor(e,t){if(this.range=e,this.parent=t,t&&!t.range.contains(this.range))throw Error(`Invalid argument: parent must contain this range`)}};uE=k([q],uE);var dE=class{constructor(e,t,n,r,i,a){this.kind=e,this.name=t,this.detail=n,this.uri=r,this.range=i,this.selectionRange=a}},fE=class{constructor(e,t){this.fromRanges=t,this.from=e}},pE=class{constructor(e,t){this.fromRanges=t,this.to=e}},mE;(function(e){e[e.Information=0]=`Information`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(mE||={});let hE=class{constructor(e,t){this.range=e,this.command=t}get isResolved(){return!!this.command}};hE=k([q],hE);let gE=class{constructor(e,t){this.label=e,this.documentation=t}};gE=k([q],gE);let _E=class{constructor(e,t){this.label=e,this.documentation=t,this.parameters=[]}};_E=k([q],_E);let vE=class{constructor(){this.activeSignature=0,this.activeParameter=0,this.signatures=[]}};vE=k([q],vE);var yE;(function(e){e[e.Invoke=1]=`Invoke`,e[e.TriggerCharacter=2]=`TriggerCharacter`,e[e.ContentChange=3]=`ContentChange`})(yE||={});var bE;(function(e){e[e.Type=1]=`Type`,e[e.Parameter=2]=`Parameter`})(bE||={});let xE=class{constructor(e){this.value=e}};xE=k([q],xE);let SE=class{constructor(e,t,n){this.position=e,this.label=t,this.kind=n}};SE=k([q],SE);var CE;(function(e){e[e.Invoke=0]=`Invoke`,e[e.TriggerCharacter=1]=`TriggerCharacter`,e[e.TriggerForIncompleteCompletions=2]=`TriggerForIncompleteCompletions`})(CE||={});var wE;(function(e){e[e.Text=0]=`Text`,e[e.Method=1]=`Method`,e[e.Function=2]=`Function`,e[e.Constructor=3]=`Constructor`,e[e.Field=4]=`Field`,e[e.Variable=5]=`Variable`,e[e.Class=6]=`Class`,e[e.Interface=7]=`Interface`,e[e.Module=8]=`Module`,e[e.Property=9]=`Property`,e[e.Unit=10]=`Unit`,e[e.Value=11]=`Value`,e[e.Enum=12]=`Enum`,e[e.Keyword=13]=`Keyword`,e[e.Snippet=14]=`Snippet`,e[e.Color=15]=`Color`,e[e.File=16]=`File`,e[e.Reference=17]=`Reference`,e[e.Folder=18]=`Folder`,e[e.EnumMember=19]=`EnumMember`,e[e.Constant=20]=`Constant`,e[e.Struct=21]=`Struct`,e[e.Event=22]=`Event`,e[e.Operator=23]=`Operator`,e[e.TypeParameter=24]=`TypeParameter`,e[e.User=25]=`User`,e[e.Issue=26]=`Issue`})(wE||={});var TE;(function(e){e[e.Deprecated=1]=`Deprecated`})(TE||={});let EE=class{constructor(e,t){this.label=e,this.kind=t}toJSON(){return{label:this.label,kind:this.kind&&wE[this.kind],detail:this.detail,documentation:this.documentation,sortText:this.sortText,filterText:this.filterText,preselect:this.preselect,insertText:this.insertText,textEdit:this.textEdit}}};EE=k([q],EE);let DE=class{constructor(e=[],t=!1){this.items=e,this.isIncomplete=t}};DE=k([q],DE);let OE=class{constructor(e,t,n){this.insertText=e,this.range=t,this.command=n}};OE=k([q],OE);let kE=class{constructor(e){this.commands=void 0,this.suppressSuggestions=void 0,this.items=e}};kE=k([q],kE);var AE;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Word=1]=`Word`,e[e.Line=2]=`Line`,e[e.Suggest=3]=`Suggest`})(AE||={});var jE;(function(e){e[e.Accepted=0]=`Accepted`,e[e.Rejected=1]=`Rejected`,e[e.Ignored=2]=`Ignored`})(jE||={});var ME;(function(e){e[e.Code=1]=`Code`,e[e.Label=2]=`Label`})(ME||={});var NE;(function(e){e[e.Active=-1]=`Active`,e[e.Beside=-2]=`Beside`,e[e.One=1]=`One`,e[e.Two=2]=`Two`,e[e.Three=3]=`Three`,e[e.Four=4]=`Four`,e[e.Five=5]=`Five`,e[e.Six=6]=`Six`,e[e.Seven=7]=`Seven`,e[e.Eight=8]=`Eight`,e[e.Nine=9]=`Nine`})(NE||={});var PE;(function(e){e[e.Left=1]=`Left`,e[e.Right=2]=`Right`})(PE||={});function FE(e,t){return`${Ts.toKey(e)}.${t}`}var IE;(function(e){e[e.Off=0]=`Off`,e[e.On=1]=`On`,e[e.Relative=2]=`Relative`,e[e.Interval=3]=`Interval`})(IE||={});var LE;(function(e){e[e.Manual=1]=`Manual`,e[e.AfterDelay=2]=`AfterDelay`,e[e.FocusOut=3]=`FocusOut`})(LE||={});var RE;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(RE||={});var zE;(function(e){e[e.Keyboard=1]=`Keyboard`,e[e.Mouse=2]=`Mouse`,e[e.Command=3]=`Command`})(zE||={});var BE;(function(e){e[e.Addition=1]=`Addition`,e[e.Deletion=2]=`Deletion`,e[e.Modification=3]=`Modification`})(BE||={});var VE;(function(e){e[e.Undo=1]=`Undo`,e[e.Redo=2]=`Redo`})(VE||={});var HE;(function(e){e[e.OpenOpen=0]=`OpenOpen`,e[e.ClosedClosed=1]=`ClosedClosed`,e[e.OpenClosed=2]=`OpenClosed`,e[e.ClosedOpen=3]=`ClosedOpen`})(HE||={}),(function(e){function t(t){switch(t){case`keyboard`:return e.Keyboard;case`mouse`:return e.Mouse;case Xw.PROGRAMMATIC:case Xw.JUMP:case Xw.NAVIGATION:return e.Command}}e.fromValue=t})(zE||={});var UE;(function(e){e[e.Other=0]=`Other`,e[e.Comment=1]=`Comment`,e[e.String=2]=`String`,e[e.RegEx=3]=`RegEx`})(UE||={}),(function(e){function t(t){switch(t){case e.Other:return`other`;case e.Comment:return`comment`;case e.String:return`string`;case e.RegEx:return`regex`}return`other`}e.toString=t})(UE||={});let WE=class{constructor(e,t){if(t&&!C.isUri(t))throw se(`target`);if(!sT.isRange(e)||e.isEmpty)throw se(`range`);this.range=e,this.target=t}};WE=k([q],WE);let GE=class{constructor(e,t,n,r){this.red=e,this.green=t,this.blue=n,this.alpha=r}};GE=k([q],GE);let KE=class{constructor(e,t){if(t&&!(t instanceof GE))throw se(`color`);if(!sT.isRange(e)||e.isEmpty)throw se(`range`);this.range=e,this.color=t}};KE=k([q],KE);let qE=class{constructor(e){if(!e||typeof e!=`string`)throw se(`label`);this.label=e}};qE=k([q],qE);var JE;(function(e){e[e.RGB=0]=`RGB`,e[e.HEX=1]=`HEX`,e[e.HSL=2]=`HSL`})(JE||={});var YE;(function(e){e[e.Error=0]=`Error`,e[e.Warning=1]=`Warning`,e[e.Information=2]=`Information`})(YE||={});var XE;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Shutdown=1]=`Shutdown`,e[e.Process=2]=`Process`,e[e.User=3]=`User`,e[e.Extension=4]=`Extension`})(XE||={});var ZE;(function(e){e[e.Low=0]=`Low`,e[e.Medium=1]=`Medium`,e[e.High=2]=`High`})(ZE||={});var QE;(function(e){e[e.Sh=1]=`Sh`,e[e.Bash=2]=`Bash`,e[e.Fish=3]=`Fish`,e[e.Csh=4]=`Csh`,e[e.Ksh=5]=`Ksh`,e[e.Zsh=6]=`Zsh`,e[e.CommandPrompt=7]=`CommandPrompt`,e[e.GitBash=8]=`GitBash`,e[e.PowerShell=9]=`PowerShell`,e[e.Python=10]=`Python`,e[e.Julia=11]=`Julia`,e[e.NuShell=12]=`NuShell`,e[e.Node=13]=`Node`,e[e.Xonsh=14]=`Xonsh`})(QE||={});var $E=class{constructor(e,t,n){if(this.startIndex=e,this.length=t,this.tooltip=n,typeof e!=`number`||e<0)throw se(`startIndex`);if(typeof t!=`number`||t<1)throw se(`length`);if(n!==void 0&&typeof n!=`string`)throw se(`tooltip`)}},eD=class{constructor(e){this.uri=e}},tD=class{constructor(e){this.terminalCommand=e}},nD;(function(e){e[e.Panel=1]=`Panel`,e[e.Editor=2]=`Editor`})(nD||={});var rD=class{constructor(e){if(this.options=e,typeof e!=`object`)throw se(`options`)}},iD;(function(e){e[e.File=0]=`File`,e[e.Folder=1]=`Folder`,e[e.Method=2]=`Method`,e[e.Alias=3]=`Alias`,e[e.Argument=4]=`Argument`,e[e.Option=5]=`Option`,e[e.OptionValue=6]=`OptionValue`,e[e.Flag=7]=`Flag`,e[e.SymbolicLinkFile=8]=`SymbolicLinkFile`,e[e.SymbolicLinkFolder=9]=`SymbolicLinkFolder`,e[e.ScmCommit=10]=`ScmCommit`,e[e.ScmBranch=11]=`ScmBranch`,e[e.ScmTag=12]=`ScmTag`,e[e.ScmStash=13]=`ScmStash`,e[e.ScmRemote=14]=`ScmRemote`,e[e.PullRequest=15]=`PullRequest`,e[e.PullRequestDone=16]=`PullRequestDone`})(iD||={});var aD=class{constructor(e,t,n,r,i,a,o,s){this.label=e,this.replacementRange=t,this.kind=n,this.detail=r,this.documentation=i,this.isFile=a,this.isDirectory=o,this.isKeyword=s}},oD=class{constructor(e,t){this.items=e??[],this.resourceOptions=t}},sD;(function(e){e[e.Always=1]=`Always`,e[e.Silent=2]=`Silent`,e[e.Never=3]=`Never`})(sD||={});var cD;(function(e){e.Changed=`changed`,e.ProcessStarted=`processStarted`,e.ProcessEnded=`processEnded`,e.Terminated=`terminated`,e.Start=`start`,e.AcquiredInput=`acquiredInput`,e.DependsOnStarted=`dependsOnStarted`,e.Active=`active`,e.Inactive=`inactive`,e.End=`end`,e.ProblemMatcherStarted=`problemMatcherStarted`,e.ProblemMatcherEnded=`problemMatcherEnded`,e.ProblemMatcherFoundErrors=`problemMatcherFoundErrors`})(cD||={});var lD;(function(e){e[e.Shared=1]=`Shared`,e[e.Dedicated=2]=`Dedicated`,e[e.New=3]=`New`})(lD||={});let uD=class{static{HT=this}static{this.Clean=new HT(`clean`,`Clean`)}static{this.Build=new HT(`build`,`Build`)}static{this.Rebuild=new HT(`rebuild`,`Rebuild`)}static{this.Test=new HT(`test`,`Test`)}static from(e){switch(e){case`clean`:return HT.Clean;case`build`:return HT.Build;case`rebuild`:return HT.Rebuild;case`test`:return HT.Test;default:return}}constructor(e,t){if(this.label=t,typeof e!=`string`||typeof t!=`string`)throw se(`name`);this._id=e}get id(){return this._id}};uD=HT=k([q],uD);function dD(e){let t=``;for(let n=0;n<e.length;n++)t+=e[n].replace(/,/g,`,,`)+`,`;return t}let fD=class{constructor(e,t,n){if(typeof e!=`string`)throw se(`process`);this._args=[],this._process=e,t!==void 0&&(Array.isArray(t)?(this._args=t,this._options=n):this._options=t)}get process(){return this._process}set process(e){if(typeof e!=`string`)throw se(`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(){let e=[];if(e.push(`process`),this._process!==void 0&&e.push(this._process),this._args&&this._args.length>0)for(let t of this._args)e.push(t);return dD(e)}};fD=k([q],fD);let pD=class{constructor(e,t,n){if(this._args=[],Array.isArray(t)){if(!e)throw se(`command can't be undefined or null`);if(typeof e!=`string`&&typeof e.value!=`string`)throw se(`command`);this._command=e,t&&(this._args=t),this._options=n}else{if(typeof e!=`string`)throw se(`commandLine`);this._commandLine=e,this._options=t}}get commandLine(){return this._commandLine}set commandLine(e){if(typeof e!=`string`)throw se(`commandLine`);this._commandLine=e}get command(){return this._command?this._command:``}set command(e){if(typeof e!=`string`&&typeof e.value!=`string`)throw se(`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(){let 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(let t of this._args)e.push(typeof t==`string`?t:t.value);return dD(e)}};pD=k([q],pD);var mD;(function(e){e[e.Escape=1]=`Escape`,e[e.Strong=2]=`Strong`,e[e.Weak=3]=`Weak`})(mD||={});var hD;(function(e){e[e.Global=1]=`Global`,e[e.Workspace=2]=`Workspace`})(hD||={});var gD;(function(e){e[e.Default=1]=`Default`,e[e.FolderOpen=2]=`FolderOpen`,e[e.WorktreeCreated=3]=`WorktreeCreated`})(gD||={});var _D=class{constructor(e){this._callback=e}computeId(){return`customExecution`+Gc()}set callback(e){this._callback=e}get callback(){return this._callback}};let vD=class{static{UT=this}static{this.ExtensionCallbackType=`customExecution`}static{this.ProcessType=`process`}static{this.ShellType=`shell`}static{this.EmptyType=`$empty`}constructor(e,t,n,r,i,a){this.__deprecated=!1,this._definition=this.definition=e;let o;typeof t==`string`?(this._name=this.name=t,this._source=this.source=n,this.execution=r,o=i,this.__deprecated=!0):(t===hD.Global||hD.Workspace,this.target=t,this._name=this.name=n,this._source=this.source=r,this.execution=i,o=a),typeof o==`string`?(this._problemMatchers=[o],this._hasDefinedMatchers=!0):Array.isArray(o)?(this._problemMatchers=o,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 fD?this._definition={type:UT.ProcessType,id:this._execution.computeId()}:this._execution instanceof pD?this._definition={type:UT.ShellType,id:this._execution.computeId()}:this._execution instanceof _D?this._definition={type:UT.ExtensionCallbackType,id:this._execution.computeId()}:this._definition={type:UT.EmptyType,id:Gc()}}get definition(){return this._definition}set definition(e){if(e==null)throw se(`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 se(`name`);this.clear(),this._name=e}get execution(){return this._execution}set execution(e){e===null&&(e=void 0),this.clear(),this._execution=e;let t=this._definition.type;(UT.EmptyType===t||UT.ProcessType===t||UT.ShellType===t||UT.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 se(`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??=Object.create(null),this.clear(),this._presentationOptions=e}get runOptions(){return this._runOptions}set runOptions(e){e??=Object.create(null),this.clear(),this._runOptions=e}};vD=UT=k([q],vD);var yD;(function(e){e[e.SourceControl=1]=`SourceControl`,e[e.Window=10]=`Window`,e[e.Notification=15]=`Notification`})(yD||={});var bD;(function(e){function t(e){let t=e;return at(t.value)?t.tooltip&&!et(t.tooltip)?(console.log(`INVALID view badge, invalid tooltip`,t.tooltip),!1):!0:(console.log(`INVALID view badge, invalid value`,t.value),!1)}e.isViewBadge=t})(bD||={});let xD=WT=class{static isTreeItem(e,t){let n=e;if(n.checkboxState!==void 0){let e=at(n.checkboxState)?n.checkboxState:rt(n.checkboxState)&&at(n.checkboxState.state)?n.checkboxState.state:void 0,t=!at(n.checkboxState)&&rt(n.checkboxState)?n.checkboxState.tooltip:void 0;if(e===void 0||e!==CD.Checked&&e!==CD.Unchecked||t!==void 0&&!et(t))return console.log(`INVALID tree item, invalid checkboxState`,n.checkboxState),!1}if(e instanceof WT)return!0;if(n.label!==void 0&&!et(n.label)&&!n.label?.label)return console.log(`INVALID tree item, invalid label`,n.label),!1;if(n.id!==void 0&&!et(n.id))return console.log(`INVALID tree item, invalid id`,n.id),!1;if(n.iconPath!==void 0&&!et(n.iconPath)&&!C.isUri(n.iconPath)&&(!n.iconPath||!et(n.iconPath.id))){let e=n.iconPath;if(!e||!et(e.light)&&!C.isUri(e.light)&&!et(e.dark)&&!C.isUri(e.dark))return console.log(`INVALID tree item, invalid iconPath`,n.iconPath),!1}return n.description!==void 0&&!et(n.description)&&typeof n.description!=`boolean`?(console.log(`INVALID tree item, invalid description`,n.description),!1):n.resourceUri!==void 0&&!C.isUri(n.resourceUri)?(console.log(`INVALID tree item, invalid resourceUri`,n.resourceUri),!1):n.tooltip!==void 0&&!et(n.tooltip)&&!(n.tooltip instanceof rT)?(console.log(`INVALID tree item, invalid tooltip`,n.tooltip),!1):n.command!==void 0&&!n.command.command?(console.log(`INVALID tree item, invalid command`,n.command),!1):n.collapsibleState!==void 0&&n.collapsibleState<SD.None&&n.collapsibleState>SD.Expanded?(console.log(`INVALID tree item, invalid collapsibleState`,n.collapsibleState),!1):n.contextValue!==void 0&&!et(n.contextValue)?(console.log(`INVALID tree item, invalid contextValue`,n.contextValue),!1):n.accessibilityInformation!==void 0&&!n.accessibilityInformation?.label?(console.log(`INVALID tree item, invalid accessibilityInformation`,n.accessibilityInformation),!1):!0}constructor(e,t=SD.None){this.collapsibleState=t,C.isUri(e)?this.resourceUri=e:this.label=e}};xD=WT=k([q],xD);var SD;(function(e){e[e.None=0]=`None`,e[e.Collapsed=1]=`Collapsed`,e[e.Expanded=2]=`Expanded`})(SD||={});var CD;(function(e){e[e.Unchecked=0]=`Unchecked`,e[e.Checked=1]=`Checked`})(CD||={});let wD=class{async asString(){return typeof this.value==`string`?this.value:JSON.stringify(this.value)}asFile(){}constructor(e){this.value=e}};wD=k([q],wD);var TD=class extends wD{},ED=class extends TD{#e;constructor(e){super(``),this.#e=e}asFile(){return this.#e}},DD=class{constructor(e,t,n,r){this.name=e,this.uri=t,this._itemId=n,this._getData=r}data(){return this._getData()}};let OD=class{#e=new Map;constructor(e){for(let[t,n]of e??[]){let e=this.#e.get(this.#t(t));e?e.push(n):this.#e.set(this.#t(t),[n])}}get(e){return this.#e.get(this.#t(e))?.[0]}set(e,t){this.#e.set(this.#t(e),[t])}forEach(e,t){for(let[n,r]of this.#e)for(let i of r)e.call(t,i,n,this)}*[Symbol.iterator](){for(let[e,t]of this.#e)for(let n of t)yield[e,n]}#t(e){return e.toLowerCase()}};OD=k([q],OD);let kD=class{constructor(e,t,n){this.insertText=e,this.title=t,this.kind=n}};kD=k([q],kD);var AD;(function(e){e[e.Automatic=0]=`Automatic`,e[e.PasteAs=1]=`PasteAs`})(AD||={});var jD=class e{static{this.sep=`.`}constructor(e){this.value=e}append(...t){return new e((this.value?[this.value,...t]:t).join(e.sep))}intersects(e){return this.contains(e)||e.contains(this)}contains(t){return this.value===t.value||t.value.startsWith(this.value+e.sep)}};jD.Empty=new jD(``),jD.Text=new jD(`text`),jD.TextUpdateImports=jD.Text.append(`updateImports`);var MD=class{constructor(e,t,n){this.title=t,this.insertText=e,this.kind=n}};let ND=class{constructor(e,t){this.id=e,this.color=t}static isThemeIcon(e){return typeof e.id==`string`?!0:(console.log(`INVALID ThemeIcon, invalid id`,e.id),!1)}};ND=k([q],ND),ND.File=new ND(`file`),ND.Folder=new ND(`folder`);let PD=class{constructor(e){this.id=e}};PD=k([q],PD);var FD;(function(e){e[e.Global=1]=`Global`,e[e.Workspace=2]=`Workspace`,e[e.WorkspaceFolder=3]=`WorkspaceFolder`})(FD||={});let ID=class{get base(){return this._base}set base(e){this._base=e,this._baseUri=C.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||!C.isUri(e)&&!C.isUri(e.uri)))throw se(`base`);if(typeof t!=`string`)throw se(`pattern`);typeof e==`string`?this.baseUri=C.file(e):C.isUri(e)?this.baseUri=e:this.baseUri=e.uri,this.pattern=t}toJSON(){return{pattern:this.pattern,base:this.base,baseUri:this.baseUri.toJSON()}}};ID=k([q],ID);const LD=new WeakMap;function RD(e,t){LD.set(e,t)}let zD=class{constructor(e,t,n,r,i){this.enabled=typeof e==`boolean`?e:!0,typeof t==`string`&&(this.condition=t),typeof n==`string`&&(this.hitCondition=n),typeof r==`string`&&(this.logMessage=r),typeof i==`string`&&(this.mode=i)}get id(){return this._id||=LD.get(this)??Gc(),this._id}};zD=k([q],zD);let BD=class extends zD{constructor(e,t,n,r,i,a){if(super(t,n,r,i,a),e===null)throw se(`location`);this.location=e}};BD=k([q],BD);let VD=class extends zD{constructor(e,t,n,r,i,a){super(t,n,r,i,a),this.functionName=e}};VD=k([q],VD);let HD=class extends zD{constructor(e,t,n,r,i,a,o,s){if(super(r,i,a,o,s),!t)throw se(`dataId`);this.label=e,this.dataId=t,this.canPersist=n}};HD=k([q],HD);let UD=class{constructor(e,t,n){this.command=e,this.args=t||[],this.options=n}};UD=k([q],UD);let WD=class{constructor(e,t){this.port=e,this.host=t}};WD=k([q],WD);let GD=class{constructor(e){this.path=e}};GD=k([q],GD);let KD=class{constructor(e){this.implementation=e}};KD=k([q],KD);var qD=class{constructor(e,t,n){this.session=e,this.threadId=t,this.frameId=n}},JD=class{constructor(e,t){this.session=e,this.threadId=t}};let YD=class{constructor(e,t){this.range=e,this.expression=t}};YD=k([q],YD);var XD;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(XD||={});var ZD;(function(e){e[e.Other=0]=`Other`,e[e.Empty=1]=`Empty`,e[e.TokenCancellation=2]=`TokenCancellation`,e[e.LostRace=3]=`LostRace`,e[e.NotTaken=4]=`NotTaken`})(ZD||={});let QD=class{constructor(e,t){this.range=e,this.text=t}};QD=k([q],QD);let $D=class{constructor(e,t,n=!0){this.range=e,this.variableName=t,this.caseSensitiveLookup=n}};$D=k([q],$D);let eO=class{constructor(e,t){this.range=e,this.expression=t}};eO=k([q],eO);let tO=class{constructor(e,t){this.frameId=e,this.stoppedLocation=t}};tO=k([q],tO);var nO;(function(e){e[e.AIGenerated=1]=`AIGenerated`})(nO||={});var rO;(function(e){e[e.Invoke=0]=`Invoke`,e[e.Automatic=1]=`Automatic`})(rO||={});var iO=class{constructor(e,t){this.newSymbolName=e,this.tags=t}},aO;(function(e){e[e.Changed=1]=`Changed`,e[e.Created=2]=`Created`,e[e.Deleted=3]=`Deleted`})(aO||={});let oO=GT=class extends Error{static FileExists(e){return new GT(e,xc.FileExists,GT.FileExists)}static FileNotFound(e){return new GT(e,xc.FileNotFound,GT.FileNotFound)}static FileNotADirectory(e){return new GT(e,xc.FileNotADirectory,GT.FileNotADirectory)}static FileIsADirectory(e){return new GT(e,xc.FileIsADirectory,GT.FileIsADirectory)}static NoPermissions(e){return new GT(e,xc.NoPermissions,GT.NoPermissions)}static Unavailable(e){return new GT(e,xc.Unavailable,GT.Unavailable)}constructor(e,t=xc.Unknown,n){super(C.isUri(e)?e.toString(!0):e),this.code=n?.name??`Unknown`,Cc(this,t),Object.setPrototypeOf(this,GT.prototype),typeof Error.captureStackTrace==`function`&&typeof n==`function`&&Error.captureStackTrace(this,n)}};oO=GT=k([q],oO);let sO=class{constructor(e,t,n){this.start=e,this.end=t,this.kind=n}};sO=k([q],sO);var cO;(function(e){e[e.Comment=1]=`Comment`,e[e.Imports=2]=`Imports`,e[e.Region=3]=`Region`})(cO||={});var lO;(function(e){e[e.Collapsed=0]=`Collapsed`,e[e.Expanded=1]=`Expanded`})(lO||={});var uO;(function(e){e[e.Editing=0]=`Editing`,e[e.Preview=1]=`Preview`})(uO||={});var dO;(function(e){e[e.Published=0]=`Published`,e[e.Draft=1]=`Draft`})(dO||={});var fO;(function(e){e[e.Unresolved=0]=`Unresolved`,e[e.Resolved=1]=`Resolved`})(fO||={});var pO;(function(e){e[e.Current=0]=`Current`,e[e.Outdated=1]=`Outdated`})(pO||={});var mO;(function(e){e[e.Reply=1]=`Reply`,e[e.Comment=2]=`Comment`})(mO||={});var hO=class{constructor(e,t=[]){this.tokenTypes=e,this.tokenModifiers=t}};function gO(e){return e===void 0||tt(e)}var _O=class e{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,n=e.tokenTypes.length;t<n;t++)this._tokenTypeStrToInt.set(e.tokenTypes[t],t);for(let t=0,n=e.tokenModifiers.length;t<n;t++)this._tokenModifierStrToInt.set(e.tokenModifiers[t],t)}}push(e,t,n,r,i){if(typeof e==`number`&&typeof t==`number`&&typeof n==`number`&&typeof r==`number`&&(typeof i==`number`||i===void 0))return i===void 0&&(i=0),this._pushEncoded(e,t,n,r,i);if(sT.isRange(e)&&typeof t==`string`&&gO(n))return this._push(e,t,n);throw se()}_push(e,t,n){if(!this._hasLegend)throw Error(`Legend must be provided in constructor`);if(e.start.line!==e.end.line)throw Error("`range` cannot span multiple lines");if(!this._tokenTypeStrToInt.has(t))throw Error("`tokenType` is not in the provided legend");let r=e.start.line,i=e.start.character,a=e.end.character-e.start.character,o=this._tokenTypeStrToInt.get(t),s=0;if(n)for(let e of n){if(!this._tokenModifierStrToInt.has(e))throw Error("`tokenModifier` is not in the provided legend");let t=this._tokenModifierStrToInt.get(e);s|=1<<t>>>0}this._pushEncoded(r,i,a,o,s)}_pushEncoded(e,t,n,r,i){if(this._dataIsSortedAndDeltaEncoded&&(e<this._prevLine||e===this._prevLine&&t<this._prevChar)){this._dataIsSortedAndDeltaEncoded=!1;let e=this._data.length/5|0,t=0,n=0;for(let r=0;r<e;r++){let e=this._data[5*r],i=this._data[5*r+1];e===0?(e=t,i+=n):e+=t,this._data[5*r]=e,this._data[5*r+1]=i,t=e,n=i}}let a=e,o=t;this._dataIsSortedAndDeltaEncoded&&this._dataLen>0&&(a-=this._prevLine,a===0&&(o-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=o,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}static _sortAndDeltaEncode(e){let t=[],n=e.length/5|0;for(let e=0;e<n;e++)t[e]=e;t.sort((t,n)=>{let r=e[5*t],i=e[5*n];return r===i?e[5*t+1]-e[5*n+1]:r-i});let r=new Uint32Array(e.length),i=0,a=0;for(let o=0;o<n;o++){let n=5*t[o],s=e[n+0],c=e[n+1],l=e[n+2],u=e[n+3],d=e[n+4],f=s-i,p=f===0?c-a:c,m=5*o;r[m+0]=f,r[m+1]=p,r[m+2]=l,r[m+3]=u,r[m+4]=d,i=s,a=c}return r}build(t){return this._dataIsSortedAndDeltaEncoded?new vO(new Uint32Array(this._data),t):new vO(e._sortAndDeltaEncode(this._data),t)}},vO=class{constructor(e,t){this.resultId=t,this.data=e}},yO=class{constructor(e,t,n){this.start=e,this.deleteCount=t,this.data=n}},bO=class{constructor(e,t){this.resultId=t,this.edits=e}},xO;(function(e){e[e.Separate=0]=`Separate`,e[e.MergeWithParent=1]=`MergeWithParent`})(xO||={});var SO=class{constructor(e){this.name=e}},CO;(function(e){e[e.Title=1]=`Title`,e[e.Inline=2]=`Inline`,e[e.Input=3]=`Input`})(CO||={});let wO=class{static{this.Back={iconPath:new ND(`arrow-left`)}}constructor(){}};wO=k([q],wO);var TO;(function(e){e[e.Separator=-1]=`Separator`,e[e.Default=0]=`Default`})(TO||={});var EO;(function(e){e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(EO||={});var DO;(function(e){e[e.UI=1]=`UI`,e[e.Workspace=2]=`Workspace`})(DO||={});var OO=class{static validate(e){if(typeof e.badge==`string`){let t=Ta(e.badge,0);if(t<e.badge.length&&(t+=Ta(e.badge,t)),e.badge.length>t)throw Error(`The 'badge'-property must be undefined or a short character`)}else if(e.badge&&!ND.isThemeIcon(e.badge))throw Error(`The 'badge'-property is not a valid ThemeIcon`);if(!e.color&&!e.badge&&!e.tooltip)throw Error(`The decoration is empty`);return!0}constructor(e,t,n){this.badge=e,this.tooltip=t,this.color=n}};let kO=class{constructor(e){this.kind=e}};kO=k([q],kO);var AO;(function(e){e[e.Light=1]=`Light`,e[e.Dark=2]=`Dark`,e[e.HighContrast=3]=`HighContrast`,e[e.HighContrastLight=4]=`HighContrastLight`})(AO||={});var jO=class{constructor(e,t,n){this.label=e,this.uri=t,this.position=n}},MO;(function(e){e[e.Idle=1]=`Idle`,e[e.Pending=2]=`Pending`,e[e.Executing=3]=`Executing`})(MO||={});var NO;(function(e){e[e.Left=1]=`Left`,e[e.Right=2]=`Right`})(NO||={});var PO;(function(e){e[e.Default=0]=`Default`,e[e.InCenter=1]=`InCenter`,e[e.InCenterIfOutsideViewport=2]=`InCenterIfOutsideViewport`,e[e.AtTop=3]=`AtTop`})(PO||={});var FO=class{constructor(e,t){this.text=e,this.alignment=t}},IO;(function(e){e[e.Default=1]=`Default`,e[e.Preferred=2]=`Preferred`})(IO||={});var LO;(function(e){e[e.Default=1]=`Default`,e[e.Preferred=2]=`Preferred`,e[e.Hidden=-1]=`Hidden`})(LO||={});var RO=class{constructor(e,t=[]){this.uri=e,this.provides=ke(t)}},zO=class{constructor(e){this.label=e}},BO;(function(e){e[e.Named=1]=`Named`,e[e.Indexed=2]=`Indexed`})(BO||={});let VO=class{constructor(e,t){this.label=e,this.timestamp=t}};VO=k([q],VO);var HO;(function(e){e[e.Production=1]=`Production`,e[e.Development=2]=`Development`,e[e.Test=3]=`Test`})(HO||={});var UO;(function(e){e[e.Node=1]=`Node`,e[e.Webworker=2]=`Webworker`})(UO||={});var WO;(function(e){e[e.Other=0]=`Other`,e[e.Comment=1]=`Comment`,e[e.String=2]=`String`,e[e.RegEx=3]=`RegEx`})(WO||={});var GO=class{constructor(e,t){this.ranges=e,this.wordPattern=t}},KO=class{constructor(e){this._autoForwardAction=e}get autoForwardAction(){return this._autoForwardAction}},qO;(function(e){e[e.Queued=1]=`Queued`,e[e.Running=2]=`Running`,e[e.Passed=3]=`Passed`,e[e.Failed=4]=`Failed`,e[e.Skipped=5]=`Skipped`,e[e.Errored=6]=`Errored`})(qO||={});var JO;(function(e){e[e.Run=1]=`Run`,e[e.Debug=2]=`Debug`,e[e.Coverage=3]=`Coverage`})(JO||={});var YO=class{constructor(e,t,n){this.controllerId=e,this.profileId=t,this.kind=n}};let XO=class{constructor(e=void 0,t=void 0,n=void 0,r=!1,i=!0){this.include=e,this.exclude=t,this.profile=n,this.continuous=r,this.preserveFocus=i}};XO=k([q],XO);let ZO=KT=class{static diff(e,t,n){let r=new KT(e);return r.expectedOutput=t,r.actualOutput=n,r}constructor(e){this.message=e}};ZO=KT=k([q],ZO);let QO=class{constructor(e){this.id=e}};QO=k([q],QO);var $O=class{constructor(e,t,n){this.label=e,this.uri=t,this.position=n}},ek=class{constructor(e,t){this.covered=e,this.total=t,tk(this)}};function tk(e){if(e){if(e.covered>e.total)throw Error(`The total number of covered items (${e.covered}) cannot be greater than the total (${e.total})`);if(e.total<0)throw Error(`The number of covered items (${e.total}) cannot be negative`)}}var nk=class e{static fromDetails(t,n){let r=new ek(0,0),i=new ek(0,0),a=new ek(0,0);for(let e of n)if(`branches`in e){r.total+=1,r.covered+=+!!e.executed;for(let t of e.branches)i.total+=1,i.covered+=+!!t.executed}else a.total+=1,a.covered+=+!!e.executed;let o=new e(t,r,i.total>0?i:void 0,a.total>0?a:void 0);return o.detailedCoverage=n,o}constructor(e,t,n,r,i=[]){this.uri=e,this.statementCoverage=t,this.branchCoverage=n,this.declarationCoverage=r,this.includesTests=i}},rk=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,n=[]){this.executed=e,this.location=t,this.branches=n}},ik=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,n){this.executed=e,this.location=t,this.label=n}},ak=class{get executionCount(){return+this.executed}set executionCount(e){this.executed=e}constructor(e,t,n){this.name=e,this.executed=t,this.location=n}},ok;(function(e){e[e.None=0]=`None`,e[e.Option=1]=`Option`,e[e.Default=2]=`Default`,e[e.Preferred=3]=`Preferred`})(ok||={});var sk;(function(e){e[e.Untrusted=0]=`Untrusted`,e[e.Trusted=1]=`Trusted`,e[e.Unspecified=2]=`Unspecified`})(sk||={});var ck;(function(e){e[e.Notify=1]=`Notify`,e[e.OpenBrowser=2]=`OpenBrowser`,e[e.OpenPreview=3]=`OpenPreview`,e[e.Silent=4]=`Silent`,e[e.Ignore=5]=`Ignore`,e[e.OpenBrowserOnce=6]=`OpenBrowserOnce`})(ck||={});var lk=class{constructor(e,t,n,r,i,a){this.kind=e,this.name=t,this.detail=n,this.uri=r,this.range=i,this.selectionRange=a}},uk=class{constructor(e){this.uri=e}},dk=class{constructor(e,t){this.original=e,this.modified=t}},fk=class{constructor(e,t,n,r){this.base=e,this.input1=t,this.input2=n,this.result=r}},pk=class{constructor(e,t){this.uri=e,this.viewType=t}},mk=class{constructor(e){this.viewType=e}},hk=class{constructor(e,t){this.uri=e,this.notebookType=t}},gk=class{constructor(e,t,n){this.original=e,this.modified=t,this.notebookType=n}},_k=class{constructor(){}},vk=class{constructor(e,t){this.uri=e,this.inputBoxUri=t}},yk=class{constructor(){}},bk=class{constructor(e){this.textDiffs=e}},xk;(function(e){e[e.Down=0]=`Down`,e[e.Up=1]=`Up`})(xk||={});var Sk;(function(e){e[e.Action=1]=`Action`,e[e.Toolbar=2]=`Toolbar`})(Sk||={});var Ck;(function(e){e[e.Short=1]=`Short`,e[e.Medium=2]=`Medium`,e[e.Full=3]=`Full`})(Ck||={});var wk=class{constructor(e,t,n){this.id=e,this.label=t,this.values=n}},Tk;(function(e){e[e.Accepted=1]=`Accepted`,e[e.Rejected=2]=`Rejected`,e[e.Saved=3]=`Saved`})(Tk||={});var Ek;(function(e){e[e.Keep=1]=`Keep`,e[e.Undo=2]=`Undo`,e[e.UserModification=3]=`UserModification`})(Ek||={});var Dk;(function(e){e[e.Unhelpful=0]=`Unhelpful`,e[e.Helpful=1]=`Helpful`,e[e.Undone=2]=`Undone`,e[e.Accepted=3]=`Accepted`,e[e.Bug=4]=`Bug`})(Dk||={});var Ok;(function(e){e[e.Unhelpful=0]=`Unhelpful`,e[e.Helpful=1]=`Helpful`})(Ok||={});var kk=class{constructor(e){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new rT(e):e}},Ak=class{constructor(e,t){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new rT(e):e,this.vulnerabilities=t}},jk=class{constructor(e,t,n,r){this.title=e,this.message=t,this.data=n,this.buttons=r}},Mk=class{constructor(e,t){this.value=e,this.baseUri=t}},Nk=class{constructor(e,t,n){this.value=e,this.title=t,this.readOnly=n}},Pk=class{constructor(e,t){this.data=e,this.mimeType=t}},Fk=class{constructor(e,t,n,r){this.description=e,this.agentName=t,this.prompt=n,this.result=r}},Ik=class{constructor(e,t){this.uris=e,this.callback=t,this.applied=new Promise(e=>{this.didGetApplied=e})}},Lk=class{constructor(e,t){this.value=e,this.value2=e,this.title=t}},Rk=class{constructor(e){this.value=e}},zk=class{constructor(e,t){this.value=e,this.task=t}},Bk=class{constructor(e,t,n){this.value=e,this.id=t,this.metadata=n}},Vk=class{constructor(e,t,n,r){this.hookType=e,this.stopReason=t,this.systemMessage=n,this.metadata=r}},Hk=class{constructor(e){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new rT(e):e}},Uk=class{constructor(e){if(typeof e!=`string`&&e.isTrusted===!0)throw Error(`The boolean form of MarkdownString.isTrusted is NOT supported for chat participants.`);this.value=typeof e==`string`?new rT(e):e}},Wk=class{constructor(e){this.value=e}},Gk=class{constructor(e,t,n){this.value=e,this.iconPath=t,this.options=n}},Kk=class{constructor(e,t,n){this.value=e,this.isEdit=t,this.undoStopId=n}},qk=class{constructor(e,t,n){this.value=e,this.license=t,this.snippet=n}},Jk=class{constructor(e,t){this.uri=e,this.range=t}},Yk=class{constructor(e){this.extensions=e}},Xk=class{constructor(e,t,n,r,i){this.title=t,this.description=n,this.author=r,this.linkTag=i,li(e)?(this.uri=e,this.command={title:`Open Pull Request`,command:`vscode.open`,arguments:[e]}):this.command=e}toJSON(){return{$mid:Mr.ChatResponsePullRequestPart,uri:this.uri,title:this.title,description:this.description,author:this.author}}},Zk;(function(e){e[e.Text=1]=`Text`,e[e.SingleSelect=2]=`SingleSelect`,e[e.MultiSelect=3]=`MultiSelect`})(Zk||={});var Qk=class{constructor(e,t,n,r){this.id=e,this.type=t,this.title=n,this.message=r?.message,this.options=r?.options,this.defaultValue=r?.defaultValue,this.allowFreeformInput=r?.allowFreeformInput}},$k=class{constructor(e,t=!0){this.questions=e,this.allowSkip=t}},eA=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},tA=class{constructor(e,t){this.uri=e,t===!0?(this.isDone=!0,this.edits=[]):this.edits=Array.isArray(t)?t:[t]}},nA=class{constructor(e){this.edits=e}},rA;(function(e){e[e.NotStarted=1]=`NotStarted`,e[e.InProgress=2]=`InProgress`,e[e.Completed=3]=`Completed`})(rA||={});var iA;(function(e){e[e.Running=0]=`Running`,e[e.Completed=1]=`Completed`,e[e.Failed=2]=`Failed`})(iA||={});var aA=class{constructor(e,t,n){this.toolName=e,this.toolCallId=t,this.errorMessage=n}},oA=class{constructor(e,t,n,r,i,a,o,s,c){this.prompt=e,this.command=t,this.references=n,this.participant=r,this.toolReferences=i,this.editedFileEvents=a,this.id=o,this.modelId=s,this.modeInstructions2=c}},sA=class{constructor(e,t,n,r){this.response=e,this.result=t,this.participant=n,this.command=r}},cA=class{constructor(e,t,n,r){this.response=e,this.result=t,this.participant=n,this.command=r}},lA;(function(e){e[e.Panel=1]=`Panel`,e[e.Terminal=2]=`Terminal`,e[e.Notebook=3]=`Notebook`,e[e.Editor=4]=`Editor`})(lA||={});var uA;(function(e){e[e.Failed=0]=`Failed`,e[e.Completed=1]=`Completed`,e[e.InProgress=2]=`InProgress`,e[e.NeedsInput=3]=`NeedsInput`})(uA||={});var dA=class e{static{this.Agent=new e(`agent`)}static{this.Skill=new e(`skill`)}static{this.Instructions=new e(`instructions`)}static{this.Prompt=new e(`prompt`)}static{this.Hook=new e(`hook`)}static{this.Plugins=new e(`plugins`)}constructor(e){this.id=e}},fA;(function(e){e[e.Trace=0]=`Trace`,e[e.Info=1]=`Info`,e[e.Warning=2]=`Warning`,e[e.Error=3]=`Error`})(fA||={});var pA;(function(e){e[e.Success=0]=`Success`,e[e.Error=1]=`Error`})(pA||={});var mA;(function(e){e[e.Success=0]=`Success`,e[e.Error=1]=`Error`,e[e.NonBlockingError=2]=`NonBlockingError`})(mA||={});var hA=class{constructor(e,t){this._kind=`toolCall`,this.toolName=e,this.created=t}},gA=class{constructor(e){this._kind=`modelTurn`,this.created=e}},_A=class{constructor(e,t,n){this._kind=`generic`,this.name=e,this.level=t,this.created=n}},vA=class{constructor(e,t){this._kind=`subagentInvocation`,this.agentName=e,this.created=t}},yA=class{constructor(e,t){this.name=e,this.content=t}},bA=class{constructor(e,t){this._kind=`userMessage`,this.message=e,this.created=t,this.sections=[]}},xA=class{constructor(e,t){this._kind=`agentResponse`,this.message=e,this.created=t,this.sections=[]}},SA=class{constructor(e){this._kind=`text`,this.value=e}},CA;(function(e){e[e.User=0]=`User`,e[e.Agent=1]=`Agent`})(CA||={});var wA=class{constructor(e,t,n){this._kind=`messageContent`,this.type=e,this.message=t,this.sections=n}},TA=class{constructor(e){this._kind=`toolCallContent`,this.toolName=e}},EA=class{constructor(e){this._kind=`modelTurnContent`,this.requestName=e}},DA=class{constructor(e){this._kind=`hookContent`,this.hookType=e}},OA=class{constructor(e,t,n,r,i){this.uri=e,this.originalUri=t,this.modifiedUri=n,this.insertions=r,this.deletions=i}},kA;(function(e){e[e.Complete=1]=`Complete`,e[e.Partial=2]=`Partial`,e[e.Omitted=3]=`Omitted`})(kA||={});var AA;(function(e){e[e.NoReason=0]=`NoReason`,e[e.FilteredContentRetry=1]=`FilteredContentRetry`,e[e.CopyrightContentRetry=2]=`CopyrightContentRetry`})(AA||={});var jA=class{constructor(e,t,n,r){this.editor=e,this.document=t,this.selection=n,this.wholeRange=r}},MA=class{constructor(e){this.cell=e}},NA=class{constructor(e,t,n){this.mimeType=e,this.data=t,this.reference=n}},PA=class{constructor(e){this.diagnostics=e}},FA;(function(e){e[e.User=1]=`User`,e[e.Assistant=2]=`Assistant`,e[e.System=3]=`System`})(FA||={});var IA=class{constructor(e,t,n){this.callId=e,this.content=t,this.isError=n??!1}},LA;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(LA||={});var RA;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(RA||={});var zA=class e{static User(t,n){return new e(FA.User,t,n)}static Assistant(t,n){return new e(FA.Assistant,t,n)}set content(e){typeof e==`string`?this._content=[new UA(e)]:this._content=e}get content(){return this._content}constructor(e,t,n){this._content=[],this.role=e,this.content=t,this.name=n}},BA=class e{static User(t,n){return new e(FA.User,t,n)}static Assistant(t,n){return new e(FA.Assistant,t,n)}set content(e){typeof e==`string`?this._content=[new UA(e)]:this._content=e}get content(){return this._content}set content2(e){e&&(this.content=e.map(e=>typeof e==`string`?new UA(e):e))}get content2(){return this.content.map(e=>e instanceof UA?e.value:e)}constructor(e,t,n){this._content=[],this.role=e,this.content=t,this.name=n}},VA=class{constructor(e,t,n){this.callId=e,this.name=t,this.input=n}},HA;(function(e){e[e.Assistant=0]=`Assistant`,e[e.User=1]=`User`,e[e.Extension=2]=`Extension`})(HA||={});var UA=class{constructor(e,t){this.value=e}toJSON(){return{$mid:Mr.LanguageModelTextPart,value:this.value,audience:this.audience}}},WA=class e{constructor(e,t,n){this.mimeType=t,this.data=e,this.audience=n}static image(t,n){return new e(t,n)}static json(t,n=`text/x-json`){let r=JSON.stringify(t,void 0,` `);return new e(y.fromString(r).buffer,n)}static text(t,n=Yu.text){return new e(y.fromString(t).buffer,n)}toJSON(){return{$mid:Mr.LanguageModelDataPart,mimeType:this.mimeType,data:Xt(y.wrap(this.data)),audience:this.audience}}},GA;(function(e){e.PNG=`image/png`,e.JPEG=`image/jpeg`,e.GIF=`image/gif`,e.WEBP=`image/webp`,e.BMP=`image/bmp`})(GA||={});var KA=class{constructor(e,t,n){this.value=e,this.id=t,this.metadata=n}toJSON(){return{$mid:Mr.LanguageModelThinkingPart,value:this.value,id:this.id,metadata:this.metadata}}},qA=class{constructor(e){this.value=e}toJSON(){return{$mid:Mr.LanguageModelPromptTsxPart,value:this.value}}},JA=class e extends Error{static#e=`LanguageModelError`;static NotFound(t){return new e(t,e.NotFound.name)}static NoPermissions(t){return new e(t,e.NoPermissions.name)}static Blocked(t){return new e(t,e.Blocked.name)}static tryDeserialize(t){if(t.name===e.#e)return new e(t.message,t.code,t.cause)}constructor(t,n,r){super(t,{cause:r}),this.name=e.#e,this.code=n??``}},YA=class{constructor(e){this.content=e}toJSON(){return{$mid:Mr.LanguageModelToolResult,content:this.content}}},XA=class{constructor(e){this.content=e}toJSON(){return{$mid:Mr.LanguageModelToolResult,content:this.content}}},ZA=class extends YA{},QA;(function(e){e[e.Auto=1]=`Auto`,e[e.Required=2]=`Required`})(QA||={});var $A=class{constructor(e,t){this.id=e,this.label=t}},ej=class{constructor(e,t,n){this.label=e,this.name=t,this.instructions=n}},tj;(function(e){e[e.SymbolInformation=1]=`SymbolInformation`,e[e.CommandInformation=2]=`CommandInformation`,e[e.SearchInformation=3]=`SearchInformation`,e[e.SettingInformation=4]=`SettingInformation`})(tj||={});var nj;(function(e){e[e.EMBEDDED=1]=`EMBEDDED`,e[e.LLM_RANKED=2]=`LLM_RANKED`,e[e.CANCELED=3]=`CANCELED`})(nj||={});var rj;(function(e){e[e.Started=1]=`Started`,e[e.Recognizing=2]=`Recognizing`,e[e.Recognized=3]=`Recognized`,e[e.Stopped=4]=`Stopped`,e[e.Error=5]=`Error`})(rj||={});var ij;(function(e){e[e.Started=1]=`Started`,e[e.Stopped=2]=`Stopped`,e[e.Error=3]=`Error`})(ij||={});var aj;(function(e){e[e.Recognized=1]=`Recognized`,e[e.Stopped=2]=`Stopped`})(aj||={});var oj;(function(e){e[e.Initial=0]=`Initial`,e[e.Dynamic=1]=`Dynamic`})(oj||={});var sj=class{constructor(e,t,n,r={},i,a){this.label=e,this.command=t,this.args=n,this.env=r,this.version=i,this.metadata=a}},cj=class{constructor(e,t,n={},r,i,a){this.label=e,this.uri=t,this.headers=n,this.version=r,this.metadata=i,this.authentication=a}},lj;(function(e){function t(e){let{selectionStartLineNumber:t,selectionStartColumn:n,positionLineNumber:r,positionColumn:i}=e;return new ET(new aT(t-1,n-1),new aT(r-1,i-1))}e.to=t;function n(e){let{anchor:t,active:n}=e;return{selectionStartLineNumber:t.line+1,selectionStartColumn:t.character+1,positionLineNumber:n.line+1,positionColumn:n.character+1}}e.from=n})(lj||={});var J;(function(e){function t(e){if(!e)return;let{start:t,end:n}=e;return{startLineNumber:t.line+1,startColumn:t.character+1,endLineNumber:n.line+1,endColumn:n.character+1}}e.from=t;function n(e){if(!e)return;let{startLineNumber:t,startColumn:n,endLineNumber:r,endColumn:i}=e;return new sT(t-1,n-1,r-1,i-1)}e.to=n})(J||={});var uj;(function(e){function t(e){return{uri:e.uri,range:J.from(e.range)}}e.from=t;function n(e){return new gT(C.revive(e.uri),J.to(e.range))}e.to=n})(uj||={});var dj;(function(e){function t(e){switch(e){case Ap.Comment:return WO.Comment;case Ap.Other:return WO.Other;case Ap.RegEx:return WO.RegEx;case Ap.String:return WO.String}}e.to=t})(dj||={});var fj;(function(e){function t(e){return new aT(e.lineNumber-1,e.column-1)}e.to=t;function n(e){return{lineNumber:e.line+1,column:e.character+1}}e.from=n})(fj||={});var pj;(function(e){function t(e,t,r){return Se(ke(e).map(e=>n(e,t,r)))}e.from=t;function n(e,t,n){if(typeof e==`string`)return{$serialized:!0,language:e,isBuiltin:n?.isBuiltin};if(e)return{$serialized:!0,language:e.language,scheme:r(e.scheme,t),pattern:pM.from(e.pattern)??void 0,exclusive:e.exclusive,notebookType:e.notebookType,isBuiltin:n?.isBuiltin}}function r(e,t){return t&&typeof e==`string`?t.transformOutgoingScheme(e):e}})(pj||={});var mj;(function(e){function t(e){switch(e){case dT.Unnecessary:return Cm.Unnecessary;case dT.Deprecated:return Cm.Deprecated}}e.from=t;function n(e){switch(e){case Cm.Unnecessary:return dT.Unnecessary;case Cm.Deprecated:return dT.Deprecated;default:return}}e.to=n})(mj||={});var hj;(function(e){function t(e){let t;return e.code&&(t=et(e.code)||at(e.code)?String(e.code):{value:String(e.code.value),target:e.code.target}),{...J.from(e.range),message:e.message,source:e.source,code:t,severity:_j.from(e.severity),relatedInformation:e.relatedInformation&&e.relatedInformation.map(gj.from),tags:Array.isArray(e.tags)?Se(e.tags.map(mj.from)):void 0}}e.from=t;function n(e){let t=new mT(J.to(e),e.message,_j.to(e.severity));return t.source=e.source,t.code=et(e.code)?e.code:e.code?.value,t.relatedInformation=e.relatedInformation&&e.relatedInformation.map(gj.to),t.tags=e.tags&&Se(e.tags.map(mj.to)),t}e.to=n})(hj||={});var gj;(function(e){function t(e){return{...J.from(e.location.range),message:e.message,resource:e.location.uri}}e.from=t;function n(e){return new pT(new gT(e.resource,J.to(e)),e.message)}e.to=n})(gj||={});var _j;(function(e){function t(e){switch(e){case fT.Error:return wm.Error;case fT.Warning:return wm.Warning;case fT.Information:return wm.Info;case fT.Hint:return wm.Hint}return wm.Error}e.from=t;function n(e){switch(e){case wm.Info:return fT.Information;case wm.Warning:return fT.Warning;case wm.Error:return fT.Error;case wm.Hint:return fT.Hint;default:return fT.Error}}e.to=n})(_j||={});var vj;(function(e){function t(e){return typeof e==`number`&&e>=NE.One?e-1:e===NE.Beside?-2:-1}e.from=t;function n(e){if(typeof e==`number`&&e>=0)return e+1;throw Error(`invalid 'EditorGroupColumn'`)}e.to=n})(vj||={});function yj(e){return e.range!==void 0}function bj(e){return e.length===0?!0:!!yj(e[0])}var Y;(function(e){function t(t){return t.map(e.from)}e.fromMany=t;function n(e){return e&&typeof e==`object`&&typeof e.language==`string`&&typeof e.value==`string`}function r(e){let t;if(n(e)){let{language:n,value:r}=e;t={value:"```"+n+`
|
|
94
|
+
`+r+"\n```\n"}}else t=rT.isMarkdownString(e)?{value:e.value,isTrusted:e.isTrusted,supportThemeIcons:e.supportThemeIcons,supportHtml:e.supportHtml,supportAlertSyntax:e.supportAlertSyntax,baseUri:e.baseUri}:typeof e==`string`?{value:e}:{value:``};let r=Object.create(null);t.uris=r;let a=({href:e})=>{try{let t=C.parse(e,!0);t=t.with({query:i(t.query,r)}),r[e]=t}catch{}return``};return Wu.walkTokens(Wu.lexer(t.value),e=>{e.type===`link`?a({href:e.href}):e.type===`image`&&typeof e.href==`string`&&a(Dl(e.href))}),t}e.from=r;function i(e,t){if(!e)return e;let n;try{n=Ku(e)}catch{}if(!n)return e;let r=!1;return n=uc(n,e=>{if(C.isUri(e)){let n=`__uri_${Math.random().toString(16).slice(2,8)}`;return t[n]=e,r=!0,n}else return}),r?JSON.stringify(n):e}function a(e){let t=new rT(e.value,e.supportThemeIcons);return t.isTrusted=e.isTrusted,t.supportHtml=e.supportHtml,t.supportAlertSyntax=e.supportAlertSyntax,t.baseUri=e.baseUri?C.from(e.baseUri):void 0,t}e.to=a;function o(t){if(t)return typeof t==`string`?t:e.from(t)}e.fromStrict=o})(Y||={});function xj(e){return bj(e)?e.map(e=>({range:J.from(e.range),hoverMessage:Array.isArray(e.hoverMessage)?Y.fromMany(e.hoverMessage):e.hoverMessage?Y.from(e.hoverMessage):void 0,renderOptions:e.renderOptions})):e.map(e=>({range:J.from(e)}))}function Sj(e){return e===void 0?e:typeof e==`string`?C.file(e):e}var Cj;(function(e){function t(e){return e===void 0?e:{contentText:e.contentText,contentIconPath:e.contentIconPath?Sj(e.contentIconPath):void 0,border:e.border,borderColor:e.borderColor,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,color:e.color,backgroundColor:e.backgroundColor,margin:e.margin,width:e.width,height:e.height}}e.from=t})(Cj||={});var wj;(function(e){function t(e){return e===void 0?e:{backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?Sj(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?Cj.from(e.before):void 0,after:e.after?Cj.from(e.after):void 0}}e.from=t})(wj||={});var Tj;(function(e){function t(e){if(e===void 0)return e;switch(e){case HE.OpenOpen:return vm.AlwaysGrowsWhenTypingAtEdges;case HE.ClosedClosed:return vm.NeverGrowsWhenTypingAtEdges;case HE.OpenClosed:return vm.GrowsOnlyWhenTypingBefore;case HE.ClosedOpen:return vm.GrowsOnlyWhenTypingAfter}}e.from=t})(Tj||={});var Ej;(function(e){function t(e){return{isWholeLine:e.isWholeLine,rangeBehavior:e.rangeBehavior?Tj.from(e.rangeBehavior):void 0,overviewRulerLane:e.overviewRulerLane,light:e.light?wj.from(e.light):void 0,dark:e.dark?wj.from(e.dark):void 0,backgroundColor:e.backgroundColor,outline:e.outline,outlineColor:e.outlineColor,outlineStyle:e.outlineStyle,outlineWidth:e.outlineWidth,border:e.border,borderColor:e.borderColor,borderRadius:e.borderRadius,borderSpacing:e.borderSpacing,borderStyle:e.borderStyle,borderWidth:e.borderWidth,fontStyle:e.fontStyle,fontWeight:e.fontWeight,textDecoration:e.textDecoration,cursor:e.cursor,color:e.color,opacity:e.opacity,letterSpacing:e.letterSpacing,gutterIconPath:e.gutterIconPath?Sj(e.gutterIconPath):void 0,gutterIconSize:e.gutterIconSize,overviewRulerColor:e.overviewRulerColor,before:e.before?Cj.from(e.before):void 0,after:e.after?Cj.from(e.after):void 0}}e.from=t})(Ej||={});var Dj;(function(e){function t(e){return{text:e.newText,eol:e.newEol&&cM.from(e.newEol),range:J.from(e.range)}}e.from=t;function n(e){let t=new IT(J.to(e.range),e.text);return t.newEol=e.eol===void 0?void 0:cM.to(e.eol),t}e.to=n})(Dj||={});var Oj;(function(e){function t(e,t){let n={edits:[]};if(e instanceof zT){let r=new Ue;for(let t of e._allEntries())t._type===RT.File&&C.isUri(t.to)&&t.from===void 0&&r.add(t.to);for(let i of e._allEntries())if(i._type===RT.File){let e;i.options?.contents&&(e=ArrayBuffer.isView(i.options.contents)?{type:`base64`,value:Xt(y.wrap(i.options.contents))}:{type:`dataTransferItem`,id:i.options.contents._itemId}),n.edits.push({oldResource:i.from,newResource:i.to,options:{...i.options,contents:e},metadata:i.metadata})}else i._type===RT.Text?n.edits.push({resource:i.uri,textEdit:Dj.from(i.edit),versionId:r.has(i.uri)?void 0:t?.getTextDocumentVersion(i.uri),metadata:i.metadata}):i._type===RT.Snippet?n.edits.push({resource:i.uri,textEdit:{range:J.from(i.range),text:i.edit.value,insertAsSnippet:!0,keepWhitespace:i.keepWhitespace},versionId:r.has(i.uri)?void 0:t?.getTextDocumentVersion(i.uri),metadata:i.metadata}):i._type===RT.Cell?n.edits.push({metadata:i.metadata,resource:i.uri,cellEdit:i.edit,notebookVersionId:t?.getNotebookDocumentVersion(i.uri)}):i._type===RT.CellReplace&&n.edits.push({metadata:i.metadata,resource:i.uri,notebookVersionId:t?.getNotebookDocumentVersion(i.uri),cellEdit:{editType:fC.Replace,index:i.index,count:i.count,cells:i.cells.map(yM.from)}})}return n}e.from=t;function n(e){let t=new zT,n=new He;for(let r of e.edits)if(r.textEdit){let e=r,t=C.revive(e.resource),i=J.to(e.textEdit.range),a=e.textEdit.text,o=e.textEdit.insertAsSnippet,s;s=o?LT.replace(i,new kT(a)):IT.replace(i,a);let c=n.get(t);c?c.push(s):n.set(t,[s])}else t.renameFile(C.revive(r.oldResource),C.revive(r.newResource),r.options);for(let[e,r]of n)t.set(e,r);return t}e.to=n})(Oj||={});var kj;(function(e){let t=Object.create(null);t[jT.File]=V.File,t[jT.Module]=V.Module,t[jT.Namespace]=V.Namespace,t[jT.Package]=V.Package,t[jT.Class]=V.Class,t[jT.Method]=V.Method,t[jT.Property]=V.Property,t[jT.Field]=V.Field,t[jT.Constructor]=V.Constructor,t[jT.Enum]=V.Enum,t[jT.Interface]=V.Interface,t[jT.Function]=V.Function,t[jT.Variable]=V.Variable,t[jT.Constant]=V.Constant,t[jT.String]=V.String,t[jT.Number]=V.Number,t[jT.Boolean]=V.Boolean,t[jT.Array]=V.Array,t[jT.Object]=V.Object,t[jT.Key]=V.Key,t[jT.Null]=V.Null,t[jT.EnumMember]=V.EnumMember,t[jT.Struct]=V.Struct,t[jT.Event]=V.Event,t[jT.Operator]=V.Operator,t[jT.TypeParameter]=V.TypeParameter;function n(e){return typeof t[e]==`number`?t[e]:V.Property}e.from=n;function r(e){for(let n in t)if(t[n]===e)return Number(n);return jT.Property}e.to=r})(kj||={});var Aj;(function(e){function t(e){switch(e){case MT.Deprecated:return Yp.Deprecated}}e.from=t;function n(e){switch(e){case Yp.Deprecated:return MT.Deprecated}}e.to=n})(Aj||={});var jj;(function(e){function t(e){return{name:e.name,kind:kj.from(e.kind),tags:e.tags&&e.tags.map(Aj.from),containerName:e.containerName,location:Ij.from(e.location)}}e.from=t;function n(e){let t=new NT(e.name,kj.to(e.kind),e.containerName,Ij.to(e.location));return t.tags=e.tags&&e.tags.map(Aj.to),t}e.to=n})(jj||={});var Mj;(function(e){function t(e){let n={name:e.name||`!!MISSING: name!!`,detail:e.detail,range:J.from(e.range),selectionRange:J.from(e.selectionRange),kind:kj.from(e.kind),tags:e.tags?.map(Aj.from)??[]};return e.children&&(n.children=e.children.map(t)),n}e.from=t;function n(e){let t=new sE(e.name,e.detail,kj.to(e.kind),J.to(e.range),J.to(e.selectionRange));return Te(e.tags)&&(t.tags=e.tags.map(Aj.to)),e.children&&(t.children=e.children.map(n)),t}e.to=n})(Mj||={});var Nj;(function(e){function t(e){let t=new dE(kj.to(e.kind),e.name,e.detail||``,C.revive(e.uri),J.to(e.range),J.to(e.selectionRange));return t._sessionId=e._sessionId,t._itemId=e._itemId,t}e.to=t;function n(e,t,n){if(t??=e._sessionId,n??=e._itemId,t===void 0||n===void 0)throw Error(`invalid item`);return{_sessionId:t,_itemId:n,name:e.name,detail:e.detail,kind:kj.from(e.kind),uri:e.uri,range:J.from(e.range),selectionRange:J.from(e.selectionRange),tags:e.tags?.map(Aj.from)}}e.from=n})(Nj||={});var Pj;(function(e){function t(e){return new fE(Nj.to(e.from),e.fromRanges.map(e=>J.to(e)))}e.to=t})(Pj||={});var Fj;(function(e){function t(e){return new pE(Nj.to(e.to),e.fromRanges.map(e=>J.to(e)))}e.to=t})(Fj||={});var Ij;(function(e){function t(e){return{range:e.range&&J.from(e.range),uri:e.uri}}e.from=t;function n(e){return new gT(C.revive(e.uri),J.to(e.range))}e.to=n})(Ij||={});var Lj;(function(e){function t(e){let t=e,n=e;return{originSelectionRange:t.originSelectionRange?J.from(t.originSelectionRange):void 0,uri:t.targetUri?t.targetUri:n.uri,range:J.from(t.targetRange?t.targetRange:n.range),targetSelectionRange:t.targetSelectionRange?J.from(t.targetSelectionRange):void 0}}e.from=t;function n(e){return{targetUri:C.revive(e.uri),targetRange:J.to(e.range),targetSelectionRange:e.targetSelectionRange?J.to(e.targetSelectionRange):void 0,originSelectionRange:e.originSelectionRange?J.to(e.originSelectionRange):void 0}}e.to=n})(Lj||={});var Rj;(function(e){function t(e){return{range:J.from(e.range),contents:Y.fromMany(e.contents),canIncreaseVerbosity:e.canIncreaseVerbosity,canDecreaseVerbosity:e.canDecreaseVerbosity}}e.from=t;function n(e){let t=e.contents.map(Y.to),n=J.to(e.range),r=e.canIncreaseVerbosity,i=e.canDecreaseVerbosity;return new nE(t,n,r,i)}e.to=n})(Rj||={});var zj;(function(e){function t(e){return{range:J.from(e.range),expression:e.expression}}e.from=t;function n(e){return new YD(J.to(e.range),e.expression)}e.to=n})(zj||={});var Bj;(function(e){function t(e){if(e instanceof QD)return{type:`text`,range:J.from(e.range),text:e.text};if(e instanceof $D)return{type:`variable`,range:J.from(e.range),variableName:e.variableName,caseSensitiveLookup:e.caseSensitiveLookup};if(e instanceof eO)return{type:`expression`,range:J.from(e.range),expression:e.expression};throw Error(`Unknown 'InlineValue' type`)}e.from=t;function n(e){switch(e.type){case`text`:return{range:J.to(e.range),text:e.text};case`variable`:return{range:J.to(e.range),variableName:e.variableName,caseSensitiveLookup:e.caseSensitiveLookup};case`expression`:return{range:J.to(e.range),expression:e.expression}}}e.to=n})(Bj||={});var Vj;(function(e){function t(e){return{frameId:e.frameId,stoppedLocation:J.from(e.stoppedLocation)}}e.from=t;function n(e){return new tO(e.frameId,J.to(e.stoppedLocation))}e.to=n})(Vj||={});var Hj;(function(e){function t(e){return{range:J.from(e.range),kind:e.kind}}e.from=t;function n(e){return new aE(J.to(e.range),e.kind)}e.to=n})(Hj||={});var Uj;(function(e){function t(e){return{uri:e.uri,highlights:e.highlights.map(Hj.from)}}e.from=t;function n(e){return new oE(C.revive(e.uri),e.highlights.map(Hj.to))}e.to=n})(Uj||={});var Wj;(function(e){function t(e){switch(e){case zp.TriggerCharacter:return CE.TriggerCharacter;case zp.TriggerForIncompleteCompletions:return CE.TriggerForIncompleteCompletions;case zp.Invoke:default:return CE.Invoke}}e.to=t})(Wj||={});var Gj;(function(e){function t(e){return{triggerKind:Wj.to(e.triggerKind),triggerCharacter:e.triggerCharacter}}e.to=t})(Gj||={});var Kj;(function(e){function t(e){switch(e){case TE.Deprecated:return Ip.Deprecated}}e.from=t;function n(e){switch(e){case Ip.Deprecated:return TE.Deprecated}}e.to=n})(Kj||={});var qj;(function(e){function t(e,t,n){return`icon`in e&&`command`in e?{command:t.toInternal(e.command,n),icon:RN.fromThemeIcon(e.icon)}:{command:t.toInternal(e,n)}}e.from=t})(qj||={});var Jj;(function(e){let t=new Map([[wE.Method,B.Method],[wE.Function,B.Function],[wE.Constructor,B.Constructor],[wE.Field,B.Field],[wE.Variable,B.Variable],[wE.Class,B.Class],[wE.Interface,B.Interface],[wE.Struct,B.Struct],[wE.Module,B.Module],[wE.Property,B.Property],[wE.Unit,B.Unit],[wE.Value,B.Value],[wE.Constant,B.Constant],[wE.Enum,B.Enum],[wE.EnumMember,B.EnumMember],[wE.Keyword,B.Keyword],[wE.Snippet,B.Snippet],[wE.Text,B.Text],[wE.Color,B.Color],[wE.File,B.File],[wE.Reference,B.Reference],[wE.Folder,B.Folder],[wE.Event,B.Event],[wE.Operator,B.Operator],[wE.TypeParameter,B.TypeParameter],[wE.Issue,B.Issue],[wE.User,B.User]]);function n(e){return t.get(e)??B.Property}e.from=n;let r=new Map([[B.Method,wE.Method],[B.Function,wE.Function],[B.Constructor,wE.Constructor],[B.Field,wE.Field],[B.Variable,wE.Variable],[B.Class,wE.Class],[B.Interface,wE.Interface],[B.Struct,wE.Struct],[B.Module,wE.Module],[B.Property,wE.Property],[B.Unit,wE.Unit],[B.Value,wE.Value],[B.Constant,wE.Constant],[B.Enum,wE.Enum],[B.EnumMember,wE.EnumMember],[B.Keyword,wE.Keyword],[B.Snippet,wE.Snippet],[B.Text,wE.Text],[B.Color,wE.Color],[B.File,wE.File],[B.Reference,wE.Reference],[B.Folder,wE.Folder],[B.Event,wE.Event],[B.Operator,wE.Operator],[B.TypeParameter,wE.TypeParameter],[B.User,wE.User],[B.Issue,wE.Issue]]);function i(e){return r.get(e)??wE.Property}e.to=i})(Jj||={});var Yj;(function(e){function t(e,t){let n=new EE(e.label);return n.insertText=e.insertText,n.kind=Jj.to(e.kind),n.tags=e.tags?.map(Kj.to),n.detail=e.detail,n.documentation=wl(e.documentation)?Y.to(e.documentation):e.documentation,n.sortText=e.sortText,n.filterText=e.filterText,n.preselect=e.preselect,n.commitCharacters=e.commitCharacters,Ep.isIRange(e.range)?n.range=J.to(e.range):typeof e.range==`object`&&(n.range={inserting:J.to(e.range.insert),replacing:J.to(e.range.replace)}),n.keepWhitespace=e.insertTextRules===void 0?!1:!!(e.insertTextRules&Lp.KeepWhitespace),e.insertTextRules!==void 0&&e.insertTextRules&Lp.InsertAsSnippet?n.insertText=new kT(e.insertText):(n.insertText=e.insertText,n.textEdit=n.range instanceof sT?new IT(n.range,n.insertText):void 0),e.additionalTextEdits&&e.additionalTextEdits.length>0&&(n.additionalTextEdits=e.additionalTextEdits.map(e=>Dj.to(e))),n.command=t&&e.command?t.fromInternal(e.command):void 0,n}e.to=t})(Yj||={});var Xj;(function(e){function t(e){if(typeof e.label!=`string`&&!Array.isArray(e.label))throw TypeError(`Invalid label`);return{label:e.label,documentation:Y.fromStrict(e.documentation)}}e.from=t;function n(e){return{label:e.label,documentation:wl(e.documentation)?Y.to(e.documentation):e.documentation}}e.to=n})(Xj||={});var Zj;(function(e){function t(e){return{label:e.label,documentation:Y.fromStrict(e.documentation),parameters:Array.isArray(e.parameters)?e.parameters.map(Xj.from):[],activeParameter:e.activeParameter}}e.from=t;function n(e){return{label:e.label,documentation:wl(e.documentation)?Y.to(e.documentation):e.documentation,parameters:Array.isArray(e.parameters)?e.parameters.map(Xj.to):[],activeParameter:e.activeParameter}}e.to=n})(Zj||={});var Qj;(function(e){function t(e){return{activeSignature:e.activeSignature,activeParameter:e.activeParameter,signatures:Array.isArray(e.signatures)?e.signatures.map(Zj.from):[]}}e.from=t;function n(e){return{activeSignature:e.activeSignature,activeParameter:e.activeParameter,signatures:Array.isArray(e.signatures)?e.signatures.map(Zj.to):[]}}e.to=n})(Qj||={});var $j;(function(e){function t(e,t){let n=new SE(fj.to(t.position),typeof t.label==`string`?t.label:t.label.map(eM.to.bind(void 0,e)),t.kind&&tM.to(t.kind));return n.textEdits=t.textEdits&&t.textEdits.map(Dj.to),n.tooltip=wl(t.tooltip)?Y.to(t.tooltip):t.tooltip,n.paddingLeft=t.paddingLeft,n.paddingRight=t.paddingRight,n}e.to=t})($j||={});var eM;(function(e){function t(e,t){let n=new xE(t.label);return n.tooltip=wl(t.tooltip)?Y.to(t.tooltip):t.tooltip,em.is(t.command)&&(n.command=e.fromInternal(t.command)),t.location&&(n.location=Ij.to(t.location)),n}e.to=t})(eM||={});var tM;(function(e){function t(e){return e}e.from=t;function n(e){return e}e.to=n})(tM||={});var nM;(function(e){function t(e){return{range:J.from(e.range),url:e.target,tooltip:e.tooltip}}e.from=t;function n(e){let t;if(e.url)try{t=typeof e.url==`string`?C.parse(e.url,!0):C.revive(e.url)}catch{}let n=new WE(J.to(e.range),t);return n.tooltip=e.tooltip,n}e.to=n})(nM||={});var rM;(function(e){function t(e){let t=new qE(e.label);return e.textEdit&&(t.textEdit=Dj.to(e.textEdit)),e.additionalTextEdits&&(t.additionalTextEdits=e.additionalTextEdits.map(e=>Dj.to(e))),t}e.to=t;function n(e){return{label:e.label,textEdit:e.textEdit?Dj.from(e.textEdit):void 0,additionalTextEdits:e.additionalTextEdits?e.additionalTextEdits.map(e=>Dj.from(e)):void 0}}e.from=n})(rM||={});var iM;(function(e){function t(e){return new GE(e[0],e[1],e[2],e[3])}e.to=t;function n(e){return[e.red,e.green,e.blue,e.alpha]}e.from=n})(iM||={});var aM;(function(e){function t(e){return{range:J.from(e.range)}}e.from=t;function n(e){return new uE(J.to(e.range))}e.to=n})(aM||={});var oM;(function(e){function t(e){switch(e){case Km.AUTO:return LE.AfterDelay;case Km.EXPLICIT:return LE.Manual;case Km.FOCUS_CHANGE:case Km.WINDOW_CHANGE:return LE.FocusOut}}e.to=t})(oM||={});var sM;(function(e){function t(e){switch(e){case IE.Off:return rp.Off;case IE.Relative:return rp.Relative;case IE.Interval:return rp.Interval;case IE.On:default:return rp.On}}e.from=t;function n(e){switch(e){case rp.Off:return IE.Off;case rp.Relative:return IE.Relative;case rp.Interval:return IE.Interval;case rp.On:default:return IE.On}}e.to=n})(sM||={});var cM;(function(e){function t(e){if(e===FT.CRLF)return gm.CRLF;if(e===FT.LF)return gm.LF}e.from=t;function n(e){if(e===gm.CRLF)return FT.CRLF;if(e===gm.LF)return FT.LF}e.to=n})(cM||={});var lM;(function(e){function t(e){if(typeof e==`object`)return e.viewId;switch(e){case yD.SourceControl:return Dm.Scm;case yD.Window:return Dm.Window;case yD.Notification:return Dm.Notification}throw Error(`Unknown 'ProgressLocation'`)}e.from=t})(lM||={});var uM;(function(e){function t(e){let t={start:e.start+1,end:e.end+1};return e.kind&&(t.kind=dM.from(e.kind)),t}e.from=t;function n(e){let t={start:e.start-1,end:e.end-1};return e.kind&&(t.kind=dM.to(e.kind)),t}e.to=n})(uM||={});var dM;(function(e){function t(e){if(e)switch(e){case cO.Comment:return Zp.Comment;case cO.Imports:return Zp.Imports;case cO.Region:return Zp.Region}}e.from=t;function n(e){if(e)switch(e.value){case Zp.Comment.value:return cO.Comment;case Zp.Imports.value:return cO.Imports;case Zp.Region.value:return cO.Region}}e.to=n})(dM||={});var fM;(function(e){function t(e){if(e)return{pinned:typeof e.preview==`boolean`?!e.preview:void 0,inactive:e.background,preserveFocus:e.preserveFocus,selection:typeof e.selection==`object`?J.from(e.selection):void 0,override:typeof e.override==`boolean`?Rm.id:void 0}}e.from=t})(fM||={});var pM;(function(e){function t(e){return e instanceof ID?e.toJSON():typeof e==`string`?e:n(e)||r(e)?new ID(e.baseUri??e.base,e.pattern).toJSON():e}e.from=t;function n(e){let t=e;return t?C.isUri(t.baseUri)&&typeof t.pattern==`string`:!1}function r(e){let t=e;return t?typeof t.base==`string`&&typeof t.pattern==`string`:!1}function i(e){return typeof e==`string`?e:new ID(C.revive(e.baseUri),e.pattern)}e.to=i})(pM||={});var mM;(function(e){function t(e){if(e){if(Array.isArray(e))return e.map(t);if(typeof e==`string`)return e;{let t=e;return{language:t.language,scheme:t.scheme,pattern:pM.from(t.pattern)??void 0,exclusive:t.exclusive,notebookType:t.notebookType}}}}e.from=t})(mM||={});var hM;(function(e){function t(e){return{start:e.start,end:e.end}}e.from=t;function n(e){return new yT(e.start,e.end)}e.to=n})(hM||={});var gM;(function(e){function t(e){return{timing:typeof e.runStartTime==`number`&&typeof e.runEndTime==`number`?{startTime:e.runStartTime,endTime:e.runEndTime}:void 0,executionOrder:e.executionOrder,success:e.lastRunSuccess}}e.to=t;function n(e){return{lastRunSuccess:e.success,runStartTime:e.timing?.startTime,runEndTime:e.timing?.endTime,executionOrder:e.executionOrder}}e.from=n})(gM||={});var _M;(function(e){function t(e){switch(e){case vT.Markup:return iC.Markup;case vT.Code:default:return iC.Code}}e.from=t;function n(e){switch(e){case iC.Markup:return vT.Markup;case iC.Code:default:return vT.Code}}e.to=n})(_M||={});var vM;(function(e){function t(e){let t={metadata:e.metadata??Object.create(null),cells:[]};for(let n of e.cells)bT.validate(n),t.cells.push(yM.from(n));return t}e.from=t;function n(e){let t=new xT(e.cells.map(yM.to));return pt(e.metadata)||(t.metadata=e.metadata),t}e.to=n})(vM||={});var yM;(function(e){function t(e){return{cellKind:_M.from(e.kind),language:e.languageId,mime:e.mime,source:e.value,metadata:e.metadata,internalMetadata:gM.from(e.executionSummary??{}),outputs:e.outputs?e.outputs.map(xM.from):[]}}e.from=t;function n(e){return new bT(_M.to(e.cellKind),e.source,e.language,e.mime,e.outputs?e.outputs.map(xM.to):void 0,e.metadata,e.internalMetadata?gM.to(e.internalMetadata):void 0)}e.to=n})(yM||={});var bM;(function(e){function t(e){return{mime:e.mime,valueBytes:y.wrap(e.data)}}e.from=t;function n(e){return new CT(e.valueBytes.buffer,e.mime)}e.to=n})(bM||={});var xM;(function(e){function t(e){return{outputId:e.id,items:e.items.map(bM.from),metadata:e.metadata}}e.from=t;function n(e){return new wT(e.items.map(bM.to),e.outputId,e.metadata)}e.to=n})(xM||={});var SM;(function(e){function t(e){return r(e)?{include:pM.from(e.include)??void 0,exclude:pM.from(e.exclude)??void 0}:pM.from(e)??void 0}e.from=t;function n(e){return r(e)?{include:pM.to(e.include),exclude:pM.to(e.exclude)}:pM.to(e)}e.to=n;function r(e){let t=e;return t?!lt(t.include)&&!lt(t.exclude):!1}})(SM||={});var CM;(function(e){function t(e,t,n){let r=typeof e.command==`string`?{title:``,command:e.command}:e.command;return{alignment:e.alignment===NO.Left?_C.Left:_C.Right,command:t.toInternal(r,n),text:e.text,tooltip:e.tooltip,accessibilityInformation:e.accessibilityInformation,priority:e.priority}}e.from=t})(CM||={});var wM;(function(e){function t(e,t,n){let r=typeof e.command==`string`?{title:``,command:e.command}:e.command;return{command:t.toInternal(r,n),label:e.label,description:e.description,detail:e.detail,documentation:e.documentation}}e.from=t})(wM||={});var TM;(function(e){function t(e){return{transientOutputs:e?.transientOutputs??!1,transientCellMetadata:e?.transientCellMetadata??{},transientDocumentMetadata:e?.transientDocumentMetadata??{},cellContentMetadata:e?.cellContentMetadata??{}}}e.from=t})(TM||={});var EM;(function(e){function t(e){return{uri:e.uri,provides:e.provides}}e.from=t;function n(e){return new RO(C.revive(e.uri),e.provides)}e.to=n})(EM||={});var DM;(function(e){function t(e){return{message:Y.fromStrict(e.message)||``,type:zC.Error,expected:e.expectedOutput,actual:e.actualOutput,contextValue:e.contextValue,location:e.location&&{range:J.from(e.location.range),uri:e.location.uri},stackTrace:e.stackTrace?.map(e=>({label:e.label,position:e.position&&fj.from(e.position),uri:e.uri&&C.revive(e.uri).toJSON()}))}}e.from=t;function n(e){let t=new ZO(typeof e.message==`string`?e.message:Y.to(e.message));return t.actualOutput=e.actual,t.expectedOutput=e.expected,t.contextValue=e.contextValue,t.location=e.location?Ij.to(e.location):void 0,t}e.to=n})(DM||={});var OM;(function(e){e.namespace=GC,e.denamespace=KC})(OM||={});var kM;(function(e){function t(e){return{controllerId:e.controllerId,profileId:e.profileId,group:AM.from(e.kind)}}e.from=t})(kM||={});var AM;(function(e){let t={[JO.Coverage]:IC.Coverage,[JO.Debug]:IC.Debug,[JO.Run]:IC.Run};function n(e){return t.hasOwnProperty(e)?t[e]:IC.Run}e.from=n})(AM||={});var jM;(function(e){function t(e){let t=Gw(e).controllerId;return{extId:MC.fromExtHostTestItem(e,t).toString(),label:e.label,uri:C.revive(e.uri),busy:e.busy,tags:e.tags.map(e=>OM.namespace(t,e.id)),range:Ep.lift(J.from(e.range)),description:e.description||null,sortText:e.sortText||null,error:e.error&&Y.fromStrict(e.error)||null}}e.from=t;function n(e){return{parent:void 0,error:void 0,id:MC.fromString(e.extId).localId,label:e.label,uri:C.revive(e.uri),tags:(e.tags||[]).map(e=>{let{tagId:t}=OM.denamespace(e);return new QO(t)}),children:{add:()=>{},delete:()=>{},forEach:()=>{},*[Symbol.iterator](){},get:()=>void 0,replace:()=>{},size:0},range:J.to(e.range||void 0),canResolveChildren:!1,busy:e.busy,description:e.description||void 0,sortText:e.sortText||void 0}}e.toPlain=n})(jM||={}),(function(e){function t(e){return{id:e.id}}e.from=t;function n(e){return new QO(e.id)}e.to=n})(OM||={});var MM;(function(e){let t=(e,n)=>{let r=e.value;if(!r)return;let i={...jM.toPlain(r.item),parent:n,taskStates:r.tasks.map(e=>({state:e.state,duration:e.duration,messages:e.messages.filter(e=>e.type===zC.Error).map(DM.to)})),children:[]};if(e.children)for(let n of e.children.values()){let e=t(n,i);e&&i.children.push(e)}return i};function n(e){let n=new ed;for(let t of e.items)n.insert(MC.fromString(t.item.extId).path,t);let r=[n.nodes],i=[];for(;r.length;)for(let e of r.pop())e.value?i.push(e):e.children&&r.push(e.children.values());return{completedAt:e.completedAt,results:i.map(e=>t(e)).filter(ct)}}e.to=n})(MM||={});var NM;(function(e){function t(e){return{covered:e.covered,total:e.total}}function n(e){return`line`in e?fj.from(e):J.from(e)}function r(e){if(e)return`endLineNumber`in e?J.to(e):fj.to(e)}function i(e){if(e.type===rw.Statement){let t=[];if(e.branches)for(let n of e.branches)t.push({executed:n.count,location:r(n.location),label:n.label});return new rk(e.count,r(e.location),e.branches?.map(e=>new ik(e.count,r(e.location),e.label)))}else return new ak(e.name,e.count,r(e.location))}e.to=i;function a(e){if(typeof e.executed==`number`&&e.executed<0)throw Error(`Invalid coverage count ${e.executed}`);return`branches`in e?{count:e.executed,location:n(e.location),type:rw.Statement,branches:e.branches.length?e.branches.map(e=>({count:e.executed,location:e.location&&n(e.location),label:e.label})):void 0}:{type:rw.Declaration,name:e.name,count:e.executed,location:n(e.location)}}e.fromDetails=a;function o(e,n,r){return tk(r.statementCoverage),tk(r.branchCoverage),tk(r.declarationCoverage),{id:n,uri:r.uri,statement:t(r.statementCoverage),branch:r.branchCoverage&&t(r.branchCoverage),declaration:r.declarationCoverage&&t(r.declarationCoverage),testIds:r instanceof nk&&r.includesTests.length?r.includesTests.map(t=>MC.fromExtHostTestItem(t,e).toString()):void 0}}e.fromFile=o})(NM||={});var PM;(function(e){function t(e){switch(e){case Up.Invoke:return cE.Invoke;case Up.Auto:return cE.Automatic}}e.to=t})(PM||={});var FM;(function(e){function t(e){let t=new lk(kj.to(e.kind),e.name,e.detail||``,C.revive(e.uri),J.to(e.range),J.to(e.selectionRange));return t._sessionId=e._sessionId,t._itemId=e._itemId,t}e.to=t;function n(e,t,n){if(t??=e._sessionId,n??=e._itemId,t===void 0||n===void 0)throw Error(`invalid item`);return{_sessionId:t,_itemId:n,kind:kj.from(e.kind),name:e.name,detail:e.detail??``,uri:e.uri,range:J.from(e.range),selectionRange:J.from(e.selectionRange),tags:e.tags?.map(Aj.from)}}e.from=n})(FM||={});var IM;(function(e){function t(e){if(e)return{value:e.value,tooltip:e.tooltip}}e.from=t})(IM||={});var LM;(function(e){function t(e,t,n){let r=t.fileData;return r?new ED(new DD(r.name,C.revive(r.uri),r.id,Ye(()=>n(r.id)))):e===Yu.uriList&&t.uriListData?new TD(i(t.uriListData)):new TD(t.asString)}e.to=t;async function n(e,t,n=Gc()){let i=await t.asString();if(e===Yu.uriList)return{id:n,asString:i,fileData:void 0,uriListData:r(i)};let a=t.asFile();return{id:n,asString:i,fileData:a?{name:a.name,uri:a.uri,id:a._itemId??a.id}:void 0}}e.from=n;function r(e){return Kc.split(e).map(e=>{if(e.startsWith(`#`))return e;try{return C.parse(e)}catch{}return e})}function i(e){return Kc.create(e.map(e=>typeof e==`string`?e:C.revive(e)))}})(LM||={});var RM;(function(e){function t(e,t){return new OD(e.items.map(([e,n])=>[e,LM.to(e,n,t)]))}e.toDataTransfer=t;async function n(e){return{items:await Promise.all(Array.from(e,async([e,t])=>[e,await LM.from(e,t)]))}}e.from=n;async function r(e){return{items:await Promise.all(Array.from(e,async([e,t])=>[e,await LM.from(e,t,t.id)]))}}e.fromList=r})(RM||={});var zM;(function(e){function t(e,t){return{kind:`reply`,agentId:e.participant??t?.agentId??``,subCommand:e.command??t?.command,message:e.prompt,title:e.label}}e.from=t;function n(e){return{prompt:e.message,label:e.title,participant:e.agentId,command:e.subCommand}}e.to=n})(zM||={});var BM;(function(e){function t(e){switch(e){case Tx.System:return FA.System;case Tx.User:return FA.User;case Tx.Assistant:return FA.Assistant}}e.to=t;function n(e){switch(e){case FA.System:return Tx.System;case FA.User:return Tx.User;case FA.Assistant:return Tx.Assistant}return Tx.User}e.from=n})(BM||={});var VM;(function(e){function t(e){let t=e.content.map(e=>{if(e.type===`text`)return new UA(e.value,e.audience);if(e.type===`tool_result`){let t=Se(e.value.map(e=>{if(e.type===`text`)return new UA(e.value,e.audience);if(e.type===`data`)return new WA(e.data.buffer,e.mimeType);if(e.type===`prompt_tsx`)return new qA(e.value)}));return new IA(e.toolCallId,t,e.isError)}else if(e.type===`image_url`)return new WA(e.value.data.buffer,e.value.mimeType);else if(e.type===`data`)return new WA(e.data.buffer,e.mimeType);else if(e.type===`tool_use`)return new VA(e.toolCallId,e.name,e.parameters)}).filter(e=>e!==void 0);return new zA(BM.to(e.role),t,e.name)}e.to=t;function n(e){let t=BM.from(e.role),n=e.name,r=e.content;return typeof r==`string`&&(r=[new UA(r)]),{role:t,name:n,content:r.map(e=>{if(e instanceof IA)return{type:`tool_result`,toolCallId:e.callId,value:Se(e.content.map(e=>{if(e instanceof UA)return{type:`text`,value:e.value,audience:e.audience};if(e instanceof qA)return{type:`prompt_tsx`,value:e.value};if(e instanceof WA)return{type:`data`,mimeType:e.mimeType,data:y.wrap(e.data),audience:e.audience}})),isError:e.isError};if(e instanceof WA)return UM(e)?{type:`image_url`,value:{mimeType:e.mimeType,data:y.wrap(e.data)}}:{type:`data`,mimeType:e.mimeType,data:y.wrap(e.data),audience:e.audience};if(e instanceof VA)return{type:`tool_use`,toolCallId:e.callId,name:e.name,parameters:e.input};if(e instanceof UA)return{type:`text`,value:e.value};if(typeof e!=`string`)throw Error(`Unexpected chat message content type`);return{type:`text`,value:e}})}}e.from=n})(VM||={});var HM;(function(e){function t(e){let t=e.content.map(e=>{if(e.type===`text`)return new UA(e.value,e.audience);if(e.type===`tool_result`){let t=e.value.map(e=>e.type===`text`?new UA(e.value,e.audience):e.type===`data`?new WA(e.data.buffer,e.mimeType):new qA(e.value));return new IA(e.toolCallId,t,e.isError)}else if(e.type===`image_url`)return new WA(e.value.data.buffer,e.value.mimeType);else if(e.type===`data`)return new WA(e.data.buffer,e.mimeType);else if(e.type===`thinking`)return new KA(e.value,e.id,e.metadata);else return new VA(e.toolCallId,e.name,e.parameters)});return new BA(BM.to(e.role),t,e.name)}e.to=t;function n(e){let t=BM.from(e.role),n=e.name,r=e.content;return typeof r==`string`&&(r=[new UA(r)]),{role:t,name:n,content:r.map(e=>{if(e instanceof IA)return{type:`tool_result`,toolCallId:e.callId,value:Se(e.content.map(e=>{if(e instanceof UA)return{type:`text`,value:e.value,audience:e.audience};if(e instanceof qA)return{type:`prompt_tsx`,value:e.value};if(e instanceof WA)return{type:`data`,mimeType:e.mimeType,data:y.wrap(e.data),audience:e.audience}})),isError:e.isError};if(e instanceof WA)return UM(e)?{type:`image_url`,value:{mimeType:e.mimeType,data:y.wrap(e.data)}}:{type:`data`,mimeType:e.mimeType,data:y.wrap(e.data),audience:e.audience};if(e instanceof VA)return{type:`tool_use`,toolCallId:e.callId,name:e.name,parameters:e.input};if(e instanceof UA)return{type:`text`,value:e.value};if(e instanceof KA)return{type:`thinking`,value:e.value,id:e.id,metadata:e.metadata};if(typeof e!=`string`)throw Error(`Unexpected chat message content type llm 2`);return{type:`text`,value:e}})}}e.from=n})(HM||={});function UM(e){switch(typeof e.mimeType==`string`?e.mimeType.toLowerCase():``){case`image/png`:case`image/jpeg`:case`image/jpg`:case`image/gif`:case`image/webp`:case`image/bmp`:return!0;default:return!1}}var WM;(function(e){function t(e){return{kind:`markdownContent`,content:Y.from(e.value)}}e.from=t;function n(e){return new kk(Y.to(e.content))}e.to=n})(WM||={});var GM;(function(e){function t(e){return{kind:`codeblockUri`,uri:e.value,isEdit:e.isEdit,undoStopId:e.undoStopId}}e.from=t;function n(e){return new Kk(C.revive(e.uri),e.isEdit,e.undoStopId)}e.to=n})(GM||={});var KM;(function(e){function t(e){return{kind:`markdownVuln`,content:Y.from(e.value),vulnerabilities:e.vulnerabilities}}e.from=t;function n(e){return new Ak(Y.to(e.content),e.vulnerabilities)}e.to=n})(KM||={});var qM;(function(e){function t(e){return{kind:`confirmation`,title:e.title,message:Y.from(e.message),data:e.data,buttons:e.buttons}}e.from=t})(qM||={});var JM;(function(e){function t(e){switch(e){case Zk.Text:return`text`;case Zk.SingleSelect:return`singleSelect`;case Zk.MultiSelect:return`multiSelect`;default:return`text`}}function n(e){switch(e){case`text`:return Zk.Text;case`singleSelect`:return Zk.SingleSelect;case`multiSelect`:return Zk.MultiSelect;default:return Zk.Text}}function r(e){return{kind:`questionCarousel`,questions:e.questions.map(e=>({id:e.id,type:t(e.type),title:e.title,message:e.message?Y.from(e.message):void 0,options:e.options?.map(e=>({id:e.id,label:e.label,value:String(e.value)})),defaultValue:e.defaultValue,allowFreeformInput:e.allowFreeformInput})),allowSkip:e.allowSkip}}e.from=r;function i(e){return new $k(e.questions.map(e=>new Qk(e.id,n(e.type),e.title,{message:e.message?typeof e.message==`string`?new rT(e.message):Y.to(e.message):void 0,options:e.options?.map(e=>({id:e.id,label:e.label,value:e.value})),defaultValue:e.defaultValue,allowFreeformInput:e.allowFreeformInput})),e.allowSkip)}e.to=i})(JM||={});var YM;(function(e){function t(e){let{value:t,baseUri:n}=e;function r(e,t){return e.map(e=>{let n=C.joinPath(t,e.name);return{label:e.name,uri:n,children:e.children&&r(e.children,n)}})}return{kind:`treeData`,treeData:{label:so(n),uri:n,children:r(t,n)}}}e.from=t;function n(e){let t=Ju(e.treeData);function n(e){return e.map(e=>({name:e.label,children:e.children&&n(e.children)}))}let r=t.uri;return new Mk(t.children?n(t.children):[],r)}e.to=n})(YM||={});var XM;(function(e){function t(e){return{kind:`multiDiffData`,multiDiffData:{title:e.title,resources:e.value.map(e=>({originalUri:e.originalUri,modifiedUri:e.modifiedUri,goToFileUri:e.goToFileUri,added:e.added,removed:e.removed}))},readOnly:e.readOnly}}e.from=t;function n(e){return new Nk(e.multiDiffData.resources.map(e=>({originalUri:e.originalUri?C.revive(e.originalUri):void 0,modifiedUri:e.modifiedUri?C.revive(e.modifiedUri):void 0,goToFileUri:e.goToFileUri?C.revive(e.goToFileUri):void 0,added:e.added,removed:e.removed})),e.multiDiffData.title,e.readOnly)}e.to=n})(XM||={});var ZM;(function(e){function t(e){return{kind:`inlineReference`,name:e.title,inlineReference:(e=>C.isUri(e))(e.value)?e.value:(e=>`name`in e)(e.value)?jj.from(e.value):uj.from(e.value)}}e.from=t;function n(e){let t=Ju(e);return new Lk(C.isUri(t.inlineReference)?t.inlineReference:`location`in t.inlineReference?jj.to(t.inlineReference):uj.to(t.inlineReference),e.name)}e.to=n})(ZM||={});var QM;(function(e){function t(e){return{kind:`progressMessage`,content:Y.from(e.value)}}e.from=t;function n(e){return new Rk(e.content.value)}e.to=n})(QM||={});var $M;(function(e){function t(e){return{kind:`thinking`,value:e.value,id:e.id,metadata:e.metadata}}e.from=t;function n(e){return new Bk(e.value??``,e.id,e.metadata)}e.to=n})($M||={});var eN;(function(e){function t(e){return{kind:`hook`,hookType:e.hookType,stopReason:e.stopReason,systemMessage:e.systemMessage,metadata:e.metadata}}e.from=t;function n(e){return new Vk(e.hookType,e.stopReason,e.systemMessage,e.metadata)}e.to=n})(eN||={});var tN;(function(e){function t(e){return{kind:`warning`,content:Y.from(e.value)}}e.from=t;function n(e){return new Hk(e.content.value)}e.to=n})(tN||={});var nN;(function(e){function t(e){return{kind:`info`,content:Y.from(e.value)}}e.from=t;function n(e){return new Uk(e.content.value)}e.to=n})(nN||={});var rN;(function(e){function t(e){return{kind:`extensions`,extensions:e.extensions}}e.from=t})(rN||={});var iN;(function(e){function t(e,t,n){let r;if(e.command)r=t.toInternal(e.command,n);else{if(!e.uri)throw Error(`Pull request part must have a command if URI is provided`);r={title:`Open Pull Request`,id:`vscode.open`,arguments:[e.uri]}}return{kind:`pullRequest`,author:e.author,title:e.title,description:e.description,uri:e.uri,linkTag:e.linkTag,command:r}}e.from=t})(iN||={});var aN;(function(e){function t(e){return{kind:`move`,uri:e.uri,range:J.from(e.range)}}e.from=t;function n(e){return new Jk(C.revive(e.uri),J.to(e.range))}e.to=n})(aN||={});var oN;(function(e){function t(e){let t,a;e.toolSpecificData&&n(e.toolSpecificData)?(t=r(e.toolSpecificData,e.isError),a=void 0):a=e.toolSpecificData?i(e.toolSpecificData):void 0;let o=e.presentation===`hidden`?Lb.Hidden:e.presentation===`hiddenAfterComplete`?Lb.HiddenAfterComplete:void 0;return e.enablePartialUpdate?{kind:`externalToolInvocationUpdate`,toolCallId:e.toolCallId,toolName:e.toolName,isComplete:!!e.isComplete,invocationMessage:e.invocationMessage?Y.from(e.invocationMessage):void 0,pastTenseMessage:e.pastTenseMessage?Y.from(e.pastTenseMessage):void 0,toolSpecificData:a,subagentInvocationId:e.subAgentInvocationId,resultDetails:t}:{kind:`toolInvocationSerialized`,toolCallId:e.toolCallId,toolId:e.toolName,invocationMessage:e.invocationMessage?Y.from(e.invocationMessage):e.toolName,originMessage:e.originMessage?Y.from(e.originMessage):void 0,pastTenseMessage:e.pastTenseMessage?Y.from(e.pastTenseMessage):void 0,isConfirmed:e.isConfirmed,isComplete:!0,source:Fb.External,toolSpecificData:a,resultDetails:t,presentation:o,subAgentInvocationId:e.subAgentInvocationId}}e.from=t;function n(e){return typeof e==`object`&&!!e&&`input`in e&&typeof e.input==`string`&&`output`in e&&Array.isArray(e.output)}function r(e,t){return{input:e.input,output:e.output.map(e=>{let t=e.mimeType.startsWith(`text/`);return{type:`embed`,mimeType:e.mimeType,value:t?y.wrap(e.data).toString():Xt(y.wrap(e.data)),isText:t}}),isError:t??!1}}function i(e){return`command`in e&&`language`in e?{kind:`terminal`,command:e.command,language:e.language}:`commandLine`in e&&`language`in e?{kind:`terminal`,presentationOverrides:e.presentationOverrides&&typeof e.presentationOverrides.commandLine==`string`?{commandLine:e.presentationOverrides.commandLine,language:e.presentationOverrides.language}:void 0,commandLine:e.commandLine,language:e.language,terminalCommandOutput:typeof e.output?.text==`string`?{text:e.output.text}:void 0,terminalCommandState:e.state?{exitCode:e.state.exitCode,duration:e.state.duration}:void 0}:`todoList`in e&&Array.isArray(e.todoList)?{kind:`todoList`,todoList:e.todoList.map(e=>({id:String(e.id),title:e.title,status:a(e.status)}))}:`input`in e&&`output`in e&&!Array.isArray(e.output)?{kind:`simpleToolInvocation`,input:typeof e.input==`string`?e.input:``,output:typeof e.output==`string`?e.output:``}:e&&`values`in e&&Array.isArray(e.values)?{kind:`resources`,values:e.values.map(e=>e instanceof gT?uj.from(e):C.revive(e))}:e instanceof Fk?{kind:`subagent`,description:e.description,agentName:e.agentName,prompt:e.prompt,result:e.result}:e}function a(e){switch(e){case rA.NotStarted:return`not-started`;case rA.InProgress:return`in-progress`;case rA.Completed:return`completed`;default:return`not-started`}}function o(e){switch(e){case`not-started`:return rA.NotStarted;case`in-progress`:return rA.InProgress;case`completed`:return rA.Completed;default:return rA.NotStarted}}function s(e){let t=new aA(e.toolId||e.toolName,e.toolCallId,e.errorMessage);return e.invocationMessage&&(t.invocationMessage=e.invocationMessage),e.originMessage&&(t.originMessage=e.originMessage),e.pastTenseMessage&&(t.pastTenseMessage=e.pastTenseMessage),e.isConfirmed!==void 0&&(t.isConfirmed=e.isConfirmed),e.isComplete!==void 0&&(t.isComplete=e.isComplete),e.toolSpecificData&&(t.toolSpecificData=c(e.toolSpecificData)),t.subAgentInvocationId=e.subAgentInvocationId,t.subAgentName=e.subAgentName,t}e.to=s;function c(e){if(e.kind===`terminal`)if(e.commandLine){let t={commandLine:e.commandLine,language:e.language};return e.terminalCommandOutput&&(t.output={text:e.terminalCommandOutput.text,truncated:e.terminalCommandOutput.truncated,lineCount:e.terminalCommandOutput.lineCount}),e.terminalCommandState&&(t.state={exitCode:e.terminalCommandState.exitCode,duration:e.terminalCommandState.duration}),t}else return{command:e.command,language:e.language};else if(e.kind===`terminal2`)return{commandLine:e.commandLine,language:e.language};else if(e.kind===`todoList`)return{todoList:e.todoList.map((e,t)=>{let n=Number(e.id);return{id:Number.isFinite(n)?n:t,title:e.title,status:o(e.status)}})};return e}})(oN||={});var sN;(function(e){function t(e){return{kind:`progressTask`,content:Y.from(e.value)}}e.from=t})(sN||={});var cN;(function(e){function t(e){return{kind:`progressTaskResult`,content:typeof e==`string`?Y.from(e):void 0}}e.from=t})(cN||={});var lN;(function(e){function t(e,t,n){return{kind:`command`,command:t.toInternal(e.value,n)??{command:e.value.command,title:e.value.title}}}e.from=t;function n(e,t){return new Wk(t.fromInternal(e.command)??{command:e.command.id,title:e.command.title})}e.to=n})(lN||={});var uN;(function(e){function t(e){return{kind:`textEdit`,uri:e.uri,edits:e.edits.map(e=>Dj.from(e)),done:e.isDone}}e.from=t;function n(e){let t=new eA(C.revive(e.uri),e.edits.map(e=>Dj.to(e)));return t.isDone=e.done,t}e.to=n})(uN||={});var dN;(function(e){function t(e){return e.newCellMetadata?{editType:fC.Metadata,index:e.range.start,metadata:e.newCellMetadata}:e.newNotebookMetadata?{editType:fC.DocumentMetadata,metadata:e.newNotebookMetadata}:{editType:fC.Replace,index:e.range.start,count:e.range.end-e.range.start,cells:e.newCells.map(yM.from)}}e.from=t})(dN||={});var fN;(function(e){function t(e){return{kind:`notebookEdit`,uri:e.uri,edits:e.edits.map(dN.from),done:e.isDone}}e.from=t})(fN||={});var pN;(function(e){function t(e){return{kind:`workspaceEdit`,edits:e.edits.map(e=>({oldResource:e.oldResource,newResource:e.newResource}))}}e.from=t})(pN||={});var mN;(function(e){function t(e){let t=vl.isThemeIcon(e.iconPath)?e.iconPath:C.isUri(e.iconPath)?{light:C.revive(e.iconPath)}:e.iconPath&&`light`in e.iconPath&&`dark`in e.iconPath&&C.isUri(e.iconPath.light)&&C.isUri(e.iconPath.dark)?{light:C.revive(e.iconPath.light),dark:C.revive(e.iconPath.dark)}:void 0;return typeof e.value==`object`&&`variableName`in e.value?{kind:`reference`,reference:{variableName:e.value.variableName,value:C.isUri(e.value.value)||!e.value.value?e.value.value:uj.from(e.value.value)},iconPath:t,options:e.options}:{kind:`reference`,reference:C.isUri(e.value)||typeof e.value==`string`?e.value:uj.from(e.value),iconPath:t,options:e.options}}e.from=t;function n(e){let t=Ju(e),n=e=>C.isUri(e)?e:uj.to(e);return new Gk(typeof t.reference==`string`?t.reference:`variableName`in t.reference?{variableName:t.reference.variableName,value:t.reference.value&&n(t.reference.value)}:n(t.reference))}e.to=n})(mN||={});var hN;(function(e){function t(e){return{kind:`codeCitation`,value:e.value,license:e.license,snippet:e.snippet}}e.from=t})(hN||={});var gN;(function(e){function t(e,t,n){return e instanceof kk?WM.from(e):e instanceof Lk?ZM.from(e):e instanceof Gk?mN.from(e):e instanceof Rk?QM.from(e):e instanceof Bk?$M.from(e):e instanceof Vk?eN.from(e):e instanceof Mk?YM.from(e):e instanceof Nk?XM.from(e):e instanceof Wk?lN.from(e,t,n):e instanceof eA?uN.from(e):e instanceof tA?fN.from(e):e instanceof Ak?KM.from(e):e instanceof Kk?GM.from(e):e instanceof Hk?tN.from(e):e instanceof Uk?nN.from(e):e instanceof jk?qM.from(e):e instanceof $k?JM.from(e):e instanceof qk?hN.from(e):e instanceof Jk?aN.from(e):e instanceof Yk?rN.from(e):e instanceof Xk?iN.from(e,t,n):e instanceof aA?oN.from(e):e instanceof nA?pN.from(e):{kind:`markdownContent`,content:Y.from(``)}}e.from=t;function n(e,t){switch(e.kind){case`reference`:return mN.to(e);case`markdownContent`:case`inlineReference`:case`progressMessage`:case`treeData`:case`command`:return r(e,t)}}e.to=n;function r(e,t){switch(e.kind){case`markdownContent`:return WM.to(e);case`inlineReference`:return ZM.to(e);case`progressMessage`:return;case`treeData`:return YM.to(e);case`command`:return lN.to(e,t)}}e.toContent=r})(gN||={});var _N;(function(e){function t(e,t,n,r,i,a,o,s){let c=[],l=[];for(let t of e.variables.variables)t.kind===`tool`?c.push(t):t.kind===`toolset`?c.push(...t.value):l.push(t);let u=fh.parseLocalSessionId(e.sessionResource)??e.sessionResource.toString(),d={id:e.requestId,prompt:e.message,command:e.command,attempt:e.attempt??0,enableCommandDetection:e.enableCommandDetection??!0,isParticipantDetected:e.isParticipantDetected??!1,sessionId:u,sessionResource:e.sessionResource,references:l.map(e=>bN.to(e,i,s)).filter(ct),toolReferences:c.map(xN.to),location:vN.to(e.location),acceptedConfirmationData:e.acceptedConfirmationData,rejectedConfirmationData:e.rejectedConfirmationData,location2:t,toolInvocationToken:Object.freeze({sessionResource:e.sessionResource,workingDirectory:C.revive(e.workingDirectory)}),tools:a,model:n,modelConfiguration:r,editedFileEvents:e.editedFileEvents,modeInstructions:e.modeInstructions?.content,modeInstructions2:CN.to(e.modeInstructions),permissionLevel:e.permissionLevel,subAgentInvocationId:e.subAgentInvocationId,subAgentName:e.subAgentName,parentRequestId:e.parentRequestId,hasHooksEnabled:e.hasHooksEnabled??!1,hooks:e.hooks?HN.to(e.hooks):void 0,isSystemInitiated:e.isSystemInitiated};return Mw(o)||(delete d.id,delete d.attempt,delete d.enableCommandDetection,delete d.isParticipantDetected,delete d.location,delete d.location2,delete d.editedFileEvents,delete d.sessionId,delete d.subAgentInvocationId,delete d.subAgentName,delete d.parentRequestId,delete d.hasHooksEnabled,delete d.hooks),Mw(o)||(delete d.acceptedConfirmationData,delete d.rejectedConfirmationData,delete d.tools),d}e.to=t})(_N||={});var vN;(function(e){function t(e){switch(e){case xy.Notebook:return lA.Notebook;case xy.Terminal:return lA.Terminal;case xy.Chat:return lA.Panel;case xy.EditorInline:return lA.Editor}}e.to=t;function n(e){switch(e){case lA.Notebook:return xy.Notebook;case lA.Terminal:return xy.Terminal;case lA.Panel:return xy.Chat;case lA.Editor:return xy.EditorInline}}e.from=n})(vN||={});var yN;(function(e){function t(e){return e.id}e.from=t})(yN||={});var bN;(function(e){function t(e,t,n){let r=e.value;if(!r){let t;try{t=JSON.stringify(e)}catch{t=`kind=${e.kind}, id=${e.id}, name=${e.name}`}n.error(`[ChatPromptReference] Ignoring invalid reference in variable: ${t}`);return}if(li(r))r=C.revive(r);else if(r&&typeof r==`object`&&`uri`in r&&`range`in r&&li(r.uri))r=uj.to(Ju(r));else if(vh(e)){let t=e.references?.[0]?.reference;r=new NA(e.mimeType??`image/png`,()=>Promise.resolve(new Uint8Array(Object.values(e.value))),t&&C.isUri(t)?t:void 0)}else if(e.kind===`diagnostic`){let n=e.filterSeverity&&_j.to(e.filterSeverity),i=e.filterUri&&C.revive(e.filterUri).toString();r=new PA(t.map(([t,r])=>e.filterUri&&t.toString()!==i?[t,[]]:[t,r.filter(t=>!(n&&t.severity>n||e.filterRange&&!Ep.areIntersectingOrTouching(e.filterRange,J.from(t.range))))]).filter(([,e])=>e.length>0))}let i;return(yh(e)||bh(e))&&e.toolReferences&&(i=SN.to(e.toolReferences)),{id:e.id,name:e.name,range:e.range&&[e.range.start,e.range.endExclusive],toolReferences:i,value:r,modelDescription:e.modelDescription}}e.to=t})(bN||={});var xN;(function(e){function t(e){if(e.value)throw Error(`Invalid tool reference`);return{name:e.id,range:e.range&&[e.range.start,e.range.endExclusive]}}e.to=t})(xN||={});var SN;(function(e){function t(e){let t=[];for(let n of e)if(n.kind===`tool`)t.push(xN.to(n));else if(n.kind===`toolset`)t.push(...n.value.map(xN.to));else throw Error(`Invalid tool reference in prompt variables`);return t}e.to=t})(SN||={});var CN;(function(e){function t(e){if(e)return{uri:C.revive(e.uri),name:e.name,content:e.content,toolReferences:SN.to(Ju(e.toolReferences)),metadata:e.metadata,isBuiltin:e.isBuiltin}}e.to=t;function n(e){if(e)return{uri:e.uri,name:e.name,content:e.content,toolReferences:e.toolReferences?.map(e=>({kind:`tool`,id:e.name,name:e.name,value:void 0,range:e.range?{start:e.range[0],endExclusive:e.range[1]}:void 0}))??[],metadata:e.metadata,isBuiltin:e.isBuiltin}}e.from=n})(CN||={});var wN;(function(e){function t(e,t,n){return{id:e.id,label:e.label,fullName:e.fullName,icon:e.icon?.id,value:e.values[0].value,insertText:e.insertText,detail:e.detail,documentation:e.documentation,command:t.toInternal(e.command,n)}}e.from=t})(wN||={});var TN;(function(e){function t(e){return{errorDetails:e.errorDetails,metadata:r(e.metadata),nextQuestion:e.nextQuestion,details:e.details}}e.to=t;function n(e){return{errorDetails:e.errorDetails,metadata:e.metadata,nextQuestion:e.nextQuestion,details:e.details}}e.from=n;function r(e){return uc(e,e=>{if(e.$mid===Mr.LanguageModelToolResult)return new YA(uc(e.content,r));if(e.$mid===Mr.LanguageModelTextPart)return new UA(e.value);if(e.$mid===Mr.LanguageModelThinkingPart)return new KA(e.value,e.id,e.metadata);if(e.$mid===Mr.LanguageModelPromptTsxPart)return new qA(e.value);if(e.$mid===Mr.LanguageModelDataPart){let t;if(e.data&&typeof e.data==`object`&&e.data.type===`Buffer`&&Array.isArray(e.data.data))t=new Uint8Array(e.data.data);else if(typeof e.data==`string`)try{t=Yt(e.data).buffer}catch{t=new Uint8Array}else t=new Uint8Array;return new WA(t,e.mimeType,e.audience)}})}})(TN||={});var EN;(function(e){function t(e,t,n){if(t.action.kind===`vote`)return;let r=TN.to(e);if(t.action.kind===`command`){let e=t.action.commandButton.command;return{action:{kind:`command`,commandButton:{command:n.fromInternal(e)??{command:e.id,title:e.title}}},result:r}}else if(t.action.kind===`followUp`)return{action:{kind:`followUp`,followup:zM.to(t.action.followup)},result:r};else if(t.action.kind===`inlineChat`)return{action:{kind:`editor`,accepted:t.action.action===`accepted`},result:r};else if(t.action.kind===`chatEditingSessionAction`)return{action:{kind:`chatEditingSessionAction`,outcome:new Map([[`accepted`,Tk.Accepted],[`rejected`,Tk.Rejected],[`saved`,Tk.Saved]]).get(t.action.outcome)??Tk.Rejected,uri:C.revive(t.action.uri),hasRemainingEdits:t.action.hasRemainingEdits},result:r};else if(t.action.kind===`chatEditingHunkAction`)return{action:{kind:`chatEditingHunkAction`,outcome:new Map([[`accepted`,Tk.Accepted],[`rejected`,Tk.Rejected]]).get(t.action.outcome)??Tk.Rejected,uri:C.revive(t.action.uri),hasRemainingEdits:t.action.hasRemainingEdits,lineCount:t.action.lineCount,linesAdded:t.action.linesAdded,linesRemoved:t.action.linesRemoved},result:r};else return{action:t.action,result:r}}e.to=t})(EN||={});var DN;(function(e){function t(e,t,n){return`terminalCommand`in e?{terminalCommand:e.terminalCommand,shouldExecute:e.shouldExecute}:`uri`in e?{uri:e.uri}:t.toInternal(e,n)}e.from=t})(DN||={});var ON;(function(e){function t(e){return{...e,documentation:Y.fromStrict(e.documentation)}}e.from=t})(ON||={});var kN;(function(e){function t(e,t){return Array.isArray(e)?{items:e.map(e=>ON.from(e))}:{items:e.items.map(e=>ON.from(e)),resourceOptions:e.resourceOptions?AN.from(e.resourceOptions,t):void 0}}e.from=t})(kN||={});var AN;(function(e){function t(e,t){return{...e,pathSeparator:t,cwd:e.cwd,globPattern:pM.from(e.globPattern)??void 0}}e.from=t})(AN||={});var jN;(function(e){function t(e){return{kind:MN.to(e.kind),acceptedLength:e.acceptedLength}}e.to=t})(jN||={});var MN;(function(e){function t(e){switch(e){case Rp.Word:return AE.Word;case Rp.Line:return AE.Line;case Rp.Suggest:return AE.Suggest;default:return AE.Unknown}}e.to=t})(MN||={});var NN;(function(e){function t(e,t){if(e.kind===Hp.Ignored){let n=e.supersededBy?t(e.supersededBy):void 0;return{kind:jE.Ignored,supersededBy:n,userTypingDisagreed:e.userTypingDisagreed}}else if(e.kind===Hp.Accepted)return{kind:jE.Accepted};return{kind:jE.Rejected}}e.to=t})(NN||={});var PN;(function(e){function t(e){return e===ME.Label?Vp.Label:Vp.Code}e.from=t;function n(e){switch(e){case Vp.Label:return ME.Label;default:return ME.Code}}e.to=n})(PN||={});var FN;(function(e){function t(e,t){return{id:t,label:e.label,description:e.description,canEdit:e.canEdit,collapsibleState:e.collapsibleState||Kx.None,contextValue:e.contextValue}}e.from=t})(FN||={});var IN;(function(e){function t(e){if(e.type===`mcp`)return new ej(e.label,e.serverLabel||e.label,e.instructions);if(e.type===`extension`)return new $A(e.extensionId.value,e.label)}e.to=t})(IN||={});var LN;(function(e){function t(e){let t=new YA(e.content.map(e=>e.kind===`text`?new UA(e.value,e.audience):e.kind===`data`?new WA(e.value.data.buffer,e.value.mimeType,e.audience):new qA(e.value)));return e.toolMetadata!==void 0&&(t.toolMetadata=e.toolMetadata),e.toolResultError&&(t.hasError=!!e.toolResultError),t}e.to=t;function n(e,t){e.toolResultMessage&&K(t,`chatParticipantPrivate`);let n=e=>{e.audience&&K(t,`languageModelToolResultAudience`)},r=!1,i;Array.isArray(e.toolResultDetails)?i=e.toolResultDetails?.map(e=>C.isUri(e)?e:uj.from(e)):e.toolResultDetails2&&(i={output:{type:`data`,mimeType:e.toolResultDetails2.mime,value:y.wrap(e.toolResultDetails2.value)}},r=!0);let a={content:e.content.map(e=>{if(e instanceof UA)return n(e),{kind:`text`,value:e.value,audience:e.audience};if(e instanceof qA)return{kind:`promptTsx`,value:e.value};if(e instanceof WA)return n(e),r=!0,{kind:`data`,value:{mimeType:e.mimeType,data:y.wrap(e.data)},audience:e.audience};throw Error(`Unknown LanguageModelToolResult part type`)}),toolResultMessage:Y.fromStrict(e.toolResultMessage),toolResultDetails:i,toolMetadata:e.toolMetadata,toolResultError:e.hasError};return r?new Ci(a):a}e.from=n})(LN||={});var RN;(function(e){function t(e){return e}e.fromThemeIcon=t;function n(e){if(e){if(vl.isThemeIcon(e)||C.isUri(e))return e;if(typeof e==`string`)return C.file(e);if(typeof e==`object`&&e&&`dark`in e){let t=typeof e.dark==`string`?C.file(e.dark):e.dark,n=typeof e.light==`string`?C.file(e.light):e.light;return t?{dark:t,light:n??t}:void 0}else return}}e.from=n;function r(e){if(e){if(vl.isThemeIcon(e))return e;if(li(e))return C.revive(e);{let t=e;return{light:C.revive(t.light),dark:C.revive(t.dark)}}}}e.to=r})(RN||={});var zN;(function(e){function t(e){return{query:e.query,kind:n(e.kind),settings:e.settings}}e.fromSettingsSearchResult=t;function n(e){switch(e){case dw.EMBEDDED:return dw.EMBEDDED;case dw.LLM_RANKED:return dw.LLM_RANKED;case dw.CANCELED:return dw.CANCELED;default:throw Error(`Unknown AiSettingsSearchResultKind`)}}})(zN||={});var BN;(function(e){function t(e){return!!e.uri}function n(e){return dS.toSerialized(t(e)?{type:uS.HTTP,uri:e.uri,headers:Object.entries(e.headers),authentication:e.authentication?{providerId:e.authentication.providerId,scopes:e.authentication.scopes}:void 0}:{type:uS.Stdio,cwd:e.cwd?.fsPath,args:e.args,command:e.command,env:e.env,envFile:void 0,sandbox:void 0})}e.from=n;function r(e){let t=dS.fromSerialized(e.launch);if(t.type===uS.HTTP)return new cj(e.label,t.uri,Object.fromEntries(t.headers),e.cacheNonce===`$$NONE`?void 0:e.cacheNonce);{let n=new sj(e.label,t.command,[...t.args],Object.fromEntries(Object.entries(t.env).map(([e,t])=>[e,t===null?null:String(t)])),e.cacheNonce===`$$NONE`?void 0:e.cacheNonce);return t.cwd&&(n.cwd=C.file(t.cwd)),n}}e.to=r})(BN||={});var VN;(function(e){function t(e){switch(e){case YE.Error:return EC.Error;case YE.Warning:return EC.Warning;case YE.Information:return EC.Information;default:throw Error(`Unknown SourceControlInputBoxValidationType`)}}e.from=t})(VN||={});var HN;(function(e){function t(e){let t={};for(let[n,r]of Object.entries(e)){if(!r||r.length===0)continue;let e=[];for(let t of r){let n=UN.to(t);n&&e.push(n)}e.length>0&&(t[n]=e)}return t}e.to=t})(HN||={});var UN;(function(e){function t(e){let t=Mb(e,Vn);if(t)return{command:t,cwd:e.cwd,env:e.env,timeout:e.timeout}}e.to=t})(UN||={});var WN;(function(e){function t(e){if(e!==void 0)switch(e){case 0:return ch.Failed;case 1:return ch.Completed;case 2:return ch.InProgress;case 3:return ch.NeedsInput;default:return}}function n(e){let n=e.timing,r=n?.created??n?.startTime??0,i=n?.lastRequestStarted??n?.startTime,a=n?.lastRequestEnded??n?.endTime;return{resource:e.resource,label:e.label,description:e.description?Y.from(e.description):void 0,badge:e.badge?Y.from(e.badge):void 0,status:t(e.status),archived:e.archived,tooltip:Y.fromStrict(e.tooltip),timing:{created:r,lastRequestStarted:i,lastRequestEnded:a},changes:e.changes instanceof Array?e.changes:void 0,metadata:e.metadata,legacyResource:e.legacyResource}}e.from=n})(WN||={});var GN=class{constructor(e,t,n){this.uri=e,this.ranges=t,this.previewText=n}},KN=class{constructor(e,t,n){this.uri=e,this.text=t,this.lineNumber=n}},qN=class{constructor(e){this.keyword=e}},JN;(function(e){e[e.None=1]=`None`,e[e.FilesExclude=2]=`FilesExclude`,e[e.SearchAndFilesExclude=3]=`SearchAndFilesExclude`})(JN||={});var YN;(function(e){e[e.Information=1]=`Information`,e[e.Warning=2]=`Warning`})(YN||={});var XN;(function(e){e[e.file=0]=`file`,e[e.text=1]=`text`,e[e.aiText=2]=`aiText`})(XN||={});var ZN;(function(e){e[e.File=1]=`File`,e[e.Text=2]=`Text`,e[e.aiText=3]=`aiText`})(ZN||={});function QN(e){return!!e.rangeLocations&&!!e.previewText}var $N;(function(e){e[e.Normal=0]=`Normal`,e[e.NewSearchStarted=1]=`NewSearchStarted`})($N||={});var eP=class{constructor(e,t,n,r){this.rangeLocations=[],this.webviewIndex=r;let i=Array.isArray(t)?t:[t];if(n&&n.matchLines===1&&tP(i)){e=Ia(e,n.matchLines);let t=``,r=0,a=0,o=Math.floor(n.charsPerLine/5);for(let s of i){let i=Math.max(s.startColumn-o,0),c=s.startColumn+n.charsPerLine;if(i>a+o+56){let n=`⟪ `+(i-a)+` characters skipped ⟫`;t+=n+e.slice(i,c),r+=i-(a+n.length)}else t+=e.slice(a,c);a=c,this.rangeLocations.push({source:s,preview:new rP(0,s.startColumn-r,s.endColumn-r)})}this.previewText=t}else{let n=Array.isArray(t)?t[0].startLineNumber:t.startLineNumber,r=Oe(t,e=>({preview:new nP(e.startLineNumber-n,e.startColumn,e.endLineNumber-n,e.endColumn),source:e}));this.rangeLocations=Array.isArray(r)?r:[r],this.previewText=e}}};function tP(e){let t=e[0].startLineNumber;for(let n of e)if(n.startLineNumber!==t||n.endLineNumber!==t)return!1;return!0}var nP=class{constructor(e,t,n,r){this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=r}},rP=class extends nP{constructor(e,t,n){super(e,t,e,n)}},iP;(function(e){e.List=`list`,e.Tree=`tree`})(iP||={});var aP;(function(e){e.Default=`default`,e.FileNames=`fileNames`,e.Type=`type`,e.Modified=`modified`,e.CountDescending=`countDescending`,e.CountAscending=`countAscending`})(aP||={});var oP;(function(e){e.Auto=`auto`,e.Manual=`manual`,e.RunOnEmpty=`runOnEmpty`})(oP||={});function sP(e,t=!0){let n=e&&e.files&&e.files.exclude,r=t&&e&&e.search&&e.search.exclude;if(!n&&!r)return;if(!n||!r)return n||r||void 0;let i=Object.create(null);return i=fc(i,sc(n)),i=fc(i,sc(r),!0),i}function cP(e,t){let n=e.ignoreGlobCase?{ignoreCase:!0}:void 0;return e.excludePattern&&GS(e.excludePattern,t,n)?!1:e.includePattern||e.usingSearchPaths?e.includePattern&&GS(e.includePattern,t,n)?!0:e.usingSearchPaths?!!e.folderQueries&&e.folderQueries.some(r=>{let i=r.folder.fsPath;if(Ka(t,i,e.ignoreGlobCase)){let e=Xr(i,t);return!r.includePattern||!!GS(r.includePattern,e,n)}else return!1}):!1:!0}var lP;(function(e){e[e.unknownEncoding=1]=`unknownEncoding`,e[e.regexParseError=2]=`regexParseError`,e[e.globParseError=3]=`globParseError`,e[e.invalidLiteral=4]=`invalidLiteral`,e[e.rgProcessError=5]=`rgProcessError`,e[e.other=6]=`other`,e[e.canceled=7]=`canceled`})(lP||={});function uP(e,t){let n={...e||{},...t||{}};return Object.keys(n).filter(e=>{let t=n[e];return typeof t==`boolean`&&t})}var dP=class{constructor(e,t){this._parsedIncludeExpression=null;let n=e.ignoreGlobCase||t.ignoreGlobCase?{ignoreCase:!0}:void 0;this._excludeExpression=t.excludePattern?.map(t=>({...e.excludePattern||{},...t.pattern||{}}))??[],this._excludeExpression.length===0&&(this._excludeExpression=[e.excludePattern||{}]),this._parsedExcludeExpression=this._excludeExpression.map(e=>KS(e,n));let r=e.includePattern;t.includePattern&&(r=r?{...r,...t.includePattern}:t.includePattern),r&&(this._parsedIncludeExpression=KS(r,n))}_evalParsedExcludeExpression(e,t,n){let r=null;for(let i of this._parsedExcludeExpression){let a=i(e,t,n);if(typeof a==`string`){r=a;break}}return r}matchesExcludesSync(e,t,n){return!!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,n))}includedInQuerySync(e,t,n){return!(this._parsedExcludeExpression&&this._evalParsedExcludeExpression(e,t,n)||this._parsedIncludeExpression&&!this._parsedIncludeExpression(e,t,n))}includedInQuery(e,t,n){let r=()=>this._parsedIncludeExpression?!!this._parsedIncludeExpression(e,t,n):!0;return Promise.all(this._parsedExcludeExpression.map(i=>{let a=i(e,t,n);return vo(a)?a.then(e=>e?!1:r()):r()})).then(e=>e.some(e=>!!e))}hasSiblingExcludeClauses(){return this._excludeExpression.reduce((e,t)=>fP(t)||e,!1)}};function fP(e){for(let t in e)if(typeof e[t]!=`boolean`)return!0;return!1}function pP(e){if(!e)return;let t;return n=>(t||=(e()||Promise.resolve([])).then(e=>e?hP(e):{}),t.then(e=>!!e[n]))}function mP(e){if(!e)return;let t;return n=>{if(!t){let n=e();t=n?hP(n):{}}return!!t[n]}}function hP(e){let t={};for(let n of e)t[n]=!0;return t}function gP(e){return e.flatMap(e=>e.patterns.map(t=>e.baseUri?{baseUri:e.baseUri,pattern:t}:t))}const _P={matchLines:100,charsPerLine:1e4},vP=`utf8`,yP=`utf8bom`,bP=`utf16be`,xP=`utf16le`,SP=[254,255],CP=[255,254],wP=[239,187,191];var TP;(function(e){e[e.STREAM_IS_BINARY=1]=`STREAM_IS_BINARY`})(TP||={});var EP=class extends Error{constructor(e,t){super(e),this.decodeStreamErrorKind=t}},DP=class e{static async create(t){let n;if(t!==`utf8`)n=(await import(`./iconv-lite-umd-Jn9RTrsv.js`).then(e=>c(e.default,1))).getDecoder(AP(t));else{let e=new TextDecoder;n={write(t){return e.decode(t,{stream:!0})},end(){return e.decode()}}}return new e(n)}constructor(e){this.iconvLiteDecoder=e}write(e){return this.iconvLiteDecoder.write(e)}end(){return this.iconvLiteDecoder.end()}};function OP(e,t){let n=t.minBytesRequiredForDetection??(t.guessEncoding?4096:512);return new Promise((r,i)=>{let a=Dt(e=>e.join(``)),o=[],s=0,c,l=new Hi,u=async()=>{try{let e=await zP({buffer:y.concat(o),bytesRead:s},t.guessEncoding,t.candidateGuessEncodings);if(e.seemsBinary&&t.acceptTextOnly)throw new EP(`Stream is binary but only text is accepted for decoding`,TP.STREAM_IS_BINARY);e.encoding=await t.overwriteEncoding(e.encoding),c=await DP.create(e.encoding);let n=c.write(y.concat(o).buffer);a.write(n),o.length=0,s=0,r({stream:a,detected:e})}catch(e){l.cancel(),a.destroy(),i(e)}};jt(e,{onData:async t=>{c?a.write(c.write(t.buffer)):(o.push(t),s+=t.byteLength,s>=n&&(e.pause(),await u(),setTimeout(()=>e.resume())))},onError:e=>a.error(e),onEnd:async()=>{c||await u(),a.end(c?.end())}},l.token)})}async function kP(e,t,n){let r=(await import(`./iconv-lite-umd-Jn9RTrsv.js`).then(e=>c(e.default,1))).getEncoder(AP(t),n),i=!1,a=!1;return{read(){if(a)return null;let o=e.read();if(typeof o!=`string`){if(a=!0,!i&&n?.addBOM)switch(t){case vP:case yP:return y.wrap(Uint8Array.from(wP));case bP:return y.wrap(Uint8Array.from(SP));case xP:return y.wrap(Uint8Array.from(CP))}let e=r.end();return e&&e.length>0?(i=!0,y.wrap(e)):null}return i=!0,y.wrap(r.write(o))}}}function AP(e){return e===`utf8bom`||e===null?vP:e}function jP(e,t){if(!e||t<SP.length)return null;let n=e.readUInt8(0),r=e.readUInt8(1);if(n===SP[0]&&r===SP[1])return bP;if(n===CP[0]&&r===CP[1])return xP;if(t<wP.length)return null;let i=e.readUInt8(2);return n===wP[0]&&r===wP[1]&&i===wP[2]?yP:null}const MP=[`ascii`,`utf-16`,`utf-32`];async function NP(e,t){let n=await import(`./jschardet-CjCVc2Gw.js`).then(e=>c(e.default,1)),r=RP(e.slice(0,65536).buffer);t&&(t=Se(t.map(e=>LP(e))),t.length===0&&(t=void 0));let i;try{i=n.detect(r,t?{detectEncodings:t}:void 0)}catch{return null}if(!i?.encoding)return null;let a=i.encoding.toLowerCase();return 0<=MP.indexOf(a)?null:IP(i.encoding)}const PP={ibm866:`cp866`,big5:`cp950`};function FP(e){return e.replace(/[^a-zA-Z0-9]/g,``).toLowerCase()}function IP(e){let t=FP(e);return PP[t]||t}function LP(e){let t=VP[FP(e)];return t?t.guessableName:void 0}function RP(e){let t=``;for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function zP({buffer:e,bytesRead:t},n,r){let i=jP(e,t),a=!1;if(i!==`utf16be`&&i!==`utf16le`&&e){let n=!0,r=!0,o=!1;for(let i=0;i<t&&i<512;i++){let t=i%2==1,a=e.readUInt8(i)===0;if(a&&(o=!0),n&&(t&&!a||!t&&a)&&(n=!1),r&&(t&&a||!t&&!a)&&(r=!1),a&&!n&&!r)break}o&&(n?i=xP:r?i=bP:a=!0)}return n&&!a&&!i&&e?NP(e.slice(0,t),r).then(e=>({seemsBinary:!1,encoding:e})):{seemsBinary:a,encoding:i}}const BP={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},cp857:{labelLong:`Turkish (CP 857)`,labelShort:`CP 857`,order:34},windows1258:{labelLong:`Vietnamese (Windows 1258)`,labelShort:`Windows 1258`,order:35},gbk:{labelLong:`Simplified Chinese (GBK)`,labelShort:`GBK`,order:36},gb18030:{labelLong:`Simplified Chinese (GB18030)`,labelShort:`GB18030`,order:37},cp950:{labelLong:`Traditional Chinese (Big5)`,labelShort:`Big5`,order:38,guessableName:`Big5`},big5hkscs:{labelLong:`Traditional Chinese (Big5-HKSCS)`,labelShort:`Big5-HKSCS`,order:39},shiftjis:{labelLong:`Japanese (Shift JIS)`,labelShort:`Shift JIS`,order:40,guessableName:`SHIFT_JIS`},eucjp:{labelLong:`Japanese (EUC-JP)`,labelShort:`EUC-JP`,order:41,guessableName:`EUC-JP`},euckr:{labelLong:`Korean (EUC-KR)`,labelShort:`EUC-KR`,order:42,guessableName:`EUC-KR`},windows874:{labelLong:`Thai (Windows 874)`,labelShort:`Windows 874`,order:43},iso885911:{labelLong:`Latin/Thai (ISO 8859-11)`,labelShort:`ISO 8859-11`,order:44},koi8ru:{labelLong:`Cyrillic (KOI8-RU)`,labelShort:`KOI8-RU`,order:45},koi8t:{labelLong:`Tajik (KOI8-T)`,labelShort:`KOI8-T`,order:46},gb2312:{labelLong:`Simplified Chinese (GB 2312)`,labelShort:`GB 2312`,order:47,guessableName:`GB2312`},cp865:{labelLong:`Nordic DOS (CP 865)`,labelShort:`CP 865`,order:48},cp850:{labelLong:`Western European DOS (CP 850)`,labelShort:`CP 850`,order:49}},VP=(()=>{let e={};for(let t in BP)BP[t].guessableName&&(e[t]=BP[t]);return e})();var HP;(function(e){e[e.FILE_IS_BINARY=0]=`FILE_IS_BINARY`})(HP||={});var UP;(function(e){e[e.SAVED=0]=`SAVED`,e[e.DIRTY=1]=`DIRTY`,e[e.PENDING_SAVE=2]=`PENDING_SAVE`,e[e.CONFLICT=3]=`CONFLICT`,e[e.ORPHAN=4]=`ORPHAN`,e[e.ERROR=5]=`ERROR`})(UP||={});var WP;(function(e){e[e.EDITOR=1]=`EDITOR`,e[e.REFERENCE=2]=`REFERENCE`,e[e.OTHER=3]=`OTHER`})(WP||={});var GP;(function(e){e[e.Encode=0]=`Encode`,e[e.Decode=1]=`Decode`})(GP||={});function KP(e){let t=!1;return{read(){return t?null:(t=!0,e)}}}function qP(e,t,n){return new to(e=>ZP(e,n)).isEqual(e,t)}function JP(e,t,n){return qP(e.uri,t.uri,n)?0:ca(e.uri.toString(),t.uri.toString())}function YP(e,t,n){return e.index===t.index?qP(e.uri,t.uri,n)?ca(e.name,t.name):ca(e.uri.toString(),t.uri.toString()):e.index<t.index?-1:1}function XP(e,t,n,r){return xe(e.slice(0).sort((e,t)=>n(e,t,r)),t.slice(0).sort((e,t)=>n(e,t,r)),(e,t)=>n(e,t,r))}function ZP(e,t){let n=t.getCapabilities(e.scheme);return!(n&&n&bc.PathCaseSensitive)}var QP=class e extends Bc{static toExtHostWorkspace(t,n,r,i){if(!t)return{workspace:null,added:[],removed:[]};let{id:a,name:o,folders:s,configuration:c,transient:l,isUntitled:u}=t,d=[],f=n;n?s.forEach((t,a)=>{let o=C.revive(t.uri),s=e._findFolder(r||n,o,i);s?(s.name=t.name,s.index=t.index,d.push(s)):d.push({uri:o,name:t.name,index:a})}):d.push(...s.map(({uri:e,name:t,index:n})=>({uri:C.revive(e),name:t,index:n}))),d.sort((e,t)=>e.index<t.index?-1:1);let p=new e(a,o,d,!!l,c?C.revive(c):null,!!u,e=>ZP(e,i)),{added:m,removed:ee}=XP(f?f.workspaceFolders:[],p.workspaceFolders,JP,i);return{workspace:p,added:m,removed:ee}}static _findFolder(e,t,n){for(let r=0;r<e.folders.length;r++){let i=e.workspaceFolders[r];if(qP(i.uri,t,n))return i}}constructor(e,t,n,r,i,a,o){super(e,n.map(e=>new Vc(e)),r,i,o),this._name=t,this._isUntitled=a,this._workspaceFolders=[],this._structure=oc.forUris(o,()=>!0),n.forEach(e=>{this._workspaceFolders.push(e),this._structure.set(e.uri,e)})}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=lo(e)),this._structure.findSubstr(e)}resolveWorkspaceFolder(e){return this._structure.get(e)}};let $P=class{constructor(e,t,n,r,i){this._onDidChangeWorkspace=new x,this.onDidChangeWorkspace=this._onDidChangeWorkspace.event,this._onDidGrantWorkspaceTrust=new x,this.onDidGrantWorkspaceTrust=this._onDidGrantWorkspaceTrust.event,this._onDidChangeWorkspaceTrustedFolders=new x,this.onDidChangeWorkspaceTrustedFolders=this._onDidChangeWorkspaceTrustedFolders.event,this._activeSearchCallbacks=[],this._trusted=!1,this._editSessionIdentityProviders=new Map,this._providerHandlePool=0,this._onWillCreateEditSessionIdentityEvent=new mr,this._canonicalUriProviders=new Map,this._logService=r,this._extHostFileSystemInfo=n,this._uriTransformerService=i,this._requestIdProvider=new gc,this._barrier=new jo,this._proxy=e.getProxy(T.MainThreadWorkspace),this._messageService=e.getProxy(T.MainThreadMessageService),this._telemetryProxy=e.getProxy(T.MainThreadTelemetry);let a=t.workspace;this._confirmedWorkspace=a?new QP(a.id,a.name,[],!!a.transient,a.configuration?C.revive(a.configuration):null,!!a.isUntitled,e=>ZP(e,n)):void 0}$setConfigProvider(e){this._configProvider=e}_useIgnoreFilesInFindFiles(){return this._configProvider?.getConfiguration(`search`).get(`experimental.useIgnoreFilesInFindFiles`)??!1}_userIgnoreFilesSetting(){return this._configProvider?.getConfiguration(`search`).get(`useIgnoreFiles`)??!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?C.from({scheme:D.untitled,path:so(lo(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,n,...r){let i=[];if(Array.isArray(r)&&r.forEach(e=>{C.isUri(e.uri)&&!i.some(t=>qP(t.uri,e.uri,this._extHostFileSystemInfo))&&i.push({uri:e.uri,name:e.name||oo(e.uri)})}),this._unconfirmedWorkspace||[t,n].some(e=>typeof e!=`number`||e<0)||n===0&&i.length===0)return!1;let a=this._actualWorkspace?this._actualWorkspace.workspaceFolders:[];if(t+n>a.length)return!1;let o=a.slice(0);o.splice(t,n,...i.map(e=>({uri:e.uri,name:e.name||oo(e.uri),index:void 0})));for(let e=0;e<o.length;e++){let t=o[e];if(o.some((n,r)=>r!==e&&qP(t.uri,n.uri,this._extHostFileSystemInfo)))return!1}o.forEach((e,t)=>e.index=t);let{added:s,removed:c}=XP(a,o,YP,this._extHostFileSystemInfo);if(s.length===0&&c.length===0)return!1;if(this._proxy){let r=e.displayName||e.name;this._proxy.$updateWorkspaceFolders(r,t,n,i).then(void 0,t=>{this._unconfirmedWorkspace=void 0;let n={source:{identifier:e.identifier,label:e.displayName||e.name}};this._messageService.$showMessage(Nc.Error,b(2881,`Extension '{0}' failed to update workspace folders: {1}`,r,t.toString()),n,[])})}return this.trySetWorkspaceFolders(o),!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;let{folders:e}=this._actualWorkspace;if(e.length!==0)return e[0].uri.fsPath}getRelativePath(e,t){let n,r=``;if(typeof e==`string`?(n=C.file(e),r=e):e!==void 0&&(n=e,r=e.fsPath),!n)return r;let i=this.getWorkspaceFolder(n,!0);if(!i)return r;t===void 0&&this._actualWorkspace&&(t=this._actualWorkspace.folders.length>1);let a=fo(i.uri,n);return t&&i.name&&(a=`${i.name}/${a}`),a}trySetWorkspaceFolders(e){this._actualWorkspace&&(this._unconfirmedWorkspace=QP.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){let{workspace:t,added:n,removed:r}=QP.toExtHostWorkspace(e,this._confirmedWorkspace,this._unconfirmedWorkspace,this._extHostFileSystemInfo);this._confirmedWorkspace=t||void 0,this._unconfirmedWorkspace=void 0,this._onDidChangeWorkspace.fire(Object.freeze({added:n,removed:r}))}findFiles(e,t,n,r,i=Bi.None){this._logService.trace(`extHostWorkspace#findFiles: fileSearch, extension: ${r.value}, entryPoint: findFiles`);let a=``,o=!0;t===null?o=!1:t!==void 0&&(a=typeof t==`string`?t:t.pattern);let s=this._useIgnoreFilesInFindFiles()&&t!==null?void 0:!1;return this._findFilesImpl({type:`include`,value:e},{exclude:[a],maxResults:n,useExcludeSettings:o?JN.FilesExclude:JN.None,useIgnoreFiles:{local:s}},r,`findFiles`,{useIgnoreFilesLocal:void 0,excludeWasNull:t===null},i)}findFiles2(e,t={},n,r=Bi.None){return this._logService.trace(`extHostWorkspace#findFiles2New: fileSearch, extension: ${n.value}, entryPoint: findFiles2New`),this._findFilesImpl({type:`filePatterns`,value:e},t,n,`findFiles2`,{useIgnoreFilesLocal:t.useIgnoreFiles?.local,excludeWasNull:!1},r)}async _findFilesImpl(e,t,n,r,i,a){let o=i.useIgnoreFilesLocal===!0?`true`:i.useIgnoreFilesLocal===!1?`false`:`unspecified`,s=new tr(!0),c=0,l=this._userIgnoreFilesSetting(),u=0,d=!1,f=!1;try{if(a.isCancellationRequested)return d=!0,[];let n=e.type===`include`?[e.value]:e.value??[];if(!Array.isArray(n))throw console.error(`Invalid file pattern provided`,n),Error(`Invalid file pattern provided ${JSON.stringify(n)}`);let r=n.map(n=>{let r=nF(t.exclude),i={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===JN.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==JN.SearchAndFilesExclude,maxResults:t.maxResults,excludePattern:r.length>0?r:void 0,ignoreGlobCase:t.caseInsensitive,_reason:`startFileSearch`,shouldGlobSearch:e.type===`include`?void 0:!0},a=tF(pM.from(n)),o=a?.folder;return e.type===`include`?i.includePattern=a?.pattern:i.filePattern=a?.pattern,{folder:o,options:i}});c=r.length;let i=this._userIgnoreFilesSetting();l=r.every(e=>e.options.disregardIgnoreFiles===!0?!1:e.options.disregardIgnoreFiles===!1?!0:i);let o=await this._findFilesBase(r,a);return u=o.length,d=a.isCancellationRequested,o}catch(e){throw f=!0,d=a.isCancellationRequested,e}finally{this._reportFindFilesTelemetry({extensionId:n.value,apiKind:r,respectedIgnoreFiles:l,useIgnoreFilesLocalRequested:o,excludeWasNull:i.excludeWasNull,resultCount:u,durationMs:s.elapsed(),queryCount:c,cancelled:d,errored:f})}}async _findFilesBase(e,t){let n=t,r;if(!Bi.isCancellationToken(t)){r=new Hi;let e=t;typeof e.onCancellationRequested==`function`&&e.onCancellationRequested(()=>r.cancel()),n=r.token}let i=(await Promise.all(e?.map(e=>this._proxy.$startFileSearch(e.folder??null,e.options,n).then(e=>Array.isArray(e)?e.map(e=>C.revive(e)):[]))??[])).flat();r?.dispose();let a=new to(e=>ZP(e,this._extHostFileSystemInfo)),o=new Map;for(let e of i){let t=a.getComparisonKey(e);o.has(t)||o.set(t,e)}return Array.from(o.values())}_reportFindFilesTelemetry(e){this._telemetryProxy.$publicLog2(`extHostFindFiles`,e)}findTextInFiles2(e,t,n,r=Bi.None){this._logService.trace(`extHostWorkspace#findTextInFiles2: textSearch, extension: ${n.value}, entryPoint: findTextInFiles2`);let i=e=>{if(!t)return{folder:void 0,options:{}};let n=e?tF(pM.from(e)):void 0,r=t.exclude?nF(t.exclude):void 0;return{options:{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===JN.None,disregardSearchExcludeSettings:t.useExcludeSettings!==void 0&&t.useExcludeSettings!==JN.SearchAndFilesExclude,fileEncoding:t.encoding,maxResults:t.maxResults,ignoreGlobCase:t.caseInsensitive,previewOptions:t.previewOptions?{matchLines:t.previewOptions?.numMatchLines??100,charsPerLine:t.previewOptions?.charsPerLine??1e4}:void 0,surroundingContext:t.surroundingContext,includePattern:n?.pattern,excludePattern:r},folder:n?.folder}},a=(t?.include?.map(e=>i(e))??[i(void 0)]).filter(e=>!!e),o=new _,s=o.add(new x),c=this.findTextInFilesBase(e,a,(e,t)=>s.fire({result:e,uri:t}),r);return{results:new Xo(async e=>{o.add(s.event(t=>{let n=t.result,r=t.uri;QN(n)?e.emitOne(new GN(r,n.rangeLocations.map(e=>({previewRange:new sT(e.preview.startLineNumber,e.preview.startColumn,e.preview.endLineNumber,e.preview.endColumn),sourceRange:new sT(e.source.startLineNumber,e.source.startColumn,e.source.endLineNumber,e.source.endColumn)})),n.previewText)):e.emitOne(new KN(r,n.text,n.lineNumber))})),await c}),complete:c.then(e=>(o.dispose(),{limitHit:e?.limitHit??!1}))}}async findTextInFilesBase(e,t,n,r=Bi.None){let i=this._requestIdProvider.getNext(),a=!1;if(r.onCancellationRequested(e=>{a=!0}),this._activeSearchCallbacks[i]=e=>{if(a)return;let t=C.revive(e.resource);e.results.forEach(e=>{n(Ju(e),t)})},r.isCancellationRequested)return{};try{let n=await Promise.all(t?.map(t=>this._proxy.$startTextSearch(e,t.folder??null,t.options,i,r)||{})??[]);return delete this._activeSearchCallbacks[i],n.reduce((e,t)=>({limitHit:e?.limitHit||(t?.limitHit??!1),message:[e?.message??[],t?.message??[]].flat()}),{})??{limitHit:!1}}catch(e){throw delete this._activeSearchCallbacks[i],e}}async findTextInFiles(e,t,n,r,i=Bi.None){this._logService.trace(`extHostWorkspace#findTextInFiles: textSearch, extension: ${r.value}, entryPoint: findTextInFiles`);let a=t.previewOptions===void 0?{matchLines:100,charsPerLine:1e4}:t.previewOptions,o=tF(pM.from(t.include)),s=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:a,surroundingContext:t.afterContext,includePattern:o?.pattern,excludePattern:s?[{pattern:s}]:void 0};return this.findTextInFilesBase(e,[{options:c,folder:o?.folder}],(e,t)=>{QN(e)?n({uri:t,preview:{text:e.previewText,matches:Oe(e.rangeLocations,e=>new sT(e.preview.startLineNumber,e.preview.startColumn,e.preview.endLineNumber,e.preview.endColumn))},ranges:Oe(e.rangeLocations,e=>new sT(e.source.startLineNumber,e.source.startColumn,e.source.endLineNumber,e.source.endColumn))}):n({uri:t,text:e.text,lineNumber:e.lineNumber})},i)}$handleTextSearchResult(e,t){this._activeSearchCallbacks[t]?.(e)}async save(e){let t=await this._proxy.$save(e,{saveAs:!1});return C.revive(t)}async saveAs(e){let t=await this._proxy.$save(e,{saveAs:!0});return C.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}requestResourceTrust(e){return this._proxy.$requestResourceTrust(e)}requestWorkspaceTrust(e){return this._proxy.$requestWorkspaceTrust(e)}$onDidGrantWorkspaceTrust(){this._trusted||(this._trusted=!0,this._onDidGrantWorkspaceTrust.fire())}$onDidChangeWorkspaceTrustedFolders(){this._onDidChangeWorkspaceTrustedFolders.fire()}isResourceTrusted(e){return this._proxy.$isResourceTrusted(e)}registerEditSessionIdentityProvider(e,t){if(this._editSessionIdentityProviders.has(e))throw Error(`A provider has already been registered for scheme ${e}`);this._editSessionIdentityProviders.set(e,t);let n=this._uriTransformerService.transformOutgoingScheme(e),r=this._providerHandlePool++;return this._proxy.$registerEditSessionIdentityProvider(r,n),g(()=>{this._editSessionIdentityProviders.delete(e),this._proxy.$unregisterEditSessionIdentityProvider(r)})}async $getEditSessionIdentifier(e,t){this._logService.info(`Getting edit session identifier for workspaceFolder`,e);let n=await this.resolveWorkspaceFolder(C.revive(e));if(!n){this._logService.warn(`Unable to resolve workspace folder`);return}this._logService.info(`Invoking #provideEditSessionIdentity for workspaceFolder`,n);let r=this._editSessionIdentityProviders.get(n.uri.scheme);if(this._logService.info(`Provider for scheme ${n.uri.scheme} is defined: `,!!r),!r)return;let i=await r.provideEditSessionIdentity(n,t);if(this._logService.info(`Provider returned edit session identifier: `,i),i)return i}async $provideEditSessionIdentityMatch(e,t,n,r){this._logService.info(`Getting edit session identifier for workspaceFolder`,e);let i=await this.resolveWorkspaceFolder(C.revive(e));if(!i){this._logService.warn(`Unable to resolve workspace folder`);return}this._logService.info(`Invoking #provideEditSessionIdentity for workspaceFolder`,i);let a=this._editSessionIdentityProviders.get(i.uri.scheme);if(this._logService.info(`Provider for scheme ${i.uri.scheme} is defined: `,!!a),!a)return;let o=await a.provideEditSessionIdentityMatch?.(t,n,r);if(this._logService.info(`Provider returned edit session identifier match result: `,o),o)return o}getOnWillCreateEditSessionIdentityEvent(e){return(t,n,r)=>{let i=function(e){t.call(n,e)};return i.extension=e,this._onWillCreateEditSessionIdentityEvent.event(i,void 0,r)}}async $onWillCreateEditSessionIdentity(e,t,n){let r=await this.resolveWorkspaceFolder(C.revive(e));if(r===void 0)throw Error(`Unable to resolve workspace folder`);await this._onWillCreateEditSessionIdentityEvent.fireAsync({workspaceFolder:r},t,async(e,t)=>{let r=Date.now();await Promise.resolve(e),Date.now()-r>n&&this._logService.warn(`SLOW edit session create-participant`,t.extension.identifier)}),t.isCancellationRequested}registerCanonicalUriProvider(e,t){if(this._canonicalUriProviders.has(e))throw Error(`A provider has already been registered for scheme ${e}`);this._canonicalUriProviders.set(e,t);let n=this._uriTransformerService.transformOutgoingScheme(e),r=this._providerHandlePool++;return this._proxy.$registerCanonicalUriProvider(r,n),g(()=>{this._canonicalUriProviders.delete(e),this._proxy.$unregisterCanonicalUriProvider(r)})}async provideCanonicalUri(e,t,n){let r=this._canonicalUriProviders.get(e.scheme);if(!r)return;let i=await r.provideCanonicalUri?.(C.revive(e),t,n);if(i)return i}async $provideCanonicalUri(e,t,n){return this.provideCanonicalUri(C.revive(e),{targetScheme:t},n)}async decode(e,t){let[n,r]=this.toEncodeDecodeParameters(t),i=await this._proxy.$resolveDecoding(n,r),a=(await OP(Jt(y.wrap(e)),{...i,acceptTextOnly:!0,overwriteEncoding:e=>e===null||e===i.preferredEncoding?Promise.resolve(i.preferredEncoding):this._proxy.$validateDetectedEncoding(n,e,r)})).stream;return At(a,e=>e.join(``))}async encode(e,t){let[n,r]=this.toEncodeDecodeParameters(t),{encoding:i,addBOM:a}=await this._proxy.$resolveEncoding(n,r);return i===`utf8`&&!a?y.fromString(e).buffer:Kt(await kP(KP(e),i,{addBOM:a})).buffer}toEncodeDecodeParameters(e){let t=li(e?.uri)?e.uri:void 0,n=typeof e?.encoding==`string`?e.encoding:void 0;return[t,n?{encoding:n}:void 0]}};$P=k([A(0,Js),A(1,Vs),A(2,Wc),A(3,Ns),A(4,Xs)],$P);const eF=O(`IExtHostWorkspace`);function tF(e){let t,n;if(e)return typeof e==`string`?t=e:(t=e.pattern,n=C.revive(e.baseUri)),{pattern:t,folder:n}}function nF(e){return(e?.map(e=>{if(typeof e==`string`)return e===``?void 0:{pattern:e,uri:void 0};{let t=tF(e);return t?{pattern:t.pattern,uri:t.folder}:void 0}})??[]).filter(e=>!!e)}function rF(e){return Object.isFrozen(e)?e:cc(e)}var iF=class e{static createEmptyModel(t){return new e({},[],[],void 0,t)}constructor(e,t,n,r,i){this._contents=e,this._keys=t,this._overrides=n,this._raw=r,this.logService=i,this.overrideConfigurations=new Map}get rawConfiguration(){if(!this._rawConfiguration)if(this._raw){let t=(Array.isArray(this._raw)?this._raw:[this._raw]).map(t=>{if(t instanceof e)return t;let n=new aF(``,this.logService);return n.parseRaw(t),n.configurationModel});this._rawConfiguration=t.reduce((e,t)=>t===e?t:e.merge(t),t[0])}else this._rawConfiguration=this;return this._rawConfiguration}get contents(){return this._contents}get overrides(){return this._overrides}get keys(){return this._keys}get raw(){if(this._raw&&!(Array.isArray(this._raw)&&this._raw.every(t=>t instanceof e)))return this._raw}isEmpty(){return this._keys.length===0&&Object.keys(this._contents).length===0&&this._overrides.length===0}getValue(e){return e?ng(this.contents,e):this.contents}inspect(t,n){let r=this;return{get value(){return rF(r.rawConfiguration.getValue(t))},get override(){return n?rF(r.rawConfiguration.getOverrideValue(t,n)):void 0},get merged(){return rF(n?r.rawConfiguration.override(n).getValue(t):r.rawConfiguration.getValue(t))},get overrides(){let n=[];for(let{contents:i,identifiers:a,keys:o}of r.rawConfiguration.overrides){let s=new e(i,o,[],void 0,r.logService).getValue(t);s!==void 0&&n.push({identifiers:a,value:s})}return n.length?rF(n):void 0}}}getOverrideValue(e,t){let n=this.getContentsForOverrideIdentifer(t);return n?e?ng(n,e):n:void 0}getKeysForOverrideIdentifier(e){let t=[];for(let n of this.overrides)n.identifiers.includes(e)&&t.push(...n.keys);return Ee(t)}getAllOverrideIdentifiers(){let e=[];for(let t of this.overrides)e.push(...t.identifiers);return Ee(e)}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...t){let n=sc(this.contents),r=sc(this.overrides),i=[...this.keys],a=this._raw?Array.isArray(this._raw)?[...this._raw]:[this._raw]:[this];for(let e of t)if(a.push(...e._raw?Array.isArray(e._raw)?e._raw:[e._raw]:[e]),!e.isEmpty()){this.mergeContents(n,e.contents);for(let t of e.overrides){let[e]=r.filter(e=>ge(e.identifiers,t.identifiers));e?(this.mergeContents(e.contents,t.contents),e.keys.push(...t.keys),e.keys=Ee(e.keys)):r.push(sc(t))}for(let t of e.keys)i.indexOf(t)===-1&&i.push(t)}return new e(n,i,r,!a.length||a.every(t=>t instanceof e)?void 0:a,this.logService)}createOverrideConfigurationModel(t){let n=this.getContentsForOverrideIdentifer(t);if(!n||typeof n!=`object`||!Object.keys(n).length)return this;let r={};for(let e of Ee([...Object.keys(this.contents),...Object.keys(n)])){let t=this.contents[e],i=n[e];i&&(typeof t==`object`&&typeof i==`object`?(t=sc(t),this.mergeContents(t,i)):t=i),r[e]=t}return new e(r,this.keys,this.overrides,void 0,this.logService)}mergeContents(e,t){for(let n of Object.keys(t)){if(n in e&&rt(e[n])&&rt(t[n])){this.mergeContents(e[n],t[n]);continue}e[n]=sc(t[n])}}getContentsForOverrideIdentifer(e){let t=null,n=null,r=e=>{e&&(n?this.mergeContents(n,e):n=sc(e))};for(let n of this.overrides)n.identifiers.length===1&&n.identifiers[0]===e?t=n.contents:n.identifiers.includes(e)&&r(n.contents);return r(t),n}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){let t=this.keys.indexOf(e);t!==-1&&(this.keys.splice(t,1),eg(this.contents,e),Dg.test(e)&&this.overrides.splice(this.overrides.findIndex(t=>ge(t.identifiers,Og(e))),1))}updateValue(e,t,n){if($h(this.contents,e,t,e=>this.logService.error(e)),n||=this.keys.indexOf(e)===-1,n&&this.keys.push(e),Dg.test(e)){let t=this.contents[e],n=Og(e),r={identifiers:n,keys:Object.keys(t),contents:Qh(t,e=>this.logService.error(e))},i=this.overrides.findIndex(e=>ge(e.identifiers,n));i===-1?this.overrides.push(r):this.overrides[i]=r}}},aF=class{constructor(e,t){this._name=e,this.logService=t,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[],this._parseErrors=[]}get configurationModel(){return this._configurationModel||iF.createEmptyModel(this.logService)}get restrictedConfigurations(){return this._restrictedConfigurations}get errors(){return this._parseErrors}parse(e,t){if(!lt(e)){let n=this.doParseContent(e);this.parseRaw(n,t)}}reparse(e){this._raw&&this.parseRaw(this._raw,e)}parseRaw(e,t){this._raw=e;let{contents:n,keys:r,overrides:i,restricted:a,hasExcludedProperties:o}=this.doParseRaw(e,t);this._configurationModel=new iF(n,r,i,o?[e]:void 0,this.logService),this._restrictedConfigurations=a||[]}doParseContent(e){let t={},n=null,r=[],i=[];function a(e){Array.isArray(r)?r.push(e):n!==null&&(r[n]=e)}let o={onObjectBegin:()=>{let e={};a(e),i.push(r),r=e,n=null},onObjectProperty:e=>{n=e},onObjectEnd:()=>{r=i.pop()},onArrayBegin:()=>{let e=[];a(e),i.push(r),r=e,n=null},onArrayEnd:()=>{r=i.pop()},onLiteralValue:a,onError:(e,t,n)=>{}};if(e)try{Ny(e,o),t=r[0]||{}}catch(e){this.logService.error(`Error while parsing settings file ${this._name}: ${e}`),this._parseErrors=[e]}return t}doParseRaw(e,t){let n=Am.as(dg.Configuration),r=n.getConfigurationProperties(),i=n.getExcludedConfigurationProperties(),a=this.filter(e,r,i,!0,t);return e=a.raw,{contents:Qh(e,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),keys:Object.keys(e),overrides:this.toOverrides(e,e=>this.logService.error(`Conflict in settings file ${this._name}: ${e}`)),restricted:a.restricted,hasExcludedProperties:a.hasExcludedProperties}}filter(e,t,n,r,i){let a=!1;if(!i?.scopes&&!i?.skipRestricted&&!i?.skipUnregistered&&!i?.exclude?.length)return{raw:e,restricted:[],hasExcludedProperties:a};let o={},s=[];for(let c in e)if(Dg.test(c)&&r){let r=this.filter(e[c],t,n,!1,i);o[c]=r.raw,a||=r.hasExcludedProperties,s.push(...r.restricted)}else{let r=t[c];r?.restricted&&s.push(c),this.shouldInclude(c,r,n,i)?o[c]=e[c]:a=!0}return{raw:o,restricted:s,hasExcludedProperties:a}}shouldInclude(e,t,n,r){if(r.exclude?.includes(e))return!1;if(r.include?.includes(e))return!0;if(r.skipRestricted&&t?.restricted||r.skipUnregistered&&!t)return!1;let i=t??n[e],a=i?i.scope===void 0?fg.WINDOW:i.scope:void 0;return a===void 0||r.scopes===void 0?!0:r.scopes.includes(a)}toOverrides(e,t){let n=[];for(let r of Object.keys(e))if(Dg.test(r)){let i={},a=e[r];for(let e in a)i[e]=a[e];n.push({identifiers:Og(r),keys:Object.keys(i),contents:Qh(i,t)})}return n}},oF=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this.key=e,this.overrides=t,this._value=n,this.overrideIdentifiers=r,this.defaultConfiguration=i,this.policyConfiguration=a,this.applicationConfiguration=o,this.userConfiguration=s,this.localUserConfiguration=c,this.remoteUserConfiguration=l,this.workspaceConfiguration=u,this.folderConfigurationModel=d,this.memoryConfigurationModel=f}get value(){return rF(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.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?void 0:{value:this.policyInspectValue.value}}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.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.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.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 sF=class e{constructor(e,t,n,r,i,a,o,s,c,l){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=n,this._localUserConfiguration=r,this._remoteUserConfiguration=i,this._workspaceConfiguration=a,this._folderConfigurations=o,this._memoryConfiguration=s,this._memoryConfigurationByResource=c,this.logService=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new He,this._userConfiguration=null}getValue(e,t,n){return this.getConsolidatedConfigurationModel(e,t,n).getValue(e)}updateValue(e,t,n={}){let r;n.resource?(r=this._memoryConfigurationByResource.get(n.resource),r||(r=iF.createEmptyModel(this.logService),this._memoryConfigurationByResource.set(n.resource,r))):r=this._memoryConfiguration,t===void 0?r.removeValue(e):r.setValue(e,t),n.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,n){let r=this.getConsolidatedConfigurationModel(e,t,n),i=this.getFolderConfigurationModelForResource(t.resource,n),a=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,o=new Set;for(let t of r.overrides)for(let n of t.identifiers)r.getOverrideValue(e,n)!==void 0&&o.add(n);return new oF(e,t,r.getValue(e),o.size?[...o]:void 0,this._defaultConfiguration,this._policyConfiguration.isEmpty()?void 0:this._policyConfiguration,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,n?this._workspaceConfiguration:void 0,i||void 0,a)}keys(e){let t=this.getFolderConfigurationModelForResource(void 0,e);return{default:this._defaultConfiguration.keys.slice(0),policy:this._policyConfiguration.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){let n=[];if(!t){let{added:n,updated:r,removed:i}=lF(this._defaultConfiguration,e);t=[...n,...r,...i]}for(let r of t)for(let t of Og(r)){let r=this._defaultConfiguration.getKeysForOverrideIdentifier(t),i=e.getKeysForOverrideIdentifier(t),a=[...i.filter(e=>r.indexOf(e)===-1),...r.filter(e=>i.indexOf(e)===-1),...r.filter(n=>!pc(this._defaultConfiguration.override(t).getValue(n),e.override(t).getValue(n)))];n.push([t,a])}return this.updateDefaultConfiguration(e),{keys:t,overrides:n}}compareAndUpdatePolicyConfiguration(e){let{added:t,updated:n,removed:r}=lF(this._policyConfiguration,e),i=[...t,...n,...r];return i.length&&this.updatePolicyConfiguration(e),{keys:i,overrides:[]}}compareAndUpdateApplicationConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=lF(this.applicationConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateApplicationConfiguration(e),{keys:a,overrides:i}}compareAndUpdateLocalUserConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=lF(this.localUserConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateLocalUserConfiguration(e),{keys:a,overrides:i}}compareAndUpdateRemoteUserConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=lF(this.remoteUserConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateRemoteUserConfiguration(e),{keys:a,overrides:i}}compareAndUpdateWorkspaceConfiguration(e){let{added:t,updated:n,removed:r,overrides:i}=lF(this.workspaceConfiguration,e),a=[...t,...n,...r];return a.length&&this.updateWorkspaceConfiguration(e),{keys:a,overrides:i}}compareAndUpdateFolderConfiguration(e,t){let n=this.folderConfigurations.get(e),{added:r,updated:i,removed:a,overrides:o}=lF(n,t),s=[...r,...i,...a];return(s.length||!n)&&this.updateFolderConfiguration(e,t),{keys:s,overrides:o}}compareAndDeleteFolderConfiguration(e){let t=this.folderConfigurations.get(e);if(!t)throw Error(`Unknown folder`);this.deleteFolderConfiguration(e);let{added:n,updated:r,removed:i,overrides:a}=lF(t,void 0);return{keys:[...n,...r,...i],overrides:a}}get defaults(){return this._defaultConfiguration}get applicationConfiguration(){return this._applicationConfiguration}get userConfiguration(){if(!this._userConfiguration)if(this._remoteUserConfiguration.isEmpty())this._userConfiguration=this._localUserConfiguration;else{let e=this._localUserConfiguration.merge(this._remoteUserConfiguration);this._userConfiguration=new iF(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,n){let r=this.getConsolidatedConfigurationModelForResource(t,n);if(t.overrideIdentifier&&(r=r.override(t.overrideIdentifier)),!this._policyConfiguration.isEmpty()&&this._policyConfiguration.getValue(e)!==void 0){r=r.merge();for(let e of this._policyConfiguration.keys)r.setValue(e,this._policyConfiguration.getValue(e))}return r}getConsolidatedConfigurationModelForResource({resource:e},t){let n=this.getWorkspaceConsolidatedConfiguration();if(t&&e){let r=t.getFolder(e);r&&(n=this.getFolderConsolidatedConfiguration(r.uri)||n);let i=this._memoryConfigurationByResource.get(e);i&&(n=n.merge(i))}return n}getWorkspaceConsolidatedConfiguration(){return 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){let n=this.getWorkspaceConsolidatedConfiguration(),r=this._folderConfigurations.get(e);r?(t=n.merge(r),this._foldersConsolidatedConfigurations.set(e,t)):t=n}return t}getFolderConfigurationModelForResource(e,t){if(t&&e){let n=t.getFolder(e);if(n)return this._folderConfigurations.get(n.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)=>{let{contents:n,overrides:r,keys:i}=this._folderConfigurations.get(t);return e.push([t,{contents:n,overrides:r,keys:i}]),e},[])}}allKeys(){let 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(t=>e.add(t))),[...e.values()]}allOverrideIdentifiers(){let 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(t=>e.add(t))),[...e.values()]}getAllKeysForOverrideIdentifier(e){let t=new Set;return this._defaultConfiguration.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e)),this._workspaceConfiguration.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e)),this._folderConfigurations.forEach(n=>n.getKeysForOverrideIdentifier(e).forEach(e=>t.add(e))),[...t.values()]}static parse(t,n){return new e(this.parseConfigurationModel(t.defaults,n),this.parseConfigurationModel(t.policy,n),this.parseConfigurationModel(t.application,n),this.parseConfigurationModel(t.userLocal,n),this.parseConfigurationModel(t.userRemote,n),this.parseConfigurationModel(t.workspace,n),t.folders.reduce((e,t)=>(e.set(C.revive(t[0]),this.parseConfigurationModel(t[1],n)),e),new He),iF.createEmptyModel(n),new He,n)}static parseConfigurationModel(e,t){return new iF(e.contents,e.keys,e.overrides,e.raw,t)}};var cF=class{constructor(e,t,n,r,i){this.change=e,this.previous=t,this.currentConfiguraiton=n,this.currentWorkspace=r,this.logService=i,this._marker=`
|
|
95
|
+
`,this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=46,this.affectedKeys=new Set,this._previousConfiguration=void 0;for(let t of e.keys)this.affectedKeys.add(t);for(let[,t]of e.overrides)for(let e of t)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(let e of this.affectedKeys)this._affectsConfigStr+=e+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=sF.parse(this.previous.data,this.logService)),this._previousConfiguration}affectsConfiguration(e,t){let n=this._marker+e,r=this._affectsConfigStr.indexOf(n);if(r<0)return!1;let i=r+n.length;if(i>=this._affectsConfigStr.length)return!1;let a=this._affectsConfigStr.charCodeAt(i);return a!==this._markerCode1&&a!==this._markerCode2?!1:t?!pc(this.previousConfiguration?this.previousConfiguration.getValue(e,t,this.previous?.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace)):!0}};function lF(e,t){let{added:n,removed:r,updated:i}=uF(t?.rawConfiguration,e?.rawConfiguration),a=[],o=e?.getAllOverrideIdentifiers()||[],s=t?.getAllOverrideIdentifiers()||[];if(t){let e=s.filter(e=>!o.includes(e));for(let n of e)a.push([n,t.getKeysForOverrideIdentifier(n)])}if(e){let t=o.filter(e=>!s.includes(e));for(let n of t)a.push([n,e.getKeysForOverrideIdentifier(n)])}if(t&&e){for(let n of o)if(s.includes(n)){let r=uF({contents:e.getOverrideValue(void 0,n)||{},keys:e.getKeysForOverrideIdentifier(n)},{contents:t.getOverrideValue(void 0,n)||{},keys:t.getKeysForOverrideIdentifier(n)});a.push([n,[...r.added,...r.removed,...r.updated]])}}return{added:n,removed:r,updated:i,overrides:a}}function uF(e,t){let n=e?t?e.keys.filter(e=>t.keys.indexOf(e)===-1):[...e.keys]:[],r=t?e?t.keys.filter(t=>e.keys.indexOf(t)===-1):[...t.keys]:[],i=[];if(e&&t)for(let n of t.keys)e.keys.indexOf(n)!==-1&&(pc(ng(t.contents,n),ng(e.contents,n))||i.push(n));return{added:n,removed:r,updated:i}}function dF(e,t){if(t){let n=t.split(`.`),r=e;for(let e=0;r&&e<n.length;e++)r=r[n[e]];return r}}function fF(e){return e instanceof C}function pF(e){return rt(e)&&e.uri instanceof C&&!!e.languageId&&typeof e.languageId==`string`}function mF(e){return rt(e)&&!e.uri&&!!e.languageId&&typeof e.languageId==`string`}function hF(e){return rt(e)&&e.uri instanceof C&&(!e.name||typeof e.name==`string`)&&(!e.index||typeof e.index==`number`)}function gF(e){if(fF(e))return{resource:e};if(pF(e))return{resource:e.uri,overrideIdentifier:e.languageId};if(mF(e))return{overrideIdentifier:e.languageId};if(hF(e))return{resource:e.uri};if(e===null)return{resource:null}}let _F=class{constructor(e,t,n){this._proxy=e.getProxy(T.MainThreadConfiguration),this._extHostWorkspace=t,this._logService=n,this._barrier=new jo,this._actual=null}getConfigProvider(){return this._barrier.wait().then(e=>this._actual)}$initializeConfiguration(e){this._actual=new vF(this._proxy,this._extHostWorkspace,e,this._logService),this._extHostWorkspace.$setConfigProvider(this._actual),this._barrier.open()}$acceptConfigurationChanged(e,t){this.getConfigProvider().then(n=>n.$acceptConfigurationChanged(e,t))}};_F=k([A(0,Js),A(1,eF),A(2,Ns)],_F);var vF=class{constructor(e,t,n,r){this._onDidChangeConfiguration=new x,this._proxy=e,this._logService=r,this._extHostWorkspace=t,this._configuration=sF.parse(n,r),this._configurationScopes=this._toMap(n.configurationScopes)}get onDidChangeConfiguration(){return this._onDidChangeConfiguration&&this._onDidChangeConfiguration.event}$acceptConfigurationChanged(e,t){let n={data:this._configuration.toData(),workspace:this._extHostWorkspace.workspace};this._configuration=sF.parse(e,this._logService),this._configurationScopes=this._toMap(e.configurationScopes),this._onDidChangeConfiguration.fire(this._toConfigurationChangeEvent(t,n))}getConfiguration(e,t,n){let r=gF(t)||{},i=this._toReadonlyValue(this._configuration.getValue(e,r,this._extHostWorkspace.workspace));e&&this._validateConfigurationAccess(e,r,n?.identifier);function a(e){if(e==null)return null;if(typeof e==`boolean`)return e?Zh.USER:Zh.WORKSPACE;switch(e){case FD.Global:return Zh.USER;case FD.Workspace:return Zh.WORKSPACE;case FD.WorkspaceFolder:return Zh.WORKSPACE_FOLDER}}let o={has(e){return dF(i,e)!==void 0},get:(t,a)=>{this._validateConfigurationAccess(e?`${e}.${t}`:t,r,n?.identifier);let o=dF(i,t);if(o===void 0)o=a;else{let e,n=(t,r)=>{if(rt(t)){let a,o=()=>{e||=sc(i),a||=dF(e,r)};return new Proxy(t,{get:(t,i)=>{if(typeof i==`string`&&i.toLowerCase()===`tojson`)return o(),()=>a;if(e)return a||=dF(e,r),a[i];let s=t[i];return typeof i==`string`?n(s,`${r}.${i}`):s},set:(e,t,n)=>(o(),a&&(a[t]=n),!0),deleteProperty:(e,t)=>(o(),a&&delete a[t],!0),defineProperty:(e,t,n)=>(o(),a&&Object.defineProperty(a,t,n),!0)})}return Array.isArray(t)?sc(t):t};o=n(o,t)}return o},update:(t,n,i,o)=>{t=e?`${e}.${t}`:t;let s=a(i);return n===void 0?this._proxy.$removeConfigurationOption(s,t,r,o):this._proxy.$updateConfigurationOption(s,t,n,r,o)},inspect:t=>{t=e?`${e}.${t}`:t;let n=this._configuration.inspect(t,r,this._extHostWorkspace.workspace);if(n)return{key:t,defaultValue:sc(n.policy?.value??n.default?.value),globalLocalValue:sc(n.userLocal?.value),globalRemoteValue:sc(n.userRemote?.value),globalValue:sc(n.user?.value??n.application?.value),workspaceValue:sc(n.workspace?.value),workspaceFolderValue:sc(n.workspaceFolder?.value),defaultLanguageValue:sc(n.default?.override),globalLocalLanguageValue:sc(n.userLocal?.override),globalRemoteLanguageValue:sc(n.userRemote?.override),globalLanguageValue:sc(n.user?.override??n.application?.override),workspaceLanguageValue:sc(n.workspace?.override),workspaceFolderLanguageValue:sc(n.workspaceFolder?.override),languageIds:sc(n.overrideIdentifiers)}}};return typeof i==`object`&&fc(o,i,!1),Object.freeze(o)}_toReadonlyValue(e){let t=e=>rt(e)?new Proxy(e,{get:(e,n)=>t(e[n]),set:(e,t,n)=>{throw Error(`TypeError: Cannot assign to read only property '${String(t)}' of object`)},deleteProperty:(e,t)=>{throw Error(`TypeError: Cannot delete read only property '${String(t)}' of object`)},defineProperty:(e,t)=>{throw Error(`TypeError: Cannot define property '${String(t)}' for a readonly object`)},setPrototypeOf:e=>{throw Error(`TypeError: Cannot set prototype for a readonly object`)},isExtensible:()=>!1,preventExtensions:()=>!0}):e;return t(e)}_validateConfigurationAccess(e,t,n){let r=Dg.test(e)?fg.RESOURCE:this._configurationScopes.get(e),i=n?`[${n.value}] `:``;if(fg.RESOURCE===r){t?.resource===void 0&&this._logService.warn(`${i}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(fg.WINDOW===r){t?.resource&&this._logService.warn(`${i}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){let n=new cF(e,t,this._configuration,this._extHostWorkspace.workspace,this._logService);return Object.freeze({affectsConfiguration:(e,t)=>n.affectsConfiguration(e,gF(t))})}_toMap(e){return e.reduce((e,t)=>(e.set(t[0],t[1]),e),new Map)}};const yF=O(`IExtHostConfiguration`);var bF=class{constructor(e,t){this.versionId=e,this.removedDueToLooping=t}},xF=class e extends v{static isHostExtension(e,t,n){if(t.getExtensionDescription(e))return!1;let r=n.getExtensionDescription(e);return r?!!((r.main||r.browser)&&r.api===`none`):!1}constructor(e,t){super(),this._activationEventsReader=e,this._onDidChange=this._register(new x),this.onDidChange=this._onDidChange.event,this._versionId=0,this._extensionDescriptions=t,this._initialize()}_initialize(){this._extensionDescriptions.sort(wF),this._extensionsMap=new Ds,this._extensionsArr=[],this._activationMap=new Map;for(let 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);let t=this._activationEventsReader.readActivationEvents(e);for(let n of t)this._activationMap.has(n)||this._activationMap.set(n,[]),this._activationMap.get(n).push(e)}}set(e){return this._extensionDescriptions=e,this._initialize(),this._versionId++,this._onDidChange.fire(void 0),{versionId:this._versionId}}deltaExtensions(t,n){this._extensionDescriptions=TF(this._extensionDescriptions,n),this._extensionDescriptions=this._extensionDescriptions.concat(t);let r=e._findLoopingExtensions(this._extensionDescriptions);return this._extensionDescriptions=TF(this._extensionDescriptions,r.map(e=>e.identifier)),this._initialize(),this._versionId++,this._onDidChange.fire(void 0),new bF(this._versionId,r)}static _findLoopingExtensions(e){let t=new class{constructor(){this._arcs=new Map,this._nodesSet=new Set,this._nodesArr=[]}addNode(e){this._nodesSet.has(e)||(this._nodesSet.add(e),this._nodesArr.push(e))}addArc(e,t){this.addNode(e),this.addNode(t),this._arcs.has(e)?this._arcs.get(e).push(t):this._arcs.set(e,[t])}getArcs(e){return this._arcs.has(e)?this._arcs.get(e):[]}hasOnlyGoodArcs(e,n){let r=t.getArcs(e);for(let e=0;e<r.length;e++)if(!n.has(r[e]))return!1;return!0}getNodes(){return this._nodesArr}},n=new Ds;for(let r of e)if(n.set(r.identifier,r),r.extensionDependencies)for(let e of r.extensionDependencies)t.addArc(Ts.toKey(r.identifier),Ts.toKey(e));let r=new Set;t.getNodes().filter(e=>t.getArcs(e).length===0).forEach(e=>r.add(e));let i=t.getNodes().filter(e=>!r.has(e)),a;do{a=!1;for(let e=0;e<i.length;e++){let n=i[e];t.hasOnlyGoodArcs(n,r)&&(i.splice(e,1),e--,r.add(n),a=!0)}}while(a);return i.map(e=>n.get(e))}containsActivationEvent(e){return this._activationMap.has(e)}containsExtension(e){return this._extensionsMap.has(e)}getExtensionDescriptionsForActivationEvent(e){let t=this._activationMap.get(e);return t?t.slice(0):[]}getAllExtensionDescriptions(){return this._extensionsArr.slice(0)}getSnapshot(){return new SF(this._versionId,this.getAllExtensionDescriptions())}getExtensionDescription(e){return this._extensionsMap.get(e)||void 0}getExtensionDescriptionByUUID(e){for(let t of this._extensionsArr)if(t.uuid===e)return t}getExtensionDescriptionByIdOrUUID(e,t){return this.getExtensionDescription(e)??(t?this.getExtensionDescriptionByUUID(t):void 0)}},SF=class{constructor(e,t){this.versionId=e,this.extensions=t}},CF;(function(e){e[e.Builtin=0]=`Builtin`,e[e.User=1]=`User`,e[e.Dev=2]=`Dev`})(CF||={});function wF(e,t){let n=e.isBuiltin?CF.Builtin:e.isUnderDevelopment?CF.Dev:CF.User,r=t.isBuiltin?CF.Builtin:t.isUnderDevelopment?CF.Dev:CF.User;if(n!==r)return n-r;let i=Gr.basename(e.extensionLocation.path),a=Gr.basename(t.extensionLocation.path);return i<a?-1:+(i>a)}function TF(e,t){let n=new Es(t);return e.filter(e=>!n.has(e.identifier))}var EF=class e{static{this.NONE=new e(!1,-1,-1,-1)}constructor(e,t,n,r){this.startup=e,this.codeLoadingTime=t,this.activateCallTime=n,this.activateResolvedTime=r}},DF=class{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 EF(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()}},OF=class{constructor(e,t,n,r,i,a){this.activationFailed=e,this.activationFailedError=t,this.activationTimes=n,this.module=r,this.exports=i,this.disposable=a}},kF=class extends OF{constructor(e){super(!1,null,e,{activate:void 0,deactivate:void 0},void 0,v.None)}},AF=class extends OF{constructor(){super(!1,null,EF.NONE,{activate:void 0,deactivate:void 0},void 0,v.None)}},jF=class extends OF{constructor(e){super(!0,e,EF.NONE,{activate:void 0,deactivate:void 0},void 0,v.None)}};let MF=class{constructor(e,t,n,r){this._logService=r,this._registry=e,this._globalRegistry=t,this._host=n,this._operations=new Ds,this._alreadyActivatedEvents=Object.create(null)}dispose(){for(let[e,t]of this._operations)t.dispose()}async waitForActivatingExtensions(){let e=[];for(let[t,n]of this._operations)e.push(n.wait());await Promise.all(e)}isActivated(e){let t=this._operations.get(e);return!!(t&&t.value)}getActivatedExtension(e){let t=this._operations.get(e);if(!t||!t.value)throw Error(`Extension '${e.value}' is not known or not activated`);return t.value}async activateByEvent(e,t){if(this._alreadyActivatedEvents[e])return;let n=this._registry.getExtensionDescriptionsForActivationEvent(e);await this._activateExtensions(n.map(n=>({id:n.identifier,reason:{startup:t,extensionId:n.identifier,activationEvent:e}}))),this._alreadyActivatedEvents[e]=!0}activateById(e,t){let n=this._registry.getExtensionDescription(e);if(!n)throw Error(`Extension '${e.value}' is not known`);return this._activateExtensions([{id:n.identifier,reason:t}])}async _activateExtensions(e){let t=e.filter(e=>!this.isActivated(e.id)).map(e=>this._handleActivationRequest(e));await Promise.all(t.map(e=>e.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);let t=this._registry.getExtensionDescription(e.id);if(!t){let t=Error(`Cannot activate unknown extension '${e.id.value}'`),n=this._createAndSaveOperation(e,null,[],new jF(t));return this._host.onExtensionActivationError(e.id,t,new Aw(e.id.value)),n}let n=[],r=t.extensionDependencies===void 0?[]:t.extensionDependencies;for(let i of r){if(this._isResolvedExtension(i))continue;let r=this._operations.get(i);if(r){n.push(r);continue}if(this._isHostExtension(i)){n.push(this._handleActivationRequest({id:this._globalRegistry.getExtensionDescription(i).identifier,reason:e.reason}));continue}let a=this._registry.getExtensionDescription(i);if(a){if(!a.main&&!a.browser)continue;n.push(this._handleActivationRequest({id:a.identifier,reason:e.reason}));continue}let o=t.displayName||t.identifier.value,s=Error(`Cannot activate the '${o}' extension because it depends on unknown extension '${i}'`),c=this._createAndSaveOperation(e,t.displayName,[],new jF(s));return this._host.onExtensionActivationError(t.identifier,s,new Aw(i)),c}return this._createAndSaveOperation(e,t.displayName,n,null)}_createAndSaveOperation(e,t,n,r){let i=new NF(e.id,t,e.reason,n,r,this._host,this._logService);return this._operations.set(e.id,i),i}_isHostExtension(e){return xF.isHostExtension(e,this._registry,this._globalRegistry)}_isResolvedExtension(e){let t=this._globalRegistry.getExtensionDescription(e);return t?!t.main&&!t.browser:!1}};MF=k([A(3,Ns)],MF);let NF=class{get value(){return this._value}get friendlyName(){return this._displayName||this._id.value}constructor(e,t,n,r,i,a,o){this._id=e,this._displayName=t,this._reason=n,this._deps=r,this._value=i,this._host=a,this._logService=o,this._barrier=new jo,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++){let t=this._deps[e];if(t.value&&!t.value.activationFailed){this._deps.splice(e,1),e--;continue}if(t.value&&t.value.activationFailed){let e=Error(`Cannot activate the '${this.friendlyName}' extension because its dependency '${t.friendlyName}' failed to activate`);e.detail=t.value.activationFailedError,this._value=new jF(e),this._host.onExtensionActivationError(this._id,e,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){let t=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 jF(t),this._isDisposed&&re(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)}}};NF=k([A(6,Ns)],NF);var PF=class{constructor(e,t){this._logService=t,this._onDidChangeStorage=new x,this.onDidChangeStorage=this._onDidChangeStorage.event,this._proxy=e.getProxy(T.MainThreadStorage)}registerExtensionStorageKeysToSync(e,t){this._proxy.$registerExtensionStorageKeysToSync(e,t)}async initializeExtensionStorage(e,t,n){let r=await this._proxy.$initializeExtensionStorage(e,t),i;return r&&(i=this.safeParseValue(e,t,r)),i||n}setValue(e,t,n){return this._proxy.$setValue(e,t,n)}$acceptValue(e,t,n){let r=this.safeParseValue(e,t,n);r&&this._onDidChangeStorage.fire({shared:e,key:t,value:r})}safeParseValue(e,t,n){try{return JSON.parse(n)}catch(n){this._logService.error(`[extHostStorage] unexpected error parsing storage contents (extensionId: ${t}, global: ${e}): ${n}`)}}};const FF=O(`IExtHostStorage`);var IF=class{constructor(e,t,n){this._deferredPromises=new Map,this._id=e,this._shared=t,this._storage=n,this._init=this._storage.initializeExtensionStorage(this._shared,this._id,Object.create(null)).then(e=>(this._value=e,this)),this._storageListener=this._storage.onDidChangeStorage(e=>{e.shared===this._shared&&e.key===this._id&&(this._value=e.value)}),this._scheduler=new Ro(()=>{let e=this._deferredPromises;this._deferredPromises=new Map,(async()=>{try{await this._storage.setValue(this._shared,this._id,this._value);for(let t of e.values())t.complete()}catch(t){for(let n of e.values())n.error(t)}})()},0)}keys(){return Object.entries(this._value??{}).filter(([,e])=>e!==void 0).map(([e])=>e)}get whenReady(){return this._init}get(e,t){let n=this._value[e];return n===void 0&&(n=t),n}update(e,t){typeof t==`object`&&t?this._value[e]=JSON.parse(JSON.stringify(t)):this._value[e]=t;let n=this._deferredPromises.get(e);if(n!==void 0)return n.p;let r=new Wo;return this._deferredPromises.set(e,r),this._scheduler.isScheduled()||this._scheduler.schedule(),r.p}dispose(){this._storageListener.dispose()}},LF=class extends IF{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}},RF;let zF=RF=class{constructor(e,t){this._fileSystemProvider=new Map,this._writeQueue=new Io,this._proxy=e.getProxy(T.MainThreadFileSystem);let n=this;this.value=Object.freeze({async stat(e){try{let t,r=n._fileSystemProvider.get(e.scheme);return r?(await n._proxy.$ensureActivation(e.scheme),t=await r.impl.stat(e)):t=await n._proxy.$stat(e),{type:t.type,ctime:t.ctime,mtime:t.mtime,size:t.size,permissions:t.permissions===vc.Readonly?1:void 0}}catch(e){RF._handleError(e)}},async readDirectory(e){try{let t=n._fileSystemProvider.get(e.scheme);return t?(await n._proxy.$ensureActivation(e.scheme),(await t.impl.readDirectory(e)).slice()):await n._proxy.$readdir(e)}catch(e){return RF._handleError(e)}},async createDirectory(e){try{let t=n._fileSystemProvider.get(e.scheme);return t&&!t.isReadonly?(await n._proxy.$ensureActivation(e.scheme),await n.mkdirp(t.impl,t.extUri,e)):await n._proxy.$mkdir(e)}catch(e){return RF._handleError(e)}},async readFile(e){try{let t=n._fileSystemProvider.get(e.scheme);return t?(await n._proxy.$ensureActivation(e.scheme),(await t.impl.readFile(e)).slice()):(await n._proxy.$readFile(e)).buffer}catch(e){return RF._handleError(e)}},async writeFile(e,t){try{let r=n._fileSystemProvider.get(e.scheme);return r&&!r.isReadonly?(await n._proxy.$ensureActivation(e.scheme),await n.mkdirp(r.impl,r.extUri,r.extUri.dirname(e)),await n._writeQueue.queueFor(e,()=>Promise.resolve(r.impl.writeFile(e,t,{create:!0,overwrite:!0})))):await n._proxy.$writeFile(e,y.wrap(t))}catch(e){return RF._handleError(e)}},async delete(e,t){try{let r=n._fileSystemProvider.get(e.scheme);return r&&!r.isReadonly&&!t?.useTrash?(await n._proxy.$ensureActivation(e.scheme),await r.impl.delete(e,{recursive:!1,...t})):await n._proxy.$delete(e,{recursive:!1,useTrash:!1,atomic:!1,...t})}catch(e){return RF._handleError(e)}},async rename(e,t,r){try{return await n._proxy.$rename(e,t,{overwrite:!1,...r})}catch(e){return RF._handleError(e)}},async copy(e,t,r){try{return await n._proxy.$copy(e,t,{overwrite:!1,...r})}catch(e){return RF._handleError(e)}},isWritableFileSystem(e){let n=t.getCapabilities(e);if(typeof n==`number`)return!(n&bc.Readonly)}})}async mkdirp(e,t,n){let r=[];for(;!t.isEqual(n,t.dirname(n));)try{if(((await e.stat(n)).type&_c.Directory)===0)throw oO.FileExists(`Unable to create folder '${n.scheme===D.file?n.fsPath:n.toString(!0)}' that already exists but is not a directory`);break}catch(e){if(wc(e)!==xc.FileNotFound)throw e;r.push(t.basename(n)),n=t.dirname(n)}for(let i=r.length-1;i>=0;i--){n=t.joinPath(n,r[i]);try{await e.createDirectory(n)}catch(e){if(wc(e)!==xc.FileExists)throw e}}}static _handleError(e){if(e instanceof oO)throw e;if(e instanceof Sc)switch(e.code){case xc.FileExists:throw oO.FileExists(e.message);case xc.FileNotFound:throw oO.FileNotFound(e.message);case xc.FileNotADirectory:throw oO.FileNotADirectory(e.message);case xc.FileIsADirectory:throw oO.FileIsADirectory(e.message);case xc.NoPermissions:throw oO.NoPermissions(e.message);case xc.Unavailable:throw oO.Unavailable(e.message);default:throw new oO(e.message,e.name)}if(!(e instanceof Error))throw new oO(String(e));if(e.name===`ENOPRO`||e.message.includes(`ENOPRO`))throw oO.Unavailable(e.message);switch(e.name){case xc.FileExists:throw oO.FileExists(e.message);case xc.FileNotFound:throw oO.FileNotFound(e.message);case xc.FileNotADirectory:throw oO.FileNotADirectory(e.message);case xc.FileIsADirectory:throw oO.FileIsADirectory(e.message);case xc.NoPermissions:throw oO.NoPermissions(e.message);case xc.Unavailable:throw oO.Unavailable(e.message);default:throw new oO(e.message,e.name)}}addFileSystemProvider(e,t,n){return this._fileSystemProvider.set(e,{impl:t,extUri:n?.isCaseSensitive?no:io,isReadonly:!!n?.isReadonly}),g(()=>this._fileSystemProvider.delete(e))}getFileSystemProviderExtUri(e){return this._fileSystemProvider.get(e)?.extUri??no}};zF=RF=k([A(0,Js),A(1,Wc)],zF);const BF=O(`IExtHostConsumerFileSystem`),VF=O(`IExtensionStoragePaths`);let HF=class{constructor(e,t,n){this._logService=t,this._extHostFileSystem=n,this._workspace=e.workspace??void 0,this._environment=e.environment,this.whenReady=this._getOrCreateWorkspaceStoragePath().then(e=>this._value=e)}async _getWorkspaceStorageURI(e){return C.joinPath(this._environment.workspaceStorageHome,e)}async _getOrCreateWorkspaceStoragePath(){if(!this._workspace)return Promise.resolve(void 0);let 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(C.joinPath(t,`meta.json`),new TextEncoder().encode(JSON.stringify({id:this._workspace.id,configuration:C.revive(this._workspace.configuration)?.toString(),name:this._workspace.name},void 0,2))),t}catch(e){this._logService.error(`[ExtHostStorage]`,e);return}}workspaceValue(e){if(this._value)return C.joinPath(this._value,e.identifier.value)}globalValue(e){return C.joinPath(this._environment.globalStorageHome,e.identifier.value.toLowerCase())}onWillDeactivateAll(){}};HF=k([A(0,Vs),A(1,Ns),A(2,BF)],HF);var UF;(function(e){e.Http=`http`,e.Https=`https`})(UF||={});var WF;(function(e){e.ConstantPrivate=`constantPrivate`,e.Private=`private`,e.Public=`public`})(WF||={});var GF;(function(e){e[e.Notify=1]=`Notify`,e[e.OpenBrowser=2]=`OpenBrowser`,e[e.OpenPreview=3]=`OpenPreview`,e[e.Silent=4]=`Silent`,e[e.Ignore=5]=`Ignore`,e[e.OpenBrowserOnce=6]=`OpenBrowserOnce`})(GF||={});function KF(e){if(e.scheme!==`http`&&e.scheme!==`https`)return;let t=/^(localhost|127\.0\.0\.1|0\.0\.0\.0):(\d+)$/.exec(e.authority);if(t)return{address:t[1],port:+t[2]}}const qF=[`localhost`,`127.0.0.1`,`0:0:0:0:0:0:0:1`,`::1`];function JF(e){return qF.indexOf(e)>=0}const YF=[`0.0.0.0`,`0:0:0:0:0:0:0:0`,`::`];function XF(e){return YF.indexOf(e)>=0}var ZF=class{constructor(e,t,n){this.remoteAddress=e,this.localAddress=t,this._dispose=n,this._onDispose=new x,this.onDidDispose=this._onDispose.event}dispose(){return this._onDispose.fire(),this._onDispose.dispose(),this._dispose()}};let QF=class extends v{constructor(e,t){super(),this.logService=e,this.configurationService=t,this._onTunnelOpened=this._register(new x),this.onTunnelOpened=this._onTunnelOpened.event,this._onTunnelClosed=this._register(new x),this.onTunnelClosed=this._onTunnelClosed.event,this._onAddedTunnelProvider=this._register(new x),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(){let 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(){let e=[],t=Array.from(this._tunnels.values());for(let n of t){let t=Array.from(n.values());for(let n of t){let t=await n.value;t&&typeof t!=`string`&&e.push(t)}}return e}async dispose(){super.dispose();for(let e of this._tunnels.values()){for(let{value:t}of e.values())await t.then(e=>typeof e==`string`?void 0:e?.dispose());e.clear()}this._tunnels.clear()}setEnvironmentTunnel(e,t,n,r,i){this.addTunnelToMap(e,t,Promise.resolve({tunnelRemoteHost:e,tunnelRemotePort:t,localAddress:n,privacy:r,protocol:i,dispose:()=>Promise.resolve()}))}async getExistingTunnel(e,t){(XF(e)||JF(e))&&(e=qF[0]);let n=this.getTunnelFromMap(e,t);if(n)return++n.refcount,n.value}openTunnel(e,t,n,r,i,a=!1,o,s){this.logService.trace(`ForwardedPorts: (TunnelService) openTunnel request for ${t}:${n} on local port ${i}.`);let c=this._tunnelProvider??e;if(!c)return;if(t||=`localhost`,r||=this.defaultTunnelHost,this._tunnelProvider&&this._factoryInProgress.has(n)){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}let l=this.retainOrCreateTunnel(c,t,n,r,i,a,o,s);return l?l.then(e=>{if(!e){this.logService.trace(`ForwardedPorts: (TunnelService) New tunnel is undefined.`),this.removeEmptyOrErrorTunnelFromMap(t,n);return}else if(typeof e==`string`)return this.logService.trace(`ForwardedPorts: (TunnelService) The tunnel provider returned an error when creating the tunnel.`),this.removeEmptyOrErrorTunnelFromMap(t,n),e;this.logService.trace(`ForwardedPorts: (TunnelService) New tunnel established.`);let r=this.makeTunnel(e);return(e.tunnelRemoteHost!==t||e.tunnelRemotePort!==n)&&this.logService.warn(`ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Host or port mismatch.`),o&&e.privacy!==o&&this.logService.warn(`ForwardedPorts: (TunnelService) Created tunnel does not match requirements of requested tunnel. Privacy mismatch.`),this._onTunnelOpened.fire(r),r}):(this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel was not created.`),l)}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} `);let t=this._tunnels.get(e.tunnelRemoteHost);if(t){let n=t.get(e.tunnelRemotePort);n&&(n.refcount--,await this.tryDisposeTunnel(e.tunnelRemoteHost,e.tunnelRemotePort,n))}}}}async tryDisposeTunnel(e,t,n){if(n.refcount<=0){this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel is being disposed ${e}:${t}.`);let r=n.value.then(async e=>{e&&typeof e!=`string`&&(await e.dispose(!0),this._onTunnelClosed.fire({host:e.tunnelRemoteHost,port:e.tunnelRemotePort}))});return this._tunnels.has(e)&&this._tunnels.get(e).delete(t),r}}async closeTunnel(e,t){this.logService.trace(`ForwardedPorts: (TunnelService) close request for ${e}:${t} `);let n=this._tunnels.get(e);if(n&&n.has(t)){let r=n.get(t);r.refcount=0,await this.tryDisposeTunnel(e,t,r)}}addTunnelToMap(e,t,n){this._tunnels.has(e)||this._tunnels.set(e,new Map),this._tunnels.get(e).set(t,{refcount:1,value:n})}async removeEmptyOrErrorTunnelFromMap(e,t){let n=this._tunnels.get(e);if(n){let r=n.get(t),i=r?await r.value:void 0;(!i||typeof i==`string`)&&n.delete(t),n.size===0&&this._tunnels.delete(e)}}getTunnelFromMap(e,t){let n=[e];JF(e)?(n.push(...qF),n.push(...YF)):XF(e)&&n.push(...YF);let r=n.map(e=>this._tunnels.get(e));for(let e of r){let n=e?.get(t);if(n)return n}}canTunnel(e){return!!KF(e)}createWithProvider(e,t,n,r,i,a,o){this.logService.trace(`ForwardedPorts: (TunnelService) Creating tunnel with provider ${t}:${n} on local port ${r}.`);let s=n;this._factoryInProgress.add(s);let c=r===void 0?n:r,l={elevationRequired:i?this.isPortPrivileged(c):!1},u={remoteAddress:{host:t,port:n},localAddressPort:r,privacy:a,public:a?a!==WF.Private:void 0,protocol:o},d=e.forwardPort(u,l);return d?(this.addTunnelToMap(t,n,d),d.finally(()=>{this.logService.trace(`ForwardedPorts: (TunnelService) Tunnel created by provider.`),this._factoryInProgress.delete(s)})):this._factoryInProgress.delete(s),d}};QF=k([A(0,Ns),A(1,Oh)],QF);var $F=class extends ZF{},eI;(function(e){function t(e){return{remoteAddress:e.remoteAddress,localAddress:e.localAddress,public:!!e.public,privacy:e.privacy??(e.public?WF.Public:WF.Private),protocol:e.protocol}}e.fromApiTunnel=t;function n(e){return{remoteAddress:{host:e.tunnelRemoteHost,port:e.tunnelRemotePort},localAddress:e.localAddress,public:e.privacy!==WF.ConstantPrivate&&e.privacy!==WF.ConstantPrivate,privacy:e.privacy,protocol:e.protocol}}e.fromServiceTunnel=n})(eI||={});const tI=O(`IExtHostTunnelService`);let nI=class extends v{constructor(e,t,n){super(),this.logService=n,this._showCandidatePort=()=>Promise.resolve(!0),this._extensionTunnels=new Map,this._onDidChangeTunnels=this._register(new x),this.onDidChangeTunnels=this._onDidChangeTunnels.event,this._providerHandleCounter=0,this._portAttributesProviders=new Map,this._proxy=e.getProxy(T.MainThreadTunnelService)}async openTunnel(e,t){this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) ${e.identifier.value} called openTunnel API for ${t.remoteAddress.host}:${t.remoteAddress.port}.`);let n=await this._proxy.$openTunnel(t,e.displayName);if(n){let e=new $F(n.remoteAddress,n.localAddress,()=>this._proxy.$closeTunnel(n.remoteAddress));return this._register(e),e}}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`);let n=this.nextPortAttributesProviderHandle();return this._portAttributesProviders.set(n,{selector:e,provider:t}),this._proxy.$registerPortsAttributesProvider(e,n),new YT(()=>{this._portAttributesProviders.delete(n),this._proxy.$unregisterPortsAttributesProvider(n)})}async $providePortAttributes(e,t,n,r,i){let a=[];for(let o of e){let e=this._portAttributesProviders.get(o);if(!e)return[];a.push(...await Promise.all(t.map(async t=>{let a;try{a=await e.provider.providePortAttributes({port:t,pid:n,commandLine:r},i)}catch{a=await e.provider.providePortAttributes(t,n,r,i)}return{providedAttributes:a,port:t}})))}let o=a.filter(e=>!!e.providedAttributes);return o.length>0?o.map(e=>({autoForwardAction:e.providedAttributes.autoForwardAction,port:e.port})):[]}async $registerCandidateFinder(e){}registerTunnelProvider(e,t){if(this._forwardPortProvider)throw Error(`A tunnel provider has already been registered. Only the first tunnel provider to be registered will be used.`);this._forwardPortProvider=async(t,n)=>await e.provideTunnel(t,n,Bi.None)??void 0;let n=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(n,!0),Promise.resolve(g(()=>{this._forwardPortProvider=void 0,this._proxy.$setTunnelProvider(void 0,!1)}))}hasTunnelProvider(){return this._proxy.$hasTunnelProvider()}async setTunnelFactory(e,t){if(e){e.candidatePortSource!==void 0&&this._proxy.$setCandidatePortSource(e.candidatePortSource),e.showCandidatePort&&(this._showCandidatePort=e.showCandidatePort,this._proxy.$setCandidateFilter());let n=e.tunnelFactory??(t?this.makeManagedTunnelFactory(t):void 0);if(n){this._forwardPortProvider=n;let t=e.tunnelFeatures?.privacyOptions??[];e.tunnelFeatures?.public&&t.length===0&&(t=[{id:`private`,label:b(2879,`Private`),themeIcon:`lock`},{id:`public`,label:b(2880,`Public`),themeIcon:`eye`}]);let r=e.tunnelFeatures?{elevation:!!e.tunnelFeatures?.elevation,public:!!e.tunnelFeatures?.public,privacyOptions:t,protocol:!0}:void 0;this._proxy.$setTunnelProvider(r,!!e.tunnelFactory)}}else this._forwardPortProvider=void 0;return g(()=>{this._forwardPortProvider=void 0})}makeManagedTunnelFactory(e){}async $closeTunnel(e,t){if(this._extensionTunnels.has(e.host)){let n=this._extensionTunnels.get(e.host);n.has(e.port)&&(t&&n.get(e.port).disposeListener.dispose(),await n.get(e.port).tunnel.dispose(),n.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.`);let n=this._forwardPortProvider(e,t);if(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Got tunnel promise from provider.`),n!==void 0){let t=await n;if(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Successfully awaited tunnel from provider.`),t===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);let r=this._register(t.onDidDispose(()=>(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Extension fired tunnel's onDidDispose.`),this._proxy.$closeTunnel(t.remoteAddress))));return this._extensionTunnels.get(e.remoteAddress.host).set(e.remoteAddress.port,{tunnel:t,disposeListener:r}),eI.fromApiTunnel(t)}else this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) Tunnel is undefined`)}catch(e){if(this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) tunnel provider error`),e instanceof Error)return e.message}}async $applyCandidateFilter(e){let t=await Promise.all(e.map(e=>this._showCandidatePort(e.host,e.port,e.detail??``))),n=e.filter((e,n)=>t[n]);return this.logService.trace(`ForwardedPorts: (ExtHostTunnelService) filtered from ${e.map(e=>e.port).join(`, `)} to ${n.map(e=>e.port).join(`, `)}`),n}};nI=k([A(0,Js),A(1,Vs),A(2,Ns)],nI);function rI(e){return[...e.entries()]}function iI(e){return e?[...e.entries()]:[]}var aI;(function(e){e.AutomationProfile=`terminal.integrated.automationProfile.`,e.DefaultProfile=`terminal.integrated.defaultProfile.`,e.Profiles=`terminal.integrated.profiles.`})(aI||={});var oI;(function(e){e.SendKeybindingsToShell=`terminal.integrated.sendKeybindingsToShell`,e.AutomationProfileLinux=`terminal.integrated.automationProfile.linux`,e.AutomationProfileMacOs=`terminal.integrated.automationProfile.osx`,e.AutomationProfileWindows=`terminal.integrated.automationProfile.windows`,e.AgentHostProfileLinux=`terminal.integrated.agentHostProfile.linux`,e.AgentHostProfileMacOs=`terminal.integrated.agentHostProfile.osx`,e.AgentHostProfileWindows=`terminal.integrated.agentHostProfile.windows`,e.ProfilesWindows=`terminal.integrated.profiles.windows`,e.ProfilesMacOs=`terminal.integrated.profiles.osx`,e.ProfilesLinux=`terminal.integrated.profiles.linux`,e.DefaultProfileLinux=`terminal.integrated.defaultProfile.linux`,e.DefaultProfileMacOs=`terminal.integrated.defaultProfile.osx`,e.DefaultProfileWindows=`terminal.integrated.defaultProfile.windows`,e.UseWslProfiles=`terminal.integrated.useWslProfiles`,e.TabsDefaultColor=`terminal.integrated.tabs.defaultColor`,e.TabsDefaultIcon=`terminal.integrated.tabs.defaultIcon`,e.TabsEnabled=`terminal.integrated.tabs.enabled`,e.TabsEnableAnimation=`terminal.integrated.tabs.enableAnimation`,e.TabsHideCondition=`terminal.integrated.tabs.hideCondition`,e.TabsShowActiveTerminal=`terminal.integrated.tabs.showActiveTerminal`,e.TabsShowActions=`terminal.integrated.tabs.showActions`,e.TabsLocation=`terminal.integrated.tabs.location`,e.TabsFocusMode=`terminal.integrated.tabs.focusMode`,e.TabsAllowAgentCliTitle=`terminal.integrated.tabs.allowAgentCliTitle`,e.MacOptionIsMeta=`terminal.integrated.macOptionIsMeta`,e.MacOptionClickForcesSelection=`terminal.integrated.macOptionClickForcesSelection`,e.AltClickMovesCursor=`terminal.integrated.altClickMovesCursor`,e.CopyOnSelection=`terminal.integrated.copyOnSelection`,e.EnableMultiLinePasteWarning=`terminal.integrated.enableMultiLinePasteWarning`,e.DrawBoldTextInBrightColors=`terminal.integrated.drawBoldTextInBrightColors`,e.FontFamily=`terminal.integrated.fontFamily`,e.FontSize=`terminal.integrated.fontSize`,e.LetterSpacing=`terminal.integrated.letterSpacing`,e.LineHeight=`terminal.integrated.lineHeight`,e.MinimumContrastRatio=`terminal.integrated.minimumContrastRatio`,e.TabStopWidth=`terminal.integrated.tabStopWidth`,e.FastScrollSensitivity=`terminal.integrated.fastScrollSensitivity`,e.MouseWheelScrollSensitivity=`terminal.integrated.mouseWheelScrollSensitivity`,e.BellDuration=`terminal.integrated.bellDuration`,e.FontWeight=`terminal.integrated.fontWeight`,e.FontWeightBold=`terminal.integrated.fontWeightBold`,e.CursorBlinking=`terminal.integrated.cursorBlinking`,e.TextBlinking=`terminal.integrated.textBlinking`,e.CursorStyle=`terminal.integrated.cursorStyle`,e.CursorStyleInactive=`terminal.integrated.cursorStyleInactive`,e.CursorWidth=`terminal.integrated.cursorWidth`,e.Scrollback=`terminal.integrated.scrollback`,e.DetectLocale=`terminal.integrated.detectLocale`,e.DefaultLocation=`terminal.integrated.defaultLocation`,e.GpuAcceleration=`terminal.integrated.gpuAcceleration`,e.TerminalTitleSeparator=`terminal.integrated.tabs.separator`,e.TerminalTitle=`terminal.integrated.tabs.title`,e.TerminalDescription=`terminal.integrated.tabs.description`,e.RightClickBehavior=`terminal.integrated.rightClickBehavior`,e.MiddleClickBehavior=`terminal.integrated.middleClickBehavior`,e.Cwd=`terminal.integrated.cwd`,e.ConfirmOnExit=`terminal.integrated.confirmOnExit`,e.ConfirmOnKill=`terminal.integrated.confirmOnKill`,e.EnableBell=`terminal.integrated.enableBell`,e.EnableVisualBell=`terminal.integrated.enableVisualBell`,e.CommandsToSkipShell=`terminal.integrated.commandsToSkipShell`,e.AllowChords=`terminal.integrated.allowChords`,e.AllowMnemonics=`terminal.integrated.allowMnemonics`,e.TabFocusMode=`terminal.integrated.tabFocusMode`,e.EnvMacOs=`terminal.integrated.env.osx`,e.EnvLinux=`terminal.integrated.env.linux`,e.EnvWindows=`terminal.integrated.env.windows`,e.EnvironmentChangesRelaunch=`terminal.integrated.environmentChangesRelaunch`,e.ShowExitAlert=`terminal.integrated.showExitAlert`,e.SplitCwd=`terminal.integrated.splitCwd`,e.WindowsUseConptyDll=`terminal.integrated.windowsUseConptyDll`,e.WordSeparators=`terminal.integrated.wordSeparators`,e.EnableFileLinks=`terminal.integrated.enableFileLinks`,e.AllowedLinkSchemes=`terminal.integrated.allowedLinkSchemes`,e.UnicodeVersion=`terminal.integrated.unicodeVersion`,e.EnablePersistentSessions=`terminal.integrated.enablePersistentSessions`,e.PersistentSessionReviveProcess=`terminal.integrated.persistentSessionReviveProcess`,e.HideOnStartup=`terminal.integrated.hideOnStartup`,e.HideOnLastClosed=`terminal.integrated.hideOnLastClosed`,e.PreserveDrawingBuffer=`terminal.integrated.preserveDrawingBuffer`,e.CustomGlyphs=`terminal.integrated.customGlyphs`,e.RescaleOverlappingGlyphs=`terminal.integrated.rescaleOverlappingGlyphs`,e.PersistentSessionScrollback=`terminal.integrated.persistentSessionScrollback`,e.InheritEnv=`terminal.integrated.inheritEnv`,e.ShowLinkHover=`terminal.integrated.showLinkHover`,e.IgnoreProcessNames=`terminal.integrated.ignoreProcessNames`,e.ShellIntegrationEnabled=`terminal.integrated.shellIntegration.enabled`,e.ShellIntegrationShowWelcome=`terminal.integrated.shellIntegration.showWelcome`,e.ShellIntegrationDecorationsEnabled=`terminal.integrated.shellIntegration.decorationsEnabled`,e.ShellIntegrationTimeout=`terminal.integrated.shellIntegration.timeout`,e.ShellIntegrationQuickFixEnabled=`terminal.integrated.shellIntegration.quickFixEnabled`,e.ShellIntegrationEnvironmentReporting=`terminal.integrated.shellIntegration.environmentReporting`,e.EnableImages=`terminal.integrated.enableImages`,e.SmoothScrolling=`terminal.integrated.smoothScrolling`,e.IgnoreBracketedPasteMode=`terminal.integrated.ignoreBracketedPasteMode`,e.FocusAfterRun=`terminal.integrated.focusAfterRun`,e.FontLigaturesEnabled=`terminal.integrated.fontLigatures.enabled`,e.FontLigaturesFeatureSettings=`terminal.integrated.fontLigatures.featureSettings`,e.FontLigaturesFallbackLigatures=`terminal.integrated.fontLigatures.fallbackLigatures`,e.EnableKittyKeyboardProtocol=`terminal.integrated.enableKittyKeyboardProtocol`,e.EnableWin32InputMode=`terminal.integrated.enableWin32InputMode`,e.AllowInUntrustedWorkspace=`terminal.integrated.allowInUntrustedWorkspace`,e.DeveloperPtyHostLatency=`terminal.integrated.developer.ptyHost.latency`,e.DeveloperPtyHostStartupDelay=`terminal.integrated.developer.ptyHost.startupDelay`,e.DevMode=`terminal.integrated.developer.devMode`})(oI||={});var sI;(function(e){e.Bash=`bash`,e.Fish=`fish`,e.Sh=`sh`,e.Csh=`csh`,e.Ksh=`ksh`,e.Zsh=`zsh`})(sI||={});var cI;(function(e){e.CommandPrompt=`cmd`,e.Wsl=`wsl`,e.GitBash=`gitbash`})(cI||={});var lI;(function(e){e.Claude=`claude`,e.Codex=`codex`,e.Copilot=`copilot`,e.Gemini=`gemini`,e.PowerShell=`pwsh`,e.Python=`python`,e.Julia=`julia`,e.NuShell=`nu`,e.Node=`node`,e.Xonsh=`xonsh`})(lI||={});var uI;(function(e){e[e.Api=0]=`Api`,e[e.Process=1]=`Process`,e[e.Sequence=2]=`Sequence`,e[e.Config=3]=`Config`})(uI||={});var dI;(function(e){e.LocalPty=`localPty`,e.PtyHost=`ptyHost`,e.PtyHostWindow=`ptyHostWindow`,e.Logger=`logger`,e.Heartbeat=`heartbeat`})(dI||={});var fI;(function(e){e.Cwd=`cwd`,e.InitialCwd=`initialCwd`,e.FixedDimensions=`fixedDimensions`,e.Title=`title`,e.ShellType=`shellType`,e.HasChildProcesses=`hasChildProcesses`,e.ResolvedShellLaunchConfig=`resolvedShellLaunchConfig`,e.OverrideDimensions=`overrideDimensions`,e.FailedShellIntegrationActivation=`failedShellIntegrationActivation`,e.UsedShellIntegrationInjection=`usedShellIntegrationInjection`,e.ShellIntegrationInjectionFailureReason=`shellIntegrationInjectionFailureReason`})(fI||={});var pI;(function(e){e[e.BeatInterval=5e3]=`BeatInterval`,e[e.ConnectingBeatInterval=2e4]=`ConnectingBeatInterval`,e[e.FirstWaitMultiplier=1.2]=`FirstWaitMultiplier`,e[e.SecondWaitMultiplier=1]=`SecondWaitMultiplier`,e[e.CreateProcessTimeout=5e3]=`CreateProcessTimeout`})(pI||={});var mI;(function(e){e[e.Panel=1]=`Panel`,e[e.Editor=2]=`Editor`})(mI||={});var hI;(function(e){e.TerminalView=`view`,e.Editor=`editor`})(hI||={});var gI;(function(e){e[e.GraceTime=6e4]=`GraceTime`,e[e.ShortGraceTime=6e3]=`ShortGraceTime`})(gI||={});var _I;(function(e){e[e.HighWatermarkChars=1e5]=`HighWatermarkChars`,e[e.LowWatermarkChars=5e3]=`LowWatermarkChars`,e[e.CharCountAckSize=5e3]=`CharCountAckSize`})(_I||={});var vI;(function(e){e.GitBash=`Git Bash`,e.Pwsh=`PowerShell`})(vI||={});var yI;(function(e){e[e.Off=0]=`Off`,e[e.FinalTerm=1]=`FinalTerm`,e[e.VSCode=2]=`VSCode`})(yI||={});var bI;(function(e){e.InjectionSettingDisabled=`injectionSettingDisabled`,e.NoExecutable=`noExecutable`,e.FeatureTerminal=`featureTerminal`,e.IgnoreShellIntegrationFlag=`ignoreShellIntegrationFlag`,e.UnsupportedWindowsBuild=`unsupportedWindowsBuild`,e.UnsupportedArgs=`unsupportedArgs`,e.UnsupportedShell=`unsupportedShell`,e.FailedToSetStickyBit=`failedToSetStickyBit`,e.FailedToCreateTmpDir=`failedToCreateTmpDir`})(bI||={});var xI;(function(e){e[e.DisableForTests=-2]=`DisableForTests`})(xI||={});var SI;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Shutdown=1]=`Shutdown`,e[e.Process=2]=`Process`,e[e.User=3]=`User`,e[e.Extension=4]=`Extension`})(SI||={});const CI={Backend:`workbench.contributions.terminal.processBackend`};function wI(e){return e?.toLowerCase()??``}var TI=class{constructor(e){this.remoteAuthority=e}affects(e){return wI(e)===this.remoteAuthority}},EI=class{constructor(){this._backends=new Map,this._onDidChangeBackends=new x,this.onDidChangeBackends=this._onDidChangeBackends.event}get backends(){return this._backends}registerTerminalBackend(e){let t=wI(e.remoteAuthority);if(this._backends.has(t))throw Error(`A terminal backend with remote authority '${t}' was already registered.`);this._backends.set(t,e),this._onDidChangeBackends.fire(new TI(t))}getTerminalBackend(e){return this._backends.get(wI(e))}};Am.add(CI.Backend,new EI);var DI=class{constructor(e){this._callback=e,this._terminalBufferMap=new Map}dispose(){for(let e of this._terminalBufferMap.values())e.dispose()}startBuffering(e,t,n=5){let r=t(t=>{let i=et(t)?t:t.data,a=this._terminalBufferMap.get(e);if(a){a.data.push(i);return}let o=setTimeout(()=>this.flushBuffer(e),n);a={data:[i],timeoutId:o,dispose:()=>{clearTimeout(o),this.flushBuffer(e),r.dispose()}},this._terminalBufferMap.set(e,a)});return r}stopBuffering(e){this._terminalBufferMap.get(e)?.dispose()}flushBuffer(e){let t=this._terminalBufferMap.get(e);t&&(this._terminalBufferMap.delete(e),this._callback(e,t.data.join(``)))}};const OI=(e,t,n,r)=>{let i=t;return{enumerable:!0,configurable:!1,get(){return i},set(t){if(!n(i,t)){let n=i;i=t,e.listener?.(r(t,n))}}}},kI=(e,t)=>e===t,AI={range:(e,t)=>e===t?!0:!e||!t?!1:e.isEqual(t),label:kI,description:kI,sortText:kI,busy:kI,error:kI,canResolveChildren:kI,tags:(e,t)=>!(e.length!==t.length||e.some(e=>!t.find(t=>e.id===t.id)))},jI=e=>t=>({op:Pw.SetProp,update:e(t)}),MI=(e,t)=>({range:(()=>{let t,n=jI(e=>({range:Ep.lift(J.from(e))}));return{enumerable:!0,configurable:!1,get(){return t},set(r){e.listener?.({op:Pw.DocumentSynced}),AI.range(t,r)||(t=r,e.listener?.(n(r)))}}})(),label:OI(e,t,AI.label,jI(e=>({label:e}))),description:OI(e,void 0,AI.description,jI(e=>({description:e}))),sortText:OI(e,void 0,AI.sortText,jI(e=>({sortText:e}))),canResolveChildren:OI(e,!1,AI.canResolveChildren,e=>({op:Pw.UpdateCanResolveChildren,state:e})),busy:OI(e,!1,AI.busy,jI(e=>({busy:e}))),error:OI(e,void 0,AI.error,jI(e=>({error:Y.fromStrict(e)||null}))),tags:OI(e,[],AI.tags,(e,t)=>({op:Pw.SetTags,new:e.map(OM.from),old:t.map(OM.from)}))}),NI=e=>{let t=MC.fromString(e.extId),n=new FI(t.controllerId,t.localId,e.label,C.revive(e.uri)||void 0);return n.range=J.to(e.range||void 0),n.description=e.description||void 0,n.sortText=e.sortText||void 0,n.tags=e.tags.map(e=>OM.to({id:KC(e).tagId})),n},PI=e=>{let t;for(let n of e.tests){let e=NI(n.item);Gw(e).parent=t,t=e}return t};var FI=class e{constructor(t,n,r,i){if(n.includes(AC.Delimiter))throw Error(`Test IDs may not include the ${JSON.stringify(n)} symbol`);let a=Ww(this,t);Object.defineProperties(this,{id:{value:n,enumerable:!0,writable:!1},uri:{value:i,enumerable:!0,writable:!1},parent:{enumerable:!1,get(){return a.parent instanceof II?void 0:a.parent}},children:{value:Hw(a,Gw,e),enumerable:!0,writable:!1},...MI(a,r)})}},II=class extends FI{constructor(e,t){super(e,e,t,void 0),this._isRoot=!0}},LI=class extends Rw{constructor(e,t,n){super({controllerId:e,getDocumentVersion:e=>e&&n.getDocument(e)?.version,getApiFor:Gw,getChildren:e=>e.children,root:new II(e,t),toITestItem:jM.from})}};let RI=class extends v{constructor(e,t,n){super(),this.initData=t,this._onDidChangeTelemetryEnabled=this._register(new x),this.onDidChangeTelemetryEnabled=this._onDidChangeTelemetryEnabled.event,this._onDidChangeTelemetryConfiguration=this._register(new x),this.onDidChangeTelemetryConfiguration=this._onDidChangeTelemetryConfiguration.event,this._productConfig={usage:!0,error:!0},this._level=l_.NONE,this._inLoggingOnlyMode=!1,this._telemetryLoggers=new Map,this._inLoggingOnlyMode=this.initData.environment.isExtensionTelemetryLoggingOnly;let r=t.remote.isRemote?`remoteExtHostTelemetry`:e?`workerExtHostTelemetry`:`extHostTelemetry`;this._outputLogger=this._register(n.createLogger(r,{name:b(2877,`Extension Telemetry{0}`,this._inLoggingOnlyMode?` (Not Sent)`:``),hidden:!0,group:xw}))}getTelemetryConfiguration(){return this._level===l_.USAGE}getTelemetryDetails(){return{isCrashEnabled:this._level>=l_.CRASH,isErrorsEnabled:this._productConfig.error?this._level>=l_.ERROR:!1,isUsageEnabled:this._productConfig.usage?this._level>=l_.USAGE:!1}}instantiateLogger(e,t,n){let r=this.getTelemetryDetails(),i=new zI(t,n,e,this._outputLogger,this._inLoggingOnlyMode,this.getBuiltInCommonProperties(e),{isUsageEnabled:r.isUsageEnabled,isErrorsEnabled:r.isErrorsEnabled}),a=this._telemetryLoggers.get(e.identifier.value)??[];return this._telemetryLoggers.set(e.identifier.value,[...a,i]),i.apiTelemetryLogger}$initializeTelemetryLevel(e,t,n){this._level=e,this._productConfig=n??{usage:!0,error:!0}}getBuiltInCommonProperties(e){let 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??this.initData.telemetryInfo.machineId,t[`common.vscodeversion`]=this.initData.version,t[`common.vscodereleasedate`]=this.initData.date,t[`common.isnewappinstall`]=BI(this.initData.telemetryInfo.firstSessionDate),t[`common.product`]=this.initData.environment.appHost,this.initData.uiKind){case br.Web:t[`common.uikind`]=`web`;break;case br.Desktop:t[`common.uikind`]=`desktop`;break;default:t[`common.uikind`]=`unknown`}return t[`common.remotename`]=Sw(this.initData.remote.authority,this.initData),this.initData.environment.isSessionsWindow&&(t[`common.isAgentsWindow`]=!0),t}$onDidChangeTelemetryLevel(e){this._oldTelemetryEnablement=this.getTelemetryConfiguration(),this._level=e;let t=this.getTelemetryDetails();this._telemetryLoggers.forEach((e,t)=>{let n=e.filter(e=>!e.isDisposed);n.length===0?this._telemetryLoggers.delete(t):this._telemetryLoggers.set(t,n)}),this._telemetryLoggers.forEach(e=>{for(let n of e)n.updateTelemetryEnablements(t.isUsageEnabled,t.isErrorsEnabled)}),this._oldTelemetryEnablement!==this.getTelemetryConfiguration()&&this._onDidChangeTelemetryEnabled.fire(this.getTelemetryConfiguration()),this._onDidChangeTelemetryConfiguration.fire(this.getTelemetryDetails())}onExtensionError(e,t){let n=this._telemetryLoggers.get(e.value)?.filter(e=>!e.isDisposed);if(!n)return this._telemetryLoggers.delete(e.value),!1;let r=!1;for(let e of n)e.ignoreUnhandledExtHostErrors||(e.logError(t),r=!0);return r}};RI=k([A(1,Vs),A(2,Ps)],RI);var zI=class{static validateSender(e){if(typeof e!=`object`)throw TypeError(`TelemetrySender argument is invalid`);if(typeof e.sendEventData!=`function`)throw TypeError(`TelemetrySender.sendEventData must be a function`);if(typeof e.sendErrorData!=`function`)throw TypeError(`TelemetrySender.sendErrorData must be a function`);if(e.flush!==void 0&&typeof e.flush!=`function`)throw TypeError(`TelemetrySender.flush must be a function or undefined`)}constructor(e,t,n,r,i,a,o){this._extension=n,this._logger=r,this._inLoggingOnlyMode=i,this._commonProperties=a,this._onDidChangeEnableStates=new x,this.ignoreUnhandledExtHostErrors=t?.ignoreUnhandledErrors??!1,this._ignoreBuiltinCommonProperties=t?.ignoreBuiltInCommonProperties??!1,this._additionalCommonProperties=t?.additionalCommonProperties,this._sender=e,this._telemetryEnablements={isUsageEnabled:o.isUsageEnabled,isErrorsEnabled:o.isErrorsEnabled}}updateTelemetryEnablements(e,t){this._apiObject&&(this._telemetryEnablements={isUsageEnabled:e,isErrorsEnabled:t},this._onDidChangeEnableStates.fire(this._apiObject))}mixInCommonPropsAndCleanData(e){let t=e.properties?e.properties??{}:e;return t=Dw(t,[]),this._additionalCommonProperties&&(t=fc(t,this._additionalCommonProperties)),this._ignoreBuiltinCommonProperties||(t=fc(t,this._commonProperties)),e.properties?e.properties=t:e=t,e}logEvent(e,t){this._sender&&(e=this._extension.publisher===`vscode`?this._extension.name+`/`+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{let n=Dw({name:e.name,message:e.message,stack:e.stack,cause:e.cause},[]),r=Error(typeof n.message==`string`?n.message:void 0,{cause:n.cause});r.stack=typeof n.stack==`string`?n.stack:void 0,r.name=typeof n.name==`string`?n.name:`unknown`,t=this.mixInCommonPropsAndCleanData(t||{}),this._inLoggingOnlyMode||this._sender.sendErrorData(r,t),this._logger.trace(`exception`,t)}}get apiTelemetryLogger(){if(!this._apiObject){let 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;this._onDidChangeEnableStates.dispose()}};function BI(e){let t=Date.now()-new Date(e).getTime();return isNaN(t)?!1:t<1e3*60*60*24}const VI=O(`IExtHostTelemetry`);let HI=class{#e;#t;#n;constructor(e,t,n){this._commands=new Map,this._apiCommands=new Map,this.#e=e.getProxy(T.MainThreadCommands),this._logService=t,this.#n=n,this.#t=e.getProxy(T.MainThreadTelemetry),this.converter=new WI(this,e=>{let t=this._apiCommands.get(e);return t?.result===GI.Void?t:void 0},t),this._argumentProcessors=[{processArgument(e){return Ju(e)}},{processArgument(e){return uc(e,function(e){if(Ep.isIRange(e))return J.to(e);if(Tp.isIPosition(e))return fj.to(e);if(Ep.isIRange(e.range)&&C.isUri(e.uri))return Ij.to(e);if(e instanceof y)return e.buffer.buffer;if(!Array.isArray(e))return e})}}]}registerArgumentProcessor(e){this._argumentProcessors.push(e)}registerApiCommand(e){let t=this.registerCommand(!1,e.id,async(...t)=>{let n=e.args.map((n,r)=>{if(!n.validate(t[r]))throw Error(`Invalid argument '${n.name}' when running '${e.id}', received: ${typeof t[r]==`object`?JSON.stringify(t[r],null,` `):t[r]} `);return n.convert(t[r])}),r=await this.executeCommand(e.internalId,...n);return e.result.convert(r,t,this.converter)},void 0,{description:e.description,args:e.args,returns:e.result.description});return this._apiCommands.set(e.id,e),new YT(()=>{t.dispose(),this._apiCommands.delete(e.id)})}registerCommand(e,t,n,r,i,a){if(this._logService.trace(`ExtHostCommands#registerCommand`,t),!t.trim().length)throw Error(`invalid id`);if(this._commands.has(t))throw Error(`command '${t}' already exists`);return this._commands.set(t,{callback:n,thisArg:r,metadata:i,extension:a}),e&&this.#e.$registerCommand(t),new YT(()=>{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,n){if(this._commands.has(e))return this.#e.$fireCommandActivationEvent(e),this._executeContributedCommand(e,t,!1);{let r=!1,i=uc(t,function(e){if(e instanceof aT)return fj.from(e);if(e instanceof sT)return J.from(e);if(e instanceof gT)return Ij.from(e);if(yT.isNotebookRange(e))return hM.from(e);if(e instanceof ArrayBuffer)return r=!0,y.wrap(new Uint8Array(e));if(e instanceof Uint8Array)return r=!0,y.wrap(e);if(e instanceof y)return r=!0,e;if(!Array.isArray(e))return e});try{return Ju(await this.#e.$executeCommand(e,r?new Ci(i):i,n))}catch(n){if(n instanceof Error&&n.message===`$executeCommand:retry`)return this._doExecuteCommand(e,t,!1);throw n}}}async _executeContributedCommand(e,t,n){let r=this._commands.get(e);if(!r)throw Error(`Unknown command`);let{callback:i,thisArg:a,metadata:o}=r;if(o?.args)for(let n=0;n<o.args.length;n++)try{gt(t[n],o.args[n].constraint)}catch{throw Error(`Running the contributed command: '${e}' failed. Illegal argument '${o.args[n].name}' - ${o.args[n].description}`)}let s=tr.create();try{return await i.apply(a,t)}catch(i){if(e===this.converter.delegatingCommandId){let n=this.converter.getActualCommand(...t);n&&(e=n.command)}if(re(i)||this._logService.error(i,e,r.extension?.identifier),!n)throw i;if(r.extension?.identifier){let e=this.#n.onExtensionError(r.extension.identifier,i);this._logService.trace(`forwarded error to extension?`,e,r.extension?.identifier)}throw new class extends Error{constructor(){super(Pm(i)),this.id=e,this.source=r.extension?.displayName??r.extension?.name}}}finally{this._reportTelemetry(r,e,s.elapsed())}}_reportTelemetry(e,t,n){e.extension&&(t.startsWith(`code.copilot.logStructured`)||this.#t.$publicLog2(`Extension:ActionExecuted`,{extensionId:e.extension.identifier.value,id:new bw(t),duration:n}))}$executeContributedCommand(e,...t){this._logService.trace(`ExtHostCommands#$executeContributedCommand`,e);let n=this._commands.get(e);return n?(t=t.map(e=>this._argumentProcessors.reduce((e,t)=>t.processArgument(e,n.extension),e)),this._executeContributedCommand(e,t,!0)):Promise.reject(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(e=>e[0]!==`_`)),t))}$getContributedCommandMetadata(){let e=Object.create(null);for(let[t,n]of this._commands){let{metadata:r}=n;r&&(e[t]=r)}return Promise.resolve(e)}};HI=k([A(0,Js),A(1,Ns),A(2,VI)],HI);const UI=O(`IExtHostCommands`);var WI=class{constructor(e,t,n){this._commands=e,this._lookupApiCommand=t,this._logService=n,this.delegatingCommandId=`__vsc${Gc()}`,this._cache=new Map,this._cachIdPool=0,this._commands.registerCommand(!0,this.delegatingCommandId,this._executeConvertedCommand,this)}toInternal(e,t){if(!e)return;let n={$ident:void 0,id:e.command,title:e.title,tooltip:e.tooltip};if(!e.command)return n;let r=this._lookupApiCommand(e.command);if(r)n.id=r.internalId,n.arguments=r.args.map((t,n)=>t.convert(e.arguments&&e.arguments[n]));else if(Te(e.arguments)){let r=`${e.command} /${++this._cachIdPool}`;this._cache.set(r,e),t.add(g(()=>{this._cache.delete(r),this._logService.trace(`CommandsConverter#DISPOSE`,r)})),n.$ident=r,n.id=this.delegatingCommandId,n.arguments=[r],this._logService.trace(`CommandsConverter#CREATE`,e.command,r)}return n}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){let 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]}`)}},X=class e{static{this.Uri=new e(`uri`,`Uri of a text document`,e=>C.isUri(e),e=>e)}static{this.Position=new e(`position`,`A position in a text document`,e=>aT.isPosition(e),fj.from)}static{this.Range=new e(`range`,`A range in a text document`,e=>sT.isRange(e),J.from)}static{this.Selection=new e(`selection`,`A selection in a text document`,e=>ET.isSelection(e),lj.from)}static{this.Number=new e(`number`,``,e=>typeof e==`number`,e=>e)}static{this.String=new e(`string`,``,e=>typeof e==`string`,e=>e)}static Arr(t){return new e(`${t.name}_array`,`Array of ${t.name}, ${t.description}`,e=>Array.isArray(e)&&e.every(e=>t.validate(e)),e=>e.map(e=>t.convert(e)))}static{this.CallHierarchyItem=new e(`item`,`A call hierarchy item`,e=>e instanceof dE,Nj.from)}static{this.TypeHierarchyItem=new e(`item`,`A type hierarchy item`,e=>e instanceof lk,FM.from)}static{this.TestItem=new e(`testItem`,`A VS Code TestItem`,e=>e instanceof FI,jM.from)}static{this.TestProfile=new e(`testProfile`,`A VS Code test profile`,e=>e instanceof YO,kM.from)}constructor(e,t,n,r){this.name=e,this.description=t,this.validate=n,this.convert=r}optional(){return new e(this.name,`(optional) ${this.description}`,e=>e==null||this.validate(e),e=>e===void 0?void 0:e===null?null:this.convert(e))}with(t,n){return new e(t??this.name,n??this.description,this.validate,this.convert)}},GI=class e{static{this.Void=new e(`no result`,e=>e)}constructor(e,t){this.description=e,this.convert=t}},KI=class{constructor(e,t,n,r,i){this.id=e,this.internalId=t,this.description=n,this.args=r,this.result=i}};const qI=O(`IExtHostTerminalService`);var JI=class extends v{constructor(e,t,n,r){super(),this._proxy=e,this._id=t,this._creationOptions=n,this._name=r,this._disposed=!1,this._state={isInteractedWith:!1,shell:void 0},this.isOpen=!1,this._onWillDispose=this._register(new x),this.onWillDispose=this._onWillDispose.event,this._creationOptions=Object.freeze(this._creationOptions),this._pidPromise=new Promise(e=>this._pidPromiseComplete=e);let i=this;this.value={get name(){return i._name||``},get processId(){return i._pidPromise},get creationOptions(){return i._creationOptions},get exitStatus(){return i._exitStatus},get state(){return i._state},get selection(){return i._selection},get shellIntegration(){return i.shellIntegration},sendText(e,t=!0){i._checkDisposed(),i._proxy.$sendText(i._id,e,t)},show(e){i._checkDisposed(),i._proxy.$show(i._id,e)},hide(){i._checkDisposed(),i._proxy.$hide(i._id)},dispose(){i._disposed||(i._disposed=!0,i._proxy.$dispose(i._id))},get dimensions(){if(!(i._cols===void 0||i._rows===void 0))return{columns:i._cols,rows:i._rows}}}}dispose(){this._onWillDispose.fire(),super.dispose()}async create(e,t){if(typeof this._id!=`string`)throw 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:tL(e.iconPath)??void 0,color:_l.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,shellIntegrationNonce:e.shellIntegrationNonce??void 0,titleTemplate:e.titleTemplate??void 0})}async createExtensionTerminal(e,t,n,r,i,a,o){if(typeof this._id!=`string`)throw Error(`Terminal has already been created`);if(await this._proxy.$createTerminal(this._id,{name:this._name,isExtensionCustomPtyTerminal:!0,icon:r,color:_l.isThemeColor(i)?i.id:void 0,location:t?.location||this._serializeParentTerminal(e,n),isTransient:!0,shellIntegrationNonce:a??void 0,titleTemplate:o??void 0}),typeof this._id==`string`)throw Error(`Terminal creation failed`);return this._id}_serializeParentTerminal(e,t){return typeof e==`object`?_t(e,{parentTerminal:!0})&&e.parentTerminal&&t?{parentTerminal:t}:_t(e,{viewColumn:!0})?{viewColumn:vj.from(e.viewColumn),preserveFocus:e.preserveFocus}:void 0:e}_checkDisposed(){if(this._disposed)throw 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?!1:(this._state={...this._state,shell:e},!0)}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))})}},YI=class{get onProcessReady(){return this._onProcessReady.event}constructor(e){this._pty=e,this.id=0,this.shouldPersist=!1,this._onProcessData=new x,this.onProcessData=this._onProcessData.event,this._onProcessReady=new x,this._onDidChangeProperty=new x,this.onDidChangeProperty=this._onDidChangeProperty.event,this._onProcessExit=new x,this.onProcessExit=this._onProcessExit.event}refreshProperty(e){throw Error(`refreshProperty is not suppported in extension owned terminals. property: ${e}`)}updateProperty(e,t){throw Error(`updateProperty is not suppported in extension owned terminals. property: ${e}, value: ${t}`)}async start(){}shutdown(){this._pty.close()}input(e){this._pty.handleInput?.(e)}sendSignal(e){}resize(e,t){this._pty.setDimensions?.({columns:e,rows:t})}clearBuffer(){}async processBinary(e){}acknowledgeDataEvent(e){}async setUnicodeVersion(e){}getInitialCwd(){return Promise.resolve(``)}getCwd(){return Promise.resolve(``)}startSendingEvents(e){this._pty.onDidWrite(e=>this._onProcessData.fire(e)),this._pty.onDidClose?.((e=void 0)=>{this._onProcessExit.fire(e===void 0?void 0:e)}),this._pty.onDidOverrideDimensions?.(e=>{e&&this._onDidChangeProperty.fire({type:fI.OverrideDimensions,value:{cols:e.columns,rows:e.rows}})}),this._pty.onDidChangeName?.(e=>{this._onDidChangeProperty.fire({type:fI.Title,value:e})}),this._pty.open(e||void 0),e&&this._pty.setDimensions?.(e),this._onProcessReady.fire({pid:-1,cwd:``,windowsPty:void 0})}};let XI=1,ZI=class extends v{get activeTerminal(){return this._activeTerminal?.value}get terminals(){return this._terminals.map(e=>e.value)}constructor(e,t,n){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 wt),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 x,this.onDidCloseTerminal=this._onDidCloseTerminal.event,this._onDidOpenTerminal=new x,this.onDidOpenTerminal=this._onDidOpenTerminal.event,this._onDidChangeActiveTerminal=new x,this.onDidChangeActiveTerminal=this._onDidChangeActiveTerminal.event,this._onDidChangeTerminalDimensions=new x,this.onDidChangeTerminalDimensions=this._onDidChangeTerminalDimensions.event,this._onDidChangeTerminalState=new x,this.onDidChangeTerminalState=this._onDidChangeTerminalState.event,this._onDidChangeShell=new x,this.onDidChangeShell=this._onDidChangeShell.event,this._onDidWriteTerminalData=new x({onWillAddFirstListener:()=>this._proxy.$startSendingDataEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingDataEvents()}),this.onDidWriteTerminalData=this._onDidWriteTerminalData.event,this._onDidExecuteCommand=new x({onWillAddFirstListener:()=>this._proxy.$startSendingCommandEvents(),onDidRemoveLastListener:()=>this._proxy.$stopSendingCommandEvents()}),this.onDidExecuteTerminalCommand=this._onDidExecuteCommand.event,this._proxy=n.getProxy(T.MainThreadTerminalService),this._bufferer=new DI(this._proxy.$sendProcessData),this._proxy.$registerProcessSupport(e),this._extHostCommands.registerArgumentProcessor({processArgument:e=>{let t=e=>this.getTerminalById(e.instanceId)?.value;switch(e?.$mid){case Mr.TerminalContext:return t(e);default:if(Array.isArray(e))for(let n=0;n<e.length&&e[n].$mid===Mr.TerminalContext;n++)e[n]=t(e[n]);return e}}}),this._register({dispose:()=>{for(let[e,t]of this._terminalProcesses)t.shutdown(!0)}})}getDefaultShell(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.path||``}getDefaultShellArgs(e){return(e?this._defaultAutomationProfile:this._defaultProfile)?.args||[]}createExtensionTerminal(e,t){let n=new JI(this._proxy,Gc(),e,e.name),r=new YI(e.pty);return n.createExtensionTerminal(e.location,t,this._serializeParentTerminal(e,t).resolvedExtHostIdentifier,tL(e.iconPath),nL(e.color),e.shellIntegrationNonce,e.titleTemplate).then(e=>{let t=this._setupExtHostProcessListeners(e,r);this._terminalProcessDisposables[e]=t}),this._terminals.push(n),n.value}_serializeParentTerminal(e,t){if(t||={},e.location&&typeof e.location==`object`&&_t(e.location,{parentTerminal:!0})){let n=e.location.parentTerminal;if(n){let e=this._terminals.find(e=>e.value===n);e&&(t.resolvedExtHostIdentifier=e._id)}}else e.location&&typeof e.location!=`object`?t.location=e.location:t.location&&typeof t.location==`object`&&_t(t.location,{splitActiveTerminal:!0})&&(t.location={splitActiveTerminal:!0});return t}attachPtyToTerminal(e,t){if(!this.getTerminalById(e))throw Error(`Cannot resolve terminal with id ${e} for virtual process`);let n=new YI(t),r=this._setupExtHostProcessListeners(e,n);this._terminalProcessDisposables[e]=r}async $acceptActiveTerminalChanged(e){let t=this._activeTerminal;if(e===null){this._activeTerminal=void 0,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal);return}let n=this.getTerminalById(e);n&&(this._activeTerminal=n,t!==this._activeTerminal&&this._onDidChangeActiveTerminal.fire(this._activeTerminal.value))}async $acceptTerminalProcessData(e,t){let n=this.getTerminalById(e);n&&this._onDidWriteTerminalData.fire({terminal:n.value,data:t})}async $acceptTerminalDimensions(e,t,n){let r=this.getTerminalById(e);r&&r.setDimensions(t,n)&&this._onDidChangeTerminalDimensions.fire({terminal:r.value,dimensions:r.value.dimensions})}async $acceptDidExecuteCommand(e,t){let n=this.getTerminalById(e);n&&this._onDidExecuteCommand.fire({terminal:n.value,...t})}async $acceptTerminalMaximumDimensions(e,t,n){this._terminalProcesses.get(e)?.resize(t,n)}async $acceptTerminalTitleChange(e,t){let n=this.getTerminalById(e);n&&(n.name=t)}async $acceptTerminalClosed(e,t,n){this._terminalLinkCache.delete(e);let r=this._terminalLinkCancellationSource.get(e);r&&(this._terminalLinkCancellationSource.delete(e),r.dispose(!0));let i=this._getTerminalObjectIndexById(this._terminals,e);if(i!==null){let e=this._terminals.splice(i,1)[0];e.setExitStatus(t,n),this._onDidCloseTerminal.fire(e.value)}}$acceptTerminalOpened(e,t,n,r){if(t){let n=this._getTerminalObjectIndexById(this._terminals,t);if(n!==null){this._terminals[n]._id=e,this._onDidOpenTerminal.fire(this.terminals[n]),this._terminals[n].isOpen=!0;return}}let i={name:r.name,shellPath:r.executable,shellArgs:r.args,cwd:typeof r.cwd==`string`?r.cwd:C.revive(r.cwd),env:r.env,hideFromUser:r.hideFromUser,titleTemplate:r.titleTemplate},a=new JI(this._proxy,e,i,n);this._terminals.push(a),this._onDidOpenTerminal.fire(a.value),a.isOpen=!0}async $acceptTerminalProcessId(e,t){this.getTerminalById(e)?._setProcessId(t)}async $startExtensionTerminal(e,t){let n=this.getTerminalById(e);if(!n)return{message:b(2878,`Could not find the terminal with id {0} on the extension host`,e)};n.isOpen||await new Promise(e=>{let t=this.onDidOpenTerminal(async r=>{r===n.value&&(t.dispose(),e())})});let r=this._terminalProcesses.get(e);r?r.startSendingEvents(t):this._extensionTerminalAwaitingStart[e]={initialDimensions:t}}_setupExtHostProcessListeners(e,t){let n=new _;n.add(t.onProcessReady(t=>this._proxy.$sendProcessReady(e,t.pid,t.cwd,t.windowsPty))),n.add(t.onDidChangeProperty(t=>this._proxy.$sendProcessProperty(e,t))),this._bufferer.startBuffering(e,t.onProcessData),n.add(t.onProcessExit(t=>this._onProcessExit(e,t))),this._terminalProcesses.set(e,t);let r=this._extensionTerminalAwaitingStart[e];return r&&t instanceof YI&&(t.startSendingEvents(r.initialDimensions),delete this._extensionTerminalAwaitingStart[e]),n}$acceptProcessAckDataEvent(e,t){this._terminalProcesses.get(e)?.acknowledgeDataEvent(t)}$acceptProcessInput(e,t){this._terminalProcesses.get(e)?.input(t)}$acceptTerminalInteraction(e){let t=this.getTerminalById(e);t?.setInteractedWith()&&this._onDidChangeTerminalState.fire(t.value)}$acceptTerminalSelection(e,t){this.getTerminalById(e)?.setSelection(t)}$acceptProcessResize(e,t,n){try{this._terminalProcesses.get(e)?.resize(t,n)}catch(e){if(e.code!==`EPIPE`&&e.code!==`ERR_IPC_CHANNEL_CLOSED`)throw e}}$acceptProcessShutdown(e,t){this._terminalProcesses.get(e)?.shutdown(t)}$acceptProcessRequestInitialCwd(e){this._terminalProcesses.get(e)?.getInitialCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:fI.InitialCwd,value:t}))}$acceptProcessRequestCwd(e){this._terminalProcesses.get(e)?.getCwd().then(t=>this._proxy.$sendProcessProperty(e,{type:fI.Cwd,value:t}))}$acceptProcessRequestLatency(e){return Promise.resolve(e)}registerProfileProvider(e,t,n){if(this._profileProviders.has(t))throw Error(`Terminal profile provider "${t}" already registered`);return this._profileProviders.set(t,{provider:n,extension:e}),this._proxy.$registerProfileProvider(t,e.identifier.value),new YT(()=>{this._profileProviders.delete(t),this._proxy.$unregisterProfileProvider(t)})}registerTerminalCompletionProvider(e,t,...n){if(this._completionProviders.has(e.identifier.value))throw Error(`Terminal completion provider "${e.identifier.value}" already registered`);return this._completionProviders.set(e.identifier.value,t),this._proxy.$registerCompletionProvider(e.identifier.value,e.identifier.value,...n),new YT(()=>{this._completionProviders.delete(e.identifier.value),this._proxy.$unregisterCompletionProvider(e.identifier.value)})}async $provideTerminalCompletions(e,t){let n=new Hi().token;if(n.isCancellationRequested||!this.activeTerminal)return;let r=this._completionProviders.get(e);if(!r)return;let i=await r.provideTerminalCompletions(this.activeTerminal,t,n);if(i==null)return;let a=!Tn||this.activeTerminal.state?.shell===cI.GitBash?`/`:`\\`;return kN.from(i,a)}$acceptTerminalShellType(e,t){let n=this.getTerminalById(e);n?.setShellType(t)&&this._onDidChangeTerminalState.fire(n.value)}registerTerminalQuickFixProvider(e,t,n){if(this._quickFixProviders.has(e))throw Error(`Terminal quick fix provider "${e}" is already registered`);return this._quickFixProviders.set(e,n),this._proxy.$registerQuickFixProvider(e,t),new YT(()=>{this._quickFixProviders.delete(e),this._proxy.$unregisterQuickFixProvider(e)})}async $provideTerminalQuickFixes(e,t){let n=new Hi().token;if(n.isCancellationRequested)return;let r=this._quickFixProviders.get(e);if(!r)return;let i=await r.provideTerminalQuickFixes(t,n);if(i===null||Array.isArray(i)&&i.length===0)return;let a=new _;if(this._lastQuickFixCommands.value=a,!Array.isArray(i))return i?DN.from(i,this._extHostCommands.converter,a):void 0;let o=[];for(let e of i){let t=DN.from(e,this._extHostCommands.converter,a);t&&o.push(t)}return o}async $createContributedProfileTerminal(e,t){let n=new Hi().token,r=this._profileProviders.get(e);if(!r)throw Error(`No terminal profile provider registered for id "${e}"`);let i=await r.provider.provideTerminalProfile(n);if(n.isCancellationRequested)return;if(i&&!_t(i,{options:!0})&&(i={options:i}),!i||!_t(i,{options:!0}))throw Error(`No terminal profile options provided for id "${e}"`);let a=Mw(r.extension);!a&&i.options.titleTemplate!==void 0&&(console.error(`[${r.extension.identifier.value}] \`titleTemplate\` returned from TerminalProfileProvider is ignored because the \`terminalTitle\` proposed API is not enabled.`),i={options:{...i.options,titleTemplate:void 0}}),!a&&t.titleTemplate!==void 0&&console.error(`[${r.extension.identifier.value}] \`titleTemplate\` passed to createContributedTerminalProfile is ignored because the \`terminalTitle\` proposed API is not enabled.`);let o=a&&t.titleTemplate&&!i.options.titleTemplate?{...i.options,titleTemplate:t.titleTemplate}:i.options;if(_t(o,{pty:!0})){this.createExtensionTerminal(o,t);return}this.createTerminalFromOptions(o,t)}registerLinkProvider(e){return this._linkProviders.add(e),this._linkProviders.size===1&&this._proxy.$startLinkProvider(),new YT(()=>{this._linkProviders.delete(e),this._linkProviders.size===0&&this._proxy.$stopLinkProvider()})}async $provideLinks(e,t){let n=this.getTerminalById(e);if(!n)return[];this._terminalLinkCache.delete(e),this._terminalLinkCancellationSource.get(e)?.dispose(!0);let r=new Hi;this._terminalLinkCancellationSource.set(e,r);let i=[],a={terminal:n.value,line:t},o=[];for(let e of this._linkProviders)o.push(Go.withAsyncBody(async t=>{let n=r.token.onCancellationRequested(()=>t({provider:e,links:[]}));try{let n=await e.provideTerminalLinks(a,r.token)||[];r.token.isCancellationRequested||t({provider:e,links:n})}finally{n.dispose()}}));let s=await Promise.all(o);if(r.token.isCancellationRequested)return[];let c=new Map;for(let e of s)e&&e.links.length>0&&i.push(...e.links.map(t=>{let n={id:XI++,startIndex:t.startIndex,length:t.length,label:t.tooltip};return c.set(n.id,{provider:e.provider,link:t}),n}));return this._terminalLinkCache.set(e,c),i}$activateLink(e,t){let n=this._terminalLinkCache.get(e)?.get(t);n&&n.provider.handleTerminalLink(n.link)}_onProcessExit(e,t){this._bufferer.stopBuffering(e),this._terminalProcesses.delete(e),delete this._extensionTerminalAwaitingStart[e];let n=this._terminalProcessDisposables[e];n&&(n.dispose(),delete this._terminalProcessDisposables[e]),this._proxy.$sendProcessExit(e,t)}getTerminalById(e){return this._getTerminalObjectById(this._terminals,e)}getTerminalIdByApiObject(e){let t=this._terminals.findIndex(t=>t.value===e);return t>=0?t:null}_getTerminalObjectById(e,t){let n=this._getTerminalObjectIndexById(e,t);return n===null?null:e[n]}_getTerminalObjectIndexById(e,t){let n=e.findIndex(e=>e._id===t);return n>=0?n:null}getEnvironmentVariableCollection(e){let t=this._environmentVariableCollections.get(e.identifier.value);return t||(t=this._register(new QI),this._setEnvironmentVariableCollection(e.identifier.value,t)),t.getScopedEnvironmentVariableCollection(void 0)}_syncEnvironmentVariableCollection(e,t){let n=rI(t.map),r=iI(t.descriptionMap);this._proxy.$setEnvironmentVariableCollection(e,t.persistent,n.length===0?void 0:n,r)}$initEnvironmentVariableCollections(e){e.forEach(e=>{let t=e[0],n=this._register(new QI(e[1]));this._setEnvironmentVariableCollection(t,n)})}$acceptDefaultProfile(e,t){let n=this._defaultProfile;this._defaultProfile=e,this._defaultAutomationProfile=t,n?.path!==e.path&&this._onDidChangeShell.fire(e.path)}_setEnvironmentVariableCollection(e,t){this._environmentVariableCollections.set(e,t),this._register(t.onDidChangeCollection(()=>{this._syncEnvironmentVariableCollection(e,t)}))}};ZI=k([A(1,UI),A(2,Js)],ZI);var QI=class extends v{get persistent(){return this._persistent}set persistent(e){this._persistent=e,this._onDidChangeCollection.fire()}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e){super(),this.map=new Map,this.scopedCollections=new Map,this.descriptionMap=new Map,this._persistent=!0,this._onDidChangeCollection=this._register(new x),this.map=new Map(e)}getScopedEnvironmentVariableCollection(e){let t=this.getScopeKey(e),n=this.scopedCollections.get(t);return n||(n=new $I(this,e),this.scopedCollections.set(t,n),this._register(n.onDidChangeCollection(()=>this._onDidChangeCollection.fire()))),n}replace(e,t,n,r){this._setIfDiffers(e,{value:t,type:eE.Replace,options:n??{applyAtProcessCreation:!0},scope:r})}append(e,t,n,r){this._setIfDiffers(e,{value:t,type:eE.Append,options:n??{applyAtProcessCreation:!0},scope:r})}prepend(e,t,n,r){this._setIfDiffers(e,{value:t,type:eE.Prepend,options:n??{applyAtProcessCreation:!0},scope:r})}_setIfDiffers(e,t){if(t.options&&t.options.applyAtProcessCreation===!1&&!t.options.applyAtShellIntegration)throw Error(`EnvironmentVariableMutatorOptions must apply at either process creation or shell integration`);let n=this.getKey(e,t.scope),r=this.map.get(n),i=t.options?{applyAtProcessCreation:t.options.applyAtProcessCreation??!1,applyAtShellIntegration:t.options.applyAtShellIntegration??!1}:{applyAtProcessCreation:!0};if(!r||r.value!==t.value||r.type!==t.type||r.options?.applyAtProcessCreation!==i.applyAtProcessCreation||r.options?.applyAtShellIntegration!==i.applyAtShellIntegration||r.scope?.workspaceFolder?.index!==t.scope?.workspaceFolder?.index){let n=this.getKey(e,t.scope),r={variable:e,...t,options:i};this.map.set(n,r),this._onDidChangeCollection.fire()}}get(e,t){let n=this.getKey(e,t),r=this.map.get(n);return r?rL(r):void 0}getKey(e,t){let n=this.getScopeKey(t);return n.length?`${e}:::${n}`:e}getScopeKey(e){return this.getWorkspaceKey(e?.workspaceFolder)??``}getWorkspaceKey(e){return e?e.uri.toString():void 0}getVariableMap(e){let t=new Map;for(let[n,r]of this.map)this.getScopeKey(r.scope)===this.getScopeKey(e)&&t.set(r.variable,rL(r));return t}delete(e,t){let n=this.getKey(e,t);this.map.delete(n),this._onDidChangeCollection.fire()}clear(e){if(e?.workspaceFolder){for(let[t,n]of this.map)n.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){let n=this.getScopeKey(t),r=this.descriptionMap.get(n);if(!r||r.description!==e){let r;r=typeof e==`string`?e:e?.value.split(`
|
|
96
|
+
|
|
97
|
+
`)[0];let i={description:r,scope:t};this.descriptionMap.set(n,i),this._onDidChangeCollection.fire()}}getDescription(e){let t=this.getScopeKey(e);return this.descriptionMap.get(t)?.description}clearDescription(e){let t=this.getScopeKey(e);this.descriptionMap.delete(t)}},$I=class{get persistent(){return this.collection.persistent}set persistent(e){this.collection.persistent=e}get onDidChangeCollection(){return this._onDidChangeCollection&&this._onDidChangeCollection.event}constructor(e,t){this.collection=e,this.scope=t,this._onDidChangeCollection=new x}getScoped(e){return this.collection.getScopedEnvironmentVariableCollection(e)}replace(e,t,n){this.collection.replace(e,t,n,this.scope)}append(e,t,n){this.collection.append(e,t,n,this.scope)}prepend(e,t,n){this.collection.prepend(e,t,n,this.scope)}get(e){return this.collection.get(e,this.scope)}forEach(e,t){this.collection.getVariableMap(this.scope).forEach((n,r)=>e.call(t,r,n,this),this.scope)}[Symbol.iterator](){return this.collection.getVariableMap(this.scope).entries()}delete(e){this.collection.delete(e,this.scope),this._onDidChangeCollection.fire(void 0)}clear(){this.collection.clear(this.scope)}set description(e){this.collection.setDescription(e,this.scope)}get description(){return this.collection.getDescription(this.scope)}};let eL=class extends ZI{constructor(e,t,n){super(!1,e,t),this._hasRemoteAuthority=!!n.remote.authority}createTerminal(e,t,n){if(!this._hasRemoteAuthority)throw new fe;return this.createTerminalFromOptions({name:e,shellPath:t,shellArgs:n})}createTerminalFromOptions(e,t){if(!this._hasRemoteAuthority)throw new fe;let n=new JI(this._proxy,Gc(),e,e.name);return this._terminals.push(n),n.create(e,this._serializeParentTerminal(e,t)),n.value}};eL=k([A(0,UI),A(1,Js),A(2,Vs)],eL);function tL(e){if(!(!e||typeof e==`string`))return _t(e,{id:!0})?{id:e.id,color:e.color}:e}function nL(e){return _l.isThemeColor(e)?e:void 0}function rL(e){let t={...e};return delete t.scope,t.options=t.options??void 0,t}function iL(e){return typeof e==`object`&&!!e&&`wwwAuthenticate`in e&&typeof e.wwwAuthenticate==`string`}const aL=`/.well-known`,oL=`${aL}/oauth-protected-resource`,sL=`${aL}/oauth-authorization-server`,cL=`${aL}/openid-configuration`;function lL(e,t,n,r,i,a){let o=new URLSearchParams;return o.append(`client_id`,e),t&&o.append(`client_secret`,t),o.append(`grant_type`,`urn:ietf:params:oauth:grant-type:token-exchange`),o.append(`subject_token`,n),o.append(`subject_token_type`,`urn:ietf:params:oauth:token-type:id_token`),o.append(`requested_token_type`,`urn:ietf:params:oauth:token-type:id-jag`),o.append(`audience`,r),i&&o.append(`resource`,i),a.length&&o.append(`scope`,a.join(` `)),o}function uL(e,t,n,r,i){let a=new URLSearchParams;return a.append(`client_id`,e),t&&a.append(`client_secret`,t),a.append(`grant_type`,`urn:ietf:params:oauth:grant-type:jwt-bearer`),a.append(`assertion`,n),r&&a.append(`resource`,r),i.length&&a.append(`scope`,i.join(` `)),a}var dL;(function(e){e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`})(dL||={});var fL;(function(e){e.AuthorizationPending=`authorization_pending`,e.SlowDown=`slow_down`,e.AccessDenied=`access_denied`,e.ExpiredToken=`expired_token`})(fL||={});var pL;(function(e){e.InvalidRedirectUri=`invalid_redirect_uri`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidSoftwareStatement=`invalid_software_statement`,e.UnapprovedSoftwareStatement=`unapproved_software_statement`})(pL||={});function mL(e){if(typeof e!=`object`||!e)return!1;let t=e;return!(!t.resource||t.scopes_supported!==void 0&&!Array.isArray(t.scopes_supported))}const hL=[`issuer`,`authorization_endpoint`,`token_endpoint`,`registration_endpoint`,`jwks_uri`];function gL(e){if(typeof e!=`object`||!e)return!1;let t=e;if(!t.issuer)throw Error(`Authorization server metadata must have an issuer`);for(let e of hL)if(t[e]){if(typeof t[e]!=`string`)throw Error(`Authorization server metadata '${e}' must be a string`);if(!t[e].startsWith(`https://`)&&!t[e].startsWith(`http://`))throw Error(`Authorization server metadata '${e}' must start with http:// or https://`)}return!0}function _L(e){return typeof e!=`object`||!e?!1:e.client_id!==void 0}function vL(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.access_token!==void 0&&t.token_type!==void 0}function yL(e){return typeof e!=`object`||!e?!1:e.error!==void 0}function bL(e){return typeof e!=`object`||!e?!1:e.error!==void 0}function xL(e){return{issuer:e.toString(),authorization_endpoint:new URL(`/authorize`,e).toString(),token_endpoint:new URL(`/token`,e).toString(),registration_endpoint:new URL(`/register`,e).toString(),response_types_supported:[`code`,`id_token`,`id_token token`]}}const SL=[`authorization_code`,`refresh_token`,`urn:ietf:params:oauth:grant-type:device_code`];async function CL(e,t,n){if(!e.registration_endpoint)throw Error(`Server does not support dynamic registration`);let r={client_name:t,client_uri:`https://code.visualstudio.com`,grant_types:e.grant_types_supported?e.grant_types_supported.filter(e=>SL.includes(e)):SL,response_types:[`code`],redirect_uris:[`https://insiders.vscode.dev/redirect`,`https://vscode.dev/redirect`,`http://127.0.0.1/`,`http://127.0.0.1:33418/`],scope:n?.join(` `),token_endpoint_auth_method:`none`,application_type:`native`},i=await fetch(e.registration_endpoint,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(!i.ok){let t=await i.text(),n=t;try{let e=JSON.parse(t);bL(e)&&(n=`${e.error}${e.error_description?`: ${e.error_description}`:``}`)}catch{}throw Error(`Registration to ${e.registration_endpoint} failed: ${n}`)}let a=await i.json();if(_L(a))return a;throw Error(`Invalid authorization dynamic client registration response: ${JSON.stringify(a)}`)}function wL(e){let t=[],n=[],r=``,i=!1;for(let t=0;t<e.length;t++){let a=e[t];a===`"`?(i=!i,r+=a):a===`,`&&!i?(r.trim()&&n.push(r.trim()),r=``):r+=a}r.trim()&&n.push(r.trim());let a;for(let e of n)if(!e.includes(`=`))a&&t.push(a),a={scheme:e.trim(),params:{}};else{let n=e.indexOf(` `);if(n>0){let r=e.substring(0,n),i=e.substring(n+1);if(!r.includes(`=`)&&i.includes(`=`)){a&&t.push(a),a={scheme:r.trim(),params:{}};let e=i.indexOf(`=`);if(e>0){let t=i.substring(0,e).trim(),n=i.substring(e+1).trim().replace(/^"|"$/g,``);t&&n!==void 0&&(a.params[t]=n)}continue}}if(a){let t=e.indexOf(`=`);if(t>0){let n=e.substring(0,t).trim(),r=e.substring(t+1).trim().replace(/^"|"$/g,``);n&&r!==void 0&&(a.params[n]=r)}}}return a&&t.push(a),t}function TL(e){let t=e.split(`.`);if(t.length!==3)throw Error(`Invalid JWT token format: token must have three parts separated by dots`);let[n,r]=t;try{if(typeof JSON.parse(Yt(n).toString())!=`object`)throw Error(`Invalid JWT token format: header is not a JSON object`);let e=JSON.parse(Yt(r).toString());if(typeof e!=`object`)throw Error(`Invalid JWT token format: payload is not a JSON object`);return e}catch(e){throw e instanceof Error?Error(`Failed to parse JWT token: ${e.message}`):Error(`Failed to parse JWT token`)}}function EL(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])}async function DL(e,t,n={}){let{sameOriginHeaders:r={},fetch:i=fetch}=n,a=new URL(e),o=async(e,t)=>{let n={Accept:`application/json`};new URL(e).origin===a.origin&&(n={...n,...r});let o=await i(e,{method:`GET`,headers:n});if(o.status!==200){let t;try{t=await o.text()}catch{t=o.statusText}throw Error(`Failed to fetch resource metadata from ${e}: ${o.status} ${t}`)}let s=await o.json();if(mL(s)){let n=new URL(s.resource).toString(),r=new URL(t).toString();if(n!==r)throw Error(`Protected Resource Metadata 'resource' property value "${n}" does not match expected value "${r}" for URL ${e}. Per RFC 9728, these MUST match. See https://datatracker.ietf.org/doc/html/rfc9728#PRConfigurationValidation`);return s}else throw Error(`Invalid resource metadata from ${e}. Expected to follow shape of https://datatracker.ietf.org/doc/html/rfc9728#name-protected-resource-metadata (Hints: is scopes_supported an array? Is resource a string?). Current payload: ${JSON.stringify(s)}`)},s=[];if(t)try{return{metadata:await o(t,e),discoveryUrl:t,errors:s}}catch(e){s.push(e instanceof Error?e:Error(String(e)))}let c=a.pathname!==`/`,l=`${a.origin}${oL}`;if(c){let t=`${l}${a.pathname}`;try{return{metadata:await o(t,e),discoveryUrl:t,errors:s}}catch(e){s.push(e instanceof Error?e:Error(String(e)))}}try{return{metadata:await o(l,a.origin),discoveryUrl:l,errors:s}}catch(e){s.push(e instanceof Error?e:Error(String(e)))}throw s.length===1?s[0]:AggregateError(s,`Failed to fetch resource metadata from all attempted URLs`)}async function OL(e){if(e.status===200)try{let t=await e.json();if(gL(t))return t}catch{}}async function kL(e){try{return await e.text()}catch{return e.statusText}}async function AL(e,t={}){let{additionalHeaders:n={},fetch:r=fetch}=t,i=new URL(e),a=i.pathname===`/`?``:i.pathname,o=[],s=async e=>{try{let t=await r(e,{method:`GET`,headers:{...n,Accept:`application/json`}}),i=await OL(t);if(i)return i;o.push(Error(`Failed to fetch authorization server metadata from ${e}: ${t.status} ${await kL(t)}`));return}catch(e){o.push(e instanceof Error?e:Error(String(e)));return}},c=new URL(sL,e).toString()+a,l=await s(c);if(l)return{metadata:l,discoveryUrl:c,errors:o};let u=new URL(cL,e).toString()+a;if(l=await s(u),l)return{metadata:l,discoveryUrl:u,errors:o};let d=e.endsWith(`/`)?e+cL.substring(1):e+cL;if(l=await s(d),l)return{metadata:l,discoveryUrl:d,errors:o};throw o.length===1?o[0]:AggregateError(o,`Failed to fetch authorization server metadata from all attempted URLs`)}var jL;let ML=class{static{jL=this}static{this.InitialState={focused:!0,active:!0}}getState(){let e=this._state;return{get focused(){return e.focused},get active(){return e.active}}}constructor(e,t){this._onDidChangeWindowState=new x,this.onDidChangeWindowState=this._onDidChangeWindowState.event,this._state=jL.InitialState,e.handle&&(this._nativeHandle=Yt(e.handle).buffer),this._proxy=t.getProxy(T.MainThreadWindow),this._proxy.$getInitialState().then(({isFocused:e,isActive:t})=>{this.onDidChangeWindowProperty(`focused`,e),this.onDidChangeWindowProperty(`active`,t)})}get nativeHandle(){return this._nativeHandle}$onDidChangeActiveNativeWindowHandle(e){this._nativeHandle=e?Yt(e).buffer:void 0}$onDidChangeWindowFocus(e){this.onDidChangeWindowProperty(`focused`,e)}$onDidChangeWindowActive(e){this.onDidChangeWindowProperty(`active`,e)}onDidChangeWindowProperty(e,t){t!==this._state[e]&&(this._state={...this._state,[e]:t},this._onDidChangeWindowState.fire(this._state))}openUri(e,t){let n;if(typeof e==`string`){n=e;try{e=C.parse(e)}catch{return Promise.reject(`Invalid uri - '${e}'`)}}return Ji(e.scheme)?Promise.reject(`Invalid scheme - cannot be empty`):e.scheme===D.command?Promise.reject(`Invalid scheme '${e.scheme}'`):this._proxy.$openUri(e,n,t)}async asExternalUri(e,t){if(Ji(e.scheme))return Promise.reject(`Invalid scheme - cannot be empty`);let n=await this._proxy.$asExternalUri(e,t);return C.from(n)}};ML=jL=k([A(0,Vs),A(1,Js)],ML);const NL=O(`IExtHostWindow`);var PL;let FL=class{static{PL=this}static{this.HandlePool=0}constructor(e){this.handles=new Es,this.handlers=new Map,this._proxy=e.getProxy(T.MainThreadUrls)}registerUriHandler(e,t){let n=e.identifier;if(this.handles.has(n))throw Error(`Protocol handler already registered for extension ${n}`);let r=PL.HandlePool++;return this.handles.add(n),this.handlers.set(r,t),this._proxy.$registerUriHandler(r,n,e.displayName||e.name),g(()=>{this.handles.delete(n),this.handlers.delete(r),this._proxy.$unregisterUriHandler(r)})}$handleExternalUri(e,t){let n=this.handlers.get(e);if(!n)return Promise.resolve(void 0);try{n.handleUri(C.revive(t))}catch(e){m(e)}return Promise.resolve(void 0)}async createAppUri(e){return C.revive(await this._proxy.$createAppUri(e))}};FL=PL=k([A(0,Js)],FL);const IL=O(`IExtHostUrlsService`);function LL(e){return(t,n,r)=>{let i=null,a=null;if(typeof r.value==`function`?(i=`value`,a=r.value):typeof r.get==`function`&&(i=`get`,a=r.get),!a||typeof n==`symbol`)throw Error(`not supported`);r[i]=e(a,n)}}function RL(e,t,n){return LL((t,n)=>{let r=`$debounce$${n}`,i=`$debounce$result$${n}`;return function(...n){this[i]||(this[i]=void 0),clearTimeout(this[r]),this[r]=setTimeout(()=>{t.apply(this,n),this[i]=void 0},e)}})}function zL(e,t,n){return LL((r,i)=>{let a=`$throttle$timer$${i}`,o=`$throttle$result$${i}`,s=`$throttle$lastRun$${i}`,c=`$throttle$pending$${i}`;return function(...i){if(this[o]||(this[o]=n?n():void 0),(this[s]===null||this[s]===void 0)&&(this[s]=-Number.MAX_VALUE),t&&(this[o]=t(this[o],...i)),this[c])return;let l=this[s]+e;l<=Date.now()?(this[s]=Date.now(),r.apply(this,[this[o]]),this[o]=n?n():void 0):(this[c]=!0,this[a]=setTimeout(()=>{this[c]=!1,this[s]=Date.now(),r.apply(this,[this[o]]),this[o]=n?n():void 0},l-Date.now()))}})}const BL=O(`IExtHostProgress`);let VL=class{constructor(e){this._handles=0,this._mapHandleToCancellationSource=new Map,this._proxy=e.getProxy(T.MainThreadProgress)}async withProgress(e,t,n){let r=this._handles++,{title:i,location:a,cancellable:o}=t,s={label:e.displayName||e.name,id:e.identifier.value};return this._proxy.$startProgress(r,{location:lM.from(a),title:i,source:s,cancellable:o},e.isUnderDevelopment?void 0:e.identifier.value).catch(ee),this._withProgress(r,n,!!o)}async withProgressFromSource(e,t,n){let r=this._handles++,{title:i,location:a,cancellable:o}=t;return this._proxy.$startProgress(r,{location:lM.from(a),title:i,source:e,cancellable:o},void 0).catch(ee),this._withProgress(r,n,!!o)}_withProgress(e,t,n){let r;n&&(r=new Hi,this._mapHandleToCancellationSource.set(e,r));let i=e=>{this._proxy.$progressEnd(e),this._mapHandleToCancellationSource.delete(e),r?.dispose()},a;try{a=t(new UL(this._proxy,e),n&&r?r.token:Bi.None)}catch(t){throw i(e),t}return a.then(t=>i(e),t=>i(e)),a}$acceptProgressCanceled(e){let t=this._mapHandleToCancellationSource.get(e);t&&(t.cancel(),this._mapHandleToCancellationSource.delete(e))}};VL=k([A(0,Js)],VL);function HL(e,t){return e.message=t.message,typeof t.increment==`number`&&(typeof e.increment==`number`?e.increment+=t.increment:e.increment=t.increment),e}var UL=class extends Om{constructor(e,t){super(e=>this.throttledReport(e)),this._proxy=e,this._handle=t}throttledReport(e){this._proxy.$progressReport(this._handle,e)}};UL.__decorator=k([zL(100,(e,t)=>HL(e,t),()=>Object.create(null))],UL.prototype,`throttledReport`,null);const WL=[`openid`,`offline_access`];function GL(e,t){return e+`|`+[...t].sort().join(` `)}function KL(e,t=Date.now()){return e.token.expires_in===void 0?!1:t>e.created_at+e.token.expires_in*1e3-6e4}function qL(e){return class extends e{_resourceClientSecretKey(e,t){return`${e}|${t}`}constructor(...e){super(...e),this._resourceTokens=new Map,this._resourceClientSecrets=new Map;let t=this.authorizationServer;this.id=`xaa:${t.toString(!0)}`,this._logger.trace(`[XAA] Provider constructed for issuer ${t.toString(!0)}. authorization_endpoint=${this._serverMetadata.authorization_endpoint}, token_endpoint=${this._serverMetadata.token_endpoint}`)}async getSessions(e,t){let n=t.resource,r=t.audience;if(!n||!e||!r)return[];let i=GL(n,e),a=this._resourceTokens.get(i);if(a&&!KL(a))return[JL(a.token,a.scopes)];a&&this._resourceTokens.delete(i);let o=await this._tryGetSilentIdpSession();if(!o?.idToken)return[];try{let i=await this._mintResourceToken(o,[...e],r,n,t,!0);return i?[JL(i.token,i.scopes)]:[]}catch(e){return this._logger.warn(`[XAA] Silent token mint failed for resource=${n}; falling back to interactive. Error: ${e.message}`),[]}}async createSession(e,t){let n=t.audience,r=t.resource;if(this._logger.trace(`[XAA] createSession scopes=[${e.join(` `)}] audience=${n} resource=${r}`),!n)throw Error("Enterprise-managed authentication requires `options.audience` (the resource's authorization server URL) but none was provided.");if(!r)throw Error("Enterprise-managed authentication requires `options.resource` (the resource indicator / MCP server URL) but none was provided.");let i=await this._ensureIdpSession();if(!i.idToken)throw Error("IdP session is missing an id_token; the issuer must support OpenID Connect and the `openid` scope.");let a=await this._mintResourceToken(i,e,n,r,t,!1);if(!a)throw Error(`Failed to mint a resource access token for the enterprise-managed MCP server.`);return JL(a.token,a.scopes)}async _mintResourceToken(e,t,n,r,i,a){let o=await this._exchangeForIdJag(e.idToken,n,r,t),s=await this._discoverResourceTokenEndpoint(n),c=this._clientId,l=!1,u=typeof i.clientId==`string`&&i.clientId.length>0?i.clientId:void 0;if(u)c=u,l=c!==this._clientId;else try{let e=TL(o);typeof e.client_id==`string`&&e.client_id.length>0&&(c=e.client_id,l=c!==this._clientId)}catch(e){this._logger.warn(`[XAA] Could not decode ID-JAG to read resource client_id; falling back to IdP client_id. Error: ${e.message}`)}let d=this._clientSecret,f=typeof i.clientSecret==`string`&&i.clientSecret.length>0?i.clientSecret:void 0,p=this._resourceClientSecretKey(r,c);if(f)d=f,this._resourceClientSecrets.set(p,f);else if(l)if(this._resourceClientSecrets.has(p))d=this._resourceClientSecrets.get(p);else if(a){this._logger.info(`[XAA] Silent mint requires resource client_secret for '${c}' but none is cached or configured; deferring to interactive flow.`);return}else{this._logger.info(`[XAA] Resource AS requires a distinct client_id '${c}' — prompting for matching client_secret.`);let e=await this._proxy.$promptForResourceClientSecret(c,r);if(e===void 0)return;this._resourceClientSecrets.set(p,e),d=e.length>0?e:void 0}let m={resource:r,scopes:t,token:await this._redeemAtResource(s,o,r,t,c,d),created_at:Date.now()};return this._resourceTokens.set(GL(r,t),m),m}async _tryGetSilentIdpSession(){let e=await super.getSessions(WL,{});return e.length?e[0]:void 0}async _ensureIdpSession(){this._logger.trace(`[XAA] _ensureIdpSession: scopes=[${WL.join(` `)}] authorization_endpoint=${this._serverMetadata.authorization_endpoint}`);let e=await this._tryGetSilentIdpSession();return e?.idToken?(this._logger.trace(`[XAA] _ensureIdpSession: reusing existing IdP session`),e):(this._logger.trace(`[XAA] _ensureIdpSession: creating new IdP session via super.createSession`),super.createSession([...WL],{}))}async _exchangeForIdJag(e,t,n,r){let i=this._serverMetadata.token_endpoint;if(!i)throw Error(`Issuer metadata is missing token_endpoint; cannot perform XAA token exchange.`);let a=lL(this._clientId,this._clientSecret,e,t,n,r);this._logger.trace(`[XAA] POST ${i} (ID-JAG exchange) audience=${t} resource=${n} scope=${r.join(` `)}`);let o=await fetch(i,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:a.toString()});if(!o.ok)throw Error(`XAA token exchange (IdP) failed: ${o.status} ${await YL(o)}`);let s=await o.json(),c=s&&typeof s==`object`&&typeof s.access_token==`string`?s.access_token:void 0;if(!c)throw Error(`XAA token exchange (IdP) returned no access_token. Response: ${JSON.stringify(s)}`);return c}async _discoverResourceTokenEndpoint(e){let{metadata:t,errors:n}=await AL(e);if(!t?.token_endpoint)throw Error(`Failed to discover resource authorization server metadata for '${e}': ${n.map(e=>e.message).join(`; `)||`no token_endpoint in metadata`}`);return t.token_endpoint}async _redeemAtResource(e,t,n,r,i,a){let o=uL(i,a,t,n,r);this._logger.trace(`[XAA] POST ${e} (ID-JAG redemption) client_id=${i} resource=${n} scope=${r.join(` `)}`);let s=await fetch(e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:o.toString()});if(!s.ok)throw Error(`XAA token exchange (resource) failed: ${s.status} ${await YL(s)}`);let c=await s.json();if(!vL(c))throw Error(`XAA token exchange (resource) returned an invalid token response: ${JSON.stringify(c)}`);return c}}}function JL(e,t){let n;if(e.id_token)try{n=TL(e.id_token)}catch{}if(!n)try{n=TL(e.access_token)}catch{}return{id:Fh(e.access_token,0).toString(),accessToken:e.access_token,account:{id:n?.sub||`unknown`,label:n?.preferred_username||n?.name||n?.email||`XAA`},scopes:[...t],idToken:e.id_token}}async function YL(e){try{return await e.text()}catch{return e.statusText}}const XL=O(`IExtHostAuthentication`);let ZL=class{constructor(e,t,n,r,i,a,o){this._initData=t,this._extHostWindow=n,this._extHostUrls=r,this._extHostProgress=i,this._extHostLoggerService=a,this._logService=o,this._dynamicAuthProviderCtor=$L,this._xaaAuthProviderCtor=qL($L),this._authenticationProviders=new Map,this._providerOperations=new Eo,this._onDidChangeSessions=new x,this._getSessionTaskSingler=new QL,this._onDidDynamicAuthProviderTokensChange=new x,this._proxy=e.getProxy(T.MainThreadAuthentication)}getExtensionScopedSessionsEvent(e){let t=e.toLowerCase();return ir.chain(this._onDidChangeSessions.event,e=>e.filter(e=>!e.extensionIdFilter||e.extensionIdFilter.includes(t)).map(e=>({provider:e.provider})))}async getSession(e,t,n,r={}){let i=Ts.toKey(e.identifier),a=Object.keys(r).map(e=>{switch(e){case`account`:return`${e}:${r.account?.id}`;case`createIfNone`:case`forceNewSession`:return`${e}:${typeof r[e]==`boolean`?`${r[e]}`:`'${r[e]?.detail}/${r[e]?.learnMore?.toString()}'`}`;case`authorizationServer`:return`${e}:${r.authorizationServer?.toString(!0)}`;default:return`${e}:${!!r[e]}`}}).sort().join(`, `),o;if(iL(n)){let e=n;o=`${i} ${t} challenge:${e.wwwAuthenticate} ${e.fallbackScopes?[...e.fallbackScopes].sort().join(` `):``} ${a}`}else o=`${i} ${t} ${[...n].sort().join(` `)} ${a}`;return await this._getSessionTaskSingler.getOrCreate(o,async()=>{await this._proxy.$ensureProvider(t);let a=e.displayName||e.name;return this._proxy.$getSession(t,n,i,a,r)})}async getAccounts(e){return await this._proxy.$ensureProvider(e),await this._proxy.$getAccounts(e)}registerAuthenticationProvider(e,t,n,r){return this._providerOperations.queue(e,async()=>{if(this._authenticationProviders.get(e)){this._logService.error(`An authentication provider with id '${e}' is already registered. The existing provider will not be replaced.`);return}let i=n.onDidChangeSessions(t=>this._proxy.$sendDidChangeSessions(e,t));this._authenticationProviders.set(e,{label:t,provider:n,disposable:i,options:r??{supportsMultipleAccounts:!1}}),await this._proxy.$registerAuthenticationProvider({id:e,label:t,supportsMultipleAccounts:r?.supportsMultipleAccounts??!1,supportedAuthorizationServers:r?.supportedAuthorizationServers,supportsChallenges:r?.supportsChallenges})}),new YT(()=>{this._providerOperations.queue(e,async()=>{let t=this._authenticationProviders.get(e);t&&(t.disposable?.dispose(),this._authenticationProviders.delete(e),await this._proxy.$unregisterAuthenticationProvider(e))})})}$createSession(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r)return n.authorizationServer=C.revive(n.authorizationServer),await r.provider.createSession(t,n);throw Error(`Unable to find authentication provider with handle: ${e}`)})}$removeSession(e,t){return this._providerOperations.queue(e,async()=>{let n=this._authenticationProviders.get(e);if(n)return await n.provider.removeSession(t);throw Error(`Unable to find authentication provider with handle: ${e}`)})}$getSessions(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r)return n.authorizationServer=C.revive(n.authorizationServer),await r.provider.getSessions(t,n);throw Error(`Unable to find authentication provider with handle: ${e}`)})}$getSessionsFromChallenges(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r){let i=r.provider;if(typeof i.getSessionsFromChallenges==`function`)return n.authorizationServer=C.revive(n.authorizationServer),await i.getSessionsFromChallenges(t,n);throw Error(`Authentication provider with handle: ${e} does not support getSessionsFromChallenges`)}throw Error(`Unable to find authentication provider with handle: ${e}`)})}$createSessionFromChallenges(e,t,n){return this._providerOperations.queue(e,async()=>{let r=this._authenticationProviders.get(e);if(r){let i=r.provider;if(typeof i.createSessionFromChallenges==`function`)return n.authorizationServer=C.revive(n.authorizationServer),await i.createSessionFromChallenges(t,n);throw Error(`Authentication provider with handle: ${e} does not support createSessionFromChallenges`)}throw Error(`Unable to find authentication provider with handle: ${e}`)})}$onDidChangeAuthenticationSessions(e,t,n){return e.startsWith(`__`)||this._onDidChangeSessions.fire({provider:{id:e,label:t},extensionIdFilter:n}),Promise.resolve()}$onDidUnregisterAuthenticationProvider(e){return this._providerOperations.queue(e,async()=>{let t=this._authenticationProviders.get(e);t&&(t.disposable?.dispose(),this._authenticationProviders.delete(e))})}async $registerDynamicAuthProvider(e,t,n,r,i,a){if(!r){let a=C.revive(e);if(t.registration_endpoint)try{let e=await CL(t,this._initData.environment.appName,n?.scopes_supported);r=e.client_id,i=e.client_secret}catch(e){this._logService.warn(`Dynamic registration failed for ${a.toString()}: ${e.message}. Prompting user for client ID and client secret...`)}if(!r){this._logService.info(`Prompting user for client registration details for ${a.toString()}`);let e=await this._proxy.$promptForClientRegistration(a.toString());if(!e)throw Error(`User did not provide client details`);r=e.clientId,i=e.clientSecret,this._logService.info(`User provided client registration for ${a.toString()}`),i?this._logService.trace(`User provided client secret for ${a.toString()}`):this._logService.trace(`User did not provide client secret for ${a.toString()}`)}}let o=new this._dynamicAuthProviderCtor(this._extHostWindow,this._extHostUrls,this._initData,this._extHostProgress,this._extHostLoggerService,this._proxy,C.revive(e),t,n,r,i,this._onDidDynamicAuthProviderTokensChange,a||[]);return await this._providerOperations.queue(o.id,async()=>{this._authenticationProviders.set(o.id,{label:o.label,provider:o,disposable:YT.from(o,o.onDidChangeSessions(e=>this._proxy.$sendDidChangeSessions(o.id,e)),o.onDidChangeClientId(()=>this._proxy.$sendDidChangeDynamicProviderInfo({providerId:o.id,clientId:o.clientId,clientSecret:o.clientSecret}))),options:{supportsMultipleAccounts:!0}}),await this._proxy.$registerDynamicAuthenticationProvider({id:o.id,label:o.label,supportsMultipleAccounts:!0,authorizationServer:e,resourceServer:n?C.parse(n.resource):void 0,clientId:o.clientId,clientSecret:o.clientSecret})}),o.id}async $registerXaaAuthProvider(e,t,n,r,i){let a=C.revive(e);if(!n){this._logService.info(`Prompting user for client registration details for XAA issuer ${a.toString()}`);let e=await this._proxy.$promptForClientRegistration(a.toString());if(!e)throw Error(`User did not provide client details`);n=e.clientId,r=e.clientSecret}let o=new this._xaaAuthProviderCtor(this._extHostWindow,this._extHostUrls,this._initData,this._extHostProgress,this._extHostLoggerService,this._proxy,a,t,void 0,n,r,this._onDidDynamicAuthProviderTokensChange,i||[]);return await this._providerOperations.queue(o.id,async()=>{this._authenticationProviders.set(o.id,{label:o.label,provider:o,disposable:YT.from(o,o.onDidChangeSessions(e=>this._proxy.$sendDidChangeSessions(o.id,e)),o.onDidChangeClientId(()=>this._proxy.$sendDidChangeDynamicProviderInfo({providerId:o.id,clientId:o.clientId,clientSecret:o.clientSecret}))),options:{supportsMultipleAccounts:!0}}),await this._proxy.$registerDynamicAuthenticationProvider({id:o.id,label:o.label,supportsMultipleAccounts:!0,authorizationServer:e,resourceServer:void 0,clientId:o.clientId,clientSecret:o.clientSecret})}),o.id}async $onDidChangeDynamicAuthProviderTokens(e,t,n){this._onDidDynamicAuthProviderTokensChange.fire({authProviderId:e,clientId:t,tokens:n})}};ZL=k([A(0,Js),A(1,Vs),A(2,NL),A(3,IL),A(4,BL),A(5,Ps),A(6,Ns)],ZL);var QL=class{constructor(){this._inFlightPromises=new Map}getOrCreate(e,t){let n=this._inFlightPromises.get(e);if(n)return n;let r=t().finally(()=>this._inFlightPromises.delete(e));return this._inFlightPromises.set(e,r),r}};let $L=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){this._extHostWindow=e,this._extHostUrls=t,this._initData=n,this._extHostProgress=r,this._proxy=a,this.authorizationServer=o,this._serverMetadata=s,this._resourceMetadata=c,this._clientId=l,this._clientSecret=u,this._onDidChangeSessions=new x,this.onDidChangeSessions=this._onDidChangeSessions.event,this._onDidChangeClientId=new x,this.onDidChangeClientId=this._onDidChangeClientId.event;let p=o.toString(!0);this.id=c?.resource?p+` `+c?.resource:p,this.label=c?.resource_name??this.authorizationServer.authority,this._logger=i.createLogger(this.id,{name:`Auth: ${this.label}`}),this._disposable=new _,this._disposable.add(this._onDidChangeSessions),this._disposable.add(this._onDidChangeClientId);let m=ir.chain(d.event,e=>e.filter(e=>e.authProviderId===this.id&&e.clientId===l).map(e=>e.tokens));this._tokenStore=this._disposable.add(new eR({onDidChange:m,set:e=>a.$setSessionsForDynamicAuthProvider(this.id,this.clientId,e)},f,this._logger)),this._disposable.add(this._tokenStore.onDidChangeSessions(e=>this._onDidChangeSessions.fire(e))),this._createFlows=[],s.authorization_endpoint&&this._createFlows.push({label:b(2859,`URL Handler`),handler:(e,t,n)=>this._createWithUrlHandler(e,t,n)})}get clientId(){return this._clientId}get clientSecret(){return this._clientSecret}async getSessions(e,t){if(this._logger.info(`Getting sessions for scopes: ${e?.join(` `)??`all`}`),!e)return this._tokenStore.sessions;let n=[...e].sort(),r=e.join(` `),i=this._tokenStore.sessions.filter(e=>ge([...e.scopes].sort(),n));if(this._logger.info(`Found ${i.length} sessions for scopes: ${r}`),i.length){let e=[],t=[],a=new Map(this._tokenStore.tokens.map(e=>[e.access_token,e]));for(let n of i){let i=a.get(n.accessToken);if(i&&i.expires_in){let a=Date.now(),o=i.expires_in*1e3;if(a>i.created_at+o-300*1e3){if(this._logger.info(`Token for session ${n.id} is about to expire, refreshing...`),t.push(i),!i.refresh_token){this._logger.warn(`No refresh token available for scopes ${n.scopes.join(` `)}. Throwing away token.`);continue}try{let t=await this.exchangeRefreshTokenForToken(i.refresh_token);t.scope!==r&&(this._logger.warn(`Token scopes '${t.scope}' do not match requested scopes '${r}'. Overwriting token with what was requested...`),t.scope=r),this._logger.info(`Successfully created a new token for scopes ${n.scopes.join(` `)}.`),e.push(t)}catch(e){this._logger.error(`Failed to refresh token: ${e}`)}}}}return(e.length||t.length)&&(this._tokenStore.update({added:e,removed:t}),i=this._tokenStore.sessions.filter(e=>ge([...e.scopes].sort(),n))),this._logger.info(`Found ${i.length} sessions for scopes: ${r}`),i}return[]}async createSession(e,t){this._logger.info(`Creating session for scopes: ${e.join(` `)}`);let n;for(let t=0;t<this._createFlows.length;t++){let{handler:r}=this._createFlows[t];try{if(n=await this._extHostProgress.withProgressFromSource({label:this.label,id:this.id},{location:yD.Notification,title:b(2860,`Authenticating to '{0}'`,this.label),cancellable:!0},(t,n)=>r(e,t,n)),n)break}catch(e){let n=this._createFlows[t+1]?.label;if(!n)break;let r=re(e)?b(2861,`Having trouble authenticating to '{0}'? Would you like to try a different way? ({1})`,this.label,n):b(2862,`You have not yet finished authenticating to '{0}'. Would you like to try a different way? ({1})`,this.label,n);if(!await this._proxy.$showContinueNotification(r))throw new ie;this._logger.error(`Failed to create token via flow '${n}': ${e}`)}}if(!n)throw Error(`Failed to create authentication token`);n.scope!==e.join(` `)&&(this._logger.warn(`Token scopes '${n.scope}' do not match requested scopes '${e.join(` `)}'. Overwriting token with what was requested...`),n.scope=e.join(` `)),this._tokenStore.update({added:[{...n,created_at:Date.now()}],removed:[]});let r=this._tokenStore.sessions.find(e=>e.accessToken===n.access_token);return this._logger.info(`Created ${n.refresh_token?`refreshable`:`non-refreshable`} session for scopes: ${n.scope}${n.expires_in?` that expires in ${n.expires_in} seconds`:``}`),r}async removeSession(e){this._logger.info(`Removing session with id: ${e}`);let t=this._tokenStore.sessions.find(t=>t.id===e);if(!t){this._logger.error(`Session with id ${e} not found`);return}let n=this._tokenStore.tokens.find(e=>e.access_token===t.accessToken);if(!n){this._logger.error(`Failed to retrieve token for removed session: ${t.id}`);return}this._tokenStore.update({added:[],removed:[n]}),this._logger.info(`Removed token for session: ${t.id} with scopes: ${t.scopes.join(` `)}`)}dispose(){this._disposable.dispose()}async _createWithUrlHandler(e,t,n){if(!this._serverMetadata.authorization_endpoint)throw Error(`Authorization Endpoint required`);if(!this._serverMetadata.token_endpoint)throw Error(`Token endpoint not available in server metadata`);let r=this.generateRandomString(64),i=await this.generateCodeChallenge(r),a=this.generateRandomString(32),o=C.parse(`${this._initData.environment.appUriScheme}://dynamicauthprovider/${this.authorizationServer.authority}/authorize?nonce=${a}`),s;try{s=await this._extHostUrls.createAppUri(o)}catch(e){throw Error(`Failed to create external URI: ${e}`)}let c=new URL(this._serverMetadata.authorization_endpoint);c.searchParams.append(`client_id`,this._clientId),c.searchParams.append(`response_type`,`code`),c.searchParams.append(`state`,s.toString()),c.searchParams.append(`code_challenge`,i),c.searchParams.append(`code_challenge_method`,`S256`);let l=e.join(` `);l&&c.searchParams.append(`scope`,l),this._resourceMetadata?.resource&&c.searchParams.append(`resource`,this._resourceMetadata.resource);let u=`https://vscode.dev/redirect`;c.searchParams.append(`redirect_uri`,u);let d=this.waitForAuthorizationCode(o);if(this._logger.info(`Opening authorization URL for scopes: ${l}`),this._logger.trace(`Authorization URL: ${c.toString()}`),!await this._extHostWindow.openUri(c.toString(),{}))throw new ie;t.report({message:b(2863,`Complete the authentication in the browser window that has opened.`)});let f;try{f=(await xo(d,n)).code}catch(e){throw re(e)?(this._logger.info(`Authorization code request was cancelled by the user.`),e):(this._logger.error(`Failed to receive authorization code: ${e}`),Error(`Failed to receive authorization code: ${e}`))}return this._logger.info(`Authorization code received for scopes: ${l}`),await this.exchangeCodeForToken(f,r,u)}generateRandomString(e){let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t).map(e=>e.toString(16).padStart(2,`0`)).join(``).substring(0,e)}async generateCodeChallenge(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Xt(y.wrap(new Uint8Array(n)),!1,!1).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}async waitForAuthorizationCode(e){let t=await this._proxy.$waitForUriHandler(e),n=/[?&]code=([^&]+)/.exec(t.query||``);if(!n||n.length<2)throw Error(`Authentication failed: No authorization code received`);return{code:n[1]}}async exchangeCodeForToken(e,t,n){if(!this._serverMetadata.token_endpoint)throw Error(`Token endpoint not available in server metadata`);let r=new URLSearchParams;r.append(`client_id`,this._clientId),r.append(`grant_type`,`authorization_code`),r.append(`code`,e),r.append(`redirect_uri`,n),r.append(`code_verifier`,t),this._resourceMetadata?.resource&&r.append(`resource`,this._resourceMetadata.resource),this._clientSecret&&r.append(`client_secret`,this._clientSecret),this._logger.info(`Exchanging authorization code for token...`),this._logger.trace(`Url: ${this._serverMetadata.token_endpoint}`),this._logger.trace(`Token request body: ${r.toString()}`);let i;try{i=await fetch(this._serverMetadata.token_endpoint,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:r.toString()})}catch(e){throw this._logger.error(`Failed to exchange authorization code for token: ${e}`),Error(`Failed to exchange authorization code for token: ${e}`)}if(!i.ok){let e=await i.text();throw Error(`Token exchange failed: ${i.status} ${i.statusText} - ${e}`)}let a=await i.json();if(vL(a))return this._logger.info(`Successfully exchanged authorization code for token.`),a;throw yL(a)&&a.error===dL.InvalidClient?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),Error(`Client ID was invalid, generated a new one. Please try again.`)):Error(`Invalid authorization token response: ${JSON.stringify(a)}`)}async exchangeRefreshTokenForToken(e){if(!this._serverMetadata.token_endpoint)throw Error(`Token endpoint not available in server metadata`);let t=new URLSearchParams;t.append(`client_id`,this._clientId),t.append(`grant_type`,`refresh_token`),t.append(`refresh_token`,e),this._resourceMetadata?.resource&&t.append(`resource`,this._resourceMetadata.resource),this._clientSecret&&t.append(`client_secret`,this._clientSecret);let n=await(await fetch(this._serverMetadata.token_endpoint,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`},body:t.toString()})).json();if(vL(n))return{...n,created_at:Date.now()};throw yL(n)&&n.error===dL.InvalidClient?(this._logger.warn(`Client ID (${this._clientId}) was invalid, generated a new one.`),await this._generateNewClientId(),Error(`Client ID was invalid, generated a new one. Please try again.`)):Error(`Invalid authorization token response: ${JSON.stringify(n)}`)}async _generateNewClientId(){try{let e=await CL(this._serverMetadata,this._initData.environment.appName,this._resourceMetadata?.scopes_supported);this._clientId=e.client_id,this._clientSecret=e.client_secret,this._onDidChangeClientId.fire()}catch(e){this._logger.info(`Dynamic registration failed for ${this.authorizationServer.toString()}: ${e}. Prompting user for client ID and client secret.`);try{let e=await this._proxy.$promptForClientRegistration(this.authorizationServer.toString());if(!e)throw Error(`User did not provide client details`);this._clientId=e.clientId,this._clientSecret=e.clientSecret,this._logger.info(`User provided client ID for ${this.authorizationServer.toString()}`),e.clientSecret?this._logger.info(`User provided client secret for ${this.authorizationServer.toString()}`):this._logger.info(`User did not provide client secret for ${this.authorizationServer.toString()} (optional)`),this._onDidChangeClientId.fire()}catch{throw this._logger.error(`Failed to fetch new client ID and user did not provide one: ${e}`),Error(`Failed to fetch new client ID and user did not provide one: ${e}`)}}}};$L=k([A(0,NL),A(1,IL),A(2,Vs),A(3,BL),A(4,Ps)],$L);var eR=class{constructor(e,t,n){this._persistence=e,this._logger=n,this._onDidChangeSessions=new x,this.onDidChangeSessions=this._onDidChangeSessions.event,this._disposable=new _,this._tokensObservable=vv(`tokens`,t),this._sessionsObservable=fv({equalsFn:(e,t)=>ge(e,t,(e,t)=>e.accessToken===t.accessToken)},e=>this._tokensObservable.read(e).map(e=>this._getSessionFromToken(e))),this._disposable.add(this._registerChangeEventAutorun()),this._disposable.add(this._persistence.onDidChange(e=>this._tokensObservable.set(e,void 0)))}get tokens(){return this._tokensObservable.get()}get sessions(){return this._sessionsObservable.get()}dispose(){this._disposable.dispose()}update({added:e,removed:t}){this._logger.trace(`Updating tokens: added ${e.length}, removed ${t.length}`);let n=[...this._tokensObservable.get()];for(let e of t){let t=n.findIndex(t=>t.access_token===e.access_token);t!==-1&&n.splice(t,1)}for(let t of e){let e=n.findIndex(e=>e.access_token===t.access_token);e===-1?n.push(t):n[e]=t}(e.length||t.length)&&(this._tokensObservable.set(n,void 0),this._persistence.set(n)),this._logger.trace(`Tokens updated: ${n.length} tokens stored.`)}_registerChangeEventAutorun(){let e=[];return pv(t=>{this._logger.trace(`Checking for session changes...`);let n=this._sessionsObservable.read(t);if(e===n){this._logger.trace(`No session changes detected.`);return}if(!n||n.length===0){this._logger.trace(`All sessions removed.`),e.length>0&&(this._onDidChangeSessions.fire({added:[],removed:e,changed:[]}),e=[]);return}let r=[],i=[];for(let t of n)e.some(e=>e.accessToken===t.accessToken)||r.push(t);for(let t of e)n.some(e=>e.accessToken===t.accessToken)||i.push(t);(r.length>0||i.length>0)&&(this._logger.trace(`Sessions changed: added ${r.length}, removed ${i.length}`),this._onDidChangeSessions.fire({added:r,removed:i,changed:[]})),e=n})}_getSessionFromToken(e){let t;if(e.id_token)try{t=TL(e.id_token)}catch{}if(!t)try{t=TL(e.access_token)}catch{}let n=e.scope?e.scope.split(` `):t?.scope?t.scope.split(` `):[];return{id:Fh(e.access_token,0).toString(),accessToken:e.access_token,account:{id:t?.sub||`unknown`,label:t?.preferred_username||t?.name||t?.email||`MCP`},scopes:n,idToken:e.id_token}}},tR;const nR=O(`IExtHostLanguageModels`);var rR=class{constructor(){this._defaultStream=new Jo,this._isDone=!1;let e=this,[t,n]=Xo.tee(e._defaultStream.asyncIterable);this.apiObject={get stream(){return t},get text(){return n.map(e=>{if(e instanceof UA)return e.value}).coalesce()}}}handleResponsePart(e){if(this._isDone)return;let t=[];for(let n of vt.wrap(e)){let e;e=n.type===`text`?new UA(n.value,n.audience):n.type===`thinking`?new KA(n.value,n.id,n.metadata):n.type===`data`?new WA(n.data.buffer,n.mimeType,n.audience):new VA(n.toolCallId,n.name,n.parameters),t.push(e)}this._defaultStream.emitMany(t)}reject(e){this._isDone=!0,this._defaultStream.reject(e)}resolve(){this._isDone=!0,this._defaultStream.resolve()}};let iR=class{static{tR=this}static{this._idPool=1}constructor(e,t,n){this._logService=t,this._extHostAuthentication=n,this._onDidChangeModelAccess=new x,this._onDidChangeProviders=new x,this.onDidChangeProviders=this._onDidChangeProviders.event,this._onDidChangeModelProxyAvailability=new x,this.onDidChangeModelProxyAvailability=this._onDidChangeModelProxyAvailability.event,this._languageModelProviders=new Map,this._localModels=new Map,this._modelAccessList=new Ds,this._pendingRequest=new Map,this._ignoredFileProviders=new Map,this._languageAccessInformationExtensions=new Set,this._proxy=e.getProxy(T.MainThreadLanguageModels)}dispose(){this._onDidChangeModelAccess.dispose(),this._onDidChangeProviders.dispose(),this._onDidChangeModelProxyAvailability.dispose()}registerLanguageModelChatProvider(e,t,n){this._languageModelProviders.set(t,{extension:e,provider:n}),this._proxy.$registerLanguageModelProvider(t);let r;return n.onDidChangeLanguageModelChatInformation&&(r=n.onDidChangeLanguageModelChatInformation(()=>{this._proxy.$onLMProviderChange(t)})),g(()=>{this._languageModelProviders.delete(t),this._localModels.forEach((e,n)=>{e.metadata.vendor===t&&this._localModels.delete(n)}),r?.dispose(),this._proxy.$unregisterProvider(t)})}toModelIdentifier(e,t,n){return t?`${e}/${t}/${n}`:`${e}/${n}`}getVendorFromModelIdentifier(e){let t=e.indexOf(`/`);return t===-1?void 0:e.substring(0,t)}async $provideLanguageModelChatInfo(e,t,n){let r=this._languageModelProviders.get(e);if(!r)return[];let i=await r.provider.provideLanguageModelChatInformation({silent:t.silent,configuration:t.configuration},n)??[],a=i.map(n=>{let i;n.requiresAuthorization&&Mw(r.extension)&&(i={providerLabel:r.extension.displayName||r.extension.name,accountLabel:typeof n.requiresAuthorization==`object`?n.requiresAuthorization.label:void 0}),n.capabilities.editTools&&K(r.extension,`chatProvider`);let a={};if(Mw(r.extension)){if(n.isDefault===!0)for(let e of Object.values(xy))typeof e==`string`&&(a[e]=!0);else if(typeof n.isDefault==`object`)for(let e of Object.keys(n.isDefault)){let t=parseInt(e);a[vN.from(t)]=n.isDefault[t]}}return{metadata:{extension:r.extension.identifier,id:n.id,vendor:e,name:n.name??``,family:n.family??``,detail:n.detail,tooltip:n.tooltip,version:n.version,multiplierNumeric:n.multiplierNumeric,pricing:n.pricing,inputCost:n.inputCost,outputCost:n.outputCost,cacheCost:n.cacheCost,longContextInputCost:n.longContextInputCost,longContextOutputCost:n.longContextOutputCost,longContextCacheCost:n.longContextCacheCost,priceCategory:n.priceCategory,maxInputTokens:n.maxInputTokens,maxOutputTokens:n.maxOutputTokens,auth:i,isDefaultForLocation:a,isUserSelectable:n.isUserSelectable,statusIcon:n.statusIcon,targetChatSessionType:n.targetChatSessionType,configurationSchema:n.configurationSchema,capabilities:n.capabilities?{vision:n.capabilities.imageInput,editTools:n.capabilities.editTools,toolCalling:!!n.capabilities.toolCalling,agentMode:!!n.capabilities.toolCalling}:void 0},identifier:this.toModelIdentifier(e,t.group,n.id)}});this._localModels.forEach((n,r)=>{n.metadata.vendor===e&&n.group===t.group&&this._localModels.delete(r)});for(let e=0;e<a.length;e++)this._localModels.set(a[e].identifier,{group:t.group,metadata:a[e].metadata,info:i[e]});return a}async $startChatRequest(e,t,n,r,i,a){let o=this._localModels.get(e);if(!o)throw Error(`Model not found`);let s=this._languageModelProviders.get(o.metadata.vendor);if(!s)throw Error(`Language model provider for '${o.metadata.id}' not found.`);let c=[],l=()=>{c.length>0&&(this._proxy.$reportResponsePart(t,new Ci(c)),c.length=0)},u=new Ro(l,30),d=e=>{c.push(e)>30?(l(),u.cancel()):u.schedule()},f=new Om(async e=>{if(a.isCancellationRequested){this._logService.warn(`[CHAT](${s.extension.identifier.value}) CANNOT send progress because the REQUEST IS CANCELLED`);return}let t;if(e instanceof VA?t={type:`tool_use`,name:e.name,parameters:e.input,toolCallId:e.callId}:e instanceof UA?t={type:`text`,value:e.value,audience:e.audience}:e instanceof WA?t={type:`data`,mimeType:e.mimeType,data:y.wrap(e.data),audience:e.audience}:e instanceof KA&&(t={type:`thinking`,value:e.value,id:e.id,metadata:e.metadata}),!t){this._logService.warn(`[CHAT](${s.extension.identifier.value}) UNKNOWN part ${JSON.stringify(e)}`);return}d(t)}),p;try{p=s.provider.provideLanguageModelChatResponse(o.info,r.value.map(HM.to),{...i,modelOptions:i.modelOptions??{},modelConfiguration:i.configuration,requestInitiator:n?Ts.toKey(n):`core`,toolMode:i.toolMode??QA.Auto},f,a)}catch(e){throw e}Promise.resolve(p).then(()=>{l(),this._proxy.$reportResponseDone(t,void 0)},e=>{l(),this._proxy.$reportResponseDone(t,te(e))})}$provideTokenLength(e,t,n){let r=this._localModels.get(e);if(!r)return Promise.resolve(0);let i=this._languageModelProviders.get(r.metadata.vendor);return i?Promise.resolve(i.provider.provideTokenCount(r.info,t,n)):Promise.resolve(0)}async getDefaultLanguageModel(e,t){let n;t&&await this.selectLanguageModels(e,{});for(let[e,t]of this._localModels)if(t.metadata.isDefaultForLocation[xy.Chat]&&t.metadata.vendor===`copilot`){n=e;break}return!n&&!t?this.getDefaultLanguageModel(e,!0):this.getLanguageModelByIdentifier(e,n)}async getLanguageModelByIdentifier(e,t){if(t){if(!this._localModels.has(t)){let n=this.getVendorFromModelIdentifier(t);if(!n){this._logService.warn(`[LanguageModelProxy](${e.identifier.value}) Could not extract vendor from model identifier '${t}'.`);return}if(this._logService.trace(`[LanguageModelProxy](${e.identifier.value}) Could not find model '${t}' in local cache. Trying to resolve model again.`),await this._proxy.$selectChatModels({vendor:n,extension:e.identifier}),!this._localModels.has(t)){this._logService.warn(`[LanguageModelProxy](${e.identifier.value}) Could not find model '${t}' in local cache after re-resolving models.`);return}}return this._createLanguageModelChatApi(e,t)}}async _createLanguageModelChatApi(e,t){let n=this._localModels.get(t);if(!n)return;this._isUsingAuth(e.identifier,n.metadata)&&await this._fakeAuthPopulate(n.metadata);let r=this;return{id:n.info.id,vendor:n.metadata.vendor,family:n.info.family,version:n.info.version,name:n.info.name,pricing:n.metadata.pricing,inputCost:n.metadata.inputCost,outputCost:n.metadata.outputCost,cacheCost:n.metadata.cacheCost,longContextInputCost:n.metadata.longContextInputCost,longContextOutputCost:n.metadata.longContextOutputCost,longContextCacheCost:n.metadata.longContextCacheCost,priceCategory:n.metadata.priceCategory,capabilities:{supportsImageToText:n.metadata.capabilities?.vision??!1,supportsToolCalling:!!n.metadata.capabilities?.toolCalling,editToolsHint:n.metadata.capabilities?.editTools},maxInputTokens:n.metadata.maxInputTokens,countTokens(e,n){if(!r._localModels.has(t))throw JA.NotFound(t);return r._computeTokenLength(t,e,n??Bi.None)},sendRequest(n,i,a){if(!r._localModels.has(t))throw JA.NotFound(t);return r._sendChatRequest(e,t,n,i??{},a??Bi.None)}}}async selectLanguageModels(e,t){let n=await this._proxy.$selectChatModels({...t,extension:e.identifier});return(await Promise.all(n.map(t=>this._createLanguageModelChatApi(e,t)))).filter(e=>!!e)}async _sendChatRequest(e,t,n,r,i){let a=this._convertMessages(e,n),o=e.identifier,s=this._localModels.get(t)?.metadata;if(!s||!this._localModels.has(t))throw JA.NotFound(`Language model '${t}' is unknown.`);if(this._isUsingAuth(o,s)&&(!await this._getAuthAccess(e,{identifier:s.extension,displayName:s.auth.providerLabel},r.justification,!1)||!this._modelAccessList.get(o)?.has(s.extension)))throw JA.NoPermissions(`Language model '${t}' cannot be used by '${o.value}'.`);let c=Math.random()*1e6|0,l=new rR;this._pendingRequest.set(c,{languageModelId:t,res:l});try{await this._proxy.$tryStartChatRequest(o,t,c,new Ci(a),r,i)}catch(e){throw this._pendingRequest.delete(c),JA.tryDeserialize(e)??e}return l.apiObject}_convertMessages(e,t){let n=[];for(let r of t)r.role===FA.System&&K(e,`languageModelSystem`),n.push(HM.from(r));return n}async $acceptResponsePart(e,t){let n=this._pendingRequest.get(e);n&&n.res.handleResponsePart(t.value)}$onChatModelsChange(){this._onDidChangeProviders.fire()}async $acceptResponseDone(e,t){let n=this._pendingRequest.get(e);n&&(this._pendingRequest.delete(e),t?n.res.reject(JA.tryDeserialize(t)??ne(t)):n.res.resolve())}async _getAuthAccess(e,t,n,r){let i=`__`+t.identifier.value;if(await this._extHostAuthentication.getSession(e,i,[],{silent:!0}))return this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0;if(r)return!1;try{let r=n?b(2869,`Justification: {1}`,t.displayName,n):void 0;return await this._extHostAuthentication.getSession(e,i,[],{forceNewSession:{detail:r}}),this.$updateModelAccesslist([{from:e.identifier,to:t.identifier,enabled:!0}]),!0}catch{return!1}}_isUsingAuth(e,t){return!!t.auth&&!Ts.equals(t.extension,e)}async _fakeAuthPopulate(e){if(e.auth)for(let t of this._languageAccessInformationExtensions)try{await this._getAuthAccess(t,{identifier:e.extension,displayName:``},void 0,!0)}catch(e){this._logService.error(`Fake Auth request failed`),this._logService.error(e)}}async _computeTokenLength(e,t,n){let r=this._localModels.get(e);if(!r)throw JA.NotFound(`Language model '${e}' is unknown.`);return this._languageModelProviders.get(r.metadata.vendor)?.provider.provideTokenCount(r.info,t,n)??0}$updateModelAccesslist(e){let t=[];for(let{from:n,to:r,enabled:i}of e){let e=this._modelAccessList.get(n)??new Es;if(e.has(r)!==i){i?e.add(r):e.delete(r),this._modelAccessList.set(n,e);let a={from:n,to:r};t.push(a),this._onDidChangeModelAccess.fire(a)}}}createLanguageModelAccessInformation(e){this._languageAccessInformationExtensions.add(e);let t=ir.signal(ir.filter(this._onDidChangeModelAccess.event,t=>Ts.equals(t.from,e.identifier))),n=ir.signal(this._onDidChangeProviders.event);return{get onDidChange(){return ir.any(t,n)},canSendRequest(e){return!0}}}fileIsIgnored(e,t,n=Bi.None){return K(e,`chatParticipantAdditions`),this._proxy.$fileIsIgnored(t,n)}get isModelProxyAvailable(){return!!this._languageModelProxyProvider}async getModelProxy(e){if(K(e,`languageModelProxy`),!this._languageModelProxyProvider)throw this._logService.trace(`[LanguageModelProxy] No LanguageModelProxyProvider registered`),Error(`No language model proxy provider is registered.`);let t=Ts.toKey(e.identifier);try{let e=await Promise.resolve(this._languageModelProxyProvider.provideModelProxy(t,Bi.None));if(!e)throw this._logService.warn(`[LanguageModelProxy] Provider returned no proxy for ${t}`),Error(`Language model proxy is not available.`);return e}catch(e){throw this._logService.error(`[LanguageModelProxy] Provider failed to return proxy for ${t}`,e),e}}async $isFileIgnored(e,t,n){let r=this._ignoredFileProviders.get(e);if(!r)throw Error(`Unknown LanguageModelIgnoredFileProvider`);return await r.provideFileIgnored(C.revive(t),n)??!1}registerIgnoredFileProvider(e,t){K(e,`chatParticipantPrivate`);let n=tR._idPool++;return this._proxy.$registerFileIgnoreProvider(n),this._ignoredFileProviders.set(n,t),g(()=>{this._proxy.$unregisterFileIgnoreProvider(n),this._ignoredFileProviders.delete(n)})}registerLanguageModelProxyProvider(e,t){return K(e,`chatParticipantPrivate`),this._languageModelProxyProvider=t,this._onDidChangeModelProxyAvailability.fire(),g(()=>{this._languageModelProxyProvider===t&&(this._languageModelProxyProvider=void 0,this._onDidChangeModelProxyAvailability.fire())})}};iR=tR=k([A(0,Js),A(1,Ns),A(2,XL)],iR);function aR(e){return e.getFullYear()+`-`+String(e.getMonth()+1).padStart(2,`0`)+`-`+String(e.getDate()).padStart(2,`0`)+`T`+String(e.getHours()).padStart(2,`0`)+`:`+String(e.getMinutes()).padStart(2,`0`)+`:`+String(e.getSeconds()).padStart(2,`0`)+`.`+(e.getMilliseconds()/1e3).toFixed(3).slice(2,5)+`Z`}const oR={DateTimeFormat(e,t){return new u(()=>{try{return new Intl.DateTimeFormat(e,t)}catch{return new Intl.DateTimeFormat(void 0,t)}})},Collator(e,t){return new u(()=>{try{return new Intl.Collator(e,t)}catch{return new Intl.Collator(void 0,t)}})},Segmenter(e,t){return new u(()=>{try{return new Intl.Segmenter(e,t)}catch{return new Intl.Segmenter(void 0,t)}})},Locale(e,t){return new u(()=>{try{return new Intl.Locale(e,t)}catch{return new Intl.Locale(`en`,t)}})},NumberFormat(e,t){return new u(()=>{try{return new Intl.NumberFormat(e,t)}catch{return new Intl.NumberFormat(void 0,t)}})}};var sR=class e{constructor(t){let n=Ki(t);this._defaultValue=n,this._asciiMap=e._createAsciiMap(n),this._map=new Map}static _createAsciiMap(e){let t=new Uint8Array(256);return t.fill(e),t}set(e,t){let n=Ki(t);e>=0&&e<256?this._asciiMap[e]=n:this._map.set(e,n)}get(e){return e>=0&&e<256?this._asciiMap[e]:this._map.get(e)||this._defaultValue}clear(){this._asciiMap.fill(this._defaultValue),this._map.clear()}},cR;(function(e){e[e.False=0]=`False`,e[e.True=1]=`True`})(cR||={});var lR;(function(e){e[e.Regular=0]=`Regular`,e[e.Whitespace=1]=`Whitespace`,e[e.WordSeparator=2]=`WordSeparator`})(lR||={});var uR=class extends sR{constructor(e,t){super(lR.Regular),this._segmenter=null,this._cachedLine=null,this._cachedSegments=[],this.intlSegmenterLocales=t,this.intlSegmenterLocales.length>0?this._segmenter=oR.Segmenter(this.intlSegmenterLocales,{granularity:`word`}):this._segmenter=null;for(let t=0,n=e.length;t<n;t++)this.set(e.charCodeAt(t),lR.WordSeparator);this.set(S.Space,lR.Whitespace),this.set(S.Tab,lR.Whitespace)}findPrevIntlWordBeforeOrAtOffset(e,t){let n=null;for(let r of this._getIntlSegmenterWordsOnLine(e)){if(r.index>t)break;n=r}return n}findNextIntlWordAtOrAfterOffset(e,t){for(let n of this._getIntlSegmenterWordsOnLine(e))if(!(n.index<t))return n;return null}_getIntlSegmenterWordsOnLine(e){return this._segmenter?this._cachedLine===e?this._cachedSegments:(this._cachedLine=e,this._cachedSegments=this._filterWordSegments(this._segmenter.value.segment(e)),this._cachedSegments):[]}_filterWordSegments(e){let t=[];for(let n of e)this._isWordLike(n)&&t.push(n);return t}_isWordLike(e){return!!e.isWordLike}};const dR=new qe(10);function fR(e,t){let n=`${e}/${t.join(`,`)}`,r=dR.get(n);return r||(r=new uR(e,t),dR.set(n,r)),r}var pR=class{constructor(e,t,n,r){this.searchString=e,this.isRegex=t,this.matchCase=n,this.wordSeparators=r}parseSearchRequest(){if(this.searchString===``)return null;let e;e=this.isRegex?mR(this.searchString):this.searchString.indexOf(`
|
|
98
|
+
`)>=0;let t=null;try{t=ra(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch{return null}if(!t)return null;let n=!this.isRegex&&!e;return n&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(n=this.matchCase),new xm(t,this.wordSeparators?fR(this.wordSeparators,[]):null,n?this.searchString:null)}};function mR(e){if(!e||e.length===0)return!1;for(let t=0,n=e.length;t<n;t++){let r=e.charCodeAt(t);if(r===S.LineFeed)return!0;if(r===S.Backslash){if(t++,t>=n)break;let r=e.charCodeAt(t);if(r===S.n||r===S.r||r===S.W)return!0}}return!1}function hR(e,t,n){if(!n)return new _m(e,null);let r=[];for(let e=0,n=t.length;e<n;e++)r[e]=t[e];return new _m(e,r)}function gR(e,t,n,r,i){if(r===0)return!0;let a=t.charCodeAt(r-1);if(e.get(a)!==lR.Regular||a===S.CarriageReturn||a===S.LineFeed)return!0;if(i>0){let n=t.charCodeAt(r);if(e.get(n)!==lR.Regular)return!0}return!1}function _R(e,t,n,r,i){if(r+i===n)return!0;let a=t.charCodeAt(r+i);if(e.get(a)!==lR.Regular||a===S.CarriageReturn||a===S.LineFeed)return!0;if(i>0){let n=t.charCodeAt(r+i-1);if(e.get(n)!==lR.Regular)return!0}return!1}function vR(e,t,n,r,i){return gR(e,t,n,r,i)&&_R(e,t,n,r,i)}var yR=class{constructor(e,t){this._wordSeparators=e,this._searchRegex=t,this._prevMatchStartIndex=-1,this._prevMatchLength=0}reset(e){this._searchRegex.lastIndex=e,this._prevMatchStartIndex=-1,this._prevMatchLength=0}next(e){let t=e.length,n;do{if(this._prevMatchStartIndex+this._prevMatchLength===t||(n=this._searchRegex.exec(e),!n))return null;let r=n.index,i=n[0].length;if(r===this._prevMatchStartIndex&&i===this._prevMatchLength){if(i===0){xa(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=r,this._prevMatchLength=i,!this._wordSeparators||vR(this._wordSeparators,e,t,r,i))return n}while(n);return null}};const bR=O(`contextService`),xR=O(`editorGroupsService`),SR=O(`pathService`);function CR(e){return typeof e==`object`&&`uri`in e&&`pattern`in e}let wR=class{constructor(e,t,n,r,i,a){this.configurationService=e,this.workspaceContextService=t,this.editorGroupsService=n,this.logService=r,this.pathService=i,this.uriIdentityService=a}aiText(e,t,n={}){return{...this.commonQuery(t?.map(Hc),n),type:ZN.aiText,contentPattern:e}}text(e,t,n={}){e=this.getContentPattern(e,n);let r=this.configurationService.getValue(),i=t&&t.some(e=>!this.configurationService.getValue({resource:e}).search?.useRipgrep);return{...this.commonQuery(t?.map(Hc),n),type:ZN.Text,contentPattern:e,previewOptions:n.previewOptions,maxFileSize:n.maxFileSize,usePCRE2:r.search?.usePCRE2||i||!1,surroundingContext:n.surroundingContext,userDisabledExcludesAndIgnoreFiles:n.disregardExcludeSettings&&n.disregardIgnoreFiles}}getContentPattern(e,t){let n=this.configurationService.getValue();e.isRegExp&&(e.pattern=e.pattern.replace(/\r?\n/g,`\\n`));let r={...e,wordSeparators:n.editor.wordSeparators};return this.isCaseSensitive(e,t)&&(r.isCaseSensitive=!0),this.isMultiline(e)&&(r.isMultiline=!0),t.notebookSearchConfig?.includeMarkupInput&&(r.notebookInfo||={},r.notebookInfo.isInNotebookMarkdownInput=t.notebookSearchConfig.includeMarkupInput),t.notebookSearchConfig?.includeMarkupPreview&&(r.notebookInfo||={},r.notebookInfo.isInNotebookMarkdownPreview=t.notebookSearchConfig.includeMarkupPreview),t.notebookSearchConfig?.includeCodeInput&&(r.notebookInfo||={},r.notebookInfo.isInNotebookCellInput=t.notebookSearchConfig.includeCodeInput),t.notebookSearchConfig?.includeOutput&&(r.notebookInfo||={},r.notebookInfo.isInNotebookCellOutput=t.notebookSearchConfig.includeOutput),r}file(e,t={}){return{...this.commonQuery(e,t),type:ZN.File,filePattern:t.filePattern?t.filePattern.trim():t.filePattern,exists:t.exists,sortByScore:t.sortByScore,cacheKey:t.cacheKey,shouldGlobMatchFilePattern:t.shouldGlobSearch}}handleIncludeExclude(e,t){if(!e)return{};if(Array.isArray(e)){if(e=e.filter(e=>e.length>0).map(kR),!e.length)return{}}else e=kR(e);return t?this.parseSearchPaths(e):{pattern:ER(...Array.isArray(e)?e:[e])}}commonQuery(e=[],t={}){let n=Array.isArray(t.excludePattern)?t.excludePattern.map(e=>e.pattern).flat():t.excludePattern;n=n?.length===1?n[0]:n;let r=this.handleIncludeExclude(t.includePattern,t.expandPatterns),i=this.handleIncludeExclude(n,t.expandPatterns),a=e.length>1,o=(r.searchPaths&&r.searchPaths.length?r.searchPaths.map(e=>this.getFolderQueryForSearchPath(e,t,i)):e.map(e=>this.getFolderQueryForRoot(e,t,i,a))).filter(e=>!!e),s={_reason:t._reason,folderQueries:o,usingSearchPaths:!!(r.searchPaths&&r.searchPaths.length),extraFileResources:t.extraFileResources,excludePattern:i.pattern,includePattern:r.pattern,ignoreGlobCase:t.ignoreGlobCase,onlyOpenEditors:t.onlyOpenEditors,maxResults:t.maxResults,onlyFileScheme:t.onlyFileScheme};if(t.onlyOpenEditors){let e=Se(this.editorGroupsService.groups.flatMap(e=>e.editors.map(e=>e.resource)));this.logService.trace(`QueryBuilder#commonQuery - openEditor URIs`,JSON.stringify(e));let t=e.filter(e=>cP(s,e.fsPath)),n=this.commonQueryFromFileList(t);return this.logService.trace(`QueryBuilder#commonQuery - openEditor Query`,JSON.stringify(n)),{...s,...n}}if(t.changedFileUris!==void 0){let e=t.changedFileUris.filter(e=>cP(s,e.fsPath)),n=this.commonQueryFromFileList(e);return this.logService.trace(`QueryBuilder#commonQuery - changedFile Query`,JSON.stringify(n)),{...s,...n}}let c=t.extraFileResources&&t.extraFileResources.filter(e=>cP(s,e.fsPath));return s.extraFileResources=c&&c.length?c:void 0,s}commonQueryFromFileList(e){let t=[],n=new He,r={},i=!1;return e.forEach(e=>{if(e.scheme!==D.walkThrough)if(po(e)){let r=this.workspaceContextService.getWorkspaceFolder(e)?.uri??this.uriIdentityService.extUri.dirname(e),a=n.get(r);a||(i=!0,a={folder:r,includePattern:{}},t.push(a),n.set(r,a));let o=Xr(r.fsPath,e.fsPath);dt(a.includePattern)[jR(o.replace(/\\/g,`/`))]=!0}else e.fsPath&&(i=!0,r[jR(e.fsPath)]=!0)}),{folderQueries:t,includePattern:r,usingSearchPaths:!0,excludePattern:i?void 0:{"**/*":!0}}}isCaseSensitive(e,t){if(t.isSmartCase){if(e.isRegExp){if(Fa(e.pattern,!0))return!0}else if(Fa(e.pattern))return!0}return!!e.isCaseSensitive}isMultiline(e){return e.isMultiline||e.isRegExp&&mR(e.pattern)||e.pattern.indexOf(`
|
|
99
|
+
`)>=0?!0:!!e.isMultiline}parseSearchPaths(e){let t=e=>qr(e)||/^\.\.?([\/\\]|$)/.test(e),n=Pe((Array.isArray(e)?e:DR(e)).map(e=>{let t=this.pathService.resolvedUserHome;return t?wy(e,t.scheme===D.file?t.fsPath:t.path):e}),e=>t(e)?`searchPaths`:`exprSegments`),r=(n.exprSegments||[]).map(e=>na(e,`/`)).map(e=>na(e,`\\`)).map(e=>(e[0]===`.`&&(e=`*`+e),OR(e))),i={},a=this.expandSearchPathPatterns(n.searchPaths||[]);a&&a.length&&(i.searchPaths=a);let o=ER(...r.flat());return o&&(i.pattern=o),i}getExcludesForFolder(e,t){return t.disregardExcludeSettings?void 0:sP(e,!t.disregardSearchExcludeSettings)}expandSearchPathPatterns(e){if(!e||!e.length)return[];let t=e.flatMap(e=>{let{pathPortion:t,globPortion:n}=TR(e);return n&&=AR(n),this.expandOneSearchPath(t).flatMap(e=>this.resolveOneSearchPathPattern(e,n))}),n=new Map;return t.forEach(e=>{let t=e.searchPath.toString(),r=n.get(t);r?e.pattern&&(r.pattern=r.pattern||{},r.pattern[e.pattern]=!0):n.set(t,{searchPath:e.searchPath,pattern:e.pattern?ER(e.pattern):void 0})}),Array.from(n.values())}expandOneSearchPath(e){if(qr(e)){let t=this.workspaceContextService.getWorkspace().folders;return t[0]&&t[0].uri.scheme!==D.file?[{searchPath:t[0].uri.with({path:e})}]:[{searchPath:C.file(Kr(e))}]}if(this.workspaceContextService.getWorkbenchState()===zc.FOLDER){let t=this.workspaceContextService.getWorkspace().folders[0].uri;if(e=kR(e),e.startsWith(`../`)||e===`..`){let n=Gr.resolve(t.path,e);return[{searchPath:t.with({path:n})}]}return[{searchPath:t,pattern:AR(e)}]}else if(e===`./`||e===`.\\`)return[];else{let t=e.replace(/^\.[\/\\]/,``),n=this.workspaceContextService.getWorkspace().folders.map(e=>{let n=t.match(RegExp(`^${$i(e.name)}(?:/(.*)|$)`));return n?{match:n,folder:e}:null}).filter(ct);if(n.length)return n.map(e=>{let t=e.match[1];return{searchPath:e.folder.uri,pattern:t&&AR(t)}});{let t=e.match(/\.[\/\\](.+)[\/\\]?/),n=b(17250,`Workspace folder does not exist: {0}`,t?t[1]:e);throw Error(n)}}}resolveOneSearchPathPattern(e,t){let n=e.pattern&&t?`${e.pattern}/${t}`:e.pattern||t,r=[{searchPath:e.searchPath,pattern:n}];return n&&!n.endsWith(`**`)&&r.push({searchPath:e.searchPath,pattern:n+`/**`}),r}getFolderQueryForSearchPath(e,t,n){let r=this.getFolderQueryForRoot(Hc(e.searchPath),t,n,!1);return r?{...r,includePattern:e.pattern}:null}getFolderQueryForRoot(e,t,n,r){let i,a=C.isUri(e)?e:e.uri,o=t.excludePattern?.map(n=>{let r=t.excludePattern&&CR(n)?n.uri:void 0;return!r||!(C.isUri(e)&&this.uriIdentityService.extUri.isEqual(e,r))?r:void 0});if(o?.length||(o=[void 0]),n.searchPaths){let e=n.searchPaths.filter(e=>ao(e.searchPath,a))[0];if(e&&!e.pattern)return null;e&&(i=e.pattern)}let s=this.configurationService.getValue({resource:a}),c={...this.getExcludesForFolder(s,t)||{},...i||{}},l=C.isUri(e)?so(e):e.name,u=o.map(e=>Object.keys(c).length>0?{folder:e,pattern:c}:void 0).filter(e=>e);return{folder:a,folderName:r?l:void 0,excludePattern:u,fileEncoding:s.files&&s.files.encoding,disregardIgnoreFiles:typeof t.disregardIgnoreFiles==`boolean`?t.disregardIgnoreFiles:!s.search?.useIgnoreFiles,disregardGlobalIgnoreFiles:typeof t.disregardGlobalIgnoreFiles==`boolean`?t.disregardGlobalIgnoreFiles:!s.search?.useGlobalIgnoreFiles,disregardParentIgnoreFiles:typeof t.disregardParentIgnoreFiles==`boolean`?t.disregardParentIgnoreFiles:!s.search?.useParentIgnoreFiles,ignoreSymlinks:typeof t.ignoreSymlinks==`boolean`?t.ignoreSymlinks:!s.search?.followSymlinks,ignoreGlobCase:t.ignoreGlobCase}}};wR=k([A(0,Oh),A(1,bR),A(2,xR),A(3,Ns),A(4,SR),A(5,Jg)],wR);function TR(e){let t=e.match(/[\*\{\}\(\)\[\]\?]/);if(t){let n=t.index,r=e.substr(0,n).match(/[/|\\][^/\\]*$/);if(r){let t=e.substr(0,r.index);return t.match(/[/\\]/)||(t+=`/`),{pathPortion:t,globPortion:e.substr((r.index||0)+1)}}}return{pathPortion:e}}function ER(...e){return e.length?e.reduce((e,t)=>(e[t]=!0,e),Object.create(null)):void 0}function DR(e){return ES(e,`,`).map(e=>e.trim()).filter(e=>!!e.length)}function OR(e){return[`**/${e}/**`,`**/${e}`].map(e=>e.replace(/\*\*\/\*\*/g,`**`))}function kR(e){return e.replace(/\\/g,`/`)}function AR(e){return kR(e).replace(/^\.\//,``).replace(/\/+$/g,``)}function jR(e){return e.replace(/([?*[\]])/g,`[$1]`)}O(`searchService`);function MR(e,t){let n=t.activationEvents;if(!n)return Promise.resolve(void 0);let r=[],i=[];for(let t of n)if(/^workspaceContains:/.test(t)){let n=t.substr(18);n.indexOf(`*`)>=0||n.indexOf(`?`)>=0||e.forceUsingSearch?i.push(n):r.push(n)}if(r.length===0&&i.length===0)return Promise.resolve(void 0);let{promise:a,resolve:o}=Co(),s=e=>o({activationEvent:e}),c=Promise.all(r.map(t=>NR(e,t,s))).then(()=>{}),l=PR(e,t.identifier,i,s);return Promise.all([c,l]).then(()=>{o(void 0)}),a}async function NR(e,t,n){for(let r of e.folders)if(await e.exists(uo(C.revive(r),t))){n(`workspaceContains:${t}`);return}}async function PR(e,t,n,r){if(n.length===0)return Promise.resolve(void 0);let i=new Hi,a=e.checkExists(e.folders,n,i.token),o=setTimeout(async()=>{i.cancel(),e.logService.info(`Not activating extension '${t.value}': Timed out while searching for 'workspaceContains' pattern ${n.join(`,`)}`)},7e3),s=!1;try{s=await a}catch(e){re(e)||m(e)}i.dispose(),clearTimeout(o),s&&r(`workspaceContains:${n.join(`,`)}`)}var FR=class{constructor(e){this._onDidChangePassword=new x,this.onDidChangePassword=this._onDidChangePassword.event,this._proxy=e.getProxy(T.MainThreadSecretState)}async $onDidChangePassword(e){this._onDidChangePassword.fire(e)}get(e,t){return this._proxy.$getPassword(e,t)}store(e,t,n){return this._proxy.$setPassword(e,t,n)}delete(e,t){return this._proxy.$deletePassword(e,t)}keys(e){return this._proxy.$getKeys(e)}};const IR=O(`IExtHostSecretState`);var LR=class{#e;constructor(e,t){this.disposables=new _,this._id=Ts.toKey(e.identifier),this.#e=t,this.onDidChange=ir.map(ir.filter(this.#e.onDidChangePassword,e=>e.extensionId===this._id),e=>({key:e.key}),this.disposables)}dispose(){this.disposables.dispose()}get(e){return this.#e.get(this._id,e)}store(e,t){return this.#e.store(this._id,e,t)}delete(e){return this.#e.delete(this._id,e)}keys(){return this.#e.keys(this._id)||[]}};let RR=class{constructor(e,t,n){this.logService=n,this.bundleCache=new Map,this._proxy=t.getProxy(T.MainThreadLocalization),this.currentLanguage=e.environment.appLanguage,this.isDefaultLanguage=this.currentLanguage===`en`}getMessage(e,t){let{message:n,args:r,comment:i}=t;if(this.isDefaultLanguage)return Qi(n,r??{});let a=n;i&&i.length>0&&(a+=`/${Array.isArray(i)?i.join(``):i}`);let o=this.bundleCache.get(e)?.contents[a];return o||this.logService.warn(`Using default string since no string found in i18n bundle that has the key: ${a}`),Qi(o??n,r??{})}getBundle(e){return this.bundleCache.get(e)?.contents}getBundleUri(e){return this.bundleCache.get(e)?.uri}async initializeLocalizedMessages(e){if(this.isDefaultLanguage||!e.l10n&&!e.isBuiltin||this.bundleCache.has(e.identifier.value))return;let t,n=await this.getBundleLocation(e);if(!n){this.logService.error(`No bundle location found for extension ${e.identifier.value}`);return}try{let r=await this._proxy.$fetchBundleContents(n),i=JSON.parse(r);t=e.isBuiltin?i.contents?.bundle:i}catch(t){this.logService.error(`Failed to load translations for ${e.identifier.value} from ${n}: ${t.message}`);return}t&&this.bundleCache.set(e.identifier.value,{contents:t,uri:n})}async getBundleLocation(e){if(e.isBuiltin){let t=await this._proxy.$fetchBuiltInBundleUri(e.identifier.value,this.currentLanguage);return C.revive(t)}return e.l10n?C.joinPath(e.extensionLocation,e.l10n,`bundle.l10n.${this.currentLanguage}.json`):void 0}};RR=k([A(0,Vs),A(1,Js),A(2,Ns)],RR);const zR=O(`IExtHostLocalizationService`),BR=O(`IExtHostManagedSockets`);let VR=class{constructor(e){this._remoteSocketIdCounter=0,this._factory=null,this._managedRemoteSockets=new Map,this._proxy=e.getProxy(T.MainThreadManagedSockets)}setFactory(e,t){for(let e of this._managedRemoteSockets.values())e.dispose();this._factory&&this._proxy.$unregisterSocketFactory(this._factory.socketFactoryId),this._factory=new HR(e,t),this._proxy.$registerSocketFactory(this._factory.socketFactoryId)}async $openRemoteSocket(e){if(!this._factory||this._factory.socketFactoryId!==e)throw Error(`No socket factory with id ${e}`);let t=++this._remoteSocketIdCounter,n=await this._factory.makeConnection(),r=new _;return this._managedRemoteSockets.set(t,new UR(t,n,r)),r.add(g(()=>this._managedRemoteSockets.delete(t))),r.add(n.onDidEnd(()=>{this._proxy.$onDidManagedSocketEnd(t),r.dispose()})),r.add(n.onDidClose(e=>{this._proxy.$onDidManagedSocketClose(t,e?.stack??e?.message),r.dispose()})),r.add(n.onDidReceiveMessage(e=>this._proxy.$onDidManagedSocketHaveData(t,y.wrap(e)))),t}$remoteSocketWrite(e,t){this._managedRemoteSockets.get(e)?.actual.send(t.buffer)}$remoteSocketEnd(e){let t=this._managedRemoteSockets.get(e);t&&(t.actual.end(),t.dispose())}async $remoteSocketDrain(e){await this._managedRemoteSockets.get(e)?.actual.drain?.()}};VR=k([A(0,Js)],VR);var HR=class{constructor(e,t){this.socketFactoryId=e,this.makeConnection=t}},UR=class extends v{constructor(e,t,n){super(),this.socketId=e,this.actual=t,this._register(n)}},WR;const GR=O(`IHostUtils`);let KR=WR=class extends v{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){super(),this._extHostManagedSockets=d,this._extHostLanguageModels=f,this._onDidChangeRemoteConnectionData=this._register(new x),this.onDidChangeRemoteConnectionData=this._onDidChangeRemoteConnectionData.event,this._realPathCache=new Map,this._isTerminating=!1,this._hostUtils=t,this._extHostContext=n,this._initData=o,this._extHostWorkspace=r,this._extHostConfiguration=i,this._logService=a,this._extHostTunnelService=c,this._extHostTerminalService=l,this._extHostLocalizationService=u,this._mainThreadWorkspaceProxy=this._extHostContext.getProxy(T.MainThreadWorkspace),this._mainThreadTelemetryProxy=this._extHostContext.getProxy(T.MainThreadTelemetry),this._mainThreadExtensionsProxy=this._extHostContext.getProxy(T.MainThreadExtensionService),this._almostReadyToRunExtensions=new jo,this._readyToStartExtensionHost=new jo,this._readyToRunExtensions=new jo,this._eagerExtensionsActivated=new jo,this._activationEventsReader=new ez(this._initData.extensions.activationEvents),this._globalRegistry=new xF(this._activationEventsReader,this._initData.extensions.allExtensions);let p=new Es(this._initData.extensions.myExtensions);this._myRegistry=new xF(this._activationEventsReader,QR(this._globalRegistry,p)),Pn&&(this._logService.info(`Creating extension host with the following global extensions: ${YR(this._globalRegistry)}`),this._logService.info(`Creating extension host with the following local extensions: ${YR(this._myRegistry)}`)),this._storage=new PF(this._extHostContext,this._logService),this._secretState=new FR(this._extHostContext),this._storagePath=s,this._instaService=this._store.add(e.createChild(new Bs([FF,this._storage],[IR,this._secretState]))),this._activator=this._register(new MF(this._myRegistry,this._globalRegistry,{onExtensionActivationError:(e,t,n)=>{this._mainThreadExtensionsProxy.$onExtensionActivationError(e,te(t),n)},actualActivateExtension:async(e,t)=>{if(xF.isHostExtension(e,this._myRegistry,this._globalRegistry))return await this._mainThreadExtensionsProxy.$activateExtension(e,t),new AF;let n=this._myRegistry.getExtensionDescription(e);return this._activateExtension(n,t)}},this._logService)),this._extensionPathIndex=null,this._resolvers=Object.create(null),this._started=!1,this._remoteConnectionData=this._initData.remote.connectionData}getRemoteConnectionData(){return this._remoteConnectionData}async initialize(){try{await this._beforeAlmostReadyToRunExtensions(),this._almostReadyToRunExtensions.open(),await this._extHostWorkspace.waitForInitializeCall(),Ar(`code/extHost/ready`),this._readyToStartExtensionHost.open(),this._initData.autoStart&&this._startExtensionHost()}catch(e){m(e)}}async _deactivateAll(){this._storagePath.onWillDeactivateAll();let e=[];try{e=this._myRegistry.getAllExtensionDescriptions().map(e=>e.identifier).filter(e=>this.isActivated(e)).map(e=>this._deactivate(e))}catch{}await Promise.all(e)}terminate(e,t=0){if(this._isTerminating)return;this._isTerminating=!0,this._logService.info(`Extension host terminating: ${e}`),this._logService.flush(),this._extHostTerminalService.dispose(),this._activator.dispose(),An&&f(e=>{this._logService.error(e)}),this._extHostContext.dispose();let n=this._deactivateAll();Promise.race([Mo(5e3),n]).finally(()=>{this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} exiting with code ${t}`):this._logService.info(`Extension host exiting with code ${t}`),this._logService.flush(),this._logService.dispose(),this._hostUtils.exit(t)})}isActivated(e){return this._readyToRunExtensions.isOpen()?this._activator.isActivated(e):!1}async getExtension(e){let t=await this._mainThreadExtensionsProxy.$getExtension(e);return t&&{...t,identifier:new Ts(t.identifier.value),extensionLocation:C.revive(t.extensionLocation)}}_activateByEvent(e,t){return this._activator.activateByEvent(e,t)}_activateById(e,t){return this._activator.activateById(e,t)}activateByIdWithErrors(e,t){return this._activateById(e,t).then(()=>{let t=this._activator.getActivatedExtension(e);if(t.activationFailed)return Promise.reject(t.activationFailedError)})}getExtensionRegistry(){return this._readyToRunExtensions.wait().then(e=>this._myRegistry)}getExtensionExports(e){if(this._readyToRunExtensions.isOpen())return this._activator.getActivatedExtension(e).exports;try{return this._activator.getActivatedExtension(e).exports}catch{return null}}async _realPathExtensionUri(e){if(e.scheme===D.file&&this._hostUtils.fsRealpath){let t=e.fsPath;this._realPathCache.has(t)||this._realPathCache.set(t,this._hostUtils.fsRealpath(t));let n=await this._realPathCache.get(t);return C.file(n)}return e}async getExtensionPathIndex(){return this._extensionPathIndex||=this._createExtensionPathIndex(this._myRegistry.getAllExtensionDescriptions()).then(e=>new $R(e)),this._extensionPathIndex}async _createExtensionPathIndex(e){let t=oc.forUris(e=>ro.ignorePathCasing(e));return await Promise.all(e.map(async e=>{if(this._getEntryPoint(e)){let n=await this._realPathExtensionUri(e.extensionLocation);t.set(n,e)}})),t}_deactivate(e){let t=Promise.resolve(void 0);if(!this._readyToRunExtensions.isOpen()||!this._activator.isActivated(e))return t;let n=this._activator.getActivatedExtension(e);if(!n)return t;try{typeof n.module.deactivate==`function`&&(t=Promise.resolve(n.module.deactivate()).then(void 0,e=>(this._logService.error(e),Promise.resolve(void 0))))}catch(t){this._logService.error(`An error occurred when deactivating the extension '${e.value}':`),this._logService.error(t)}try{n.disposable.dispose()}catch(t){this._logService.error(`An error occurred when disposing the subscriptions for extension '${e.value}':`),this._logService.error(t)}return t}async _activateExtension(e,t){return this._initData.remote.isRemote?this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier):await this._mainThreadExtensionsProxy.$onWillActivateExtension(e.identifier),this._doActivateExtension(e,t).then(n=>{let r=n.activationTimes;return this._mainThreadExtensionsProxy.$onDidActivateExtension(e.identifier,r.codeLoadingTime,r.activateCallTime,r.activateResolvedTime,t),this._logExtensionActivationTimes(e,t,`success`,r),n},n=>{throw this._logExtensionActivationTimes(e,t,`failure`),n})}_logExtensionActivationTimes(e,t,n,r){let i=JR(e,t);this._mainThreadTelemetryProxy.$publicLog2(`extensionActivationTimes`,{...i,...r||{},outcome:n})}_doActivateExtension(e,t){let n=JR(e,t);this._mainThreadTelemetryProxy.$publicLog2(`activatePlugin`,n);let r=this._getEntryPoint(e);if(!r)return Promise.resolve(new kF(EF.NONE));this._logService.info(`ExtensionService#_doActivateExtension ${e.identifier.value}, startup: ${t.startup}, activationEvent: '${t.activationEvent}'${e.identifier.value===t.extensionId.value?``:`, root cause: ${t.extensionId.value}`}`),this._logService.flush();let i=this._isESM(e),a=new _,o=new DF(t.startup);return Promise.all([i?this._loadESMModule(e,uo(e.extensionLocation,r),o):this._loadCommonJSModule(e,uo(e.extensionLocation,r),o),this._loadExtensionContext(e,a)]).then(t=>(Ar(`code/extHost/willActivateExtension/${e.identifier.value}`),WR._callActivate(this._logService,e.identifier,t[0],t[1],a,o))).then(t=>(Ar(`code/extHost/didActivateExtension/${e.identifier.value}`),t))}_loadExtensionContext(e,t){let n=this._extHostLanguageModels.createLanguageModelAccessInformation(e),r=t.add(new LF(e,this._storage)),i=t.add(new IF(e.identifier.value,!1,this._storage)),a=t.add(new LR(e,this._secretState)),o=e.isUnderDevelopment?this._initData.environment.extensionTestsLocationURI?HO.Test:HO.Development:HO.Production,s=this._initData.remote.isRemote?DO.Workspace:DO.UI;return this._logService.trace(`ExtensionService#loadExtensionContext ${e.identifier.value}`),Promise.all([r.whenReady,i.whenReady,this._storagePath.whenReady]).then(()=>{let t=this,c,l,u=Mw(e)?this._initData.messagePorts?.get(Ts.toKey(e.identifier)):void 0;return Object.freeze({globalState:r,workspaceState:i,secrets:a,subscriptions:[],get languageModelAccessInformation(){return n},get extensionUri(){return e.extensionLocation},get extensionPath(){return e.extensionLocation.fsPath},asAbsolutePath(t){return Jr(e.extensionLocation.fsPath,t)},get storagePath(){return t._storagePath.workspaceValue(e)?.fsPath},get globalStoragePath(){return t._storagePath.globalValue(e).fsPath},get logPath(){return Jr(t._initData.logsLocation.fsPath,e.identifier.value)},get logUri(){return C.joinPath(t._initData.logsLocation,e.identifier.value)},get storageUri(){return t._storagePath.workspaceValue(e)},get globalStorageUri(){return t._storagePath.globalValue(e)},get extensionMode(){return o},get extension(){return c===void 0&&(c=new ZR(t,e.identifier,e,s,!1)),c},get extensionRuntime(){return K(e,`extensionRuntime`),t.extensionRuntime},get environmentVariableCollection(){return t._extHostTerminalService.getEnvironmentVariableCollection(e)},get messagePassingProtocol(){if(!l){if(!u)return;let e=ir.buffer(ir.fromDOMEventEmitter(u,`message`,e=>e.data),`onDidReceiveMessage`);u.start(),l={onDidReceiveMessage:e,postMessage:u.postMessage.bind(u)}}return l}})})}static _callActivate(e,t,n,r,i,a){return n||={activate:void 0,deactivate:void 0},this._callActivateOptional(e,t,n,r,a).then(e=>new OF(!1,null,a.build(),n,e,g(()=>{i.dispose(),xt(r.subscriptions)})))}static _callActivateOptional(e,t,n,r,i){if(typeof n.activate==`function`)try{i.activateCallStart(),e.trace(`ExtensionService#_callActivateOptional ${t.value}`);let a=n.activate.apply(globalThis,[r]);return i.activateCallStop(),i.activateResolveStart(),Promise.resolve(a).then(e=>(i.activateResolveStop(),e))}catch(e){return Promise.reject(e)}else return Promise.resolve(n)}_activateOneStartupFinished(e,t){this._activateById(e.identifier,{startup:!1,extensionId:e.identifier,activationEvent:t}).then(void 0,e=>{this._logService.error(e)})}_activateAllStartupFinishedDeferred(e,t=0){let n=Date.now();zn(()=>{for(let r=t;r<e.length;r+=1){let t=e[r];for(let i of t.activationEvents??[])if(i===`onStartupFinished`)if(Date.now()-n>50){this._activateAllStartupFinishedDeferred(e,r);break}else this._activateOneStartupFinished(t,i)}})}_activateAllStartupFinished(){this._mainThreadExtensionsProxy.$setPerformanceMarks(jr()),this._extHostConfiguration.getConfigProvider().then(e=>{let t=e.getConfiguration(`extensions.experimental`).get(`deferredStartupFinishedActivation`),n=this._myRegistry.getAllExtensionDescriptions();if(t)this._activateAllStartupFinishedDeferred(n);else for(let e of n)if(e.activationEvents)for(let t of e.activationEvents)t===`onStartupFinished`&&this._activateOneStartupFinished(e,t)})}_handleEagerExtensions(){let e=this._activateByEvent(`*`,!0).then(void 0,e=>{this._logService.error(e)});this._register(this._extHostWorkspace.onDidChangeWorkspace(e=>this._handleWorkspaceContainsEagerExtensions(e.added)));let t=this._extHostWorkspace.workspace?this._extHostWorkspace.workspace.folders:[],n=this._handleWorkspaceContainsEagerExtensions(t),r=this._handleRemoteResolverEagerExtensions(),i=Promise.all([r,e,n]).then(()=>{});return Promise.race([i,Mo(1e4)]).then(()=>{this._activateAllStartupFinished()}),i}_handleWorkspaceContainsEagerExtensions(e){return e.length===0?Promise.resolve(void 0):Promise.all(this._myRegistry.getAllExtensionDescriptions().map(t=>this._handleWorkspaceContainsEagerExtension(e,t))).then(()=>{})}async _handleWorkspaceContainsEagerExtension(e,t){if(this.isActivated(t.identifier))return;let n=!this._initData.remote.isRemote&&!!this._initData.remote.authority,r=await MR({logService:this._logService,folders:e.map(e=>e.uri),forceUsingSearch:n||!this._hostUtils.fsExists,exists:e=>this._hostUtils.fsExists(e.fsPath),checkExists:(e,t,n)=>this._mainThreadWorkspaceProxy.$checkExists(e,t,n)},t);if(r)return this._activateById(t.identifier,{startup:!0,extensionId:t.identifier,activationEvent:r.activationEvent}).then(void 0,e=>this._logService.error(e))}async _handleRemoteResolverEagerExtensions(){if(this._initData.remote.authority)return this._activateByEvent(`onResolveRemoteAuthority:${this._initData.remote.authority}`,!1)}async $extensionTestsExecute(){await this._eagerExtensionsActivated.wait();try{return await this._doHandleExtensionTests()}catch(e){throw console.error(e),e}}async _doHandleExtensionTests(){let{extensionDevelopmentLocationURI:e,extensionTestsLocationURI:t}=this._initData.environment;if(!e||!t)throw Error(b(2865,`Cannot load test runner.`));let n=(await this.getExtensionPathIndex()).findSubstr(t),r=await(this._isESM(n,t.path)?this._loadESMModule(null,t,new DF(!1)):this._loadCommonJSModule(null,t,new DF(!1)));if(!r||typeof r.run!=`function`)throw Error(b(2866,`Path {0} does not point to a valid extension test runner.`,t.toString()));return new Promise((e,n)=>{let i=(t,r)=>{t?(Pn&&this._logService.error(`Test runner called back with error`,t),n(t)):(Pn&&(r?this._logService.info(`Test runner called back with ${r} failures.`):this._logService.info(`Test runner called back with successful outcome.`)),e(+(typeof r==`number`&&r>0)))},a=eo(t),o=r.run(a,i);o&&o.then&&o.then(()=>{Pn&&this._logService.info(`Test runner finished successfully.`),e(0)}).catch(e=>{Pn&&this._logService.error(`Test runner finished with error`,e),n(e instanceof Error&&e.stack?e.stack:String(e))})})}_startExtensionHost(){if(this._started)throw Error(`Extension host is already started!`);return this._started=!0,this._readyToStartExtensionHost.wait().then(()=>this._readyToRunExtensions.open()).then(()=>Promise.race([this._activator.waitForActivatingExtensions(),Mo(1e3)])).then(()=>this._handleEagerExtensions()).then(()=>{this._eagerExtensionsActivated.open(),this._logService.info(`Eager extensions activated`)})}registerRemoteAuthorityResolver(e,t){return this._resolvers[e]=t,g(()=>{delete this._resolvers[e]})}async getRemoteExecServer(e){let{resolver:t}=await this._activateAndGetResolver(e);return t?.resolveExecServer?.(e,{resolveAttempt:0})}async _activateAndGetResolver(e){let t=e.indexOf(`+`);if(t===-1)throw new $T(`Not an authority that can be resolved!`,eT.InvalidAuthority);let n=e.substr(0,t);return await this._almostReadyToRunExtensions.wait(),await this._activateByEvent(`onResolveRemoteAuthority:${n}`,!1),{authorityPrefix:n,resolver:this._resolvers[n]}}async $resolveAuthority(e,t){let n=tr.create(!1),r=()=>`[resolveAuthority(${tT(e)},${t})][${n.elapsed()}ms] `,i=e=>this._logService.info(`${r()}${e}`),a=e=>this._logService.warn(`${r()}${e}`),o=(e,t=void 0)=>this._logService.error(`${r()}${e}`,t),s=e=>{if(e instanceof $T)return{type:`error`,error:{code:e._code,message:e._message,detail:e._detail}};throw e},c=async e=>{i(`activating resolver for ${e}...`);let{resolver:t,authorityPrefix:n}=await this._activateAndGetResolver(e);if(!t)throw o(`no resolver for ${n}`),new $T(`No remote extension installed to resolve ${n}.`,eT.NoResolverFound);return{resolver:t,authorityPrefix:n,remoteAuthority:e}},l=e.split(/@|%40/g).reverse();i(`activating remote resolvers ${l.join(` -> `)}`);let u;try{u=await Promise.all(l.map(c)).catch(async t=>{if(!(t instanceof $T)||t._code!==eT.InvalidAuthority)throw t;return a(`resolving nested authorities failed: ${t.message}`),[await c(e)]})}catch(e){return s(e)}let d=new Lo;d.cancelAndSet(()=>i(`waiting...`),1e3);let f,p;for(let[e,{authorityPrefix:n,resolver:r,remoteAuthority:a}]of u.entries())try{if(e===u.length-1)i(`invoking final resolve()...`),Ar(`code/extHost/willResolveAuthority/${n}`),f=await r.resolve(a,{resolveAttempt:t,execServer:p}),Ar(`code/extHost/didResolveAuthorityOK/${n}`),i(`setting tunnel factory...`),this._register(await this._extHostTunnelService.setTunnelFactory(r,QT.isManagedResolvedAuthority(f)?f:void 0));else{if(i(`invoking resolveExecServer() for ${a}`),Ar(`code/extHost/willResolveExecServer/${n}`),p=await r.resolveExecServer?.(a,{resolveAttempt:t,execServer:p}),!p)throw new $T(`Exec server was not available for ${a}`,eT.NoResolverFound);Ar(`code/extHost/didResolveExecServerOK/${n}`)}}catch(e){return Ar(`code/extHost/didResolveAuthorityError/${n}`),o(`returned an error`,e),d.dispose(),s(e)}d.dispose();let m={environmentTunnels:f.environmentTunnels,features:f.tunnelFeatures?{elevation:f.tunnelFeatures.elevation,privacyOptions:f.tunnelFeatures.privacyOptions,protocol:f.tunnelFeatures.protocol===void 0?!0:f.tunnelFeatures.protocol}:void 0},ee={extensionHostEnv:f.extensionHostEnv,isTrusted:f.isTrusted,authenticationSession:f.authenticationSessionForInitializingExtensions?{id:f.authenticationSessionForInitializingExtensions.id,providerId:f.authenticationSessionForInitializingExtensions.providerId}:void 0};i(`returned ${QT.isManagedResolvedAuthority(f)?`managed authority`:`${f.host}:${f.port}`}`);let te;if(QT.isManagedResolvedAuthority(f)){let n=t;this._extHostManagedSockets.setFactory(n,f.makeConnection),te={authority:e,connectTo:new Qw(n),connectionToken:f.connectionToken}}else te={authority:e,connectTo:new $w(f.host,f.port),connectionToken:f.connectionToken};return{type:`ok`,value:{authority:te,options:ee,tunnelInformation:m}}}async $getCanonicalURI(e,t){this._logService.info(`$getCanonicalURI invoked for authority (${tT(e)})`);let{resolver:n}=await this._activateAndGetResolver(e);if(!n)return null;let r=C.revive(t);return n.getCanonicalURI===void 0?r:await So(()=>n.getCanonicalURI(r))||r}async $startExtensionHost(e){e.toAdd.forEach(e=>e.extensionLocation=C.revive(e.extensionLocation));let{globalRegistry:t,myExtensions:n}=qR(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),r=await this._createExtensionPathIndex(n);return(await this.getExtensionPathIndex()).setSearchTree(r),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(n),Pn&&(this._logService.info(`$startExtensionHost: global extensions: ${YR(this._globalRegistry)}`),this._logService.info(`$startExtensionHost: local extensions: ${YR(this._myRegistry)}`)),this._startExtensionHost()}$activateByEvent(e,t){return t===Nw.Immediate?this._almostReadyToRunExtensions.wait().then(t=>this._activateByEvent(e,!1)):this._readyToRunExtensions.wait().then(t=>this._activateByEvent(e,!1))}async $activate(e,t){return await this._readyToRunExtensions.wait(),this._myRegistry.getExtensionDescription(e)?(await this._activateById(e,t),!0):!1}async $deltaExtensions(e){e.toAdd.forEach(e=>e.extensionLocation=C.revive(e.extensionLocation));let{globalRegistry:t,myExtensions:n}=qR(this._activationEventsReader,this._globalRegistry,this._myRegistry,e),r=await this._createExtensionPathIndex(n);return(await this.getExtensionPathIndex()).setSearchTree(r),this._globalRegistry.set(t.getAllExtensionDescriptions()),this._myRegistry.set(n),Pn&&(this._logService.info(`$deltaExtensions: global extensions: ${YR(this._globalRegistry)}`),this._logService.info(`$deltaExtensions: local extensions: ${YR(this._myRegistry)}`)),Promise.resolve(void 0)}async $test_latency(e){return e}async $test_up(e){return e.byteLength}async $test_down(e){let t=y.alloc(e),n=Math.random()%256;for(let r=0;r<e;r++)t.writeUInt8(n,r);return t}async $updateRemoteConnectionData(e){this._remoteConnectionData=e,this._onDidChangeRemoteConnectionData.fire()}_isESM(e,t){return t??=e?this._getEntryPoint(e):t,t?.endsWith(`.mjs`)||e?.type===`module`&&!t?.endsWith(`.cjs`)}};KR=WR=k([A(0,As),A(1,GR),A(2,Js),A(3,eF),A(4,yF),A(5,Ns),A(6,Vs),A(7,VF),A(8,tI),A(9,qI),A(10,zR),A(11,BR),A(12,nR)],KR);function qR(e,t,n,r){e.addActivationEvents(r.addActivationEvents);let i=new xF(e,t.getAllExtensionDescriptions());i.deltaExtensions(r.toAdd,r.toRemove);let a=new Es(n.getAllExtensionDescriptions().map(e=>e.identifier));for(let e of r.myToRemove)a.delete(e);for(let e of r.myToAdd)a.add(e);return{globalRegistry:i,myExtensions:QR(i,a)}}function JR(e,t){return{id:e.identifier.value,name:e.name,extensionVersion:e.version,publisherDisplayName:e.publisher,activationEvents:e.activationEvents?e.activationEvents.join(`,`):null,isBuiltin:e.isBuiltin,reason:t.activationEvent,reasonId:t.extensionId.value}}function YR(e){return e.getAllExtensionDescriptions().map(e=>e.identifier.value).join(`,`)}const XR=O(`IExtHostExtensionService`);var ZR=class{#e;#t;#n;constructor(e,t,n,r,i){this.#e=e,this.#t=t,this.#n=n.identifier,this.id=n.identifier.value,this.isBuiltin=n.isBuiltin||n.isUserBuiltin,this.extensionUri=n.extensionLocation,this.extensionPath=Kr(eo(n.extensionLocation)),this.packageJSON=n,this.extensionKind=r,this.isFromDifferentExtensionHost=i}get isActive(){return this.#e.isActivated(this.#n)}get exports(){if(!(this.packageJSON.api===`none`||this.isFromDifferentExtensionHost))return this.#e.getExtensionExports(this.#n)}async activate(){if(this.isFromDifferentExtensionHost)throw Error(`Cannot activate foreign extension`);return await this.#e.activateByIdWithErrors(this.#n,{startup:!1,extensionId:this.#t,activationEvent:`api`}),this.exports}};function QR(e,t){return e.getAllExtensionDescriptions().filter(e=>t.has(e.identifier))}var $R=class{constructor(e){this._searchTree=e}setSearchTree(e){this._searchTree=e}findSubstr(e){return this._searchTree.findSubstr(e)}forEach(e){return this._searchTree.forEach(e)}},ez=class{constructor(e){this._map=new Ds,this.addActivationEvents(e)}readActivationEvents(e){return this._map.get(e.identifier)??[]}addActivationEvents(e){for(let t of Object.keys(e))this._map.set(t,e[t])}};const tz=O(`IExtHostApiDeprecationService`);let nz=class{constructor(e,t){this._extHostLogService=t,this._reportedUsages=new Set,this._telemetryShape=e.getProxy(T.MainThreadTelemetry)}report(e,t,n,r){let i=this.getUsageKey(e,t,r?.usageId);this._reportedUsages.has(i)||(this._reportedUsages.add(i),t.isUnderDevelopment&&this._extHostLogService.warn(`[Deprecation Warning] '${e}' is deprecated. ${n}`),this._telemetryShape.$publicLog2(`extHostDeprecatedApiUsage`,{extensionId:t.identifier.value,apiId:e,usageId:r?.usageId??``}))}getUsageKey(e,t,n){let r=`${e}-${t.identifier.value}`;return n?`${r}-${n}`:r}};nz=k([A(0,Js),A(1,Ns)],nz);let rz=class extends Jh{constructor(e,t){super(t.logLevel,t.logsLocation,t.loggers.map(e=>Ju(e))),this._proxy=e.getProxy(T.MainThreadLogger)}$setLogLevel(e,t){t?this.setLogLevel(C.revive(t),e):this.setLogLevel(e)}setVisibility(e,t){super.setVisibility(e,t),this._proxy.$setVisibility(e,t)}doCreateLogger(e,t,n){return new iz(this._proxy,e,t,n)}};rz=k([A(0,Js),A(1,Vs)],rz);var iz=class extends Kh{constructor(e,t,n,r){super(r?.logLevel===`always`),this.proxy=e,this.file=t,this.isLoggerCreated=!1,this.buffer=[],this.setLevel(n),this.proxy.$createLogger(t,r).then(()=>{this.doLog(this.buffer),this.isLoggerCreated=!0})}log(e,t){let n=[[e,t]];this.isLoggerCreated?this.doLog(n):this.buffer.push(...n)}doLog(e){this.proxy.$log(this.file,e)}flush(){this.proxy.$flush(this.file)}},az=class extends v{constructor(e,t=[]){super(),this.logger=new qh([e,...t]),this._register(e.onDidChangeLogLevel(e=>this.setLevel(e)))}get onDidChangeLogLevel(){return this.logger.onDidChangeLogLevel}setLevel(e){this.logger.setLevel(e)}getLevel(){return this.logger.getLevel()}trace(e,...t){this.logger.trace(e,...t)}debug(e,...t){this.logger.debug(e,...t)}info(e,...t){this.logger.info(e,...t)}warn(e,...t){this.logger.warn(e,...t)}error(e,...t){this.logger.error(e,...t)}flush(){this.logger.flush()}};let oz=class extends az{constructor(e,t,n){let r=n.remote.isRemote?`remoteexthost`:e?`workerexthost`:`exthost`,i=n.remote.isRemote?b(2870,`Extension Host (Remote)`):e?b(2871,`Extension Host (Worker)`):b(2872,`Extension Host`);super(t.createLogger(r,{name:i}))}};oz=k([A(1,Ps),A(2,Vs)],oz);var sz=class{static async installEarlyHandler(e){Error.stackTraceLimit=100;let t=e.get(Ns),n=e.get(Js).getProxy(T.MainThreadErrors);f(e=>{t.error(e);let r=te(e);n.$onUnexpectedError(r)})}static async installFullHandler(e){let t=e.get(Ns),n=e.get(Js),r=e.get(XR),i=e.get(VI),a=e.get(tz),o=n.getProxy(T.MainThreadExtensionService),s=n.getProxy(T.MainThreadErrors),c=await r.getExtensionRegistry(),l=await r.getExtensionPathIndex(),u=new WeakMap;function p(e,t){if(u.has(e))return u.get(e).stack;let n=``,r,i;for(let e of t)n+=`\n\tat ${e.toString()}`,i=e.getFileName(),!r&&i&&(r=l.findSubstr(C.file(i)));let a=`${e.name||`Error`}: ${e.message||``}${n}`;return u.set(e,{extensionIdentifier:r?.identifier,stack:a}),a}let m=Symbol(`prepareStackTrace wrapped`),ee=p;Object.defineProperty(Error,"prepareStackTrace",{configurable:!1,get(){return ee},set(e){if(e===p||!e||e[m]){ee=e||p;return}ee=function(t,n){return p(t,n),e.call(Error,t,n)},Object.assign(ee,{[m]:!0})}}),f(e=>{ae.is(e)||t.error(e);let n=te(e),r;if(r=e instanceof Os?e.extension:u.get(e)?.extensionIdentifier,r)if(ae.is(e)){let t=c.getExtensionDescription(r);t&&a.report(e.name,t,`${e.message}\n FROM: ${e.stack}`)}else{o.$onExtensionRuntimeError(r,n);let a=i.onExtensionError(r,e);t.trace(`forwarded error to extension?`,a,r)}}),d.addListener(e=>{s.$onUnexpectedError(e)})}},cz=class e{constructor(t,n,r,i,a){this._hostUtils=r,this._rpcProtocol=new ms(t,null,i),n=e._transform(n,this._rpcProtocol);let o=new Bs(...zs());o.set(Vs,{_serviceBrand:void 0,...n,messagePorts:a}),o.set(Js,new Ys(this._rpcProtocol)),o.set(Xs,new Zs(i)),o.set(GR,r),o.set(Ns,new Fs(oz,[!0],!0)),o.set(Ps,new Fs(rz,[],!0));let s=new Gs(o,!0);An&&s.invokeFunction(sz.installEarlyHandler),this._logService=s.invokeFunction(e=>e.get(Ns)),Ar(`code/extHost/didCreateServices`),this._hostUtils.pid?this._logService.info(`Extension host with pid ${this._hostUtils.pid} started`):this._logService.info(`Extension host started`),this._logService.trace(`initData`,n),this._extensionService=s.invokeFunction(e=>e.get(XR)),this._extensionService.initialize(),An&&s.invokeFunction(sz.installFullHandler)}async asBrowserUri(e){let t=this._rpcProtocol.getProxy(T.MainThreadExtensionService);return C.revive(await t.$asBrowserUri(e))}async getAllStaticBrowserUris(){return(await this._rpcProtocol.getProxy(T.MainThreadExtensionService).$getAllStaticBrowserUris()).map(([e,t])=>[C.revive(e),C.revive(t)])}terminate(e){this._extensionService.terminate(e)}getExtHostExtensionService(){return this._extensionService}static _transform(e,t){e.extensions.allExtensions.forEach(e=>{e.extensionLocation=C.revive(t.transformIncomingURIs(e.extensionLocation))}),e.environment.appRoot=C.revive(t.transformIncomingURIs(e.environment.appRoot));let n=e.environment.extensionDevelopmentLocationURI;return n&&(e.environment.extensionDevelopmentLocationURI=n.map(e=>C.revive(t.transformIncomingURIs(e)))),e.environment.extensionTestsLocationURI=C.revive(t.transformIncomingURIs(e.environment.extensionTestsLocationURI)),e.environment.globalStorageHome=C.revive(t.transformIncomingURIs(e.environment.globalStorageHome)),e.environment.workspaceStorageHome=C.revive(t.transformIncomingURIs(e.environment.workspaceStorageHome)),e.nlsBaseUrl=C.revive(t.transformIncomingURIs(e.nlsBaseUrl)),e.logsLocation=C.revive(t.transformIncomingURIs(e.logsLocation)),e.workspace=t.transformIncomingURIs(e.workspace),e}};const lz=(function(e){let t=n=>{globalThis.removeEventListener(`message`,t);let r=n.data;Object.defineProperties(globalThis,{postMessage:{value(e,t){r.postMessage(e,t)}},onmessage:{get(){return r.onmessage},set(e){r.onmessage=e}}}),r.addEventListener(`message`,e=>{globalThis.dispatchEvent(new MessageEvent(`message`,{data:e.data,ports:e.ports?[...e.ports]:void 0}))}),r.start(),globalThis.Worker=class{constructor(){throw TypeError(`Nested workers from within nested worker are NOT supported.`)}},importScripts(e)};globalThis.addEventListener(`message`,t)}).toString();var uz=class extends EventTarget{constructor(e,t,n){super(),this.onmessage=null,this.onmessageerror=null,this.onerror=null;let r=`((${lz})('${t}'))`,i=new Blob([r],{type:`application/javascript`}),a=URL.createObjectURL(i),o=new MessageChannel,s=a;e({type:`_newWorker`,id:s,port:o.port2,url:a,options:n},[o.port2]),this.postMessage=o.port1.postMessage.bind(o.port1),this.terminate=()=>{e({type:`_terminateWorker`,id:s}),URL.revokeObjectURL(a),o.port1.close(),o.port2.close()},Object.defineProperties(this,{onmessage:{get(){return o.port1.onmessage},set(e){o.port1.onmessage=e}},onmessageerror:{get(){return o.port1.onmessageerror},set(e){o.port1.onmessageerror=e}}}),o.port1.addEventListener(`messageerror`,e=>{let t=new MessageEvent(`messageerror`,{data:e.data});this.dispatchEvent(t)}),o.port1.addEventListener(`message`,e=>{let t=new MessageEvent(`message`,{data:e.data});this.dispatchEvent(t)}),o.port1.start()}};new F(`inOutput`,!1),new F(`activeLogOutput`,!1),new F(`activeLogOutput.isLog`,!1),new F(`activeLogOutput.levelSettable`,!1),new F(`activeLogOutput.level`,``),new F(`activeLogOutput.levelIsDefault`,!1),new F(`outputView.scrollLock`,!1),new F(`activeOutputChannel`,``),new F(`output.filter.trace`,!0),new F(`output.filter.debug`,!0),new F(`output.filter.info`,!0),new F(`output.filter.warning`,!0),new F(`output.filter.error`,!0),new F(`outputFilterFocus`,!1),new F(`output.filter.categories`,``);var dz;(function(e){e[e.Append=1]=`Append`,e[e.Replace=2]=`Replace`,e[e.Clear=3]=`Clear`})(dz||={});const fz={OutputChannels:`workbench.contributions.outputChannels`};function pz(e){return Array.isArray(e.source)}var mz=class extends v{constructor(){super(...arguments),this.channels=new Map,this._onDidRegisterChannel=this._register(new x),this.onDidRegisterChannel=this._onDidRegisterChannel.event,this._onDidRemoveChannel=this._register(new x),this.onDidRemoveChannel=this._onDidRemoveChannel.event,this._onDidUpdateChannelFiles=this._register(new x),this.onDidUpdateChannelSources=this._onDidUpdateChannelFiles.event}registerChannel(e){this.channels.has(e.id)||(this.channels.set(e.id,e),this._onDidRegisterChannel.fire(e.id))}getChannels(){let e=[];return this.channels.forEach(t=>e.push(t)),e}getChannel(e){return this.channels.get(e)}updateChannelSources(e,t){let n=this.channels.get(e);n&&pz(n)&&(n.source=t,this._onDidUpdateChannelFiles.fire(n))}removeChannel(e){let t=this.channels.get(e);t&&(this.channels.delete(e),this._onDidRemoveChannel.fire(t))}};Am.add(fz.OutputChannels,new mz);var hz=class extends Kh{constructor(e,t,n,r,i){super(),this.id=e,this.name=t,this.logger=n,this.proxy=r,this.extension=i,this.offset=0,this.visible=!1,this.setLevel(n.getLevel()),this._register(n.onDidChangeLogLevel(e=>this.setLevel(e))),this._register(g(()=>this.proxy.$dispose(this.id)))}get logLevel(){return this.getLevel()}appendLine(e){this.append(e+`
|
|
100
|
+
`)}append(e){this.info(e)}clear(){let e=this.offset;this.logger.flush(),this.proxy.$update(this.id,dz.Clear,e)}replace(e){let t=this.offset;this.info(e),this.proxy.$update(this.id,dz.Replace,t),this.visible&&this.logger.flush()}show(e,t){this.logger.flush(),this.proxy.$reveal(this.id,!!(typeof e==`boolean`?e:t))}hide(){this.proxy.$close(this.id)}log(e,t){this.offset+=y.fromString(t).byteLength,Uh(this.logger,e,t),this.visible&&(this.logger.flush(),this.proxy.$update(this.id,dz.Append))}},gz=class extends hz{appendLine(e){this.append(e)}};let _z=class{constructor(e,t,n,r,i,a){this.initData=t,this.extHostFileSystem=n,this.extHostFileSystemInfo=r,this.loggerService=i,this.logService=a,this.extensionLogDirectoryCreationPromise=new He,this.logOutputChannels=new He,this.namePool=1,this.channels=new Map,this.visibleChannelId=null,this.proxy=e.getProxy(T.MainThreadOutputService),this.outputsLocation=this.extHostFileSystemInfo.extUri.joinPath(t.logsLocation,`output_logging_${aR(new Date).replace(/-|:|\.\d+Z$/g,``)}`)}$setVisibleChannel(e){this.visibleChannelId=e;for(let[e,t]of this.channels)t.visible=e===this.visibleChannelId}createOutputChannel(e,t,n){if(e=e.trim(),!e)throw Error("illegal argument `name`. must not be falsy");let r=typeof t==`object`&&t.log,i=et(t)?t:void 0;if(et(i)&&!i.trim())throw Error("illegal argument `languageId`. must not be empty");let a=new _,o,s=this.initData.environment.extensionLogLevel?.find(([e])=>Ts.equals(n.identifier,e))?.[1],c;if(r){let t=this.extHostFileSystemInfo.extUri.joinPath(this.initData.logsLocation,n.identifier.value);c=this.extHostFileSystemInfo.extUri.joinPath(t,`${e.replace(/[\\/:\*\?"<>\|]/g,``)}.log`);let r=this.logOutputChannels.get(c);if(r)return r;let i=this.loggerService.getRegisteredLogger(c);i?.logLevel!==void 0&&(s=i.logLevel),o=this.doCreateLogOutputChannel(e,c,s,n,a)}else o=this.doCreateOutputChannel(e,i,n,a);if(o.then(e=>{this.channels.set(e.id,e),e.visible=e.id===this.visibleChannelId,a.add(g(()=>{this.channels.delete(e.id),c&&this.logOutputChannels.delete(c)}))}),c){let t=this.createExtHostLogOutputChannel(e,s??this.logService.getLevel(),o,a);return this.logOutputChannels.set(c,t),t}return this.createExtHostOutputChannel(e,o,a)}async doCreateOutputChannel(e,t,n,r){this.outputDirectoryPromise||=this.extHostFileSystem.value.createDirectory(this.outputsLocation).then(()=>this.outputsLocation);let i=await this.outputDirectoryPromise,a=this.extHostFileSystemInfo.extUri.joinPath(i,`${this.namePool++}-${e.replace(/[\\/:\*\?"<>\|]/g,``)}.log`),o=r.add(this.loggerService.createLogger(a,{logLevel:`always`,donotRotate:!0,donotUseFormatters:!0,hidden:!0})),s=await this.proxy.$register(e,a,t,n.identifier.value);return r.add(g(()=>this.loggerService.deregisterLogger(a))),new hz(s,e,o,this.proxy,n)}async doCreateLogOutputChannel(e,t,n,r,i){await this.createExtensionLogDirectory(t);let a=`${r.identifier.value}.${this.extHostFileSystemInfo.extUri.basename(t)}`,o=i.add(this.loggerService.createLogger(t,{id:a,name:e,logLevel:n,extensionId:r.identifier.value}));return i.add(g(()=>this.loggerService.deregisterLogger(t))),new gz(a,e,o,this.proxy,r)}createExtensionLogDirectory(e){let t=this.extHostFileSystemInfo.extUri.dirname(e),n=this.extensionLogDirectoryCreationPromise.get(t);return n||this.extensionLogDirectoryCreationPromise.set(t,n=(async()=>{try{await this.extHostFileSystem.value.createDirectory(t)}catch(e){if(wc(e)!==xc.FileExists)throw e}})()),n}createExtHostOutputChannel(e,t,n){let r=()=>{if(n.isDisposed)throw Error(`Channel has been closed`)};return t.then(e=>n.add(e)),{get name(){return e},append(e){r(),t.then(t=>t.append(e))},appendLine(e){r(),t.then(t=>t.appendLine(e))},clear(){r(),t.then(e=>e.clear())},replace(e){r(),t.then(t=>t.replace(e))},show(e,n){r(),t.then(t=>t.show(e,n))},hide(){r(),t.then(e=>e.hide())},dispose(){n.dispose()}}}createExtHostLogOutputChannel(e,t,n,r){let i=()=>{if(r.isDisposed)throw Error(`Channel has been closed`)},a=r.add(new x);function o(e){t=e,a.fire(e)}return n.then(e=>{e.logLevel!==t&&o(e.logLevel),r.add(e.onDidChangeLogLevel(e=>o(e)))}),{...this.createExtHostOutputChannel(e,n,r),get logLevel(){return t},onDidChangeLogLevel:a.event,trace(e,...t){i(),n.then(n=>n.trace(e,...t))},debug(e,...t){i(),n.then(n=>n.debug(e,...t))},info(e,...t){i(),n.then(n=>n.info(e,...t))},warn(e,...t){i(),n.then(n=>n.warn(e,...t))},error(e,...t){i(),n.then(n=>n.error(e,...t))}}}};_z=k([A(0,Js),A(1,Vs),A(2,BF),A(3,Wc),A(4,Ps),A(5,Ns)],_z);const vz=O(`IExtHostOutputService`);var yz;let bz=class{static{yz=this}static{this._handlePool=0}static{this._maxEventSize=250}constructor(e,t){this._logService=t,this._provider=new Map,this._proxy=e.getProxy(T.MainThreadDecorations)}registerFileDecorationProvider(e,t){let n=yz._handlePool++;this._provider.set(n,{provider:e,extensionDescription:t}),this._proxy.$registerDecorationProvider(n,t.identifier.value);let r=e.onDidChangeFileDecorations&&e.onDidChangeFileDecorations(e=>{if(!e){this._proxy.$onDidChange(n,null);return}let r=ke(e);if(r.length<=yz._maxEventSize){this._proxy.$onDidChange(n,r);return}this._logService.warn(`[Decorations] CAPPING events from decorations provider`,t.identifier.value,r.length);let i=ye(r.map(e=>({uri:e,rank:ea(e.path,`/`)})),(e,t)=>e.rank-t.rank||ca(e.uri.path,t.uri.path)),a=[];outer:for(let e of i){let t;for(let n of e){let e=Zr(n.uri.path);if(t!==e&&(t=e,a.push(n.uri)>=yz._maxEventSize))break outer}}this._proxy.$onDidChange(n,a)});return new YT(()=>{r?.dispose(),this._proxy.$unregisterDecorationProvider(n),this._provider.delete(n)})}async $provideDecorations(e,t,n){if(!this._provider.has(e))return Object.create(null);let r=Object.create(null),{provider:i,extensionDescription:a}=this._provider.get(e);return await Promise.all(t.map(async e=>{try{let{uri:t,id:o}=e,s=await Promise.resolve(i.provideFileDecoration(C.revive(t),n));if(!s)return;try{OO.validate(s),s.badge&&typeof s.badge!=`string`&&K(a,`codiconDecoration`),r[o]=[s.propagate,s.tooltip,s.badge,s.color]}catch(e){this._logService.warn(`INVALID decoration from extension '${a.identifier.value}': ${e}`)}}catch(e){this._logService.error(e)}})),r}};bz=yz=k([A(0,Js),A(1,Ns)],bz);const xz=O(`IExtHostDecorations`);var Sz=class{constructor(e){this.values=e,this.prefixSum=new Uint32Array(e.length),this.prefixSumValidIndex=new Int32Array(1),this.prefixSumValidIndex[0]=-1}getCount(){return this.values.length}insertValues(e,t){e=qi(e);let n=this.values,r=this.prefixSum,i=t.length;return i===0?!1:(this.values=new Uint32Array(n.length+i),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e),e+i),this.values.set(t,e),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSum=new Uint32Array(this.values.length),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}setValue(e,t){return e=qi(e),t=qi(t),this.values[e]===t?!1:(this.values[e]=t,e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),!0)}removeValues(e,t){e=qi(e),t=qi(t);let n=this.values,r=this.prefixSum;if(e>=n.length)return!1;let i=n.length-e;return t>=i&&(t=i),t===0?!1:(this.values=new Uint32Array(n.length-t),this.values.set(n.subarray(0,e),0),this.values.set(n.subarray(e+t),e),this.prefixSum=new Uint32Array(this.values.length),e-1<this.prefixSumValidIndex[0]&&(this.prefixSumValidIndex[0]=e-1),this.prefixSumValidIndex[0]>=0&&this.prefixSum.set(r.subarray(0,this.prefixSumValidIndex[0]+1)),!0)}getTotalSum(){return this.values.length===0?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=qi(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;t===0&&(this.prefixSum[0]=this.values[0],t++),e>=this.values.length&&(e=this.values.length-1);for(let n=t;n<=e;n++)this.prefixSum[n]=this.prefixSum[n-1]+this.values[n];return this.prefixSumValidIndex[0]=Math.max(this.prefixSumValidIndex[0],e),this.prefixSum[e]}getIndexOf(e){e=Math.floor(e),this.getTotalSum();let t=0,n=this.values.length-1,r=0,i=0,a=0;for(;t<=n;)if(r=t+(n-t)/2|0,i=this.prefixSum[r],a=i-this.values[r],e<a)n=r-1;else if(e>=i)t=r+1;else break;return new Cz(r,e-a)}},Cz=class{constructor(e,t){this.index=e,this.remainder=t,this._prefixSumIndexOfResultBrand=void 0,this.index=e,this.remainder=t}},wz=class{constructor(e,t,n,r){this._uri=e,this._lines=t,this._eol=n,this._versionId=r,this._lineStarts=null,this._cachedTextValue=null}dispose(){this._lines.length=0}get version(){return this._versionId}getText(){return this._cachedTextValue===null&&(this._cachedTextValue=this._lines.join(this._eol)),this._cachedTextValue}onEvents(e){e.eol&&e.eol!==this._eol&&(this._eol=e.eol,this._lineStarts=null);let t=e.changes;for(let e of t)this._acceptDeleteRange(e.range),this._acceptInsertText(new Tp(e.range.startLineNumber,e.range.startColumn),e.text);this._versionId=e.versionId,this._cachedTextValue=null}_ensureLineStarts(){if(!this._lineStarts){let e=this._eol.length,t=this._lines.length,n=new Uint32Array(t);for(let r=0;r<t;r++)n[r]=this._lines[r].length+e;this._lineStarts=new Sz(n)}}_setLineText(e,t){this._lines[e]=t,this._lineStarts&&this._lineStarts.setValue(e,this._lines[e].length+this._eol.length)}_acceptDeleteRange(e){if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.startLineNumber-1].substring(e.endColumn-1));return}this._setLineText(e.startLineNumber-1,this._lines[e.startLineNumber-1].substring(0,e.startColumn-1)+this._lines[e.endLineNumber-1].substring(e.endColumn-1)),this._lines.splice(e.startLineNumber,e.endLineNumber-e.startLineNumber),this._lineStarts&&this._lineStarts.removeValues(e.startLineNumber,e.endLineNumber-e.startLineNumber)}_acceptInsertText(e,t){if(t.length===0)return;let n=aa(t);if(n.length===1){this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]+this._lines[e.lineNumber-1].substring(e.column-1));return}n[n.length-1]+=this._lines[e.lineNumber-1].substring(e.column-1),this._setLineText(e.lineNumber-1,this._lines[e.lineNumber-1].substring(0,e.column-1)+n[0]);let r=new Uint32Array(n.length-1);for(let t=1;t<n.length;t++)this._lines.splice(e.lineNumber+t-1,0,n[t]),r[t-1]=n[t].length+this._eol.length;this._lineStarts&&this._lineStarts.insertValues(e.lineNumber,r)}};const Tz=new Map;function Ez(e,t){t?Tz.set(e,t):Tz.delete(e)}function Dz(e){return Tz.get(e)}var Oz=class extends wz{constructor(e,t,n,r,i,a,o,s,c=!0){super(t,n,r,i),this._proxy=e,this._languageId=a,this._isDirty=o,this._encoding=s,this._strictInstanceofChecks=c,this._isDisposed=!1}dispose(){Xe(!this._isDisposed),this._isDisposed=!0,this._isDirty=!1}equalLines(e){return ge(this._lines,e)}get document(){if(!this._document){let e=this;this._document={get uri(){return e._uri},get fileName(){return e._uri.fsPath},get isUntitled(){return e._uri.scheme===D.untitled},get languageId(){return e._languageId},get version(){return e._versionId},get isClosed(){return e._isDisposed},get isDirty(){return e._isDirty},get encoding(){return e._encoding},save(){return e._save()},getText(t){return t?e._getTextInRange(t):e.getText()},get eol(){return e._eol===`
|
|
101
|
+
`?FT.LF:FT.CRLF},get lineCount(){return e._lines.length},lineAt(t){return e._lineAt(t)},offsetAt(t){return e._offsetAt(t)},positionAt(t){return e._positionAt(t)},validateRange(t){return e._validateRange(t)},validatePosition(t){return e._validatePosition(t)},getWordRangeAtPosition(t,n){return e._getWordRangeAtPosition(t,n)},[Symbol.for(`debug.description`)](){return`TextDocument(${e._uri.toString()})`}}}return Object.freeze(this._document)}_acceptLanguageId(e){Xe(!this._isDisposed),this._languageId=e}_acceptIsDirty(e){Xe(!this._isDisposed),this._isDirty=e}_acceptEncoding(e){Xe(!this._isDisposed),this._encoding=e}_save(){return this._isDisposed?Promise.reject(Error(`Document has been closed`)):this._proxy.$trySaveDocument(this._uri)}_getTextInRange(e){let t=this._validateRange(e);if(t.isEmpty)return``;if(t.isSingleLine)return this._lines[t.start.line].substring(t.start.character,t.end.character);let n=this._eol,r=t.start.line,i=t.end.line,a=[];a.push(this._lines[r].substring(t.start.character));for(let e=r+1;e<i;e++)a.push(this._lines[e]);return a.push(this._lines[i].substring(0,t.end.character)),a.join(n)}_lineAt(e){let t;if(e instanceof aT?t=e.line:typeof e==`number`?t=e:!this._strictInstanceofChecks&&aT.isPosition(e)&&(t=e.line),typeof t!=`number`||t<0||t>=this._lines.length||Math.floor(t)!==t)throw Error("Illegal value for `line`");return new kz(t,this._lines[t],t===this._lines.length-1)}_offsetAt(e){return e=this._validatePosition(e),this._ensureLineStarts(),this._lineStarts.getPrefixSum(e.line-1)+e.character}_positionAt(e){e=Math.floor(e),e=Math.max(0,e),this._ensureLineStarts();let t=this._lineStarts.getIndexOf(e),n=this._lines[t.index].length;return new aT(t.index,Math.min(t.remainder,n))}_validateRange(e){if(this._strictInstanceofChecks){if(!(e instanceof sT))throw Error(`Invalid argument`)}else if(!sT.isRange(e))throw Error(`Invalid argument`);let t=this._validatePosition(e.start),n=this._validatePosition(e.end);return t===e.start&&n===e.end?e:new sT(t.line,t.character,n.line,n.character)}_validatePosition(e){if(this._strictInstanceofChecks){if(!(e instanceof aT))throw Error(`Invalid argument`)}else if(!aT.isPosition(e))throw Error(`Invalid argument`);if(this._lines.length===0)return e.with(0,0);let{line:t,character:n}=e,r=!1;if(t<0)t=0,n=0,r=!0;else if(t>=this._lines.length)t=this._lines.length-1,n=this._lines[t].length,r=!0;else{let e=this._lines[t].length;n<0?(n=0,r=!0):n>e&&(n=e,r=!0)}return r?new aT(t,n):e}_getWordRangeAtPosition(e,t){let n=this._validatePosition(e);if(!t)t=Dz(this._languageId);else if(ia(t))throw Error(`[getWordRangeAtPosition]: ignoring custom regexp '${t.source}' because it matches the empty string.`);let r=gd(n.character+1,md(t),this._lines[n.line],0);if(r)return new sT(n.line,r.startColumn-1,n.line,r.endColumn-1)}},kz=class{constructor(e,t,n){this._line=e,this._text=t,this._isLastLine=n}get lineNumber(){return this._line}get text(){return this._text}get range(){return new sT(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:new sT(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}},Az=class{constructor(e){this._prefix=e,this._lastId=0}nextId(){return this._prefix+ ++this._lastId}};new Az(`id#`);var jz=class e{static{this._Keys=new Az(`TextEditorDecorationType`)}constructor(t,n,r){let i=e._Keys.nextId();t.$registerTextEditorDecorationType(n.identifier,i,Ej.from(r)),this.value=Object.freeze({key:i,dispose(){t.$removeTextEditorDecorationType(i)}})}},Mz=class{constructor(e,t){this._collectedEdits=[],this._setEndOfLine=void 0,this._finalized=!1,this._document=e,this._documentVersionId=e.version,this._undoStopBefore=t.undoStopBefore,this._undoStopAfter=t.undoStopAfter}finalize(){return this._finalized=!0,{documentVersionId:this._documentVersionId,edits:this._collectedEdits,setEndOfLine:this._setEndOfLine,undoStopBefore:this._undoStopBefore,undoStopAfter:this._undoStopAfter}}_throwIfFinalized(){if(this._finalized)throw Error(`Edit is only valid while callback runs`)}replace(e,t){this._throwIfFinalized();let n=null;if(e instanceof aT)n=new sT(e,e);else if(e instanceof sT)n=e;else throw Error(`Unrecognized location`);this._pushEdit(n,t,!1)}insert(e,t){this._throwIfFinalized(),this._pushEdit(new sT(e,e),t,!0)}delete(e){this._throwIfFinalized();let t=null;if(e instanceof sT)t=e;else throw Error(`Unrecognized location`);this._pushEdit(t,null,!0)}_pushEdit(e,t,n){let r=this._document.validateRange(e);this._collectedEdits.push({range:r,text:t,forceMoveMarkers:n})}setEndOfLine(e){if(this._throwIfFinalized(),e!==FT.LF&&e!==FT.CRLF)throw se(`endOfLine`);this._setEndOfLine=e}},Nz=class{constructor(e,t,n,r){this._proxy=e,this._id=t,this._accept(n),this._logService=r;let i=this;this.value={get tabSize(){return i._tabSize},set tabSize(e){i._setTabSize(e)},get indentSize(){return i._indentSize},set indentSize(e){i._setIndentSize(e)},get insertSpaces(){return i._insertSpaces},set insertSpaces(e){i._setInsertSpaces(e)},get cursorStyle(){return i._cursorStyle},set cursorStyle(e){i._setCursorStyle(e)},get lineNumbers(){return i._lineNumbers},set lineNumbers(e){i._setLineNumbers(e)}}}_accept(e){this._tabSize=e.tabSize,this._indentSize=e.indentSize,this._originalIndentSize=e.originalIndentSize,this._insertSpaces=e.insertSpaces,this._cursorStyle=e.cursorStyle,this._lineNumbers=sM.to(e.lineNumbers)}_validateTabSize(e){if(e===`auto`)return`auto`;if(typeof e==`number`){let t=Math.floor(e);return t>0?t:null}if(typeof e==`string`){let t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setTabSize(e){let t=this._validateTabSize(e);if(t!==null){if(typeof t==`number`){if(this._tabSize===t)return;this._tabSize=t}this._warnOnError(`setTabSize`,this._proxy.$trySetOptions(this._id,{tabSize:t}))}}_validateIndentSize(e){if(e===`tabSize`)return`tabSize`;if(typeof e==`number`){let t=Math.floor(e);return t>0?t:null}if(typeof e==`string`){let t=parseInt(e,10);return isNaN(t)?null:t>0?t:null}return null}_setIndentSize(e){let t=this._validateIndentSize(e);if(t!==null){if(typeof t==`number`){if(this._originalIndentSize===t)return;this._indentSize=t,this._originalIndentSize=t}this._warnOnError(`setIndentSize`,this._proxy.$trySetOptions(this._id,{indentSize:t}))}}_validateInsertSpaces(e){return e===`auto`?`auto`:e===`false`?!1:!!e}_setInsertSpaces(e){let t=this._validateInsertSpaces(e);if(typeof t==`boolean`){if(this._insertSpaces===t)return;this._insertSpaces=t}this._warnOnError(`setInsertSpaces`,this._proxy.$trySetOptions(this._id,{insertSpaces:t}))}_setCursorStyle(e){this._cursorStyle!==e&&(this._cursorStyle=e,this._warnOnError(`setCursorStyle`,this._proxy.$trySetOptions(this._id,{cursorStyle:e})))}_setLineNumbers(e){this._lineNumbers!==e&&(this._lineNumbers=e,this._warnOnError(`setLineNumbers`,this._proxy.$trySetOptions(this._id,{lineNumbers:sM.from(e)})))}assign(e){let t={},n=!1;if(e.tabSize!==void 0){let r=this._validateTabSize(e.tabSize);r===`auto`?(n=!0,t.tabSize=r):typeof r==`number`&&this._tabSize!==r&&(this._tabSize=r,n=!0,t.tabSize=r)}if(e.indentSize!==void 0){let r=this._validateIndentSize(e.indentSize);r===`tabSize`?(n=!0,t.indentSize=r):typeof r==`number`&&this._originalIndentSize!==r&&(this._indentSize=r,this._originalIndentSize=r,n=!0,t.indentSize=r)}if(e.insertSpaces!==void 0){let r=this._validateInsertSpaces(e.insertSpaces);r===`auto`?(n=!0,t.insertSpaces=r):this._insertSpaces!==r&&(this._insertSpaces=r,n=!0,t.insertSpaces=r)}e.cursorStyle!==void 0&&this._cursorStyle!==e.cursorStyle&&(this._cursorStyle=e.cursorStyle,n=!0,t.cursorStyle=e.cursorStyle),e.lineNumbers!==void 0&&this._lineNumbers!==e.lineNumbers&&(this._lineNumbers=e.lineNumbers,n=!0,t.lineNumbers=sM.from(e.lineNumbers)),n&&this._warnOnError(`setOptions`,this._proxy.$trySetOptions(this._id,t))}_warnOnError(e,t){t.catch(t=>{this._logService.warn(`ExtHostTextEditorOptions '${e}' failed:'`),this._logService.warn(t)})}},Pz=class{constructor(e,t,n,r,i,a,o,s){this.id=e,this._proxy=t,this._logService=n,this._disposed=!1,this._hasDecorationsForKey=new Set,this._selections=i,this._options=new Nz(this._proxy,this.id,a,n),this._visibleRanges=o,this._viewColumn=s;let c=this;this.value=Object.freeze({get document(){return r.value},set document(e){throw new le(`document`)},get selection(){return c._selections&&c._selections[0]},set selection(e){if(!(e instanceof ET))throw se(`selection`);c._selections=[e],c._trySetSelection()},get selections(){return c._selections},set selections(e){if(!Array.isArray(e)||e.some(e=>!(e instanceof ET)))throw se(`selections`);e.length===0&&(e=[new ET(0,0,0,0)]),c._selections=e,c._trySetSelection()},get visibleRanges(){return c._visibleRanges},set visibleRanges(e){throw new le(`visibleRanges`)},get diffInformation(){return c._diffInformation},get options(){return c._options.value},set options(e){c._disposed||c._options.assign(e)},get viewColumn(){return c._viewColumn},set viewColumn(e){throw new le(`viewColumn`)},edit(e,t={undoStopBefore:!0,undoStopAfter:!0}){if(c._disposed)return Promise.reject(Error(`TextEditor#edit not possible on closed editors`));let n=new Mz(r.value,t);return e(n),c._applyEdit(n)},insertSnippet(n,i,a={undoStopBefore:!0,undoStopAfter:!0}){if(c._disposed)return Promise.reject(Error(`TextEditor#insertSnippet not possible on closed editors`));let o;if(!i||Array.isArray(i)&&i.length===0)o=c._selections.map(e=>J.from(e));else if(i instanceof aT){let{lineNumber:e,column:t}=fj.from(i);o=[{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}]}else if(i instanceof sT)o=[J.from(i)];else{o=[];for(let e of i)if(e instanceof sT)o.push(J.from(e));else{let{lineNumber:t,column:n}=fj.from(e);o.push({startLineNumber:t,startColumn:n,endLineNumber:t,endColumn:n})}}return a.keepWhitespace===void 0&&(a.keepWhitespace=!1),t.$tryInsertSnippet(e,r.value.version,n.value,o,a)},setDecorations(n,r){let i=r.length===0;i&&!c._hasDecorationsForKey.has(n.key)||(i?c._hasDecorationsForKey.delete(n.key):c._hasDecorationsForKey.add(n.key),c._runOnProxy(()=>{if(bj(r))return t.$trySetDecorations(e,n.key,xj(r));{let i=Array(4*r.length);for(let e=0,t=r.length;e<t;e++){let t=r[e];i[4*e]=t.start.line+1,i[4*e+1]=t.start.character+1,i[4*e+2]=t.end.line+1,i[4*e+3]=t.end.character+1}return t.$trySetDecorationsFast(e,n.key,i)}}))},revealRange(n,r){c._runOnProxy(()=>t.$tryRevealRange(e,J.from(n),r||RE.Default))},show(n){t.$tryShowEditor(e,vj.from(n))},hide(){t.$tryHideEditor(e)},[Symbol.for(`debug.description`)](){return`TextEditor(${this.document.uri.toString()})`}})}dispose(){Xe(!this._disposed),this._disposed=!0}_acceptOptions(e){Xe(!this._disposed),this._options._accept(e)}_acceptVisibleRanges(e){Xe(!this._disposed),this._visibleRanges=e}_acceptViewColumn(e){Xe(!this._disposed),this._viewColumn=e}_acceptSelections(e){Xe(!this._disposed),this._selections=e}_acceptDiffInformation(e){Xe(!this._disposed),this._diffInformation=e}async _trySetSelection(){let e=this._selections.map(lj.from);return await this._runOnProxy(()=>this._proxy.$trySetSelections(this.id,e)),this.value}_applyEdit(e){let t=e.finalize();if(t.edits.length===0&&!t.setEndOfLine)return Promise.resolve(!0);let n=t.edits.map(e=>e.range);n.sort((e,t)=>e.end.line===t.end.line?e.end.character===t.end.character?e.start.line===t.start.line?e.start.character-t.start.character:e.start.line-t.start.line:e.end.character-t.end.character:e.end.line-t.end.line);for(let e=0,t=n.length-1;e<t;e++){let t=n[e].end;if(n[e+1].start.isBefore(t))return Promise.reject(Error(`Overlapping ranges are not allowed!`))}let r=t.edits.map(e=>({range:J.from(e.range),text:e.text,forceMoveMarkers:e.forceMoveMarkers}));return this._proxy.$tryApplyEdits(this.id,t.documentVersionId,r,{setEndOfLine:typeof t.setEndOfLine==`number`?cM.from(t.setEndOfLine):void 0,undoStopBefore:t.undoStopBefore,undoStopAfter:t.undoStopAfter})}_runOnProxy(e){return this._disposed?(this._logService.warn(`TextEditor is closed/disposed`),Promise.resolve(void 0)):e().then(()=>this,e=>(e instanceof Error&&e.name===`DISPOSED`||this._logService.warn(e),null))}},Fz=class{constructor(e){this.value=e,this._count=0}ref(){this._count++}unref(){return--this._count===0}};let Iz=class{constructor(e,t){this._extHostRpc=e,this._logService=t,this._activeEditorId=null,this._editors=new Map,this._documents=new He,this._onDidAddDocuments=new x,this._onDidRemoveDocuments=new x,this._onDidChangeVisibleTextEditors=new x,this._onDidChangeActiveTextEditor=new x,this.onDidAddDocuments=this._onDidAddDocuments.event,this.onDidRemoveDocuments=this._onDidRemoveDocuments.event,this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event,this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event}$acceptDocumentsAndEditorsDelta(e){this.acceptDocumentsAndEditorsDelta(e)}acceptDocumentsAndEditorsDelta(e){let t=[],n=[],r=[];if(e.removedDocuments)for(let n of e.removedDocuments){let e=C.revive(n),r=this._documents.get(e);r?.unref()&&(this._documents.delete(e),t.push(r.value))}if(e.addedDocuments)for(let t of e.addedDocuments){let e=C.revive(t.uri),r=this._documents.get(e);if(r&&e.scheme!==D.vscodeNotebookCell&&e.scheme!==D.vscodeInteractiveInput)throw Error(`document '${e} already exists!'`);r||(r=new Fz(new Oz(this._extHostRpc.getProxy(T.MainThreadDocuments),e,t.lines,t.EOL,t.versionId,t.languageId,t.isDirty,t.encoding)),this._documents.set(e,r),n.push(r.value)),r.ref()}if(e.removedEditors)for(let t of e.removedEditors){let e=this._editors.get(t);this._editors.delete(t),e&&r.push(e)}if(e.addedEditors)for(let t of e.addedEditors){let e=C.revive(t.documentUri);Xe(this._documents.has(e),`document '${e}' does not exist`),Xe(!this._editors.has(t.id),`editor '${t.id}' already exists!`);let n=this._documents.get(e).value,r=new Pz(t.id,this._extHostRpc.getProxy(T.MainThreadTextEditors),this._logService,new u(()=>n.document),t.selections.map(lj.to),t.options,t.visibleRanges.map(e=>J.to(e)),typeof t.editorPosition==`number`?vj.to(t.editorPosition):void 0);this._editors.set(t.id,r)}e.newActiveEditor!==void 0&&(Xe(e.newActiveEditor===null||this._editors.has(e.newActiveEditor),`active editor '${e.newActiveEditor}' does not exist`),this._activeEditorId=e.newActiveEditor),xt(t),xt(r),e.removedDocuments&&this._onDidRemoveDocuments.fire(t),e.addedDocuments&&this._onDidAddDocuments.fire(n),(e.removedEditors||e.addedEditors)&&this._onDidChangeVisibleTextEditors.fire(this.allEditors().map(e=>e.value)),e.newActiveEditor!==void 0&&this._onDidChangeActiveTextEditor.fire(this.activeEditor())}getDocument(e){return this._documents.get(e)?.value}allDocuments(){return vt.map(this._documents.values(),e=>e.value)}getEditor(e){return this._editors.get(e)}activeEditor(e){if(!this._activeEditorId)return;let t=this._editors.get(this._activeEditorId);return e?t:t?.value}allEditors(){return[...this._editors.values()]}};Iz=k([A(0,Js),A(1,Ns)],Iz);const Lz=O(`IExtHostDocumentsAndEditors`),Rz={type:`object`,additionalProperties:!1,properties:{type:{type:`string`,description:b(14075,`The actual task type. Please note that types starting with a '$' are reserved for internal usage.`)},required:{type:`array`,markdownDescription:b(14076,"The names of the properties from the `properties` object that must be provided for a task of this type to be considered a match. Used by VS Code to associate a `tasks.json` entry with a registered task provider."),items:{type:`string`}},properties:{type:`object`,description:b(14077,`Additional properties of the task type`),additionalProperties:{$ref:`http://json-schema.org/draft-07/schema#`}},when:{type:`string`,markdownDescription:b(14078,"Condition which must be true to enable this type of task. Consider using `shellExecutionSupported`, `processExecutionSupported`, and `customExecutionSupported` as appropriate for this task definition. See the [API documentation](https://code.visualstudio.com/api/extension-guides/task-provider#when-clause) for more information."),default:``}}};var zz;(function(e){function t(e,t,n){if(!e)return;let r=et(e.type)?e.type:void 0;if(!r||r.length===0){n.error(b(14079,`The task type configuration is missing the required 'taskType' property`));return}let i=[];if(Array.isArray(e.required))for(let t of e.required)et(t)&&i.push(t);return{extensionId:t.value,taskType:r,required:i,properties:e.properties?sc(e.properties):{},when:e.when?Fd.deserialize(e.when):void 0}}e.from=t})(zz||={});const Bz=gx.registerExtensionPoint({extensionPoint:`taskDefinitions`,activationEventsGenerator:function*(e){for(let t of e)t.type&&(yield`onTaskType:${t.type}`)},jsonSchema:{description:b(14080,`Contributes task kinds`),type:`array`,items:Rz}}),Vz=new class{constructor(){this._onDefinitionsChanged=new x,this.onDefinitionsChanged=this._onDefinitionsChanged.event,this.taskTypes=Object.create(null),this.readyPromise=new Promise((e,t)=>{Bz.setHandler((t,n)=>{this._schema=void 0;try{for(let e of n.removed){let t=e.value;for(let e of t)this.taskTypes&&e.type&&this.taskTypes[e.type]&&delete this.taskTypes[e.type]}for(let e of n.added){let t=e.value;for(let n of t){let t=zz.from(n,e.description.identifier,e.collector);t&&(this.taskTypes[t.taskType]=t)}}(n.removed.length>0||n.added.length>0)&&this._onDefinitionsChanged.fire()}catch{}e(void 0)})})}onReady(){return this.readyPromise}get(e){return this.taskTypes[e]}all(){return Object.keys(this.taskTypes).map(e=>this.taskTypes[e])}getJsonSchema(){if(this._schema===void 0){let e=[];for(let t of this.all()){let n={type:`object`,additionalProperties:!1};t.required.length>0&&(n.required=t.required.slice(0)),t.properties===void 0?n.properties=Object.create(null):n.properties=sc(t.properties),n.properties.type={type:`string`,enum:[t.taskType]},e.push(n)}this._schema={oneOf:e}}return this._schema}},Hz={IconContribution:`base.contributions.icons`};var Uz;(function(e){function t(e,t){let n=e.defaults;for(;vl.isThemeIcon(n);){let e=qz.getIcon(n.id);if(!e)return;n=e.defaults}return n}e.getDefinition=t})(Uz||={});var Wz;(function(e){function t(e){return{weight:e.weight,style:e.style,src:e.src.map(e=>({format:e.format,location:e.location.toString()}))}}e.toJSONObject=t;function n(e){let t=e=>et(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every(e=>et(e.format)&&et(e.location)))return{weight:t(e.weight),style:t(e.style),src:e.src.map(e=>({format:e.format,location:C.parse(e.location)}))}}e.fromJSONObject=n})(Wz||={});const Gz=/^([\w_-]+)$/,Kz=b(2485,`The font ID must only contain letters, numbers, underscores and dashes.`),qz=new class extends v{constructor(){super(),this._onDidChange=this._register(new x),this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:`object`,properties:{fontId:{type:`string`,description:b(2486,`The id of the font to use. If not set, the font that is defined first is used.`),pattern:Gz.source,patternErrorMessage:Kz},fontCharacter:{type:`string`,description:b(2487,`The font character associated with the icon definition.`)}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:`\\\\e030`}}]}},type:`object`,properties:{}},this.iconReferenceSchema={type:`string`,pattern:`^${vl.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,n,r){let i=this.iconsById[e];if(i){if(n&&!i.description){i.description=n,this.iconSchema.properties[e].markdownDescription=`${n} $(${e})`;let t=this.iconReferenceSchema.enum.indexOf(e);t!==-1&&(this.iconReferenceSchema.enumDescriptions[t]=n),this._onDidChange.fire()}return i}let a={id:e,description:n,defaults:t,deprecationMessage:r};this.iconsById[e]=a;let o={$ref:`#/definitions/icons`};return r&&(o.deprecationMessage=r),n&&(o.markdownDescription=`${n}: $(${e})`),this.iconSchema.properties[e]=o,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(n||``),this._onDidChange.fire(),{id:e}}deregisterIcon(e){delete this.iconsById[e],delete this.iconSchema.properties[e];let 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){return this.iconFontsById[e]||(this.iconFontsById[e]=t,this._onDidChange.fire(),t)}deregisterIconFont(e){delete this.iconFontsById[e]}getIconFont(e){return this.iconFontsById[e]}toString(){let e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;vl.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:``}`},n=[];n.push(`| preview | identifier | default codicon ID | description`),n.push(`| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |`);let r=Object.keys(this.iconsById).map(e=>this.iconsById[e]);for(let i of r.filter(e=>!!e.description).sort(e))n.push(`|<i class="${t(i)}"></i>|${i.id}|${vl.isThemeIcon(i.defaults)?i.defaults.id:i.id}|${i.description||``}|`);n.push(`| preview | identifier `),n.push(`| ----------- | --------------------------------- |`);for(let i of r.filter(e=>!vl.isThemeIcon(e.defaults)).sort(e))n.push(`|<i class="${t(i)}"></i>|${i.id}|`);return n.join(`
|
|
102
|
+
`)}};Am.add(Hz.IconContribution,qz);function Jz(e,t,n,r){return qz.registerIcon(e,t,n,r)}function Yz(){let e=ml();for(let t in e){let n=`\\`+e[t].toString(16);qz.registerIcon(t,{fontCharacter:n})}}Yz();const Xz=`vscode://schemas/icons`,Zz=Am.as(sg.JSONContribution);Zz.registerSchema(Xz,qz.getIconSchema());const Qz=new Ro(()=>Zz.notifySchemaChanged(Xz),200);qz.onDidChange(()=>{Qz.isScheduled()||Qz.schedule()}),Jz(`widget-close`,N.close,b(2488,`Icon for the close action in widgets.`)),Jz(`goto-previous-location`,N.arrowUp,b(2489,`Icon for goto previous editor location.`)),Jz(`goto-next-location`,N.arrowDown,b(2490,`Icon for goto next editor location.`)),vl.modify(N.sync,`spin`),vl.modify(N.loading,`spin`),Jz(`rerun-task`,N.refresh,b(13866,`View icon of the rerun task.`)),new F(`taskRunning`,!1,b(14091,`Whether a task is currently running.`)),new F(`taskTerminalActive`,!1,b(14092,`Whether the active terminal is a task terminal.`)),ln(14093,`Tasks`);var $z;(function(e){e[e.Escape=1]=`Escape`,e[e.Strong=2]=`Strong`,e[e.Weak=3]=`Weak`})($z||={}),(function(e){function t(t){if(!t)return e.Strong;switch(t.toLowerCase()){case`escape`:return e.Escape;case`strong`:return e.Strong;case`weak`:return e.Weak;default:return e.Strong}}e.from=t})($z||={});var eB;(function(e){e.defaults={cwd:"${workspaceFolder}"}})(eB||={});var tB;(function(e){e[e.Always=1]=`Always`,e[e.Silent=2]=`Silent`,e[e.Never=3]=`Never`})(tB||={}),(function(e){function t(t){switch(t.toLowerCase()){case`always`:return e.Always;case`silent`:return e.Silent;case`never`:return e.Never;default:return e.Always}}e.fromString=t})(tB||={});var nB;(function(e){e[e.Never=1]=`Never`,e[e.OnProblem=2]=`OnProblem`,e[e.Always=3]=`Always`})(nB||={}),(function(e){function t(t){switch(t.toLowerCase()){case`always`:return e.Always;case`never`:return e.Never;case`onproblem`:return e.OnProblem;default:return e.OnProblem}}e.fromString=t})(nB||={});var rB;(function(e){e[e.Shared=1]=`Shared`,e[e.Dedicated=2]=`Dedicated`,e[e.New=3]=`New`})(rB||={}),(function(e){function t(t){switch(t.toLowerCase()){case`shared`:return e.Shared;case`dedicated`:return e.Dedicated;case`new`:return e.New;default:return e.Shared}}e.fromString=t})(rB||={});var iB;(function(e){e.defaults={echo:!0,reveal:tB.Always,revealProblems:nB.Never,focus:!1,panel:rB.Shared,showReuseMessage:!0,clear:!1,preserveTerminalName:!1}})(iB||={});var aB;(function(e){e[e.Shell=1]=`Shell`,e[e.Process=2]=`Process`,e[e.CustomExecution=3]=`CustomExecution`})(aB||={}),(function(e){function t(t){switch(t.toLowerCase()){case`shell`:return e.Shell;case`process`:return e.Process;case`customExecution`:return e.CustomExecution;default:return e.Process}}e.fromString=t;function n(t){switch(t){case e.Shell:return`shell`;case e.Process:return`process`;case e.CustomExecution:return`customExecution`;default:return`process`}}e.toString=n})(aB||={});var oB;(function(e){function t(e){return et(e)?e:e.value}e.value=t})(oB||={});var sB;(function(e){e.Clean={_id:`clean`,isDefault:!1},e.Build={_id:`build`,isDefault:!1},e.Rebuild={_id:`rebuild`,isDefault:!1},e.Test={_id:`test`,isDefault:!1};function t(t){return t===e.Clean._id||t===e.Build._id||t===e.Rebuild._id||t===e.Test._id}e.is=t;function n(e){if(e!==void 0)return et(e)?t(e)?{_id:e,isDefault:!1}:void 0:e}e.from=n})(sB||={});var cB;(function(e){e[e.Global=1]=`Global`,e[e.Workspace=2]=`Workspace`,e[e.Folder=3]=`Folder`})(cB||={});var lB;(function(e){e.Workspace=`workspace`,e.Extension=`extension`,e.InMemory=`inMemory`,e.WorkspaceFile=`workspaceFile`,e.User=`user`;function t(t){switch(t){case e.User:return Zh.USER;case e.WorkspaceFile:return Zh.WORKSPACE;default:return Zh.WORKSPACE_FOLDER}}e.toConfigurationTarget=t})(lB||={});var uB;(function(e){e.parallel=`parallel`,e.sequence=`sequence`})(uB||={});var dB;(function(e){e[e.default=1]=`default`,e[e.folderOpen=2]=`folderOpen`,e[e.worktreeCreated=3]=`worktreeCreated`})(dB||={});var fB;(function(e){e.terminateNewest=`terminateNewest`,e.terminateOldest=`terminateOldest`,e.prompt=`prompt`,e.warn=`warn`,e.silent=`silent`})(fB||={});var pB;(function(e){e.defaults={reevaluateOnRerun:!0,runOn:dB.default,instanceLimit:1,instancePolicy:fB.prompt}})(pB||={});var mB;(function(e){e[e.Process=1]=`Process`,e[e.Terminal=2]=`Terminal`})(mB||={}),(function(e){e._default=e.Terminal})(mB||={});var hB;(function(e){e[e.V0_1_0=1]=`V0_1_0`,e[e.V2_0_0=2]=`V2_0_0`})(hB||={});var gB;(function(e){e.SingleRun=`singleRun`,e.Background=`background`})(gB||={});var _B;(function(e){e.Changed=`changed`,e.ProcessStarted=`processStarted`,e.ProcessEnded=`processEnded`,e.Terminated=`terminated`,e.Start=`start`,e.AcquiredInput=`acquiredInput`,e.DependsOnStarted=`dependsOnStarted`,e.Active=`active`,e.Inactive=`inactive`,e.End=`end`,e.ProblemMatcherStarted=`problemMatcherStarted`,e.ProblemMatcherEnded=`problemMatcherEnded`,e.ProblemMatcherFoundErrors=`problemMatcherFoundErrors`})(_B||={});var vB;(function(e){e[e.System=0]=`System`,e[e.User=1]=`User`,e[e.FolderOpen=2]=`FolderOpen`,e[e.ConfigurationChange=3]=`ConfigurationChange`,e[e.Reconnect=4]=`Reconnect`,e[e.ChatAgent=5]=`ChatAgent`})(vB||={});var yB;(function(e){function t(e){return{taskId:e._id,taskName:e.configurationProperties.name,runType:e.configurationProperties.isBackground?gB.Background:gB.SingleRun,group:e.configurationProperties.group,__task:e}}function n(e,n,r){return{...t(e),kind:_B.Start,terminalId:n,resolvedVariables:r}}e.start=n;function r(e,n,r){return{...t(e),kind:_B.ProcessStarted,terminalId:n,processId:r}}e.processStarted=r;function i(e,n,r,i){return{...t(e),kind:_B.ProcessEnded,terminalId:n,exitCode:r,durationMs:i}}e.processEnded=i;function a(e,n,r){return{...t(e),kind:_B.Inactive,terminalId:n,durationMs:r}}e.inactive=a;function o(e,n,r){return{...t(e),kind:_B.Terminated,exitReason:r,terminalId:n}}e.terminated=o;function s(e,n,r){return{...t(n),kind:e,terminalId:r}}e.general=s;function c(e,n,r){return{...t(e),kind:_B.ProblemMatcherEnded,hasErrors:n}}e.problemMatcherEnded=c;function l(){return{kind:_B.Changed}}e.changed=l})(yB||={});var bB;(function(e){function t(e){let n=Object.keys(e).sort(),r=``;for(let i of n){let n=e[i];n instanceof Object?n=t(n):typeof n==`string`&&(n=n.replace(/,/g,`,,`)),r+=i+`,`+n+`,`}return r}function n(e){let n={_key:t(e),type:e.taskType};return Object.assign(n,e),n}e.create=n})(bB||={});var xB;(function(e){e.AutoDetect=`task.autoDetect`,e.SaveBeforeRun=`task.saveBeforeRun`,e.ShowDecorations=`task.showDecorations`,e.ProblemMatchersNeverPrompt=`task.problemMatchers.neverPrompt`,e.SlowProviderWarning=`task.slowProviderWarning`,e.QuickOpenHistory=`task.quickOpen.history`,e.QuickOpenDetail=`task.quickOpen.detail`,e.QuickOpenSkip=`task.quickOpen.skip`,e.QuickOpenShowAll=`task.quickOpen.showAll`,e.AllowAutomaticTasks=`task.allowAutomaticTasks`,e.Reconnection=`task.reconnection`,e.VerboseLogging=`task.verboseLogging`,e.NotifyWindowOnTaskCompletion=`task.notifyWindowOnTaskCompletion`})(xB||={});var SB;(function(e){e.Tasks=`tasks`,e.SuppressTaskName=`tasks.suppressTaskName`,e.Windows=`tasks.windows`,e.Osx=`tasks.osx`,e.Linux=`tasks.linux`,e.ShowOutput=`tasks.showOutput`,e.IsShellCommand=`tasks.isShellCommand`,e.ServiceTestSetting=`tasks.service.testSetting`})(SB||={});var CB;(function(e){function t(e,t){let n=Vz.get(e.type);if(n===void 0){let t=sc(e);return delete t._key,bB.create(t)}let r=Object.create(null);r.type=n.taskType;let i=new Set;n.required.forEach(e=>i.add(e));let a=n.properties;for(let n of Object.keys(a)){let o=e[n];if(o!=null)r[n]=o;else if(i.has(n)){let i=a[n];if(i.default!==void 0)r[n]=sc(i.default);else switch(i.type){case`boolean`:r[n]=!1;break;case`number`:case`integer`:r[n]=0;break;case`string`:r[n]=``;break;default:t.error(b(14094,`Error: the task identifier '{0}' is missing the required property '{1}'. The task identifier will be ignored.`,JSON.stringify(e,void 0,0),n));return}}}return bB.create(r)}e.createTaskIdentifier=t})(CB||={});var wB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(wB||={});var TB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(TB||={});var EB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(EB||={});var DB;(function(e){function t(e){if(e){let t=e;return t&&!!t.process}else return!1}e.is=t;function n(e){if(e==null)return;let t={process:e.process,args:e.args};return e.options&&(t.options=EB.from(e.options)),t}e.from=n;function r(e){if(e!=null)return new fD(e.process,e.args,e.options)}e.to=r})(DB||={});var OB;(function(e){function t(e){if(e!=null)return e}e.from=t;function n(e){if(e!=null)return e}e.to=n})(OB||={});var kB;(function(e){function t(e){if(e){let t=e;return t&&(!!t.commandLine||!!t.command)}else return!1}e.is=t;function n(e){if(e==null)return;let t={};return e.commandLine===void 0?(t.command=e.command,t.args=e.args):t.commandLine=e.commandLine,e.options&&(t.options=OB.from(e.options)),t}e.from=n;function r(e){if(!(e==null||e.command===void 0&&e.commandLine===void 0))return e.commandLine?new pD(e.commandLine,e.options):new pD(e.command,e.args?e.args:[],e.options)}e.to=r})(kB||={});var AB;(function(e){function t(e){if(e){let t=e;return t&&t.customExecution===`customExecution`}else return!1}e.is=t;function n(e){return{customExecution:`customExecution`}}e.from=n;function r(e,t){return t.get(e)}e.to=r})(AB||={});var jB;(function(e){function t(e,t){let n;return e.scope!==void 0&&typeof e.scope!=`number`?n=e.scope.uri:e.scope!==void 0&&typeof e.scope==`number`&&(n=e.scope===hD.Workspace&&t&&t.workspaceFile?t.workspaceFile:`settings`),{id:e._id,workspaceFolder:n}}e.from=t})(jB||={});var MB;(function(e){function t(e){if(e!=null)return{_id:e.id,isDefault:e.isDefault}}e.from=t})(MB||={});var NB;(function(e){function t(e,t){if(e==null)return[];let r=[];for(let i of e){let e=n(i,t);e&&r.push(e)}return r}e.fromMany=t;function n(e,t){if(e==null)return;let n;e.execution instanceof fD?n=DB.from(e.execution):e.execution instanceof pD?n=kB.from(e.execution):e.execution&&e.execution instanceof _D&&(n=AB.from(e.execution));let r=wB.from(e.definition),i;if(i=e.scope?typeof e.scope==`number`?e.scope:e.scope.uri:hD.Workspace,!(!r||!i))return{_id:e._id,definition:r,name:e.name,source:{extensionId:t.identifier.value,label:e.source,scope:i},execution:n,isBackground:e.isBackground,group:MB.from(e.group),presentationOptions:TB.from(e.presentationOptions),problemMatchers:ke(e.problemMatchers),hasDefinedMatchers:e.hasDefinedMatchers,runOptions:e.runOptions?e.runOptions:{reevaluateOnRerun:!0},detail:e.detail}}e.from=n;async function r(e,t,n){if(e==null)return;let r;DB.is(e.execution)?r=DB.to(e.execution):kB.is(e.execution)?r=kB.to(e.execution):AB.is(e.execution)&&(r=AB.to(e._id,n));let i=wB.to(e.definition),a;if(e.source&&(a=e.source.scope===void 0?hD.Workspace:typeof e.source.scope==`number`?e.source.scope:await t.resolveWorkspaceFolder(C.revive(e.source.scope))),!i||!a)return;let o=new vD(i,a,e.name,e.source.label,r,e.problemMatchers);return e.isBackground!==void 0&&(o.isBackground=e.isBackground),e.group!==void 0&&(o.group=uD.from(e.group._id),o.group&&e.group.isDefault&&(o.group=new uD(o.group.id,o.group.label),e.group.isDefault===!0&&(o.group.isDefault=e.group.isDefault))),e.presentationOptions&&(o.presentationOptions=TB.to(e.presentationOptions)),e.runOptions&&(o.runOptions=e.runOptions),e._id&&(o._id=e._id),e.detail&&(o.detail=e.detail),o}e.to=r})(NB||={});var PB;(function(e){function t(e){return e}e.from=t;function n(e){if(e)return Object.assign(Object.create(null),e)}e.to=n})(PB||={});var FB=class{#e;constructor(e,t,n){this._id=t,this._task=n,this.#e=e}get task(){return this._task}terminate(){this.#e.terminateTask(this)}fireDidStartProcess(e){}fireDidEndProcess(e){}get terminal(){return this._terminal}set terminal(e){this._terminal=e}};let IB=class{constructor(e,t,n,r,i,a,o,s){this._onDidExecuteTask=new x,this._onDidTerminateTask=new x,this._onDidTaskProcessStarted=new x,this._onDidTaskProcessEnded=new x,this._onDidStartTaskProblemMatchers=new x,this._onDidEndTaskProblemMatchers=new x,this._proxy=e.getProxy(T.MainThreadTask),this._workspaceProvider=n,this._editorService=r,this._configurationService=i,this._terminalService=a,this._handleCounter=0,this._handlers=new Map,this._taskExecutions=new Map,this._taskExecutionPromises=new Map,this._providedCustomExecutions2=new Map,this._notProvidedCustomExecutions=new Set,this._activeCustomExecutions2=new Map,this._logService=o,this._deprecationService=s,this._proxy.$registerSupportedExecutions(!0)}registerTaskProvider(e,t,n){if(!n)return new YT(()=>{});let r=this.nextHandle();return this._handlers.set(r,{type:t,provider:n,extension:e}),this._proxy.$registerTaskProvider(r,t),new YT(()=>{this._handlers.delete(r),this._proxy.$unregisterTaskProvider(r)})}registerTaskSystem(e,t){this._proxy.$registerTaskSystem(e,t)}fetchTasks(e){return this._proxy.$fetchTasks(PB.from(e)).then(async e=>{let t=[];for(let n of e){let e=await NB.to(n,this._workspaceProvider,this._providedCustomExecutions2);e&&t.push(e)}return t})}get taskExecutions(){let e=[];return this._taskExecutions.forEach(t=>e.push(t)),e}terminateTask(e){if(!(e instanceof FB))throw Error(`No valid task execution provided`);return this._proxy.$terminateTask(e._id)}get onDidStartTask(){return this._onDidExecuteTask.event}async $onDidStartTask(e,t,n){let r=this._providedCustomExecutions2.get(e.id);r&&(this._activeCustomExecutions2.set(e.id,r),this._terminalService.attachPtyToTerminal(t,await r.callback(n))),this._lastStartedTask=e.id;let i=await this.getTaskExecution(e),a=this._terminalService.getTerminalById(t)?.value;i&&(i.terminal=a),this._onDidExecuteTask.fire({execution:i})}get onDidEndTask(){return this._onDidTerminateTask.event}async $OnDidEndTask(e){if(!this._taskExecutionPromises.has(e.id))return;let t=await this.getTaskExecution(e);this._taskExecutionPromises.delete(e.id),this._taskExecutions.delete(e.id),this.customExecutionComplete(e),this._onDidTerminateTask.fire({execution:t})}get onDidStartTaskProcess(){return this._onDidTaskProcessStarted.event}async $onDidStartTaskProcess(e){let t=await this.getTaskExecution(e.id);this._onDidTaskProcessStarted.fire({execution:t,processId:e.processId})}get onDidEndTaskProcess(){return this._onDidTaskProcessEnded.event}async $onDidEndTaskProcess(e){let t=await this.getTaskExecution(e.id);this._onDidTaskProcessEnded.fire({execution:t,exitCode:e.exitCode})}get onDidStartTaskProblemMatchers(){return this._onDidStartTaskProblemMatchers.event}async $onDidStartTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidStartTaskProblemMatchers.fire({execution:t})}get onDidEndTaskProblemMatchers(){return this._onDidEndTaskProblemMatchers.event}async $onDidEndTaskProblemMatchers(e){let t;try{t=await this.getTaskExecution(e.execution.id)}catch{return}this._onDidEndTaskProblemMatchers.fire({execution:t,hasErrors:e.hasErrors})}$provideTasks(e,t){let n=this._handlers.get(e);if(!n)return Promise.reject(Error(`no handler found`));let r=[],i=So(()=>n.provider.provideTasks(Bi.None)).then(e=>this.provideTasksInternal(t,r,n,e));return new Promise(e=>{i.then(t=>{Promise.all(r).then(()=>{e(t)})})})}async $resolveTask(e,t){let n=this._handlers.get(e);if(!n)return Promise.reject(Error(`no handler found`));if(t.definition.type!==n.type)throw Error(`Unexpected: Task of type [${t.definition.type}] cannot be resolved by provider of type [${n.type}].`);let r=await NB.to(t,this._workspaceProvider,this._providedCustomExecutions2);if(!r)throw Error(`Unexpected: Task cannot be resolved.`);let i=await n.provider.resolveTask(r,Bi.None);if(!i)return;this.checkDeprecation(i,n);let a=NB.from(i,n.extension);if(!a)throw Error(`Unexpected: Task cannot be resolved.`);if(i.definition!==r.definition)throw Error(`Unexpected: The resolved task definition must be the same object as the original task definition. The task definition cannot be changed.`);return AB.is(a.execution)&&await this.addCustomExecution(a,i,!0),await this.resolveTaskInternal(a)}nextHandle(){return this._handleCounter++}async addCustomExecution(e,t,n){let r=await this._proxy.$createTaskId(e);!n&&!this._providedCustomExecutions2.has(r)&&(this._notProvidedCustomExecutions.add(r),this._activeCustomExecutions2.set(r,t.execution)),this._providedCustomExecutions2.set(r,t.execution)}async getTaskExecution(e,t){if(typeof e==`string`){let t=this._taskExecutionPromises.get(e);if(!t)throw new pe(`Unexpected: The specified task is missing an execution`);return t}let n=this._taskExecutionPromises.get(e.id);if(n)return n;let r;return r=t?Promise.resolve(new FB(this,e.id,t)):NB.to(e.task,this._workspaceProvider,this._providedCustomExecutions2).then(t=>{if(!t)throw new pe(`Unexpected: Task does not exist.`);return new FB(this,e.id,t)}),this._taskExecutionPromises.set(e.id,r),r.then(t=>(this._taskExecutions.set(e.id,t),t))}checkDeprecation(e,t){e._deprecated&&this._deprecationService.report(`Task.constructor`,t.extension,"Use the Task constructor that takes a `scope` instead.")}customExecutionComplete(e){this._activeCustomExecutions2.get(e.id)&&this._activeCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.has(e.id)&&this._lastStartedTask!==e.id&&(this._providedCustomExecutions2.delete(e.id),this._notProvidedCustomExecutions.delete(e.id));let t=this._notProvidedCustomExecutions.values(),n=t.next();for(;!n.done;)!this._activeCustomExecutions2.has(n.value)&&this._lastStartedTask!==n.value&&(this._providedCustomExecutions2.delete(n.value),this._notProvidedCustomExecutions.delete(n.value)),n=t.next()}};IB=k([A(0,Js),A(1,Vs),A(2,eF),A(3,Lz),A(4,yF),A(5,qI),A(6,Ns),A(7,tz)],IB);let LB=class extends IB{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o,s),this.registerTaskSystem(D.vscodeRemote,{scheme:D.vscodeRemote,authority:``,platform:wn(Cn.Web)})}async executeTask(e,t){if(!t.execution)throw Error(`Tasks to execute must include an execution`);let n=NB.from(t,e);if(n===void 0)throw Error(`Task is not valid`);if(AB.is(n.execution))await this.addCustomExecution(n,t,!1);else throw new fe;let r=await this.getTaskExecution(await this._proxy.$getTaskExecution(n),t);return this._proxy.$executeTask(n).catch(e=>{throw Error(e)}),r}provideTasksInternal(e,t,n,r){let i=[];if(r)for(let a of r){if(this.checkDeprecation(a,n),!a.definition||!e[a.definition.type]){let e=a.source?a.source:`No task source`;this._logService.warn(`The task [${e}, ${a.name}] uses an undefined task type. The task will be ignored in the future.`)}let r=NB.from(a,n.extension);r&&AB.is(r.execution)?(i.push(r),t.push(this.addCustomExecution(r,a,!0))):this._logService.warn(`Only custom execution tasks supported.`)}return{tasks:i,extension:n.extension}}async resolveTaskInternal(e){if(AB.is(e.execution))return e;this._logService.warn(`Only custom execution tasks supported.`)}async $resolveVariables(e,t){return{process:void 0,variables:Object.create(null)}}async $jsonTasksSupported(){return!1}async $findExecutable(e,t,n){}};LB=k([A(0,Js),A(1,Vs),A(2,eF),A(3,Lz),A(4,yF),A(5,qI),A(6,Ns),A(7,tz)],LB);const RB=O(`IExtHostTask`);var zB=class{constructor(){this.pendingRequests=new Map,this.pendingRequestTimers=new Map,this.queue=[],this._onError=new x,this._onExit=new x,this.sequence=1}get onError(){return this._onError.event}get onExit(){return this._onExit.event}onMessage(e){this.messageCallback&&this._onError.fire(Error(`attempt to set more than one 'Message' callback`)),this.messageCallback=e}onEvent(e){this.eventCallback&&this._onError.fire(Error(`attempt to set more than one 'Event' callback`)),this.eventCallback=e}onRequest(e){this.requestCallback&&this._onError.fire(Error(`attempt to set more than one 'Request' callback`)),this.requestCallback=e}sendResponse(e){e.seq>0?this._onError.fire(Error(`attempt to send more than one response for command ${e.command}`)):this.internalSend(`response`,e)}sendRequest(e,t,n,r){let i={command:e};if(t&&Object.keys(t).length>0&&(i.arguments=t),this.internalSend(`request`,i),typeof r==`number`){let t=setTimeout(()=>{this.pendingRequestTimers.delete(i.seq);let t=this.pendingRequests.get(i.seq);t&&(this.pendingRequests.delete(i.seq),t({type:`response`,seq:0,request_seq:i.seq,success:!1,command:e,message:b(9373,`Timeout after {0} ms for '{1}'`,r,e)}))},r);this.pendingRequestTimers.set(i.seq,t)}return n&&this.pendingRequests.set(i.seq,n),i.seq}acceptMessage(e){this.messageCallback?this.messageCallback(e):(this.queue.push(e),this.queue.length===1&&this.processQueue())}needsTaskBoundaryBetween(e,t){return e.type!==`event`||t.type!==`event`}async processQueue(){let e;for(;this.queue.length;){if((!e||this.needsTaskBoundaryBetween(this.queue[0],e))&&await Mo(0),e=this.queue.shift(),!e)return;switch(e.type){case`event`:this.eventCallback?.(e);break;case`request`:this.requestCallback?.(e);break;case`response`:{let t=e,n=this.pendingRequests.get(t.request_seq);n&&(this.pendingRequests.delete(t.request_seq),this.clearPendingRequestTimer(t.request_seq),n(t));break}}}}internalSend(e,t){t.type=e,t.seq=this.sequence++,this.sendMessage(t)}async cancelPendingRequests(){if(this.pendingRequests.size===0)return Promise.resolve();let e=new Map;this.pendingRequests.forEach((t,n)=>e.set(n,t)),await Mo(500),e.forEach((e,t)=>{e({type:`response`,seq:0,request_seq:t,success:!1,command:`canceled`,message:`canceled`}),this.pendingRequests.delete(t),this.clearPendingRequestTimer(t)})}clearPendingRequestTimer(e){clearTimeout(this.pendingRequestTimers.get(e)),this.pendingRequestTimers.delete(e)}getPendingRequestIds(){return Array.from(this.pendingRequests.keys())}dispose(){for(let e of this.pendingRequestTimers.values())clearTimeout(e);this.pendingRequestTimers.clear(),this._onError.dispose(),this._onExit.dispose(),this.queue=[]}};function BB(e){return e.type&&(e.label||e.program||e.runtime)}const VB=/^[a-zA-Z][a-zA-Z0-9\+\-\.]+:/;function HB(e){return!!(e&&e.match(VB))}function UB(e){if(typeof e.path==`string`&&!(typeof e.sourceReference==`number`&&e.sourceReference>0)){if(HB(e.path))return C.parse(e.path);if(qr(e.path))return C.file(e.path)}return e.path}function WB(e){if(typeof e.path==`object`){let t=C.revive(e.path);if(t)return t.scheme===D.file?t.fsPath:t.toString()}return e.path}function GB(e,t){let n=t?UB:WB,r=sc(e);return qB(r,(e,t)=>{e&&t&&(t.path=n(t))}),r}function KB(e,t){let n=t?UB:WB,r=sc(e);return qB(r,(e,t)=>{!e&&t&&(t.path=n(t))}),r}function qB(e,t){switch(e.type){case`event`:{let n=e;switch(n.event){case`output`:t(!1,n.body.source);break;case`loadedSource`:t(!1,n.body.source);break;case`breakpoint`:t(!1,n.body.breakpoint.source);break}break}case`request`:{let n=e;switch(n.command){case`setBreakpoints`:t(!0,n.arguments.source);break;case`breakpointLocations`:t(!0,n.arguments.source);break;case`source`:t(!0,n.arguments.source);break;case`gotoTargets`:t(!0,n.arguments.source);break;case`launchVSCode`:n.arguments.args.forEach(e=>t(!1,e));break}break}case`response`:{let n=e;if(n.success&&n.body)switch(n.command){case`stackTrace`:n.body.stackFrames.forEach(e=>t(!1,e.source));break;case`loadedSources`:n.body.sources.forEach(e=>t(!1,e));break;case`scopes`:n.body.scopes.forEach(e=>t(!1,e.source));break;case`setFunctionBreakpoints`:n.body.breakpoints.forEach(e=>t(!1,e.source));break;case`setBreakpoints`:n.body.breakpoints.forEach(e=>t(!1,e.source));break;case`disassemble`:n.body?.instructions.forEach(e=>t(!1,e.location));break;case`locations`:t(!1,n.body?.source);break}break}}}const JB=O(`IExtHostEditorTabs`);var YB=class{constructor(e,t,n){this._activeTabIdGetter=n,this._parentGroup=t,this.acceptDtoUpdate(e)}get apiObject(){if(!this._apiObject){let e=this,t={get isActive(){return e._dto.id===e._activeTabIdGetter()},get label(){return e._dto.label},get input(){return e._input},get isDirty(){return e._dto.isDirty},get isPinned(){return e._dto.isPinned},get isPreview(){return e._dto.isPreview},get group(){return e._parentGroup.apiObject}};this._apiObject=Object.freeze(t)}return this._apiObject}get tabId(){return this._dto.id}acceptDtoUpdate(e){this._dto=e,this._input=this._initInput()}_initInput(){switch(this._dto.input.kind){case Ti.TextInput:return new uk(C.revive(this._dto.input.uri));case Ti.TextDiffInput:return new dk(C.revive(this._dto.input.original),C.revive(this._dto.input.modified));case Ti.TextMergeInput:return new fk(C.revive(this._dto.input.base),C.revive(this._dto.input.input1),C.revive(this._dto.input.input2),C.revive(this._dto.input.result));case Ti.CustomEditorInput:return new pk(C.revive(this._dto.input.uri),this._dto.input.viewType);case Ti.WebviewEditorInput:return new mk(this._dto.input.viewType);case Ti.NotebookInput:return new hk(C.revive(this._dto.input.uri),this._dto.input.notebookType);case Ti.NotebookDiffInput:return new gk(C.revive(this._dto.input.original),C.revive(this._dto.input.modified),this._dto.input.notebookType);case Ti.TerminalEditorInput:return new _k;case Ti.InteractiveEditorInput:return new vk(C.revive(this._dto.input.uri),C.revive(this._dto.input.inputBoxUri));case Ti.ChatEditorInput:return new yk;case Ti.MultiDiffEditorInput:return new bk(this._dto.input.diffEditors.map(e=>new dk(C.revive(e.original),C.revive(e.modified))));default:return}}},XB=class{constructor(e,t){this._tabs=[],this._activeTabId=``,this._dto=e,this._activeGroupIdGetter=t;for(let t of e.tabs)t.isActive&&(this._activeTabId=t.id),this._tabs.push(new YB(t,this,()=>this.activeTabId()))}get apiObject(){if(!this._apiObject){let e=this,t={get isActive(){return e._dto.groupId===e._activeGroupIdGetter()},get viewColumn(){return vj.to(e._dto.viewColumn)},get activeTab(){return e._tabs.find(t=>t.tabId===e._activeTabId)?.apiObject},get tabs(){return Object.freeze(e._tabs.map(e=>e.apiObject))}};this._apiObject=Object.freeze(t)}return this._apiObject}get groupId(){return this._dto.groupId}get tabs(){return this._tabs}acceptGroupDtoUpdate(e){this._dto=e}acceptTabOperation(e){if(e.kind===Ei.TAB_OPEN){let t=new YB(e.tabDto,this,()=>this.activeTabId());return this._tabs.splice(e.index,0,t),e.tabDto.isActive&&(this._activeTabId=t.tabId),t}else if(e.kind===Ei.TAB_CLOSE){let t=this._tabs.splice(e.index,1)[0];if(!t)throw Error(`Tab close updated received for index ${e.index} which does not exist`);return t.tabId===this._activeTabId&&(this._activeTabId=``),t}else if(e.kind===Ei.TAB_MOVE){if(e.oldIndex===void 0)throw Error(`Invalid old index on move IPC`);let t=this._tabs.splice(e.oldIndex,1)[0];if(!t)throw Error(`Tab move updated received for index ${e.oldIndex} which does not exist`);return this._tabs.splice(e.index,0,t),t}let t=this._tabs.find(t=>t.tabId===e.tabDto.id);if(!t)throw Error(`INVALID tab`);return e.tabDto.isActive?this._activeTabId=e.tabDto.id:this._activeTabId===e.tabDto.id&&!e.tabDto.isActive&&(this._activeTabId=``),t.acceptDtoUpdate(e.tabDto),t}activeTabId(){return this._activeTabId}};let ZB=class{constructor(e){this._onDidChangeTabs=new x,this._onDidChangeTabGroups=new x,this._extHostTabGroups=[],this._proxy=e.getProxy(T.MainThreadEditorTabs)}get tabGroups(){if(!this._apiObject){let e=this,t={onDidChangeTabGroups:e._onDidChangeTabGroups.event,onDidChangeTabs:e._onDidChangeTabs.event,get all(){return Object.freeze(e._extHostTabGroups.map(e=>e.apiObject))},get activeTabGroup(){let t=e._activeGroupId;return dt(e._extHostTabGroups.find(e=>e.groupId===t)?.apiObject)},close:async(e,t)=>{let n=Array.isArray(e)?e:[e];return n.length?QB(n[0])?this._closeGroups(n,t):this._closeTabs(n,t):!0}};this._apiObject=Object.freeze(t)}return this._apiObject}$acceptEditorTabModel(e){let t=Fe(new Set(this._extHostTabGroups.map(e=>e.groupId)),new Set(e.map(e=>e.groupId))),n=this._extHostTabGroups.filter(e=>t.removed.includes(e.groupId)).map(e=>e.apiObject),r=[],i=[];this._extHostTabGroups=e.map(e=>{let n=new XB(e,()=>this._activeGroupId);return t.added.includes(n.groupId)?r.push(n.apiObject):i.push(n.apiObject),n});let a=dt(e.find(e=>e.isActive===!0)?.groupId);a!==void 0&&this._activeGroupId!==a&&(this._activeGroupId=a),this._onDidChangeTabGroups.fire(Object.freeze({opened:r,closed:n,changed:i}))}$acceptTabGroupUpdate(e){let t=this._extHostTabGroups.find(t=>t.groupId===e.groupId);if(!t)throw Error(`Update Group IPC call received before group creation.`);t.acceptGroupDtoUpdate(e),e.isActive&&(this._activeGroupId=e.groupId),this._onDidChangeTabGroups.fire(Object.freeze({changed:[t.apiObject],opened:[],closed:[]}))}$acceptTabOperation(e){let t=this._extHostTabGroups.find(t=>t.groupId===e.groupId);if(!t)throw Error(`Update Tabs IPC call received before group creation.`);let n=t.acceptTabOperation(e);switch(e.kind){case Ei.TAB_OPEN:this._onDidChangeTabs.fire(Object.freeze({opened:[n.apiObject],closed:[],changed:[]}));return;case Ei.TAB_CLOSE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[n.apiObject],changed:[]}));return;case Ei.TAB_MOVE:case Ei.TAB_UPDATE:this._onDidChangeTabs.fire(Object.freeze({opened:[],closed:[],changed:[n.apiObject]}));return}}_findExtHostTabFromApi(e){for(let t of this._extHostTabGroups)for(let n of t.tabs)if(n.apiObject===e)return n}_findExtHostTabGroupFromApi(e){return this._extHostTabGroups.find(t=>t.apiObject===e)}async _closeTabs(e,t){let n=[];for(let t of e){let e=this._findExtHostTabFromApi(t);if(!e)throw Error(`Tab close: Invalid tab not found!`);n.push(e.tabId)}return this._proxy.$closeTab(n,t)}async _closeGroups(e,t){let n=[];for(let t of e){let e=this._findExtHostTabGroupFromApi(t);if(!e)throw Error(`Group close: Invalid group not found!`);n.push(e.groupId)}return this._proxy.$closeGroup(n,t)}};ZB=k([A(0,Js)],ZB);function QB(e){return e.tabs!==void 0}var $B;(function(e){e.ViewletId=`workbench.view.extension.test`,e.ExplorerViewId=`workbench.view.testing`,e.OutputPeekContributionId=`editor.contrib.testingOutputPeek`,e.DecorationsContributionId=`editor.contrib.testingDecorations`,e.CoverageDecorationsContributionId=`editor.contrib.coverageDecorations`,e.CoverageViewId=`workbench.view.testCoverage`,e.ResultsPanelId=`workbench.panel.testResults`,e.ResultsViewId=`workbench.panel.testResults.view`,e.MessageLanguageId=`vscodeInternalTestMessage`})($B||={});var eV;(function(e){e.List=`list`,e.Tree=`true`})(eV||={});var tV;(function(e){e.ByLocation=`location`,e.ByStatus=`status`,e.ByDuration=`duration`})(tV||={}),NC.Errored,b(15472,`Errored`),NC.Failed,b(15473,`Failed`),NC.Passed,b(15474,`Passed`),NC.Queued,b(15475,`Queued`),NC.Running,b(15476,`Running`),NC.Skipped,b(15477,`Skipped`),NC.Unset,b(15478,`Not yet run`),IC.Debug,b(15480,`Debug`),IC.Run,b(15481,`Run`),IC.Coverage,b(15482,`Coverage`);var nV;(function(e){e.CancelTestRefreshAction=`testing.cancelTestRefresh`,e.CancelTestRunAction=`testing.cancelRun`,e.ClearTestResultsAction=`testing.clearTestResults`,e.CollapseAllAction=`testing.collapseAll`,e.ConfigureTestProfilesAction=`testing.configureProfile`,e.ContinousRunUsingForTest=`testing.continuousRunUsingForTest`,e.CoverageAtCursor=`testing.coverageAtCursor`,e.CoverageByUri=`testing.coverage.uri`,e.CoverageClear=`testing.coverage.close`,e.CoverageCurrentFile=`testing.coverageCurrentFile`,e.CoverageFilterToTest=`testing.coverageFilterToTest`,e.CoverageFilterToTestInEditor=`testing.coverageFilterToTestInEditor`,e.CoverageGoToNextMissedLine=`testing.coverage.goToNextMissedLine`,e.CoverageGoToPreviousMissedLine=`testing.coverage.goToPreviousMissedLine`,e.CoverageLastRun=`testing.coverageLastRun`,e.CoverageSelectedAction=`testing.coverageSelected`,e.CoverageToggleInExplorer=`testing.toggleCoverageInExplorer`,e.CoverageToggleToolbar=`testing.coverageToggleToolbar`,e.CoverageViewChangeSorting=`testing.coverageViewChangeSorting`,e.CoverageViewCollapseAll=`testing.coverageViewCollapseAll`,e.DebugAction=`testing.debug`,e.DebugAllAction=`testing.debugAll`,e.DebugAtCursor=`testing.debugAtCursor`,e.DebugByUri=`testing.debug.uri`,e.DebugCurrentFile=`testing.debugCurrentFile`,e.DebugFailedTests=`testing.debugFailTests`,e.DebugFailedFromLastRun=`testing.debugFailedFromLastRun`,e.DebugLastRun=`testing.debugLastRun`,e.DebugSelectedAction=`testing.debugSelected`,e.FilterAction=`workbench.actions.treeView.testExplorer.filter`,e.GetExplorerSelection=`_testing.getExplorerSelection`,e.GetSelectedProfiles=`testing.getSelectedProfiles`,e.GoToTest=`testing.editFocusedTest`,e.GoToRelatedTest=`testing.goToRelatedTest`,e.PeekRelatedTest=`testing.peekRelatedTest`,e.GoToRelatedCode=`testing.goToRelatedCode`,e.PeekRelatedCode=`testing.peekRelatedCode`,e.HideTestAction=`testing.hideTest`,e.OpenCoverage=`testing.openCoverage`,e.OpenOutputPeek=`testing.openOutputPeek`,e.RefreshTestsAction=`testing.refreshTests`,e.ReRunFailedTests=`testing.reRunFailTests`,e.ReRunFailedFromLastRun=`testing.reRunFailedFromLastRun`,e.ReRunLastRun=`testing.reRunLastRun`,e.RunAction=`testing.run`,e.RunAllAction=`testing.runAll`,e.RunAllWithCoverageAction=`testing.coverageAll`,e.RunAtCursor=`testing.runAtCursor`,e.RunByUri=`testing.run.uri`,e.RunCurrentFile=`testing.runCurrentFile`,e.RunSelectedAction=`testing.runSelected`,e.RunUsingProfileAction=`testing.runUsing`,e.RunWithCoverageAction=`testing.coverage`,e.SearchForTestExtension=`testing.searchForTestExtension`,e.SelectDefaultTestProfiles=`testing.selectDefaultTestProfiles`,e.ShowMostRecentOutputAction=`testing.showMostRecentOutput`,e.StartContinousRun=`testing.startContinuousRun`,e.StartContinousRunFromExtension=`testing.startContinuousRunFromExtension`,e.StopContinousRunFromExtension=`testing.stopContinuousRunFromExtension`,e.StopContinousRun=`testing.stopContinuousRun`,e.TestingSortByDurationAction=`testing.sortByDuration`,e.TestingSortByLocationAction=`testing.sortByLocation`,e.TestingSortByStatusAction=`testing.sortByStatus`,e.TestingViewAsListAction=`testing.viewAsList`,e.TestingViewAsTreeAction=`testing.viewAsTree`,e.ToggleContinousRunForTest=`testing.toggleContinuousRunForTest`,e.ToggleResultsViewLayoutAction=`testing.toggleResultsViewLayout`,e.ToggleInlineTestOutput=`testing.toggleInlineTestOutput`,e.UnhideAllTestsAction=`testing.unhideAllTests`,e.UnhideTestAction=`testing.unhideTest`})(nV||={});let rV=0;const iV=new WeakMap,aV=O(`IExtHostTesting`);let oV=class extends v{constructor(e,t,n,r){super(),this.logService=t,this.commands=n,this.editors=r,this.resultsChangedEmitter=this._register(new x),this.controllers=new Map,this.defaultProfilesChangedEmitter=this._register(new x),this.followupProviders=new Set,this.testFollowups=new Map,this.onResultsChanged=this.resultsChangedEmitter.event,this.results=[],this.proxy=e.getProxy(T.MainThreadTesting),this.observer=new mV(this.proxy),this.runTracker=new lV(this.proxy,t),n.registerArgumentProcessor({processArgument:e=>{switch(e?.$mid){case Mr.TestItemContext:{let t=e,n=t.tests[t.tests.length-1].item.extId;return this.controllers.get(MC.root(n))?.collection.tree.get(n)?.actual??PI(e)}case Mr.TestMessageMenuArgs:{let{test:t,message:n}=e,r=t.item.extId;return{test:this.controllers.get(MC.root(r))?.collection.tree.get(r)?.actual??PI({tests:[t]}),message:DM.to(n)}}default:return e}}}),n.registerCommand(!1,`testing.getExplorerSelection`,async()=>{let e=await n.executeCommand(nV.GetExplorerSelection),t=e=>{let t=this.controllers.get(MC.root(e));if(t)return MC.isRoot(e)?t.controller:t.collection.tree.get(e)?.actual};return{include:e?.include.map(t).filter(ct)||[],exclude:e?.exclude.map(t).filter(ct)||[]}})}createTestController(e,t,n,r){if(this.controllers.has(t))throw Error(`Attempt to insert a duplicate controller with ID "${t}"`);let i=new _,a=i.add(new LI(t,n,this.editors));a.root.label=n;let o=new Map,s=new Set,c=this.proxy,l=()=>{let e=0;r&&(e|=FC.Refresh);let t=d.relatedCodeProvider;return t&&(t?.provideRelatedTests&&(e|=FC.TestRelatedToCode),t?.provideRelatedCode&&(e|=FC.CodeRelatedToTest)),e},u={items:a.root.children,get label(){return n},set label(e){n=e,a.root.label=e,c.$updateController(t,{label:n})},get refreshHandler(){return r},set refreshHandler(e){r=e,c.$updateController(t,{capabilities:l()})},get id(){return t},get relatedCodeProvider(){return d.relatedCodeProvider},set relatedCodeProvider(n){K(e,`testRelatedCode`),d.relatedCodeProvider=n,c.$updateController(t,{capabilities:l()})},createRunProfile:(e,n,r,i,a,c)=>{let l=jh(e);for(;o.has(l);)l++;return new gV(this.proxy,o,s,this.defaultProfilesChangedEmitter.event,t,l,e,n,r,i,a,c)},createTestItem(e,n,r){return new FI(t,e,n,r)},createTestRun:(n,r,i=!0)=>this.runTracker.createTestRun(e,t,a,n,r,i),invalidateTestResults:e=>{if(e===void 0)this.proxy.$markTestRetired(void 0);else{let n=e instanceof Array?e:[e];this.proxy.$markTestRetired(n.map(e=>MC.fromExtHostTestItem(e,t).toString()))}},set resolveHandler(e){a.resolveHandler=e},get resolveHandler(){return a.resolveHandler},dispose:()=>{i.dispose()}},d={controller:u,collection:a,profiles:o,extension:e,activeProfiles:s};return c.$registerTestController(t,n,l()),i.add(g(()=>c.$unregisterTestController(t))),this.controllers.set(t,d),i.add(g(()=>this.controllers.delete(t))),i.add(a.onDidGenerateDiff(e=>c.$publishDiff(t,e.map(lw.serialize)))),u}createTestObserver(){return this.observer.checkout()}async runTests(e,t=Bi.None){let n=uV(e);if(!n)throw Error("The request passed to `vscode.test.runTests` must include a profile");let r=this.controllers.get(n.controllerId);if(!r)throw Error(`Controller not found`);await this.proxy.$runTests({preserveFocus:e.preserveFocus??!0,group:AM.from(n.kind),targets:[{testIds:e.include?.map(e=>MC.fromExtHostTestItem(e,r.collection.root.id).toString())??[r.collection.root.id],profileId:n.profileId,controllerId:n.controllerId}],exclude:e.exclude?.map(e=>e.id)},t)}registerTestFollowupProvider(e){return this.followupProviders.add(e),{dispose:()=>{this.followupProviders.delete(e)}}}async $getTestsRelatedToCode(e,t,n){let r=this.editors.getDocument(C.revive(e));if(!r)return[];let i=fj.to(t),a=[];return await Promise.all([...this.controllers.values()].map(async e=>{let t;try{t=await e.relatedCodeProvider?.provideRelatedTests?.(r.document,i,n)}catch(t){n.isCancellationRequested||this.logService.warn(`Error thrown while providing related tests for ${e.controller.label}`,t)}if(t){for(let n of t)a.push(MC.fromExtHostTestItem(n,e.controller.id).toString());e.collection.flushDiff()}})),a}async $getCodeRelatedToTest(e,t){let n=this.controllers.get(MC.root(e));if(!n)return[];let r=n.collection.tree.get(e);return r?(await n.relatedCodeProvider?.provideRelatedCode?.(r.actual,t))?.map(Ij.from)??[]:[]}$syncTests(){for(let{collection:e}of this.controllers.values())e.flushDiff();return Promise.resolve()}async $getCoverageDetails(e,t,n){return(await this.runTracker.getCoverageDetails(e,t,n))?.map(NM.fromDetails)}async $disposeRun(e){this.runTracker.disposeTestRun(e)}$configureRunProfile(e,t){this.controllers.get(e)?.profiles.get(t)?.configureHandler?.()}$setDefaultRunProfiles(e){let t=new Map;for(let[n,r]of Object.entries(e)){let e=this.controllers.get(n);if(!e)continue;let i=new Map,a=r.filter(t=>!e.activeProfiles.has(t)),o=[...e.activeProfiles].filter(e=>!r.includes(e));for(let t of a)i.set(t,!0),e.activeProfiles.add(t);for(let t of o)i.set(t,!1),e.activeProfiles.delete(t);i.size&&t.set(n,i)}this.defaultProfilesChangedEmitter.fire(t)}async $refreshTests(e,t){await this.controllers.get(e)?.controller.refreshHandler?.(t)}$publishTestResults(e){this.results=Object.freeze(e.map(e=>{let t=MM.to(e),n=e.tasks.findIndex(e=>e.hasCoverage);return n!==-1&&(t.getDetailedCoverage=(t,r=Bi.None)=>this.proxy.$getCoverageDetails(e.id,n,t,r).then(e=>e.map(NM.to))),iV.set(t,e.id),t}).concat(this.results).sort((e,t)=>t.completedAt-e.completedAt).slice(0,32)),this.resultsChangedEmitter.fire()}async $expandTest(e,t){let n=this.controllers.get(MC.fromString(e).controllerId)?.collection;n&&(await n.expand(e,t<0?1/0:t),n.flushDiff())}$acceptDiff(e){this.observer.applyDiff(e.map(e=>lw.deserialize({asCanonicalUri:e=>e},e)))}async $runControllerTests(e,t){return Promise.all(e.map(e=>this.runControllerTestRequest(e,!1,t)))}async $startContinuousRun(e,t){let n=new Hi(t),r=await Promise.all(e.map(e=>this.runControllerTestRequest(e,!0,n.token)));return!t.isCancellationRequested&&!r.some(e=>e.error)&&await new Promise(e=>t.onCancellationRequested(e)),n.dispose(!0),r}async $provideTestFollowups(e,t){let n=this.results.find(t=>iV.get(t)===e.resultId),r=n&&_V(MC.fromString(e.extId),n?.results);if(!r)return[];let i=[];return await Promise.all([...this.followupProviders].map(async a=>{try{let o=await a.provideFollowup(n,r,e.taskIndex,e.messageIndex,t);o&&(i=i.concat(o))}catch(e){this.logService.error(`Error thrown while providing followup for test message`,e)}})),t.isCancellationRequested?[]:i.map(e=>{let t=rV++;return this.testFollowups.set(t,e),{title:e.title,id:t}})}$disposeTestFollowups(e){for(let t of e)this.testFollowups.delete(t)}$executeTestFollowup(e){let t=this.testFollowups.get(e);return t?this.commands.executeCommand(t.command,...t.arguments||[]):Promise.resolve()}$cancelExtensionTestRun(e,t){e===void 0?this.runTracker.cancelAllRuns():this.runTracker.cancelRunById(e,t)}getMetadataForRun(e){for(let t of this.runTracker.trackers){let n=t.getTaskIdForRun(e);if(n)return{taskId:n,runId:t.id}}}async runControllerTestRequest(e,t,n){let r=this.controllers.get(e.controllerId);if(!r)return{};let{collection:i,profiles:a,extension:o}=r,s=a.get(e.profileId);if(!s)return{};let c=e.testIds.map(e=>i.tree.get(e)).filter(ct),l=e.excludeExtIds.map(e=>r.collection.tree.get(e)).filter(ct).filter(e=>c.some(t=>t.fullId.compare(e.fullId)===jC.IsChild));if(!c.length)return{};let u=new XO(c.some(e=>e.actual instanceof II)?void 0:c.map(e=>e.actual),l.map(e=>e.actual),s,t),d=LC(e)&&this.runTracker.prepareForMainThreadTestRun(o,u,dV.fromInternal(e,r.collection),s,n);try{return await s.runHandler(u,n),{}}catch(e){return{error:String(e)}}finally{d&&d.hasRunningTasks&&!n.isCancellationRequested&&await ir.toPromise(d.onEnd)}}};oV=k([A(0,Js),A(1,Ns),A(2,UI),A(3,Lz)],oV);var sV;(function(e){e[e.Running=0]=`Running`,e[e.Cancelling=1]=`Cancelling`,e[e.Ended=2]=`Ended`})(sV||={});var cV=class extends v{get hasRunningTasks(){return this.running>0}get id(){return this.dto.id}constructor(e,t,n,r,i,a){super(),this.dto=e,this.proxy=t,this.logService=n,this.profile=r,this.extension=i,this.state=sV.Running,this.running=0,this.tasks=new Map,this.sharedTestIds=new Set,this.endEmitter=this._register(new x),this.publishedCoverage=new Map,this.onEnd=this.endEmitter.event,this.cts=this._register(new Hi(a));let o=this._register(new Ro(()=>this.forciblyEndTasks(),1e4));this._register(this.cts.token.onCancellationRequested(()=>o.schedule()));let s=new x;this.onDidDispose=s.event,this._register(g(()=>{s.fire(),s.dispose()}))}getTaskIdForRun(e){for(let[t,{run:n}]of this.tasks)if(n===e)return t}cancel(e){e?this.tasks.get(e)?.cts.cancel():this.state===sV.Running?(this.cts.cancel(),this.state=sV.Cancelling):this.state===sV.Cancelling&&this.forciblyEndTasks()}async getCoverageDetails(e,t,n){let[,r]=MC.fromString(e).path,i=this.publishedCoverage.get(e);if(!i)return[];let{report:a,extIds:o}=i,s=this.tasks.get(r);if(!s)throw Error(`unreachable: run task was not found`);let c;if(t&&a instanceof nk){let e=o.indexOf(t);if(e===-1)return[];c=a.includesTests[e]}return await(c?this.profile?.loadDetailedCoverageForTest?.(s.run,a,c,n):this.profile?.loadDetailedCoverage?.(s.run,a,n))??[]}createRun(e){let t=this.dto.id,n=this.dto.controllerId,r=Gc(),i=e=>(t,...n)=>{if(o){this.logService.warn(`Setting the state of test "${t.id}" is a no-op after the run ends.`);return}this.ensureTestIsKnown(t),e(t,...n)},a=(e,i)=>{let a=i instanceof Array?i.map(DM.from):[DM.from(i)];if(e.uri&&e.range){let t={range:J.from(e.range),uri:e.uri};for(let e of a)e.location=e.location||t}this.proxy.$appendTestMessagesInRun(t,r,MC.fromExtHostTestItem(e,n).toString(),a)},o=!1,s=this._register(new Hi(this.cts.token)),c={isPersisted:this.dto.isPersisted,token:s.token,name:e,onDidDispose:this.onDidDispose,addCoverage:e=>{if(o)return;let i=e instanceof nk?e.includesTests:[];if(i.length)for(let e of i)this.ensureTestIsKnown(e);let a=new MC([t,r,e.uri.toString()]).toString();this.publishedCoverage.set(a,{report:e,extIds:i.map(e=>MC.fromExtHostTestItem(e,n).toString())}),this.proxy.$appendCoverage(t,r,NM.fromFile(n,a,e))},enqueued:i(e=>{this.proxy.$updateTestStateInRun(t,r,MC.fromExtHostTestItem(e,n).toString(),NC.Queued)}),skipped:i(e=>{this.proxy.$updateTestStateInRun(t,r,MC.fromExtHostTestItem(e,n).toString(),NC.Skipped)}),started:i(e=>{this.proxy.$updateTestStateInRun(t,r,MC.fromExtHostTestItem(e,n).toString(),NC.Running)}),errored:i((e,i,o)=>{a(e,i),this.proxy.$updateTestStateInRun(t,r,MC.fromExtHostTestItem(e,n).toString(),NC.Errored,o)}),failed:i((e,i,o)=>{a(e,i),this.proxy.$updateTestStateInRun(t,r,MC.fromExtHostTestItem(e,n).toString(),NC.Failed,o)}),passed:i((e,n)=>{this.proxy.$updateTestStateInRun(t,r,MC.fromExtHostTestItem(e,this.dto.controllerId).toString(),NC.Passed,n)}),appendOutput:(e,i,a)=>{o||(a&&this.ensureTestIsKnown(a),this.proxy.$appendOutputToRun(t,r,y.fromString(e),i&&Ij.from(i),a&&MC.fromExtHostTestItem(a,n).toString()))},end:()=>{o||(o=!0,this.proxy.$finishedTestRunTask(t,r),--this.running||this.markEnded())}};return this.running++,this.tasks.set(r,{run:c,cts:s}),this.proxy.$startedTestRunTask(t,{id:r,ctrlId:this.dto.controllerId,name:e||this.extension.displayName||this.extension.identifier.value,running:!0}),c}forciblyEndTasks(){for(let{run:e}of this.tasks.values())e.end()}markEnded(){this.state!==sV.Ended&&(this.state=sV.Ended,this.endEmitter.fire())}ensureTestIsKnown(e){if(!(e instanceof FI))throw new Bw(e.id);if(this.sharedTestIds.has(MC.fromExtHostTestItem(e,this.dto.controllerId).toString()))return;let t=[],n=this.dto.colllection.root;for(;;){let r=jM.from(e);if(t.unshift(r),this.sharedTestIds.has(r.extId)||(this.sharedTestIds.add(r.extId),e===n))break;e=e.parent||n}this.proxy.$addTestsToRun(this.dto.controllerId,this.dto.id,t)}dispose(){this.markEnded(),super.dispose()}},lV=class{get trackers(){return this.tracked.values()}constructor(e,t){this.proxy=e,this.logService=t,this.tracked=new Map,this.trackedById=new Map}getCoverageDetails(e,t,n){let r=MC.root(e);return this.trackedById.get(r)?.getCoverageDetails(e,t,n)||[]}disposeTestRun(e){this.trackedById.get(e)?.dispose(),this.trackedById.delete(e);for(let[t,{id:n}]of this.tracked)n===e&&this.tracked.delete(t)}prepareForMainThreadTestRun(e,t,n,r,i){return this.getTracker(t,n,r,e,i)}cancelRunById(e,t){this.trackedById.get(e)?.cancel(t)}cancelAllRuns(){for(let e of this.tracked.values())e.cancel()}createTestRun(e,t,n,r,i,a){let o=this.tracked.get(r);if(o)return o.createRun(i);let s=dV.fromPublic(t,n,r,a),c=uV(r);this.proxy.$startedExtensionTestRun({controllerId:t,continuous:!!r.continuous,profile:c&&{group:AM.from(c.kind),id:c.profileId},exclude:r.exclude?.map(e=>MC.fromExtHostTestItem(e,n.root.id).toString())??[],id:s.id,include:r.include?.map(e=>MC.fromExtHostTestItem(e,n.root.id).toString())??[n.root.id],preserveFocus:r.preserveFocus??!0,persist:a});let l=this.getTracker(r,s,r.profile,e);return ir.once(l.onEnd)(()=>{this.proxy.$finishedExtensionTestRun(s.id)}),l.createRun(i)}getTracker(e,t,n,r,i){let a=new cV(t,this.proxy,this.logService,n,r,i);return this.tracked.set(e,a),this.trackedById.set(a.id,a),a}};const uV=e=>{if(e.profile){if(!(e.profile instanceof gV))throw Error(`TestRunRequest.profile is not an instance created from TestController.createRunProfile`);return e.profile}};var dV=class e{static fromPublic(t,n,r,i){return new e(t,Gc(),i,n)}static fromInternal(t,n){return new e(t.controllerId,t.runId,!0,n)}constructor(e,t,n,r){this.controllerId=e,this.id=t,this.isPersisted=n,this.colllection=r}},fV=class{get isEmpty(){return this.added.size===0&&this.removed.size===0&&this.updated.size===0}constructor(e){this.emitter=e,this.added=new Set,this.updated=new Set,this.removed=new Set,this.alreadyRemoved=new Set}add(e){this.added.add(e)}update(e){Object.assign(e.revived,jM.toPlain(e.item)),this.added.has(e)||this.updated.add(e)}remove(e){if(this.added.delete(e))return;this.updated.delete(e);let t=MC.parentId(e.item.extId);if(t&&this.alreadyRemoved.has(t.toString())){this.alreadyRemoved.add(e.item.extId);return}this.removed.add(e)}getChangeEvent(){let{added:e,updated:t,removed:n}=this;return{get added(){return[...e].map(e=>e.revived)},get updated(){return[...t].map(e=>e.revived)},get removed(){return[...n].map(e=>e.revived)}}}complete(){this.isEmpty||this.emitter.fire(this.getChangeEvent())}},pV=class extends uw{constructor(){super(...arguments),this.changeEmitter=new x,this.onDidChangeTests=this.changeEmitter.event}get rootTests(){return this.roots}getMirroredTestDataById(e){return this.items.get(e)}getMirroredTestDataByReference(e){return this.items.get(e.id)}createItem(e,t){return{...e,revived:jM.toPlain(e.item),depth:t?t.depth+1:0,children:new Set}}createChangeCollector(){return new fV(this.changeEmitter)}},mV=class{constructor(e){this.proxy=e}checkout(){this.current||=this.createObserverData();let e=this.current;return e.observers++,{onDidChangeTest:e.tests.onDidChangeTests,get tests(){return[...e.tests.rootTests].map(e=>e.revived)},dispose:Ye(()=>{--e.observers===0&&(this.proxy.$unsubscribeFromDiffs(),this.current=void 0)})}}getMirroredTestDataByReference(e){return this.current?.tests.getMirroredTestDataByReference(e)}applyDiff(e){this.current?.tests.apply(e)}createObserverData(){let e=new pV({asCanonicalUri:e=>e});return this.proxy.$subscribeToDiffs(),{observers:0,tests:e}}};const hV=(e,t,n,r)=>{n?Object.assign(n,r):t.$updateTestRunConfig(e.controllerId,e.profileId,r)};var gV=class extends YO{#e;#t;#n;#r;#i;get label(){return this._label}set label(e){e!==this._label&&(this._label=e,hV(this,this.#e,this.#r,{label:e}))}get supportsContinuousRun(){return this._supportsContinuousRun}set supportsContinuousRun(e){e!==this._supportsContinuousRun&&(this._supportsContinuousRun=e,hV(this,this.#e,this.#r,{supportsContinuousRun:e}))}get isDefault(){return this.#t.has(this.profileId)}set isDefault(e){e!==this.isDefault&&(e?this.#t.add(this.profileId):this.#t.delete(this.profileId),hV(this,this.#e,this.#r,{isDefault:e}))}get tag(){return this._tag}set tag(e){e?.id!==this._tag?.id&&(this._tag=e,hV(this,this.#e,this.#r,{tag:e?OM.namespace(this.controllerId,e.id):null}))}get configureHandler(){return this._configureHandler}set configureHandler(e){e!==this._configureHandler&&(this._configureHandler=e,hV(this,this.#e,this.#r,{hasConfigurationHandler:!!e}))}get onDidChangeDefault(){return ir.chain(this.#n,e=>e.map(e=>e.get(this.controllerId)?.get(this.profileId)).filter(ct))}constructor(e,t,n,r,i,a,o,s,c,l=!1,u=void 0,d=!1){super(i,a,s),this._label=o,this.runHandler=c,this._tag=u,this._supportsContinuousRun=d,this.#e=e,this.#i=t,this.#t=n,this.#n=r,t.set(a,this);let f=AM.from(s);l&&n.add(a),this.#r={profileId:a,controllerId:i,tag:u?OM.namespace(this.controllerId,u.id):null,label:o,group:f,isDefault:l,hasConfigurationHandler:!1,supportsContinuousRun:d},queueMicrotask(()=>{this.#r&&=(this.#e.$publishTestRunProfile(this.#r),void 0)})}dispose(){this.#i?.delete(this.profileId)&&(this.#i=void 0,this.#e.$removeTestProfile(this.controllerId,this.profileId)),this.#r=void 0}};function _V(e,t){for(let n=0;n<e.path.length;n++){let r=t.find(t=>t.id===e.path[n]);if(!r)return;if(n===e.path.length-1)return r;t=r.children}}var vV;(function(e){e.Unknown=`unknown`,e.Env=`env`,e.Config=`config`,e.Command=`command`,e.Input=`input`,e.ExtensionInstallFolder=`extensionInstallFolder`,e.TaskVar=`taskVar`,e.WorkspaceFolder=`workspaceFolder`,e.Cwd=`cwd`,e.WorkspaceFolderBasename=`workspaceFolderBasename`,e.UserHome=`userHome`,e.LineNumber=`lineNumber`,e.ColumnNumber=`columnNumber`,e.SelectedText=`selectedText`,e.File=`file`,e.FileWorkspaceFolder=`fileWorkspaceFolder`,e.FileWorkspaceFolderBasename=`fileWorkspaceFolderBasename`,e.RelativeFile=`relativeFile`,e.RelativeFileDirname=`relativeFileDirname`,e.FileDirname=`fileDirname`,e.FileExtname=`fileExtname`,e.FileBasename=`fileBasename`,e.FileBasenameNoExtension=`fileBasenameNoExtension`,e.FileDirnameBasename=`fileDirnameBasename`,e.ExecPath=`execPath`,e.ExecInstallFolder=`execInstallFolder`,e.PathSeparator=`pathSeparator`,e.PathSeparatorAlias=`/`})(vV||={});const yV=Object.values(vV).filter(e=>typeof e==`string`);var bV=class extends pe{constructor(e,t){super(t),this.variable=e}},xV=class e{static{this.VARIABLE_LHS="${"}constructor(e){this.locations=new Map,this.newReplacementNotifiers=new Set,typeof e==`string`?(this.stringRoot=!0,this.root={value:e}):(this.stringRoot=!1,this.root=structuredClone(e))}static parse(t){if(t instanceof e)return t;let n=new e(t);return n.applyPlatformSpecificKeys(),n.parseObject(n.root),n}applyPlatformSpecificKeys(){let e=this.root,t=Tn?`windows`:En?`osx`:Dn?`linux`:void 0;t&&e&&typeof e==`object`&&e.hasOwnProperty(t)&&Object.keys(e[t]).forEach(n=>e[n]=e[t][n]),delete e.windows,delete e.osx,delete e.linux}parseVariable(e,t){if(e[t]!==`$`||e[t+1]!==`{`)return;let n=t+2,r=1;for(;n<e.length;){if(e[n]===`{`)r++;else if(e[n]===`}`&&(r--,r===0))break;n++}if(r!==0)return;let i=e.slice(t,n+1),a=e.substring(t+2,n),o=a.indexOf(`:`);return o===-1?{replacement:{id:i,name:a,inner:a},end:n}:{replacement:{id:i,inner:a,name:a.slice(0,o),arg:a.slice(o+1)},end:n}}parseObject(e){if(!(typeof e!=`object`||!e)){if(Array.isArray(e)){for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`?this.parseString(e,t,n):this.parseObject(n)}return}for(let[t,n]of Object.entries(e))this.parseString(e,t,t,!0),typeof n==`string`?this.parseString(e,t,n):this.parseObject(n)}}parseString(e,t,n,r,i){let a=0;for(;a<n.length;){let o=n.indexOf("${",a);if(o===-1)break;let s=this.parseVariable(n,o);if(s){if(a=s.end+1,i?.includes(s.replacement.id))continue;let n=this.locations.get(s.replacement.id)||{locations:[],replacement:s.replacement},o={object:e,propertyName:t,replaceKeyName:r};n.locations.push(o),this.locations.set(s.replacement.id,n),n.resolved?this._resolveAtLocation(s.replacement,o,n.resolved,i):this.newReplacementNotifiers.forEach(e=>e(s.replacement))}else a=o+2}}*unresolved(){let e=new Map,t=t=>{e.set(t.id,t)};for(let t of this.locations.values())t.resolved===void 0&&e.set(t.replacement.id,t.replacement);for(this.newReplacementNotifiers.add(t);;){let t=vt.first(e);if(!t)break;let[n,r]=t;yield r,e.delete(n)}this.newReplacementNotifiers.delete(t)}resolved(){return vt.map(vt.filter(this.locations.values(),e=>!!e.resolved),e=>[e.replacement,e.resolved])}resolve(e,t){typeof t!=`object`&&(t={value:String(t)});let n=this.locations.get(e.id);if(n&&(n.resolved=t,t.value!==void 0))for(let r of n.locations||vt.empty())this._resolveAtLocation(e,r,t)}_resolveAtLocation(e,{replaceKeyName:t,propertyName:n,object:r},i,a=[]){if(i.value!==void 0){if(a.push(e.id),t&&typeof n==`string`){let t=r[n],o=n.replaceAll(e.id,i.value);delete r[n],r[o]=t,this._renameKeyInLocations(r,n,o),this.parseString(r,o,i.value,!0,a)}else r[n]=r[n].replaceAll(e.id,i.value),this.parseString(r,n,i.value,!1,a);a.pop()}}_renameKeyInLocations(e,t,n){for(let r of this.locations.values())for(let i of r.locations)i.object===e&&i.propertyName===t&&(i.propertyName=n)}toObject(){return this.stringRoot?this.root.value:this.root}},SV=class{constructor(e,t,n,r){this._contributedVariables=new Map,this.resolvableVariables=new Set(yV),this._context=e,this._labelService=t,this._userHomePromise=n,r&&(this._envVariablesPromise=r.then(e=>this.prepareEnv(e)))}prepareEnv(e){if(Tn){let t=Object.create(null);return Object.keys(e).forEach(n=>{t[n.toLowerCase()]=e[n]}),t}return e}async resolveWithEnvironment(e,t,n){let r=xV.parse(n);for(let n of r.unresolved()){let i=await this.evaluateSingleVariable(n,t?.uri,e);i!==void 0&&r.resolve(n,String(i))}return r.toObject()}async resolveAsync(e,t){let n=xV.parse(t);for(let t of n.unresolved()){let r=await this.evaluateSingleVariable(t,e?.uri);r!==void 0&&n.resolve(t,String(r))}return n.toObject()}resolveWithInteractionReplace(e,t){throw Error(`resolveWithInteractionReplace not implemented.`)}resolveWithInteraction(e,t){throw Error(`resolveWithInteraction not implemented.`)}contributeVariable(e,t){if(this._contributedVariables.has(e))throw Error(`Variable `+e+` is contributed twice.`);this.resolvableVariables.add(e),this._contributedVariables.set(e,t)}fsPath(e){return this._labelService?this._labelService.getUriLabel(e,{noPrefix:!0}):e.fsPath}async evaluateSingleVariable(e,t,n,r){let i={env:n===void 0?await this._envVariablesPromise:this.prepareEnv(n),userHome:n===void 0?await this._userHomePromise:void 0},{name:a,arg:o}=e,s=t=>{let n=this._context.getFilePath();if(n)return Cy(n);throw new bV(t,b(16803,`Variable {0} can not be resolved. Please open an editor.`,e.id))},c=t=>{let n=s(t);if(this._context.getWorkspaceFolderPathForFile){let e=this._context.getWorkspaceFolderPathForFile();if(e)return Cy(e)}throw new bV(t,b(16804,`Variable {0}: can not find workspace folder of '{1}'.`,e.id,Qr(n)))},l=e=>{if(o){let t=this._context.getFolderUri(o);if(t)return t;throw new bV(e,b(16805,`Variable {0} can not be resolved. No such folder '{1}'.`,e,o))}if(t)return t;throw this._context.getWorkspaceFolderCount()>1?new bV(e,b(16806,`Variable {0} can not be resolved in a multi folder workspace. Scope this variable using ':' and a workspace folder name.`,e)):new bV(e,b(16807,`Variable {0} can not be resolved. Please open a folder.`,e))};switch(a){case`env`:if(o){if(i.env){let e=i.env[Tn?o.toLowerCase():o];if(et(e))return e}return``}throw new bV(vV.Env,b(16808,`Variable {0} can not be resolved because no environment variable name is given.`,e.id));case`config`:if(o){let n=this._context.getConfigurationValue(t,o);if(lt(n))throw new bV(vV.Config,b(16809,`Variable {0} can not be resolved because setting '{1}' not found.`,e.id,o));if(rt(n))throw new bV(vV.Config,b(16810,`Variable {0} can not be resolved because '{1}' is a structured value.`,e.id,o));return n}throw new bV(vV.Config,b(16811,`Variable {0} can not be resolved because no settings name is given.`,e.id));case`command`:return this.resolveFromMap(vV.Command,e.id,o,r,`command`);case`input`:return this.resolveFromMap(vV.Input,e.id,o,r,`input`);case`extensionInstallFolder`:if(o){let t=await this._context.getExtension(o);if(!t)throw new bV(vV.ExtensionInstallFolder,b(16812,`Variable {0} can not be resolved because the extension {1} is not installed.`,e.id,o));return this.fsPath(t.extensionLocation)}throw new bV(vV.ExtensionInstallFolder,b(16813,`Variable {0} can not be resolved because no extension name is given.`,e.id));default:switch(a){case`workspaceRoot`:case`workspaceFolder`:{let e=l(vV.WorkspaceFolder);return e?Cy(this.fsPath(e)):void 0}case`cwd`:{if(!t&&!o)return Zn();let e=l(vV.Cwd);return e?Cy(this.fsPath(e)):void 0}case`workspaceRootFolderName`:case`workspaceFolderBasename`:{let e=l(vV.WorkspaceFolderBasename);return e?Cy(Qr(this.fsPath(e))):void 0}case`userHome`:if(i.userHome)return i.userHome;throw new bV(vV.UserHome,b(16814,`Variable {0} can not be resolved. UserHome path is not defined`,e.id));case`lineNumber`:{let t=this._context.getLineNumber();if(t)return t;throw new bV(vV.LineNumber,b(16815,`Variable {0} can not be resolved. Make sure to have a line selected in the active editor.`,e.id))}case`columnNumber`:{let t=this._context.getColumnNumber();if(t)return t;throw Error(b(16816,`Variable {0} can not be resolved. Make sure to have a column selected in the active editor.`,e.id))}case`selectedText`:{let t=this._context.getSelectedText();if(t)return t;throw new bV(vV.SelectedText,b(16817,`Variable {0} can not be resolved. Make sure to have some text selected in the active editor.`,e.id))}case`file`:return s(vV.File);case`fileWorkspaceFolder`:return c(vV.FileWorkspaceFolder);case`fileWorkspaceFolderBasename`:return Qr(c(vV.FileWorkspaceFolderBasename));case`relativeFile`:return t||o?Xr(this.fsPath(l(vV.RelativeFile)),s(vV.RelativeFile)):s(vV.RelativeFile);case`relativeFileDirname`:{let e=Zr(s(vV.RelativeFileDirname));if(t||o){let t=Xr(this.fsPath(l(vV.RelativeFileDirname)),e);return t.length===0?`.`:t}return e}case`fileDirname`:return Zr(s(vV.FileDirname));case`fileExtname`:return $r(s(vV.FileExtname));case`fileBasename`:return Qr(s(vV.FileBasename));case`fileBasenameNoExtension`:{let e=Qr(s(vV.FileBasenameNoExtension));return e.slice(0,e.length-$r(e).length)}case`fileDirnameBasename`:return Qr(Zr(s(vV.FileDirnameBasename)));case`execPath`:return this._context.getExecPath()||e.id;case`execInstallFolder`:return this._context.getAppRoot()||e.id;case`pathSeparator`:case`/`:return ei;default:try{return this.resolveFromMap(vV.Unknown,e.id,o,r,void 0)}catch{return e.id}}}}resolveFromMap(e,t,n,r,i){if(n&&r){let a=i===void 0?r[n]:r[i+`:`+n];if(typeof a==`string`)return a;throw new bV(e,b(16818,`Variable {0} can not be resolved because the command has no value.`,t))}return t}};const CV=O(`IExtHostVariableResolverProvider`);var wV=class extends SV{constructor(e,t,n,r,i,a,o){function s(){if(n){let e=n.activeEditor();if(e)return e.document.uri;let t=r.tabGroups.all.find(e=>e.isActive)?.activeTab;if(t!==void 0){if(t.input instanceof dk||t.input instanceof gk)return t.input.modified;if(t.input instanceof uk||t.input instanceof hk||t.input instanceof pk)return t.input.uri}}}super({getFolderUri:e=>{let t=a.folders.filter(t=>t.name===e);if(t&&t.length>0)return t[0].uri},getWorkspaceFolderCount:()=>a.folders.length,getConfigurationValue:(e,t)=>i.getConfiguration(void 0,e).get(t),getAppRoot:()=>Zn(),getExecPath:()=>Qn.VSCODE_EXEC_PATH,getFilePath:()=>{let e=s();if(e)return Kr(e.fsPath)},getWorkspaceFolderPathForFile:()=>{if(t){let e=s();if(e){let n=t.getWorkspaceFolder(e);if(n)return Kr(n.uri.fsPath)}}},getSelectedText:()=>{if(n){let e=n.activeEditor();if(e&&!e.selection.isEmpty)return e.document.getText(e.selection)}},getLineNumber:()=>{if(n){let e=n.activeEditor();if(e)return String(e.selection.end.line+1)}},getColumnNumber:()=>{if(n){let e=n.activeEditor();if(e)return String(e.selection.end.character+1)}},getExtension:t=>e.getExtension(t)},void 0,o?Promise.resolve(o):void 0,Promise.resolve(Qn))}};let TV=class extends v{constructor(e,t,n,r,i){super(),this.extensionService=e,this.workspaceService=t,this.editorService=n,this.configurationService=r,this.editorTabs=i,this._resolver=new u(async()=>{let e=await this.configurationService.getConfigProvider(),t={folders:await this.workspaceService.getWorkspaceFolders2()||[]};return this._register(this.workspaceService.onDidChangeWorkspace(async e=>{t.folders=await this.workspaceService.getWorkspaceFolders2()||[]})),new wV(this.extensionService,this.workspaceService,this.editorService,this.editorTabs,e,t,this.homeDir())})}getResolver(){return this._resolver.value}homeDir(){}};TV=k([A(0,XR),A(1,eF),A(2,Lz),A(3,yF),A(4,JB)],TV);const EV=O(`IExtHostDebugService`);let DV=class extends v{get onDidStartDebugSession(){return this._onDidStartDebugSession.event}get onDidTerminateDebugSession(){return this._onDidTerminateDebugSession.event}get onDidChangeActiveDebugSession(){return this._onDidChangeActiveDebugSession.event}get activeDebugSession(){return this._activeDebugSession?.api}get onDidReceiveDebugSessionCustomEvent(){return this._onDidReceiveDebugSessionCustomEvent.event}get activeDebugConsole(){return this._activeDebugConsole.value}constructor(e,t,n,r,i,a,o,s){super(),this._workspaceService=t,this._extensionService=n,this._configurationService=r,this._editorTabs=i,this._variableResolver=a,this._commands=o,this._testing=s,this._debugSessions=new Map,this._debugVisualizationTreeItemIdsCounter=0,this._debugVisualizationProviders=new Map,this._debugVisualizationTrees=new Map,this._debugVisualizationTreeItemIds=new WeakMap,this._debugVisualizationElements=new Map,this._visualizers=new Map,this._visualizerIdCounter=0,this._configProviderHandleCounter=0,this._configProviders=[],this._adapterFactoryHandleCounter=0,this._adapterFactories=[],this._trackerFactoryHandleCounter=0,this._trackerFactories=[],this._debugAdapters=new Map,this._debugAdaptersTrackers=new Map,this._onDidStartDebugSession=this._register(new x),this._onDidTerminateDebugSession=this._register(new x),this._onDidChangeActiveDebugSession=this._register(new x),this._onDidReceiveDebugSessionCustomEvent=this._register(new x),this._debugServiceProxy=e.getProxy(T.MainThreadDebugService),this._onDidChangeBreakpoints=this._register(new x),this._onDidChangeActiveStackItem=this._register(new x),this._activeDebugConsole=new kV(this._debugServiceProxy),this._breakpoints=new Map,this._extensionService.getExtensionRegistry().then(e=>{this._register(e.onDidChange(t=>{this.registerAllDebugTypes(e)})),this.registerAllDebugTypes(e)}),this._telemetryProxy=e.getProxy(T.MainThreadTelemetry)}async $getVisualizerTreeItem(e,t){let n=this.hydrateVisualizationContext(t);if(!n)return;let r=await this._debugVisualizationTrees.get(e)?.getTreeItem?.(n);return r?this.convertVisualizerTreeItem(e,r):void 0}registerDebugVisualizationTree(e,t,n){let r=Ts.toKey(e.identifier),i=this.extensionVisKey(r,t);if(this._debugVisualizationProviders.has(i))throw Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationTrees.set(i,n),this._debugServiceProxy.$registerDebugVisualizerTree(i,!!n.editItem),g(()=>{this._debugServiceProxy.$unregisterDebugVisualizerTree(i),this._debugVisualizationTrees.delete(t)})}async $getVisualizerTreeItemChildren(e,t){let n=this._debugVisualizationElements.get(t)?.item;return n&&(await this._debugVisualizationTrees.get(e)?.getChildren?.(n))?.map(t=>this.convertVisualizerTreeItem(e,t))||[]}async $editVisualizerTreeItem(e,t){let n=this._debugVisualizationElements.get(e);if(!n)return;let r=await this._debugVisualizationTrees.get(n.provider)?.editItem?.(n.item,t);return this.convertVisualizerTreeItem(n.provider,r||n.item)}$disposeVisualizedTree(e){let t=this._debugVisualizationElements.get(e);if(!t)return;let n=[t.children];for(let e of n)if(e)for(let t of e)n.push(this._debugVisualizationElements.get(t)?.children),this._debugVisualizationElements.delete(t)}convertVisualizerTreeItem(e,t){let n=this._debugVisualizationTreeItemIds.get(t);return n||(n=this._debugVisualizationTreeItemIdsCounter++,this._debugVisualizationTreeItemIds.set(t,n),this._debugVisualizationElements.set(n,{provider:e,item:t})),FN.from(t,n)}asDebugSourceUri(e,t){let n=e;if(typeof n.sourceReference==`number`&&n.sourceReference>0){let e=`debug:${encodeURIComponent(n.path||``)}`,r=`?`;return t&&(e+=`${r}session=${encodeURIComponent(t.id)}`,r=`&`),e+=`${r}ref=${n.sourceReference}`,C.parse(e)}else if(n.path)return C.file(n.path);else throw Error(`cannot create uri from DAP 'source' object; properties 'path' and 'sourceReference' are both missing.`)}registerAllDebugTypes(e){let t=[];for(let n of e.getAllExtensionDescriptions())if(n.contributes){let e=n.contributes.debuggers;if(e&&e.length>0)for(let n of e)BB(n)&&t.push(n.type)}this._debugServiceProxy.$registerDebugTypes(t)}get activeStackItem(){return this._activeStackItem}get onDidChangeActiveStackItem(){return this._onDidChangeActiveStackItem.event}get onDidChangeBreakpoints(){return this._onDidChangeBreakpoints.event}get breakpoints(){let e=[];return this._breakpoints.forEach(t=>e.push(t)),e}async $resolveDebugVisualizer(e,t){let n=this._visualizers.get(e);if(!n)throw Error(`No debug visualizer found with id '${e}'`);let{v:r,provider:i,extensionId:a}=n;if(r.visualization||(r=await i.resolveDebugVisualization?.(r,t)||r,n.v=r),!r.visualization)throw Error(`No visualization returned from resolveDebugVisualization in '${i}'`);return this.serializeVisualization(a,r.visualization)}async $executeDebugVisualizerCommand(e){let t=this._visualizers.get(e);if(!t)throw Error(`No debug visualizer found with id '${e}'`);let n=t.v.visualization;n&&`command`in n&&this._commands.executeCommand(n.command,...n.arguments||[])}hydrateVisualizationContext(e){let t=this._debugSessions.get(e.sessionId);return t&&{session:t.api,variable:e.variable,containerId:e.containerId,frameId:e.frameId,threadId:e.threadId}}async $provideDebugVisualizers(e,t,n,r){let i=this.hydrateVisualizationContext(n),a=this.extensionVisKey(e,t),o=this._debugVisualizationProviders.get(a);if(!i||!o)return[];let s=await o.provideDebugVisualization(i,r);return s?s.map(t=>{let n=++this._visualizerIdCounter;this._visualizers.set(n,{v:t,provider:o,extensionId:e});let r=t.iconPath?this.getIconPathOrClass(t.iconPath):void 0;return{id:n,name:t.name,iconClass:r?.iconClass,iconPath:r?.iconPath,visualization:this.serializeVisualization(e,t.visualization)}}):[]}$disposeDebugVisualizers(e){for(let t of e)this._visualizers.delete(t)}registerDebugVisualizationProvider(e,t,n){if(!e.contributes?.debugVisualizers?.some(e=>e.id===t))throw Error(`Extensions may only call registerDebugVisualizationProvider() for renderers they contribute (got ${t})`);let r=Ts.toKey(e.identifier),i=this.extensionVisKey(r,t);if(this._debugVisualizationProviders.has(i))throw Error(`A debug visualization provider with id '${t}' is already registered`);return this._debugVisualizationProviders.set(i,n),this._debugServiceProxy.$registerDebugVisualizer(r,t),g(()=>{this._debugServiceProxy.$unregisterDebugVisualizer(r,t),this._debugVisualizationProviders.delete(t)})}addBreakpoints(e){let t=e.filter(e=>{let t=e.id;return this._breakpoints.has(t)?!1:(this._breakpoints.set(t,e),!0)});this.fireBreakpointChanges(t,[],[]);let n=[],r=new Map;for(let e of t)if(e instanceof BD){let t=r.get(e.location.uri.toString());t||(t={type:`sourceMulti`,uri:e.location.uri,lines:[]},r.set(e.location.uri.toString(),t),n.push(t)),t.lines.push({id:e.id,enabled:e.enabled,condition:e.condition,hitCondition:e.hitCondition,logMessage:e.logMessage,line:e.location.range.start.line,character:e.location.range.start.character,mode:e.mode})}else e instanceof VD&&n.push({type:`function`,id:e.id,enabled:e.enabled,hitCondition:e.hitCondition,logMessage:e.logMessage,condition:e.condition,functionName:e.functionName,mode:e.mode});return this._debugServiceProxy.$registerBreakpoints(n)}removeBreakpoints(e){let t=e.filter(e=>this._breakpoints.delete(e.id));this.fireBreakpointChanges([],t,[]);let n=t.filter(e=>e instanceof BD).map(e=>e.id),r=t.filter(e=>e instanceof VD).map(e=>e.id),i=t.filter(e=>e instanceof HD).map(e=>e.id);return this._debugServiceProxy.$unregisterBreakpoints(n,r,i)}startDebugging(e,t,n){let r=n.testRun&&this._testing.getMetadataForRun(n.testRun);return this._debugServiceProxy.$startDebugging(e?e.uri:void 0,t,{parentSessionID:n.parentSession?n.parentSession.id:void 0,lifecycleManagedByParent:n.lifecycleManagedByParent,repl:n.consoleMode===xO.MergeWithParent?`mergeWithParent`:`separate`,noDebug:n.noDebug,compact:n.compact,suppressSaveBeforeStart:n.suppressSaveBeforeStart,testRun:r&&{runId:r.runId,taskId:r.taskId},suppressDebugStatusbar:n.suppressDebugStatusbar??n.debugUI?.simple,suppressDebugToolbar:n.suppressDebugToolbar??n.debugUI?.simple,suppressDebugView:n.suppressDebugView??n.debugUI?.simple})}stopDebugging(e){return this._debugServiceProxy.$stopDebugging(e?e.id:void 0)}registerDebugConfigurationProvider(e,t,n){if(!t)return new YT(()=>{});let r=this._configProviderHandleCounter++;return this._configProviders.push({type:e,handle:r,provider:t}),this._debugServiceProxy.$registerDebugConfigurationProvider(e,n,!!t.provideDebugConfigurations,!!t.resolveDebugConfiguration,!!t.resolveDebugConfigurationWithSubstitutedVariables,r),new YT(()=>{this._configProviders=this._configProviders.filter(e=>e.provider!==t),this._debugServiceProxy.$unregisterDebugConfigurationProvider(r)})}registerDebugAdapterDescriptorFactory(e,t,n){if(!n)return new YT(()=>{});if(!this.definesDebugType(e,t))throw Error(`a DebugAdapterDescriptorFactory can only be registered from the extension that defines the '${t}' debugger.`);if(this.getAdapterDescriptorFactoryByType(t))throw Error(`a DebugAdapterDescriptorFactory can only be registered once per a type.`);let r=this._adapterFactoryHandleCounter++;return this._adapterFactories.push({type:t,handle:r,factory:n}),this._debugServiceProxy.$registerDebugAdapterDescriptorFactory(t,r),new YT(()=>{this._adapterFactories=this._adapterFactories.filter(e=>e.factory!==n),this._debugServiceProxy.$unregisterDebugAdapterDescriptorFactory(r)})}registerDebugAdapterTrackerFactory(e,t){if(!t)return new YT(()=>{});let n=this._trackerFactoryHandleCounter++;return this._trackerFactories.push({type:e,handle:n,factory:t}),new YT(()=>{this._trackerFactories=this._trackerFactories.filter(e=>e.factory!==t)})}async $runInTerminal(e,t){return Promise.resolve(void 0)}async $substituteVariables(e,t){let n,r=await this.getFolder(e);return r&&(n={uri:r.uri,name:r.name,index:r.index}),(await this._variableResolver.getResolver()).resolveAsync(n,t)}createDebugAdapter(e,t){if(e instanceof KD)return new jV(e.implementation)}createSignService(){}async $startDASession(e,t){let n=this,r=await this.getSession(t);return this.getAdapterDescriptor(this.getAdapterDescriptorFactoryByType(r.type),r).then(t=>{if(!t)throw Error(`Couldn't find a debug adapter descriptor for debug type '${r.type}' (extension might have failed to activate)`);let i=this.createDebugAdapter(t,r);if(!i)throw Error(`Couldn't create a debug adapter for type '${r.type}'.`);let a=i;return this._debugAdapters.set(e,a),this.getDebugAdapterTrackers(r).then(t=>(t&&this._debugAdaptersTrackers.set(e,t),a.onMessage(async i=>{if(i.type===`request`&&i.command===`handshake`){let e=i,t={type:`response`,seq:0,command:e.command,request_seq:e.seq,success:!0};this._signService||=this.createSignService();try{if(this._signService)t.body={signature:await this._signService.sign(e.arguments.value)},a.sendResponse(t);else throw Error(`no signer`)}catch(e){t.success=!1,t.message=e.message,a.sendResponse(t)}}else{t&&t.onDidSendMessage&&t.onDidSendMessage(i);try{i=KB(i,!0)}catch(e){let t=i.type+`_`+(i.command??i.event??``);throw this._telemetryProxy.$publicLog2(`debugProtocolMessageError`,{type:t,from:r.type}),e}n._debugServiceProxy.$acceptDAMessage(e,i)}}),a.onError(n=>{t&&t.onError&&t.onError(n),this._debugServiceProxy.$acceptDAError(e,n.name,n.message,n.stack)}),a.onExit(n=>{t&&t.onExit&&t.onExit(n??void 0,void 0),this._debugServiceProxy.$acceptDAExit(e,n??void 0,void 0)}),t&&t.onWillStartSession&&t.onWillStartSession(),a.startSession()))})}$sendDAMessage(e,t){t=GB(t,!1);let n=this._debugAdaptersTrackers.get(e);n&&n.onWillReceiveMessage&&n.onWillReceiveMessage(t),this._debugAdapters.get(e)?.sendMessage(t)}$stopDASession(e){let t=this._debugAdaptersTrackers.get(e);this._debugAdaptersTrackers.delete(e),t&&t.onWillStopSession&&t.onWillStopSession();let n=this._debugAdapters.get(e);return this._debugAdapters.delete(e),n?n.stopSession():Promise.resolve(void 0)}$acceptBreakpointsDelta(e){let t=[],n=[],r=[];if(e.added)for(let n of e.added){let e=n.id;if(e&&!this._breakpoints.has(e)){let r;r=n.type===`function`?new VD(n.functionName,n.enabled,n.condition,n.hitCondition,n.logMessage,n.mode):n.type===`data`?new HD(n.label,n.dataId,n.canPersist,n.enabled,n.hitCondition,n.condition,n.logMessage,n.mode):new BD(new gT(C.revive(n.uri),new aT(n.line,n.character)),n.enabled,n.condition,n.hitCondition,n.logMessage,n.mode),RD(r,e),this._breakpoints.set(e,r),t.push(r)}}if(e.removed)for(let t of e.removed){let e=this._breakpoints.get(t);e&&(this._breakpoints.delete(t),n.push(e))}if(e.changed){for(let t of e.changed)if(t.id){let e=this._breakpoints.get(t.id);if(e){if(e instanceof VD&&t.type===`function`){let n=e;n.enabled=t.enabled,n.condition=t.condition,n.hitCondition=t.hitCondition,n.logMessage=t.logMessage,n.functionName=t.functionName}else if(e instanceof BD&&t.type===`source`){let n=e;n.enabled=t.enabled,n.condition=t.condition,n.hitCondition=t.hitCondition,n.logMessage=t.logMessage,n.location=new gT(C.revive(t.uri),new aT(t.line,t.character))}r.push(e)}}}this.fireBreakpointChanges(t,n,r)}async $acceptStackFrameFocus(e){let t;if(e){let n=await this.getSession(e.sessionId);t=e.kind===`thread`?new JD(n.api,e.threadId):new qD(n.api,e.threadId,e.frameId)}this._activeStackItem=t,this._onDidChangeActiveStackItem.fire(this._activeStackItem)}$provideDebugConfigurations(e,t,n){return So(async()=>{let r=this.getConfigProviderByHandle(e);if(!r)throw Error(`no DebugConfigurationProvider found`);if(!r.provideDebugConfigurations)throw Error(`DebugConfigurationProvider has no method provideDebugConfigurations`);let i=await this.getFolder(t);return r.provideDebugConfigurations(i,n)}).then(e=>{if(!e)throw Error(`nothing returned from DebugConfigurationProvider.provideDebugConfigurations`);return e})}$resolveDebugConfiguration(e,t,n,r){return So(async()=>{let i=this.getConfigProviderByHandle(e);if(!i)throw Error(`no DebugConfigurationProvider found`);if(!i.resolveDebugConfiguration)throw Error(`DebugConfigurationProvider has no method resolveDebugConfiguration`);let a=await this.getFolder(t);return i.resolveDebugConfiguration(a,n,r)})}$resolveDebugConfigurationWithSubstitutedVariables(e,t,n,r){return So(async()=>{let i=this.getConfigProviderByHandle(e);if(!i)throw Error(`no DebugConfigurationProvider found`);if(!i.resolveDebugConfigurationWithSubstitutedVariables)throw Error(`DebugConfigurationProvider has no method resolveDebugConfigurationWithSubstitutedVariables`);let a=await this.getFolder(t);return i.resolveDebugConfigurationWithSubstitutedVariables(a,n,r)})}async $provideDebugAdapter(e,t){let n=this.getAdapterDescriptorFactoryByHandle(e);if(!n)return Promise.reject(Error(`no adapter descriptor factory found for handle`));let r=await this.getSession(t);return this.getAdapterDescriptor(n,r).then(e=>{if(!e)throw Error(`Couldn't find a debug adapter descriptor for debug type '${r.type}'`);return this.convertToDto(e)})}async $acceptDebugSessionStarted(e){let t=await this.getSession(e);this._onDidStartDebugSession.fire(t.api)}async $acceptDebugSessionTerminated(e){let t=await this.getSession(e);t&&(this._onDidTerminateDebugSession.fire(t.api),this._debugSessions.delete(t.id))}async $acceptDebugSessionActiveChanged(e){this._activeDebugSession=e?await this.getSession(e):void 0,this._onDidChangeActiveDebugSession.fire(this._activeDebugSession?.api)}async $acceptDebugSessionNameChanged(e,t){(await this.getSession(e))?._acceptNameChanged(t)}async $acceptDebugSessionCustomEvent(e,t){let n={session:(await this.getSession(e)).api,event:t.event,body:t.body};this._onDidReceiveDebugSessionCustomEvent.fire(n)}convertToDto(e){if(e instanceof UD)return this.convertExecutableToDto(e);if(e instanceof WD)return this.convertServerToDto(e);if(e instanceof GD)return this.convertPipeServerToDto(e);if(e instanceof KD)return this.convertImplementationToDto(e);throw Error(`convertToDto unexpected type`)}convertExecutableToDto(e){return{type:`executable`,command:e.command,args:e.args,options:e.options}}convertServerToDto(e){return{type:`server`,port:e.port,host:e.host}}convertPipeServerToDto(e){return{type:`pipeServer`,path:e.path}}convertImplementationToDto(e){return{type:`implementation`}}getAdapterDescriptorFactoryByType(e){let t=this._adapterFactories.filter(t=>t.type===e);if(t.length>0)return t[0].factory}getAdapterDescriptorFactoryByHandle(e){let t=this._adapterFactories.filter(t=>t.handle===e);if(t.length>0)return t[0].factory}getConfigProviderByHandle(e){let t=this._configProviders.filter(t=>t.handle===e);if(t.length>0)return t[0].provider}definesDebugType(e,t){if(e.contributes){let n=e.contributes.debuggers;if(n&&n.length>0){for(let e of n)if(e.label&&e.type&&e.type===t)return!0}}return!1}getDebugAdapterTrackers(e){let t=e.configuration.type,n=this._trackerFactories.filter(e=>e.type===t||e.type===`*`).map(t=>So(()=>t.factory.createDebugAdapterTracker(e.api)).then(e=>e,e=>null));return Promise.race([Promise.all(n).then(e=>{let t=Se(e);if(t.length>0)return new AV(t)}),new Promise(e=>setTimeout(()=>e(void 0),1e3))]).catch(e=>{})}async getAdapterDescriptor(e,t){let n=t.configuration.debugServer;if(typeof n==`number`)return Promise.resolve(new WD(n));if(e){let n=await this._extensionService.getExtensionRegistry();return So(()=>e.createDebugAdapterDescriptor(t.api,this.daExecutableFromPackage(t,n))).then(e=>{if(e)return e})}let r=await this._extensionService.getExtensionRegistry();return Promise.resolve(this.daExecutableFromPackage(t,r))}daExecutableFromPackage(e,t){}fireBreakpointChanges(e,t,n){(e.length>0||t.length>0||n.length>0)&&this._onDidChangeBreakpoints.fire(Object.freeze({added:e,removed:t,changed:n}))}async getSession(e){if(e)if(typeof e==`string`){let t=this._debugSessions.get(e);if(t)return t}else{let t=this._debugSessions.get(e.id);if(!t){let n=await this.getFolder(e.folderUri),r=e.parent?this._debugSessions.get(e.parent):void 0;t=new OV(this._debugServiceProxy,e.id,e.type,e.name,n,e.configuration,r?.api),this._debugSessions.set(t.id,t),this._debugServiceProxy.$sessionCached(t.id)}return t}throw Error(`cannot find session`)}getFolder(e){if(e){let t=C.revive(e);return this._workspaceService.resolveWorkspaceFolder(t)}return Promise.resolve(void 0)}extensionVisKey(e,t){return`${e}\0${t}`}serializeVisualization(e,t){if(t){if(`title`in t&&`command`in t)return{type:Gx.Command};if(`treeId`in t)return{type:Gx.Tree,id:`${e}\0${t.treeId}`};throw Error(`Unsupported debug visualization type`)}}getIconPathOrClass(e){let t=this.getIconUris(e),n,r;return`id`in t?r=vl.asClassName(t):n=t,{iconPath:n,iconClass:r}}getIconUris(e){if(e instanceof ND)return{id:e.id};let t=typeof e==`object`&&`dark`in e?e.dark:e,n=typeof e==`object`&&`light`in e?e.light:e;return{dark:typeof t==`string`?C.file(t):t,light:typeof n==`string`?C.file(n):n}}};DV=k([A(0,Js),A(1,eF),A(2,XR),A(3,yF),A(4,JB),A(5,CV),A(6,UI),A(7,aV)],DV);var OV=class{constructor(e,t,n,r,i,a,o){this._debugServiceProxy=e,this._id=t,this._type=n,this._name=r,this._workspaceFolder=i,this._configuration=a,this._parentSession=o}get api(){let e=this;return this.apiSession??=Object.freeze({id:e._id,type:e._type,get name(){return e._name},set name(t){e._name=t,e._debugServiceProxy.$setDebugSessionName(e._id,t)},parentSession:e._parentSession,workspaceFolder:e._workspaceFolder,configuration:e._configuration,customRequest(t,n){return e._debugServiceProxy.$customDebugAdapterRequest(e._id,t,n)},getDebugProtocolBreakpoint(t){return e._debugServiceProxy.$getDebugProtocolBreakpoint(e._id,t.id)}})}get id(){return this._id}get type(){return this._type}_acceptNameChanged(e){this._name=e}get configuration(){return this._configuration}},kV=class{constructor(e){this.value=Object.freeze({append(t){e.$appendDebugConsole(t)},appendLine(e){this.append(e+`
|
|
103
|
+
`)}})}},AV=class{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(n=>n.onExit?n.onExit(e,t):void 0)}},jV=class extends zB{constructor(e){super(),this.implementation=e,e.onDidSendMessage(e=>{this.acceptMessage(e)})}startSession(){return Promise.resolve(void 0)}sendMessage(e){this.implementation.handleMessage(e)}stopSession(){return this.implementation.dispose(),Promise.resolve(void 0)}};let MV=class extends DV{constructor(e,t,n,r,i,a,o,s){super(e,t,n,r,i,a,o,s)}};MV=k([A(0,Js),A(1,eF),A(2,XR),A(3,yF),A(4,JB),A(5,CV),A(6,UI),A(7,aV)],MV);function NV(e){return`uri`in e&&`ranges`in e&&`preview`in e}function PV(e){return e.folderOptions.map(t=>({folder:t.folder,excludes:t.excludes.map(e=>typeof e==`string`?e:e.pattern),includes:t.includes,useGlobalIgnoreFiles:t.useIgnoreFiles.global,useIgnoreFiles:t.useIgnoreFiles.local,useParentIgnoreFiles:t.useIgnoreFiles.parent,followSymlinks:t.followSymlinks,maxResults:e.maxResults,session:e.session}))}var FV=class{constructor(e){this.provider=e}provideFileSearchResults(e,t,n){return(async()=>{let r=PV(t);return Promise.all(r.map(t=>this.provider.provideFileSearchResults({pattern:e},t,n)))})().then(e=>Se(e).flat())}};function IV(e){return e.folderOptions.map(t=>({folder:t.folder,excludes:t.excludes.map(e=>typeof e==`string`?e:e.pattern),includes:t.includes,useGlobalIgnoreFiles:t.useIgnoreFiles.global,useIgnoreFiles:t.useIgnoreFiles.local,useParentIgnoreFiles:t.useIgnoreFiles.parent,followSymlinks:t.followSymlinks,maxResults:e.maxResults,previewOptions:LV(e.previewOptions),maxFileSize:e.maxFileSize,encoding:t.encoding,afterContext:e.surroundingContext,beforeContext:e.surroundingContext}))}function LV(e){return{matchLines:e?.matchLines??_P.matchLines,charsPerLine:e?.charsPerLine??_P.charsPerLine}}function RV(e){if(NV(e)){let t=ke(e.ranges).map((t,n)=>({sourceRange:t,previewRange:ke(e.preview.matches)[n]}));return new GN(e.uri,t,e.preview.text)}else return new KN(e.uri,e.text,e.lineNumber)}var zV=class{constructor(e){this.provider=e}provideTextSearchResults(e,t,n,r){let i=e=>{BV(e)&&n.report(RV(e))};return(async()=>Se(await Promise.all(IV(t).map(t=>this.provider.provideTextSearchResults(e,t,{report:e=>i(e)},r)))).reduce((e,t)=>({limitHit:e.limitHit||t.limitHit}),{limitHit:!1}))().then(e=>({limitHit:e.limitHit,message:Se(ke(e.message))}))}};function BV(e){if(VV(e)){if(Array.isArray(e.ranges)){if(!Array.isArray(e.preview.matches))return console.warn("INVALID - A text search provider match's`ranges` and`matches` properties must have the same type."),!1;if(e.preview.matches.length!==e.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(e.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 VV(e){return!!e.preview}var HV=class extends oc{constructor(e,t,n=()=>!1){let r=new nc(n,()=>!1);super(r);let i=new He;e.forEach((e,t)=>{let n=e.folder.with({query:``,fragment:``});i.has(n)?i.get(n).push({fq:e,i:t}):i.set(n,[{fq:e,i:t}])}),i.forEach((e,n)=>{let r=new Map;for(let n of e){let e=t(n.fq,n.i);r.set(this.encodeKey(n.fq.folder),e)}super.set(n,r)})}findQueryFragmentAwareSubstr(e){let t=super.findSubstr(e.with({query:``,fragment:``}));if(!t)return;let n=this.encodeKey(e);return t.get(n)}forEachFolderQueryInfo(e){return this.forEach(t=>t.forEach(t=>e(t)))}encodeKey(e){let t=``;return e.query&&(t+=e.query),e.fragment&&(t+=`#`+e.fragment),t}},UV=class{constructor(e,t,n){this.config=e,this.provider=t,this.sessionLifecycle=n,this.isLimitHit=!1,this.resultCount=0,this.isCanceled=!1,this.filePattern=e.filePattern;let r=e.ignoreGlobCase?{ignoreCase:!0}:void 0;this.includePattern=e.includePattern&&KS(e.includePattern,r),this.maxResults=e.maxResults||void 0,this.exists=e.exists,this.activeCancellationTokens=new Set,this.globalExcludePattern=e.excludePattern&&KS(e.excludePattern,r)}cancel(){this.isCanceled=!0,this.activeCancellationTokens.forEach(e=>e.cancel()),this.activeCancellationTokens=new Set}search(e){let t=this.config.folderQueries||[];return new Promise((n,r)=>{let i=t=>{this.resultCount++,e(t)};if(this.isCanceled)return n({limitHit:this.isLimitHit});this.config.extraFileResources&&this.config.extraFileResources.forEach(e=>{let t=e.toString(),n=Qr(t);this.globalExcludePattern&&this.globalExcludePattern(t,n)||this.matchFile(i,{base:e,basename:n})}),this.doSearch(t,i).then(e=>{n({limitHit:this.isLimitHit,stats:e||void 0})},e=>{r(Error(Pm(e)))})})}async doSearch(e,t){let n=new Hi,r=e.map(e=>this.getSearchOptionsForFolder(e)),i=this.provider instanceof FV?this.sessionLifecycle?.tokenSource.token:this.sessionLifecycle?.obj,a={folderOptions:r,maxResults:this.config.maxResults??2e4,session:i},o=new HV(e,e=>{let t=new dP(this.config,e);return{queryTester:t,noSiblingsClauses:!t.hasSiblingExcludeClauses(),folder:e.folder,tree:this.initDirectoryTree()}}),s;try{this.activeCancellationTokens.add(n),s=tr.create();let e=await this.provider.provideFileSearchResults(this.config.filePattern||``,a,n.token),r=s.elapsed(),i=tr.create();return this.isCanceled&&!this.isLimitHit||(e&&e.forEach(e=>{let n=o.findQueryFragmentAwareSubstr(e),r=Gr.relative(n.folder.path,e.path);if(n.noSiblingsClauses){let i=Qr(e.path);this.matchFile(t,{base:n.folder,relativePath:r,basename:i});return}this.addDirectoryEntries(n.tree,n.folder,r,t)}),this.isCanceled&&!this.isLimitHit)?null:(o.forEachFolderQueryInfo(e=>{this.matchDirectoryTree(e.tree,e.queryTester,t)}),{providerTime:r,postProcessTime:i.elapsed()})}finally{n.dispose(),this.activeCancellationTokens.delete(n)}}getSearchOptionsForFolder(e){let t=uP(this.config.includePattern,e.includePattern),n=e.excludePattern?.map(e=>({folder:e.folder,patterns:uP(this.config.excludePattern,e.pattern)}));n?.length||(n=[{folder:void 0,patterns:uP(this.config.excludePattern,void 0)}]);let r=gP(n);return{folder:e.folder,excludes:r,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks}}initDirectoryTree(){let e={rootEntries:[],pathToEntries:Object.create(null)};return e.pathToEntries[`.`]=e.rootEntries,e}addDirectoryEntries({pathToEntries:e},t,n,r){if(this.filePattern&&ma(n,this.filePattern,this.config.ignoreGlobCase)){let e=Qr(this.filePattern);this.matchFile(r,{base:t,relativePath:this.filePattern,basename:e})}function i(n){let r=Qr(n),a=Zr(n),o=e[a];o||(o=e[a]=[],i(a)),o.push({base:t,relativePath:n,basename:r})}i(n)}matchDirectoryTree({rootEntries:e,pathToEntries:t},n,r){let i=this,a=this.filePattern,o=this.config.ignoreGlobCase;function s(e){let c=mP(()=>e.map(e=>e.basename));for(let l=0,u=e.length;l<u;l++){let u=e[l],{relativePath:d,basename:f}=u;if(n.matchesExcludesSync(d,f,ma(a,f,o)?void 0:c))continue;let p=t[d];if(p)s(p);else{if(ma(d,a,o))continue;i.matchFile(r,u)}if(i.isLimitHit)break}}s(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))}},WV=class{constructor(){this._obj={},this.tokenSource=new Hi}get obj(){if(this._obj)return this._obj;throw Error(`Session object has been dereferenced.`)}cancel(){this.tokenSource.cancel(),this._obj=void 0}},GV=class e{constructor(){this.sessions=new Map}static{this.BATCH_SIZE=512}fileSearch(t,n,r,i){let a=new UV(t,n,this.getSessionTokenSource(t.cacheKey)),o=0;return this.doSearch(a,e.BATCH_SIZE,e=>{o+=e.length,r(e.map(e=>this.rawMatchToSearchItem(e)))},i).then(e=>({limitHit:e.limitHit,stats:e.stats?{fromCache:!1,type:`fileSearchProvider`,resultCount:o,detailStats:e.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 WV),this.sessions.get(e)}rawMatchToSearchItem(e){return e.relativePath?{resource:uo(e.base,e.relativePath)}:{resource:e.base}}doSearch(e,t,n,r){let i=r.onCancellationRequested(()=>{e.cancel()}),a=e=>{e&&(o.push(e),t>0&&o.length>=t&&(n(o),o=[]))},o=[];return e.search(a).then(e=>(o.length&&n(o),i.dispose(),e),e=>(o.length&&n(o),i.dispose(),Promise.reject(e)))}},KV=class{constructor(e,t,n){this.queryProviderPair=e,this.fileUtils=t,this.processType=n,this.collector=null,this.isLimitHit=!1,this.resultCount=0}get query(){return this.queryProviderPair.query}search(e,t,n){let r=this.query.folderQueries||[],i=new Hi(t);return new Promise((t,a)=>{this.collector=new JV(e);let o=!1;this.doSearch(r,(e,t)=>{if(!(e instanceof qN)&&!o&&!this.isLimitHit){let n=this.resultSize(e);e instanceof GN&&typeof this.query.maxResults==`number`&&this.resultCount+n>this.query.maxResults&&(this.isLimitHit=!0,o=!0,i.cancel(),e=this.trimResultToSize(e,this.query.maxResults-this.resultCount));let r=this.resultSize(e);this.resultCount+=r;let a=e instanceof GN;(r>0||!a)&&this.collector.add(e,t)}},i.token,n).then(e=>{i.dispose(),this.collector.flush(),t({limitHit:this.isLimitHit||e?.limitHit,messages:this.getMessagesFromResults(e),stats:{type:this.processType}})},e=>{i.dispose();let t=Pm(e);a(Error(t))})})}getMessagesFromResults(e){return e?.message?Array.isArray(e.message)?e.message:[e.message]:[]}resultSize(e){return e instanceof GN?Array.isArray(e.ranges)?e.ranges.length:1:0}trimResultToSize(e,t){return new GN(e.uri,e.ranges.slice(0,t),e.previewText)}async doSearch(e,t,n,r){let i=new HV(e,(e,t)=>({queryTester:new dP(this.query,e),folder:e.folder,folderIdx:t}),()=>!0),a=[],o={report:e=>{if(e instanceof qN)r?.(e);else{if(e.uri===void 0)throw Error(`Text search result URI is undefined. Please check provider implementation.`);let n=i.findQueryFragmentAwareSubstr(e.uri);if(n?.folder?.scheme){let r=n.folder.scheme===D.file?pP(()=>this.fileUtils.readdir(lo(e.uri))):void 0,i=fo(n.folder,e.uri);if(i){let o=n.queryTester.includedInQuery(i,Qr(i),r);vo(o)?a.push(o.then(r=>{r&&t(e,n.folderIdx)})):o&&t(e,n.folderIdx)}}}}},s={folderOptions:e.map(e=>this.getSearchOptionsForFolder(e)),maxFileSize:this.query.maxFileSize,maxResults:this.query.maxResults??2e4,previewOptions:this.query.previewOptions??_P,surroundingContext:this.query.surroundingContext??0};`usePCRE2`in this.query&&(s.usePCRE2=this.query.usePCRE2);let c;return c=this.queryProviderPair.query.type===ZN.aiText?await this.queryProviderPair.provider.provideAITextSearchResults(this.queryProviderPair.query.contentPattern,s,o,n):await this.queryProviderPair.provider.provideTextSearchResults(qV(this.queryProviderPair.query.contentPattern),s,o,n),a.length&&await Promise.all(a),c}getSearchOptionsForFolder(e){let t=uP(this.query.includePattern,e.includePattern),n=e.excludePattern?.map(e=>({folder:e.folder,patterns:uP(this.query.excludePattern,e.pattern)}));(!n||n.length===0)&&(n=[{folder:void 0,patterns:uP(this.query.excludePattern,void 0)}]);let r=gP(n);return{folder:C.from(e.folder),excludes:r,includes:t,useIgnoreFiles:{local:!e.disregardIgnoreFiles,parent:!e.disregardParentIgnoreFiles,global:!e.disregardGlobalIgnoreFiles},followSymlinks:!e.ignoreSymlinks,encoding:(e.fileEncoding&&this.fileUtils.toCanonicalName(e.fileEncoding))??``,ignoreGlobCase:this.query.ignoreGlobCase||e.ignoreGlobCase}}};function qV(e){return{isCaseSensitive:e.isCaseSensitive||!1,isRegExp:e.isRegExp||!1,isWordMatch:e.isWordMatch||!1,isMultiline:e.isMultiline||!1,pattern:e.pattern}}var JV=class{constructor(e){this._onResult=e,this._currentFolderIdx=-1,this._currentFileMatch=null,this._batchedCollector=new XV(512,e=>this.sendItems(e))}add(e,t){this._currentFileMatch&&(this._currentFolderIdx!==t||!ao(this._currentUri,e.uri))&&(this.pushToCollector(),this._currentFileMatch=null),this._currentFileMatch||=(this._currentFolderIdx=t,this._currentUri=e.uri,{resource:e.uri,results:[]}),this._currentFileMatch.results.push(YV(e))}pushToCollector(){let 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 YV(e){return e instanceof GN?{previewText:e.previewText,rangeLocations:e.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:e.text,lineNumber:e.lineNumber}}var XV=class e{static{this.TIMEOUT=4e3}static{this.START_BATCH_AFTER_COUNT=50}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<e.START_BATCH_AFTER_COUNT||this.batchSize>=this.maxBatchSize?this.flush():this.timeoutHandle||=setTimeout(()=>{this.flush()},e.TIMEOUT)}flush(){this.batchSize&&(this.totalNumberCompleted+=this.batchSize,this.cb(this.batch),this.batch=[],this.batchSize=0,this.timeoutHandle&&=(clearTimeout(this.timeoutHandle),void 0))}};const ZV=O(`IExtHostSearch`);let QV=class{constructor(e,t,n){this.extHostRpc=e,this._uriTransformer=t,this._logService=n,this._proxy=this.extHostRpc.getProxy(T.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 GV}_transformScheme(e){return this._uriTransformer.transformOutgoingScheme(e)}registerTextSearchProviderOld(e,t){if(this._textSearchUsedSchemes.has(e))throw Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);let n=this._handlePool++;return this._textSearchProvider.set(n,new zV(t)),this._proxy.$registerTextSearchProvider(n,this._transformScheme(e)),g(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerTextSearchProvider(e,t){if(this._textSearchUsedSchemes.has(e))throw Error(`a text search provider for the scheme '${e}' is already registered`);this._textSearchUsedSchemes.add(e);let n=this._handlePool++;return this._textSearchProvider.set(n,t),this._proxy.$registerTextSearchProvider(n,this._transformScheme(e)),g(()=>{this._textSearchUsedSchemes.delete(e),this._textSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerAITextSearchProvider(e,t){if(this._aiTextSearchUsedSchemes.has(e))throw Error(`an AI text search provider for the scheme '${e}'is already registered`);this._aiTextSearchUsedSchemes.add(e);let n=this._handlePool++;return this._aiTextSearchProvider.set(n,t),this._proxy.$registerAITextSearchProvider(n,this._transformScheme(e)),g(()=>{this._aiTextSearchUsedSchemes.delete(e),this._aiTextSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerFileSearchProviderOld(e,t){if(this._fileSearchUsedSchemes.has(e))throw Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);let n=this._handlePool++;return this._fileSearchProvider.set(n,new FV(t)),this._proxy.$registerFileSearchProvider(n,this._transformScheme(e)),g(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}registerFileSearchProvider(e,t){if(this._fileSearchUsedSchemes.has(e))throw Error(`a file search provider for the scheme '${e}' is already registered`);this._fileSearchUsedSchemes.add(e);let n=this._handlePool++;return this._fileSearchProvider.set(n,t),this._proxy.$registerFileSearchProvider(n,this._transformScheme(e)),g(()=>{this._fileSearchUsedSchemes.delete(e),this._fileSearchProvider.delete(n),this._proxy.$unregisterProvider(n)})}$provideFileSearchResults(e,t,n,r){let i=$V(n),a=this._fileSearchProvider.get(e);if(a)return this._fileSearchManager.fileSearch(i,a,n=>{this._proxy.$handleFileMatch(e,t,n.map(e=>e.resource))},r);throw Error(`unknown provider: `+e)}async doInternalFileSearchWithCustomCallback(e,t,n){return{messages:[]}}$clearCache(e){return this._fileSearchManager.clearCache(e),Promise.resolve(void 0)}$provideTextSearchResults(e,t,n,r){let i=this._textSearchProvider.get(e);if(!i||!i.provideTextSearchResults)throw Error(`Unknown Text Search Provider ${e}`);let a=$V(n);return this.createTextSearchManager(a,i).search(n=>this._proxy.$handleTextMatch(e,t,n),r)}$provideAITextSearchResults(e,t,n,r){let i=this._aiTextSearchProvider.get(e);if(!i||!i.provideAITextSearchResults)throw Error(`Unknown AI Text Search Provider ${e}`);let a=$V(n);return this.createAITextSearchManager(a,i).search(n=>this._proxy.$handleTextMatch(e,t,n),r,n=>this._proxy.$handleKeywordResult(e,t,n))}$enableExtensionHostSearch(){}async $getAIName(e){let t=this._aiTextSearchProvider.get(e);if(!(!t||!t.provideAITextSearchResults))return t.name??`AI`}createTextSearchManager(e,t){return new KV({query:e,provider:t},{readdir:e=>Promise.resolve([]),toCanonicalName:e=>e},`textSearchProvider`)}createAITextSearchManager(e,t){return new KV({query:e,provider:t},{readdir:e=>Promise.resolve([]),toCanonicalName:e=>e},`aiTextSearchProvider`)}};QV=k([A(0,Js),A(1,Xs),A(2,Ns)],QV);function $V(e){return{...e,folderQueries:e.folderQueries&&e.folderQueries.map(eH),extraFileResources:e.extraFileResources&&e.extraFileResources.map(e=>C.revive(e))}}function eH(e){return Ju(e)}let tH=class extends v{constructor(e){super(),this._onDidSuspend=this._register(new x),this.onDidSuspend=this._onDidSuspend.event,this._onDidResume=this._register(new x),this.onDidResume=this._onDidResume.event,this._onDidChangeOnBatteryPower=this._register(new x),this.onDidChangeOnBatteryPower=this._onDidChangeOnBatteryPower.event,this._onDidChangeThermalState=this._register(new x),this.onDidChangeThermalState=this._onDidChangeThermalState.event,this._onDidChangeSpeedLimit=this._register(new x),this.onDidChangeSpeedLimit=this._onDidChangeSpeedLimit.event,this._onWillShutdown=this._register(new x),this.onWillShutdown=this._onWillShutdown.event,this._onDidLockScreen=this._register(new x),this.onDidLockScreen=this._onDidLockScreen.event,this._onDidUnlockScreen=this._register(new x),this.onDidUnlockScreen=this._onDidUnlockScreen.event,this._proxy=e.getProxy(T.MainThreadPower)}$onDidSuspend(){this._onDidSuspend.fire()}$onDidResume(){this._onDidResume.fire()}$onDidChangeOnBatteryPower(e){this._onDidChangeOnBatteryPower.fire(e)}$onDidChangeThermalState(e){this._onDidChangeThermalState.fire(e)}$onDidChangeSpeedLimit(e){this._onDidChangeSpeedLimit.fire(e)}$onWillShutdown(){this._onWillShutdown.fire()}$onDidLockScreen(){this._onDidLockScreen.fire()}$onDidUnlockScreen(){this._onDidUnlockScreen.fire()}getSystemIdleState(e){return this._proxy.$getSystemIdleState(e)}getSystemIdleTime(){return this._proxy.$getSystemIdleTime()}getCurrentThermalState(){return this._proxy.$getCurrentThermalState()}isOnBatteryPower(){return this._proxy.$isOnBatteryPower()}async startPowerSaveBlocker(e){let t=await this._proxy.$startPowerSaveBlocker(e),n=this._proxy,r=t>=0,i=!1;return{id:t,get isStarted(){return r&&!i},dispose:()=>{r&&!i&&(i=!0,n.$stopPowerSaveBlocker(t))}}}};tH=k([A(0,Js)],tH);const nH=O(`IExtHostPower`),rH=O(`IExtHostTerminalShellIntegration`);let iH=class extends v{constructor(e,t){super(),this._extHostTerminalService=t,this._activeShellIntegrations=new Map,this._onDidChangeTerminalShellIntegration=this._register(new x),this.onDidChangeTerminalShellIntegration=this._onDidChangeTerminalShellIntegration.event,this._onDidStartTerminalShellExecution=this._register(new x),this.onDidStartTerminalShellExecution=this._onDidStartTerminalShellExecution.event,this._onDidEndTerminalShellExecution=this._register(new x),this.onDidEndTerminalShellExecution=this._onDidEndTerminalShellExecution.event,this._proxy=e.getProxy(T.MainThreadTerminalShellIntegration),this._register(g(()=>{for(let[e,t]of this._activeShellIntegrations)t.dispose();this._activeShellIntegrations.clear()}))}$shellIntegrationChange(e,t){let n=this._extHostTerminalService.getTerminalById(e);if(!n)return;let r=n.value,i=this._activeShellIntegrations.get(e);i||(i=new aH(n.value,t,this._onDidStartTerminalShellExecution),this._activeShellIntegrations.set(e,i),i.store.add(n.onWillDispose(()=>this._activeShellIntegrations.get(e)?.dispose())),i.store.add(i.onDidRequestShellExecution(t=>this._proxy.$executeCommand(e,t))),i.store.add(i.onDidRequestEndExecution(e=>this._onDidEndTerminalShellExecution.fire(e))),i.store.add(i.onDidRequestChangeShellIntegration(e=>this._onDidChangeTerminalShellIntegration.fire(e))),n.shellIntegration=i.value),this._onDidChangeTerminalShellIntegration.fire({terminal:r,shellIntegration:i.value})}$shellExecutionStart(e,t,n,r,i,a){this._activeShellIntegrations.has(e)||this.$shellIntegrationChange(e,t);let o={value:n,confidence:r,isTrusted:i};this._activeShellIntegrations.get(e)?.startShellExecution(o,this._convertCwdToUri(a))}$shellExecutionEnd(e,t,n,r,i){let a={value:t,confidence:n,isTrusted:r};this._activeShellIntegrations.get(e)?.endShellExecution(a,i)}$shellExecutionData(e,t){this._activeShellIntegrations.get(e)?.emitData(t)}$shellEnvChange(e,t,n,r){this._activeShellIntegrations.get(e)?.setEnv(t,n,r)}$cwdChange(e,t){this._activeShellIntegrations.get(e)?.setCwd(this._convertCwdToUri(t))}$closeTerminal(e){this._activeShellIntegrations.get(e)?.dispose(),this._activeShellIntegrations.delete(e)}_convertCwdToUri(e){return e?C.file(e):void 0}};iH=k([A(0,Js),A(1,qI)],iH);var aH=class extends v{get currentExecution(){return this._currentExecution}constructor(e,t,n){super(),this._terminal=e,this._onDidStartTerminalShellExecution=n,this._pendingExecutions=[],this.store=this._register(new _),this._onDidRequestChangeShellIntegration=this._register(new x),this.onDidRequestChangeShellIntegration=this._onDidRequestChangeShellIntegration.event,this._onDidRequestShellExecution=this._register(new x),this.onDidRequestShellExecution=this._onDidRequestShellExecution.event,this._onDidRequestEndExecution=this._register(new x),this.onDidRequestEndExecution=this._onDidRequestEndExecution.event,this._onDidRequestNewExecution=this._register(new x),this.onDidRequestNewExecution=this._onDidRequestNewExecution.event;let r=this;this.value={get cwd(){return r._cwd},get env(){if(r._env)return Object.freeze({isTrusted:r._env.isTrusted,value:Object.freeze({...r._env.value})})},executeCommand(e,n){if(!t)throw Error(`This terminal does not support the executeCommand API.`);let i=e;if(n)for(let e of n)!e.match(/["'`]/)&&e.match(/\s/)?i+=` "${e}"`:i+=` ${e}`;r._onDidRequestShellExecution.fire(i);let a={value:i,confidence:ZE.High,isTrusted:!0};return r.requestNewShellExecution(a,r._cwd).value}}}requestNewShellExecution(e,t){let n=new oH(e,t??this._cwd);return cH(e.value).length>1&&(this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:cH(e.value)}),this._pendingExecutions.push(n),this._onDidRequestNewExecution.fire(e.value),n}startShellExecution(e,t){if(this._pendingEndingExecution&&=(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:this._pendingEndingExecution.value,exitCode:void 0}),void 0),this._currentExecution){if(this._currentExecutionProperties?.isMultiLine&&this._currentExecutionProperties.unresolvedCommandLines){let t=lH(this._currentExecutionProperties.unresolvedCommandLines,e);if(t){this._currentExecutionProperties.unresolvedCommandLines=t.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 n;if(e.confidence===ZE.High)for(let[t,r]of this._pendingExecutions.entries())if(r.value.commandLine.value===e.value){n=r,this._currentExecutionProperties={isMultiLine:!1,unresolvedCommandLines:void 0},n=r,this._pendingExecutions.splice(t,1);break}else{let i=lH(cH(r.value.commandLine.value),e);if(i){this._currentExecutionProperties={isMultiLine:!0,unresolvedCommandLines:i.unresolvedCommandLines},n=r,this._pendingExecutions.splice(t,1);break}}else n=this._pendingExecutions.shift();n||=new oH(e,t??this._cwd),this._currentExecution=n,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){let n=this._currentExecutionProperties?.isMultiLine?this._currentExecution.value.commandLine:e;this._currentExecution.endExecution(n);let r=this._currentExecution;this._pendingEndingExecution=r,this._currentExecution=void 0,r.flush().then(()=>{this._pendingEndingExecution===r&&(this._onDidRequestEndExecution.fire({terminal:this._terminal,shellIntegration:this.value,execution:r.value,exitCode:t}),this._pendingEndingExecution=void 0)})}}setEnv(e,t,n){let r={};for(let n=0;n<e.length;n++)r[e[n]]=t[n];this._env={value:r,isTrusted:n},this._fireChangeEvent()}setCwd(e){let t=!1;C.isUri(this._cwd)?t=!C.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})}},oH=class{constructor(e,t){this._commandLine=e,this.cwd=t,this._isEnded=!1;let n=this;this.value={get commandLine(){return n._commandLine},get cwd(){return n.cwd},read(){return n._createDataStream()}}}_createDataStream(){if(!this._dataStream){if(this._isEnded)return qo.EMPTY;this._dataStream=new sH}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(),void 0)}},sH=class extends v{constructor(){super(...arguments),this._iterables=[],this._emitters=[]}createIterable(){this._barrier||=new jo;let e=this._barrier,t=new qo(async t=>{this._emitters.push(t),await e.wait()});return this._iterables.push(t),t}emitData(e){for(let t of this._emitters)t.emitOne(e)}endExecution(){this._barrier?.open()}async flush(){await Promise.all(this._iterables.map(e=>e.toPromise()))}};function cH(e){return e.split(`
|
|
104
|
+
`).map(e=>e.trim()).filter(e=>e.length>0)}function lH(e,t){if(e.length===0)return!1;let n=[...e],r=cH(t.value);if(n&&n.length>0){for(;n.length>0&&n[0]===r[0];)n.shift(),r.shift();if(r.length===0)return{unresolvedCommandLines:n}}return!1}var uH;(function(e){e[e.CR=13]=`CR`,e[e.LF=10]=`LF`,e[e.COLON=58]=`COLON`,e[e.SPACE=32]=`SPACE`})(uH||={});var dH=class{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]===uH.LF&&t++,this.endedOnCR=!1;t<e.length;){let n=e.indexOf(uH.CR,t),r=e.indexOf(uH.LF,t),i=n===-1?r:r===-1?n:Math.min(n,r);if(i===-1)break;let a=``;for(let e of this.buffer)a+=this.decoder.decode(e,{stream:!0});a+=this.decoder.decode(e.subarray(t,i)),this.processLine(a),this.buffer.length=0,t=i+(e[i]===uH.CR&&e[i+1]===uH.LF?2:1)}t<e.length?this.buffer.push(e.subarray(t)):this.endedOnCR=e[e.length-1]===uH.CR}processLine(e){if(!e.length){this.dispatchEvent();return}if(e.startsWith(`:`))return;let t,n,r=e.indexOf(`:`);r===-1?(t=e,n=``):(t=e.substring(0,r),n=e.substring(r+1),n.startsWith(` `)&&(n=n.substring(1))),this.processField(t,n)}processField(e,t){switch(e){case`event`:this.eventTypeBuffer=t;break;case`data`:this.dataBuffer+=t,this.dataBuffer+=`
|
|
105
|
+
`;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(`
|
|
106
|
+
`)&&(this.dataBuffer=this.dataBuffer.substring(0,this.dataBuffer.length-1));let 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}},fH=class{validateOrThrow(e){let t=this.validate(e);if(t.error)throw Error(t.error.message);return t.content}},pH=class extends fH{constructor(e){super(),this.type=e}validate(e){return typeof e===this.type?{content:e,error:void 0}:{content:void 0,error:{message:`Expected ${this.type}, but got ${typeof e}`}}}getJSONSchema(){return{type:this.type}}};const mH=new pH(`string`);function hH(){return mH}const gH=new pH(`number`);function _H(){return gH}new pH(`boolean`);const vH=new pH(`object`);function yH(){return vH}var bH=class{constructor(e){this.validator=e}};function xH(e){return new bH(e)}var SH=class extends fH{constructor(e){super(),this.properties=e}validate(e){if(typeof e!=`object`||!e)return{content:void 0,error:{message:`Expected object`}};let t={};for(let n in this.properties){let r=this.properties[n],i=e[n],a=r instanceof bH,o=a?r.validator:r;if(a&&i===void 0)continue;let{content:s,error:c}=o.validate(i);if(c)return{content:void 0,error:{message:`Error in property '${n}': ${c.message}`}};t[n]=s}return{content:t,error:void 0}}getJSONSchema(){let e=[],t={};for(let[n,r]of Object.entries(this.properties)){let i=r instanceof bH;t[n]=(i?r.validator:r).getJSONSchema(),i||e.push(n)}return{type:`object`,properties:t,...e.length>0?{required:e}:{}}}};function CH(e){return new SH(e)}var wH=class extends fH{constructor(e){super(),this.validator=e}validate(e){if(!Array.isArray(e))return{content:void 0,error:{message:`Expected array`}};let t=[];for(let n=0;n<e.length;n++){let{content:r,error:i}=this.validator.validate(e[n]);if(i)return{content:void 0,error:{message:`Error in element ${n}: ${i.message}`}};t.push(r)}return{content:t,error:void 0}}getJSONSchema(){return{type:`array`,items:this.validator.getJSONSchema()}}};function TH(e){return new wH(e)}const EH=O(`IExtHostMpcService`),DH=CH({label:hH(),version:xH(hH()),metadata:xH(CH({capabilities:xH(yH()),serverInfo:xH(yH()),tools:xH(TH(CH({availability:_H(),definition:yH()})))})),authentication:xH(CH({providerId:hH(),scopes:TH(hH())}))});let OH=class extends v{constructor(e,t,n,r,i){super(),this._logService=t,this._extHostInitData=n,this._workspaceService=r,this._variableResolver=i,this._initialProviderPromises=new Set,this._sseEventSources=this._register(new Tt),this._unresolvedMcpServers=new Map,this._onDidChangeMcpServerDefinitions=this._register(new x),this.onDidChangeMcpServerDefinitions=this._onDidChangeMcpServerDefinitions.event,this._mcpServerDefinitions=[],this._activeGateways=new Map,this._proxy=e.getProxy(T.MainThreadMcp)}get mcpServerDefinitions(){return this._mcpServerDefinitions}$onDidChangeMcpServerDefinitions(e){this._mcpServerDefinitions=e.map(e=>BN.to(e)),this._onDidChangeMcpServerDefinitions.fire()}$startMcp(e,t){this._startMcp(e,dS.fromSerialized(t.launch),t.defaultCwd&&C.revive(t.defaultCwd),t.errorOnUserInteraction)}_startMcp(e,t,n,r){if(t.type===uS.HTTP){this._sseEventSources.set(e,new MH(e,t,this._proxy,this._logService,r));return}throw Error(`not implemented`)}async $substituteVariables(e,t){let n=C.revive(e),r=n&&await this._workspaceService.resolveWorkspaceFolder(n);return(await this._variableResolver.getResolver()).resolveAsync(r&&{uri:r.uri,name:r.name,index:r.index},t)}$stopMcp(e){this._sseEventSources.get(e)?.close().then(()=>this._didClose(e))}_didClose(e){this._sseEventSources.deleteAndDispose(e)}$sendMessage(e,t){this._sseEventSources.get(e)?.send(t)}async $waitForInitialCollectionProviders(){await Promise.all(this._initialProviderPromises)}async $resolveMcpLaunch(e,t){let n=this._unresolvedMcpServers.get(e);if(!n)return;let r=n.servers.find(e=>e.label===t);if(!r)return;if(!n.provider.resolveMcpServerDefinition)return BN.from(r);let i=await n.provider.resolveMcpServerDefinition(r,Bi.None);return i?BN.from(i):void 0}registerMcpConfigurationProvider(e,t,n){let r=new _,i=e.contributes?.mcpServerDefinitionProviders?.find(e=>e.id===t);if(!i)throw Error(`MCP configuration providers must be registered in the contributes.mcpServerDefinitionProviders array within your package.json, but "${t}" was not`);let a={id:$x(e.identifier,t),isTrustedByDefault:!0,label:i?.label??e.displayName??e.name,scope:r_.WORKSPACE,canResolveLaunch:typeof n.resolveMcpServerDefinition==`function`,extensionId:e.identifier.value,configTarget:this._extHostInitData.remote.isRemote?Zh.USER_REMOTE:Zh.USER},o=async()=>{let t=await n.provideMcpServerDefinitions(Bi.None);this._unresolvedMcpServers.set(a.id,{servers:t??[],provider:n});let r=[];for(let n of t??[]){let t=Ts.toKey(e.identifier)+`/`+n.label;if(r.some(e=>e.id===t)){let e=2;for(;r.some(n=>n.id===t+e);)e++;t+=e}DH.validateOrThrow(n),n.authentication&&K(e,`mcpToolDefinitions`);let i,a=n;Mw(e)&&a.metadata&&(i={capabilities:a.metadata.capabilities,instructions:a.metadata.instructions,serverInfo:a.metadata.serverInfo,tools:a.metadata.tools?.map(e=>({availability:e.availability===oj.Dynamic?nS.Dynamic:nS.Initial,definition:e.definition}))}),r.push({id:t,label:n.label,cacheNonce:n.version||`$$NONE`,staticMetadata:i,launch:BN.from(n)})}this._proxy.$upsertMcpCollection(a,r)};r.add(g(()=>{this._unresolvedMcpServers.delete(a.id),this._proxy.$deleteMcpCollection(a.id)})),n.onDidChangeMcpServerDefinitions&&r.add(n.onDidChangeMcpServerDefinitions(o)),n.onDidChangeServerDefinitions&&r.add(n.onDidChangeServerDefinitions(o)),n.onDidChange&&r.add(n.onDidChange(o));let s=new Promise(e=>{setTimeout(()=>o().finally(()=>{this._initialProviderPromises.delete(s),e()}),0)});return this._initialProviderPromises.add(s),r}async startMcpGateway(e){let t=await this._proxy.$startMcpGateway(e?.toJSON());if(!t)return;let n=t.gatewayId,r=t.servers.map(e=>({label:e.label,address:C.revive(e.address)})),i=new x;return this._activeGateways.set(n,{servers:r,onDidChangeServers:i}),{get servers(){return r},onDidChangeServers:i.event,dispose:()=>{this._activeGateways.delete(n),i.dispose(),this._proxy.$disposeMcpGateway(n)}}}$onDidChangeGatewayServers(e,t){let n=this._activeGateways.get(e);if(!n)return;let r=t.map(e=>({label:e.label,address:C.revive(e.address)}));n.servers.length=0,n.servers.push(...r),n.onDidChangeServers.fire(r)}};OH=k([A(0,Js),A(1,Ns),A(2,Vs),A(3,eF),A(4,CV)],OH);function kH(e){if(!(e instanceof Error))return String(e);let t=String(e),n=e.cause;for(let e=0;n!==void 0&&e<5;e++)t+=`: ${n instanceof Error&&n.message||String(n)}`,n=n instanceof Error?n.cause:void 0;return t}var AH;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Http=1]=`Http`,e[e.SSE=2]=`SSE`})(AH||={});const jH=[301,302,303,307,308];var MH=class extends v{constructor(e,t,n,r,i){super(),this._id=e,this._launch=t,this._proxy=n,this._logService=r,this._errorOnUserInteraction=i,this._requestSequencer=new To,this._postEndpoint=new Wo,this._mode={value:AH.Unknown},this._cts=new Hi,this._abortCtrl=new AbortController,this._didSendClose=!1,this._register(g(()=>{this._abortCtrl.abort(),this._cts.dispose(!0)})),this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Running})}async send(e){try{this._mode.value===AH.Unknown?await this._requestSequencer.queue(()=>this._send(e)):await this._send(e)}catch(e){let t=`Error sending message to ${this._launch.uri}: ${kH(e)}`;this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Error,message:t})}}async close(){if(this._mode.value===AH.Http&&this._mode.sessionId&&!this._didSendClose){this._didSendClose=!0;try{await this._closeSession(this._mode.sessionId)}catch{}}this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Stopped})}async _closeSession(e){let t={...Object.fromEntries(this._launch.headers),"Mcp-Session-Id":e};try{await this._addAuthHeader(t,{errorOnUserInteraction:!0})}catch{this._log(H.Debug,`Skipping session close: authentication no longer available`);return}await this._fetch(this._launch.uri.toString(!0),{method:`DELETE`,headers:t})}_send(e){return this._mode.value===AH.SSE?this._sendLegacySSE(this._mode.endpoint,e):this._sendStreamableHttp(e,this._mode.value===AH.Http?this._mode.sessionId:void 0)}async _sendStreamableHttp(e,t){let n=new TextEncoder().encode(e),r={...Object.fromEntries(this._launch.headers),"Content-Type":`application/json`,Accept:`text/event-stream, application/json`};t&&(r[`Mcp-Session-Id`]=t),await this._addAuthHeader(r);let i=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:`POST`,headers:r,body:n},r),a=this._mode.value===AH.Unknown,o=i.headers.get(`Mcp-Session-Id`);if(o&&(this._mode={value:AH.Http,sessionId:o}),this._mode.value===AH.Unknown&&i.status>=400&&i.status<500&&!PH(i.status)){this._log(H.Info,`${i.status} status sending message to ${this._launch.uri}, will attempt to fall back to legacy SSE`),this._sseFallbackWithMessage(e);return}if(i.status>=300){let e=this._mode.value===AH.Http&&!!this._mode.sessionId&&(i.status===400||i.status===404);this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Error,message:`${i.status} status sending message to ${this._launch.uri}: ${await this._getErrText(i)}`+(e?`; will retry with new session ID`:``),shouldRetry:e});return}this._mode.value===AH.Unknown&&(this._mode={value:AH.Http,sessionId:void 0}),a&&this._attachStreamableBackchannel(),await this._handleSuccessfulStreamableHttp(i,e)}async _sseFallbackWithMessage(e){let t=await this._attachSSE();t&&(this._mode={value:AH.SSE,endpoint:t},await this._sendLegacySSE(t,e))}async _handleSuccessfulStreamableHttp(e,t){if(e.status===202)return;let n=e.headers.get(`Content-Type`)?.toLowerCase()||``;if(n.startsWith(`text/event-stream`)){let n=new dH(e=>{if(e.type===`message`)this._proxy.$onDidReceiveMessage(this._id,e.data);else if(e.type===`endpoint`)throw this._log(H.Warning,`Received SSE endpoint from a POST to ${this._launch.uri}, will fall back to legacy SSE`),this._sseFallbackWithMessage(t),new ie});try{await this._doSSE(n,e)}catch(e){this._log(H.Warning,`Error reading SSE stream: ${kH(e)}`)}}else if(n.startsWith(`application/json`))this._proxy.$onDidReceiveMessage(this._id,await e.text());else{let t=await e.text();NH(t)?this._proxy.$onDidReceiveMessage(this._id,t):this._log(H.Warning,`Unexpected ${e.status} response for request: ${t}`)}}async _attachStreamableBackchannel(){let e,t;for(let n=0;!this._store.isDisposed;n++){t===void 0?await Mo(Math.min(n*1e3,3e4),this._cts.token):(await Mo(Math.max(0,t-Date.now()),this._cts.token),t=void 0);let r;try{let t={...Object.fromEntries(this._launch.headers),Accept:`text/event-stream`};await this._addAuthHeader(t),this._mode.value===AH.Http&&this._mode.sessionId!==void 0&&(t[`Mcp-Session-Id`]=this._mode.sessionId),e&&(t[`Last-Event-ID`]=e),r=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:`GET`,headers:t},t)}catch{this._log(H.Info,`Error connecting to ${this._launch.uri} for async notifications, will retry`);continue}if(r.status>=400){this._log(H.Debug,`${r.status} status connecting to ${this._launch.uri} for async notifications; they will be disabled: ${await this._getErrText(r)}`);return}r.headers.get(`content-type`)?.toLowerCase().includes(`text/event-stream`)&&(n=0);let i=new dH(n=>{n.retry&&(t=Date.now()+n.retry),n.type===`message`&&n.data&&this._proxy.$onDidReceiveMessage(this._id,n.data),n.id&&(e=n.id)});try{await this._doSSE(i,r)}catch(e){this._log(H.Info,`Error reading from async stream, we will reconnect: ${e}`)}}}async _attachSSE(){let e=new Wo,t={...Object.fromEntries(this._launch.headers),Accept:`text/event-stream`};await this._addAuthHeader(t);let n;try{if(n=await this._fetchWithAuthRetry(this._launch.uri.toString(!0),{method:`GET`,headers:t},t),n.status>=300){this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Error,message:`${n.status} status connecting to ${this._launch.uri} as SSE: ${await this._getErrText(n)}`});return}}catch(e){this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Error,message:`Error connecting to ${this._launch.uri} as SSE: ${e}`});return}let r=new dH(t=>{t.type===`message`?this._proxy.$onDidReceiveMessage(this._id,t.data):t.type===`endpoint`&&e.complete(new URL(t.data,this._launch.uri.toString(!0)).toString())});return this._register(g(()=>e.cancel())),this._doSSE(r,n).catch(e=>{this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Error,message:`Error reading SSE stream: ${kH(e)}`})}),e.p}async _sendLegacySSE(e,t){let n=new TextEncoder().encode(t),r={...Object.fromEntries(this._launch.headers),"Content-Type":`application/json`};await this._addAuthHeader(r);let i=await this._fetch(e,{method:`POST`,headers:r,body:n});i.status>=300&&this._log(H.Warning,`${i.status} status sending message to ${this._postEndpoint}: ${await this._getErrText(i)}`)}async _doSSE(e,t){if(!t.body)return;let n=t.body.getReader(),r;do{try{r=await xo(n.read(),this._cts.token)}catch(e){if(n.cancel(),this._store.isDisposed)return;throw e}r.value&&e.feed(r.value)}while(!r.done)}async _addAuthHeader(e,t){let n=t?.errorOnUserInteraction??this._errorOnUserInteraction;if(this._authMetadata)try{let r={authorizationServer:this._authMetadata.authorizationServer.toJSON(),authorizationServerMetadata:this._authMetadata.serverMetadata,resourceMetadata:this._authMetadata.resourceMetadata,scopes:this._authMetadata.scopes,clientId:this._launch.oauth?.clientId,enterpriseManaged:this._launch.oauth?.enterpriseManaged},i=await this._proxy.$getTokenFromServerMetadata(this._id,r,{errorOnUserInteraction:n,forceNewRegistration:t?.forceNewRegistration});i&&(e.Authorization=`Bearer ${i}`)}catch(e){if(pS.is(e))throw this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Stopped,reason:`needs-user-interaction`}),new ie;this._log(H.Warning,`Error getting token from server metadata: ${String(e)}`)}if(this._launch.authentication)try{this._log(H.Debug,`Using provided authentication config: providerId=${this._launch.authentication.providerId}, scopes=${this._launch.authentication.scopes.join(`, `)}`);let r=await this._proxy.$getTokenForProviderId(this._id,this._launch.authentication.providerId,this._launch.authentication.scopes,{errorOnUserInteraction:n,forceNewRegistration:t?.forceNewRegistration,clientId:this._launch.oauth?.clientId});r&&(e.Authorization=`Bearer ${r}`,this._log(H.Info,`Successfully obtained token from provided authentication config`))}catch(e){if(pS.is(e))throw this._proxy.$onDidChangeState(this._id,{state:fS.Kind.Stopped,reason:`needs-user-interaction`}),new ie;this._log(H.Warning,`Error getting token from provided authentication config: ${String(e)}`)}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,n){let r=()=>this._fetch(e,t),i=await r();if(PH(i.status)&&(this._authMetadata?this._authMetadata.update(i.headers)&&(await this._addAuthHeader(n),n.Authorization&&(t.headers=n,i=await r())):(this._authMetadata=await IH(e,i.headers,{sameOriginHeaders:{...Object.fromEntries(this._launch.headers),"MCP-Protocol-Version":Zx.LATEST_PROTOCOL_VERSION},fetch:(e,t)=>this._fetch(e,t),log:(e,t)=>this._log(e,t)}),this._proxy.$logMcpAuthSetup(this._authMetadata.telemetry),await this._addAuthHeader(n),n.Authorization&&(t.headers=n,i=await r()))),n.Authorization&&PH(i.status)){let e=await this._getErrText(i);this._log(H.Info,`Received ${i.status} status with Authorization header, retrying with new auth registration. Error details: ${e||`no additional details`}`),await this._addAuthHeader(n,{forceNewRegistration:!0}),i=await r()}return i}async _fetch(e,t){if(t.headers[`user-agent`]=`${Dh.nameLong}/${Dh.version}`,Hh(this._logService.getLevel(),H.Trace)){let n={...t,headers:{...t.headers}};n.body&&=new TextDecoder().decode(n.body),n.headers?.Authorization&&(n.headers.Authorization=`***`),this._log(H.Trace,`Fetching ${e} with options: ${JSON.stringify(n)}`)}let n=e,r;for(let e=0;e<5&&(r=await this._fetchInternal(n,{...t,signal:this._abortCtrl.signal,redirect:`manual`}),jH.includes(r.status));e++){let e=r.headers.get(`location`);if(!e)break;let i=new URL(e,n).toString();this._log(H.Trace,`Redirect (${r.status}) from ${n} to ${i}`),n=i,(r.status===303||(r.status===301||r.status===302)&&t.method===`POST`)&&(t.method=`GET`,delete t.body)}if(Hh(this._logService.getLevel(),H.Trace)){let e={};r.headers.forEach((t,n)=>{e[n]=t}),this._log(H.Trace,`Fetched ${n}: ${JSON.stringify({status:r.status,headers:e})}`)}return r}_fetchInternal(e,t){return fetch(e,t)}};function NH(e){try{return JSON.parse(e),!0}catch{return!1}}function PH(e){return e===401||e===403}var FH=class{constructor(e,t,n,r,i,a){this.authorizationServer=e,this.serverMetadata=t,this.resourceMetadata=n,this.telemetry=i,this._log=a,this._scopes=r}get scopes(){return this._scopes}update(e){let t=this._parseScopesFromResponse(e);return EL(t,this._scopes)?!1:(this._log(H.Info,`Scopes changed from ${JSON.stringify(this._scopes)} to ${JSON.stringify(t)}, updating`),this._scopes=t,!0)}_parseScopesFromResponse(e){let t=e.get(`WWW-Authenticate`);if(!t)return;let n=wL(t);for(let e of n)if(e.scheme===`Bearer`&&e.params.scope){let t=e.params.scope.split(` `).filter(e=>e.trim().length);if(t.length)return this._log(H.Info,`Found scope challenge in WWW-Authenticate header: ${e.params.scope}`),t}}};async function IH(e,t,n){let{sameOriginHeaders:r,fetch:i,log:a}=n,o=Fi.None,s,{resourceMetadataChallenge:c,scopesChallenge:l}=LH(t.get(`WWW-Authenticate`)??void 0,a),u,d,f=l;try{let{metadata:t,discoveryUrl:n,errors:l}=await DL(e,c,{sameOriginHeaders:r,fetch:(e,t)=>i(e,t)});for(let e of l)a(H.Warning,`Error fetching resource metadata: ${e}`);a(H.Info,`Discovered resource metadata at ${n}`),o=c?Fi.Header:Fi.WellKnown,u=t.authorization_servers?.[0],u?(a(H.Info,`Using auth server metadata url: ${u}`),s=Ii.ResourceMetadata):a(H.Warning,`No authorization_servers found in resource metadata ${n} - Is this resource metadata configured correctly?`),f??=t.scopes_supported,d=t}catch(e){a(H.Warning,`Could not fetch resource metadata: ${String(e)}`)}let p=new URL(e).origin,m={};u||(u=p,r&&(m=r));try{a(H.Debug,`Fetching auth server metadata for: ${u} ...`);let{metadata:e,discoveryUrl:t,errors:n}=await AL(u,{additionalHeaders:m,fetch:(e,t)=>i(e,t)});for(let e of n)a(H.Warning,`Error fetching authorization server metadata: ${e}`);return a(H.Info,`Discovered authorization server metadata at ${t}`),s??=Ii.WellKnown,new FH(C.parse(u),e,d,f,{resourceMetadataSource:o,serverMetadataSource:s},a)}catch(e){a(H.Warning,`Error populating auth server metadata for ${u}: ${String(e)}`)}let ee=xL(new URL(p));return a(H.Info,`Using default auth metadata`),new FH(C.parse(p),ee,d,f,{resourceMetadataSource:o,serverMetadataSource:Ii.Default},a)}function LH(e,t){if(!e)return{};let n,r,i=wL(e);for(let e of i)if(e.scheme===`Bearer`){if(!n&&e.params.resource_metadata&&(n=e.params.resource_metadata,t(H.Debug,`Found resource_metadata challenge in WWW-Authenticate header: ${n}`)),!r&&e.params.scope){let n=e.params.scope.split(` `).filter(e=>e.trim().length);n.length&&(t(H.Debug,`Found scope challenge in WWW-Authenticate header: ${e.params.scope}`),r=n)}if(n&&r)break}return{resourceMetadataChallenge:n,scopesChallenge:r}}const RH=O(`IExtHostDataChannels`);var zH=class{constructor(){this._channels=new Map}createDataChannel(e,t){K(e,`dataChannels`);let n=this._channels.get(t);return n||(n=new BH(t),this._channels.set(t,n)),n}$onDidReceiveData(e,t){let n=this._channels.get(e);n&&n._fireDidReceiveData(t)}},BH=class extends v{constructor(e){super(),this.channelId=e,this._onDidReceiveData=new x,this.onDidReceiveData=this._onDidReceiveData.event,this._register(this._onDidReceiveData)}_fireDidReceiveData(e){this._onDidReceiveData.fire({data:e})}toString(){return`DataChannel(${this.channelId})`}};const VH=O(`IExtHostMeteredConnection`);var HH=class extends v{constructor(){super(),this._isConnectionMetered=!1,this._onDidChangeIsConnectionMetered=this._register(new x),this.onDidChangeIsConnectionMetered=this._onDidChangeIsConnectionMetered.event}get isConnectionMetered(){return this._isConnectionMetered}$initializeIsConnectionMetered(e){this._isConnectionMetered=e}$onDidChangeIsConnectionMetered(e){this._isConnectionMetered!==e&&(this._isConnectionMetered=e,this._onDidChangeIsConnectionMetered.fire(e))}},UH;const WH=`vscode.git`;function GH(e){switch(e){case XH.Head:return Ri.Head;case XH.RemoteHead:return Ri.RemoteHead;case XH.Tag:return Ri.Tag;default:throw Error(`Unknown GitRefType: ${e}`)}}function KH(e){return{name:e.name,commit:e.commit,type:GH(e.type),remote:e.remote,upstream:e.upstream?qH(e.upstream):void 0,ahead:e.ahead,behind:e.behind}}function qH(e){return{remote:e.remote,name:e.name,commit:e.commit}}var JH;(function(e){e[e.INDEX_ADDED=1]=`INDEX_ADDED`,e[e.INDEX_DELETED=2]=`INDEX_DELETED`,e[e.INDEX_RENAMED=3]=`INDEX_RENAMED`,e[e.MODIFIED=5]=`MODIFIED`,e[e.DELETED=6]=`DELETED`,e[e.UNTRACKED=7]=`UNTRACKED`,e[e.INTENT_TO_ADD=9]=`INTENT_TO_ADD`,e[e.INTENT_TO_RENAME=10]=`INTENT_TO_RENAME`})(JH||={});function YH(e){switch(e.status){case JH.INDEX_ADDED:case JH.UNTRACKED:case JH.INTENT_TO_ADD:return{uri:e.uri,originalUri:void 0,modifiedUri:e.uri};case JH.INDEX_DELETED:case JH.DELETED:return{uri:e.uri,originalUri:e.uri,modifiedUri:void 0};case JH.INDEX_RENAMED:case JH.INTENT_TO_RENAME:return{uri:e.uri,originalUri:e.originalUri,modifiedUri:e.renameUri};default:return{uri:e.uri,originalUri:e.originalUri,modifiedUri:e.uri}}}var XH;(function(e){e[e.Head=0]=`Head`,e[e.RemoteHead=1]=`RemoteHead`,e[e.Tag=2]=`Tag`})(XH||={});const ZH=O(`IExtHostGitExtensionService`);let QH=class extends v{static{UH=this}static{this._handlePool=0}constructor(e,t){super(),this._extHostExtensionService=t,this._repositories=new Map,this._repositoryByUri=new He,this._repositoryStateChangeListeners=new Tt,this._proxy=e.getProxy(T.MainThreadGitExtension)}async $isGitExtensionAvailable(){return!!(await this._extHostExtensionService.getExtensionRegistry()).getExtensionDescription(WH)}async $openRepository(e){let t=await this._ensureGitApi();if(!t)return;let n=await t.openRepository(C.revive(e));if(!n)return;let r=this._repositoryByUri.get(n.rootUri);if(r!==void 0){this._repositories.get(r)!==n&&(this._repositories.set(r,n),this._repositoryByUri.set(n.rootUri,r),this._setRepositoryStateChangeListener(r,n));let e=this._getRepositoryState(n);return{handle:r,rootUri:n.rootUri,state:e}}let i=UH._handlePool++;this._repositories.set(i,n),this._repositoryByUri.set(n.rootUri,i),this._setRepositoryStateChangeListener(i,n);let a=this._getRepositoryState(n);return{handle:i,rootUri:n.rootUri,state:a}}async $getRefs(e,t,n){let r=this._repositories.get(e);if(!r)return[];try{return(await r.getRefs(t,n)).map(e=>{if(!(!e.name||!e.commit))return{id:e.type===XH.Head?`refs/heads/${e.name}`:e.type===XH.RemoteHead?`refs/remotes/${e.remote}/${e.name}`:`refs/tags/${e.name}`,name:e.name,type:GH(e.type),revision:e.commit}}).filter(e=>!!e)}catch{return[]}}async $getRepositoryState(e){let t=this._repositories.get(e);if(t)return this._getRepositoryState(t)}_getRepositoryState(e){let t=e.state;return{HEAD:t.HEAD?KH(t.HEAD):void 0,remotes:t.remotes,mergeChanges:t.mergeChanges.map(YH),indexChanges:t.indexChanges.map(YH),workingTreeChanges:t.workingTreeChanges.map(YH),untrackedChanges:t.untrackedChanges.map(YH)}}_setRepositoryStateChangeListener(e,t){this._repositoryStateChangeListeners.set(e,t.state.onDidChange(()=>{this._proxy.$onDidChangeRepository(e)}))}async $diffBetweenWithStats(e,t,n,r){let i=this._repositories.get(e);if(!i)return[];try{return(await i.diffBetweenWithStats(t,n,r)).map(e=>({...YH(e),insertions:e.insertions,deletions:e.deletions}))}catch{return[]}}async $diffBetweenWithStats2(e,t,n){let r=this._repositories.get(e);if(!r)return[];try{return(await r.diffBetweenWithStats2(t,n)).map(e=>({...YH(e),insertions:e.insertions,deletions:e.deletions}))}catch{return[]}}async _ensureGitApi(){if(this._gitApi)return this._gitApi;try{await this._extHostExtensionService.activateByIdWithErrors(new Ts(WH),{startup:!1,extensionId:new Ts(WH),activationEvent:`api`});let e=this._extHostExtensionService.getExtensionExports(new Ts(WH));e&&typeof e.getAPI==`function`&&(this._gitApi=e.getAPI(1))}catch{}return this._gitApi}dispose(){this._repositoryStateChangeListeners.dispose(),super.dispose()}};QH=UH=k([A(0,Js),A(1,XR)],QH),Rs(zR,RR,Ls.Delayed),Rs(Ps,rz,Ls.Delayed),Rs(tz,nz,Ls.Delayed),Rs(UI,HI,Ls.Eager),Rs(BL,VL,Ls.Eager),Rs(nR,iR,Ls.Eager),Rs(yF,_F,Ls.Eager),Rs(BF,zF,Ls.Eager),Rs(aV,oV,Ls.Eager),Rs(EV,MV,Ls.Eager),Rs(xz,bz,Ls.Eager),Rs(Lz,Iz,Ls.Eager),Rs(BR,VR,Ls.Eager),Rs(Wc,Uc,Ls.Eager),Rs(vz,_z,Ls.Delayed),Rs(ZV,QV,Ls.Eager),Rs(FF,PF,Ls.Eager),Rs(RB,LB,Ls.Eager),Rs(qI,eL,Ls.Eager),Rs(rH,iH,Ls.Eager),Rs(tI,nI,Ls.Eager),Rs(NL,ML,Ls.Eager),Rs(nH,tH,Ls.Eager),Rs(IL,FL,Ls.Eager),Rs(eF,$P,Ls.Eager),Rs(IR,FR,Ls.Eager),Rs(JB,ZB,Ls.Eager),Rs(CV,TV,Ls.Eager),Rs(EH,OH,Ls.Eager),Rs(RH,zH,Ls.Eager),Rs(VH,HH,Ls.Eager),Rs(ZH,QH,Ls.Delayed);function $H(e,t,n,r,i,a){if(Array.isArray(e)){let o=0;for(let s of e){let e=$H(s,t,n,r,i,a);if(e===10)return e;e>o&&(o=e)}return o}else if(typeof e==`string`)return r?e===`*`?5:e===n?10:0:0;else if(e){let{language:o,pattern:s,scheme:c,hasAccessToAllModels:l,notebookType:u}=e;if(!r&&!l)return 0;u&&i&&(t=i);let d=0;if(c)if(c===t.scheme)d=10;else if(c===`*`)d=5;else return 0;if(o)if(o===n)d=10;else if(o===`*`)d=Math.max(d,5);else return 0;if(u)if(u===a)d=10;else if(u===`*`&&a!==void 0)d=Math.max(d,5);else return 0;if(s){let e;if(e=typeof s==`string`?s:{...s,base:Kr(s.base)},e===t.fsPath||GS(e,t.fsPath))d=10;else return 0}return d}else return 0}function eU(e){return typeof e==`string`?!1:Array.isArray(e)?e.some(eU):!!e.notebookType}var tU;(function(e){e[e.None=0]=`None`,e[e.Indent=1]=`Indent`,e[e.IndentOutdent=2]=`IndentOutdent`,e[e.Outdent=3]=`Outdent`})(tU||={});var nU;(function(e){e[e.Complete=100]=`Complete`,e[e.Partial=50]=`Partial`,e[e.None=0]=`None`})(nU||={});var rU=class{constructor(e){this._relatedInformationProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(T.MainThreadAiRelatedInformation)}async $provideAiRelatedInformation(e,t,n){if(this._relatedInformationProviders.size===0)throw Error(`No related information providers registered`);let r=this._relatedInformationProviders.get(e);if(!r)throw Error(`related information provider not found`);return await r.provideRelatedInformation(t,n)??[]}getRelatedInformation(e,t,n){return this._proxy.$getAiRelatedInformation(t,n)}registerRelatedInformationProvider(e,t,n){let r=this._nextHandle;return this._nextHandle++,this._relatedInformationProviders.set(r,n),this._proxy.$registerAiRelatedInformationProvider(r,t),new YT(()=>{this._proxy.$unregisterAiRelatedInformationProvider(r),this._relatedInformationProviders.delete(r)})}},iU=class{constructor(e){this._settingsSearchProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(T.MainThreadAiSettingsSearch)}async $startSearch(e,t,n,r){if(this._settingsSearchProviders.size===0)throw Error(`No related information providers registered`);let i=this._settingsSearchProviders.get(e);if(!i)throw Error(`Settings search provider not found`);let a=new Om(t=>{this._proxy.$handleSearchResult(e,zN.fromSettingsSearchResult(t))});return i.provideSettingsSearchResults(t,n,a,r)}registerSettingsSearchProvider(e,t){let n=this._nextHandle;return this._nextHandle++,this._settingsSearchProviders.set(n,t),this._proxy.$registerAiSettingsSearchProvider(n),new YT(()=>{this._proxy.$unregisterAiSettingsSearchProvider(n),this._settingsSearchProviders.delete(n)})}},aU;(function(e){e[e.Full=1]=`Full`,e[e.Delta=2]=`Delta`})(aU||={});function oU(e){for(let t=0,n=e.length;t<n;t+=4){let n=e[t+0],r=e[t+1],i=e[t+2],a=e[t+3];e[t+0]=a,e[t+1]=i,e[t+2]=r,e[t+3]=n}}function sU(e){let t=new Uint8Array(e.buffer,e.byteOffset,e.length*4);return Wn()||oU(t),y.wrap(t)}function cU(e){let t=e.buffer;if(Wn()||oU(t),t.byteOffset%4==0)return new Uint32Array(t.buffer,t.byteOffset,t.length/4);{let e=new Uint8Array(t.byteLength);return e.set(t),new Uint32Array(e.buffer,e.byteOffset,e.length/4)}}function lU(e){let t=new Uint32Array(uU(e)),n=0;if(t[n++]=e.id,e.type===`full`)t[n++]=aU.Full,t[n++]=e.data.length,t.set(e.data,n),n+=e.data.length;else{t[n++]=aU.Delta,t[n++]=e.deltas.length;for(let r of e.deltas)t[n++]=r.start,t[n++]=r.deleteCount,r.data?(t[n++]=r.data.length,t.set(r.data,n),n+=r.data.length):t[n++]=0}return sU(t)}function uU(e){let t=0;if(t+=2,e.type===`full`)t+=1+e.data.length;else{t+=1,t+=3*e.deltas.length;for(let n of e.deltas)n.data&&(t+=n.data.length)}return t}function dU(e){let t=cU(e),n=0,r=t[n++];if(t[n++]===aU.Full){let e=t[n++],i=t.subarray(n,n+e);return n+=e,{id:r,type:`full`,data:i}}let i=t[n++],a=[];for(let e=0;e<i;e++){let r=t[n++],i=t[n++],o=t[n++],s;o>0&&(s=t.subarray(n,n+o),n+=o),a[e]={start:r,deleteCount:i,data:s}}return{id:r,type:`delta`,deltas:a}}const fU=[new KI(`vscode.executeDocumentHighlights`,`_executeDocumentHighlights`,`Execute document highlight provider.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of DocumentHighlight-instances.`,mU(Hj.to))),new KI(`vscode.executeDocumentSymbolProvider`,`_executeDocumentSymbolProvider`,`Execute document symbol provider.`,[X.Uri],new GI(`A promise that resolves to an array of SymbolInformation and DocumentSymbol instances.`,(e,t)=>{if(we(e))return;class n extends NT{constructor(){super(...arguments),this.containerName=``}static to(e){let r=new n(e.name,kj.to(e.kind),e.containerName||``,new gT(t[0],J.to(e.range)));return r.detail=e.detail,r.range=r.location.range,r.selectionRange=J.to(e.selectionRange),r.children=e.children?e.children.map(n.to):[],r}}return e.map(n.to)})),new KI(`vscode.executeFormatDocumentProvider`,`_executeFormatDocumentProvider`,`Execute document format provider.`,[X.Uri,new X(`options`,`Formatting options`,e=>!0,e=>e)],new GI(`A promise that resolves to an array of TextEdits.`,mU(Dj.to))),new KI(`vscode.executeFormatRangeProvider`,`_executeFormatRangeProvider`,`Execute range format provider.`,[X.Uri,X.Range,new X(`options`,`Formatting options`,e=>!0,e=>e)],new GI(`A promise that resolves to an array of TextEdits.`,mU(Dj.to))),new KI(`vscode.executeFormatOnTypeProvider`,`_executeFormatOnTypeProvider`,`Execute format on type provider.`,[X.Uri,X.Position,new X(`ch`,`Trigger character`,e=>typeof e==`string`,e=>e),new X(`options`,`Formatting options`,e=>!0,e=>e)],new GI(`A promise that resolves to an array of TextEdits.`,mU(Dj.to))),new KI(`vscode.executeDefinitionProvider`,`_executeDefinitionProvider`,`Execute all definition providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.experimental.executeDefinitionProvider_recursive`,`_executeDefinitionProvider_recursive`,`Execute all definition providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.executeTypeDefinitionProvider`,`_executeTypeDefinitionProvider`,`Execute all type definition providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.experimental.executeTypeDefinitionProvider_recursive`,`_executeTypeDefinitionProvider_recursive`,`Execute all type definition providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.executeDeclarationProvider`,`_executeDeclarationProvider`,`Execute all declaration providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.experimental.executeDeclarationProvider_recursive`,`_executeDeclarationProvider_recursive`,`Execute all declaration providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.executeImplementationProvider`,`_executeImplementationProvider`,`Execute all implementation providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.experimental.executeImplementationProvider_recursive`,`_executeImplementationProvider_recursive`,`Execute all implementation providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location or LocationLink instances.`,hU)),new KI(`vscode.executeReferenceProvider`,`_executeReferenceProvider`,`Execute all reference providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location-instances.`,mU(Ij.to))),new KI(`vscode.experimental.executeReferenceProvider`,`_executeReferenceProvider_recursive`,`Execute all reference providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Location-instances.`,mU(Ij.to))),new KI(`vscode.executeHoverProvider`,`_executeHoverProvider`,`Execute all hover providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Hover-instances.`,mU(Rj.to))),new KI(`vscode.experimental.executeHoverProvider_recursive`,`_executeHoverProvider_recursive`,`Execute all hover providers.`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of Hover-instances.`,mU(Rj.to))),new KI(`vscode.executeSelectionRangeProvider`,`_executeSelectionRangeProvider`,`Execute selection range provider.`,[X.Uri,new X(`position`,`A position in a text document`,e=>Array.isArray(e)&&e.every(e=>aT.isPosition(e)),e=>e.map(fj.from))],new GI(`A promise that resolves to an array of ranges.`,e=>e.map(e=>{let t;for(let n of e.reverse())t=new uE(J.to(n),t);return t}))),new KI(`vscode.executeWorkspaceSymbolProvider`,`_executeWorkspaceSymbolProvider`,`Execute all workspace symbol providers.`,[X.String.with(`query`,`Search string`)],new GI(`A promise that resolves to an array of SymbolInformation-instances.`,e=>e.map(jj.to))),new KI(`vscode.prepareCallHierarchy`,`_executePrepareCallHierarchy`,`Prepare call hierarchy at a position inside a document`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of CallHierarchyItem-instances`,e=>e.map(Nj.to))),new KI(`vscode.provideIncomingCalls`,`_executeProvideIncomingCalls`,`Compute incoming calls for an item`,[X.CallHierarchyItem],new GI(`A promise that resolves to an array of CallHierarchyIncomingCall-instances`,e=>e.map(Pj.to))),new KI(`vscode.provideOutgoingCalls`,`_executeProvideOutgoingCalls`,`Compute outgoing calls for an item`,[X.CallHierarchyItem],new GI(`A promise that resolves to an array of CallHierarchyOutgoingCall-instances`,e=>e.map(Fj.to))),new KI(`vscode.prepareRename`,`_executePrepareRename`,`Execute the prepareRename of rename provider.`,[X.Uri,X.Position],new GI(`A promise that resolves to a range and placeholder text.`,e=>{if(e)return{range:J.to(e.range),placeholder:e.text}})),new KI(`vscode.executeDocumentRenameProvider`,`_executeDocumentRenameProvider`,`Execute rename provider.`,[X.Uri,X.Position,X.String.with(`newName`,`The new symbol name`)],new GI(`A promise that resolves to a WorkspaceEdit.`,e=>{if(e){if(e.rejectReason)throw Error(e.rejectReason);return Oj.to(e)}})),new KI(`vscode.executeLinkProvider`,`_executeLinkProvider`,`Execute document link provider.`,[X.Uri,X.Number.with(`linkResolveCount`,`Number of links that should be resolved, only when links are unresolved.`).optional()],new GI(`A promise that resolves to an array of DocumentLink-instances.`,e=>e.map(nM.to))),new KI(`vscode.provideDocumentSemanticTokensLegend`,`_provideDocumentSemanticTokensLegend`,`Provide semantic tokens legend for a document`,[X.Uri],new GI(`A promise that resolves to SemanticTokensLegend.`,e=>{if(e)return new hO(e.tokenTypes,e.tokenModifiers)})),new KI(`vscode.provideDocumentSemanticTokens`,`_provideDocumentSemanticTokens`,`Provide semantic tokens for a document`,[X.Uri],new GI(`A promise that resolves to SemanticTokens.`,e=>{if(!e)return;let t=dU(e);if(t.type===`full`)return new vO(t.data,void 0)})),new KI(`vscode.provideDocumentRangeSemanticTokensLegend`,`_provideDocumentRangeSemanticTokensLegend`,`Provide semantic tokens legend for a document range`,[X.Uri,X.Range.optional()],new GI(`A promise that resolves to SemanticTokensLegend.`,e=>{if(e)return new hO(e.tokenTypes,e.tokenModifiers)})),new KI(`vscode.provideDocumentRangeSemanticTokens`,`_provideDocumentRangeSemanticTokens`,`Provide semantic tokens for a document range`,[X.Uri,X.Range],new GI(`A promise that resolves to SemanticTokens.`,e=>{if(!e)return;let t=dU(e);if(t.type===`full`)return new vO(t.data,void 0)})),new KI(`vscode.executeCompletionItemProvider`,`_executeCompletionItemProvider`,`Execute completion item provider.`,[X.Uri,X.Position,X.String.with(`triggerCharacter`,"Trigger completion when the user types the character, like `,` or `(`").optional(),X.Number.with(`itemResolveCount`,`Number of completions to resolve (too large numbers slow down completions)`).optional()],new GI(`A promise that resolves to a CompletionList-instance.`,(e,t,n)=>e?new DE(e.suggestions.map(e=>Yj.to(e,n)),e.incomplete):new DE([]))),new KI(`vscode.executeSignatureHelpProvider`,`_executeSignatureHelpProvider`,`Execute signature help provider.`,[X.Uri,X.Position,X.String.with(`triggerCharacter`,"Trigger signature help when the user types the character, like `,` or `(`").optional()],new GI(`A promise that resolves to SignatureHelp.`,e=>{if(e)return Qj.to(e)})),new KI(`vscode.executeCodeLensProvider`,`_executeCodeLensProvider`,`Execute code lens provider.`,[X.Uri,X.Number.with(`itemResolveCount`,`Number of lenses that should be resolved and returned. Will only return resolved lenses, will impact performance)`).optional()],new GI(`A promise that resolves to an array of CodeLens-instances.`,(e,t,n)=>mU(e=>new hE(J.to(e.range),e.command&&n.fromInternal(e.command)))(e))),new KI(`vscode.executeCodeActionProvider`,`_executeCodeActionProvider`,`Execute code action provider.`,[X.Uri,new X(`rangeOrSelection`,`Range in a text document. Some refactoring provider requires Selection object.`,e=>sT.isRange(e),e=>ET.isSelection(e)?lj.from(e):J.from(e)),X.String.with(`kind`,`Code action kind to return code actions for`).optional(),X.Number.with(`itemResolveCount`,`Number of code actions to resolve (too large numbers slow down code actions)`).optional()],new GI(`A promise that resolves to an array of Command-instances.`,(e,t,n)=>mU(e=>{if(e._isSynthetic){if(!e.command)throw Error(`Synthetic code actions must have a command`);return n.fromInternal(e.command)}else{let t=new lE(e.title,e.kind?new uT(e.kind):void 0);return e.edit&&(t.edit=Oj.to(e.edit)),e.command&&(t.command=n.fromInternal(e.command)),t.isPreferred=e.isPreferred,t}})(e))),new KI(`vscode.executeDocumentColorProvider`,`_executeDocumentColorProvider`,`Execute document color provider.`,[X.Uri],new GI(`A promise that resolves to an array of ColorInformation objects.`,e=>e?e.map(e=>new KE(J.to(e.range),iM.to(e.color))):[])),new KI(`vscode.executeColorPresentationProvider`,`_executeColorPresentationProvider`,`Execute color presentation provider.`,[new X(`color`,`The color to show and insert`,e=>e instanceof GE,iM.from),new X(`context`,`Context object with uri and range`,e=>!0,e=>({uri:e.uri,range:J.from(e.range)}))],new GI(`A promise that resolves to an array of ColorPresentation objects.`,e=>e?e.map(rM.to):[])),new KI(`vscode.executeInlayHintProvider`,`_executeInlayHintProvider`,`Execute inlay hints provider`,[X.Uri,X.Range],new GI(`A promise that resolves to an array of Inlay objects`,(e,t,n)=>e.map($j.to.bind(void 0,n)))),new KI(`vscode.executeFoldingRangeProvider`,`_executeFoldingRangeProvider`,`Execute folding range provider`,[X.Uri],new GI(`A promise that resolves to an array of FoldingRange objects`,(e,t)=>{if(e)return e.map(uM.to)})),new KI(`vscode.resolveNotebookContentProviders`,`_resolveNotebookContentProvider`,`Resolve Notebook Content Providers`,[],new GI(`A promise that resolves to an array of NotebookContentProvider static info objects.`,mU(e=>({viewType:e.viewType,displayName:e.displayName,options:{transientOutputs:e.options.transientOutputs,transientCellMetadata:e.options.transientCellMetadata,transientDocumentMetadata:e.options.transientDocumentMetadata},filenamePattern:e.filenamePattern.map(e=>SM.to(e))})))),new KI(`vscode.executeInlineValueProvider`,`_executeInlineValueProvider`,`Execute inline value provider`,[X.Uri,X.Range,new X(`context`,`An InlineValueContext`,e=>e&&typeof e.frameId==`number`&&e.stoppedLocation instanceof sT,e=>Vj.from(e))],new GI(`A promise that resolves to an array of InlineValue objects`,e=>e.map(Bj.to))),new KI(`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 X(`uriOrString`,`Uri-instance or string (only http/https)`,e=>C.isUri(e)||typeof e==`string`&&Xa(e,D.http,D.https),e=>e),new X(`columnOrOptions`,`Either the column in which to open or editor options, see vscode.TextDocumentShowOptions`,e=>e===void 0||typeof e==`number`||typeof e==`object`,e=>e&&(typeof e==`number`?[vj.from(e),void 0]:[vj.from(e.viewColumn),fM.from(e)])).optional(),X.String.with(`label`,``).optional()],GI.Void),new KI(`vscode.openWith`,`_workbench.openWith`,`Opens the provided resource with a specific editor.`,[X.Uri.with(`resource`,`Resource to open`),X.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 X(`columnOrOptions`,`Either the column in which to open or editor options, see vscode.TextDocumentShowOptions`,e=>e===void 0||typeof e==`number`||typeof e==`object`,e=>e&&(typeof e==`number`?[vj.from(e),void 0]:[vj.from(e.viewColumn),fM.from(e)])).optional()],GI.Void),new KI(`vscode.diff`,`_workbench.diff`,`Opens the provided resources in the diff editor to compare their contents.`,[X.Uri.with(`left`,`Left-hand side resource of the diff editor`),X.Uri.with(`right`,`Right-hand side resource of the diff editor`),X.String.with(`title`,`Human readable title for the diff editor`).optional(),new X(`columnOrOptions`,`Either the column in which to open or editor options, see vscode.TextDocumentShowOptions`,e=>e===void 0||typeof e==`object`,e=>e&&[vj.from(e.viewColumn),fM.from(e)]).optional()],GI.Void),new KI(`vscode.changes`,`_workbench.changes`,`Opens a list of resources in the changes editor to compare their contents.`,[X.String.with(`title`,`Human readable title for the changes editor`),new X(`resourceList`,`List of resources to compare`,e=>{for(let t of e){if(t.length!==3)return!1;let[e,n,r]=t;if(!C.isUri(e)||!C.isUri(n)&&n!=null||!C.isUri(r)&&r!=null)return!1}return!0},e=>e)],GI.Void),new KI(`vscode.prepareTypeHierarchy`,`_executePrepareTypeHierarchy`,`Prepare type hierarchy at a position inside a document`,[X.Uri,X.Position],new GI(`A promise that resolves to an array of TypeHierarchyItem-instances`,e=>e.map(FM.to))),new KI(`vscode.provideSupertypes`,`_executeProvideSupertypes`,`Compute supertypes for an item`,[X.TypeHierarchyItem],new GI(`A promise that resolves to an array of TypeHierarchyItem-instances`,e=>e.map(FM.to))),new KI(`vscode.provideSubtypes`,`_executeProvideSubtypes`,`Compute subtypes for an item`,[X.TypeHierarchyItem],new GI(`A promise that resolves to an array of TypeHierarchyItem-instances`,e=>e.map(FM.to))),new KI(`vscode.revealTestInExplorer`,`_revealTestInExplorer`,`Reveals a test instance in the explorer`,[X.TestItem],GI.Void),new KI(`vscode.startContinuousTestRun`,`testing.startContinuousRunFromExtension`,`Starts running the given tests with continuous run mode.`,[X.TestProfile,X.Arr(X.TestItem)],GI.Void),new KI(`vscode.stopContinuousTestRun`,`testing.stopContinuousRunFromExtension`,`Stops running the given tests with continuous run mode.`,[X.Arr(X.TestItem)],GI.Void),new KI(`vscode.experimental.editSession.continue`,`_workbench.editSessions.actions.continueEditSession`,`Continue the current edit session in a different workspace`,[X.Uri.with(`workspaceUri`,`The target workspace to continue the current edit session in`)],GI.Void),new KI(`setContext`,`_setContext`,`Set a custom context key value that can be used in when clauses.`,[X.String.with(`name`,`The context key name`),new X(`value`,`The context key value`,()=>!0,e=>e)],GI.Void),new KI(`vscode.editorChat.start`,`inlineChat.start`,`Invoke a new editor chat session`,[new X(`Run arguments`,``,e=>!0,e=>{if(e)return{initialRange:e.initialRange?J.from(e.initialRange):void 0,initialSelection:ET.isSelection(e.initialSelection)?lj.from(e.initialSelection):void 0,message:e.message,attachments:e.attachments,autoSend:e.autoSend,position:e.position?fj.from(e.position):void 0,resolveOnResponse:e.resolveOnResponse}})],GI.Void),new KI(`vscode.extensionPromptFileProvider`,`_listExtensionPromptFiles`,`Get all extension-contributed prompt files (custom agents, instructions, and prompt files).`,[],new GI(`A promise that resolves to an array of objects containing uri, type, and extensionId.`,e=>e?e.map(e=>({uri:C.revive(e.uri),type:e.type,extensionId:e.extensionId})):[]))];var pU=class{static register(e){fU.forEach(e.registerApiCommand,e),this._registerValidateWhenClausesCommand(e)}static _registerValidateWhenClausesCommand(e){e.registerCommand(!1,`_validateWhenClauses`,Id)}};function mU(e){return t=>{if(Array.isArray(t))return t.map(e)}}function hU(e){if(!Array.isArray(e))return;let t=[];for(let n of e)qp(n)?t.push(Lj.to(n)):t.push(Ij.to(n));return t}let gU=class{constructor(e,t){this._proxy=e.getProxy(T.MainThreadBulkEdits),this._versionInformationProvider={getTextDocumentVersion:e=>t.getDocument(e)?.version,getNotebookDocumentVersion:()=>void 0}}applyWorkspaceEdit(e,t,n){let r=new Ci(Oj.from(e,this._versionInformationProvider));return this._proxy.$tryApplyWorkspaceEdit(r,void 0,n?.isRefactoring??!1)}};gU=k([A(0,Js)],gU);var _U;(function(e){function t(e,t){return e.callstack<t.callstack?-1:+(e.callstack>t.callstack)}e.compare=t})(_U||={});function vU(e){return!e||typeof e!=`object`?{callstack:void 0,msg:mc(e)}:{callstack:Array.isArray(e.stack)?e.stack.join(`
|
|
107
|
+
`):e.stack,msg:e.message?e.message:mc(e)}}(class e{static{this.ERROR_FLUSH_TIMEOUT=5*1e3}constructor(t,n=e.ERROR_FLUSH_TIMEOUT){this._flushHandle=void 0,this._buffer=[],this._disposables=new _,this._telemetryService=t,this._flushDelay=n;let r=d.addListener(e=>this._onErrorEvent(e));this._disposables.add(g(r)),this.installErrorListeners()}dispose(){clearTimeout(this._flushHandle),this._flushBuffer(),this._disposables.dispose()}installErrorListeners(){}_onErrorEvent(e){if(!e||e.code||(e.detail&&e.detail.stack&&(e=e.detail),pe.isErrorNoTelemetry(e)||e instanceof Oc||ae.is(e)||typeof e?.message==`string`&&e.message.includes(`Unable to read file`)))return;let{callstack:t,msg:n}=vU(e);if(!t)return;let r={msg:n,callstack:t};cr.is(e)&&(r.kind=e.kind,r.listenerCount=e.listenerCount),this._enqueue(r)}_enqueue(e){let t=_e(this._buffer,e,_U.compare);t<0?(e.count=1,this._buffer.splice(~t,0,e)):(this._buffer[t].count||(this._buffer[t].count=0),this._buffer[t].count+=1),this._flushHandle===void 0&&(this._flushHandle=setTimeout(()=>{this._flushBuffer(),this._flushHandle=void 0},this._flushDelay))}_flushBuffer(){for(let e of this._buffer)this._telemetryService.publicLogError2(`UnhandledError`,e);this._buffer.length=0}});function yU(e){return!!e&&C.isUri(e.sessionResource)&&e.$mid===Mr.ChatViewContext}var bU;(function(e){e[e.Info=0]=`Info`,e[e.Warning=1]=`Warning`,e[e.Error=2]=`Error`})(bU||={});var xU;(function(e){e[e.Complete=1]=`Complete`,e[e.Partial=2]=`Partial`,e[e.Omitted=3]=`Omitted`})(xU||={});var SU;(function(e){e[e.NoReason=0]=`NoReason`,e[e.FilteredContentRetry=1]=`FilteredContentRetry`,e[e.CopyrightContentRetry=2]=`CopyrightContentRetry`})(SU||={});var CU;(function(e){e.Pending=`pending`,e.Accepted=`accepted`,e.Rejected=`rejected`})(CU||={});var wU;(function(e){e[e.Denied=0]=`Denied`,e[e.ConfirmationNotNeeded=1]=`ConfirmationNotNeeded`,e[e.Setting=2]=`Setting`,e[e.LmServicePerTool=3]=`LmServicePerTool`,e[e.UserAction=4]=`UserAction`,e[e.Skipped=5]=`Skipped`})(wU||={});var TU;(function(e){let t;(function(e){e[e.Streaming=0]=`Streaming`,e[e.WaitingForConfirmation=1]=`WaitingForConfirmation`,e[e.Executing=2]=`Executing`,e[e.WaitingForPostApproval=3]=`WaitingForPostApproval`,e[e.Completed=4]=`Completed`,e[e.Cancelled=5]=`Cancelled`})(t=e.StateKind||={});function n(e,n){if(e.kind===`toolInvocationSerialized`)return e.isConfirmed===void 0||typeof e.isConfirmed==`boolean`?{type:e.isConfirmed?wU.UserAction:wU.Denied}:e.isConfirmed;let r=e.state.read(n);if(!(r.type===t.Streaming||r.type===t.WaitingForConfirmation))return r.type===t.Cancelled?{type:r.reason}:r.confirmed}e.executionConfirmedOrDenied=n;function r(e,t){let r=n(e);if(r)return Promise.resolve(r);let i=new _;return new Promise(r=>{t&&i.add(t.onCancellationRequested(()=>{r({type:wU.Denied})})),i.add(pv(t=>{let a=n(e,t);a&&(i.dispose(),r(a))}))}).finally(()=>{i.dispose()})}e.awaitConfirmation=r;function i(e,n){let r=e.state.read(n);if(r.type===t.Completed)return r.postConfirmed||{type:wU.ConfirmationNotNeeded};if(r.type===t.Cancelled)return{type:r.reason}}function a(e,n){let r=e?.state.get();return r?.type===t.WaitingForConfirmation||r?.type===t.WaitingForPostApproval?(r.confirm(n),!0):!1}e.confirmWith=a;function o(e,t){let n=i(e);if(n)return Promise.resolve(n);let r=new _;return new Promise(n=>{t&&r.add(t.onCancellationRequested(()=>{n({type:wU.Denied})})),r.add(pv(t=>{let a=i(e,t);a&&(r.dispose(),n(a))}))}).finally(()=>{r.dispose()})}e.awaitPostConfirmation=o;function s(e,n){if(e.kind===`toolInvocationSerialized`)return e.resultDetails;let r=e.state.read(n);if(r.type===t.Completed||r.type===t.WaitingForPostApproval)return r.resultDetails}e.resultDetails=s;function c(e,n){if(e.kind===`toolInvocationSerialized`)return!0;let r=e.state.read(n);return r.type===t.Completed||r.type===t.Cancelled}e.isComplete=c;function l(e,t){return!!(e.presentation===`hidden`||e.presentation===`hiddenAfterComplete`&&c(e,t))}e.isEffectivelyHidden=l;function u(e,n){return e.kind===`toolInvocationSerialized`?!1:e.state.read(n).type===t.Streaming}e.isStreaming=u;function d(e,n){if(e.kind===`toolInvocationSerialized`)return;let r=e.state.read(n);if(r.type!==t.Streaming)return r.parameters}e.getParameters=d;function f(e,n){if(e.kind===`toolInvocationSerialized`)return;let r=e.state.read(n);if(r.type!==t.Streaming)return r.confirmationMessages}e.getConfirmationMessages=f})(TU||={});var EU;(function(e){e[e.Down=0]=`Down`,e[e.Up=1]=`Up`})(EU||={});var DU;(function(e){e[e.Action=1]=`Action`,e[e.Toolbar=2]=`Toolbar`})(DU||={});var OU;(function(e){e[e.Pending=0]=`Pending`,e[e.Complete=1]=`Complete`,e[e.Cancelled=2]=`Cancelled`,e[e.Failed=3]=`Failed`,e[e.NeedsInput=4]=`NeedsInput`})(OU||={});var kU;(function(e){function t(e){return e.kind===`sent`}e.isSent=t;function n(e){return e.kind===`rejected`}e.isRejected=n;function r(e){return e.kind===`queued`}e.isQueued=r;function i(e){if(e.kind!==`sent`)throw Error(`Expected ChatSendResult to be 'sent', but was '${e.kind}'`)}e.assertSent=i})(kU||={});var AU;(function(e){e.Queued=`queued`,e.Steering=`steering`})(AU||={});var jU=class{constructor(e,t,n,r,i,a,o){this._extension=e,this._request=t,this._proxy=n,this._commandsConverter=r,this._sessionDisposables=i,this._pendingCarouselResolvers=a,this._token=o,this._stopWatch=tr.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 e=this;this._stopWatch.reset();let t=0;function n(t){if(e._isClosed){let e=Error(`Response stream has been closed`);throw Error.captureStackTrace(e,t),e}}let r=[],i=[];function a(t,n){if(r.push(n===void 0?t:[t,n])===1&&queueMicrotask(()=>{let t=i;i=[],e._proxy.$handleProgressChunk(e._request.requestId,r).finally(()=>{t.forEach(e=>e())}),r.length=0}),n!==void 0)return new Promise(e=>{i.push(e)})}let o=(e,n)=>{if(this._firstProgress===void 0&&(e.kind===`markdownContent`||e.kind===`markdownVuln`||e.kind===`beginToolInvocation`)&&(this._firstProgress=this._stopWatch.elapsed()),n){let r=t++,i=a(e,r);Promise.all([i,n({report:e=>{i.then(()=>{rT.isMarkdownString(e.value)?a(tN.from(e),r):a(mN.from(e),r)})}})]).then(([e,t])=>{a(cN.from(t),r)})}else a(e)};this._apiObject=Object.freeze({clearToPreviousToolInvocation(e){return n(this.markdown),a({kind:`clearToPreviousToolInvocation`,reason:e}),this},markdown(e){n(this.markdown);let t=new kk(e);return o(WM.from(t)),this},markdownWithVulnerabilities(t,r){n(this.markdown),r&&K(e._extension,`chatParticipantAdditions`);let i=new Ak(t,r);return o(KM.from(i)),this},codeblockUri(t,r){n(this.codeblockUri),K(e._extension,`chatParticipantAdditions`);let i=new Kk(t,r);return o(GM.from(i)),this},filetree(e,t){n(this.filetree);let r=new Mk(e,t);return o(YM.from(r)),this},anchor(e,t){let n=new Lk(e,t);return this.push(n)},button(t){n(this.anchor);let r=new Wk(t);return o(lN.from(r,e._commandsConverter,e._sessionDisposables)),this},progress(e,t){n(this.progress);let r=new zk(e,t);return o(t?sN.from(r):QM.from(r),t),this},thinkingProgress(t){n(this.thinkingProgress),K(e._extension,`chatParticipantAdditions`);let r=new Bk(t.text??``,t.id,t.metadata);return o($M.from(r)),this},hookProgress(t,r,i){n(this.hookProgress),K(e._extension,`chatParticipantAdditions`);let a=new Vk(t,r,i);return o(eN.from(a)),this},warning(t){n(this.progress),K(e._extension,`chatParticipantAdditions`);let r=new Hk(t);return o(tN.from(r)),this},info(t){n(this.progress),K(e._extension,`chatParticipantAdditions`);let r=new Uk(t);return o(nN.from(r)),this},reference(e,t){return this.reference2(e,t)},reference2(t,r,i){if(n(this.reference),typeof t==`object`&&`variableName`in t&&K(e._extension,`chatParticipantAdditions`),typeof t==`object`&&`variableName`in t&&!t.value){let n=e._request.variables.variables.find(e=>e.name===t.variableName);if(n){let e;if(n.references?.length)e=n.references.map(e=>({kind:`reference`,reference:{variableName:t.variableName,value:e.reference}}));else{let n=new Gk(t,r,i);e=[mN.from(n)]}return e.forEach(e=>o(e)),this}}else{let e=new Gk(t,r,i);o(mN.from(e))}return this},codeCitation(t,r,i){n(this.codeCitation),K(e._extension,`chatParticipantAdditions`);let a=new qk(t,r,i);o(hN.from(a))},textEdit(t,r){n(this.textEdit),K(e._extension,`chatParticipantAdditions`);let i=new eA(t,r);return i.isDone=r===!0?!0:void 0,o(uN.from(i)),this},notebookEdit(t,r){n(this.notebookEdit),K(e._extension,`chatParticipantAdditions`);let i=new tA(t,r);return o(fN.from(i)),this},workspaceEdit(t){n(this.workspaceEdit),K(e._extension,`chatParticipantAdditions`);let r=new nA(t);return o(pN.from(r)),this},async externalEdit(e,r){n(this.externalEdit);let i=Array.isArray(e)?e:[e],o=t++,s=Gc();await a({kind:`externalEdits`,start:!0,resources:i,undoStopId:s},o);try{return await r(),s}finally{await a({kind:`externalEdits`,start:!1,resources:i,undoStopId:s},o)}},confirmation(t,r,i,a){n(this.confirmation),K(e._extension,`chatParticipantAdditions`);let s=new jk(t,r,i,a);return o(qM.from(s)),this},async questionCarousel(t,r=!0){n(this.questionCarousel),K(e._extension,`chatParticipantAdditions`);let i=Gc(),a=new $k(t,r),s=JM.from(a);s.resolveId=i;let c=new Wo;return e._pendingCarouselResolvers.has(e._request.requestId)||e._pendingCarouselResolvers.set(e._request.requestId,new Map),e._pendingCarouselResolvers.get(e._request.requestId).set(i,c),o(s),bo(c.p,e._token)},beginToolInvocation(t,r,i){return n(this.beginToolInvocation),K(e._extension,`chatParticipantAdditions`),o({kind:`beginToolInvocation`,toolCallId:t,toolName:r,streamData:i?{partialInput:i.partialInput}:void 0,subagentInvocationId:i?.subagentInvocationId}),this},updateToolInvocation(t,r){return n(this.updateToolInvocation),K(e._extension,`chatParticipantAdditions`),o({kind:`updateToolInvocation`,toolCallId:t,streamData:{partialInput:r.partialInput}}),this},push(t){if(n(this.push),(t instanceof eA||t instanceof tA||t instanceof Ak||t instanceof Hk||t instanceof jk||t instanceof $k||t instanceof qk||t instanceof Jk||t instanceof Yk||t instanceof Ik||t instanceof Bk||t instanceof Xk||t instanceof zk)&&K(e._extension,`chatParticipantAdditions`),t instanceof Gk)this.reference2(t.value,t.iconPath,t.options);else if(t instanceof zk)o(t.task?sN.from(t):QM.from(t),t.task);else if(t instanceof Bk)o($M.from(t));else if(t instanceof Lk){let n=ZM.from(t);if(t.resolve&&(K(e._extension,`chatParticipantAdditions`),n.resolveId=Gc()),o(n),t.resolve){let r=new Hi;t.resolve(r.token).then(()=>{let r=ZM.from(t);e._proxy.$handleAnchorResolve(e._request.requestId,n.resolveId,r)}).then(()=>r.dispose(),()=>r.dispose()),e._sessionDisposables.add(g(()=>r.dispose(!0)))}}else if(t instanceof Ik)return this.externalEdit(t.uris,t.callback).then(e=>t.didGetApplied(e)),this;else o(gN.from(t,e._commandsConverter,e._sessionDisposables));return this},usage(t){return n(this.usage),K(e._extension,`chatParticipantAdditions`),o({kind:`usage`,promptTokens:t.promptTokens,completionTokens:t.completionTokens,outputBuffer:t.outputBuffer,promptTokenDetails:t.promptTokenDetails}),this}})}return this._apiObject}},MU=class e extends v{static{this._idPool=0}static{this._participantDetectionProviderIdPool=0}static{this._contributionsProviderIdPool=0}static{this._customizationProviderIdPool=0}get activeChatPanelSessionResource(){return this._activeChatPanelSessionResource}toCustomAgent(e){return Object.freeze({uri:C.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?C.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,argumentHint:e.argumentHint,tools:e.tools,model:e.model,userInvocable:e.userInvocable,disableModelInvocation:e.disableModelInvocation,enabled:e.enabled})}toInstruction(e){return Object.freeze({uri:C.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?C.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,pattern:e.pattern})}toSkill(e){return Object.freeze({uri:C.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?C.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,userInvocable:e.userInvocable,disableModelInvocation:e.disableModelInvocation})}toSlashCommand(e){return Object.freeze({uri:C.revive(e.uri),name:e.name,description:e.description,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?C.revive(e.pluginUri):void 0,sessionTypes:e.sessionTypes,argumentHint:e.argumentHint,userInvocable:e.userInvocable})}toHook(e){return Object.freeze({uri:C.revive(e.uri),sessionTypes:e.sessionTypes,source:e.source,extensionId:e.extensionId,pluginUri:e.pluginUri?C.revive(e.pluginUri):void 0})}toPlugin(e){return Object.freeze({uri:C.revive(e.uri)})}provideCustomAgents(e){return this._customAgents.get(e)}provideInstructions(e){return this._instructions.get(e)}provideSkills(e){return this._skills.get(e)}provideSlashCommands(e){return this._slashCommands.get(e)}provideHooks(e){return this._hooks.get(e)}providePlugins(e){return this._plugins.get(e)}$onDidChangeCustomAgents(){this._customAgents.clear(),this._onDidChangeCustomAgents.fire()}$onDidChangeInstructions(){this._instructions.clear(),this._onDidChangeInstructions.fire()}$onDidChangeSkills(){this._skills.clear(),this._onDidChangeSkills.fire()}$onDidChangeSlashCommands(){this._slashCommands.clear(),this._onDidChangeSlashCommands.fire()}$onDidChangeHooks(){this._hooks.clear(),this._onDidChangeHooks.fire()}$onDidChangePlugins(){this._plugins.clear(),this._onDidChangePlugins.fire()}constructor(e,t,n,r,i,a,o,s,c){super(),this._logService=t,this._commands=n,this._documents=r,this._editorsAndDocuments=i,this._languageModels=a,this._diagnostics=o,this._tools=s,this._chatSessions=c,this._agents=new Map,this._participantDetectionProviders=new Map,this._promptFileProviders=new Map,this._customizationProviders=new Map,this._sessionDisposables=this._register(new Et),this._completionDisposables=this._register(new Tt),this._inFlightRequests=new Set,this._pendingCarouselResolvers=new Map,this._onDidChangeChatRequestTools=this._register(new x),this.onDidChangeChatRequestTools=this._onDidChangeChatRequestTools.event,this._onDidDisposeChatSession=this._register(new x),this.onDidDisposeChatSession=this._onDidDisposeChatSession.event,this._onDidChangeCustomAgents=this._register(new x),this.onDidChangeCustomAgents=this._onDidChangeCustomAgents.event,this._onDidChangeInstructions=this._register(new x),this.onDidChangeInstructions=this._onDidChangeInstructions.event,this._onDidChangeSkills=this._register(new x),this.onDidChangeSkills=this._onDidChangeSkills.event,this._onDidChangeSlashCommands=this._register(new x),this.onDidChangeSlashCommands=this._onDidChangeSlashCommands.event,this._onDidChangeHooks=this._register(new x),this.onDidChangeHooks=this._onDidChangeHooks.event,this._onDidChangePlugins=this._register(new x),this.onDidChangePlugins=this._onDidChangePlugins.event,this._customAgents=new IU(()=>this._proxy.$provideCustomAgents(Bi.None).then(e=>e.map(e=>this.toCustomAgent(e)))),this._instructions=new IU(()=>this._proxy.$provideInstructions(Bi.None).then(e=>e.map(e=>this.toInstruction(e)))),this._skills=new IU(()=>this._proxy.$provideSkills(Bi.None).then(e=>e.map(e=>this.toSkill(e)))),this._slashCommands=new IU(()=>this._proxy.$provideSlashCommands(Bi.None).then(e=>e.map(e=>this.toSlashCommand(e)))),this._hooks=new IU(()=>this._proxy.$provideHooks(Bi.None).then(e=>e.map(e=>this.toHook(e)))),this._plugins=new IU(()=>this._proxy.$providePlugins(Bi.None).then(e=>e.map(e=>this.toPlugin(e)))),this._onDidChangeActiveChatPanelSessionResource=this._register(new x),this.onDidChangeActiveChatPanelSessionResource=this._onDidChangeActiveChatPanelSessionResource.event,this._proxy=e.getProxy(T.MainThreadChatAgents2),n.registerArgumentProcessor({processArgument:e=>yU(e)?null:e})}async transferActiveChat(e){await this._proxy.$transferActiveChatSession(e)}createChatAgent(t,n,r){let i=e._idPool++,a=new PU(t,n,this._proxy,i,r);return this._agents.set(i,a),this._proxy.$registerAgent(i,t.identifier,n,{},void 0),a.apiAgent}createDynamicChatAgent(t,n,r,i){let a=e._idPool++,o=new PU(t,n,this._proxy,a,i);return this._agents.set(a,o),this._proxy.$registerAgent(a,t.identifier,n,{isSticky:!0},r),o.apiAgent}registerChatParticipantDetectionProvider(t,n){let r=e._participantDetectionProviderIdPool++;return this._participantDetectionProviders.set(r,new NU(t,n)),this._proxy.$registerChatParticipantDetectionProvider(r),g(()=>{this._participantDetectionProviders.delete(r),this._proxy.$unregisterChatParticipantDetectionProvider(r)})}registerPromptFileProvider(t,n,r){let i=e._contributionsProviderIdPool++;this._promptFileProviders.set(i,{extension:t,provider:r}),this._proxy.$registerPromptFileProvider(i,n,t.identifier);let a=new _,o;switch(n){case bb.agent:o=r.onDidChangeCustomAgents;break;case bb.instructions:o=r.onDidChangeInstructions;break;case bb.prompt:o=r.onDidChangePromptFiles;break;case bb.skill:o=r.onDidChangeSkills;break;case bb.hook:o=r.onDidChangeHooks;break}return o&&a.add(o(()=>{this._proxy.$onDidChangePromptFiles(i)})),a.add(g(()=>{this._promptFileProviders.delete(i),this._proxy.$unregisterPromptFileProvider(i)})),a}async $providePromptFiles(e,t,n,r){let i=this._promptFileProviders.get(e);if(!i)return;let a=i.provider,o;switch(t){case bb.agent:o=await a.provideCustomAgents(n,r)??void 0;break;case bb.instructions:o=await a.provideInstructions(n,r)??void 0;break;case bb.prompt:o=await a.providePromptFiles(n,r)??void 0;break;case bb.skill:o=await a.provideSkills(n,r)??void 0;break;case bb.hook:o=await a.provideHooks(n,r)??void 0;break}return o}registerChatSessionCustomizationProvider(t,n,r,i){let a=e._customizationProviderIdPool++;this._customizationProviders.set(a,{extension:t,provider:i});let o={label:r.label,iconId:r.iconId,supportedTypes:r.supportedTypes?.map(e=>yN.from(e))};this._proxy.$registerChatSessionCustomizationProvider(a,n,o,t.identifier);let s=new _;return i.onDidChange&&s.add(i.onDidChange(()=>{this._proxy.$onDidChangeCustomizations(a)})),s.add(g(()=>{this._customizationProviders.delete(a),this._proxy.$unregisterChatSessionCustomizationProvider(a)})),s}async $provideChatSessionCustomizations(e,t,n){let r=this._customizationProviders.get(e);if(r&&t)try{let e=await r.provider.provideChatSessionCustomizations(C.revive(t),n);return e?e.map(e=>({uri:e.uri,type:yN.from(e.type),name:e.name,description:e.description,source:e.source,groupKey:e.groupKey,badge:e.badge,badgeTooltip:e.badgeTooltip,extensionId:e.extensionId,pluginUri:e.pluginUri,userInvocable:e.userInvocable})):void 0}catch{return}}async $detectChatParticipant(e,t,n,r,i){let a=this._participantDetectionProviders.get(e);if(!a)return;let{request:o,location:s,history:c}=await this._createRequest(t,n,a.extension),l=await this.getModelForRequest(o,a.extension),u=await this.getToolsForRequest(a.extension,o.userSelectedTools,l.id,i),d=_N.to(o,s,l,o.modelConfiguration,this.getDiagnosticsWhenEnabled(a.extension),u,a.extension,this._logService);return a.provider.provideParticipantDetection(d,{history:c,yieldRequested:!1},{participants:r.participants,location:vN.to(r.location)},i)}async _createRequest(e,t,n){let r=Ju(e),i=await this.prepareHistoryTurns(n,r.agentId,t),a;if(r.locationData?.type===xy.EditorInline){let e=this._documents.getDocument(r.locationData.document);a=new jA(this._editorsAndDocuments.getEditor(r.locationData.id).value,e,lj.to(r.locationData.selection),J.to(r.locationData.wholeRange))}else r.locationData?.type===xy.Notebook&&(a=new MA(this._documents.getDocument(r.locationData.sessionInputUri)));return{request:r,location:a,history:i}}async getModelForRequest(e,t){let n;if(e.userSelectedModelId&&(n=await this._languageModels.getLanguageModelByIdentifier(t,e.userSelectedModelId)),!n&&(n=await this._languageModels.getDefaultLanguageModel(t),!n))throw Error(`Language model unavailable`);return n}async $setRequestTools(e,t){let n=[...this._inFlightRequests].find(t=>t.requestId===e);if(!n)return;n.extRequest.tools.clear();let r=await this.getToolsForRequest(n.extension,t,n.extRequest.model.id,Bi.None);for(let[e,t]of r)n.extRequest.tools.set(e,t);this._onDidChangeChatRequestTools.fire(n.extRequest)}$setYieldRequested(e,t){let n=[...this._inFlightRequests].find(t=>t.requestId===e);n&&(n.yieldRequested=t)}async $invokeAgent(e,t,n,r){let i=this._agents.get(e);if(!i)throw Error(`[CHAT](${e}) CANNOT invoke agent because the agent is not registered`);let a,o;try{let{request:e,location:s,history:c}=await this._createRequest(t,n,i.extension),l=this._sessionDisposables.get(e.sessionResource);l||(l=new _,this._sessionDisposables.set(e.sessionResource,l)),a=new jU(i.extension,e,this._proxy,this._commands.converter,l,this._pendingCarouselResolvers,r);let u=await this.getModelForRequest(e,i.extension),d=await this.getToolsForRequest(i.extension,e.userSelectedTools,u.id,r),f=_N.to(e,s,u,e.modelConfiguration,this.getDiagnosticsWhenEnabled(i.extension),d,i.extension,this._logService);o={requestId:t.requestId,extRequest:f,extension:i.extension,hooks:e.hooks,yieldRequested:!1},this._inFlightRequests.add(o);let p;if(n.chatSessionContext){let e=C.revive(n.chatSessionContext.chatSessionResource),t=await this._chatSessions.getInputStateForSession(e,n.chatSessionContext.initialSessionOptions,r);p={chatSessionItem:{resource:e,label:n.chatSessionContext.isUntitled?`Untitled Session`:`Session`},isUntitled:n.chatSessionContext.isUntitled,initialSessionOptions:n.chatSessionContext.initialSessionOptions,inputState:t}}let m={history:c,chatSessionContext:p,get yieldRequested(){return o?.yieldRequested??!1}},ee=i.invoke(f,m,a.apiObject,r);return await FU(1e3,Promise.resolve(ee).then(e=>{if(e?.metadata)try{JSON.stringify(e.metadata)}catch(t){let n=`result.metadata MUST be JSON.stringify-able. Got error: ${t.message}`;return this._logService.error(`[${i.extension.identifier.value}] [@${i.id}] ${n}`,i.extension),{errorDetails:{message:n},timings:a?.timings,nextQuestion:e.nextQuestion}}let t;return e?.errorDetails&&(t={...e.errorDetails,responseIsIncomplete:!0}),(t?.responseIsRedacted||t?.isQuotaExceeded||t?.isRateLimited||t?.isExpectedError||t?.confirmationButtons||t?.code)&&K(i.extension,`chatParticipantPrivate`),{errorDetails:t,timings:a?.timings,metadata:e?.metadata,nextQuestion:e?.nextQuestion,details:e?.details}}),r)}catch(e){this._logService.error(e,i.extension),e instanceof JA&&e.cause&&(e=e.cause);let t=e instanceof Error&&e.name===`ChatQuotaExceeded`,n=e instanceof Error&&e.name===`ChatRateLimited`,r=e instanceof Error&&e.name===`ChatExpectedError`,{callstack:a}=vU(e),o=e instanceof Error?e.name:void 0;return{errorDetails:{message:Pm(e),responseIsIncomplete:!0,isQuotaExceeded:t,isRateLimited:n,isExpectedError:r},errorCallstack:a,errorName:o}}finally{o&&this._inFlightRequests.delete(o);let e=this._pendingCarouselResolvers.get(t.requestId);if(e){for(let t of e.values())t.complete(void 0);this._pendingCarouselResolvers.delete(t.requestId)}a?.close()}}getDiagnosticsWhenEnabled(e){return Mw(e)?this._diagnostics.getDiagnostics():[]}async getToolsForRequest(e,t,n,r){if(!t)return new Map;let i=new Map;for(let n of this._tools.getTools(e))typeof t[n.name]==`boolean`&&i.set(n,t[n.name]);return i}async prepareHistoryTurns(e,t,n){let r=[];for(let i of n.history){let n=TN.to(i.result),a=t===i.request.agentId||LU(i.request.agentId)&&LU(t)?n:{...n,metadata:void 0},o=[],s=[];for(let t of i.request.variables.variables)if(t.kind===`tool`)s.push(xN.to(t));else if(t.kind===`toolset`)s.push(...t.value.map(xN.to));else{let n=bN.to(t,this.getDiagnosticsWhenEnabled(e),this._logService);n&&o.push(n)}let c=Mw(e)?i.request.editedFileEvents:void 0,l=Mw(e)&&i.request.modeInstructions?CN.to(i.request.modeInstructions):void 0,u=new oA(i.request.message,i.request.command,o,i.request.agentId,s,c,i.request.requestId,void 0,l);r.push(u);let d=Se(i.response.map(e=>gN.toContent(e,this._commands.converter)));r.push(new sA(d,a,i.request.agentId,i.request.command))}return r}$releaseSession(e){let t=C.revive(e);this._sessionDisposables.deleteAndDispose(t);let n=fh.parseLocalSessionId(t);n&&this._onDidDisposeChatSession.fire(n)}$acceptActiveChatSession(e){let t=e?C.revive(e):void 0;this._activeChatPanelSessionResource?.toString()!==t?.toString()&&(this._activeChatPanelSessionResource=t,this._onDidChangeActiveChatPanelSessionResource.fire(t))}async $provideFollowups(e,t,n,r,i){let a=this._agents.get(t);if(!a)return Promise.resolve([]);let o=Ju(e),s=await this.prepareHistoryTurns(a.extension,a.id,r),c=TN.to(n);return(await a.provideFollowups(c,{history:s,yieldRequested:!1},i)).filter(e=>{let t=!e.participant||vt.some(this._agents.values(),t=>t.id===e.participant&&Ts.equals(t.extension.identifier,a.extension.identifier));return t||this._logService.warn(`[@${a.id}] ChatFollowup refers to an unknown participant: ${e.participant}`),t}).map(e=>zM.from(e,o))}$acceptFeedback(e,t,n){let r=this._agents.get(e);if(!r)return;let i=TN.to(t),a;switch(n.direction){case EU.Down:a=Ok.Unhelpful;break;case EU.Up:a=Ok.Helpful;break}let o={result:i,kind:a};r.acceptFeedback(Object.freeze(o))}$handleQuestionCarouselAnswer(e,t,n){let r=this._pendingCarouselResolvers.get(e);if(!r)return;let i=r.get(t);i&&(i.complete(n),r.delete(t)),r.size===0&&this._pendingCarouselResolvers.delete(e)}$acceptAction(e,t,n){let r=this._agents.get(e);if(!r||n.action.kind===`vote`)return;let i=EN.to(t,n,this._commands.converter);i&&r.acceptAction(Object.freeze(i))}async $invokeCompletionProvider(e,t,n){let r=this._agents.get(e);if(!r)return[];let i=this._completionDisposables.get(e);return i?i.clear():(i=new _,this._completionDisposables.set(e,i)),(await r.invokeCompletionProvider(t,n)).map(e=>wN.from(e,this._commands.converter,i))}async $provideChatTitle(e,t,n){let r=this._agents.get(e);if(!r)return;let i=await this.prepareHistoryTurns(r.extension,r.id,{history:t}),a=t[0]?.request.sessionResource?C.revive(t[0].request.sessionResource):void 0;return await r.provideTitle({history:i,sessionResource:a,yieldRequested:!1},n)}async $provideChatSummary(e,t,n){let r=this._agents.get(e);if(!r)return;let i=await this.prepareHistoryTurns(r.extension,r.id,{history:t}),a=t[0]?.request.sessionResource?C.revive(t[0].request.sessionResource):void 0;return await r.provideSummary({history:i,sessionResource:a,yieldRequested:!1},n)}},NU=class{constructor(e,t){this.extension=e,this.provider=t}},PU=class{constructor(e,t,n,r,i){this.extension=e,this.id=t,this._proxy=n,this._handle=r,this._requestHandler=i,this._onDidReceiveFeedback=new x,this._onDidPerformAction=new x,this._pauseStateEmitter=new x}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,n){if(!this._followupProvider)return[];let r=await this._followupProvider.provideFollowups(e,t,n);return r?r.filter(e=>!(e&&`commandId`in e)).filter(e=>!(e&&`message`in e)):[]}async provideTitle(e,t){if(this._titleProvider)return await this._titleProvider.provideChatTitle(e,t)??void 0}async provideSummary(e,t){if(this._summarizer)return await this._summarizer.provideChatSummary(e,t)??void 0}get apiAgent(){let e=!1,t=!1,n=()=>{e||t||(t=!0,queueMicrotask(()=>{this._proxy.$updateAgent(this._handle,{icon:this._iconPath?this._iconPath instanceof C?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 ND?this._iconPath:void 0,hasFollowups:this._followupProvider!==void 0,helpTextPrefix:!this._helpTextPrefix||typeof this._helpTextPrefix==`string`?this._helpTextPrefix:Y.from(this._helpTextPrefix),helpTextPostfix:!this._helpTextPostfix||typeof this._helpTextPostfix==`string`?this._helpTextPostfix:Y.from(this._helpTextPostfix),supportIssueReporting:this._supportIssueReporting,additionalWelcomeMessage:!this._additionalWelcomeMessage||typeof this._additionalWelcomeMessage==`string`?this._additionalWelcomeMessage:Y.from(this._additionalWelcomeMessage)}),t=!1}))},r=this;return{get id(){return r.id},get iconPath(){return r._iconPath},set iconPath(e){r._iconPath=e,n()},get requestHandler(){return r._requestHandler},set requestHandler(e){ut(typeof e==`function`,`Invalid request handler`),r._requestHandler=e},get followupProvider(){return r._followupProvider},set followupProvider(e){r._followupProvider=e,n()},get helpTextPrefix(){return K(r.extension,`defaultChatParticipant`),r._helpTextPrefix},set helpTextPrefix(e){K(r.extension,`defaultChatParticipant`),r._helpTextPrefix=e,n()},get helpTextPostfix(){return K(r.extension,`defaultChatParticipant`),r._helpTextPostfix},set helpTextPostfix(e){K(r.extension,`defaultChatParticipant`),r._helpTextPostfix=e,n()},get supportIssueReporting(){return K(r.extension,`chatParticipantPrivate`),r._supportIssueReporting},set supportIssueReporting(e){K(r.extension,`chatParticipantPrivate`),r._supportIssueReporting=e,n()},get onDidReceiveFeedback(){return r._onDidReceiveFeedback.event},set participantVariableProvider(e){if(K(r.extension,`chatParticipantAdditions`),r._agentVariableProvider=e,e){if(!e.triggerCharacters.length)throw Error(`triggerCharacters are required`);r._proxy.$registerAgentCompletionsProvider(r._handle,r.id,e.triggerCharacters)}else r._proxy.$unregisterAgentCompletionsProvider(r._handle,r.id)},get participantVariableProvider(){return K(r.extension,`chatParticipantAdditions`),r._agentVariableProvider},set additionalWelcomeMessage(e){K(r.extension,`defaultChatParticipant`),r._additionalWelcomeMessage=e,n()},get additionalWelcomeMessage(){return K(r.extension,`defaultChatParticipant`),r._additionalWelcomeMessage},set titleProvider(e){K(r.extension,`defaultChatParticipant`),r._titleProvider=e,n()},get titleProvider(){return K(r.extension,`defaultChatParticipant`),r._titleProvider},set summarizer(e){K(r.extension,`defaultChatParticipant`),r._summarizer=e},get summarizer(){return K(r.extension,`defaultChatParticipant`),r._summarizer},get onDidChangePauseState(){return K(r.extension,`chatParticipantAdditions`),r._pauseStateEmitter.event},onDidPerformAction:Mw(this.extension)?this._onDidPerformAction.event:void 0,dispose(){e=!0,r._followupProvider=void 0,r._onDidReceiveFeedback.dispose(),r._onDidPerformAction.dispose(),r._pauseStateEmitter.dispose(),r._proxy.$unregisterAgent(r._handle)}}}invoke(e,t,n,r){return this._requestHandler(e,t,n,r)}};function FU(e,t,n){return new Promise((r,i)=>{let a=n.onCancellationRequested(async()=>{a.dispose(),await Mo(e),r(void 0)});t.then(r,i).finally(()=>a.dispose())})}var IU=class{constructor(e){this.computeFn=e}get(e){if(!this.cachedPromise){let e=this.computeFn().catch(t=>{throw this.cachedPromise===e&&(this.cachedPromise=void 0),t});this.cachedPromise=e}return bo(this.cachedPromise,e,[])}clear(){this.cachedPromise=void 0}};function LU(e){return e.startsWith(`github.copilot`)}var RU=class{constructor(e,t){this.webviews=t,this._renderers=new Map,this._proxy=e.getProxy(T.MainThreadChatOutputRenderer)}registerChatOutputRenderer(e,t,n){if(this._renderers.has(t))throw Error(`Chat output renderer already registered for: ${t}`);return this._renderers.set(t,{extension:e,renderer:n}),this._proxy.$registerChatOutputRenderer(t,e.identifier,e.extensionLocation),new YT(()=>{this._renderers.delete(t),this._proxy.$unregisterChatOutputRenderer(t)})}async $renderChatOutput(e,t,n,r,i,a){let o=this._renderers.get(e);if(!o)throw Error(`No chat output renderer registered for: ${e}`);let s=this.webviews.createNewWebview(r,{},o.extension),c=Object.freeze({webview:s,onDidDispose:s._onDidDispose});return o.renderer.renderChatOutput(Object.freeze({mime:t,value:n.buffer}),c,Object.freeze(i),a)}},zU=class{#e;#t;#n;#r;#i;get sessionResource(){return this.#i}set sessionResource(e){this.#i=e}#a;get untitledSessionResource(){return this.#a}set untitledSessionResource(e){this.#a=e}constructor(e,t){this.#n=new x,this.onDidChange=this.#n.event,this.#r=new x,this.onDidDispose=this.#r.event,this.#e=e,this.#t=t}get groups(){return this.#e}set groups(e){this.#e=e,this.#t?.()}_fireDidChange(){this.#n.fire()}_setGroups(e){this.#e=e}_dispose(){this.#r.fire(),this.#r.dispose(),this.#n.dispose()}},BU=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;constructor(e,t,n){this.resource=e,this.#e=t,this.#u=n}get label(){return this.#e}set label(e){this.#e!==e&&(this.#e=e,this.#u())}get iconPath(){return this.#t}set iconPath(e){this.#t!==e&&(this.#t=e,this.#u())}get description(){return this.#n}set description(e){this.#n!==e&&(this.#n=e,this.#u())}get badge(){return this.#r}set badge(e){this.#r!==e&&(this.#r=e,this.#u())}get status(){return this.#i}set status(e){this.#i!==e&&(this.#i=e,this.#u())}get archived(){return this.#a}set archived(e){this.#a!==e&&(this.#a=e,this.#u())}get tooltip(){return this.#o}set tooltip(e){this.#o!==e&&(this.#o=e,this.#u())}get timing(){return this.#s}set timing(e){this.#s!==e&&(this.#s=e,this.#u())}get changes(){return this.#c}set changes(e){this.#c!==e&&(this.#c=e,this.#u())}get metadata(){return this.#l}set metadata(e){if(e!==void 0)try{JSON.stringify(e)}catch{throw Error(`metadata must be JSON-serializable`)}pc(this.#l,e)||(this.#l=e,this.#u())}};function VU(e,t){let n={addedOrUpdated:new He,removed:new Ue};for(let[r,i]of t)e.get(r)!==i&&n.addedOrUpdated.set(r,i);for(let r of e.keys())t.has(r)||n.removed.add(r);return n}function HU(e){return{addedOrUpdated:e.addedOrUpdated?Array.from(e.addedOrUpdated.values(),WN.from):[],removed:e.removed?Array.from(e.removed.keys()):[]}}var UU=class{#e=new He;#t;#n;constructor(e,t){this.#t=t,this.#n=e}get size(){return this.#e.size}replace(e){if(!e.length&&!this.#e.size)return;let t=new He(e.map(e=>[e.resource,e])),n=VU(this.#e,t);!n.addedOrUpdated?.size&&!n.removed?.size||(this.#e=t,this.#t.$updateChatSessionItems(this.#n,HU(n)))}forEach(e,t){for(let[n,r]of this.#e)e.call(t,r,this)}add(e){let t=this.#e.get(e.resource);t&&t===e||(this.#e.set(e.resource,e),this.#t.$addOrUpdateChatSessionItem(this.#n,WN.from(e)))}delete(e){this.#e.delete(e)&&this.#t.$updateChatSessionItems(this.#n,{addedOrUpdated:[],removed:[e]})}get(e){return this.#e.get(e)}[Symbol.iterator](){return this.#e.entries()}},WU=class{constructor(e,t,n,r,i,a){this.session=e,this.extension=t,this.proxy=r,this.commandsConverter=i,this.sessionDisposables=a,this._pendingCarouselResolvers=new Map,this._stream=new jU(t,n,r,i,a,this._pendingCarouselResolvers,Bi.None)}get activeResponseStream(){return this._stream}getActiveRequestStream(e){return new jU(this.extension,e,this.proxy,this.commandsConverter,this.sessionDisposables,this._pendingCarouselResolvers,Bi.None)}};let GU=class extends v{constructor(e,t,n,r){super(),this.commands=e,this._languageModels=t,this._extHostRpc=n,this._logService=r,this._itemControllerHandlePool=0,this._chatSessionItemControllers=new Map,this._contentProviderHandlePool=0,this._chatSessionContentProviders=new Map,this._extHostChatSessions=new He,this._proxyCommands=new Map,this._proxy=this._extHostRpc.getProxy(T.MainThreadChatSessions),e.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Mr.AgentSessionContext){let t=e.session.resource;for(let{controller:e}of this._chatSessionItemControllers.values()){let n=e.items.get(t);if(n)return n}return this._logService.warn(`No chat session found with uri: ${t}`),e}return e}})}registerChatSessionItemProvider(e,t,n){let r=this._itemControllerHandlePool++,i=new _,a=i.add(new x),o=new UU(r,this._proxy),s={id:t,items:o,createChatSessionItem:(e,t)=>{throw Error(`Not implemented for providers`)},createChatSessionInputState:e=>new zU([]),onDidChangeChatSessionItemState:a.event,newChatSessionItemHandler:void 0,resolveChatSessionItem:n.resolveChatSessionItem?async(e,t)=>{let r=await n.resolveChatSessionItem(e,t);r&&o.add(r)}:void 0,dispose:()=>{i.dispose()},refreshHandler:async e=>{let t=await n.provideChatSessionItems(e)??[];o.replace(t)}};return this._chatSessionItemControllers.set(r,{chatSessionType:t,controller:s,extension:e,disposable:i,onDidChangeChatSessionItemStateEmitter:a,inputStates:new Set}),this._proxy.$registerChatSessionItemController(r,t,!!n.resolveChatSessionItem),n.onDidChangeChatSessionItems&&i.add(n.onDidChangeChatSessionItems(()=>{this._logService.trace(`ExtHostChatSessions. Provider items changed for ${t}`),s.refreshHandler(Bi.None)})),n.onDidCommitChatSessionItem&&i.add(n.onDidCommitChatSessionItem(e=>{let{original:t,modified:n}=e;this._proxy.$onDidCommitChatSessionItem(r,t.resource,n.resource)})),Object.assign({dispose:()=>{this._chatSessionItemControllers.delete(r),i.dispose(),this._proxy.$unregisterChatSessionItemController(r)}},{onDidChangeChatSessionItemState:a.event})}createChatSessionItemController(e,t,n){let r=this._itemControllerHandlePool++,i=new _,a=!1,o,s,c,l,u=i.add(new x),d=new Set,f=new UU(r,this._proxy),p=this._proxy,m=Object.freeze({id:t,refreshHandler:async e=>{if(a)throw Error(`ChatSessionItemController has been disposed`);this._logService.trace(`ExtHostChatSessions. Controller(${t}).refresh()`),await n(e)},items:f,onDidChangeChatSessionItemState:u.event,createChatSessionItem:(e,t)=>{if(a)throw Error(`ChatSessionItemController has been disposed`);let n=new BU(e,t,()=>{f.get(e)===n&&this._proxy.$addOrUpdateChatSessionItem(r,WN.from(n))});return n},get newChatSessionItemHandler(){return o},set newChatSessionItemHandler(e){o=e},get forkHandler(){return s},set forkHandler(e){s=e},get resolveChatSessionItem(){return c},set resolveChatSessionItem(e){let t=!!c;c=e;let n=!!e;t!==n&&!a&&p.$updateChatSessionItemControllerCapabilities(r,n)},get getChatSessionInputState(){return l},set getChatSessionInputState(e){l=e},createChatSessionInputState:e=>{if(a)throw Error(`ChatSessionItemController has been disposed`);let t=new zU(e,()=>{let e=this._chatSessionItemControllers.get(r);e&&(e.optionGroups=t.groups);let n=this._wrapOptionGroupCommands(r,t.groups).map(e=>({id:e.id,name:e.name,description:e.description,items:e.items,selected:e.selected,when:e.when,icon:e.icon,commands:e.commands,kind:e.kind})),i=t.sessionResource??t.untitledSessionResource;i&&this._proxy.$updateChatSessionInputState(r,i,n)});return d.add(t),t},dispose:()=>{a=!0;for(let e of d)e._dispose();d.clear(),i.dispose()}});return this._chatSessionItemControllers.set(r,{controller:m,extension:e,disposable:i,chatSessionType:t,onDidChangeChatSessionItemStateEmitter:u,inputStates:d}),this._proxy.$registerChatSessionItemController(r,t,!!c),i.add(g(()=>{this._chatSessionItemControllers.delete(r),this._proxy.$unregisterChatSessionItemController(r)})),m}registerChatSessionContentProvider(e,t,n,r,i){let a=this._contentProviderHandlePool++,o=new _;return this._chatSessionContentProviders.set(a,{chatSessionScheme:t,provider:r,extension:e,capabilities:i,disposable:o}),this._proxy.$registerChatSessionContentProvider(a,t),r.onDidChangeChatSessionOptions&&o.add(r.onDidChangeChatSessionOptions(e=>{let t=Object.create(null);for(let n of e.updates)t[n.optionId]=n.value;this._proxy.$onDidChangeChatSessionOptions(a,e.resource,t)})),r.onDidChangeChatSessionProviderOptions&&o.add(r.onDidChangeChatSessionProviderOptions(()=>{this._proxy.$onDidChangeChatSessionProviderOptions(a)})),new YT(()=>{this._chatSessionContentProviders.delete(a),o.dispose(),this._proxy.$unregisterChatSessionContentProvider(a)})}async $provideChatSessionContent(e,t,n,r){let i=this._chatSessionContentProviders.get(e);if(!i)throw Error(`No provider for handle ${e}`);let a=C.revive(t),o=this.getChatSessionItemController(ph(a)),s;if(o?.controller.getChatSessionInputState){let e=await o.controller.getChatSessionInputState(mh(a)?void 0:a,{previousInputState:this._createInputStateFromOptions(o.optionGroups??[],n.initialSessionOptions)},r);e&&(s=e)}s??=this._createInputStateFromOptions(o?.optionGroups??[],n.initialSessionOptions),s instanceof zU&&(o&&this._disposeInputStatesForResource(o.inputStates,a),mh(a)?s.untitledSessionResource=a:s.sessionResource=a);let c=await i.provider.provideChatSessionContent(a,r,{inputState:s});if(r.isCancellationRequested)throw new ie;let l=new _,u=a.toString(),d=new WU(c,i.extension,{sessionResource:a,requestId:`ongoing`,agentId:u,message:``,variables:{variables:[]},location:xy.Chat},{$handleProgressChunk:(t,n)=>this._proxy.$handleProgressChunk(e,a,t,n),$handleAnchorResolve:(t,n,r)=>{this._proxy.$handleAnchorResolve(e,a,t,n,r)}},this.commands.converter,l),f=l.add(new Hi);this._extHostChatSessions.set(a,{sessionObj:d,disposeCts:f}),c.activeResponseCallback&&Promise.resolve(c.activeResponseCallback(d.activeResponseStream.apiObject,f.token)).finally(()=>{this._proxy.$handleProgressComplete(e,a,`ongoing`)});let{capabilities:p}=i;return{resource:C.revive(a),title:c.title,hasActiveResponseCallback:!!c.activeResponseCallback,hasRequestHandler:!!c.requestHandler,hasForkHandler:!!o?.controller.forkHandler||!!c.forkHandler,supportsInterruption:!!p?.supportsInterruptions,options:c.options,history:c.history.map(e=>e instanceof oA?this.convertRequestTurn(e):this.convertResponseTurn(e,l))}}async $provideHandleOptionsChange(e,t,n,r){let i=C.revive(t),a=this._chatSessionContentProviders.get(e);if(!a){this._logService.warn(`No provider for handle ${e}`);return}if(a.provider.provideHandleOptionsChange){try{let e=Object.entries(n).map(([e,t])=>({optionId:e,value:t===void 0?void 0:typeof t==`string`?t:t.id}));a.provider.provideHandleOptionsChange(i,e,r)}catch(t){this._logService.error(`Error calling provideHandleOptionsChange for handle ${e}, sessionResource ${i}:`,t)}return}let o=ph(i),s=this.getChatSessionItemController(o);if(!s||!s.controller.getChatSessionInputState){this._logService.warn(`No valid controller found for session type ${o}`);return}for(let e of s?.inputStates??[]){let t=e.groups.map(e=>{let t=n[e.id];if(!t)return e;let r=typeof t==`string`?t:t.id,i=e.items.find(e=>e.id===r);return i?{...e,selected:i}:e});e._setGroups(t),e._fireDidChange()}}async $provideChatSessionProviderOptions(e,t){let n=this._chatSessionContentProviders.get(e);if(!n){this._logService.warn(`No provider for handle ${e} when requesting chat session options`);return}let r=n.provider;if(r.provideChatSessionProviderOptions)try{let e=await r.provideChatSessionProviderOptions(t);if(!e)return;let{optionGroups:i,newSessionOptions:a}=e;if(i){let e=this.getChatSessionItemController(n.chatSessionScheme);e&&(e.optionGroups=i)}return{optionGroups:i,newSessionOptions:a}}catch(t){this._logService.error(`Error calling provideChatSessionProviderOptions for handle ${e}:`,t);return}}async $interruptChatSessionActiveResponse(e,t,n){this._extHostChatSessions.get(C.revive(t))?.disposeCts.cancel()}async $disposeChatSessionContent(e,t){let n=C.revive(t),r=this._extHostChatSessions.get(n);if(!r){this._logService.warn(`No chat session found for resource: ${t}`);return}let i=this.getChatSessionItemController(n.scheme);i&&this._disposeInputStatesForResource(i.inputStates,n),r.disposeCts.cancel(),r.sessionObj.sessionDisposables.dispose(),this._extHostChatSessions.delete(n)}async $invokeChatSessionRequestHandler(e,t,n,r,i){let a=this._extHostChatSessions.get(C.revive(t));if(!a||!a.sessionObj.session.requestHandler)return{};let o=_N.to(n,void 0,await this.getModelForRequest(n,a.sessionObj.extension),n.modelConfiguration,[],new Map,a.sessionObj.extension,this._logService),s=a.sessionObj.getActiveRequestStream(n);return await a.sessionObj.session.requestHandler(o,{history:r,yieldRequested:!1},s.apiObject,i),{}}async $forkChatSession(e,t,n,r){let i=C.revive(t),a=this._extHostChatSessions.get(i);if(!a)throw Error(`No chat session found for resource ${i.toString()}`);let o=this.convertRequestDtoToRequestTurn(n),s=this.getChatSessionItemController(ph(i));if(s?.controller.forkHandler){let e=await s.controller.forkHandler(i,o,r);return WN.from(e)}if(!a.sessionObj.session.forkHandler)throw Error(`No fork handler for session ${i.toString()}`);let c=await a.sessionObj.session.forkHandler(i,o,r);return WN.from(c)}convertRequestDtoToRequestTurn(e){if(e)return new oA(e.prompt,e.command,[],e.participant,[],void 0,e.id,e.modelId,CN.to(e.modeInstructions))}getChatSessionItemController(e){for(let t of this._chatSessionItemControllers.values())if(t.chatSessionType===e)return t}_disposeInputStatesForResource(e,t){for(let n of e){let r=n.sessionResource??n.untitledSessionResource;r&&ao(t,r)&&(n._dispose(),e.delete(n))}}_createInputStateFromOptions(e,t){return t?.length?new zU(e.map(e=>{let n=t.find(t=>t.optionId===e.id);if(!n)return e;let r=e.items.find(e=>e.id===n.value);return r?{...e,selected:r}:e})):new zU(e)}async getInputStateForSession(e,t,n){let r=e?ph(e):void 0,i=r?this.getChatSessionItemController(r):void 0,a=e&&!mh(e)?e:void 0;if(i?.controller.getChatSessionInputState){let r=await i.controller.getChatSessionInputState(a,{previousInputState:this._createInputStateFromOptions(i.optionGroups??[],t)},n);if(r)return r instanceof zU&&(e&&i&&this._disposeInputStatesForResource(i.inputStates,e),e&&mh(e)?r.untitledSessionResource=e:e&&(r.sessionResource=a)),r}let o=this._createInputStateFromOptions(i?.optionGroups??[],t);return o.sessionResource=a,o}_wrapOptionGroupCommands(e,t){return this._chatSessionItemControllers.get(e)?.controller.getChatSessionInputState?t.map(t=>t.commands?.length?{...t,commands:t.commands.map(t=>{let n=`_chatSession.proxyCommand.${Gc()}`;return this._proxyCommands.set(n,{originalCommandId:t.command,controllerHandle:e}),this.commands.registerCommand(!0,n,async(...e)=>{let n=e[0]instanceof C?e[0]:void 0,r=await this.getInputStateForSession(n,void 0,Bi.None);return this.commands.executeCommand(t.command,{inputState:r,sessionResource:n},...t.arguments??[])}),{...t,command:n}})}:t):t}async getModelForRequest(e,t){let n;if(e.userSelectedModelId&&(n=await this._languageModels.getLanguageModelByIdentifier(t,e.userSelectedModelId)),!n&&(n=await this._languageModels.getDefaultLanguageModel(t),!n))throw Error(`Language model unavailable`);return n}convertRequestTurn(e){let t=e.references.map(e=>this.convertReferenceToVariable(e));return{type:`request`,id:e.id,prompt:e.prompt,participant:e.participant,command:e.command,variableData:t.length>0?{variables:t}:void 0,modelId:e.modelId,modeInstructions:CN.from(e.modeInstructions2)}}convertReferenceToVariable(e){let t=e.value&&typeof e.value==`object`&&`uri`in e.value&&`range`in e.value?uj.from(e.value):e.value,n=e.range?{start:e.range[0],endExclusive:e.range[1]}:void 0;if(t&&t instanceof PA&&Array.isArray(t.diagnostics)&&t.diagnostics.length&&t.diagnostics[0][1].length){let e=hj.from(t.diagnostics[0][1][0]),n={filterRange:{startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn},filterSeverity:e.severity,filterUri:t.diagnostics[0][0],problemMessage:t.diagnostics[0][1][0].message};return gh.toEntry(n)}if(gT.isLocation(e.value)&&e.name.startsWith(`sym:`)){let t=uj.from(e.value);return{id:e.id,name:e.name,fullName:e.name.substring(4),value:{uri:e.value.uri,range:t.range},symbolKind:V.Property,icon:Xp.toIcon(V.Property),kind:`symbol`,range:n}}if(C.isUri(t)&&e.name.startsWith(`prompt:`)){if(e.id.startsWith(xh.Instruction))return Sh(t,xh.Instruction);if(e.id.startsWith(xh.InstructionReference))return Sh(t,xh.InstructionReference);if(e.id.startsWith(xh.PromptFile))return Sh(t,xh.PromptFile)}let r=C.isUri(t)||t&&typeof t==`object`&&`uri`in t,i=r&&C.isUri(t)&&t.path.endsWith(`/`);return{id:e.id,name:e.name,value:t,modelDescription:e.modelDescription,range:n,kind:i?`directory`:r?`file`:`generic`}}convertResponseTurn(e,t){return{type:`response`,parts:Se(e.response.map(e=>gN.from(e,this.commands.converter,t))),participant:e.participant,details:e.result?.details}}async $refreshChatSessionItems(e,t){let n=this._chatSessionItemControllers.get(e);if(!n){this._logService.warn(`No controller found for handle ${e}`);return}await n.controller.refreshHandler(t)}async $newChatSessionItem(e,t,n){let r=this._chatSessionItemControllers.get(e);if(!r){this._logService.warn(`No controller found for handle ${e}`);return}let i=r.controller.newChatSessionItemHandler;if(!i)return;let a=this._createInputStateFromOptions(r.optionGroups??[],t.initialSessionOptions),o;o=r.controller.getChatSessionInputState?await r.controller.getChatSessionInputState(void 0,{previousInputState:a},n):a;let s=await i({request:{prompt:t.prompt,command:t.command},inputState:o},n);if(s)return r.controller.items.add(s),WN.from(s)}$onDidChangeChatSessionItemState(e,t,n){let r=this._chatSessionItemControllers.get(e);if(!r){this._logService.warn(`No controller found for handle ${e}`);return}let i=C.revive(t),a=r.controller.items.get(i);if(!a){this._logService.warn(`No item found for session resource ${i.toString()}`);return}a.archived=n,r.onDidChangeChatSessionItemStateEmitter.fire(a)}async $resolveChatSessionItem(e,t,n){let r=C.revive(t),i=this._chatSessionItemControllers.get(e);if(!i?.controller.resolveChatSessionItem)return;let a=i.controller.items.get(r);if(!a){this._logService.warn(`No item found for session resource ${r.toString()}`);return}await i.controller.resolveChatSessionItem(a,n);let o=i.controller.items.get(r);if(o)return WN.from(o)}async $provideChatSessionInputState(e,t,n){let r=this._chatSessionItemControllers.get(e);if(!r){this._logService.warn(`No controller found for handle ${e}`);return}let i=r.controller.getChatSessionInputState;if(!i)return;let a=t?C.revive(t):void 0,o=await i(!a||mh(a)?void 0:a,{previousInputState:void 0},n);if(o)return o instanceof zU&&a&&(this._disposeInputStatesForResource(r.inputStates,a),mh(a)?o.untitledSessionResource=a:o.sessionResource=a),r.optionGroups=o.groups,this._wrapOptionGroupCommands(e,o.groups).map(e=>({id:e.id,name:e.name,description:e.description,items:e.items,selected:e.selected,when:e.when,icon:e.icon,commands:e.commands,kind:e.kind}))}};GU=k([A(2,Js),A(3,Ns)],GU);var KU=class{constructor(e){this._items=new Map,this._proxy=e.getProxy(T.MainThreadChatStatus)}createChatStatusItem(e,t){let n=qU(e.identifier,t);if(this._items.has(n))throw Error(`Chat status item '${t}' already exists`);let r={id:n,title:``,description:``,detail:``,tooltip:void 0},i=!1,a=!1,o=()=>{if(i)throw Error(`Chat status item is disposed`);a&&this._proxy.$setEntry(t,r)},s=Object.freeze({id:t,get title(){return r.title},set title(e){r.title=e,o()},get description(){return r.description},set description(e){r.description=e,o()},get detail(){return r.detail},set detail(e){r.detail=e,o()},get tooltip(){return r.tooltip},set tooltip(e){r.tooltip=e,o()},show:()=>{a=!0,o()},hide:()=>{a=!1,this._proxy.$disposeEntry(t)},dispose:()=>{i=!0,this._proxy.$disposeEntry(t),this._items.delete(n)}});return this._items.set(n,s),s}};function qU(e,t){return`${Ts.toKey(e)}.${t}`}var JU=class extends v{constructor(e){super(),this._proxy=e.getProxy(T.MainThreadChatQuota)}updateQuotas(e){this._proxy.$updateQuotas(e)}},YU=class{constructor(e){this._items=new Map,this._proxy=e.getProxy(T.MainThreadChatInputNotification)}createInputNotification(e,t){let n=XU(e.identifier,t);if(this._items.has(n))throw Error(`Chat input notification '${t}' already exists`);let r={id:n,severity:Li.Info,message:``,description:void 0,actions:[],dismissible:!0,autoDismissOnMessage:!1},i=!1,a=!1,o=()=>{if(i)throw Error(`Chat input notification is disposed`);a&&this._proxy.$setNotification({...r})},s=Object.freeze({id:t,get severity(){return r.severity},set severity(e){r.severity=e,o()},get message(){return r.message},set message(e){r.message=e,o()},get description(){return r.description},set description(e){r.description=e,o()},get actions(){return r.actions},set actions(e){r.actions=e.map(e=>({label:e.label,commandId:e.commandId,commandArgs:e.commandArgs})),o()},get dismissible(){return r.dismissible},set dismissible(e){r.dismissible=e,o()},get autoDismissOnMessage(){return r.autoDismissOnMessage},set autoDismissOnMessage(e){r.autoDismissOnMessage=e,o()},show:()=>{a=!0,o()},hide:()=>{i||(a=!1,this._proxy.$disposeNotification(n))},dispose:()=>{i||(i=!0,a=!1,this._proxy.$disposeNotification(n),this._items.delete(n))}});return this._items.set(n,s),s}};function XU(e,t){return`${Ts.toKey(e)}.${t}`}var ZU=class{constructor(e){let t=e.getProxy(T.MainThreadClipboard);this.value=Object.freeze({readText(){return t.$readText()},writeText(e){return t.$writeText(e)}})}};const QU=`vscode-cdn.net`,$U=`vscode-resource.${QU}`,eW=`'self' https://*.${QU}`;function tW(e,t){return e.scheme===D.http||e.scheme===D.https?e:(t&&t.authority&&t.isRemote&&e.scheme===D.file&&(e=C.from({scheme:D.vscodeRemote,authority:t.authority,path:e.path})),C.from({scheme:D.https,authority:`${e.scheme}+${nW(e.authority)}.${$U}`,path:e.path,fragment:e.fragment,query:e.query}))}function nW(e){return e.replace(/./g,e=>{let t=e.charCodeAt(0);return t>=S.a&&t<=S.z||t>=S.A&&t<=S.Z||t>=S.Digit0&&t<=S.Digit9?e:`-`+t.toString(16).padStart(4,`0`)})}var rW=class{constructor(e,t,n){this._proxy=e,this._editors=t,this._remoteInfo=n,this._handlePool=0,this._disposables=new _,this._insets=new Map,this._disposables.add(t.onDidChangeVisibleTextEditors(()=>{let e=t.getVisibleTextEditors();for(let t of this._insets.values())e.indexOf(t.editor)<0&&t.inset.dispose()}))}dispose(){this._insets.forEach(e=>e.inset.dispose()),this._disposables.dispose()}createWebviewEditorInset(e,t,n,r,i){let a;for(let t of this._editors.getVisibleTextEditors(!0))if(t.value===e){a=t;break}if(!a)throw Error(`not a visible editor`);let o=this,s=this._handlePool++,c=new x,l=new x,u=new class{constructor(){this._html=``,this._options=Object.create(null)}asWebviewUri(e){return tW(e,o._remoteInfo)}get cspSource(){return eW}set options(e){this._options=e,o._proxy.$setOptions(s,e)}get options(){return this._options}set html(e){this._html=e,o._proxy.$setHtml(s,e)}get html(){return this._html}get onDidReceiveMessage(){return c.event}postMessage(e){return o._proxy.$postMessage(s,e)}},d=new class{constructor(){this.editor=e,this.line=t,this.height=n,this.webview=u,this.onDidDispose=l.event}dispose(){o._insets.delete(s)&&(o._proxy.$disposeEditorInset(s),l.fire(),l.dispose(),c.dispose())}};return this._proxy.$createEditorInset(s,a.id,a.value.document.uri,t+1,n,r||{},i.identifier,i.extensionLocation),this._insets.set(s,{editor:e,inset:d,onDidReceiveMessage:c}),d}$onDidDispose(e){let t=this._insets.get(e);t&&t.inset.dispose()}$onDidReceiveMessage(e,t){this._insets.get(e)?.onDidReceiveMessage.fire(t)}},iW=class e{static{this._providerHandlePool=0}constructor(e){this.providers=new Map,this._proxy=e.getProxy(T.MainThreadCodeMapper)}async $mapCode(e,t,n){let r=this.providers.get(e);if(!r)throw Error(`Received request to map code for unknown provider handle ${e}`);let i={textEdit:(e,n)=>{n=ke(n),this._proxy.$handleProgress(t.requestId,{uri:e,edits:n.map(Dj.from)})},notebookEdit:(e,n)=>{n=ke(n),this._proxy.$handleProgress(t.requestId,{uri:e,edits:n.map(dN.from)})}},a={location:t.location,chatRequestId:t.chatRequestId,chatRequestModel:t.chatRequestModel,chatSessionId:t.chatSessionResource?fh.parseLocalSessionId(C.revive(t.chatSessionResource)):void 0,codeBlocks:t.codeBlocks.map(e=>({code:e.code,resource:C.revive(e.resource),markdownBeforeBlock:e.markdownBeforeBlock}))};return await r.provideMappedEdits(a,i,n)??null}registerMappedEditsProvider(t,n){let r=e._providerHandlePool++;return this._proxy.$registerCodeMapperProvider(r,t.displayName??t.name),this.providers.set(r,n),{dispose:()=>this._proxy.$unregisterCodeMapperProvider(r)}}};function aW(e,t,n){let r=e.getProxy(T.MainThreadComments);class i{static{this.handlePool=0}constructor(){this._commentControllers=new Map,this._commentControllersByExtension=new Ds,t.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Mr.CommentController){let t=this._commentControllers.get(e.handle);return t?t.value:e}else if(e&&e.$mid===Mr.CommentThread){let t=e,n=this._commentControllers.get(t.commentControlHandle);if(!n)return t;let r=n.getCommentThread(t.commentThreadHandle);return r?r.value:t}else if(e&&(e.$mid===Mr.CommentThreadReply||e.$mid===Mr.CommentThreadInstance)){let t=this._commentControllers.get(e.thread.commentControlHandle);if(!t)return e;let n=t.getCommentThread(e.thread.commentThreadHandle);return n?e.$mid===Mr.CommentThreadInstance?n.value:{thread:n.value,text:e.text}:e}else if(e&&e.$mid===Mr.CommentNode){let t=this._commentControllers.get(e.thread.commentControlHandle);if(!t)return e;let n=t.getCommentThread(e.thread.commentThreadHandle);if(!n)return e;let r=e.commentUniqueId;return n.getCommentByUniqueId(r)||e}else if(e&&e.$mid===Mr.CommentThreadNode){let t=this._commentControllers.get(e.thread.commentControlHandle);if(!t)return e;let n=t.getCommentThread(e.thread.commentThreadHandle);if(!n)return e;let r=e.text,i=e.commentUniqueId,a=n.getCommentByUniqueId(i);return a?(typeof a.body==`string`?a.body=r:a.body=new rT(r),a):e}return e}})}createCommentController(e,t,n){let r=new o(e,i.handlePool++,t,n);this._commentControllers.set(r.handle,r);let a=this._commentControllersByExtension.get(e.identifier)||[];return a.push(r),this._commentControllersByExtension.set(e.identifier,a),r.value}async $createCommentThreadTemplate(e,t,n,r){let i=this._commentControllers.get(e);i&&i.$createCommentThreadTemplate(t,n,r)}async $setActiveComment(e,t){let n=this._commentControllers.get(e);n&&n.$setActiveComment(t??void 0)}async $updateCommentThreadTemplate(e,t,n){let r=this._commentControllers.get(e);r&&r.$updateCommentThreadTemplate(t,n)}$deleteCommentThread(e,t){this._commentControllers.get(e)?.$deleteCommentThread(t)}async $updateCommentThread(e,t,n){this._commentControllers.get(e)?.$updateCommentThread(t,n)}async $provideCommentingRanges(e,t,r){let i=this._commentControllers.get(e);if(!i||!i.commentingRangeProvider)return Promise.resolve(void 0);let a=await n.ensureDocumentData(C.revive(t));return So(async()=>{let e=await i.commentingRangeProvider?.provideCommentingRanges(a.document,r),t;return t=Array.isArray(e)?{ranges:e,fileComments:!1}:e?{ranges:e.ranges||[],fileComments:e.enableFileComments||!1}:e??void 0,t}).then(e=>{let t;return e&&(t={ranges:e.ranges.map(e=>J.from(e)),fileComments:e.fileComments}),t})}$toggleReaction(e,t,n,r,i){let a=this._commentControllers.get(e);return!a||!a.reactionHandler?Promise.resolve(void 0):So(()=>{let e=a.getCommentThread(t);if(e){let t=e.getCommentByUniqueId(r.uniqueIdInThread);if(a!==void 0&&t&&a.reactionHandler)return a.reactionHandler(t,l(i))}return Promise.resolve(void 0)})}}class a{static{this._handlePool=0}set threadId(e){this._id=e}get threadId(){return this._id}get id(){return this._id}get resource(){return this._uri}get uri(){return this._uri}set range(e){(e===void 0!=(this._range===void 0)||!e||!this._range||!e.isEqual(this._range))&&(this._range=e,this.modifications.range=e,this._onDidUpdateCommentThread.fire())}get range(){return this._range}set canReply(e){this._canReply!==e&&(this._canReply=e,this.modifications.canReply=e,this._onDidUpdateCommentThread.fire())}get canReply(){return this._canReply}get label(){return this._label}set label(e){this._label=e,this.modifications.label=e,this._onDidUpdateCommentThread.fire()}get contextValue(){return this._contextValue}set contextValue(e){this._contextValue=e,this.modifications.contextValue=e,this._onDidUpdateCommentThread.fire()}get comments(){return this._comments}set comments(e){this._comments=e,this.modifications.comments=e,this._onDidUpdateCommentThread.fire()}get collapsibleState(){return this._collapseState}set collapsibleState(e){this._collapseState!==e&&(this._collapseState=e,this.modifications.collapsibleState=e,this._onDidUpdateCommentThread.fire())}get state(){return this._state}set state(e){this._state=e,typeof e==`object`?(K(this.extensionDescription,`commentThreadApplicability`),this.modifications.state=e.resolved,this.modifications.applicability=e.applicability):this.modifications.state=e,this._onDidUpdateCommentThread.fire()}get isDisposed(){return this._isDiposed}constructor(e,t,n,i,o,c,l,u,d){this._commentControllerHandle=t,this._id=n,this._uri=i,this._range=o,this._comments=c,this.extensionDescription=l,this._isTemplate=u,this.handle=a._handlePool++,this.commentHandle=0,this.modifications=Object.create(null),this._onDidUpdateCommentThread=new x,this.onDidUpdateCommentThread=this._onDidUpdateCommentThread.event,this._canReply=!0,this._commentsMap=new Map,this._acceptInputDisposables=new wt,this._acceptInputDisposables.value=new _,this._id===void 0&&(this._id=`${e}.${this.handle}`),r.$createCommentThread(t,this.handle,this._id,this._uri,J.from(this._range),this._comments.map(e=>s(this,e,this._commentsMap,this.extensionDescription)),l.identifier,this._isTemplate,d),this._localDisposables=[],this._isDiposed=!1,this._localDisposables.push(this.onDidUpdateCommentThread(()=>{this.eventuallyUpdateCommentThread()})),this._localDisposables.push({dispose:()=>{r.$deleteCommentThread(t,this.handle)}});let f=this;this.value={get uri(){return f.uri},get range(){return f.range},set range(e){f.range=e},get comments(){return f.comments},set comments(e){f.comments=e},get collapsibleState(){return f.collapsibleState},set collapsibleState(e){f.collapsibleState=e},get canReply(){return f.canReply},set canReply(e){f.canReply=e},get contextValue(){return f.contextValue},set contextValue(e){f.contextValue=e},get label(){return f.label},set label(e){f.label=e},get state(){return f.state},set state(e){f.state=e},reveal:(e,t)=>f.reveal(e,t),hide:()=>f.hide(),dispose:()=>{f.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 _);let e=e=>Object.prototype.hasOwnProperty.call(this.modifications,e),t={};e(`range`)&&(t.range=J.from(this._range)),e(`label`)&&(t.label=this.label),e(`contextValue`)&&(t.contextValue=this.contextValue??null),e(`comments`)&&(t.comments=this._comments.map(e=>s(this,e,this._commentsMap,this.extensionDescription))),e(`collapsibleState`)&&(t.collapseState=u(this._collapseState)),e(`canReply`)&&(t.canReply=this.canReply),e(`state`)&&(t.state=d(this._state)),e(`applicability`)&&(t.applicability=f(this._state)),e(`isTemplate`)&&(t.isTemplate=this._isTemplate),this.modifications={},r.$updateCommentThread(this._commentControllerHandle,this.handle,this._id,this._uri,t)}getCommentByUniqueId(e){for(let t of this._commentsMap){let n=t[0];if(e===t[1])return n}}async reveal(e,t){K(this.extensionDescription,`commentReveal`);let n;e&&e.body!==void 0?n=e:t??=e;let i=n?this._commentsMap.get(n):void 0;i??=this._commentsMap.get(this._comments[0]);let a=!0,o=!1;return t?.focus===mO.Reply?(o=!0,a=!1):t?.focus===mO.Comment&&(a=!1),r.$revealCommentThread(this._commentControllerHandle,this.handle,i,{preserveFocus:a,focusReply:o})}async hide(){return r.$hideCommentThread(this._commentControllerHandle,this.handle)}dispose(){this._isDiposed=!0,this._acceptInputDisposables.dispose(),this._onDidUpdateCommentThread.dispose(),this._localDisposables.forEach(e=>e.dispose())}}class o{get id(){return this._id}get label(){return this._label}get handle(){return this._handle}get commentingRangeProvider(){return this._commentingRangeProvider}set commentingRangeProvider(e){this._commentingRangeProvider=e,e?.resourceHints&&K(this._extension,`commentingRangeHint`),r.$updateCommentingRanges(this.handle,e?.resourceHints)}get reactionHandler(){return this._reactionHandler}set reactionHandler(e){this._reactionHandler=e,r.$updateCommentControllerFeatures(this.handle,{reactionHandler:!!e})}get options(){return this._options}set options(e){this._options=e,r.$updateCommentControllerFeatures(this.handle,{options:this._options})}get activeComment(){return K(this._extension,`activeComment`),this._activeComment}get activeCommentThread(){return K(this._extension,`activeComment`),this._activeThread?.value}constructor(e,t,n,i){this._extension=e,this._handle=t,this._id=n,this._label=i,this._threads=new Map,r.$registerCommentController(this.handle,n,i,this._extension.identifier.value);let a=this;this.value=Object.freeze({id:a.id,label:a.label,get options(){return a.options},set options(e){a.options=e},get commentingRangeProvider(){return a.commentingRangeProvider},set commentingRangeProvider(e){a.commentingRangeProvider=e},get reactionHandler(){return a.reactionHandler},set reactionHandler(e){a.reactionHandler=e},get activeCommentThread(){return a.activeCommentThread},createCommentThread(e,t,n){return a.createCommentThread(e,t,n).value},dispose:()=>{a.dispose()}}),this._localDisposables=[],this._localDisposables.push({dispose:()=>{r.$unregisterCommentController(this.handle)}})}createCommentThread(e,t,n){let r=new a(this.id,this.handle,void 0,e,t,n,this._extension,!1);return this._threads.set(r.handle,r),r}$setActiveComment(e){if(!e){this._activeComment=void 0,this._activeThread=void 0;return}let t=this._threads.get(e.commentThreadHandle);t&&(this._activeComment=e.uniqueIdInThread?t.getCommentByUniqueId(e.uniqueIdInThread):void 0,this._activeThread=t)}$createCommentThreadTemplate(e,t,n){let r=new a(this.id,this.handle,void 0,C.revive(e),J.to(t),[],this._extension,!0,n);return r.collapsibleState=tm.Expanded,this._threads.set(r.handle,r),r}$updateCommentThreadTemplate(e,t){let n=this._threads.get(e);n&&(n.range=J.to(t))}$updateCommentThread(e,t){let n=this._threads.get(e);n&&(e=>Object.prototype.hasOwnProperty.call(t,e))(`collapseState`)&&(n.collapsibleState=u(t.collapseState))}$deleteCommentThread(e){this._threads.get(e)?.dispose(),this._threads.delete(e)}getCommentThread(e){return this._threads.get(e)}dispose(){this._threads.forEach(e=>{e.dispose()}),this._localDisposables.forEach(e=>e.dispose())}}function s(e,t,n,r){let i=n.get(t);return i||(i=++e.commentHandle,n.set(t,i)),t.state!==void 0&&K(r,`commentsDraftState`),t.reactions?.some(e=>e.reactors!==void 0)&&K(r,`commentReactor`),{mode:t.mode,contextValue:t.contextValue,uniqueIdInThread:i,body:typeof t.body==`string`?t.body:Y.from(t.body),userName:t.author.name,userIconPath:t.author.iconPath,label:t.label,commentReactions:t.reactions?t.reactions.map(e=>c(e)):void 0,state:t.state,timestamp:t.timestamp?.toJSON()}}function c(e){return{label:e.label,iconPath:e.iconPath?Sj(e.iconPath):void 0,count:e.count,hasReacted:e.authorHasReacted,reactors:e.reactors&&e.reactors.length>0&&typeof e.reactors[0]!=`string`?e.reactors.map(e=>e.name):e.reactors}}function l(e){return{label:e.label||``,count:e.count||0,iconPath:e.iconPath?C.revive(e.iconPath):``,authorHasReacted:e.hasReacted||!1,reactors:e.reactors?.map(e=>({name:e}))}}function u(e){if(e!==void 0)switch(e){case lO.Expanded:return tm.Expanded;case lO.Collapsed:return tm.Collapsed}return tm.Collapsed}function d(e){let t;if(t=typeof e==`object`?e.resolved:e,t!==void 0)switch(t){case fO.Unresolved:return nm.Unresolved;case fO.Resolved:return nm.Resolved}return nm.Unresolved}function f(e){let t;if(typeof e==`object`&&(t=e.applicability),t!==void 0)switch(t){case pO.Current:return rm.Current;case pO.Outdated:return rm.Outdated}return rm.Current}return new i}var oW={exports:{}},sW;function cW(){return sW?oW.exports:(sW=1,(function(e,t){t=e.exports=Le;var n=typeof process==`object`&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift(`SEMVER`),console.log.apply(console,e)}:function(){};t.SEMVER_SPEC_VERSION=`2.0.0`;var r=256,i=2**53-1||9007199254740991,a=16,o=t.re=[],s=t.src=[],c=0,l=c++;s[l]=`0|[1-9]\\d*`;var u=c++;s[u]=`[0-9]+`;var d=c++;s[d]=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`;var f=c++;s[f]=`(`+s[l]+`)\\.(`+s[l]+`)\\.(`+s[l]+`)`;var p=c++;s[p]=`(`+s[u]+`)\\.(`+s[u]+`)\\.(`+s[u]+`)`;var m=c++;s[m]=`(?:`+s[l]+`|`+s[d]+`)`;var ee=c++;s[ee]=`(?:`+s[u]+`|`+s[d]+`)`;var te=c++;s[te]=`(?:-(`+s[m]+`(?:\\.`+s[m]+`)*))`;var ne=c++;s[ne]=`(?:-?(`+s[ee]+`(?:\\.`+s[ee]+`)*))`;var h=c++;s[h]=`[0-9A-Za-z-]+`;var re=c++;s[re]=`(?:\\+(`+s[h]+`(?:\\.`+s[h]+`)*))`;var ie=c++,ae=`v?`+s[f]+s[te]+`?`+s[re]+`?`;s[ie]=`^`+ae+`$`;var oe=`[v=\\s]*`+s[p]+s[ne]+`?`+s[re]+`?`,se=c++;s[se]=`^`+oe+`$`;var ce=c++;s[ce]=`((?:<|>)?=?)`;var le=c++;s[le]=s[u]+`|x|X|\\*`;var ue=c++;s[ue]=s[l]+`|x|X|\\*`;var de=c++;s[de]=`[v=\\s]*(`+s[ue]+`)(?:\\.(`+s[ue]+`)(?:\\.(`+s[ue]+`)(?:`+s[te]+`)?`+s[re]+`?)?)?`;var fe=c++;s[fe]=`[v=\\s]*(`+s[le]+`)(?:\\.(`+s[le]+`)(?:\\.(`+s[le]+`)(?:`+s[ne]+`)?`+s[re]+`?)?)?`;var pe=c++;s[pe]=`^`+s[ce]+`\\s*`+s[de]+`$`;var me=c++;s[me]=`^`+s[ce]+`\\s*`+s[fe]+`$`;var he=c++;s[he]=`(?:^|[^\\d])(\\d{1,`+a+`})(?:\\.(\\d{1,`+a+`}))?(?:\\.(\\d{1,`+a+`}))?(?:$|[^\\d])`;var ge=c++;s[ge]=`(?:~>?)`;var _e=c++;s[_e]=`(\\s*)`+s[ge]+`\\s+`,o[_e]=new RegExp(s[_e],`g`);var ve=`$1~`,ye=c++;s[ye]=`^`+s[ge]+s[de]+`$`;var be=c++;s[be]=`^`+s[ge]+s[fe]+`$`;var xe=c++;s[xe]=`(?:\\^)`;var Se=c++;s[Se]=`(\\s*)`+s[xe]+`\\s+`,o[Se]=new RegExp(s[Se],`g`);var Ce=`$1^`,we=c++;s[we]=`^`+s[xe]+s[de]+`$`;var Te=c++;s[Te]=`^`+s[xe]+s[fe]+`$`;var Ee=c++;s[Ee]=`^`+s[ce]+`\\s*(`+oe+`)$|^$`;var De=c++;s[De]=`^`+s[ce]+`\\s*(`+ae+`)$|^$`;var Oe=c++;s[Oe]=`(\\s*)`+s[ce]+`\\s*(`+oe+`|`+s[de]+`)`,o[Oe]=new RegExp(s[Oe],`g`);var ke=`$1$2$3`,Ae=c++;s[Ae]=`^\\s*(`+s[de]+`)\\s+-\\s+(`+s[de]+`)\\s*$`;var je=c++;s[je]=`^\\s*(`+s[fe]+`)\\s+-\\s+(`+s[fe]+`)\\s*$`;var Me=c++;s[Me]=`(<|>)?=?\\s*\\*`;for(var Ne=0;Ne<c;Ne++)n(Ne,s[Ne]),o[Ne]||(o[Ne]=new RegExp(s[Ne]));t.parse=Pe;function Pe(e,t){if(e instanceof Le)return e;if(typeof e!=`string`||e.length>r||!(t?o[se]:o[ie]).test(e))return null;try{return new Le(e,t)}catch{return null}}t.valid=Fe;function Fe(e,t){var n=Pe(e,t);return n?n.version:null}t.clean=Ie;function Ie(e,t){var n=Pe(e.trim().replace(/^[=v]+/,``),t);return n?n.version:null}t.SemVer=Le;function Le(e,t){if(e instanceof Le){if(e.loose===t)return e;e=e.version}else if(typeof e!=`string`)throw TypeError(`Invalid Version: `+e);if(e.length>r)throw TypeError(`version is longer than `+r+` characters`);if(!(this instanceof Le))return new Le(e,t);n(`SemVer`,e,t),this.loose=t;var a=e.trim().match(t?o[se]:o[ie]);if(!a)throw TypeError(`Invalid Version: `+e);if(this.raw=e,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>i||this.major<0)throw TypeError(`Invalid major version`);if(this.minor>i||this.minor<0)throw TypeError(`Invalid minor version`);if(this.patch>i||this.patch<0)throw TypeError(`Invalid patch version`);a[4]?this.prerelease=a[4].split(`.`).map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t<i)return t}return e}):this.prerelease=[],this.build=a[5]?a[5].split(`.`):[],this.format()}Le.prototype.format=function(){return this.version=this.major+`.`+this.minor+`.`+this.patch,this.prerelease.length&&(this.version+=`-`+this.prerelease.join(`.`)),this.version},Le.prototype.toString=function(){return this.version},Le.prototype.compare=function(e){return n(`SemVer.compare`,this.version,this.loose,e),e instanceof Le||(e=new Le(e,this.loose)),this.compareMain(e)||this.comparePre(e)},Le.prototype.compareMain=function(e){return e instanceof Le||(e=new Le(e,this.loose)),Ve(this.major,e.major)||Ve(this.minor,e.minor)||Ve(this.patch,e.patch)},Le.prototype.comparePre=function(e){if(e instanceof Le||(e=new Le(e,this.loose)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var t=0;do{var r=this.prerelease[t],i=e.prerelease[t];if(n(`prerelease compare`,t,r,i),r===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(r===void 0)return-1;if(r===i)continue;return Ve(r,i)}while(++t)},Le.prototype.inc=function(e,t){switch(e){case`premajor`:this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc(`pre`,t);break;case`preminor`:this.prerelease.length=0,this.patch=0,this.minor++,this.inc(`pre`,t);break;case`prepatch`:this.prerelease.length=0,this.inc(`patch`,t),this.inc(`pre`,t);break;case`prerelease`:this.prerelease.length===0&&this.inc(`patch`,t),this.inc(`pre`,t);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 n=this.prerelease.length;--n>=0;)typeof this.prerelease[n]==`number`&&(this.prerelease[n]++,n=-2);n===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw Error(`invalid increment argument: `+e)}return this.format(),this.raw=this.version,this},t.inc=Re;function Re(e,t,n,r){typeof n==`string`&&(r=n,n=void 0);try{return new Le(e,n).inc(t,r).version}catch{return null}}t.diff=ze;function ze(e,t){if($e(e,t))return null;var n=Pe(e),r=Pe(t);if(n.prerelease.length||r.prerelease.length){for(var i in n)if((i===`major`||i===`minor`||i===`patch`)&&n[i]!==r[i])return`pre`+i;return`prerelease`}for(var i in n)if((i===`major`||i===`minor`||i===`patch`)&&n[i]!==r[i])return i}t.compareIdentifiers=Ve;var Be=/^[0-9]+$/;function Ve(e,t){var n=Be.test(e),r=Be.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:e<t?-1:+(e>t)}t.rcompareIdentifiers=He;function He(e,t){return Ve(t,e)}t.major=Ue;function Ue(e,t){return new Le(e,t).major}t.minor=We;function We(e,t){return new Le(e,t).minor}t.patch=Ge;function Ge(e,t){return new Le(e,t).patch}t.compare=Ke;function Ke(e,t,n){return new Le(e,n).compare(new Le(t,n))}t.compareLoose=qe;function qe(e,t){return Ke(e,t,!0)}t.rcompare=Je;function Je(e,t,n){return Ke(t,e,n)}t.sort=Ye;function Ye(e,n){return e.sort(function(e,r){return t.compare(e,r,n)})}t.rsort=Xe;function Xe(e,n){return e.sort(function(e,r){return t.rcompare(e,r,n)})}t.gt=Ze;function Ze(e,t,n){return Ke(e,t,n)>0}t.lt=Qe;function Qe(e,t,n){return Ke(e,t,n)<0}t.eq=$e;function $e(e,t,n){return Ke(e,t,n)===0}t.neq=et;function et(e,t,n){return Ke(e,t,n)!==0}t.gte=tt;function tt(e,t,n){return Ke(e,t,n)>=0}t.lte=nt;function nt(e,t,n){return Ke(e,t,n)<=0}t.cmp=rt;function rt(e,t,n,r){var i;switch(t){case`===`:typeof e==`object`&&(e=e.version),typeof n==`object`&&(n=n.version),i=e===n;break;case`!==`:typeof e==`object`&&(e=e.version),typeof n==`object`&&(n=n.version),i=e!==n;break;case``:case`=`:case`==`:i=$e(e,n,r);break;case`!=`:i=et(e,n,r);break;case`>`:i=Ze(e,n,r);break;case`>=`:i=tt(e,n,r);break;case`<`:i=Qe(e,n,r);break;case`<=`:i=nt(e,n,r);break;default:throw TypeError(`Invalid operator: `+t)}return i}t.Comparator=it;function it(e,t){if(e instanceof it){if(e.loose===t)return e;e=e.value}if(!(this instanceof it))return new it(e,t);n(`comparator`,e,t),this.loose=t,this.parse(e),this.semver===at?this.value=``:this.value=this.operator+this.semver.version,n(`comp`,this)}var at={};it.prototype.parse=function(e){var t=this.loose?o[Ee]:o[De],n=e.match(t);if(!n)throw TypeError(`Invalid comparator: `+e);this.operator=n[1],this.operator===`=`&&(this.operator=``),n[2]?this.semver=new Le(n[2],this.loose):this.semver=at},it.prototype.toString=function(){return this.value},it.prototype.test=function(e){return n(`Comparator.test`,e,this.loose),this.semver===at?!0:(typeof e==`string`&&(e=new Le(e,this.loose)),rt(e,this.operator,this.semver,this.loose))},it.prototype.intersects=function(e,t){if(!(e instanceof it))throw TypeError(`a Comparator is required`);var n;if(this.operator===``)return n=new ot(e.value,t),yt(this.value,n,t);if(e.operator===``)return n=new ot(this.value,t),yt(e.semver,n,t);var r=(this.operator===`>=`||this.operator===`>`)&&(e.operator===`>=`||e.operator===`>`),i=(this.operator===`<=`||this.operator===`<`)&&(e.operator===`<=`||e.operator===`<`),a=this.semver.version===e.semver.version,o=(this.operator===`>=`||this.operator===`<=`)&&(e.operator===`>=`||e.operator===`<=`),s=rt(this.semver,`<`,e.semver,t)&&(this.operator===`>=`||this.operator===`>`)&&(e.operator===`<=`||e.operator===`<`),c=rt(this.semver,`>`,e.semver,t)&&(this.operator===`<=`||this.operator===`<`)&&(e.operator===`>=`||e.operator===`>`);return r||i||a&&o||s||c},t.Range=ot;function ot(e,t){if(e instanceof ot)return e.loose===t?e:new ot(e.raw,t);if(e instanceof it)return new ot(e.value,t);if(!(this instanceof ot))return new ot(e,t);if(this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length}),!this.set.length)throw TypeError(`Invalid SemVer Range: `+e);this.format()}ot.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(` `).trim()}).join(`||`).trim(),this.range},ot.prototype.toString=function(){return this.range},ot.prototype.parseRange=function(e){var t=this.loose;e=e.trim(),n(`range`,e,t);var r=t?o[je]:o[Ae];e=e.replace(r,_t),n(`hyphen replace`,e),e=e.replace(o[Oe],ke),n(`comparator trim`,e,o[Oe]),e=e.replace(o[_e],ve),e=e.replace(o[Se],Ce),e=e.split(/\s+/).join(` `);var i=t?o[Ee]:o[De],a=e.split(` `).map(function(e){return ct(e,t)}).join(` `).split(/\s+/);return this.loose&&(a=a.filter(function(e){return!!e.match(i)})),a=a.map(function(e){return new it(e,t)}),a},ot.prototype.intersects=function(e,t){if(!(e instanceof ot))throw TypeError(`a Range is required`);return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})},t.toComparators=st;function st(e,t){return new ot(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(` `).trim().split(` `)})}function ct(e,t){return n(`comp`,e),e=ft(e,t),n(`caret`,e),e=ut(e,t),n(`tildes`,e),e=mt(e,t),n(`xrange`,e),e=gt(e,t),n(`stars`,e),e}function lt(e){return!e||e.toLowerCase()===`x`||e===`*`}function ut(e,t){return e.trim().split(/\s+/).map(function(e){return dt(e,t)}).join(` `)}function dt(e,t){var r=t?o[be]:o[ye];return e.replace(r,function(t,r,i,a,o){n(`tilde`,e,t,r,i,a,o);var s;return lt(r)?s=``:lt(i)?s=`>=`+r+`.0.0 <`+(+r+1)+`.0.0`:lt(a)?s=`>=`+r+`.`+i+`.0 <`+r+`.`+(+i+1)+`.0`:o?(n(`replaceTilde pr`,o),o.charAt(0)!==`-`&&(o=`-`+o),s=`>=`+r+`.`+i+`.`+a+o+` <`+r+`.`+(+i+1)+`.0`):s=`>=`+r+`.`+i+`.`+a+` <`+r+`.`+(+i+1)+`.0`,n(`tilde return`,s),s})}function ft(e,t){return e.trim().split(/\s+/).map(function(e){return pt(e,t)}).join(` `)}function pt(e,t){n(`caret`,e,t);var r=t?o[Te]:o[we];return e.replace(r,function(t,r,i,a,o){n(`caret`,e,t,r,i,a,o);var s;return lt(r)?s=``:lt(i)?s=`>=`+r+`.0.0 <`+(+r+1)+`.0.0`:lt(a)?s=r===`0`?`>=`+r+`.`+i+`.0 <`+r+`.`+(+i+1)+`.0`:`>=`+r+`.`+i+`.0 <`+(+r+1)+`.0.0`:o?(n(`replaceCaret pr`,o),o.charAt(0)!==`-`&&(o=`-`+o),s=r===`0`?i===`0`?`>=`+r+`.`+i+`.`+a+o+` <`+r+`.`+i+`.`+(+a+1):`>=`+r+`.`+i+`.`+a+o+` <`+r+`.`+(+i+1)+`.0`:`>=`+r+`.`+i+`.`+a+o+` <`+(+r+1)+`.0.0`):(n(`no pr`),s=r===`0`?i===`0`?`>=`+r+`.`+i+`.`+a+` <`+r+`.`+i+`.`+(+a+1):`>=`+r+`.`+i+`.`+a+` <`+r+`.`+(+i+1)+`.0`:`>=`+r+`.`+i+`.`+a+` <`+(+r+1)+`.0.0`),n(`caret return`,s),s})}function mt(e,t){return n(`replaceXRanges`,e,t),e.split(/\s+/).map(function(e){return ht(e,t)}).join(` `)}function ht(e,t){e=e.trim();var r=t?o[me]:o[pe];return e.replace(r,function(t,r,i,a,o,s){n(`xRange`,e,t,r,i,a,o,s);var c=lt(i),l=c||lt(a),u=l||lt(o),d=u;return r===`=`&&d&&(r=``),c?t=r===`>`||r===`<`?`<0.0.0`:`*`:r&&d?(l&&(a=0),u&&(o=0),r===`>`?(r=`>=`,l?(i=+i+1,a=0,o=0):u&&(a=+a+1,o=0)):r===`<=`&&(r=`<`,l?i=+i+1:a=+a+1),t=r+i+`.`+a+`.`+o):l?t=`>=`+i+`.0.0 <`+(+i+1)+`.0.0`:u&&(t=`>=`+i+`.`+a+`.0 <`+i+`.`+(+a+1)+`.0`),n(`xRange return`,t),t})}function gt(e,t){return n(`replaceStars`,e,t),e.trim().replace(o[Me],``)}function _t(e,t,n,r,i,a,o,s,c,l,u,d,f){return t=lt(n)?``:lt(r)?`>=`+n+`.0.0`:lt(i)?`>=`+n+`.`+r+`.0`:`>=`+t,s=lt(c)?``:lt(l)?`<`+(+c+1)+`.0.0`:lt(u)?`<`+c+`.`+(+l+1)+`.0`:d?`<=`+c+`.`+l+`.`+u+`-`+d:`<=`+s,(t+` `+s).trim()}ot.prototype.test=function(e){if(!e)return!1;typeof e==`string`&&(e=new Le(e,this.loose));for(var t=0;t<this.set.length;t++)if(vt(this.set[t],e))return!0;return!1};function vt(e,t){for(var r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length){for(var r=0;r<e.length;r++)if(n(e[r].semver),e[r].semver!==at&&e[r].semver.prerelease.length>0){var i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}t.satisfies=yt;function yt(e,t,n){try{t=new ot(t,n)}catch{return!1}return t.test(e)}t.maxSatisfying=bt;function bt(e,t,n){var r=null,i=null;try{var a=new ot(t,n)}catch{return null}return e.forEach(function(e){a.test(e)&&(!r||i.compare(e)===-1)&&(r=e,i=new Le(r,n))}),r}t.minSatisfying=xt;function xt(e,t,n){var r=null,i=null;try{var a=new ot(t,n)}catch{return null}return e.forEach(function(e){a.test(e)&&(!r||i.compare(e)===1)&&(r=e,i=new Le(r,n))}),r}t.validRange=St;function St(e,t){try{return new ot(e,t).range||`*`}catch{return null}}t.ltr=Ct;function Ct(e,t,n){return _(e,t,`<`,n)}t.gtr=g;function g(e,t,n){return _(e,t,`>`,n)}t.outside=_;function _(e,t,n,r){e=new Le(e,r),t=new ot(t,r);var i,a,o,s,c;switch(n){case`>`:i=Ze,a=nt,o=Qe,s=`>`,c=`>=`;break;case`<`:i=Qe,a=tt,o=Ze,s=`<`,c=`<=`;break;default:throw TypeError(`Must provide a hilo val of "<" or ">"`)}if(yt(e,t,r))return!1;for(var l=0;l<t.set.length;++l){var u=t.set[l],d=null,f=null;if(u.forEach(function(e){e.semver===at&&(e=new it(`>=0.0.0`)),d||=e,f||=e,i(e.semver,d.semver,r)?d=e:o(e.semver,f.semver,r)&&(f=e)}),d.operator===s||d.operator===c||(!f.operator||f.operator===s)&&a(e,f.semver)||f.operator===c&&o(e,f.semver))return!1}return!0}t.prerelease=v;function v(e,t){var n=Pe(e,t);return n&&n.prerelease.length?n.prerelease:null}t.intersects=wt;function wt(e,t,n){return e=new ot(e,n),t=new ot(t,n),e.intersects(t)}t.coerce=Tt;function Tt(e){if(e instanceof Le)return e;if(typeof e!=`string`)return null;var t=e.match(o[he]);return t==null?null:Pe((t[1]||`0`)+`.`+(t[2]||`0`)+`.`+(t[3]||`0`))}})(oW,oW.exports),oW.exports)}cW();const lW=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,uW=/^-(\d{4})(\d{2})(\d{2})(\d{2})?(\d{2})?$/;function dW(e){return e=e.trim(),e===`*`||lW.test(e)}function fW(e){if(!dW(e))return null;if(e=e.trim(),e===`*`)return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};let t=e.match(lW);return t?{hasCaret:t[1]===`^`,hasGreaterEquals:t[1]===`>=`,majorBase:t[2]===`x`?0:parseInt(t[2],10),majorMustEqual:t[2]!==`x`,minorBase:t[4]===`x`?0:parseInt(t[4],10),minorMustEqual:t[4]!==`x`,patchBase:t[6]===`x`?0:parseInt(t[6],10),patchMustEqual:t[6]!==`x`,preRelease:t[8]||null}:null}function pW(e){if(!e)return null;let t=e.majorBase,n=e.majorMustEqual,r=e.minorBase,i=e.minorMustEqual,a=e.patchBase,o=e.patchMustEqual;e.hasCaret&&(t===0||(i=!1),o=!1);let s=0;if(e.preRelease){let t=uW.exec(e.preRelease);if(t){let[,e,n,r,i,a]=t;s=Date.UTC(Number(e),Number(n)-1,Number(r),Number(i)||0,Number(a)||0)}}return{majorBase:t,majorMustEqual:n,minorBase:r,minorMustEqual:i,patchBase:a,patchMustEqual:o,isMinimum:e.hasGreaterEquals,notBefore:s}}var mW=class{constructor(){this.buffers=[]}add(e){let t=this.buffers.indexOf(e);return t<0&&(t=this.buffers.length,this.buffers.push(e)),t}};function hW(e,t){if(t.serializeBuffersForPostMessage){let t=new mW;return{message:JSON.stringify(e,(e,n)=>{if(n instanceof ArrayBuffer)return{$$vscode_array_buffer_reference$$:!0,index:t.add(n)};if(ArrayBuffer.isView(n)){let e=gW(n);if(e)return{$$vscode_array_buffer_reference$$:!0,index:t.add(n.buffer),view:{type:e,byteLength:n.byteLength,byteOffset:n.byteOffset}}}return n}),buffers:t.buffers.map(e=>{let t=new Uint8Array(e);return y.wrap(t)})}}else return{message:JSON.stringify(e),buffers:[]}}function gW(e){switch(e.constructor.name){case`Int8Array`:return Oi.Int8Array;case`Uint8Array`:return Oi.Uint8Array;case`Uint8ClampedArray`:return Oi.Uint8ClampedArray;case`Int16Array`:return Oi.Int16Array;case`Uint16Array`:return Oi.Uint16Array;case`Int32Array`:return Oi.Int32Array;case`Uint32Array`:return Oi.Uint32Array;case`Float32Array`:return Oi.Float32Array;case`Float64Array`:return Oi.Float64Array;case`BigInt64Array`:return Oi.BigInt64Array;case`BigUint64Array`:return Oi.BigUint64Array}}function _W(e,t){let n=t.map(e=>{let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e.buffer),t}),r=t.length?(e,t)=>{if(t&&typeof t==`object`&&t.$$vscode_array_buffer_reference$$){let e=t,{index:r}=e,i=n[r];if(e.view)switch(e.view.type){case Oi.Int8Array:return new Int8Array(i,e.view.byteOffset,e.view.byteLength/Int8Array.BYTES_PER_ELEMENT);case Oi.Uint8Array:return new Uint8Array(i,e.view.byteOffset,e.view.byteLength/Uint8Array.BYTES_PER_ELEMENT);case Oi.Uint8ClampedArray:return new Uint8ClampedArray(i,e.view.byteOffset,e.view.byteLength/Uint8ClampedArray.BYTES_PER_ELEMENT);case Oi.Int16Array:return new Int16Array(i,e.view.byteOffset,e.view.byteLength/Int16Array.BYTES_PER_ELEMENT);case Oi.Uint16Array:return new Uint16Array(i,e.view.byteOffset,e.view.byteLength/Uint16Array.BYTES_PER_ELEMENT);case Oi.Int32Array:return new Int32Array(i,e.view.byteOffset,e.view.byteLength/Int32Array.BYTES_PER_ELEMENT);case Oi.Uint32Array:return new Uint32Array(i,e.view.byteOffset,e.view.byteLength/Uint32Array.BYTES_PER_ELEMENT);case Oi.Float32Array:return new Float32Array(i,e.view.byteOffset,e.view.byteLength/Float32Array.BYTES_PER_ELEMENT);case Oi.Float64Array:return new Float64Array(i,e.view.byteOffset,e.view.byteLength/Float64Array.BYTES_PER_ELEMENT);case Oi.BigInt64Array:return new BigInt64Array(i,e.view.byteOffset,e.view.byteLength/BigInt64Array.BYTES_PER_ELEMENT);case Oi.BigUint64Array:return new BigUint64Array(i,e.view.byteOffset,e.view.byteLength/BigUint64Array.BYTES_PER_ELEMENT);default:throw Error(`Unknown array buffer view type`)}return i}return t}:void 0;return{message:JSON.parse(e,r),arrayBuffers:n}}var vW=class{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;constructor(e,t,n,r,i,a,o){this.#o=``,this.#c=!1,this.#l=!1,this._onMessageEmitter=new x,this.onDidReceiveMessage=this._onMessageEmitter.event,this.#f=new x,this._onDidDispose=this.#f.event,this.#e=e,this.#t=t,this.#s=n,this.#r=r,this.#i=i,this.#a=a,this.#u=yW(a),this.#d=bW(a),this.#n=o}#f;dispose(){this.#c=!0,this.#f.fire(),this.#f.dispose(),this._onMessageEmitter.dispose()}asWebviewUri(e){return this.#l=!0,tW(e,this.#r)}get cspSource(){let e=this.#a.extensionLocation;if(e.scheme===D.https||e.scheme===D.http){let t=e.toString();return t.endsWith(`/`)||(t+=`/`),t+` `+eW}return eW}get html(){return this.assertNotDisposed(),this.#o}set html(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,this.#d&&!this.#l&&/(["'])vscode-resource:([^\s'"]+?)(["'])/i.test(e)&&(this.#l=!0,this.#n.report(`Webview vscode-resource: uris`,this.#a,`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.#s}set options(e){this.assertNotDisposed(),pc(this.#s,e)||this.#t.$setOptions(this.#e,CW(this.#a,this.#i,e)),this.#s=e}async postMessage(e){if(this.#c)return!1;let t=hW(e,{serializeBuffersForPostMessage:this.#u});return this.#t.$postMessage(this.#e,t.message,...t.buffers)}assertNotDisposed(){if(this.#c)throw Error(`Webview is disposed`)}rewriteOldResourceUrlsIfNeeded(e){if(!this.#d)return e;let t=this.#a.extensionLocation?.scheme===D.vscodeRemote,n=this.#a.extensionLocation.scheme===D.vscodeRemote?this.#a.extensionLocation.authority:void 0;return e.replace(/(["'])(?:vscode-resource):(\/\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(e,r,i,a,o,s)=>`${r}${tW(C.from({scheme:a||`file`,path:decodeURIComponent(o)}),{isRemote:t,authority:n}).toString()}${s}`).replace(/(["'])(?:vscode-webview-resource):(\/\/[^\s\/'"]+\/([^\s\/'"]+?)(?=\/))?([^\s'"]+?)(["'])/gi,(e,r,i,a,o,s)=>`${r}${tW(C.from({scheme:a||`file`,path:decodeURIComponent(o)}),{isRemote:t,authority:n}).toString()}${s}`)}};function yW(e){try{let t=pW(fW(e.engines.vscode));return!!t&&t.majorBase>=1&&t.minorBase>=57}catch{return!1}}function bW(e){try{let t=pW(fW(e.engines.vscode));return t?t.majorBase<1||t.majorBase===1&&t.minorBase<60:!1}catch{return!1}}var xW=class extends v{constructor(e,t,n,r,i){super(),this.remoteInfo=t,this.workspace=n,this._logService=r,this._deprecationService=i,this._webviews=new Map,this._webviewProxy=e.getProxy(T.MainThreadWebviews)}dispose(){super.dispose();for(let e of this._webviews.values())e.dispose();this._webviews.clear()}$onMessage(e,t,n){let r=this.getWebview(e);if(r){let{message:e}=_W(t,n.value);r._onMessageEmitter.fire(e)}}$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,n){let r=new vW(e,this._webviewProxy,wW(t),this.remoteInfo,this.workspace,n,this._deprecationService);this._webviews.set(e,r);let i=r._onDidDispose(()=>{i.dispose(),this.deleteWebview(e)});return r}ensureDefaultContentOptions(e,t,n){t.localResourceRoots||this._webviewProxy.$setOptions(e,{...t,localResourceRoots:TW(n,this.workspace)})}deleteWebview(e){this._webviews.delete(e)}getWebview(e){return this._webviews.get(e)}};function SW(e){return{id:e.identifier,location:e.extensionLocation}}function CW(e,t,n){return{enableCommandUris:n.enableCommandUris,enableScripts:n.enableScripts,enableForms:n.enableForms,portMapping:n.portMapping,localResourceRoots:n.localResourceRoots||TW(e,t)}}function wW(e){return{enableCommandUris:e.enableCommandUris,enableScripts:e.enableScripts,enableForms:e.enableForms,portMapping:e.portMapping,localResourceRoots:e.localResourceRoots?.map(e=>C.from(e))}}function TW(e,t){return[...(t?.getWorkspaceFolders()||[]).map(e=>e.uri),e.extensionLocation]}var EW=class e{static{this.enableDebugLogging=!1}constructor(e){this.id=e,this._data=new Map,this._idPool=1}add(e){let 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(){e.enableDebugLogging&&console.log(`${this.id} cache size - ${this._data.size}`)}},DW=class{constructor(e,t){this.document=e,this._storagePath=t,this._backupCounter=1,this._edits=new EW(`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(let t of e)this._edits.delete(t)}getNewBackupUri(){if(!this._storagePath)throw Error(`Backup requires a valid storage path`);let e=zW(this.document.uri)+ this._backupCounter++;return uo(this._storagePath,e)}updateBackup(e){this._backup?.delete(),this._backup=e}disposeBackup(){this._backup?.delete(),this._backup=void 0}getEdit(e){let t=this._edits.get(e,0);if(!t)throw Error(`No edit found`);return t}},OW=class{constructor(){this._documents=new Map}get(e,t){return this._documents.get(this.key(e,t))}add(e,t,n){let r=this.key(e,t.uri);if(this._documents.has(r))throw Error(`Document already exists for viewType:${e} resource:${t.uri}`);let i=new DW(t,n);return this._documents.set(r,i),i}delete(e,t){let n=this.key(e,t);this._documents.delete(n)}key(e,t){return`${e}@@@${t}`}},kW;(function(e){e[e.Text=0]=`Text`,e[e.Custom=1]=`Custom`})(kW||={});var AW=class{constructor(){this._providers=new Map}addTextProvider(e,t,n){return this.add(e,{type:kW.Text,extension:t,provider:n})}addCustomProvider(e,t,n){return this.add(e,{type:kW.Custom,extension:t,provider:n})}get(e){return this._providers.get(e)}add(e,t){if(this._providers.has(e))throw Error(`Provider for viewType:${e} already registered`);return this._providers.set(e,t),new YT(()=>this._providers.delete(e))}},jW=class{constructor(e,t,n,r,i){this._extHostDocuments=t,this._extensionStoragePaths=n,this._extHostWebview=r,this._extHostWebviewPanels=i,this._editorProviders=new AW,this._documents=new OW,this._proxy=e.getProxy(T.MainThreadCustomEditors)}registerCustomEditorProvider(e,t,n,r){let i=new _;if(NW(n))i.add(this._editorProviders.addTextProvider(t,e,n)),this._proxy.$registerTextEditorProvider(SW(e),t,r.webviewOptions||{},{supportsMove:!!n.moveCustomTextEditor,supportsInlineDiff:Mw(e)&&PW(n),supportsSideBySideDiff:Mw(e)&&FW(n)},yW(e));else{i.add(this._editorProviders.addCustomProvider(t,e,n));let a=Mw(e);MW(n)&&i.add(n.onDidChangeCustomDocument(e=>{let n=this.getCustomDocumentEntry(t,e.document.uri);if(RW(e)){let r=n.addEdit(e);this._proxy.$onDidEdit(e.document.uri,t,r,e.label)}else this._proxy.$onContentChange(e.document.uri,t)})),this._proxy.$registerCustomEditorProvider(SW(e),t,r.webviewOptions||{},{supportsInlineDiff:a&&IW(n),supportsSideBySideDiff:a&&LW(n)},!!r.supportsMultipleEditorsPerDocument,yW(e))}return YT.from(i,new YT(()=>{this._proxy.$unregisterEditorProvider(t)}))}async $createCustomDocument(e,t,n,r,i){let a=this._editorProviders.get(t);if(!a)throw Error(`No provider found for '${t}'`);if(a.type!==kW.Custom)throw Error(`Invalid provide type for '${t}'`);let o=C.revive(e),s=await a.provider.openCustomDocument(o,{backupId:n,untitledDocumentData:r?.buffer},i),c;return MW(a.provider)&&this._extensionStoragePaths&&(c=this._extensionStoragePaths.workspaceValue(a.extension)??this._extensionStoragePaths.globalValue(a.extension)),this._documents.add(t,s,c),{editable:MW(a.provider)}}async $disposeCustomDocument(e,t){let n=this._editorProviders.get(t);if(!n)throw Error(`No provider found for '${t}'`);if(n.type!==kW.Custom)throw Error(`Invalid provider type for '${t}'`);let r=C.revive(e),{document:i}=this.getCustomDocumentEntry(t,r);this._documents.delete(t,r),i.dispose()}async $resolveCustomEditor(e,t,n,r,i,a){let o=this._editorProviders.get(n);if(!o)throw Error(`No provider found for '${n}'`);let s=vj.to(i),c=this._extHostWebview.createNewWebview(t,r.contentOptions,o.extension);this._extHostWebview.ensureDefaultContentOptions(t,r.contentOptions,o.extension);let l=this._extHostWebviewPanels.createNewWebviewPanel(t,n,r.title,s,r.options,c,r.active),u=C.revive(e);switch(o.type){case kW.Custom:{let{document:e}=this.getCustomDocumentEntry(n,u);return o.provider.resolveCustomEditor(e,l,a)}case kW.Text:{let e=this._extHostDocuments.getDocument(u);return o.provider.resolveCustomTextEditor(e,l,a)}default:throw Error(`Unknown webview provider type`)}}async $resolveCustomEditorInlineDiff(e,t,n,r,i,a,o){let{entry:s,panel:c}=this.createCustomEditorDiffPanel(n,r,i,a),l=C.revive(e),u=C.revive(t);if(s.type===kW.Text){if(!PW(s.provider))throw Error(`Provider for '${r}' does not support inline custom text editor diffs`);let e=this._extHostDocuments.getDocument(l),t=this._extHostDocuments.getDocument(u);return s.provider.resolveCustomTextEditorInlineDiff({original:e,modified:t},c,o)}if(!IW(s.provider))throw Error(`Provider for '${r}' does not support inline custom editor diffs`);let{document:d}=this.getCustomDocumentEntry(r,l),{document:f}=this.getCustomDocumentEntry(r,u);return s.provider.resolveCustomEditorInlineDiff({original:d,modified:f},c,o)}async $resolveCustomEditorSideBySideDiff(e,t,n,r,i,a,o){let{entry:s,panel:c}=this.createCustomEditorDiffPanel(n.original,r,i.original,a),{panel:l}=this.createCustomEditorDiffPanel(n.modified,r,i.modified,a),u=C.revive(e),d=C.revive(t);if(s.type===kW.Text){if(!FW(s.provider))throw Error(`Provider for '${r}' does not support side by side custom text editor diffs`);let e=this._extHostDocuments.getDocument(u),t=this._extHostDocuments.getDocument(d);return s.provider.resolveCustomTextEditorSideBySideDiff({original:e,modified:t},{original:c,modified:l},o)}if(!LW(s.provider))throw Error(`Provider for '${r}' does not support side by side custom editor diffs`);let{document:f}=this.getCustomDocumentEntry(r,u),{document:p}=this.getCustomDocumentEntry(r,d);return s.provider.resolveCustomEditorSideBySideDiff({original:f,modified:p},{original:c,modified:l},o)}createCustomEditorDiffPanel(e,t,n,r){let i=this._editorProviders.get(t);if(!i)throw Error(`No provider found for '${t}'`);let a=vj.to(r),o=this._extHostWebview.createNewWebview(e,n.contentOptions,i.extension);return this._extHostWebview.ensureDefaultContentOptions(e,n.contentOptions,i.extension),{entry:i,panel:this._extHostWebviewPanels.createNewWebviewPanel(e,t,n.title,a,n.options,o,n.active)}}$disposeEdits(e,t,n){this.getCustomDocumentEntry(t,e).disposeEdits(n)}async $onMoveCustomEditor(e,t,n){let r=this._editorProviders.get(n);if(!r)throw Error(`No provider found for '${n}'`);if(!r.provider.moveCustomTextEditor)throw Error(`Provider does not implement move '${n}'`);let i=this._extHostWebviewPanels.getWebviewPanel(e);if(!i)throw Error(`No webview found`);let a=C.revive(t),o=this._extHostDocuments.getDocument(a);await r.provider.moveCustomTextEditor(o,i,Bi.None)}async $undo(e,t,n,r){return this.getCustomDocumentEntry(t,e).undo(n,r)}async $redo(e,t,n,r){return this.getCustomDocumentEntry(t,e).redo(n,r)}async $revert(e,t,n){let r=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).revertCustomDocument(r.document,n),r.disposeBackup()}async $onSave(e,t,n){let r=this.getCustomDocumentEntry(t,e);await this.getCustomEditorProvider(t).saveCustomDocument(r.document,n),r.disposeBackup()}async $onSaveAs(e,t,n,r){let i=this.getCustomDocumentEntry(t,e);return this.getCustomEditorProvider(t).saveCustomDocumentAs(i.document,C.revive(n),r)}async $backup(e,t,n){let r=this.getCustomDocumentEntry(t,e),i=await this.getCustomEditorProvider(t).backupCustomDocument(r.document,{destination:r.getNewBackupUri()},n);return r.updateBackup(i),i.id}getCustomDocumentEntry(e,t){let n=this._documents.get(e,C.revive(t));if(!n)throw Error(`No custom document found`);return n}getCustomEditorProvider(e){let t=this._editorProviders.get(e)?.provider;if(!t||!MW(t))throw Error(`Custom document is not editable`);return t}};function MW(e){return!!e.onDidChangeCustomDocument}function NW(e){return typeof e.resolveCustomTextEditor==`function`}function PW(e){return typeof e.resolveCustomTextEditorInlineDiff==`function`}function FW(e){return typeof e.resolveCustomTextEditorSideBySideDiff==`function`}function IW(e){return typeof e.resolveCustomEditorInlineDiff==`function`}function LW(e){return typeof e.resolveCustomEditorSideBySideDiff==`function`}function RW(e){return typeof e.undo==`function`&&typeof e.redo==`function`}function zW(e){return jh(e.scheme===D.file||e.scheme===D.untitled?e.fsPath:e.toString())+``}var BW,VW=class e{#e;#t;#n;constructor(e,t,n,r,i,a,o,s){this._name=e,this._owner=t,this._maxDiagnosticsTotal=n,this._maxDiagnosticsPerFile=r,this._modelVersionIdProvider=i,this._isDisposed=!1,this._maxDiagnosticsTotal=Math.max(r,n),this.#n=new He(e=>a.getComparisonKey(e)),this.#e=o,this.#t=s}dispose(){this._isDisposed||=(this.#t.fire([...this.#n.keys()]),this.#e?.$clear(this._owner),this.#n.clear(),!0)}get name(){return this._checkDisposed(),this._name}set(t,n){if(!t){this.clear();return}this._checkDisposed();let r=[];if(C.isUri(t)){if(!n){this.delete(t);return}this.#n.set(t,Se(n)),r=[t]}else if(Array.isArray(t)){r=[];let n;t=[...t].sort(e._compareIndexedTuplesByUri);for(let e of t){let[t,i]=e;if((!n||t.toString()!==n.toString())&&(n&&this.#n.get(n).length===0&&this.#n.delete(n),n=t,r.push(t),this.#n.set(t,[])),i)this.#n.get(t)?.push(...Se(i));else{let e=this.#n.get(t);e&&(e.length=0)}}}if(this.#t.fire(r),!this.#e)return;let i=[],a=0;for(let e of r){let t=[],n=this.#n.get(e);if(n)if(n.length>this._maxDiagnosticsPerFile){t=[];let r=[fT.Error,fT.Warning,fT.Information,fT.Hint];orderLoop:for(let i=0;i<4;i++)for(let a of n)if(a.severity===r[i]&&t.push({...hj.from(a),modelVersionId:this._modelVersionIdProvider(e)})===this._maxDiagnosticsPerFile)break orderLoop;t.push({severity:wm.Info,message:b(2864,`Not showing {0} further errors and warnings.`,n.length-this._maxDiagnosticsPerFile),startLineNumber:t[t.length-1].startLineNumber,startColumn:t[t.length-1].startColumn,endLineNumber:t[t.length-1].endLineNumber,endColumn:t[t.length-1].endColumn})}else t=n.map(t=>({...hj.from(t),modelVersionId:this._modelVersionIdProvider(e)}));if(i.push([e,t]),a+=t.length,a>this._maxDiagnosticsTotal)break}this.#e.$changeMany(this._owner,i)}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(let[n,r]of this)e.call(t,n,r,this)}*[Symbol.iterator](){this._checkDisposed();for(let e of this.#n.keys())yield[e,this.get(e)]}get(e){this._checkDisposed();let 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 Error(`illegal state - object is disposed`)}static _compareIndexedTuplesByUri(e,t){return e[0].toString()<t[0].toString()?-1:+(e[0].toString()>t[0].toString())}};let HW=class{static{BW=this}static{this._idPool=0}static{this._maxDiagnosticsPerFile=1e3}static{this._maxDiagnosticsTotal=1.1*this._maxDiagnosticsPerFile}static _mapper(e){let t=new He;for(let n of e)t.set(n,n);return{uris:Object.freeze(Array.from(t.values()))}}constructor(e,t,n,r){this._logService=t,this._fileSystemInfoService=n,this._extHostDocumentsAndEditors=r,this._collections=new Map,this._onDidChangeDiagnostics=new gr({merge:e=>e.flat(),delay:50}),this.onDidChangeDiagnostics=ir.map(this._onDidChangeDiagnostics.event,BW._mapper),this._proxy=e.getProxy(T.MainThreadDiagnostics)}createDiagnosticCollection(e,t){let{_collections:n,_proxy:r,_onDidChangeDiagnostics:i,_logService:a,_fileSystemInfoService:o,_extHostDocumentsAndEditors:s}=this,c=new class{$changeMany(t,n){r.$changeMany(t,n),a.trace(`[DiagnosticCollection] change many (extension, owner, uris)`,e.value,t,n.length===0?`CLEARING`:n)}$clear(t){r.$clear(t),a.trace(`[DiagnosticCollection] remove all (extension, owner)`,e.value,t)}dispose(){r.dispose()}},l;if(!t)t=`_generated_diagnostic_collection_name_#`+ BW._idPool++,l=t;else if(!n.has(t))l=t;else{this._logService.warn(`DiagnosticCollection with name '${t}' does already exist.`);do l=t+ BW._idPool++;while(n.has(l))}return new class extends VW{constructor(){super(t,l,BW._maxDiagnosticsTotal,BW._maxDiagnosticsPerFile,e=>s.getDocument(e)?.version,o.extUri,c,i),n.set(l,this)}dispose(){super.dispose(),n.delete(l)}}}getDiagnostics(e){if(e)return this._getDiagnostics(e);{let e=new Map,t=[];for(let n of this._collections.values())n.forEach((n,r)=>{let i=e.get(n.toString());i===void 0&&(i=t.length,e.set(n.toString(),i),t.push([n,[]])),t[i][1]=t[i][1].concat(...r)});return t}}_getDiagnostics(e){let t=[];for(let n of this._collections.values())n.has(e)&&(t=t.concat(n.get(e)));return t}$acceptMarkersChange(e){if(!this._mirrorCollection){let e=`_generated_mirror`,t=new VW(e,e,2**53-1,2**53-1,e=>void 0,this._fileSystemInfoService.extUri,void 0,this._onDidChangeDiagnostics);this._collections.set(e,t),this._mirrorCollection=t}for(let[t,n]of e)this._mirrorCollection.set(C.revive(t),n.map(hj.to))}};HW=BW=k([A(1,Ns),A(2,Wc)],HW);var UW=class{constructor(e){this._proxy=e.getProxy(T.MainThreadDialogs)}showOpenDialog(e){return this._proxy.$showOpenDialog(e).then(e=>e?e.map(e=>C.revive(e)):void 0)}showSaveDialog(e){return this._proxy.$showSaveDialog(e).then(e=>e?C.revive(e):void 0)}},WW=class e{static{this._handlePool=0}constructor(e,t,n){this._documentsAndEditors=t,this._logService=n,this._documentContentProviders=new Map,this._proxy=e.getProxy(T.MainThreadDocumentContentProviders)}registerTextDocumentContentProvider(t,n){if(Object.keys(D).indexOf(t)>=0)throw Error(`scheme '${t}' already registered`);let r=e._handlePool++;this._documentContentProviders.set(r,n),this._proxy.$registerTextContentProvider(r,t);let i;if(typeof n.onDidChange==`function`){let e;i=n.onDidChange(async n=>{if(n.scheme!==t){this._logService.warn(`Provider for scheme '${t}' is firing event for schema '${n.scheme}' which will be IGNORED`);return}if(!this._documentsAndEditors.getDocument(n))return;e&&await e;let i=this.$provideTextDocumentContent(r,n).then(async e=>{if(!e&&typeof e!=`string`)return;let t=this._documentsAndEditors.getDocument(n);if(!t)return;let r=aa(e);if(!t.equalLines(r))return this._proxy.$onVirtualDocumentChange(n,e)}).catch(m).finally(()=>{e===i&&(e=void 0)});e=i})}return new YT(()=>{this._documentContentProviders.delete(r)&&this._proxy.$unregisterTextContentProvider(r),i&&=(i.dispose(),void 0)})}$provideTextDocumentContent(e,t){let n=this._documentContentProviders.get(e);return n?Promise.resolve(n.provideTextDocumentContent(C.revive(t),Bi.None)):Promise.reject(Error(`unsupported uri-scheme: ${t.scheme}`))}},GW=class{constructor(e,t,n,r={timeout:1500,errors:3}){this._logService=e,this._documents=t,this._mainThreadBulkEdits=n,this._thresholds=r,this._callbacks=new nn,this._badListeners=new WeakMap}dispose(){this._callbacks.clear()}getOnWillSaveTextDocumentEvent(e){return(t,n,r)=>{let i={dispose:this._callbacks.push([t,n,e])};return Array.isArray(r)&&r.push(i),i}}async $participateInSave(e,t){let n=C.revive(e),r=!1,i=setTimeout(()=>r=!0,this._thresholds.timeout),a=[];try{for(let e of[...this._callbacks]){if(r)break;let i=this._documents.getDocument(n),o=await this._deliverEventAsyncAndBlameBadListeners(e,{document:i,reason:oM.to(t)});a.push(o)}}finally{clearTimeout(i)}return a}_deliverEventAsyncAndBlameBadListeners([e,t,n],r){let i=this._badListeners.get(e);return typeof i==`number`&&i>this._thresholds.errors?Promise.resolve(!1):this._deliverEventAsync(n,e,t,r).then(()=>!0,t=>{if(this._logService.error(`onWillSaveTextDocument-listener from extension '${n.identifier.value}' threw ERROR`),this._logService.error(t),!(t instanceof Error)||t.message!==`concurrent_edits`){let t=this._badListeners.get(e);this._badListeners.set(e,t?t+1:1),typeof t==`number`&&t>this._thresholds.errors&&this._logService.info(`onWillSaveTextDocument-listener from extension '${n.identifier.value}' will now be IGNORED because of timeouts and/or errors`)}return!1})}_deliverEventAsync(e,t,n,r){let i=[],a=Date.now(),{document:o,reason:s}=r,{version:c}=o,l=Object.freeze({document:o,reason:s,waitUntil(e){if(Object.isFrozen(i))throw ce(`waitUntil can not be called async`);i.push(Promise.resolve(e))}});try{t.apply(n,[l])}catch(e){return Promise.reject(e)}return new Promise((t,n)=>{let r=setTimeout(()=>n(Error(`timeout`)),this._thresholds.timeout);return Promise.all(i).then(n=>{this._logService.debug(`onWillSaveTextDocument-listener from extension '${e.identifier.value}' finished after ${Date.now()-a}ms`),clearTimeout(r),t(n)}).catch(e=>{clearTimeout(r),n(e)})}).then(e=>{let t={edits:[]};for(let n of e)if(Array.isArray(n)&&n.every(e=>e instanceof IT))for(let{newText:e,newEol:r,range:i}of n)t.edits.push({resource:o.uri,versionId:void 0,textEdit:{range:i&&J.from(i),text:e,eol:r&&cM.from(r)}});if(t.edits.length!==0)return c===o.version?this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Ci(t)):Promise.reject(Error(`concurrent_edits`))})}},KW=class{constructor(e,t){this._toDispose=new _,this._onDidAddDocument=this._toDispose.add(new x),this._onDidRemoveDocument=this._toDispose.add(new x),this._onDidChangeDocument=this._toDispose.add(new x),this._onDidChangeDocumentWithReason=this._toDispose.add(new x),this._onDidSaveDocument=this._toDispose.add(new x),this.onDidAddDocument=this._onDidAddDocument.event,this.onDidRemoveDocument=this._onDidRemoveDocument.event,this.onDidChangeDocument=this._onDidChangeDocument.event,this.onDidChangeDocumentWithReason=this._onDidChangeDocumentWithReason.event,this.onDidSaveDocument=this._onDidSaveDocument.event,this._documentLoader=new Map,this._proxy=e.getProxy(T.MainThreadDocuments),this._documentsAndEditors=t,this._documentsAndEditors.onDidRemoveDocuments(e=>{for(let t of e)this._onDidRemoveDocument.fire(t.document)},void 0,this._toDispose),this._documentsAndEditors.onDidAddDocuments(e=>{for(let t of e)this._onDidAddDocument.fire(t.document)},void 0,this._toDispose)}dispose(){this._toDispose.dispose()}getAllDocumentData(){return[...this._documentsAndEditors.allDocuments()]}getDocumentData(e){if(!e)return;let t=this._documentsAndEditors.getDocument(e);if(t)return t}getDocument(e){let t=this.getDocumentData(e);if(!t?.document)throw Error(`Unable to retrieve document from URI '${e}'`);return t.document}ensureDocumentData(e,t){let n=this._documentsAndEditors.getDocument(e);if(n&&(!t?.encoding||n.document.encoding===t.encoding))return Promise.resolve(n);let r=this._documentLoader.get(e.toString());return r?t?.encoding&&(r=r.then(n=>n.document.encoding===t.encoding?n:this.ensureDocumentData(e,t))):(r=this._proxy.$tryOpenDocument(e,t).then(t=>{this._documentLoader.delete(e.toString());let n=C.revive(t);return dt(this._documentsAndEditors.getDocument(n))},t=>(this._documentLoader.delete(e.toString()),Promise.reject(t))),this._documentLoader.set(e.toString(),r)),r}createDocumentData(e){return this._proxy.$tryCreateDocument(e).then(e=>C.revive(e))}$acceptModelLanguageChanged(e,t){let n=C.revive(e),r=this._documentsAndEditors.getDocument(n);if(!r)throw Error(`unknown document`);this._onDidRemoveDocument.fire(r.document),r._acceptLanguageId(t),this._onDidAddDocument.fire(r.document)}$acceptModelSaved(e){let t=C.revive(e),n=this._documentsAndEditors.getDocument(t);if(!n)throw Error(`unknown document`);this.$acceptDirtyStateChanged(e,!1),this._onDidSaveDocument.fire(n.document)}$acceptDirtyStateChanged(e,t){let n=C.revive(e),r=this._documentsAndEditors.getDocument(n);if(!r)throw Error(`unknown document`);r._acceptIsDirty(t),this._onDidChangeDocument.fire({document:r.document,contentChanges:[],reason:void 0}),this._onDidChangeDocumentWithReason.fire({document:r.document,contentChanges:[],reason:void 0,detailedReason:void 0})}$acceptEncodingChanged(e,t){let n=C.revive(e),r=this._documentsAndEditors.getDocument(n);if(!r)throw Error(`unknown document`);r._acceptEncoding(t),this._onDidChangeDocument.fire({document:r.document,contentChanges:[],reason:void 0}),this._onDidChangeDocumentWithReason.fire({document:r.document,contentChanges:[],reason:void 0,detailedReason:void 0})}$acceptModelChanged(e,t,n){let r=C.revive(e),i=this._documentsAndEditors.getDocument(r);if(!i)throw Error(`unknown document`);i._acceptIsDirty(n),i.onEvents(t);let a;t.isUndoing?a=VE.Undo:t.isRedoing&&(a=VE.Redo),this._onDidChangeDocument.fire(cc({document:i.document,contentChanges:t.changes.map(e=>({range:J.to(e.range),rangeOffset:e.rangeOffset,rangeLength:e.rangeLength,text:e.text})),reason:a})),this._onDidChangeDocumentWithReason.fire(cc({document:i.document,contentChanges:t.changes.map(e=>({range:J.to(e.range),rangeOffset:e.rangeOffset,rangeLength:e.rangeLength,text:e.text})),reason:a,detailedReason:t.detailedReason?{source:t.detailedReason.source,metadata:t.detailedReason}:void 0}))}setWordDefinitionFor(e,t){Ez(e,t)}},qW=class{constructor(e){this._provider=new Map,this._onDidChange=new x,this.onDidChange=this._onDidChange.event,this._allKnownModels=new Set,this._handlePool=0,this._proxy=e.getProxy(T.MainThreadEmbeddings)}registerEmbeddingsProvider(e,t,n){if(this._allKnownModels.has(t))throw Error(`An embeddings provider for this model is already registered`);let r=this._handlePool++;return this._proxy.$registerEmbeddingProvider(r,t),this._provider.set(r,{id:t,provider:n}),g(()=>{this._allKnownModels.delete(t),this._proxy.$unregisterEmbeddingProvider(r),this._provider.delete(r)})}async computeEmbeddings(e,t,n){n??=Bi.None;let r=!1;typeof t==`string`&&(t=[t],r=!0);let i=await this._proxy.$computeEmbeddings(e,t,n);if(i.length!==t.length)throw Error();if(r){if(i.length!==1)throw Error();return i[0]}return i}async $provideEmbeddings(e,t,n){let r=this._provider.get(e);return r&&await r.provider.provideEmbeddings(t,n)||[]}get embeddingsModels(){return Array.from(this._allKnownModels)}$acceptEmbeddingModels(e){this._allKnownModels=new Set(e),this._onDidChange.fire()}},JW=class{constructor(e){this._AiEmbeddingVectorProviders=new Map,this._nextHandle=0,this._proxy=e.getProxy(T.MainThreadAiEmbeddingVector)}async $provideAiEmbeddingVector(e,t,n){if(this._AiEmbeddingVectorProviders.size===0)throw Error(`No embedding vector providers registered`);let r=this._AiEmbeddingVectorProviders.get(e);if(!r)throw Error(`Embedding vector provider not found`);let i=await r.provideEmbeddingVector(t,n);if(!i)throw Error(`Embedding vector provider returned undefined`);return i}registerEmbeddingVectorProvider(e,t,n){let r=this._nextHandle;return this._nextHandle++,this._AiEmbeddingVectorProviders.set(r,n),this._proxy.$registerAiEmbeddingVectorProvider(t,r),new YT(()=>{this._proxy.$unregisterAiEmbeddingVectorProvider(r),this._AiEmbeddingVectorProviders.delete(r)})}},YW;(function(e){e[e.Invalid=0]=`Invalid`,e[e.Start=1]=`Start`,e[e.H=2]=`H`,e[e.HT=3]=`HT`,e[e.HTT=4]=`HTT`,e[e.HTTP=5]=`HTTP`,e[e.F=6]=`F`,e[e.FI=7]=`FI`,e[e.FIL=8]=`FIL`,e[e.BeforeColon=9]=`BeforeColon`,e[e.AfterColon=10]=`AfterColon`,e[e.AlmostThere=11]=`AlmostThere`,e[e.End=12]=`End`,e[e.Accept=13]=`Accept`,e[e.LastKnownState=14]=`LastKnownState`})(YW||={});var XW=class{constructor(e,t,n){let r=new Uint8Array(e*t);for(let i=0,a=e*t;i<a;i++)r[i]=n;this._data=r,this.rows=e,this.cols=t}get(e,t){return this._data[e*this.cols+t]}set(e,t,n){this._data[e*this.cols+t]=n}},ZW=class{constructor(e){let t=0,n=YW.Invalid;for(let r=0,i=e.length;r<i;r++){let[i,a,o]=e[r];a>t&&(t=a),i>n&&(n=i),o>n&&(n=o)}t++,n++;let r=new XW(n,t,YW.Invalid);for(let t=0,n=e.length;t<n;t++){let[n,i,a]=e[t];r.set(n,i,a)}this._states=r,this._maxCharCode=t}nextState(e,t){return t<0||t>=this._maxCharCode?YW.Invalid:this._states.get(e,t)}};let QW=null;function $W(){return QW===null&&(QW=new ZW([[YW.Start,S.h,YW.H],[YW.Start,S.H,YW.H],[YW.Start,S.f,YW.F],[YW.Start,S.F,YW.F],[YW.H,S.t,YW.HT],[YW.H,S.T,YW.HT],[YW.HT,S.t,YW.HTT],[YW.HT,S.T,YW.HTT],[YW.HTT,S.p,YW.HTTP],[YW.HTT,S.P,YW.HTTP],[YW.HTTP,S.s,YW.BeforeColon],[YW.HTTP,S.S,YW.BeforeColon],[YW.HTTP,S.Colon,YW.AfterColon],[YW.F,S.i,YW.FI],[YW.F,S.I,YW.FI],[YW.FI,S.l,YW.FIL],[YW.FI,S.L,YW.FIL],[YW.FIL,S.e,YW.BeforeColon],[YW.FIL,S.E,YW.BeforeColon],[YW.BeforeColon,S.Colon,YW.AfterColon],[YW.AfterColon,S.Slash,YW.AlmostThere],[YW.AlmostThere,S.Slash,YW.End]])),QW}var eG;(function(e){e[e.None=0]=`None`,e[e.ForceTermination=1]=`ForceTermination`,e[e.CannotEndIn=2]=`CannotEndIn`})(eG||={});let tG=null;function nG(){if(tG===null){tG=new sR(eG.None);for(let e=0;e<36;e++)tG.set(` <>'"、。。、,.:;‘〈「『〔([{「」}])〕』」〉’`~…|`.charCodeAt(e),eG.ForceTermination);for(let e=0;e<4;e++)tG.set(`.,;:`.charCodeAt(e),eG.CannotEndIn)}return tG}var rG=class e{static _createLink(e,t,n,r,i){let a=i-1;do{let n=t.charCodeAt(a);if(e.get(n)!==eG.CannotEndIn)break;a--}while(a>r);if(r>0){let e=t.charCodeAt(r-1),n=t.charCodeAt(a);(e===S.OpenParen&&n===S.CloseParen||e===S.OpenSquareBracket&&n===S.CloseSquareBracket||e===S.OpenCurlyBrace&&n===S.CloseCurlyBrace)&&a--}return{range:{startLineNumber:n,startColumn:r+1,endLineNumber:n,endColumn:a+2},url:t.substring(r,a+1)}}static computeLinks(t,n=$W()){let r=nG(),i=[];for(let a=1,o=t.getLineCount();a<=o;a++){let o=t.getLineContent(a),s=o.length,c=0,l=0,u=0,d=YW.Start,f=!1,p=!1,m=!1,ee=!1;for(;c<s;){let t=!1,s=o.charCodeAt(c);if(d===YW.Accept){let n;switch(s){case S.OpenParen:f=!0,n=eG.None;break;case S.CloseParen:n=f?eG.None:eG.ForceTermination;break;case S.OpenSquareBracket:m=!0,p=!0,n=eG.None;break;case S.CloseSquareBracket:m=!1,n=p?eG.None:eG.ForceTermination;break;case S.OpenCurlyBrace:ee=!0,n=eG.None;break;case S.CloseCurlyBrace:n=ee?eG.None:eG.ForceTermination;break;case S.SingleQuote:case S.DoubleQuote:case S.BackTick:n=u===s?eG.ForceTermination:u===S.SingleQuote||u===S.DoubleQuote||u===S.BackTick?eG.None:eG.ForceTermination;break;case S.Asterisk:n=u===S.Asterisk?eG.ForceTermination:eG.None;break;case S.Space:n=m?eG.None:eG.ForceTermination;break;default:n=r.get(s)}n===eG.ForceTermination&&(i.push(e._createLink(r,o,a,l,c)),t=!0)}else if(d===YW.End){let e;s===S.OpenSquareBracket?(p=!0,e=eG.None):e=r.get(s),e===eG.ForceTermination?t=!0:d=YW.Accept}else d=n.nextState(d,s),d===YW.Invalid&&(t=!0);t&&(d=YW.Start,f=!1,p=!1,ee=!1,l=c+1,u=s),c++}d===YW.Accept&&i.push(e._createLink(r,o,a,l,s))}return i}},iG=class{constructor(){this._schemes=[]}add(e){this._stateMachine=void 0,this._schemes.push(e)}delete(e){let t=this._schemes.indexOf(e);t>=0&&(this._schemes.splice(t,1),this._stateMachine=void 0)}_initStateMachine(){if(!this._stateMachine){let e=this._schemes.sort(),t=[],n,r,i=YW.LastKnownState,a=YW.LastKnownState;for(let o of e){let e=n?_a(n,o):0;for(r=e===0?YW.Start:a;e<o.length;e++)e+1===o.length?(i=a,a=YW.BeforeColon):a+=1,t.push([r,o.toUpperCase().charCodeAt(e),a]),t.push([r,o.toLowerCase().charCodeAt(e),a]),r=a;n=o,a=i}t.push([YW.BeforeColon,S.Colon,YW.AfterColon]),t.push([YW.AfterColon,S.Slash,YW.End]),this._stateMachine=new ZW(t)}}provideDocumentLinks(e){this._initStateMachine();let t=[],n=rG.computeLinks({getLineContent(t){return e.lineAt(t-1).text},getLineCount(){return e.lineCount}},this._stateMachine);for(let e of n){let n=nM.to(e);n.target&&t.push(n)}return t}},aG=class e{constructor(e,t){this._extHostLanguageFeatures=t,this._linkProvider=new iG,this._fsProvider=new Map,this._registeredSchemes=new Set,this._watches=new Map,this._handlePool=0,this._proxy=e.getProxy(T.MainThreadFileSystem)}dispose(){this._linkProviderRegistration?.dispose()}registerFileSystemProvider(t,n,r,i={}){if(e._validateFileSystemProvider(r),this._registeredSchemes.has(n))throw Error(`a provider for the scheme '${n}' is already registered`);this._linkProviderRegistration||=this._extHostLanguageFeatures.registerDocumentLinkProvider(t,`*`,this._linkProvider);let a=this._handlePool++;this._linkProvider.add(n),this._registeredSchemes.add(n),this._fsProvider.set(a,r);let o=bc.FileReadWrite;i.isCaseSensitive&&(o+=bc.PathCaseSensitive),i.isReadonly&&(o+=bc.Readonly),typeof r.copy==`function`&&(o+=bc.FileFolderCopy),typeof r.open==`function`&&typeof r.close==`function`&&typeof r.read==`function`&&typeof r.write==`function`&&(K(t,`fsChunks`),o+=bc.FileOpenReadWriteClose);let s;i.isReadonly&&wl(i.isReadonly)&&i.isReadonly.value!==``&&(s={value:i.isReadonly.value,isTrusted:i.isReadonly.isTrusted,supportThemeIcons:i.isReadonly.supportThemeIcons,supportHtml:i.isReadonly.supportHtml,baseUri:i.isReadonly.baseUri,uris:i.isReadonly.uris}),this._proxy.$registerFileSystemProvider(a,n,o,s).catch(e=>{console.error(`FAILED to register filesystem provider of ${t.identifier.value}-extension for the scheme ${n}`),console.error(e)});let c=r.onDidChangeFile(e=>{let t=[];for(let r of e){let{uri:e,type:i}=r;if(e.scheme!==n)continue;let a;switch(i){case aO.Changed:a=Dc.UPDATED;break;case aO.Created:a=Dc.ADDED;break;case aO.Deleted:a=Dc.DELETED;break;default:throw Error(`Unknown FileChangeType`)}t.push({resource:e,type:a})}this._proxy.$onFileSystemChange(a,t)});return g(()=>{c.dispose(),this._linkProvider.delete(n),this._registeredSchemes.delete(n),this._fsProvider.delete(a),this._proxy.$unregisterProvider(a)})}static _validateFileSystemProvider(e){if(!e)throw Error(`MISSING provider`);if(typeof e.watch!=`function`)throw Error(`Provider does NOT implement watch`);if(typeof e.stat!=`function`)throw Error(`Provider does NOT implement stat`);if(typeof e.readDirectory!=`function`)throw Error(`Provider does NOT implement readDirectory`);if(typeof e.createDirectory!=`function`)throw Error(`Provider does NOT implement createDirectory`);if(typeof e.readFile!=`function`)throw Error(`Provider does NOT implement readFile`);if(typeof e.writeFile!=`function`)throw Error(`Provider does NOT implement writeFile`);if(typeof e.delete!=`function`)throw Error(`Provider does NOT implement delete`);if(typeof e.rename!=`function`)throw Error(`Provider does NOT implement rename`)}static _asIStat(e){let{type:t,ctime:n,mtime:r,size:i,permissions:a}=e;return{type:t,ctime:n,mtime:r,size:i,permissions:a}}$stat(t,n){return Promise.resolve(this._getFsProvider(t).stat(C.revive(n))).then(t=>e._asIStat(t))}$readdir(e,t){return Promise.resolve(this._getFsProvider(e).readDirectory(C.revive(t)))}$readFile(e,t){return Promise.resolve(this._getFsProvider(e).readFile(C.revive(t))).then(e=>y.wrap(e))}$writeFile(e,t,n,r){return Promise.resolve(this._getFsProvider(e).writeFile(C.revive(t),n.buffer,r))}$delete(e,t,n){return Promise.resolve(this._getFsProvider(e).delete(C.revive(t),n))}$rename(e,t,n,r){return Promise.resolve(this._getFsProvider(e).rename(C.revive(t),C.revive(n),r))}$copy(e,t,n,r){let i=this._getFsProvider(e);if(!i.copy)throw Error(`FileSystemProvider does not implement "copy"`);return Promise.resolve(i.copy(C.revive(t),C.revive(n),r))}$mkdir(e,t){return Promise.resolve(this._getFsProvider(e).createDirectory(C.revive(t)))}$watch(e,t,n,r){let i=this._getFsProvider(e).watch(C.revive(n),r);this._watches.set(t,i)}$unwatch(e,t){let n=this._watches.get(t);n&&(n.dispose(),this._watches.delete(t))}$open(e,t,n){let r=this._getFsProvider(e);if(!r.open)throw Error(`FileSystemProvider does not implement "open"`);return Promise.resolve(r.open(C.revive(t),n))}$close(e,t){let n=this._getFsProvider(e);if(!n.close)throw Error(`FileSystemProvider does not implement "close"`);return Promise.resolve(n.close(t))}$read(e,t,n,r){let i=this._getFsProvider(e);if(!i.read)throw Error(`FileSystemProvider does not implement "read"`);let a=y.alloc(r);return Promise.resolve(i.read(t,n,a.buffer,0,r)).then(e=>a.slice(0,e))}$write(e,t,n,r){let i=this._getFsProvider(e);if(!i.write)throw Error(`FileSystemProvider does not implement "write"`);return Promise.resolve(i.write(t,n,r.buffer,0,r.byteLength))}_getFsProvider(e){let t=this._fsProvider.get(e);if(!t){let e=Error();throw e.name=`ENOPRO`,e.message=`no provider`,e}return t}};(class e extends v{static{this.MAX_RESTARTS=5}constructor(e,t,n,r){super(),this.onFileChanges=e,this.onLogMessage=t,this.verboseLogging=n,this.options=r,this.watcherDisposables=this._register(new wt),this.requests=void 0,this.restartCounter=0}init(){let e=new _;this.watcherDisposables.value=e,this.watcher=this.createWatcher(e),this.watcher.setVerboseLogging(this.verboseLogging),e.add(this.watcher.onDidChangeFile(e=>this.onFileChanges(e))),e.add(this.watcher.onDidLogMessage(e=>this.onLogMessage(e))),e.add(this.watcher.onDidError(e=>this.onError(e.error,e.request)))}onError(t,n){this.canRestart(t,n)?this.restartCounter<e.MAX_RESTARTS&&this.requests?(this.error(`restarting watcher after unexpected error: ${t}`),this.restart(this.requests)):this.error(`gave up attempting to restart watcher after unexpected error: ${t}`):this.error(t)}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()}});function oG(e,t){return typeof t==`string`&&!t.startsWith(`**`)&&!qr(t)?{base:e,pattern:t}:t}var sG=class{get ignoreCreateEvents(){return!!(this._config&1)}get ignoreChangeEvents(){return!!(this._config&2)}get ignoreDeleteEvents(){return!!(this._config&4)}constructor(e,t,n,r,i,a,o,s){this.session=Math.random(),this._onDidCreate=new x,this._onDidChange=new x,this._onDidDelete=new x,this._config=0,s.ignoreCreateEvents&&(this._config+=1),s.ignoreChangeEvents&&(this._config+=2),s.ignoreDeleteEvents&&(this._config+=4);let c=typeof o==`string`?!((n.getCapabilities(D.file)??0)&bc.PathCaseSensitive):n.extUri.ignorePathCasing(C.revive(o.baseUri)),l=o;c&&(l=typeof o==`string`?o.toLowerCase():{base:o.base.toLowerCase(),pattern:o.pattern.toLowerCase()});let u=KS(l,{ignoreCase:!1}),d=typeof o==`string`,f=a(e=>{if(!(typeof e.session==`number`&&e.session!==this.session)){if(!s.ignoreCreateEvents)for(let{uri:t,lowerCaseFsPath:n}of e.created)u(c?n:t.fsPath)&&(!d||r.getWorkspaceFolder(t))&&this._onDidCreate.fire(t);if(!s.ignoreChangeEvents)for(let{uri:t,lowerCaseFsPath:n}of e.changed)u(c?n:t.fsPath)&&(!d||r.getWorkspaceFolder(t))&&this._onDidChange.fire(t);if(!s.ignoreDeleteEvents)for(let{uri:t,lowerCaseFsPath:n}of e.deleted)u(c?n:t.fsPath)&&(!d||r.getWorkspaceFolder(t))&&this._onDidDelete.fire(t)}});this._disposable=YT.from(this.ensureWatching(e,r,t,i,o,s,!1),this._onDidCreate,this._onDidChange,this._onDidDelete,f)}ensureWatching(e,t,n,r,i,a,o){let s=YT.from();if(typeof i==`string`||a.ignoreChangeEvents&&a.ignoreCreateEvents&&a.ignoreDeleteEvents)return s;let c=e.getProxy(T.MainThreadFileSystemEventService),l=!1;(i.pattern.includes(`**`)||i.pattern.includes(`/`))&&(l=!0);let u=[],d,f;if(o)(a.ignoreChangeEvents||a.ignoreCreateEvents||a.ignoreDeleteEvents)&&(f=yc.UPDATED|yc.ADDED|yc.DELETED,a.ignoreChangeEvents&&(f&=~yc.UPDATED),a.ignoreCreateEvents&&(f&=~yc.ADDED),a.ignoreDeleteEvents&&(f&=~yc.DELETED));else if(l&&u.length===0){let e=t.getWorkspaceFolder(C.revive(i.baseUri)),r=n.getConfiguration(`files`,e).get(`watcherExclude`);if(r)for(let e in r)e&&r[e]===!0&&u.push(e)}else if(!l){let e=t.getWorkspaceFolder(C.revive(i.baseUri));if(e){let t=n.getConfiguration(`files`,e).get(`watcherExclude`);if(t){for(let n in t)if(n&&t[n]===!0){let t=`${na(n,`/`)}/**`;d||=[],d.push(oG(e.uri.fsPath,t))}}if(!d||d.length===0)return s}}return c.$watch(r.identifier.value,this.session,i.baseUri,{recursive:l,excludes:u,includes:d,filter:f},!!o),YT.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}},cG=class e{get created(){return this._created.value}get changed(){return this._changed.value}get deleted(){return this._deleted.value}static _revive(e){let t=C.revive(e);return{uri:t,lowerCaseFsPath:t.fsPath.toLowerCase()}}constructor(t){this._events=t,this._created=new u(()=>this._events.created.map(e._revive)),this._changed=new u(()=>this._events.changed.map(e._revive)),this._deleted=new u(()=>this._events.deleted.map(e._revive)),this.session=this._events.session}},lG=class{constructor(e,t,n){this._mainContext=e,this._logService=t,this._extHostDocumentsAndEditors=n,this._onFileSystemEvent=new x,this._onDidRenameFile=new x,this._onDidCreateFile=new x,this._onDidDeleteFile=new x,this._onWillRenameFile=new mr,this._onWillCreateFile=new mr,this._onWillDeleteFile=new mr,this.onDidRenameFile=this._onDidRenameFile.event,this.onDidCreateFile=this._onDidCreateFile.event,this.onDidDeleteFile=this._onDidDeleteFile.event}createFileSystemWatcher(e,t,n,r,i,a){return new sG(this._mainContext,t,n,e,r,this._onFileSystemEvent.event,pM.from(i),a)}$onFileEvent(e){this._onFileSystemEvent.fire(new cG(e))}$onDidRunFileOperation(e,t){switch(e){case Ec.MOVE:this._onDidRenameFile.fire(Object.freeze({files:t.map(e=>({oldUri:C.revive(e.source),newUri:C.revive(e.target)}))}));break;case Ec.DELETE:this._onDidDeleteFile.fire(Object.freeze({files:t.map(e=>C.revive(e.target))}));break;case Ec.CREATE:case Ec.COPY:this._onDidCreateFile.fire(Object.freeze({files:t.map(e=>C.revive(e.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(n,r,i)=>{let a=function(e){n.call(r,e)};return a.extension=e,t.event(a,void 0,i)}}async $onWillRunFileOperation(e,t,n,r){switch(e){case Ec.MOVE:return await this._fireWillEvent(this._onWillRenameFile,{files:t.map(e=>({oldUri:C.revive(e.source),newUri:C.revive(e.target)}))},n,r);case Ec.DELETE:return await this._fireWillEvent(this._onWillDeleteFile,{files:t.map(e=>C.revive(e.target))},n,r);case Ec.CREATE:case Ec.COPY:return await this._fireWillEvent(this._onWillCreateFile,{files:t.map(e=>C.revive(e.target))},n,r)}}async _fireWillEvent(e,t,n,r){let i=new Set,a=[];if(await e.fireAsync(t,r,async(e,t)=>{let r=Date.now(),o=await Promise.resolve(e);o instanceof zT&&(a.push([t.extension,o]),i.add(t.extension.displayName??t.extension.identifier.value)),Date.now()-r>n&&this._logService.warn(`SLOW file-participant`,t.extension.identifier)}),r.isCancellationRequested||a.length===0)return;let o={edits:[]};for(let[,e]of a){let{edits:t}=Oj.from(e,{getTextDocumentVersion:e=>this._extHostDocumentsAndEditors.getDocument(e)?.version,getNotebookDocumentVersion:()=>void 0});o.edits=o.edits.concat(t)}return{edit:o,extensionNames:Array.from(i)}}},uG=class{constructor(e,t,n,r,i){this._extHostNotebooks=t,this._textDocumentsAndEditors=n,this._commands=r;let a=new KI(`interactive.open`,`_interactive.open`,`Open interactive window and return notebook editor and input URI`,[new X(`showOptions`,`Show Options`,e=>!0,e=>e),new X(`resource`,`Interactive resource Uri`,e=>!0,e=>e),new X(`controllerId`,`Notebook controller Id`,e=>!0,e=>e),new X(`title`,`Interactive editor title`,e=>!0,e=>e)],new GI(`Notebook and input URI`,e=>{if(i.debug(`[ExtHostInteractive] open iw with notebook editor id`,e.notebookEditorId),e.notebookEditorId!==void 0){let t=this._extHostNotebooks.getEditorById(e.notebookEditorId);return i.debug(`[ExtHostInteractive] notebook editor found`,t.id),{notebookUri:C.revive(e.notebookUri),inputUri:C.revive(e.inputUri),notebookEditor:t.apiEditor}}return i.debug(`[ExtHostInteractive] notebook editor not found, uris for the interactive document`,e.notebookUri,e.inputUri),{notebookUri:C.revive(e.notebookUri),inputUri:C.revive(e.inputUri)}}));this._commands.registerApiCommand(a)}$willAddInteractiveDocument(e,t,n,r){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:[{EOL:t,lines:[``],languageId:n,uri:e,isDirty:!1,versionId:1,encoding:`utf8`}]})}$willRemoveInteractiveDocument(e,t){this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({removedDocuments:[e]})}},dG=class{constructor(e){this._handlePool=0,this._proxy=e.getProxy(T.MainThreadLabelService)}$registerResourceLabelFormatter(e){let t=this._handlePool++;return this._proxy.$registerResourceLabelFormatter(t,e),g(()=>{this._proxy.$unregisterResourceLabelFormatter(t)})}},fG;(function(e){e[e.LTR=0]=`LTR`,e[e.RTL=1]=`RTL`})(fG||={});var pG=class e extends Ep{constructor(e,t,n,r){super(e,t,n,r),this.selectionStartLineNumber=e,this.selectionStartColumn=t,this.positionLineNumber=n,this.positionColumn=r}toString(){return`[`+this.selectionStartLineNumber+`,`+this.selectionStartColumn+` -> `+this.positionLineNumber+`,`+this.positionColumn+`]`}equalsSelection(t){return e.selectionsEqual(this,t)}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?fG.LTR:fG.RTL}setEndPosition(t,n){return this.getDirection()===fG.LTR?new e(this.startLineNumber,this.startColumn,t,n):new e(t,n,this.startLineNumber,this.startColumn)}getPosition(){return new Tp(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Tp(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(t,n){return this.getDirection()===fG.LTR?new e(t,n,this.endLineNumber,this.endColumn):new e(this.endLineNumber,this.endColumn,t,n)}static fromPositions(t,n=t){return new e(t.lineNumber,t.column,n.lineNumber,n.column)}static fromRange(t,n){return n===fG.LTR?new e(t.startLineNumber,t.startColumn,t.endLineNumber,t.endColumn):new e(t.endLineNumber,t.endColumn,t.startLineNumber,t.startColumn)}static liftSelection(t){return new e(t.selectionStartLineNumber,t.selectionStartColumn,t.positionLineNumber,t.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 n=0,r=e.length;n<r;n++)if(!this.selectionsEqual(e[n],t[n]))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(t,n,r,i,a){return a===fG.LTR?new e(t,n,r,i):new e(r,i,t,n)}},mG=class e{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentSymbols(t,n){let r=this._documents.getDocument(t),i=await this._provider.provideDocumentSymbols(r,n);if(!we(i))return i[0]instanceof sE?i.map(Mj.from):e._asDocumentSymbolTree(i)}static _asDocumentSymbolTree(e){e=e.slice(0).sort((e,t)=>{let n=e.location.range.start.compareTo(t.location.range.start);return n===0&&(n=t.location.range.end.compareTo(e.location.range.end)),n});let t=[],n=[];for(let r of e){let e={name:r.name||`!!MISSING: name!!`,kind:kj.from(r.kind),tags:r.tags?.map(Aj.from)||[],detail:``,containerName:r.containerName,range:J.from(r.location.range),selectionRange:J.from(r.location.range),children:[]};for(;;){if(n.length===0){n.push(e),t.push(e);break}let r=n[n.length-1];if(Ep.containsRange(r.range,e.range)&&!Ep.equalsRange(r.range,e.range)){r.children?.push(e),n.push(e);break}n.pop()}}return t}},hG=class{constructor(e,t,n,r,i,a){this._documents=e,this._commands=t,this._provider=n,this._extension=r,this._extTelemetry=i,this._logService=a,this._cache=new EW(`CodeLens`),this._disposables=new Map}async provideCodeLenses(e,t){let n=this._documents.getDocument(e),r=await this._provider.provideCodeLenses(n,t);if(!r||t.isCancellationRequested)return;let i=this._cache.add(r),a=new _;this._disposables.set(i,a);let o={cacheId:i,lenses:[]};for(let e=0;e<r.length;e++){if(!sT.isRange(r[e].range)){console.warn(`INVALID code lens, range is not defined`,this._extension.identifier.value);continue}o.lenses.push({cacheId:[i,e],range:J.from(r[e].range),command:this._commands.toInternal(r[e].command,a)})}return o}async resolveCodeLens(e,t){let n=e.cacheId&&this._cache.get(...e.cacheId);if(!n)return;let r;if(r=typeof this._provider.resolveCodeLens!=`function`||n.isResolved?n:await this._provider.resolveCodeLens(n,t),r||=n,t.isCancellationRequested)return;let i=e.cacheId&&this._disposables.get(e.cacheId[0]);if(i){if(!r.command){let e=Error(`INVALID code lens resolved, lacks command: `+this._extension.identifier.value);this._extTelemetry.onExtensionError(this._extension.identifier,e),this._logService.error(e);return}return e.command=this._commands.toInternal(r.command,i),e}}releaseCodeLenses(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}};function gG(e){return Array.isArray(e)?e.map(Lj.from):e?[Lj.from(e)]:[]}var _G=class{constructor(e,t){this._documents=e,this._provider=t}async provideDefinition(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t);return gG(await this._provider.provideDefinition(r,i,n))}},vG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDeclaration(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t);return gG(await this._provider.provideDeclaration(r,i,n))}},yG=class{constructor(e,t){this._documents=e,this._provider=t}async provideImplementation(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t);return gG(await this._provider.provideImplementation(r,i,n))}},bG=class{constructor(e,t){this._documents=e,this._provider=t}async provideTypeDefinition(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t);return gG(await this._provider.provideTypeDefinition(r,i,n))}},xG=class e{static{this.HOVER_MAP_MAX_SIZE=10}constructor(e,t){this._documents=e,this._provider=t,this._hoverCounter=0,this._hoverMap=new Map}async provideHover(t,n,r,i){let a=this._documents.getDocument(t),o=fj.to(n),s;if(r&&r.verbosityRequest){let e=r.verbosityRequest.previousHover.id,t=this._hoverMap.get(e);if(!t)throw Error(`Hover with id ${e} not found`);let n={verbosityDelta:r.verbosityRequest.verbosityDelta,previousHover:t};s=await this._provider.provideHover(a,o,i,n)}else s=await this._provider.provideHover(a,o,i);if(!s||we(s.contents))return;s.range||=a.getWordRangeAtPosition(o),s.range||=new sT(o,o);let c=Rj.from(s),l=this._hoverCounter;if(this._hoverMap.size===e.HOVER_MAP_MAX_SIZE){let e=Math.min(...this._hoverMap.keys());this._hoverMap.delete(e)}return this._hoverMap.set(l,s),this._hoverCounter+=1,{...c,id:l}}releaseHover(e){this._hoverMap.delete(e)}},SG=class{constructor(e,t){this._documents=e,this._provider=t}async provideEvaluatableExpression(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t),a=await this._provider.provideEvaluatableExpression(r,i,n);if(a)return zj.from(a)}},CG=class{constructor(e,t){this._documents=e,this._provider=t}async provideInlineValues(e,t,n,r){let i=this._documents.getDocument(e),a=await this._provider.provideInlineValues(i,J.to(t),Vj.to(n),r);if(Array.isArray(a))return a.map(e=>Bj.from(e))}},wG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentHighlights(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t),a=await this._provider.provideDocumentHighlights(r,i,n);if(Array.isArray(a))return a.map(Hj.from)}},TG=class{constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async provideMultiDocumentHighlights(e,t,n,r){let i=this._documents.getDocument(e),a=n.map(e=>{try{return this._documents.getDocument(e)}catch(t){this._logService.error(`Error: Unable to retrieve document from URI: `+e+`. Error message: `+t);return}}).filter(e=>e!==void 0),o=fj.to(t),s=await this._provider.provideMultiDocumentHighlights(i,o,a,r);if(Array.isArray(s))return s.map(Uj.from)}},EG=class{constructor(e,t){this._documents=e,this._provider=t}async provideLinkedEditingRanges(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t),a=await this._provider.provideLinkedEditingRanges(r,i,n);if(a&&Array.isArray(a.ranges))return{ranges:Se(a.ranges.map(J.from)),wordPattern:a.wordPattern}}},DG=class{constructor(e,t){this._documents=e,this._provider=t}async provideReferences(e,t,n,r){let i=this._documents.getDocument(e),a=fj.to(t),o=await this._provider.provideReferences(i,a,n,r);if(Array.isArray(o))return o.map(Ij.from)}},OG=class e{static{this._maxCodeActionsPerFile=1e3}constructor(e,t,n,r,i,a,o){this._documents=e,this._commands=t,this._diagnostics=n,this._provider=r,this._logService=i,this._extension=a,this._apiDeprecation=o,this._cache=new EW(`CodeAction`),this._disposables=new Map}async provideCodeActions(t,n,r,i){let a=this._documents.getDocument(t),o=pG.isISelection(n)?lj.to(n):J.to(n),s=[];for(let n of this._diagnostics.getDiagnostics(t))if(o.intersection(n.range)&&s.push(n)>e._maxCodeActionsPerFile)break;let c={diagnostics:s,only:r.only?new uT(r.only):void 0,triggerKind:PM.to(r.trigger)},l=await this._provider.provideCodeActions(a,o,c,i);if(!Te(l)||i.isCancellationRequested)return;let u=this._cache.add(l),d=new _;this._disposables.set(u,d);let f=[];for(let t=0;t<l.length;t++){let n=l[t];if(n)if(e._isCommand(n)&&!(n instanceof lE))this._apiDeprecation.report(`CodeActionProvider.provideCodeActions - return commands`,this._extension,`Return 'CodeAction' instances instead.`),f.push({_isSynthetic:!0,title:n.title,command:this._commands.toInternal(n,d)});else{let e=n;c.only&&(e.kind?c.only.contains(e.kind)||this._logService.warn(`${this._extension.identifier.value} - Code actions of kind '${c.only.value}' requested but returned code action is of kind '${e.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 '${c.only.value}' requested but returned code action does not have a 'kind'. Code action will be dropped. Please set 'CodeAction.kind'.`));let r=e.ranges??[];f.push({cacheId:[u,t],title:e.title,command:e.command&&this._commands.toInternal(e.command,d),diagnostics:e.diagnostics&&e.diagnostics.map(hj.from),edit:e.edit&&Oj.from(e.edit,void 0),kind:e.kind&&e.kind.value,isPreferred:e.isPreferred,isAI:Mw(this._extension)?e.isAI:!1,ranges:Mw(this._extension)?Se(r.map(J.from)):void 0,disabled:e.disabled?.reason})}}return{cacheId:u,actions:f}}async resolveCodeAction(t,n){let[r,i]=t,a=this._cache.get(r,i);if(!a||e._isCommand(a)||!this._provider.resolveCodeAction)return{};let o=await this._provider.resolveCodeAction(a,n)??a,s;o.edit&&(s=Oj.from(o.edit,void 0));let c;if(o.command){let e=this._disposables.get(r);e&&(c=this._commands.toInternal(o.command,e))}return{edit:s,command:c}}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`}},kG=class{constructor(e,t,n,r,i){this._proxy=e,this._documents=t,this._provider=n,this._handle=r,this._extension=i,this._editsCache=new EW(`DocumentPasteEdit.edits`)}async prepareDocumentPaste(e,t,n,r){if(!this._provider.prepareDocumentPaste)return;this._cachedPrepare=void 0;let i=this._documents.getDocument(e),a=t.map(e=>J.to(e)),o=RM.toDataTransfer(n,()=>{throw new de});if(await this._provider.prepareDocumentPaste(i,a,o,r),r.isCancellationRequested)return;let s=Array.from(o).filter(([,e])=>!(e instanceof TD)),c=new Map,l=await Promise.all(Array.from(s,async([e,t])=>{let n=Gc();return c.set(n,t),[e,await LM.from(e,t,n)]}));return this._cachedPrepare=c,{items:l}}async providePasteEdits(e,t,n,r,i,a){if(!this._provider.provideDocumentPasteEdits)return[];let o=this._documents.getDocument(t),s=n.map(e=>J.to(e)),c=new OD(r.items.map(([t,n])=>{let r=this._cachedPrepare?.get(n.id);return r?[t,r]:[t,LM.to(t,n,async t=>(await this._proxy.$resolvePasteFileData(this._handle,e,t)).buffer)]})),l=await this._provider.provideDocumentPasteEdits(o,s,c,{only:i.only?new jD(i.only):void 0,triggerKind:i.triggerKind},a);if(!l||a.isCancellationRequested)return[];let u=this._editsCache.add(l);return l.map((e,t)=>({_cacheId:[u,t],title:e.title??b(2867,`Paste using '{0}' extension`,this._extension.displayName||this._extension.name),kind:e.kind,yieldTo:e.yieldTo?.map(e=>e.value),insertText:typeof e.insertText==`string`?e.insertText:{snippet:e.insertText.value},additionalEdit:e.additionalEdit?Oj.from(e.additionalEdit,void 0):void 0}))}async resolvePasteEdit(e,t){let[n,r]=e,i=this._editsCache.get(n,r);if(!i||!this._provider.resolveDocumentPasteEdit)return{};let a=await this._provider.resolveDocumentPasteEdit(i,t)??i;return{insertText:a.insertText,additionalEdit:a.additionalEdit?Oj.from(a.additionalEdit,void 0):void 0}}releasePasteEdits(e){this._editsCache.delete(e)}},AG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentFormattingEdits(e,t,n){let r=this._documents.getDocument(e),i=await this._provider.provideDocumentFormattingEdits(r,t,n);if(Array.isArray(i))return i.map(Dj.from)}},jG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeFormattingEdits(e,t,n,r){let i=this._documents.getDocument(e),a=J.to(t),o=await this._provider.provideDocumentRangeFormattingEdits(i,a,n,r);if(Array.isArray(o))return o.map(Dj.from)}async provideDocumentRangesFormattingEdits(e,t,n,r){ut(typeof this._provider.provideDocumentRangesFormattingEdits==`function`,"INVALID invocation of `provideDocumentRangesFormattingEdits`");let i=this._documents.getDocument(e),a=t.map(J.to),o=await this._provider.provideDocumentRangesFormattingEdits(i,a,n,r);if(Array.isArray(o))return o.map(Dj.from)}},MG=class{constructor(e,t){this._documents=e,this._provider=t,this.autoFormatTriggerCharacters=[]}async provideOnTypeFormattingEdits(e,t,n,r,i){let a=this._documents.getDocument(e),o=fj.to(t),s=await this._provider.provideOnTypeFormattingEdits(a,o,n,r,i);if(Array.isArray(s))return s.map(Dj.from)}},NG=class{constructor(e,t){this._provider=e,this._logService=t,this._cache=new EW(`WorkspaceSymbols`)}async provideWorkspaceSymbols(e,t){let n=await this._provider.provideWorkspaceSymbols(e,t);if(!Te(n))return{symbols:[]};let r=this._cache.add(n),i={cacheId:r,symbols:[]};for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name){this._logService.warn(`INVALID SymbolInformation`,t);continue}i.symbols.push({...jj.from(t),cacheId:[r,e]})}return i}async resolveWorkspaceSymbol(e,t){if(typeof this._provider.resolveWorkspaceSymbol!=`function`||!e.cacheId)return e;let n=this._cache.get(...e.cacheId);if(n){let r=await this._provider.resolveWorkspaceSymbol(n,t);return r&&fc(e,jj.from(r),!0)}}releaseWorkspaceSymbols(e){this._cache.delete(e)}},PG=class e{static supportsResolving(e){return typeof e.prepareRename==`function`}constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async provideRenameEdits(t,n,r,i){let a=this._documents.getDocument(t),o=fj.to(n);try{let e=await this._provider.provideRenameEdits(a,o,r,i);return e?Oj.from(e):void 0}catch(t){let n=e._asMessage(t);return n?{rejectReason:n,edits:void 0}:Promise.reject(t)}}async resolveRenameLocation(t,n,r){if(typeof this._provider.prepareRename!=`function`)return Promise.resolve(void 0);let i=this._documents.getDocument(t),a=fj.to(n);try{let e=await this._provider.prepareRename(i,a,r),t,n;if(sT.isRange(e)?(t=e,n=i.getText(e)):rt(e)&&(t=e.range,n=e.placeholder),!t||!n)return;if(t.start.line>a.line||t.end.line<a.line){this._logService.warn(`INVALID rename location: position line must be within range start/end lines`);return}return{range:J.from(t),text:n}}catch(t){let n=e._asMessage(t);return n?{rejectReason:n,range:void 0,text:void 0}:Promise.reject(t)}}static _asMessage(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}},FG=class e{static{this.languageTriggerKindToVSCodeTriggerKind={[$p.Invoke]:rO.Invoke,[$p.Automatic]:rO.Automatic}}constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async supportsAutomaticNewSymbolNamesTriggerKind(){return this._provider.supportsAutomaticTriggerKind}async provideNewSymbolNames(t,n,r,i){let a=this._documents.getDocument(t),o=J.to(n);try{let t=e.languageTriggerKindToVSCodeTriggerKind[r],n=await this._provider.provideNewSymbolNames(a,o,t,i);return n?n.map(e=>typeof e==`string`?{newSymbolName:e}:{newSymbolName:e.newSymbolName,tags:e.tags}):void 0}catch(t){this._logService.error(e._asMessage(t)??JSON.stringify(t,null,` `));return}}static _asMessage(e){if(typeof e==`string`)return e;if(e instanceof Error&&typeof e.message==`string`)return e.message}},IG=class{constructor(e,t){this.resultId=e,this.tokens=t}},LG=class e{constructor(e,t){this._documents=e,this._provider=t,this._nextResultId=1,this._previousResults=new Map}async provideDocumentSemanticTokens(t,n,r){let i=this._documents.getDocument(t),a=n===0?null:this._previousResults.get(n),o=typeof a?.resultId==`string`&&typeof this._provider.provideDocumentSemanticTokensEdits==`function`?await this._provider.provideDocumentSemanticTokensEdits(i,a.resultId,r):await this._provider.provideDocumentSemanticTokens(i,r);return a&&this._previousResults.delete(n),o?(o=e._fixProvidedSemanticTokens(o),this._send(e._convertToEdits(a,o),o)):null}async releaseDocumentSemanticColoring(e){this._previousResults.delete(e)}static _fixProvidedSemanticTokens(t){return e._isSemanticTokens(t)?e._isCorrectSemanticTokens(t)?t:new vO(new Uint32Array(t.data),t.resultId):e._isSemanticTokensEdits(t)?e._isCorrectSemanticTokensEdits(t)?t:new bO(t.edits.map(e=>new yO(e.start,e.deleteCount,e.data?new Uint32Array(e.data):e.data)),t.resultId):t}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(let t of e.edits)if(!(t.data instanceof Uint32Array))return!1;return!0}static _convertToEdits(t,n){if(!e._isSemanticTokens(n)||!t||!t.tokens)return n;let r=t.tokens,i=r.length,a=n.data,o=a.length,s=0,c=Math.min(i,o);for(;s<c&&r[s]===a[s];)s++;if(s===i&&s===o)return new bO([],n.resultId);let l=0,u=c-s;for(;l<u&&r[i-l-1]===a[o-l-1];)l++;return new bO([{start:s,deleteCount:i-s-l,data:a.subarray(s,o-l)}],n.resultId)}_send(t,n){if(e._isSemanticTokens(t)){let e=this._nextResultId++;return this._previousResults.set(e,new IG(t.resultId,t.data)),lU({id:e,type:`full`,data:t.data})}if(e._isSemanticTokensEdits(t)){let r=this._nextResultId++;return e._isSemanticTokens(n)?this._previousResults.set(r,new IG(n.resultId,n.data)):this._previousResults.set(r,new IG(t.resultId)),lU({id:r,type:`delta`,deltas:(t.edits||[]).map(e=>({start:e.start,deleteCount:e.deleteCount,data:e.data}))})}return null}},RG=class{constructor(e,t){this._documents=e,this._provider=t}async provideDocumentRangeSemanticTokens(e,t,n){let r=this._documents.getDocument(e),i=await this._provider.provideDocumentRangeSemanticTokens(r,J.to(t),n);return i?this._send(i):null}_send(e){return lU({id:0,type:`full`,data:e.data})}},zG=class e{static supportsResolving(e){return typeof e.resolveCompletionItem==`function`}constructor(e,t,n,r,i){this._documents=e,this._commands=t,this._provider=n,this._apiDeprecation=r,this._extension=i,this._cache=new EW(`CompletionItem`),this._disposables=new Map}async provideCompletionItems(t,n,r,i){let a=this._documents.getDocument(t),o=fj.to(n),s=a.getWordRangeAtPosition(o)||new sT(o,o),c=s.with({end:o}),l=new tr,u=await this._provider.provideCompletionItems(a,o,i,Gj.to(r));if(!u||i.isCancellationRequested)return;let d=Array.isArray(u)?new DE(u):u,f=e.supportsResolving(this._provider)?this._cache.add(d.items):this._cache.add([]),p=new _;this._disposables.set(f,p);let m=[],ee={x:f,[Ni.completions]:m,[Ni.defaultRanges]:{replace:J.from(s),insert:J.from(c)},[Ni.isIncomplete]:d.isIncomplete||void 0,[Ni.duration]:l.elapsed()};for(let e=0;e<d.items.length;e++){let t=d.items[e],n=this._convertCompletionItem(t,[f,e],c,s);m.push(n)}return ee}async resolveCompletionItem(e,t){if(typeof this._provider.resolveCompletionItem!=`function`)return;let n=this._cache.get(...e);if(!n)return;let r=this._convertCompletionItem(n,e),i=await this._provider.resolveCompletionItem(n,t);if(!i)return;let a=this._convertCompletionItem(i,e);return(r[Mi.insertText]!==a[Mi.insertText]||r[Mi.insertTextRules]!==a[Mi.insertTextRules])&&this._apiDeprecation.report(`CompletionItem.insertText`,this._extension,`extension MAY NOT change 'insertText' of a CompletionItem during resolve`),(r[Mi.commandIdent]!==a[Mi.commandIdent]||r[Mi.commandId]!==a[Mi.commandId]||!pc(r[Mi.commandArguments],a[Mi.commandArguments]))&&this._apiDeprecation.report(`CompletionItem.command`,this._extension,`extension MAY NOT change 'command' of a CompletionItem during resolve`),{...r,[Mi.documentation]:a[Mi.documentation],[Mi.detail]:a[Mi.detail],[Mi.additionalTextEdits]:a[Mi.additionalTextEdits],[Mi.insertText]:a[Mi.insertText],[Mi.insertTextRules]:a[Mi.insertTextRules],[Mi.commandIdent]:a[Mi.commandIdent],[Mi.commandId]:a[Mi.commandId],[Mi.commandArguments]:a[Mi.commandArguments]}}releaseCompletionItems(e){this._disposables.get(e)?.dispose(),this._disposables.delete(e),this._cache.delete(e)}_convertCompletionItem(e,t,n,r){let i=this._disposables.get(t[0]);if(!i)throw Error(`DisposableStore is missing...`);let a=this._commands.toInternal(e.command,i),o={x:t,[Mi.label]:e.label,[Mi.kind]:e.kind===void 0?void 0:Jj.from(e.kind),[Mi.kindModifier]:e.tags&&e.tags.map(Kj.from),[Mi.detail]:e.detail,[Mi.documentation]:e.documentation===void 0?void 0:Y.fromStrict(e.documentation),[Mi.sortText]:e.sortText===e.label?void 0:e.sortText,[Mi.filterText]:e.filterText===e.label?void 0:e.filterText,[Mi.preselect]:e.preselect||void 0,[Mi.insertTextRules]:e.keepWhitespace?Lp.KeepWhitespace:Lp.None,[Mi.commitCharacters]:e.commitCharacters?.join(``),[Mi.additionalTextEdits]:e.additionalTextEdits&&e.additionalTextEdits.map(Dj.from),[Mi.commandIdent]:a?.$ident,[Mi.commandId]:a?.id,[Mi.commandArguments]:a?.$ident?void 0:a?.arguments};e.textEdit?(this._apiDeprecation.report(`CompletionItem.textEdit`,this._extension,`Use 'CompletionItem.insertText' and 'CompletionItem.range' instead.`),o[Mi.insertText]=e.textEdit.newText):typeof e.insertText==`string`?o[Mi.insertText]=e.insertText:e.insertText instanceof kT&&(o[Mi.insertText]=e.insertText.value,o[Mi.insertTextRules]|=Lp.InsertAsSnippet);let s;return e.textEdit?s=e.textEdit.range:e.range&&(s=e.range),sT.isRange(s)?o[Mi.range]=J.from(s):s&&(!n?.isEqual(s.inserting)||!r?.isEqual(s.replacing))&&(o[Mi.range]={insert:J.from(s.inserting),replace:J.from(s.replacing)}),o}},BG=class{constructor(e,t,n,r){this._extension=e,this._documents=t,this._provider=n,this._commands=r,this._references=new VG,this.languageTriggerKindToVSCodeTriggerKind={[Bp.Automatic]:XD.Automatic,[Bp.Explicit]:XD.Invoke},this._isAdditionsProposedApiEnabled=Mw(this._extension)}get supportsHandleEvents(){return Mw(this._extension)&&(typeof this._provider.handleDidShowCompletionItem==`function`||typeof this._provider.handleDidPartiallyAcceptCompletionItem==`function`||typeof this._provider.handleDidRejectCompletionItem==`function`||typeof this._provider.handleEndOfLifetime==`function`)}get supportsSetModelId(){return Mw(this._extension)&&typeof this._provider.setCurrentModelId==`function`}get supportsSetProviderOption(){return Mw(this._extension)&&typeof this._provider.setProviderOptionValue==`function`}get modelInfo(){if(this._isAdditionsProposedApiEnabled)return this._provider.modelInfo?{models:this._provider.modelInfo.models,currentModelId:this._provider.modelInfo.currentModelId}:void 0}setCurrentModelId(e){this._isAdditionsProposedApiEnabled&&this._provider.setCurrentModelId?.(e)}get providerOptions(){if(this._isAdditionsProposedApiEnabled)return this._provider.providerOptions?.map(e=>({id:e.id,label:e.label,values:e.values.map(e=>({id:e.id,label:e.label})),currentValueId:e.currentValueId}))}setProviderOption(e,t){this._isAdditionsProposedApiEnabled&&this._provider.setProviderOptionValue?.(e,t)}async provideInlineCompletions(e,t,n,r){let i=this._documents.getDocument(e),a=fj.to(t),o=await this._provider.provideInlineCompletionItems(i,a,{selectedCompletionInfo:n.selectedSuggestionInfo?{range:J.to(n.selectedSuggestionInfo.range),text:n.selectedSuggestionInfo.text}:void 0,triggerKind:this.languageTriggerKindToVSCodeTriggerKind[n.triggerKind],requestUuid:n.requestUuid,requestIssuedDateTime:n.requestIssuedDateTime,earliestShownDateTime:n.earliestShownDateTime,changeHint:n.changeHint},r);if(!o)return;let{resultItems:s,list:c}=Array.isArray(o)?{resultItems:o,list:void 0}:{resultItems:o.items,list:o},l=this._isAdditionsProposedApiEnabled?Array.isArray(o)?[]:o.commands||[]:[],u=this._isAdditionsProposedApiEnabled&&!Array.isArray(o)?o.enableForwardStability:void 0,d;return{pid:this._references.createReferenceId({dispose(){d?.dispose()},items:s,list:c}),languageId:i.languageId,items:s.map((e,t)=>{let n;e.command&&(d||=new _,n=this._commands.toInternal(e.command,d));let r;e.action&&(d||=new _,r=this._commands.toInternal(e.action,d));let i=e.insertText;return{insertText:i===void 0?void 0:typeof i==`string`?i:{snippet:i.value},range:e.range?J.from(e.range):void 0,showRange:this._isAdditionsProposedApiEnabled&&e.showRange?J.from(e.showRange):void 0,command:n,gutterMenuLinkAction:r,idx:t,completeBracketPairs:this._isAdditionsProposedApiEnabled?e.completeBracketPairs:!1,isInlineEdit:this._isAdditionsProposedApiEnabled?e.isInlineEdit:!1,showInlineEditMenu:this._isAdditionsProposedApiEnabled?e.showInlineEditMenu:!1,hint:e.displayLocation&&this._isAdditionsProposedApiEnabled?{range:J.from(e.displayLocation.range),content:e.displayLocation.label,style:e.displayLocation.kind?PN.from(e.displayLocation.kind):Vp.Code}:void 0,warning:e.warning&&this._isAdditionsProposedApiEnabled?{message:Y.from(e.warning.message),icon:e.warning.icon?RN.fromThemeIcon(e.warning.icon):void 0}:void 0,correlationId:this._isAdditionsProposedApiEnabled?e.correlationId:void 0,suggestionId:void 0,uri:this._isAdditionsProposedApiEnabled&&e.uri?e.uri:void 0,supportsRename:this._isAdditionsProposedApiEnabled?e.supportsRename:!1,jumpToPosition:this._isAdditionsProposedApiEnabled&&e.jumpToPosition?fj.from(e.jumpToPosition):void 0}}),commands:l.map(e=>(d||=new _,qj.from(e,this._commands,d))),suppressSuggestions:!1,enableForwardStability:u}}disposeCompletions(e,t){let n=this._references.get(e);if(this._provider.handleListEndOfLifetime&&this._isAdditionsProposedApiEnabled&&n?.list){function e(e){switch(e.kind){case`lostRace`:return{kind:ZD.LostRace};case`tokenCancellation`:return{kind:ZD.TokenCancellation};case`other`:return{kind:ZD.Other};case`empty`:return{kind:ZD.Empty};case`notTaken`:return{kind:ZD.NotTaken};default:return{kind:ZD.Other}}}this._provider.handleListEndOfLifetime(n.list,e(t))}this._references.disposeReferenceId(e)?.dispose()}handleDidShowCompletionItem(e,t,n){let r=this._references.get(e)?.items[t];r&&this._provider.handleDidShowCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidShowCompletionItem(r,n)}handlePartialAccept(e,t,n,r){let i=this._references.get(e)?.items[t];i&&this._provider.handleDidPartiallyAcceptCompletionItem&&this._isAdditionsProposedApiEnabled&&(this._provider.handleDidPartiallyAcceptCompletionItem(i,n),this._provider.handleDidPartiallyAcceptCompletionItem(i,jN.to(r)))}handleEndOfLifetime(e,t,n){let r=this._references.get(e)?.items[t];if(r&&this._provider.handleEndOfLifetime&&this._isAdditionsProposedApiEnabled){let e=NN.to(n,e=>this._references.get(e.pid)?.items[e.idx]);this._provider.handleEndOfLifetime(r,e)}}handleRejection(e,t){let n=this._references.get(e)?.items[t];n&&this._provider.handleDidRejectCompletionItem&&this._isAdditionsProposedApiEnabled&&this._provider.handleDidRejectCompletionItem(n)}},VG=class{constructor(){this._references=new Map,this._idPool=1}createReferenceId(e){let t=this._idPool++;return this._references.set(t,e),t}disposeReferenceId(e){let t=this._references.get(e);return this._references.delete(e),t}get(e){return this._references.get(e)}},HG=class{constructor(e,t){this._documents=e,this._provider=t,this._cache=new EW(`SignatureHelp`)}async provideSignatureHelp(e,t,n,r){let i=this._documents.getDocument(e),a=fj.to(t),o=this.reviveContext(n),s=await this._provider.provideSignatureHelp(i,a,r,o);if(s){let e=this._cache.add([s]);return{...Qj.from(s),id:e}}}reviveContext(e){let t;if(e.activeSignatureHelp){let n=Qj.to(e.activeSignatureHelp),r=this._cache.get(e.activeSignatureHelp.id,0);r?(t=r,t.activeSignature=n.activeSignature,t.activeParameter=n.activeParameter):t=n}return{...e,activeSignatureHelp:t}}releaseSignatureHelp(e){this._cache.delete(e)}},UG=class{constructor(e,t,n,r,i){this._documents=e,this._commands=t,this._provider=n,this._logService=r,this._extension=i,this._cache=new EW(`InlayHints`),this._disposables=new Map}async provideInlayHints(e,t,n){let r=this._documents.getDocument(e),i=J.to(t),a=await this._provider.provideInlayHints(r,i,n);if(!Array.isArray(a)||a.length===0){this._logService.trace(`[InlayHints] NO inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`);return}if(n.isCancellationRequested)return;let o=this._cache.add(a);this._disposables.set(o,new _);let s={hints:[],cacheId:o};for(let e=0;e<a.length;e++)this._isValidInlayHint(a[e],i)&&s.hints.push(this._convertInlayHint(a[e],[o,e]));return this._logService.trace(`[InlayHints] ${s.hints.length} inlay hints from '${this._extension.identifier.value}' for range ${JSON.stringify(t)}`),s}async resolveInlayHint(e,t){if(typeof this._provider.resolveInlayHint!=`function`)return;let n=this._cache.get(...e);if(!n)return;let r=await this._provider.resolveInlayHint(n,t);if(r&&this._isValidInlayHint(r))return this._convertInlayHint(r,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(e=>e.value.length===0)?(console.log(`INVALID inlay hint, empty label`,e),!1):!(t&&!t.contains(e.position))}_convertInlayHint(e,t){let n=this._disposables.get(t[0]);if(!n)throw Error(`DisposableStore is missing...`);let r={label:``,cacheId:t,tooltip:Y.fromStrict(e.tooltip),position:fj.from(e.position),textEdits:e.textEdits&&e.textEdits.map(Dj.from),kind:e.kind&&tM.from(e.kind),paddingLeft:e.paddingLeft,paddingRight:e.paddingRight};if(typeof e.label==`string`)r.label=e.label;else{let t=[];r.label=t;for(let r of e.label){if(!r.value){console.warn(`INVALID inlay hint, empty label part`,this._extension.identifier.value);continue}let e={label:r.value,tooltip:Y.fromStrict(r.tooltip)};gT.isLocation(r.location)&&(e.location=Ij.from(r.location)),r.command&&(e.command=this._commands.toInternal(r.command,n)),t.push(e)}}return r}},WG=class e{constructor(e,t){this._documents=e,this._provider=t,this._cache=new EW(`DocumentLink`)}async provideLinks(t,n){let r=this._documents.getDocument(t),i=await this._provider.provideDocumentLinks(r,n);if(!(!Array.isArray(i)||i.length===0)&&!n.isCancellationRequested){if(typeof this._provider.resolveDocumentLink!=`function`)return{links:i.filter(e._validateLink).map(nM.from)};{let t=this._cache.add(i),n={links:[],cacheId:t};for(let r=0;r<i.length;r++){if(!e._validateLink(i[r]))continue;let a=nM.from(i[r]);a.cacheId=[t,r],n.links.push(a)}return n}}}static _validateLink(e){return e.target&&e.target.path.length>5e4?(console.warn(`DROPPING link because it is too long`),!1):!0}async resolveLink(t,n){if(typeof this._provider.resolveDocumentLink!=`function`)return;let r=this._cache.get(...t);if(!r)return;let i=await this._provider.resolveDocumentLink(r,n);if(!(!i||!e._validateLink(i)))return nM.from(i)}releaseLinks(e){this._cache.delete(e)}},GG=class{constructor(e,t){this._documents=e,this._provider=t}async provideColors(e,t){let n=this._documents.getDocument(e),r=await this._provider.provideDocumentColors(n,t);return Array.isArray(r)?r.map(e=>({color:iM.from(e.color),range:J.from(e.range)})):[]}async provideColorPresentations(e,t,n){let r=this._documents.getDocument(e),i=J.to(t.range),a=iM.to(t.color),o=await this._provider.provideColorPresentations(a,{document:r,range:i},n);if(Array.isArray(o))return o.map(rM.from)}},KG=class{constructor(e,t){this._documents=e,this._provider=t}async provideFoldingRanges(e,t,n){let r=this._documents.getDocument(e),i=await this._provider.provideFoldingRanges(r,t,n);if(Array.isArray(i))return i.map(uM.from)}},qG=class{constructor(e,t,n){this._documents=e,this._provider=t,this._logService=n}async provideSelectionRanges(e,t,n){let r=this._documents.getDocument(e),i=t.map(fj.to),a=await this._provider.provideSelectionRanges(r,i,n);if(!Te(a))return[];if(a.length!==i.length)return this._logService.warn(`BAD selection ranges, provider must return ranges for each position`),[];let o=[];for(let e=0;e<i.length;e++){let t=[];o.push(t);let n=i[e],r=a[e];for(;;){if(!r.range.contains(n))throw Error(`INVALID selection range, must contain the previous range`);if(t.push(aM.from(r)),!r.parent)break;n=r.range,r=r.parent}}return o}},JG=class{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new Az(``),this._cache=new Map}async prepareSession(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t),a=await this._provider.prepareCallHierarchy(r,i,n);if(!a)return;let o=this._idPool.nextId();return this._cache.set(o,new Map),Array.isArray(a)?a.map(e=>this._cacheAndConvertItem(o,e)):[this._cacheAndConvertItem(o,a)]}async provideCallsTo(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing call hierarchy item`);let i=await this._provider.provideCallHierarchyIncomingCalls(r,n);if(i)return i.map(t=>({from:this._cacheAndConvertItem(e,t.from),fromRanges:t.fromRanges.map(e=>J.from(e))}))}async provideCallsFrom(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing call hierarchy item`);let i=await this._provider.provideCallHierarchyOutgoingCalls(r,n);if(i)return i.map(t=>({to:this._cacheAndConvertItem(e,t.to),fromRanges:t.fromRanges.map(e=>J.from(e))}))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){let n=this._cache.get(e),r=Nj.from(t,e,n.size.toString(36));return n.set(r._itemId,t),r}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}},YG=class{constructor(e,t){this._documents=e,this._provider=t,this._idPool=new Az(``),this._cache=new Map}async prepareSession(e,t,n){let r=this._documents.getDocument(e),i=fj.to(t),a=await this._provider.prepareTypeHierarchy(r,i,n);if(!a)return;let o=this._idPool.nextId();return this._cache.set(o,new Map),Array.isArray(a)?a.map(e=>this._cacheAndConvertItem(o,e)):[this._cacheAndConvertItem(o,a)]}async provideSupertypes(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing type hierarchy item`);let i=await this._provider.provideTypeHierarchySupertypes(r,n);if(i)return i.map(t=>this._cacheAndConvertItem(e,t))}async provideSubtypes(e,t,n){let r=this._itemFromCache(e,t);if(!r)throw Error(`missing type hierarchy item`);let i=await this._provider.provideTypeHierarchySubtypes(r,n);if(i)return i.map(t=>this._cacheAndConvertItem(e,t))}releaseSession(e){this._cache.delete(e)}_cacheAndConvertItem(e,t){let n=this._cache.get(e),r=FM.from(t,e,n.size.toString(36));return n.set(r._itemId,t),r}_itemFromCache(e,t){return this._cache.get(e)?.get(t)}},XG=class{constructor(e,t,n,r,i){this._proxy=e,this._documents=t,this._provider=n,this._handle=r,this._extension=i,this._cache=new EW(`DocumentDropEdit`)}async provideDocumentOnDropEdits(e,t,n,r,i){let a=this._documents.getDocument(t),o=fj.to(n),s=RM.toDataTransfer(r,async t=>(await this._proxy.$resolveDocumentOnDropFileData(this._handle,e,t)).buffer),c=await this._provider.provideDocumentDropEdits(a,o,s,i);if(!c)return;let l=ke(c),u=this._cache.add(l);return l.map((e,t)=>({_cacheId:[u,t],title:e.title??b(2868,`Drop using '{0}' extension`,this._extension.displayName||this._extension.name),kind:e.kind?.value,yieldTo:e.yieldTo?.map(e=>e.value),insertText:typeof e.insertText==`string`?e.insertText:{snippet:e.insertText.value},additionalEdit:e.additionalEdit?Oj.from(e.additionalEdit,void 0):void 0}))}async resolveDropEdit(e,t){let[n,r]=e,i=this._cache.get(n,r);if(!i||!this._provider.resolveDocumentDropEdit)return{};let a=await this._provider.resolveDocumentDropEdit(i,t)??i;return{additionalEdit:a.additionalEdit?Oj.from(a.additionalEdit,void 0):void 0}}releaseDropEdits(e){this._cache.delete(e)}},ZG=class{constructor(e,t){this.adapter=e,this.extension=t}},QG=class e extends v{static{this._handlePool=0}get inlineCompletionsUnificationState(){return this._inlineCompletionsUnificationState}constructor(e,t,n,r,i,a,o,s){super(),this._uriTransformer=t,this._documents=n,this._commands=r,this._diagnostics=i,this._logService=a,this._apiDeprecation=o,this._extensionTelemetry=s,this._adapter=new Map,this._onDidChangeInlineCompletionsUnificationState=this._register(new x),this.onDidChangeInlineCompletionsUnificationState=this._onDidChangeInlineCompletionsUnificationState.event,this._proxy=e.getProxy(T.MainThreadLanguageFeatures),this._inlineCompletionsUnificationState={codeUnification:!1,modelUnification:!1,extensionUnification:!1,expAssignments:[]}}_transformDocumentSelector(e,t){return pj.from(e,this._uriTransformer,t)}_createDisposable(e){return new YT(()=>{this._adapter.delete(e),this._proxy.$unregister(e)})}_nextHandle(){return e._handlePool++}async _withAdapter(e,t,n,r,i,a=!1){let o=this._adapter.get(e);if(!o||!(o.adapter instanceof t))return r;let s=Date.now();a||this._logService.trace(`[${o.extension.identifier.value}] INVOKE provider '${n.toString().replace(/[\r\n]/g,``)}'`);let c=n(o.adapter,o.extension);return Promise.resolve(c).catch(e=>{re(e)||(this._logService.error(`[${o.extension.identifier.value}] provider FAILED`),this._logService.error(e),this._extensionTelemetry.onExtensionError(o.extension.identifier,e))}).finally(()=>{a||this._logService.trace(`[${o.extension.identifier.value}] provider DONE after ${Date.now()-s}ms`)}),Bi.isCancellationToken(i)?xo(c,i):c}_addNewAdapter(e,t){let n=this._nextHandle();return this._adapter.set(n,new ZG(e,t)),n}static _extLabel(e){return e.displayName||e.name}static _extId(e){return e.identifier.value}registerDocumentSymbolProvider(t,n,r,i){let a=this._addNewAdapter(new mG(this._documents,r),t),o=i&&i.label||e._extLabel(t);return this._proxy.$registerDocumentSymbolProvider(a,this._transformDocumentSelector(n,t),o),this._createDisposable(a)}$provideDocumentSymbols(e,t,n){return this._withAdapter(e,mG,e=>e.provideDocumentSymbols(C.revive(t),n),void 0,n)}registerCodeLensProvider(e,t,n){let r=this._nextHandle(),i=typeof n.onDidChangeCodeLenses==`function`?this._nextHandle():void 0;this._adapter.set(r,new ZG(new hG(this._documents,this._commands.converter,n,e,this._extensionTelemetry,this._logService),e)),this._proxy.$registerCodeLensSupport(r,this._transformDocumentSelector(t,e),i);let a=this._createDisposable(r);if(i!==void 0){let e=n.onDidChangeCodeLenses(e=>this._proxy.$emitCodeLensEvent(i));a=YT.from(a,e)}return a}$provideCodeLenses(e,t,n){return this._withAdapter(e,hG,e=>e.provideCodeLenses(C.revive(t),n),void 0,n,t.scheme===`output`)}$resolveCodeLens(e,t,n){return this._withAdapter(e,hG,e=>e.resolveCodeLens(t,n),void 0,void 0,!0)}$releaseCodeLenses(e,t){this._withAdapter(e,hG,e=>Promise.resolve(e.releaseCodeLenses(t)),void 0,void 0,!0)}registerDefinitionProvider(e,t,n){let r=this._addNewAdapter(new _G(this._documents,n),e);return this._proxy.$registerDefinitionSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDefinition(e,t,n,r){return this._withAdapter(e,_G,e=>e.provideDefinition(C.revive(t),n,r),[],r)}registerDeclarationProvider(e,t,n){let r=this._addNewAdapter(new vG(this._documents,n),e);return this._proxy.$registerDeclarationSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDeclaration(e,t,n,r){return this._withAdapter(e,vG,e=>e.provideDeclaration(C.revive(t),n,r),[],r)}registerImplementationProvider(e,t,n){let r=this._addNewAdapter(new yG(this._documents,n),e);return this._proxy.$registerImplementationSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideImplementation(e,t,n,r){return this._withAdapter(e,yG,e=>e.provideImplementation(C.revive(t),n,r),[],r)}registerTypeDefinitionProvider(e,t,n){let r=this._addNewAdapter(new bG(this._documents,n),e);return this._proxy.$registerTypeDefinitionSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideTypeDefinition(e,t,n,r){return this._withAdapter(e,bG,e=>e.provideTypeDefinition(C.revive(t),n,r),[],r)}registerHoverProvider(e,t,n,r){let i=this._addNewAdapter(new xG(this._documents,n),e);return this._proxy.$registerHoverProvider(i,this._transformDocumentSelector(t,e)),this._createDisposable(i)}$provideHover(e,t,n,r,i){return this._withAdapter(e,xG,e=>e.provideHover(C.revive(t),n,r,i),void 0,i)}$releaseHover(e,t){this._withAdapter(e,xG,e=>Promise.resolve(e.releaseHover(t)),void 0,void 0)}registerEvaluatableExpressionProvider(e,t,n,r){let i=this._addNewAdapter(new SG(this._documents,n),e);return this._proxy.$registerEvaluatableExpressionProvider(i,this._transformDocumentSelector(t,e)),this._createDisposable(i)}$provideEvaluatableExpression(e,t,n,r){return this._withAdapter(e,SG,e=>e.provideEvaluatableExpression(C.revive(t),n,r),void 0,r)}registerInlineValuesProvider(e,t,n,r){let i=typeof n.onDidChangeInlineValues==`function`?this._nextHandle():void 0,a=this._addNewAdapter(new CG(this._documents,n),e);this._proxy.$registerInlineValuesProvider(a,this._transformDocumentSelector(t,e),i);let o=this._createDisposable(a);if(i!==void 0){let e=n.onDidChangeInlineValues(e=>this._proxy.$emitInlineValuesEvent(i));o=YT.from(o,e)}return o}$provideInlineValues(e,t,n,r,i){return this._withAdapter(e,CG,e=>e.provideInlineValues(C.revive(t),n,r,i),void 0,i)}registerDocumentHighlightProvider(e,t,n){let r=this._addNewAdapter(new wG(this._documents,n),e);return this._proxy.$registerDocumentHighlightProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}registerMultiDocumentHighlightProvider(e,t,n){let r=this._addNewAdapter(new TG(this._documents,n,this._logService),e);return this._proxy.$registerMultiDocumentHighlightProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDocumentHighlights(e,t,n,r){return this._withAdapter(e,wG,e=>e.provideDocumentHighlights(C.revive(t),n,r),void 0,r)}$provideMultiDocumentHighlights(e,t,n,r,i){return this._withAdapter(e,TG,e=>e.provideMultiDocumentHighlights(C.revive(t),n,r.map(e=>C.revive(e)),i),void 0,i)}registerLinkedEditingRangeProvider(e,t,n){let r=this._addNewAdapter(new EG(this._documents,n),e);return this._proxy.$registerLinkedEditingRangeProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideLinkedEditingRanges(t,n,r,i){return this._withAdapter(t,EG,async t=>{let a=await t.provideLinkedEditingRanges(C.revive(n),r,i);if(a)return{ranges:a.ranges,wordPattern:a.wordPattern?e._serializeRegExp(a.wordPattern):void 0}},void 0,i)}registerReferenceProvider(e,t,n){let r=this._addNewAdapter(new DG(this._documents,n),e);return this._proxy.$registerReferenceSupport(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideReferences(e,t,n,r,i){return this._withAdapter(e,DG,e=>e.provideReferences(C.revive(t),n,r,i),void 0,i)}registerCodeActionProvider(t,n,r,i){let a=new _,o=this._addNewAdapter(new OG(this._documents,this._commands.converter,this._diagnostics,r,this._logService,t,this._apiDeprecation),t);return this._proxy.$registerCodeActionSupport(o,this._transformDocumentSelector(n,t),{providedKinds:i?.providedCodeActionKinds?.map(e=>e.value),documentation:i?.documentation?.map(e=>({kind:e.kind.value,command:this._commands.converter.toInternal(e.command,a)}))},e._extLabel(t),e._extId(t),!!r.resolveCodeAction),a.add(this._createDisposable(o)),a}$provideCodeActions(e,t,n,r,i){return this._withAdapter(e,OG,e=>e.provideCodeActions(C.revive(t),n,r,i),void 0,i)}$resolveCodeAction(e,t,n){return this._withAdapter(e,OG,e=>e.resolveCodeAction(t,n),{},void 0)}$releaseCodeActions(e,t){this._withAdapter(e,OG,e=>Promise.resolve(e.releaseCodeActions(t)),void 0,void 0)}registerDocumentFormattingEditProvider(e,t,n){let r=this._addNewAdapter(new AG(this._documents,n),e);return this._proxy.$registerDocumentFormattingSupport(r,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name),this._createDisposable(r)}$provideDocumentFormattingEdits(e,t,n,r){return this._withAdapter(e,AG,e=>e.provideDocumentFormattingEdits(C.revive(t),n,r),void 0,r)}registerDocumentRangeFormattingEditProvider(e,t,n){let r=typeof n.provideDocumentRangesFormattingEdits==`function`,i=this._addNewAdapter(new jG(this._documents,n),e);return this._proxy.$registerRangeFormattingSupport(i,this._transformDocumentSelector(t,e),e.identifier,e.displayName||e.name,r),this._createDisposable(i)}$provideDocumentRangeFormattingEdits(e,t,n,r,i){return this._withAdapter(e,jG,e=>e.provideDocumentRangeFormattingEdits(C.revive(t),n,r,i),void 0,i)}$provideDocumentRangesFormattingEdits(e,t,n,r,i){return this._withAdapter(e,jG,e=>e.provideDocumentRangesFormattingEdits(C.revive(t),n,r,i),void 0,i)}registerOnTypeFormattingEditProvider(e,t,n,r){let i=this._addNewAdapter(new MG(this._documents,n),e);return this._proxy.$registerOnTypeFormattingSupport(i,this._transformDocumentSelector(t,e),r,e.identifier),this._createDisposable(i)}$provideOnTypeFormattingEdits(e,t,n,r,i,a){return this._withAdapter(e,MG,e=>e.provideOnTypeFormattingEdits(C.revive(t),n,r,i,a),void 0,a)}registerWorkspaceSymbolProvider(e,t){let n=this._addNewAdapter(new NG(t,this._logService),e);return this._proxy.$registerNavigateTypeSupport(n,typeof t.resolveWorkspaceSymbol==`function`),this._createDisposable(n)}$provideWorkspaceSymbols(e,t,n){return this._withAdapter(e,NG,e=>e.provideWorkspaceSymbols(t,n),{symbols:[]},n)}$resolveWorkspaceSymbol(e,t,n){return this._withAdapter(e,NG,e=>e.resolveWorkspaceSymbol(t,n),void 0,void 0)}$releaseWorkspaceSymbols(e,t){this._withAdapter(e,NG,e=>e.releaseWorkspaceSymbols(t),void 0,void 0)}registerRenameProvider(e,t,n){let r=this._addNewAdapter(new PG(this._documents,n,this._logService),e);return this._proxy.$registerRenameSupport(r,this._transformDocumentSelector(t,e),PG.supportsResolving(n)),this._createDisposable(r)}$provideRenameEdits(e,t,n,r,i){return this._withAdapter(e,PG,e=>e.provideRenameEdits(C.revive(t),n,r,i),void 0,i)}$resolveRenameLocation(e,t,n,r){return this._withAdapter(e,PG,e=>e.resolveRenameLocation(C.revive(t),n,r),void 0,r)}registerNewSymbolNamesProvider(e,t,n){let r=this._addNewAdapter(new FG(this._documents,n,this._logService),e);return this._proxy.$registerNewSymbolNamesProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$supportsAutomaticNewSymbolNamesTriggerKind(e){return this._withAdapter(e,FG,e=>e.supportsAutomaticNewSymbolNamesTriggerKind(),!1,void 0)}$provideNewSymbolNames(e,t,n,r,i){return this._withAdapter(e,FG,e=>e.provideNewSymbolNames(C.revive(t),n,r,i),void 0,i)}registerDocumentSemanticTokensProvider(e,t,n,r){let i=this._addNewAdapter(new LG(this._documents,n),e),a=typeof n.onDidChangeSemanticTokens==`function`?this._nextHandle():void 0;this._proxy.$registerDocumentSemanticTokensProvider(i,this._transformDocumentSelector(t,e),r,a);let o=this._createDisposable(i);if(a){let e=n.onDidChangeSemanticTokens(e=>this._proxy.$emitDocumentSemanticTokensEvent(a));o=YT.from(o,e)}return o}$provideDocumentSemanticTokens(e,t,n,r){return this._withAdapter(e,LG,e=>e.provideDocumentSemanticTokens(C.revive(t),n,r),null,r)}$releaseDocumentSemanticTokens(e,t){this._withAdapter(e,LG,e=>e.releaseDocumentSemanticColoring(t),void 0,void 0)}registerDocumentRangeSemanticTokensProvider(e,t,n,r){let i=this._addNewAdapter(new RG(this._documents,n),e),a=typeof n.onDidChangeSemanticTokens==`function`?this._nextHandle():void 0;this._proxy.$registerDocumentRangeSemanticTokensProvider(i,this._transformDocumentSelector(t,e),r,a);let o=this._createDisposable(i);if(a){let e=n.onDidChangeSemanticTokens(e=>this._proxy.$emitDocumentRangeSemanticTokensEvent(a));o=YT.from(o,e)}return o}$provideDocumentRangeSemanticTokens(e,t,n,r){return this._withAdapter(e,RG,e=>e.provideDocumentRangeSemanticTokens(C.revive(t),n,r),null,r)}registerCompletionItemProvider(e,t,n,r){let i=this._addNewAdapter(new zG(this._documents,this._commands.converter,n,this._apiDeprecation,e),e);return this._proxy.$registerCompletionsProvider(i,this._transformDocumentSelector(t,e),r,zG.supportsResolving(n),e.identifier),this._createDisposable(i)}$provideCompletionItems(e,t,n,r,i){return this._withAdapter(e,zG,e=>e.provideCompletionItems(C.revive(t),n,r,i),void 0,i)}$resolveCompletionItem(e,t,n){return this._withAdapter(e,zG,e=>e.resolveCompletionItem(t,n),void 0,n)}$releaseCompletionItems(e,t){this._withAdapter(e,zG,e=>e.releaseCompletionItems(t),void 0,void 0)}registerInlineCompletionsProvider(e,t,n,r){let i=new BG(e,this._documents,n,this._commands.converter),a=this._addNewAdapter(i,e),o=this._createDisposable(a),s=Mw(e)&&typeof n.onDidChange==`function`;if(s){let e=n.onDidChange(e=>this._proxy.$emitInlineCompletionsChange(a,e?{data:e.data}:void 0));o=YT.from(o,e)}let c=Mw(e)&&typeof n.onDidChangeModelInfo==`function`;if(c){let e=n.onDidChangeModelInfo(e=>this._proxy.$emitInlineCompletionModelInfoChange(a,i.modelInfo));o=YT.from(o,e)}let l=Mw(e)&&typeof n.onDidChangeProviderOptions==`function`;if(l){let e=n.onDidChangeProviderOptions(e=>this._proxy.$emitInlineCompletionProviderOptionsChange(a,i.providerOptions));o=YT.from(o,e)}return this._proxy.$registerInlineCompletionsSupport(a,this._transformDocumentSelector(t,e),i.supportsHandleEvents,Ts.toKey(e.identifier.value),e.version,r?.groupId?Ts.toKey(r.groupId):void 0,r?.yieldTo?.map(e=>Ts.toKey(e))||[],r?.displayName,r?.debounceDelayMs,r?.excludes?.map(e=>Ts.toKey(e))||[],s,i.supportsSetModelId,i.modelInfo,c,i.supportsSetProviderOption,i.providerOptions,l),o}$provideInlineCompletions(e,t,n,r,i){return this._withAdapter(e,BG,e=>e.provideInlineCompletions(C.revive(t),n,r,i),void 0,void 0)}$handleInlineCompletionDidShow(e,t,n,r){this._withAdapter(e,BG,async e=>{e.handleDidShowCompletionItem(t,n,r)},void 0,void 0)}$handleInlineCompletionPartialAccept(e,t,n,r,i){this._withAdapter(e,BG,async e=>{e.handlePartialAccept(t,n,r,i)},void 0,void 0)}$handleInlineCompletionEndOfLifetime(e,t,n,r){this._withAdapter(e,BG,async e=>{e.handleEndOfLifetime(t,n,r)},void 0,void 0)}$handleInlineCompletionRejection(e,t,n){this._withAdapter(e,BG,async e=>{e.handleRejection(t,n)},void 0,void 0)}$freeInlineCompletionsList(e,t,n){this._withAdapter(e,BG,async e=>{e.disposeCompletions(t,n)},void 0,void 0)}$acceptInlineCompletionsUnificationState(e){this._inlineCompletionsUnificationState=e,this._onDidChangeInlineCompletionsUnificationState.fire()}$handleInlineCompletionSetCurrentModelId(e,t){this._withAdapter(e,BG,async e=>{e.setCurrentModelId(t)},void 0,void 0)}$handleInlineCompletionSetProviderOption(e,t,n){this._withAdapter(e,BG,async e=>{e.setProviderOption(t,n)},void 0,void 0)}registerSignatureHelpProvider(e,t,n,r){let i=Array.isArray(r)?{triggerCharacters:r,retriggerCharacters:[]}:r,a=this._addNewAdapter(new HG(this._documents,n),e);return this._proxy.$registerSignatureHelpProvider(a,this._transformDocumentSelector(t,e),i),this._createDisposable(a)}$provideSignatureHelp(e,t,n,r,i){return this._withAdapter(e,HG,e=>e.provideSignatureHelp(C.revive(t),n,r,i),void 0,i)}$releaseSignatureHelp(e,t){this._withAdapter(e,HG,e=>e.releaseSignatureHelp(t),void 0,void 0)}registerInlayHintsProvider(t,n,r){let i=typeof r.onDidChangeInlayHints==`function`?this._nextHandle():void 0,a=this._addNewAdapter(new UG(this._documents,this._commands.converter,r,this._logService,t),t);this._proxy.$registerInlayHintsProvider(a,this._transformDocumentSelector(n,t),typeof r.resolveInlayHint==`function`,i,e._extLabel(t));let o=this._createDisposable(a);if(i!==void 0){let e=r.onDidChangeInlayHints(e=>this._proxy.$emitInlayHintsEvent(i));o=YT.from(o,e)}return o}$provideInlayHints(e,t,n,r){return this._withAdapter(e,UG,e=>e.provideInlayHints(C.revive(t),n,r),void 0,r)}$resolveInlayHint(e,t,n){return this._withAdapter(e,UG,e=>e.resolveInlayHint(t,n),void 0,n)}$releaseInlayHints(e,t){this._withAdapter(e,UG,e=>e.releaseHints(t),void 0,void 0)}registerDocumentLinkProvider(e,t,n){let r=this._addNewAdapter(new WG(this._documents,n),e);return this._proxy.$registerDocumentLinkProvider(r,this._transformDocumentSelector(t,e),typeof n.resolveDocumentLink==`function`),this._createDisposable(r)}$provideDocumentLinks(e,t,n){return this._withAdapter(e,WG,e=>e.provideLinks(C.revive(t),n),void 0,n,t.scheme===`output`)}$resolveDocumentLink(e,t,n){return this._withAdapter(e,WG,e=>e.resolveLink(t,n),void 0,void 0,!0)}$releaseDocumentLinks(e,t){this._withAdapter(e,WG,e=>e.releaseLinks(t),void 0,void 0,!0)}registerColorProvider(e,t,n){let r=this._addNewAdapter(new GG(this._documents,n),e);return this._proxy.$registerDocumentColorProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideDocumentColors(e,t,n){return this._withAdapter(e,GG,e=>e.provideColors(C.revive(t),n),[],n)}$provideColorPresentations(e,t,n,r){return this._withAdapter(e,GG,e=>e.provideColorPresentations(C.revive(t),n,r),void 0,r)}registerFoldingRangeProvider(e,t,n){let r=this._nextHandle(),i=typeof n.onDidChangeFoldingRanges==`function`?this._nextHandle():void 0;this._adapter.set(r,new ZG(new KG(this._documents,n),e)),this._proxy.$registerFoldingRangeProvider(r,this._transformDocumentSelector(t,e),e.identifier,i);let a=this._createDisposable(r);if(i!==void 0){let e=n.onDidChangeFoldingRanges(()=>this._proxy.$emitFoldingRangeEvent(i));a=YT.from(a,e)}return a}$provideFoldingRanges(e,t,n,r){return this._withAdapter(e,KG,e=>e.provideFoldingRanges(C.revive(t),n,r),void 0,r)}registerSelectionRangeProvider(e,t,n){let r=this._addNewAdapter(new qG(this._documents,n,this._logService),e);return this._proxy.$registerSelectionRangeProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$provideSelectionRanges(e,t,n,r){return this._withAdapter(e,qG,e=>e.provideSelectionRanges(C.revive(t),n,r),[],r)}registerCallHierarchyProvider(e,t,n){let r=this._addNewAdapter(new JG(this._documents,n),e);return this._proxy.$registerCallHierarchyProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$prepareCallHierarchy(e,t,n,r){return this._withAdapter(e,JG,e=>Promise.resolve(e.prepareSession(C.revive(t),n,r)),void 0,r)}$provideCallHierarchyIncomingCalls(e,t,n,r){return this._withAdapter(e,JG,e=>e.provideCallsTo(t,n,r),void 0,r)}$provideCallHierarchyOutgoingCalls(e,t,n,r){return this._withAdapter(e,JG,e=>e.provideCallsFrom(t,n,r),void 0,r)}$releaseCallHierarchy(e,t){this._withAdapter(e,JG,e=>Promise.resolve(e.releaseSession(t)),void 0,void 0)}registerTypeHierarchyProvider(e,t,n){let r=this._addNewAdapter(new YG(this._documents,n),e);return this._proxy.$registerTypeHierarchyProvider(r,this._transformDocumentSelector(t,e)),this._createDisposable(r)}$prepareTypeHierarchy(e,t,n,r){return this._withAdapter(e,YG,e=>Promise.resolve(e.prepareSession(C.revive(t),n,r)),void 0,r)}$provideTypeHierarchySupertypes(e,t,n,r){return this._withAdapter(e,YG,e=>e.provideSupertypes(t,n,r),void 0,r)}$provideTypeHierarchySubtypes(e,t,n,r){return this._withAdapter(e,YG,e=>e.provideSubtypes(t,n,r),void 0,r)}$releaseTypeHierarchy(e,t){this._withAdapter(e,YG,e=>Promise.resolve(e.releaseSession(t)),void 0,void 0)}registerDocumentOnDropEditProvider(e,t,n,r){let i=this._nextHandle();return this._adapter.set(i,new ZG(new XG(this._proxy,this._documents,n,i,e),e)),this._proxy.$registerDocumentOnDropEditProvider(i,this._transformDocumentSelector(t,e),r?{supportsResolve:!!n.resolveDocumentDropEdit,dropMimeTypes:r.dropMimeTypes,providedDropKinds:r.providedDropEditKinds?.map(e=>e.value)}:void 0),this._createDisposable(i)}$provideDocumentOnDropEdits(e,t,n,r,i,a){return this._withAdapter(e,XG,e=>Promise.resolve(e.provideDocumentOnDropEdits(t,C.revive(n),r,i,a)),void 0,void 0)}$resolveDropEdit(e,t,n){return this._withAdapter(e,XG,e=>e.resolveDropEdit(t,n),{},void 0)}$releaseDocumentOnDropEdits(e,t){this._withAdapter(e,XG,e=>Promise.resolve(e.releaseDropEdits(t)),void 0,void 0)}registerDocumentPasteEditProvider(e,t,n,r){let i=this._nextHandle();return this._adapter.set(i,new ZG(new kG(this._proxy,this._documents,n,i,e),e)),this._proxy.$registerPasteEditProvider(i,this._transformDocumentSelector(t,e),{supportsCopy:!!n.prepareDocumentPaste,supportsPaste:!!n.provideDocumentPasteEdits,supportsResolve:!!n.resolveDocumentPasteEdit,providedPasteEditKinds:r.providedPasteEditKinds?.map(e=>e.value),copyMimeTypes:r.copyMimeTypes,pasteMimeTypes:r.pasteMimeTypes}),this._createDisposable(i)}$prepareDocumentPaste(e,t,n,r,i){return this._withAdapter(e,kG,e=>e.prepareDocumentPaste(C.revive(t),n,r,i),void 0,i)}$providePasteEdits(e,t,n,r,i,a,o){return this._withAdapter(e,kG,e=>e.providePasteEdits(t,C.revive(n),r,i,a,o),void 0,o)}$resolvePasteEdit(e,t,n){return this._withAdapter(e,kG,e=>e.resolvePasteEdit(t,n),{},void 0)}$releasePasteEdits(e,t){this._withAdapter(e,kG,e=>Promise.resolve(e.releasePasteEdits(t)),void 0,void 0)}static _serializeRegExp(e){return{pattern:e.source,flags:e.flags}}static _serializeIndentationRule(t){return{decreaseIndentPattern:e._serializeRegExp(t.decreaseIndentPattern),increaseIndentPattern:e._serializeRegExp(t.increaseIndentPattern),indentNextLinePattern:t.indentNextLinePattern?e._serializeRegExp(t.indentNextLinePattern):void 0,unIndentedLinePattern:t.unIndentedLinePattern?e._serializeRegExp(t.unIndentedLinePattern):void 0}}static _serializeOnEnterRule(t){return{beforeText:e._serializeRegExp(t.beforeText),afterText:t.afterText?e._serializeRegExp(t.afterText):void 0,previousLineText:t.previousLineText?e._serializeRegExp(t.previousLineText):void 0,action:t.action}}static _serializeOnEnterRules(t){return t.map(e._serializeOnEnterRule)}static _serializeAutoClosingPair(e){return{open:e.open,close:e.close,notIn:e.notIn?e.notIn.map(e=>UE.toString(e)):void 0}}static _serializeAutoClosingPairs(t){return t.map(e._serializeAutoClosingPair)}setLanguageConfiguration(t,n,r){let{wordPattern:i}=r;if(i&&ia(i))throw Error(`Invalid language configuration: wordPattern '${i}' is not allowed to match the empty string.`);i?this._documents.setWordDefinitionFor(n,i):this._documents.setWordDefinitionFor(n,void 0),r.__electricCharacterSupport&&this._apiDeprecation.report(`LanguageConfiguration.__electricCharacterSupport`,t,`Do not use.`),r.__characterPairSupport&&this._apiDeprecation.report(`LanguageConfiguration.__characterPairSupport`,t,`Do not use.`);let a=this._nextHandle(),o={comments:r.comments,brackets:r.brackets,wordPattern:r.wordPattern?e._serializeRegExp(r.wordPattern):void 0,indentationRules:r.indentationRules?e._serializeIndentationRule(r.indentationRules):void 0,onEnterRules:r.onEnterRules?e._serializeOnEnterRules(r.onEnterRules):void 0,__electricCharacterSupport:r.__electricCharacterSupport,__characterPairSupport:r.__characterPairSupport,autoClosingPairs:r.autoClosingPairs?e._serializeAutoClosingPairs(r.autoClosingPairs):void 0};return this._proxy.$setLanguageConfiguration(a,n,o),this._createDisposable(a)}$setWordDefinitions(e){for(let t of e)this._documents.setWordDefinitionFor(t.languageId,new RegExp(t.regexSource,t.regexFlags))}};async function $G(e,t){let n=e+`:`+JSON.stringify(t),r=new TextEncoder().encode(n),i=await crypto.subtle.digest(`SHA-256`,r),a=Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,`0`)).join(``);return e+`:combination:`+a}const eK=O(`notebookService`),tK=O(`codeMapperService`),nK=O(`IChatService`),rK=`vscode_editFile_internal`,iK={id:rK,displayName:``,modelDescription:``,source:Fb.Internal};let aK=class{constructor(e,t,n){this.chatService=e,this.codeMapperService=t,this.notebookService=n}async invoke(e,t,n,r){if(!e.context)throw Error(`toolInvocationToken is required for this tool`);let i=e.parameters,a=C.revive(i.uri),o=mC.parse(a)?.notebook||a,s=this.chatService.getSession(e.context.sessionResource),c=s.getRequests().at(-1);s.acceptResponseProgress(c,{kind:`markdownContent`,content:new Cl("\n````\n")}),s.acceptResponseProgress(c,{kind:`codeblockUri`,uri:o,isEdit:!0}),s.acceptResponseProgress(c,{kind:`markdownContent`,content:new Cl("\n````\n")}),this.notebookService.hasSupportedNotebooks(o)&&this.notebookService.getNotebookTextModel(o)?s.acceptResponseProgress(c,{kind:`notebookEdit`,edits:[],uri:o}):s.acceptResponseProgress(c,{kind:`textEdit`,edits:[],uri:o});let l=s.editingSession;if(!l)throw Error(`This tool must be called from within an editing session`);let u=await this.codeMapperService.mapCode({codeBlocks:[{code:i.code,resource:o,markdownBeforeBlock:i.explanation}],location:`tool`,chatRequestId:e.chatRequestId,chatRequestModel:e.modelId,chatSessionResource:e.context.sessionResource},{textEdit:(e,t)=>{s.acceptResponseProgress(c,{kind:`textEdit`,uri:e,edits:t})},notebookEdit(e,t){s.acceptResponseProgress(c,{kind:`notebookEdit`,uri:e,edits:t})}},r);if(this.notebookService.hasSupportedNotebooks(o)&&this.notebookService.getNotebookTextModel(o)?s.acceptResponseProgress(c,{kind:`notebookEdit`,uri:o,edits:[],done:!0}):s.acceptResponseProgress(c,{kind:`textEdit`,uri:o,edits:[],done:!0}),u?.errorMessage)throw Error(u.errorMessage);let d;return await new Promise(e=>{let t=!1;d=pv(n=>{let r=l.entries.read(n)?.find(e=>ao(e.modifiedURI,o));r&&(r.isCurrentlyBeingModifiedBy.read(n)?t=!0:t&&e(!0))})}).finally(()=>{d.dispose()}),{content:[{kind:`text`,value:`The file was edited successfully`}]}}async prepareToolInvocation(e,t){return{presentation:Lb.Hidden}}};aK=k([A(0,nK),A(1,tK),A(2,eK)],aK);const oK=O(`ILanguageModelToolsService`);var sK=class{dismiss(e){this.isUsed||(this.data=e??{},this.isUsed=!0,this.draftAnswers=void 0,this.draftCurrentIndex=void 0,this.draftCollapsed=void 0,this.completion.complete({answers:e}))}constructor(e,t,n,r,i,a,o,s){this.questions=e,this.allowSkip=t,this.resolveId=n,this.data=r,this.isUsed=i,this.message=a,this.source=o,this.terminalId=s,this.kind=`questionCarousel`,this.completion=new Wo}toJSON(){return{kind:this.kind,questions:this.questions,allowSkip:this.allowSkip,resolveId:this.resolveId,data:this.data,isUsed:this.isUsed,message:this.message,source:this.source,terminalId:this.terminalId}}},cK;(function(e){e.RunInTerminal=`run_in_terminal`,e.SendToTerminal=`send_to_terminal`,e.GetTerminalOutput=`get_terminal_output`,e.KillTerminal=`kill_terminal`,e.TerminalSelection=`terminal_selection`,e.TerminalLastCommand=`terminal_last_command`,e.ConfirmTerminalCommand=`vscode_get_terminal_confirmation`,e.CreateAndRunTask=`create_and_run_task`,e.GetTaskOutput=`get_task_output`,e.RunTask=`run_task`})(cK||={});const lK=`The user is not available to respond and will review your work later. Work autonomously and make good decisions.`,uK=`vscode_askQuestions`,dK={header:50,question:200},fK={header:75};function pK(e,t){if(e!==void 0)return e.length>t?e.slice(0,t-3)+`...`:e}function mK(){let e={type:`object`,properties:{questions:{type:`array`,description:`List of questions to ask the user. Order is preserved.`,items:{type:`object`,properties:{header:{type:`string`,description:`Short identifier for the question. Must be unique so answers can be mapped back to the question. Maximum ${dK.header} characters.`,maxLength:dK.header},question:{type:`string`,description:`The question text to display to the user. Keep it concise, ideally one sentence. Maximum ${dK.question} characters.`,maxLength:dK.question},multiSelect:{type:`boolean`,description:`Allow selecting multiple options when options are provided.`},allowFreeformInput:{type:`boolean`,description:`Allow freeform text answers in addition to option selection. Defaults to true; set to false to restrict to predefined options only.`},message:{type:`string`,description:`Optional markdown message to display below the question text, providing additional context or details.`},options:{type:`array`,description:`Optional list of selectable answers. If omitted, the question is free text.`,items:{type:`object`,properties:{label:{type:`string`,description:`Display label and value for the option.`},description:{type:`string`,description:`Optional secondary text shown with the option.`},recommended:{type:`boolean`,description:`Mark this option as the recommended default.`}},required:[`label`]}}},required:[`header`,`question`]},minItems:1}},required:[`questions`]};return{id:uK,toolReferenceName:`askQuestions`,legacyToolReferenceFullNames:[uK,`vscode/askQuestions`],canBeReferencedInPrompt:!1,icon:vl.fromId(N.question.id),displayName:b(8327,`Ask Clarifying Questions`),userDescription:b(8328,`Ask structured clarifying questions using single select, multi-select, or freeform inputs to collect task requirements before proceeding.`),modelDescription:`Use this tool to ask the user a small number of clarifying questions before proceeding. Provide the questions array with concise headers and prompts. Use options for fixed choices, set multiSelect when multiple selections are allowed. Users can always provide a freeform text answer alongside options unless you set allowFreeformInput to false.`,source:Fb.Internal,inputSchema:e}}const hK=mK();let gK=class extends v{constructor(e,t,n,r){super(),this.chatService=e,this.telemetryService=t,this.logService=n,this.configService=r}async invoke(e,t,n,r){let i=tr.create(!0),{questions:a}=e.parameters;if(this.logService.trace(`[AskQuestionsTool] Invoking with ${a?.length??0} question(s)`),!a||a.length===0)throw Error(b(8329,`No questions provided. The questions array must contain at least one question.`));let o=e.context?.sessionResource,s=e.chatRequestId,{request:c,sessionResource:l}=this.getRequest(o,s);if(!l||!c)return this.logService.warn(`[AskQuestionsTool] Missing chat context; marking all questions as skipped.`),this.createSkippedResult(a);let u=e.chatStreamToolCallId??e.callId;if(c.modeInfo?.permissionLevel===_y.Autopilot||this.configService.getValue(hy.AutoReply)){let e=c.modeInfo?.permissionLevel===_y.Autopilot?`Autopilot mode`:`Auto-reply enabled`;this.logService.info(`[AskQuestionsTool] ${e}: auto-responding to questions`);let{carousel:t,idToHeaderMap:n}=this.toQuestionCarousel(a,u);return t.terminalId=this.extractTerminalId(c),t.data=this.buildAutopilotCarouselAnswers(a,t,n),t.isUsed=!0,this.chatService.appendProgress(c,t),this.createAutopilotResult(a)}let{carousel:d,idToHeaderMap:f}=this.toQuestionCarousel(a,u);d.terminalId=this.extractTerminalId(c),this.logService.trace(`[AskQuestionsTool] request=${c.id} terminalExecutionId=${c.terminalExecutionId??`undefined`} carousel.terminalId=${d.terminalId??`undefined`}`),this.chatService.appendProgress(c,d);let p=this.chatService.onDidReceiveQuestionCarouselAnswer(e=>{e.resolveId!==d.resolveId||d.isUsed||d.dismiss(e.answers)}),m;try{m=await bo(d.completion.p,r)}catch(e){throw e instanceof ie&&d.dismiss(void 0),e}finally{p.dispose()}if(!m)throw d.dismiss(void 0),new ie;if(r.isCancellationRequested)throw new ie;if(d.dismissedByTerminalInput&&d.terminalId)return this.logService.info(`[AskQuestionsTool] Carousel dismissed because user typed directly in terminal ${d.terminalId}`),{content:[{kind:`text`,value:`The user is replying to the terminal prompts directly. Do not ask more questions or send input to the terminal. You will be automatically notified when the command in terminal ${d.terminalId} completes.`}]};n.report({message:b(8330,`Analyzing your answers...`)});let ee=this.convertCarouselAnswers(a,m?.answers,f),{answeredCount:te,skippedCount:ne,freeTextCount:h,recommendedAvailableCount:re,recommendedSelectedCount:ae}=this.collectMetrics(a,ee);this.sendTelemetry(e.chatRequestId,a.length,te,ne,h,re,ae,i.elapsed());let oe=JSON.stringify(ee);return this.logService.trace(`[AskQuestionsTool] Returning tool result with metrics: questions=${a.length}, answered=${te}, skipped=${ne}, freeText=${h}, recommendedAvailable=${re}, recommendedSelected=${ae}`),{content:[{kind:`text`,value:oe}]}}async prepareToolInvocation(e,t){let{questions:n}=e.parameters;if(!n||n.length===0)throw Error(b(8329,`No questions provided. The questions array must contain at least one question.`));for(let e of n)if(e.options&&e.options.length===1)throw Error(b(8331,`Question "{0}" must have at least two options, or none for free text input.`,e.header));let r=n.length,i=n.map(e=>e.header).join(`, `),a=r===1?b(8332,`Asking a question ({0})`,i):b(8333,`Asking {0} questions ({1})`,r,i),o=r===1?b(8334,`Asked a question ({0})`,i):b(8335,`Asked {0} questions ({1})`,r,i);return{invocationMessage:new Cl(a),pastTenseMessage:new Cl(o)}}getRequest(e,t){if(!e)return{request:void 0,sessionResource:void 0};let n=this.chatService.getSession(e),r;return n&&(t&&(r=n.getRequests().find(e=>e.id===t)),r||=n.getRequests().at(-1)),r?{request:r,sessionResource:e}:{request:void 0,sessionResource:e}}extractTerminalId(e){if(e.terminalExecutionId)return e.terminalExecutionId;let t=e.message.text.match(/\[Terminal (?<termId>\S+) notification:/);if(t?.groups?.termId)return t.groups.termId;let n=e.response;if(n){let e=n.response.value;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.kind===`toolInvocation`&&n.toolId===cK.RunInTerminal){let e=n.state.get();if(e.type===TU.StateKind.Completed&&e.contentForModel){for(let t of e.contentForModel)if(t.kind===`text`){let e=t.value.match(/(?:running in terminal ID|may still be running in terminal ID) ([0-9a-fA-F-]+)/);if(e)return e[1]}}}}}}toQuestionCarousel(e,t){let n=new Map,r=t??Gc();return{carousel:new sK(e.map((e,t)=>this.toChatQuestion(e,n,r,t)),!0,r),idToHeaderMap:n}}toChatQuestion(e,t,n,r){let i;i=!e.options||e.options.length===0?`text`:e.multiSelect?`multiSelect`:`singleSelect`;let a;if(e.options){let t=e.options.filter(e=>e.recommended);t.length>0&&(a=e.multiSelect?t.map(e=>e.label):t[0].label)}let o=`${n}:${r}`;t.set(o,e.header);let s=pK(e.header,fK.header)??e.header;return{id:o,type:i,title:s,message:e.question,detailedMessage:e.message,options:e.options?.map(e=>({id:e.label,label:e.description?`${e.label} - ${e.description}`:e.label,value:e.label})),defaultValue:a,allowFreeformInput:e.allowFreeformInput??!0}}convertCarouselAnswers(e,t,n){let r={answers:{}};t&&(this.logService.trace(`[AskQuestionsTool] Carousel answer keys: ${Object.keys(t).join(`, `)}`),this.logService.trace(`[AskQuestionsTool] Question headers: ${e.map(e=>e.header).join(`, `)}`));let i=new Map;for(let[e,t]of n)i.set(t,e);for(let n of e){if(!t){r.answers[n.header]={selected:[],freeText:null,skipped:!0};continue}let e=i.get(n.header),a=e?t[e]:void 0;if(this.logService.trace(`[AskQuestionsTool] Processing question "${n.header}" (internal ID: ${e}), raw answer: ${JSON.stringify(a)}, type: ${typeof a}`),a===void 0)r.answers[n.header]={selected:[],freeText:null,skipped:!0};else if(typeof a==`string`)n.options?.some(e=>e.label===a)?r.answers[n.header]={selected:[a],freeText:null,skipped:!1}:r.answers[n.header]={selected:[],freeText:a,skipped:!1};else if(Array.isArray(a))r.answers[n.header]={selected:a.map(e=>String(e)),freeText:null,skipped:!1};else if(typeof a==`object`&&_t(a,{selectedValues:!0})){let{selectedValues:e,freeformValue:t}=a;r.answers[n.header]={selected:e,freeText:t??null,skipped:!1}}else if(typeof a==`object`&&(_t(a,{selectedValue:!0})||_t(a,{freeformValue:!0}))){let{selectedValue:e,freeformValue:t}=a;t?r.answers[n.header]={selected:[],freeText:t,skipped:!1}:e===void 0?r.answers[n.header]={selected:[],freeText:null,skipped:!0}:n.options?.some(t=>t.label===e)?r.answers[n.header]={selected:[e],freeText:null,skipped:!1}:r.answers[n.header]={selected:[],freeText:e,skipped:!1}}else this.logService.warn(`[AskQuestionsTool] Unknown answer format for "${n.header}": ${JSON.stringify(a)}`),r.answers[n.header]={selected:[],freeText:null,skipped:!0}}return r}collectMetrics(e,t){let n=Object.values(t.answers);return{answeredCount:n.filter(e=>!e.skipped).length,skippedCount:n.filter(e=>e.skipped).length,freeTextCount:n.filter(e=>e.freeText!==null).length,recommendedAvailableCount:e.filter(e=>e.options?.some(e=>e.recommended)).length,recommendedSelectedCount:e.filter(e=>{let n=t.answers[e.header],r=e.options?.find(e=>e.recommended);return n&&!n.skipped&&r&&n.selected.includes(r.label)}).length}}createSkippedResult(e){let t={};for(let n of e)t[n.header]={selected:[],freeText:null,skipped:!0};return{content:[{kind:`text`,value:JSON.stringify({answers:t})}]}}createAutopilotResult(e){let t={};for(let n of e)t[n.header]={selected:[],freeText:lK,skipped:!1};return{content:[{kind:`text`,value:JSON.stringify({answers:t})}]}}buildAutopilotCarouselAnswers(e,t,n){let r={},i=new Map;for(let[e,t]of n)i.set(t,e);for(let n of e){let e=i.get(n.header);if(!e)continue;let a=t.questions.find(t=>t.id===e);a&&(a.type===`multiSelect`?r[e]={selectedValues:[],freeformValue:lK}:a.type===`singleSelect`?r[e]={freeformValue:lK}:r[e]=lK)}return r}sendTelemetry(e,t,n,r,i,a,o,s){this.telemetryService.publicLog2(`askQuestionsToolInvoked`,{requestId:e,questionCount:t,answeredCount:n,skippedCount:r,freeTextCount:i,recommendedAvailableCount:a,recommendedSelectedCount:o,duration:s})}};gK=k([A(0,nK),A(1,d_),A(2,Ns),A(3,Oh)],gK);const _K={id:`vscode_get_confirmation`,displayName:`Confirmation Tool`,modelDescription:`A tool that demonstrates different types of confirmations. Takes a title, message, and confirmation type (basic or terminal).`,source:Fb.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title for the confirmation dialog`},message:{type:`string`,description:`Message to show in the confirmation dialog`},confirmationType:{type:`string`,enum:[`basic`,`terminal`],description:`Type of confirmation to show - basic for simple confirmation, terminal for terminal command confirmation`},terminalCommand:{type:`string`,description:`Terminal command to show (only used when confirmationType is "terminal")`}},required:[`title`,`message`,`confirmationType`],additionalProperties:!1}},vK={id:`vscode_get_confirmation_with_options`,displayName:`Confirmation Tool with Options`,modelDescription:`A tool that demonstrates different types of confirmations. Takes a title, message, and buttons.`,source:Fb.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title for the confirmation dialog`},message:{type:`string`,description:`Message to show in the confirmation dialog`},buttons:{type:`array`,items:{type:`string`},description:`Custom button labels to display.`}},required:[`title`,`message`,`buttons`],additionalProperties:!1}},yK={id:`vscode_get_modified_files_confirmation`,displayName:`Modified Files Confirmation Tool`,modelDescription:`A tool that shows a modified-files confirmation UI with a split primary button and a hardcoded cancel action.`,source:Fb.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title for the confirmation dialog`},message:{type:`string`,description:`Message to show in the confirmation dialog`},options:{type:`array`,items:{type:`string`},minItems:1,description:`Selectable option labels. The first option is used for the primary split button and the remaining options are placed in the dropdown menu.`},modifiedFiles:{type:`array`,items:{type:`object`,properties:{uri:{type:`string`,description:`URI of the modified file.`},originalUri:{type:`string`,description:`Optional original URI used when opening a diff.`},insertions:{type:`number`,description:`Optional number of lines added.`},deletions:{type:`number`,description:`Optional number of lines removed.`},title:{type:`string`,description:`Optional title shown in the file tooltip.`},description:{type:`string`,description:`Optional secondary label shown for the file entry.`}},required:[`uri`],additionalProperties:!1},description:`Modified files to show in the confirmation UI.`}},required:[`title`,`message`,`options`,`modifiedFiles`],additionalProperties:!1}};var bK=class{async prepareToolInvocation(e,t){let n=e.parameters;if(!n.title||!n.message)throw Error(`Missing required parameters for ConfirmationTool`);let r=n.confirmationType??`basic`,i;return i=r===`terminal`?{kind:`terminal`,commandLine:{original:n.terminalCommand??``},language:`bash`}:void 0,{confirmationMessages:{title:n.title,message:new Cl(n.message),allowAutoConfirm:!(n.buttons||[]).length,customOptions:n.buttons?.map((e,t)=>({id:e,label:e,kind:t===0?Qy.Approve:Qy.Deny}))},toolSpecificData:i,presentation:Lb.HiddenAfterComplete}}async invoke(e,t,n,r){return e.selectedCustomButton?{content:[{kind:`text`,value:e.selectedCustomButton}]}:{content:[{kind:`text`,value:`yes`}]}}},xK=class{async prepareToolInvocation(e,t){let n=e.parameters;if(!n.title||!n.message)throw Error(`Missing required parameters for ModifiedFilesConfirmationTool`);if(!n.options?.length)throw Error(`ModifiedFilesConfirmationTool requires at least one option`);let r={kind:`modifiedFilesConfirmation`,options:n.options,modifiedFiles:n.modifiedFiles.map(e=>({uri:C.parse(e.uri).toJSON(),originalUri:e.originalUri?C.parse(e.originalUri).toJSON():void 0,insertions:e.insertions,deletions:e.deletions,title:e.title,description:e.description}))};return{confirmationMessages:{title:n.title,message:new Cl(n.message),allowAutoConfirm:!1},toolSpecificData:r,presentation:Lb.HiddenAfterComplete}}async invoke(e,t,n,r){return e.selectedCustomButton?{content:[{kind:`text`,value:e.selectedCustomButton}]}:{content:[{kind:`text`,value:`yes`}]}}};const SK=O(`chatTodoListService`),CK=`manage_todo_list`;function wK(){return{id:CK,toolReferenceName:`todo`,legacyToolReferenceFullNames:[`todos`],canBeReferencedInPrompt:!0,icon:vl.fromId(N.checklist.id),displayName:b(8336,`Manage and track todo items for task planning`),userDescription:b(8337,`Manage and track todo items for task planning`),modelDescription:`Manage a structured todo list to track progress and plan tasks throughout your coding session. Use this tool VERY frequently to ensure task visibility and proper planning.
|
|
108
|
+
|
|
109
|
+
When to use this tool:
|
|
110
|
+
- Complex multi-step work requiring planning and tracking
|
|
111
|
+
- When user provides multiple tasks or requests (numbered/comma-separated)
|
|
112
|
+
- After receiving new instructions that require multiple steps
|
|
113
|
+
- BEFORE starting work on any todo (mark as in-progress)
|
|
114
|
+
- IMMEDIATELY after completing each todo (mark completed individually)
|
|
115
|
+
- When breaking down larger tasks into smaller actionable steps
|
|
116
|
+
- To give users visibility into your progress and planning
|
|
117
|
+
|
|
118
|
+
When NOT to use:
|
|
119
|
+
- Single, trivial tasks that can be completed in one step
|
|
120
|
+
- Purely conversational/informational requests
|
|
121
|
+
- When just reading files or performing simple searches
|
|
122
|
+
|
|
123
|
+
CRITICAL workflow:
|
|
124
|
+
1. Plan tasks by writing todo list with specific, actionable items
|
|
125
|
+
2. Mark ONE todo as in-progress before starting work
|
|
126
|
+
3. Complete the work for that specific todo
|
|
127
|
+
4. Mark that todo as completed IMMEDIATELY
|
|
128
|
+
5. Move to next todo and repeat
|
|
129
|
+
|
|
130
|
+
Todo states:
|
|
131
|
+
- not-started: Todo not yet begun
|
|
132
|
+
- in-progress: Currently working (limit ONE at a time)
|
|
133
|
+
- completed: Finished successfully
|
|
134
|
+
|
|
135
|
+
IMPORTANT: Mark todos completed as soon as they are done. Do not batch completions.`,source:Fb.Internal,inputSchema:{type:`object`,properties:{todoList:{type:`array`,description:`Complete array of all todo items. Must include ALL items - both existing and new.`,items:{type:`object`,properties:{id:{type:`number`,description:`Unique identifier for the todo. Use sequential numbers starting from 1.`},title:{type:`string`,description:`Concise action-oriented todo label (3-7 words). Displayed in UI.`},status:{type:`string`,enum:[`not-started`,`in-progress`,`completed`],description:`not-started: Not begun | in-progress: Currently working (max 1) | completed: Fully finished with no blockers`}},required:[`id`,`title`,`status`]}}},required:[`todoList`]}}}wK();let TK=class extends v{constructor(e,t,n){super(),this.chatTodoListService=e,this.logService=t,this.telemetryService=n}async invoke(e,t,n,r){let i=e.parameters,a=e.context?.sessionResource;if(!a&&i.operation===`read`&&i.chatSessionResource)try{a=C.parse(i.chatSessionResource)}catch(e){this.logService.error(`ManageTodoListTool: Invalid chatSessionResource URI`,e)}if(!a)return{content:[{kind:`text`,value:`Error: No session resource available`}]};this.logService.debug(`ManageTodoListTool: Invoking with options ${JSON.stringify(i)}`);try{return i.operation===`read`?this.handleReadOperation(a):this.handleWriteOperation(i,a)}catch(e){return{content:[{kind:`text`,value:`Error: ${e instanceof Error?e.message:`Unknown error`}`}]}}}async prepareToolInvocation(e,t){let n=e.parameters,r=e.chatSessionResource;if(!r)return;let i=this.chatTodoListService.getTodos(r),a;n.operation===`read`?a=b(8338,`Read todo list`):n.todoList&&(a=this.generatePastTenseMessage(i,n.todoList));let o=n.todoList??i,s=o.map(e=>({id:e.id.toString(),title:e.title,status:e.status}));return{invocationMessage:new Cl(a?.replace(/^(Starting|Completed): /i,``)??b(8339,`Updating todo list`)),presentation:o.length?void 0:Lb.Hidden,pastTenseMessage:new Cl(a??b(8340,`Updated todo list`)),toolSpecificData:{kind:`todoList`,todoList:s}}}generatePastTenseMessage(e,t){if(e.length===0&&t.length>0)return t.length===1?b(8341,`Created 1 todo`):b(8342,`Created {0} todos`,t.length);let n=new Map(e.map(e=>[e.id,e])),r=t.filter(e=>{let t=n.get(e.id);return t&&t.status!==`in-progress`&&e.status===`in-progress`});if(r.length>0){let e=r[0],n=t.length,i=t.findIndex(t=>t.id===e.id)+1;return b(8343,`Starting: *{0}* ({1}/{2})`,e.title,i,n)}let i=t.filter(e=>{let t=n.get(e.id);return t&&t.status!==`completed`&&e.status===`completed`});if(i.length>0){let e=i[0],n=t.length,r=t.findIndex(t=>t.id===e.id)+1;return b(8344,`Completed: *{0}* ({1}/{2})`,e.title,r,n)}let a=t.filter(e=>!n.has(e.id));return a.length>0?a.length===1?b(8345,`Added 1 todo`):b(8346,`Added {0} todos`,a.length):b(8347,`Updated todo list`)}handleRead(e,t){return e.length===0?`No todo list found.`:`# Todo List\n\n${this.formatTodoListAsMarkdownTaskList(e)}`}handleReadOperation(e){let t=this.chatTodoListService.getTodos(e),n=this.handleRead(t,e),r=this.calculateStatusCounts(t);return this.telemetryService.publicLog2(`todoListToolInvoked`,{operation:`read`,notStartedCount:r.notStartedCount,inProgressCount:r.inProgressCount,completedCount:r.completedCount}),{content:[{kind:`text`,value:n}]}}handleWriteOperation(e,t){if(!e.todoList)return{content:[{kind:`text`,value:`Error: todoList is required for write operation`}]};let n=e.todoList.map(e=>({id:e.id,title:e.title,status:e.status})),r=this.chatTodoListService.getTodos(t),i=this.calculateTodoChanges(r,n);this.chatTodoListService.setTodos(t,n);let a=this.calculateStatusCounts(n),o=[];return n.length<3?o.push(`Warning: Small todo list (<3 items). This task might not need a todo list.`):n.length>10&&o.push(`Warning: Large todo list (>10 items). Consider keeping the list focused and actionable.`),i>3&&o.push(`Warning: Did you mean to update so many todos at the same time? Consider working on them one by one.`),this.telemetryService.publicLog2(`todoListToolInvoked`,{operation:`write`,notStartedCount:a.notStartedCount,inProgressCount:a.inProgressCount,completedCount:a.completedCount}),{content:[{kind:`text`,value:`Successfully wrote todo list${o.length?`
|
|
136
|
+
|
|
137
|
+
`+o.join(`
|
|
138
|
+
`):``}`}],toolMetadata:{warnings:o}}}calculateStatusCounts(e){return{notStartedCount:e.filter(e=>e.status===`not-started`).length,inProgressCount:e.filter(e=>e.status===`in-progress`).length,completedCount:e.filter(e=>e.status===`completed`).length}}formatTodoListAsMarkdownTaskList(e){return e.length===0?``:e.map(e=>{let t;switch(e.status){case`completed`:t=`[x]`;break;case`in-progress`:t=`[-]`;break;default:t=`[ ]`;break}return[`- ${t} ${e.title}`].join(`
|
|
139
|
+
`)}).join(`
|
|
140
|
+
`)}calculateTodoChanges(e,t){let n=0,r=Math.min(e.length,t.length);for(let i=0;i<r;i++){let r=e[i],a=t[i];(r.title!==a.title||r.status!==a.status)&&n++}return Math.max(0,t.length-e.length)+Math.max(0,e.length-t.length)+n}};TK=k([A(0,SK),A(1,Ns),A(2,d_)],TK);var EK=class{constructor(e,t,n,r,i,a,o,s,c){this.title=e,this.content=t,this.actions=n,this.canProvideFeedback=r,this.planUri=i,this.resolveId=a,this.data=o,this.isUsed=s,this.source=c,this.kind=`planReview`,this.completion=new Wo}dismiss(){this.isUsed||(this.isUsed=!0,this.draftFeedback=void 0,this.draftCollapsed=void 0,this.completion.complete(void 0))}toJSON(){return{kind:this.kind,title:this.title,content:this.content,actions:this.actions,canProvideFeedback:this.canProvideFeedback,planUri:this.planUri,resolveId:this.resolveId,data:this.data,isUsed:this.isUsed,source:this.source}}};function DK(){return{id:`vscode_reviewPlan`,toolReferenceName:`reviewPlan`,canBeReferencedInPrompt:!1,icon:vl.fromId(N.checklist.id),displayName:b(8348,`Review Plan`),userDescription:b(8349,`Ask the user to review and approve a plan before proceeding.`),modelDescription:`Use this tool to present a plan to the user for review. Provide the plan content as markdown, a list of approval actions (with optional default), and whether the user can provide freeform feedback. Optionally provide a URI to the backing plan file so the user can edit it. The tool returns the chosen action, whether the plan was rejected, and any feedback.`,source:Fb.Internal,inputSchema:{type:`object`,properties:{title:{type:`string`,description:`Title displayed in the widget header. Defaults to "Review plan" if omitted.`},plan:{type:`string`,description:`Optional URI of an editable plan file. An Edit button in the widget header opens it in the editor.`},content:{type:`string`,description:`Markdown content rendered in the body of the widget. May be the plan summary or full plan text.`},actions:{type:`array`,description:`List of approval actions offered in the primary dropdown button. Order is preserved.`,items:{type:`object`,properties:{label:{type:`string`,description:`Short action label shown in the dropdown button.`},description:{type:`string`,description:`Optional detail shown below the label in the dropdown list.`},default:{type:`boolean`,description:`Whether this action should be selected by default.`},permissionLevel:{type:`string`,enum:[`autopilot`],description:`When set to "autopilot", a confirmation dialog is shown before proceeding.`}},required:[`label`]},minItems:1},canProvideFeedback:{type:`boolean`,description:`When true, an additional feedback textarea is shown below the plan content.`}},required:[`content`,`actions`,`canProvideFeedback`]}}}const OK=DK();let kK=class extends v{constructor(e,t){super(),this.chatService=e,this.logService=t}async invoke(e,t,n,r){let{title:i,plan:a,content:o,actions:s,canProvideFeedback:c}=e.parameters;if(!s||s.length===0)throw Error(b(8350,`At least one approval action must be provided.`));let{request:l}=this.getRequest(e.context?.sessionResource,e.chatRequestId);if(!l)return this.logService.warn(`[ReviewPlanTool] Missing chat context; returning rejected result.`),this.toResult({rejected:!0});let u;if(a)try{u=C.parse(a)}catch{try{u=C.file(a)}catch{u=void 0}}let d=new EK(i??b(8351,`Review plan`),o,s,c,u?.toJSON(),Gc());this.chatService.appendProgress(l,d);let f=await bo(d.completion.p,r);if(r.isCancellationRequested)throw new ie;return this.toResult(f??{rejected:!0})}async prepareToolInvocation(e,t){let n=e.parameters;if(!n.actions||n.actions.length===0)throw Error(b(8350,`At least one approval action must be provided.`));return{invocationMessage:new Cl(b(8352,`Asking you to review the plan`)),pastTenseMessage:new Cl(b(8353,`Asked you to review the plan`))}}toResult(e){return{content:[{kind:`text`,value:JSON.stringify(e)}]}}getRequest(e,t){if(!e)return{request:void 0};let n=this.chatService.getSession(e);if(!n)return{request:void 0};let r;return t&&(r=n.getRequests().find(e=>e.id===t)),r||=n.getRequests().at(-1),{request:r}}};kK=k([A(0,nK),A(1,Ns)],kK);const AK=O(`ILanguageModelsService`),jK=O(`chatAgentService`);O(`chatAgentNameService`);const MK=O(`labelService`),NK=O(`remoteAgentService`);function PK(){return{applyingInstructionsCount:0,referencedInstructionsCount:0,agentInstructionsCount:0,listedInstructionsCount:0,totalInstructionsCount:0,claudeRulesCount:0,claudeMdCount:0,claudeAgentsCount:0}}function FK(){return{debugDetails:[],durationInMillis:0}}function IK(e,t){return e===void 0||t===void 0||e.includes(t)}var LK;(function(e){e.local=`local`,e.user=`user`,e.extension=`extension`,e.plugin=`plugin`})(LK||={});var RK;(function(e){function t(e){return e.storage===LK.extension?{storage:LK.extension,extensionId:e.extension.identifier}:e.storage===LK.plugin?{storage:LK.plugin,pluginUri:e.pluginUri}:{storage:e.storage}}e.fromPromptPath=t;function n(e,t){return e===t?!0:!e||!t||e.storage!==t.storage?!1:e.storage===LK.extension&&t.storage===LK.extension?Ts.equals(e.extensionId,t.extensionId):e.storage===LK.plugin&&t.storage===LK.plugin?ao(e.pluginUri,t.pluginUri):!0}e.isEquals=n})(RK||={});var zK;(function(e){e.agentsMd=`agentsMd`,e.claudeMd=`claudeMd`,e.copilotInstructionsMd=`copilotInstructionsMd`})(zK||={});function BK(e){return ua(e,`SKILL.md`)===0}const VK=`~/.copilot/agents`,HK=[{path:`.agents/skills`,source:Sb.AgentsWorkspace,storage:LK.local},{path:`.github/skills`,source:Sb.GitHubWorkspace,storage:LK.local},{path:`.claude/skills`,source:Sb.ClaudeWorkspace,storage:LK.local},{path:`~/.agents/skills`,source:Sb.AgentsPersonal,storage:LK.user},{path:`~/.copilot/skills`,source:Sb.CopilotPersonal,storage:LK.user},{path:`~/.claude/skills`,source:Sb.ClaudePersonal,storage:LK.user}],UK=[{path:`.github/instructions`,source:Sb.GitHubWorkspace,storage:LK.local},{path:`.claude/rules`,source:Sb.ClaudeWorkspace,storage:LK.local},{path:`~/.copilot/instructions`,source:Sb.CopilotPersonal,storage:LK.user},{path:`~/.claude/rules`,source:Sb.ClaudePersonal,storage:LK.user}],WK=[{path:`.github/prompts`,source:Sb.GitHubWorkspace,storage:LK.local}],GK=[{path:`.github/agents`,source:Sb.GitHubWorkspace,storage:LK.local},{path:`.claude/agents`,source:Sb.ClaudeWorkspace,storage:LK.local},{path:VK,source:Sb.CopilotPersonal,storage:LK.user},{path:`~/.claude/agents`,source:Sb.ClaudePersonal,storage:LK.user}],KK=[{path:`.github/hooks`,source:Sb.GitHubWorkspace,storage:LK.local},{path:`.claude/settings.local.json`,source:Sb.ClaudeWorkspaceLocal,storage:LK.local},{path:`.claude/settings.json`,source:Sb.ClaudeWorkspace,storage:LK.local},{path:`~/.copilot/hooks`,source:Sb.CopilotPersonal,storage:LK.user},{path:`~/.claude/settings.json`,source:Sb.ClaudePersonal,storage:LK.user}];function qK(e){let t=lo(e).path;return t.endsWith(`/.github/agents`)||t.endsWith(`/.claude/agents`)||YK(e)}function JK(e){return lo(e).path.endsWith(`/.claude/agents`)}function YK(e){return lo(e).path.endsWith(VK.substring(1))}function XK(e){return e.path.includes(`/.claude/rules/`)}function ZK(e){let t=so(e);if(t.endsWith(`.prompt.md`))return bb.prompt;if(t.endsWith(`.instructions.md`)||t===`copilot-instructions.md`)return bb.instructions;if(t.endsWith(`.chatmode.md`)||t.endsWith(`.agent.md`))return bb.agent;if(BK(t))return bb.skill;if(t.endsWith(`.md`)&&t!==`README.md`&&qK(e))return bb.agent;if(t.endsWith(`.md`)&&t!==`README.md`&&XK(e))return bb.instructions;if(t.toLowerCase().endsWith(`.json`))return bb.hook}function QK(e){return ZK(e)!==void 0}function $K(e){switch(e){case bb.instructions:return UK;case bb.prompt:return WK;case bb.agent:return GK;case bb.skill:return HK;case bb.hook:return KK;default:throw Error(`Unknown prompt type`)}}var eq;(function(e){e.PROMPT_LOCATIONS_KEY=`chat.promptFilesLocations`,e.INSTRUCTIONS_LOCATION_KEY=`chat.instructionsFilesLocations`,e.MODE_LOCATION_KEY=`chat.modeFilesLocations`,e.AGENTS_LOCATION_KEY=`chat.agentFilesLocations`,e.SKILLS_LOCATION_KEY=`chat.agentSkillsLocations`,e.HOOKS_LOCATION_KEY=`chat.hookFilesLocations`,e.PROMPT_FILES_SUGGEST_KEY=`chat.promptFilesRecommendations`,e.USE_COPILOT_INSTRUCTION_FILES=`github.copilot.chat.codeGeneration.useInstructionFiles`,e.USE_AGENT_MD=`chat.useAgentsMdFile`,e.USE_NESTED_AGENT_MD=`chat.useNestedAgentsMdFiles`,e.USE_CLAUDE_MD=`chat.useClaudeMdFile`,e.USE_AGENT_SKILLS=`chat.useAgentSkills`,e.USE_CHAT_HOOKS=`chat.useHooks`,e.USE_CLAUDE_HOOKS=`chat.useClaudeHooks`,e.USE_SKILL_ADHERENCE_PROMPT=`chat.experimental.useSkillAdherencePrompt`,e.INCLUDE_APPLYING_INSTRUCTIONS=`chat.includeApplyingInstructions`,e.INCLUDE_REFERENCED_INSTRUCTIONS=`chat.includeReferencedInstructions`,e.USE_CUSTOMIZATIONS_IN_PARENT_REPOS=`chat.useCustomizationsInParentRepositories`;function t(e,t){let n=tq(t),r=e.getValue(n);if(!(r==null||Array.isArray(r))&&typeof r==`object`){let e={};for(let[t,n]of Object.entries(r)){let r=t.trim(),i=nq(n);i!==void 0&&r&&(e[r]=i)}return e}}e.getLocationsValue=t;function n(e,n){let r=t(e,n),i=$K(n);if(r&&typeof r==`object`){let e=[],t=new Set(i.map(e=>e.path));for(let t of i)r[t.path]!==!1&&e.push(t);for(let[n,i]of Object.entries(r)){if(i===!1||t.has(n))continue;let r=rq(n)?LK.user:LK.local;e.push({path:n,source:r===LK.local?Sb.ConfigWorkspace:Sb.ConfigPersonal,storage:r})}return e}return[]}e.promptSourceFolders=n;function r(t,n){let r=t.getValue(e.PROMPT_FILES_SUGGEST_KEY,{resource:n});if(!r||typeof r!=`object`||Array.isArray(r))return;let i={};for(let[e,t]of Object.entries(r)){let n=e.trim();if(!n)continue;if(typeof t==`boolean`){i[n]=t;continue}if(typeof t==`string`){let e=t.trim();e&&(i[n]=e);continue}let r=nq(t);r!==void 0&&(i[n]=r)}return Object.keys(i).length>0?i:void 0}e.getPromptFilesRecommendationsValue=r})(eq||={});function tq(e){switch(e){case bb.instructions:return eq.INSTRUCTIONS_LOCATION_KEY;case bb.prompt:return eq.PROMPT_LOCATIONS_KEY;case bb.agent:return eq.AGENTS_LOCATION_KEY;case bb.skill:return eq.SKILLS_LOCATION_KEY;case bb.hook:return eq.HOOKS_LOCATION_KEY;default:throw Error(`Unknown prompt type`)}}function nq(e){if(typeof e==`boolean`)return e;if(typeof e==`string`){let t=e.trim().toLowerCase();return t===`true`?!0:t===`false`?!1:void 0}}function rq(e){return e.startsWith(`~/`)}const iq=O(`IPromptsService`);var aq=class e{static fromTo(t,n){return new e(t,n)}static equals(e,t){return e.start===t.start&&e.endExclusive===t.endExclusive}static addRange(t,n){let r=0;for(;r<n.length&&n[r].endExclusive<t.start;)r++;let i=r;for(;i<n.length&&n[i].start<=t.endExclusive;)i++;if(r===i)n.splice(r,0,t);else{let a=Math.min(t.start,n[r].start),o=Math.max(t.endExclusive,n[i-1].endExclusive);n.splice(r,i-r,new e(a,o))}}static tryCreate(t,n){if(!(t>n))return new e(t,n)}static ofLength(t){return new e(0,t)}static ofStartAndLength(t,n){return new e(t,t+n)}static emptyAt(t){return new e(t,t)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new me(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(t){return new e(this.start+t,this.endExclusive+t)}deltaStart(t){return new e(this.start+t,this.endExclusive)}deltaEnd(t){return new e(this.start,this.endExclusive+t)}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(t){return new e(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))}intersect(t){let n=Math.max(this.start,t.start),r=Math.min(this.endExclusive,t.endExclusive);if(n<=r)return new e(n,r)}intersectionLength(e){let t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,n-t)}intersects(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)}intersectsOrTouches(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)}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 me(`Invalid clipping range: ${this.toString()}`);return Math.max(this.start,Math.min(this.endExclusive-1,e))}clipCyclic(e){if(this.isEmpty)throw new me(`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){let t=[];for(let n=this.start;n<this.endExclusive;n++)t.push(e(n));return t}forEach(e){for(let t=this.start;t<this.endExclusive;t++)e(t)}joinRightTouching(t){if(this.endExclusive!==t.start)throw new me(`Invalid join: ${this.toString()} and ${t.toString()}`);return new e(this.start,t.endExclusive)}withMargin(t,n){return n===void 0&&(n=t),new e(this.start-t,this.endExclusive+n)}};const oq=O(`agentPluginService`);let sq=class{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){this._modeKind=e,this._enabledTools=t,this._enabledSubagents=n,this._currentSessionType=r,this._promptsService=i,this._logService=a,this._labelService=o,this._configurationService=s,this._workspaceService=c,this._fileService=l,this._remoteAgentService=u,this._telemetryService=d,this._languageModelToolsService=f,this._agentPluginService=p,this._parseResults=new He}async _parseInstructionsFile(e,t){if(this._parseResults.has(e))return this._parseResults.get(e);try{let n=await this._promptsService.parseNew(e,t);return this._parseResults.set(e,n),n}catch(t){this._logService.error(`[InstructionsContextComputer] Failed to parse instruction file: ${e}`,t);return}}async collect(e,t){let n=performance.now(),r=await this._promptsService.getInstructionFiles(t);this._logService.trace(`[InstructionsContextComputer] ${r.length} instruction files available.`);let i=PK(),a=FK(),o=this._getContext(e);await this.addApplyingInstructions(r,o,e,i,a,t),await this._addReferencedInstructions(e,i,a,t),await this._addAgentInstructions(e,i,a,t);let s=await this._getCustomizationsIndex(r,e,i,a,t);s&&(e.add(s),i.listedInstructionsCount++),a.durationInMillis=performance.now()-n,this.sendTelemetry(i)}sendTelemetry(e){e.totalInstructionsCount=e.agentInstructionsCount+e.referencedInstructionsCount+e.applyingInstructionsCount+e.listedInstructionsCount,this._telemetryService.publicLog2(`instructionsCollected`,e)}async _logSkillLoadedTelemetry(e){try{let t=new He,n=this._agentPluginService.plugins.get();for(let e of n)t.set(e.uri,e);let r=e=>e===void 0?``:String(jh(e));for(let n of e){let e=n.pluginUri?t.get(n.pluginUri):void 0;this._telemetryService.publicLog2(`skillLoadedIntoContext`,{skillNameHash:r(n.name),skillStorage:n.storage,extensionIdHash:r(n.extension?.identifier.value),extensionVersion:n.extension?.version??``,pluginNameHash:r(e?.label),pluginVersion:e?.fromMarketplace?.version??``})}}catch(e){this._logService.error(`[InstructionsContextComputer] Failed to log skill telemetry`,e)}}async addApplyingInstructions(e,t,n,r,i,a){if(!this._configurationService.getValue(eq.INCLUDE_APPLYING_INSTRUCTIONS)&&this._modeKind!==gy.Edit){this._logService.trace(`[InstructionsContextComputer] includeApplyingInstructions is disabled and agent kind is not Edit. No applying instructions will be added.`);return}let o=this._currentSessionType;for(let s of e){if(a.isCancellationRequested)return;let{uri:e,pattern:c}=s;if(!IK(s.sessionTypes,o))continue;if(!c){this._logService.trace(`[InstructionsContextComputer] No pattern (applyTo / paths) found: ${e}`),i.debugDetails.push({category:`skipped`,name:so(e).toString(),uri:e,reason:b(8014,`no applyTo pattern`)});continue}let l=XK(e);if(t.instructions.has(e)){this._logService.trace(`[InstructionsContextComputer] Skipping already processed instruction file: ${e}`),i.debugDetails.push({category:`skipped`,name:so(e).toString(),uri:e,reason:b(8015,`already processed`)});continue}let u=this._matches(t.files,c);if(u){this._logService.trace(`[InstructionsContextComputer] Match for ${e} with ${u.pattern}${u.file?` for file ${u.file}`:``}`);let t=u.file?b(8017,`automatically attached as pattern {0} matches {1}`,c,this._labelService.getUriLabel(u.file,{relative:!0})):b(8016,`automatically attached as pattern is **`);n.add(Sh(e,xh.Instruction,t,!0)),r.applyingInstructionsCount++,i.debugDetails.push({category:`applying`,name:so(e).toString(),uri:e,reason:t}),l&&r.claudeRulesCount++}else this._logService.trace(`[InstructionsContextComputer] No match for ${e} with ${c}`),i.debugDetails.push({category:`skipped`,name:so(e).toString(),uri:e,reason:b(8018,`applyTo '{0}' did not match any attached files`,c)})}}_getContext(e){let t=new Ue,n=new Ue;for(let r of e.asArray())if(yh(r))n.add(r.value);else{let e=_h.toUri(r);e&&t.add(e)}return{files:t,instructions:n}}async _addAgentInstructions(e,t,n,r){let i={logInfo:e=>this._logService.trace(`[InstructionsContextComputer] ${e}`)},a=await this._promptsService.listAgentInstructions(r,i),o=new Eh,s=new Eh;for(let{uri:e,type:r}of a){let a=Sh(e,xh.Instruction,void 0,!0);o.add(a),r===zK.copilotInstructionsMd&&s.add(a),t.agentInstructionsCount++,r===zK.claudeMd&&t.claudeMdCount++,n.debugDetails.push({category:`applying`,name:so(e).toString(),uri:e,reason:b(8019,`always added`)}),i.logInfo(`Agent instruction file added: ${e.toString()}`)}if(s.length>0){await this._addReferencedInstructions(s,t,n,r);for(let t of s.asArray())e.add(t)}for(let t of o.asArray())e.add(t)}_matches(e,t){let n=ES(t,`,`),r=t=>{if(t=t.trim(),t.length!==0){if(t===`**`||t===`**/*`||t===`*`)return{pattern:t};!t.startsWith(`/`)&&!t.startsWith(`**/`)&&(t=`**/`+t);for(let n of e)if(GS(t,n.path,{ignoreCase:!0}))return{pattern:t,file:n}}};for(let e of n){let t=r(e);if(t)return t}}_getTool(e){if(!this._enabledTools)return;let t=this._languageModelToolsService.getToolByName(e);if(t&&this._enabledTools[t.id])return{tool:t,variable:`#tool:${this._languageModelToolsService.getFullReferenceName(t)}`}}async _getCustomizationsIndex(e,t,n,r,i){let a=this._getTool(`readFile`),o=this._getTool(`runInTerminal`),s=a??o,c=this._getTool(Bb.runSubagent),l=this._getTool(`skill`),u=this._currentSessionType,d=(await this._remoteAgentService.getEnvironment())?.os,f=e=>cq(e,d),p=[];if(s){let t=this._configurationService.getValue(eq.USE_NESTED_AGENT_MD)?this._promptsService.listNestedAgentMDs(i):Promise.resolve([]);p.push(`<instructions>`),p.push(`Here is a list of instruction files that contain rules for working with this codebase.`),p.push(`These files are important for understanding the codebase structure, conventions, and best practices.`),p.push(`When an instruction file applies to your task (based on its description or applyTo pattern), follow the rules specified in it.`),p.push(`If the file content is not already included in the context, use the ${s.variable} tool to read it before proceeding. Use the exact value from the <file> element as-is with the tool; do not add or remove prefixes or otherwise modify it.`),p.push(`Only load instruction files when they are relevant to the current task. Do not eagerly load all instructions upfront.`),p.push(`When modifying or creating files, check for instructions whose applyTo pattern matches the file path and follow them.`);let n=!1;for(let t of e)IK(t.sessionTypes,u)&&(p.push(`<instruction>`),p.push(`<file>${f(t.uri)}</file>`),t.description&&p.push(`<description>${t.description}</description>`),t.pattern&&p.push(`<applyTo>${t.pattern}</applyTo>`),p.push(`</instruction>`),n=!0);let a=await t;for(let{uri:e}of a){let t=this._labelService.getUriLabel(lo(e),{relative:!0}),r=t.trim().length===0?b(8020,`Instructions for the workspace`):b(8021,`Instructions for folder '{0}'`,t);p.push(`<instruction>`),p.push(`<file>${f(e)}</file>`),p.push(`<description>${r}</description>`),p.push(`</instruction>`),n=!0}n?p.push(`</instructions>`,``,``):p.length=0;let o=await this._promptsService.findAgentSkills(i),c=this._configurationService.getValue(`github.copilot.chat.agentDebugLog.fileLogging.enabled`),d=o?.filter(e=>e.description?e.disableModelInvocation?(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:b(8023,`model invocation disabled`)}),!1):IK(e.sessionTypes,u)?!c&&e.uri.path.includes(`troubleshoot/SKILL.md`)?(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:b(8025,`debug logging disabled`)}),!1):!0:(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:b(8024,`session type not matched`)}),!1):(r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:b(8022,`no description for model invocation`)}),!1));if(d&&d.length>0){this._logSkillLoadedTelemetry(d);for(let e of d)r.debugDetails.push({category:`skill`,name:e.name,uri:e.uri,reason:e.storage});let e=this._configurationService.getValue(eq.USE_SKILL_ADHERENCE_PROMPT),t=l??s;p.push(`<skills>`),e?(p.push(`Skills provide specialized capabilities, domain knowledge, and refined workflows for producing high-quality outputs. Each skill folder contains tested instructions for specific domains like testing strategies, API design, or performance optimization. Multiple skills can be combined when a task spans different domains.`),l?p.push(`BLOCKING REQUIREMENT: When a skill applies to the user's request, you MUST invoke it IMMEDIATELY as your first action, BEFORE generating any other response or taking action on the task. Use ${l.variable} with the skill name to load the relevant skill(s).`):p.push(`BLOCKING REQUIREMENT: When a skill applies to the user's request, you MUST load and read the SKILL.md file IMMEDIATELY as your first action, BEFORE generating any other response or taking action on the task. Use ${s.variable} to load the relevant skill(s).`),p.push(`NEVER just mention or reference a skill in your response without actually loading it first. If a skill is relevant, load it before proceeding.`),p.push(`How to determine if a skill applies:`),p.push(`1. Review the available skills below and match their descriptions against the user's request`),p.push(`2. If any skill's domain overlaps with the task, load that skill immediately`),p.push(`3. When multiple skills apply (e.g., a flowchart in documentation), load all relevant skills`),p.push(`Examples:`),p.push(`- "Help me write unit tests for this module" -> Load the testing skill via ${t.variable} FIRST, then proceed`),p.push(`- "Optimize this slow function" -> Load the performance-profiling skill via ${t.variable} FIRST, then proceed`),p.push(`- "Add a discount code field to checkout" -> Load both the checkout-flow and form-validation skills FIRST`),p.push(`Available skills:`)):l?(p.push(`Here is a list of skills that contain domain specific knowledge on a variety of topics.`),p.push(`When a user asks you to perform a task that falls within the domain of a skill, use the ${l.variable} tool with the skill name to load it.`)):(p.push(`Here is a list of skills that contain domain specific knowledge on a variety of topics.`),p.push(`Each skill comes with a description of the topic and a file path that contains the detailed instructions.`),p.push(`When a user asks you to perform a task that falls within the domain of a skill, use the ${s.variable} tool to acquire the full instructions from the file URI.`));let n=0,i=d.length;for(let e=0;e<d.length;e++){let t=d[e],r=[`<skill>`,`<name>${t.name}</name>`];t.description&&r.push(`<description>${t.description}</description>`),r.push(`<file>${f(t.uri)}</file>`),r.push(`</skill>`);let a=r.join(`
|
|
141
|
+
`).length+1;if(l&&n+a>15e3){i=e;break}n+=a,p.push(...r)}if(i<d.length){let e=d.slice(i),t=[],n=0;for(let r of e){let e=(t.length>0?2:0)+r.name.length;if(n+e>5e3)break;n+=e,t.push(r.name)}let r=e.length-t.length,a=t.join(`, `);p.push(r>0?`Additional skills available (invoke by name): ${a}... and ${r} more`:`Additional skills available (invoke by name): ${a}`)}p.push(`</skills>`,``,``)}}if(c){let e=!!this._configurationService.getValue(hy.GeneralPurposeAgentEnabled),t=(()=>{if(!this._enabledSubagents||this._enabledSubagents.includes(`*`))return e=>e.visibility.agentInvocable&&IK(e.sessionTypes,u);{let e=this._enabledSubagents;return t=>e.includes(t.name)&&IK(t.sessionTypes,u)}})(),a=(await this._promptsService.getCustomAgents(i)).filter(e=>e.enabled);if(e||a.length>0){p.push(`<agents>`),p.push(`Here is a list of agents that can be used when running a subagent.`),p.push(`Each agent has optionally a description with the agent's purpose and expertise. When asked to run a subagent, choose the most appropriate agent from this list.`),p.push(`Use the ${c.variable} tool with the agent name to run the subagent.`),e&&(p.push(`<agent>`),p.push(`<name>${Sy}</name>`),p.push(`<description>Full-capability agent for complex multi-step tasks requiring high-quality reasoning. Has access to the same tools and capabilities as the current agent and inherits the parent agent's model and system prompt. Use for tasks that don't fit a more specialized agent.</description>`),p.push(`</agent>`));for(let e of a)t(e)?(p.push(`<agent>`),p.push(`<name>${e.name}</name>`),e.description&&p.push(`<description>${e.description}</description>`),e.argumentHint&&p.push(`<argumentHint>${e.argumentHint}</argumentHint>`),p.push(`</agent>`),r.debugDetails.push({category:`custom-agent`,name:e.name,uri:e.uri}),JK(e.uri)&&n.claudeAgentsCount++):r.debugDetails.push({category:`skipped`,name:e.name,uri:e.uri,reason:b(8026,`not invocable by model`)});p.push(`</agents>`,``,``)}}if(p.length===0)return;let m=p.join(`
|
|
142
|
+
`),ee=[],te=e=>{if(e){let t=m.indexOf(e.variable);for(;t>=0;)ee.push(Th(e.tool,new aq(t,t+e.variable.length))),t=m.indexOf(e.variable,t+1)}};return te(s),te(c),te(l),wh(m,!0,ee)}async _addReferencedInstructions(e,t,n,r){if(!this._configurationService.getValue(eq.INCLUDE_REFERENCED_INSTRUCTIONS)&&this._modeKind!==gy.Edit){this._logService.trace(`[InstructionsContextComputer] includeReferencedInstructions is disabled and agent kind is not Edit. No referenced instructions will be added.`);return}let i=new Ue,a=[];for(let t of e.asArray())yh(t)&&(i.has(t.value)||(a.push(t.value),i.add(t.value)));let o=a.pop();for(;o;){let s=await this._parseInstructionsFile(o,r);if(s&&s.body){let r=[];for(let e of s.body.fileReferences){let t=s.body.resolveFilePath(e.content);t&&!i.has(t)&&(QK(t)||this._workspaceService.getWorkspaceFolder(t)!==void 0)&&(r.push({resource:t}),i.add(t))}if(r.length>0){let i=await this._fileService.resolveAll(r);for(let s=0;s<i.length;s++){let c=i[s],l=r[s].resource;if(c.success&&c.stat?.isFile){QK(l)&&a.push(l);let r=b(8027,`Referenced by {0}`,so(o));e.add(Sh(l,xh.InstructionReference,r,!0)),t.referencedInstructionsCount++,n.debugDetails.push({category:`referenced`,name:so(l).toString(),uri:l,reason:r}),this._logService.trace(`[InstructionsContextComputer] ${l.toString()} added, referenced by ${o.toString()}`)}}}}o=a.pop()}}};sq=k([A(4,iq),A(5,Ns),A(6,MK),A(7,Oh),A(8,bR),A(9,qg),A(10,NK),A(11,d_),A(12,oK),A(13,oq)],sq);function cq(e,t){if(e.scheme===D.file||e.scheme===D.vscodeRemote){let n=e.fsPath;return t===void 0?n:t===Bn.Windows?n.replace(/\//g,`\\`):n.replace(/\\/g,`/`)}return e.toString()}function lq(e,t,n){let r=n.defaultChatAgent?.chatExtensionId;if(!r)return!1;let i=Ts.equals(t,r),a=e.path.includes(`/github/`);return i&&a}function uq(e,t,n){if(e.storage!==LK.extension)return!1;let r=n.defaultChatAgent?.chatExtensionId;return!r||!Ts.equals(e.extensionId,r)?!1:!lq(t,e.extensionId,n)}function dq(e){return{content:[{kind:`text`,value:e}]}}var fq;let pq=class extends v{static{fq=this}static{this.Id=`runSubagent`}constructor(e,t,n,r,i,a,o,s,c){super(),this.chatAgentService=e,this.chatService=t,this.languageModelToolsService=n,this.languageModelsService=r,this.logService=i,this.configurationService=a,this.promptsService=o,this.instantiationService=s,this.productService=c,this._onDidUpdateToolData=this._register(new x),this.onDidUpdateToolData=this._onDidUpdateToolData.event,this._resolvedModels=new Map,this._sessionDepth=new Map,this._register(ir.filter(this.configurationService.onDidChangeConfiguration,e=>e.affectsConfiguration(hy.GeneralPurposeAgentEnabled))(()=>this._onDidUpdateToolData.fire()))}getToolData(){let e=this.configurationService.getValue(hy.GeneralPurposeAgentEnabled),t={prompt:{type:`string`,description:`A detailed description of the task for the agent to perform`},description:{type:`string`,description:`A short (3-5 word) description of the task`}};t.agentName={type:`string`,description:e?`Name of the agent to invoke.`:`Optional name of a specific agent to invoke. If not provided, uses the current agent.`},t.model={type:`string`,description:`Optional model for the subagent. Format: "Model Name (Vendor)", vendor is usually "copilot". Only use to enforce a specific model.`};let n=[`prompt`,`description`];e&&n.push(`agentName`);let r={type:`object`,properties:t,required:n};return{id:fq.Id,toolReferenceName:Bb.runSubagent,icon:vl.fromId(N.organization.id),displayName:b(8354,`Run Subagent`),userDescription:b(8355,`Run a task within an isolated subagent context to enable efficient organization of tasks and context window management.`),modelDescription:`Launch a new agent to handle complex, multi-step tasks autonomously. This tool is good at researching complex questions, searching for code, and executing multi-step tasks. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use this agent to perform the search for you.
|
|
143
|
+
|
|
144
|
+
- Agents do not run async or in the background, you will wait for the agent's result.
|
|
145
|
+
- When the agent is done, it will return a single message back to you. The result returned by the agent is not visible to the user. To show the user the result, you should send a text message back to the user with a concise summary of the result.
|
|
146
|
+
- Each agent invocation is stateless. You will not be able to send additional messages to the agent, nor will the agent be able to communicate with you outside of its final report. Therefore, your prompt should contain a highly detailed task description for the agent to perform autonomously and you should specify exactly what information the agent should return back to you in its final and only message to you.
|
|
147
|
+
- The agent's outputs should generally be trusted
|
|
148
|
+
- Clearly tell the agent whether you expect it to write code or just to do research (search, file reads, web fetches, etc.), since it is not aware of the user's intent
|
|
149
|
+
- If the user asks for a certain agent, you MUST provide that EXACT agent name (case-sensitive) to invoke that specific agent.`,source:Fb.Internal,inputSchema:r}}async invoke(e,t,n,r){let i=e.parameters;if(this.logService.debug(`RunSubagentTool: Invoking with prompt: ${i.prompt.substring(0,100)}...`),!e.context)throw Error(`toolInvocationToken is required for this tool`);let a=this.chatService.getSession(e.context.sessionResource);if(!a)throw Error(`Chat model not found for session`);let o=a.getRequests().at(-1),s=new _;try{let t=this.chatAgentService.getDefaultAgent(xy.Chat,gy.Agent);if(!t)return dq(`Error: No default agent available`);let n=e.modelId,c=e.userSelectedTools,l,u,d,f=i.agentName,p=this.configurationService.getValue(hy.GeneralPurposeAgentEnabled),m=p&&(!f||f===`General Purpose`),ee=m?Sy:f;if(f&&!m)if(u=await this.getSubAgentByName(f),u){let t=this._resolvedModels.get(e.callId);if(t)this._resolvedModels.delete(e.callId),n=t.modeModelId,d=t.resolvedModelName;else{let t=this.resolveSubagentModel(u,e.modelId,i.model);n=t.modeModelId,d=t.resolvedModelName}let r=u.tools;if(r){let e=this.languageModelToolsService.toToolAndToolSetEnablementMap(r,void 0);c={};for(let[t,n]of e)Rb(t)||(c[t.id]=n)}let a=u.agentInstructions;l=a&&{name:f,content:a.content,toolReferences:this.languageModelToolsService.toToolReferences(a.toolReferences),metadata:a.metadata,isBuiltin:uq(u.source,u.uri,this.productService)}}else throw this._resolvedModels.delete(e.callId),Error(`Requested agent '${f}' not found. Try again with the correct agent name, or omit agentName to use the current agent.${p?` Additionally, you can use '${Sy}' for a full-capability agent.`:``}`);else{let t=this._resolvedModels.get(e.callId);if(t)this._resolvedModels.delete(e.callId),n=t.modeModelId,d=t.resolvedModelName;else{let t=this.resolveSubagentModel(void 0,e.modelId,i.model);n=t.modeModelId,d=t.resolvedModelName}}let te=[],ne=e.chatStreamToolCallId??e.callId??`subagent-${Gc()}`,h=!1,re=e=>{for(let t of e)t.kind===`textEdit`||t.kind===`notebookEdit`||t.kind===`codeblockUri`?(t.kind===`codeblockUri`&&!h&&(h=!0,a.acceptResponseProgress(o,{kind:`markdownContent`,content:new Cl("```\n")})),t.kind===`codeblockUri`?a.acceptResponseProgress(o,{...t,subAgentInvocationId:ne}):a.acceptResponseProgress(o,t)):t.kind===`hook`?a.acceptResponseProgress(o,{...t,subAgentInvocationId:ne}):t.kind===`markdownContent`&&(h&&=(a.acceptResponseProgress(o,{kind:`markdownContent`,content:new Cl(`
|
|
150
|
+
\`\`\`
|
|
151
|
+
|
|
152
|
+
`)}),!1),te.push(t.content.value))},ie=this.configurationService.getValue(hy.SubagentsAllowInvocationsFromSubagents)??!1,ae=ie?5:0,oe=e.context.sessionResource.toString(),se=this._sessionDepth.get(oe)??0,ce=se+1<=ae;c||={},c[fq.Id]!==!1&&(c[fq.Id]=ce),c[CK]=!1,c.copilot_askQuestions=!1,ae>0&&this.logService.debug(`RunSubagentTool: Nested subagents enabling ${c[fq.Id]}: session ${oe}, currentDepth: ${se}, maxDepth: ${ae}, allowInvocationsFromSubagents: ${ie}`);let le=new Eh;await this.instantiationService.createInstance(sq,gy.Agent,c,void 0,ph(e.context.sessionResource)).collect(le,r);let ue;try{ue=(await this.promptsService.getHooks(r))?.hooks}catch(e){this.logService.warn(`[ChatService] Failed to collect hooks:`,e)}if(u?.hooks){let e={...u.hooks};if(e[Cb.Stop]){let t=e[Cb.Stop];e[Cb.SubagentStop]=e[Cb.SubagentStop]?[...e[Cb.SubagentStop],...t]:t,e[Cb.Stop]=void 0}ue=Db(ue,e)}let de={sessionResource:e.context.sessionResource,requestId:e.callId??`subagent-${Date.now()}`,agentId:t.id,message:i.prompt,variables:{variables:le.asArray()},location:xy.Chat,subAgentInvocationId:ne,subAgentName:ee,userSelectedModelId:n,modelConfiguration:n?this.languageModelsService.getModelConfiguration(n):void 0,userSelectedTools:c,modeInstructions:l,parentRequestId:e.chatRequestId,hooks:ue,hasHooksEnabled:!!ue&&Object.values(ue).some(e=>e&&e.length>0)};s.add(this.languageModelToolsService.onDidInvokeTool(e=>{e.subagentInvocationId===ne&&(te.length=0)})),this._sessionDepth.set(oe,se+1);let fe;try{fe=await this.chatAgentService.invokeAgent(t.id,de,re,[],r)}finally{let e=(this._sessionDepth.get(oe)??1)-1;e<=0?this._sessionDepth.delete(oe):this._sessionDepth.set(oe,e)}if(fe?.errorDetails)return dq(`Agent error: ${fe.errorDetails.message}`);let pe=te.join(``).replace(/^\n*```\n+```\n*/g,``).trim()||`Agent completed with no output`;return e.toolSpecificData?.kind===`subagent`&&(e.toolSpecificData.result=pe,e.toolSpecificData.modelName=d),{content:[{kind:`text`,value:pe}],toolMetadata:{subAgentInvocationId:ne,description:i.description,agentName:de.subAgentName,modelName:d}}}catch(e){let t=`Error invoking subagent: ${e instanceof Error?e.message:`Unknown error`}`;return this.logService.error(t,e),dq(t)}finally{s.dispose()}}async getSubAgentByName(e){return(await this.promptsService.getCustomAgents(Bi.None)).find(t=>t.name===e&&t.enabled)}checkMultiplierConstraint(e,t){if(!t||e===t)return{exceeds:!1};let n=this.languageModelsService.lookupLanguageModel(t),r=this.languageModelsService.lookupLanguageModel(e),i=n?.multiplierNumeric,a=r?.multiplierNumeric;return i!==void 0&&a!==void 0&&a>i?{exceeds:!0,reason:`exceeds the current model's cost tier (${a}x vs ${i}x)`}:{exceeds:!1}}getAvailableModelsInfo(e){let t=this.languageModelsService.getLanguageModelIds().map(e=>({id:e,metadata:this.languageModelsService.lookupLanguageModel(e)})).filter(e=>!!e.metadata&&kx.suitableForAgentMode(e.metadata)&&e.metadata.isUserSelectable!==!1&&!e.metadata.targetChatSessionType);if(t.length===0)return`No models available.`;let n=[],r=[];for(let{id:i,metadata:a}of t){let t=kx.asQualifiedName(a);this.checkMultiplierConstraint(i,e).exceeds?r.push(t):n.push(t)}let i=[];return n.length>0&&i.push(`Available models: ${n.join(`, `)}`),r.length>0&&i.push(`Unavailable (exceeds current model's cost tier): ${r.join(`, `)}`),i.join(`. `)||`No models available.`}resolveSubagentModel(e,t,n){let r=t,i=!1;if(n){let e=this.languageModelsService.lookupLanguageModelByQualifiedName(n);if(e?.identifier)r=e.identifier,i=!0;else throw Error(`Requested model '${n}' not found. ${this.getAvailableModelsInfo(t)}`)}if(e&&!i){let t=e.model;if(t)for(let e of t){let t=this.languageModelsService.lookupLanguageModelByQualifiedName(e);if(t?.identifier){r=t.identifier;break}}}if(r){let e=this.checkMultiplierConstraint(r,t);if(e.exceeds){let n=this.languageModelsService.lookupLanguageModel(r);throw Error(`Requested model '${n?.name}' ${e.reason}. ${this.getAvailableModelsInfo(t)}`)}}let a=r?this.languageModelsService.lookupLanguageModel(r):void 0;return{modeModelId:r,resolvedModelName:a?.name}}async prepareToolInvocation(e,t){let n=e.parameters,r=this.configurationService.getValue(hy.GeneralPurposeAgentEnabled)&&(!n.agentName||n.agentName===`General Purpose`),i=n.agentName&&!r?await this.getSubAgentByName(n.agentName):void 0,a=this.resolveSubagentModel(i,e.modelId,n.model);return this._resolvedModels.set(e.toolCallId,a),{invocationMessage:n.description,toolSpecificData:{kind:`subagent`,description:n.description,agentName:r?Sy:i?.name??n.agentName,prompt:n.prompt,modelName:a.resolvedModelName}}}};pq=fq=k([A(0,jK),A(1,nK),A(2,oK),A(3,AK),A(4,Ns),A(5,Oh),A(6,iq),A(7,As),A(8,Xh)],pq);const mq=O(`chatArtifactsService`),hq={id:`setArtifacts`,toolReferenceName:`artifacts`,legacyToolReferenceFullNames:[`Set Session Artifacts`],displayName:b(8359,`Set Session Artifacts`),modelDescription:`Set the list of artifacts for the current session. Each artifact has a label and either a uri or a toolCallId+dataPartIndex reference, plus an optional type (devServer, screenshot, plan). This overwrites the entire artifact list. URIs must be fully qualified with a scheme (e.g. https://localhost:3000, file:///tmp/plan.md). To reference a screenshot or image from a previous tool result, use toolCallId and dataPartIndex instead of uri.
|
|
153
|
+
|
|
154
|
+
When to use this tool:
|
|
155
|
+
- When creating or updating a plan saved to session memory — set a plan artifact so the user can view it in the artifact panel
|
|
156
|
+
- When taking screenshots or producing visual output — set a screenshot artifact to surface the image
|
|
157
|
+
- When starting a dev server — set a devServer artifact with the URL so the user can access it
|
|
158
|
+
- When producing important documents, drafts, or temporary markdown files — set an artifact to make them easily accessible
|
|
159
|
+
- After verification steps that produce visual results — update artifacts with screenshots showing the outcome
|
|
160
|
+
|
|
161
|
+
Workflow:
|
|
162
|
+
- Prefer artifacts over printing long content inline in chat. Save content to a file or memory, then set an artifact pointing to it.
|
|
163
|
+
- When updating plans or documents, update both the underlying file AND the artifact list.
|
|
164
|
+
- Keep artifact labels concise and descriptive.`,canBeReferencedInPrompt:!0,source:Fb.Internal,inputSchema:{type:`object`,properties:{artifacts:{type:`array`,description:`The complete list of artifacts for this session. Overwrites any existing artifacts.`,items:{type:`object`,properties:{label:{type:`string`,description:`Display label for the artifact.`},uri:{type:`string`,description:`Fully qualified URI of the artifact (e.g. https://localhost:3000 or file:///path/to/file). Must include the scheme.`},type:{type:`string`,enum:[`devServer`,`screenshot`,`plan`],description:`The type of artifact.`}},required:[`label`]}}},required:[`artifacts`]}};let gq=class{constructor(e,t,n){this._chatArtifactsService=e,this._fileService=t,this._chatService=n}async prepareToolInvocation(e,t){return{pastTenseMessage:new Cl(b(8360,`Updated session artifacts`)),presentation:Lb.Hidden}}async invoke(e,t,n,r){let i=e.parameters,a=e.context?.sessionResource;if(!a)return{content:[{kind:`text`,value:`Error: No session resource available`}]};let o=[];for(let e of i.artifacts??[]){let t=e.uri;if(t||=``,t){let e=C.parse(t);if(e.scheme!==`http`&&e.scheme!==`https`&&!await this._fileService.exists(e))throw Error(b(8361,`Artifact URI does not exist: {0}`,t))}o.push({label:e.label,uri:t,type:e.type})}let s=this._chatArtifactsService.getArtifacts(a),c=e.subAgentInvocationId;if(c){let e=this._resolveSubagentName(a,c);s.setSubagentArtifacts(c,e,o)}else s.setAgentArtifacts(o);return{content:[{kind:`text`,value:b(8362,`Set {0} artifact(s)`,o.length)}]}}_resolveSubagentName(e,t){let n=this._chatService.getSession(e);if(n)for(let e of n.getRequests()){let n=e.response;if(n){for(let e of n.response.value)if((e.kind===`toolInvocation`||e.kind===`toolInvocationSerialized`)&&e.toolCallId===t&&e.toolSpecificData?.kind===`subagent`)return e.toolSpecificData.agentName}}}};gq=k([A(0,mq),A(1,qg),A(2,nK)],gq);const _q={type:`object`,properties:{groupName:{type:`string`,description:`Display name for the artifact group.`},onlyShowGroup:{type:`boolean`,description:`When true, show only the group header instead of individual items.`}},required:[`groupName`]},vq={type:`object`,properties:{byMimeType:{type:`object`,description:`Rules for extracting artifacts from tool results by MIME type. Maps MIME type patterns (e.g. 'image/*') to group configuration.`,additionalProperties:_q},byFilePath:{type:`object`,description:`Rules for extracting artifacts from written files by file path glob pattern. Maps glob patterns (e.g. '**/*plan*.md') to group configuration.`,additionalProperties:_q},byMemoryFilePath:{type:`object`,description:`Rules for extracting artifacts from memory tool writes by memory file path glob pattern. Maps glob patterns to group configuration.`,additionalProperties:_q}}},yq={id:`setArtifactRules`,toolReferenceName:`artifactRules`,legacyToolReferenceFullNames:[],displayName:b(8356,`Set Artifact Rules`),modelDescription:`Override the artifact extraction rules for this session. Rules control which tool results, files, and memory writes are automatically surfaced as artifacts.
|
|
165
|
+
|
|
166
|
+
Provide rules as MIME type patterns, file path globs, or memory file path globs, each mapped to a group configuration with a groupName and optional onlyShowGroup flag.
|
|
167
|
+
|
|
168
|
+
Examples:
|
|
169
|
+
- byMimeType: { "image/*": { "groupName": "Screenshots", "onlyShowGroup": true } }
|
|
170
|
+
- byFilePath: { "**/*plan*.md": { "groupName": "Plans" } }
|
|
171
|
+
- byMemoryFilePath: { "**/*plan*.md": { "groupName": "Plans" } }
|
|
172
|
+
|
|
173
|
+
This fully replaces any settings-based rules for the duration of this session.`,canBeReferencedInPrompt:!0,source:Fb.Internal,inputSchema:vq};let bq=class{constructor(e){this._chatArtifactsService=e}async prepareToolInvocation(e,t){return{pastTenseMessage:new Cl(b(8357,`Updated artifact rules`)),presentation:Lb.Hidden}}async invoke(e,t,n,r){let i=e.parameters,a=e.context?.sessionResource;if(!a)return{content:[{kind:`text`,value:`Error: No session resource available`}]};let o={byMimeType:i.byMimeType,byFilePath:i.byFilePath,byMemoryFilePath:i.byMemoryFilePath};return this._chatArtifactsService.getArtifacts(a).setRuleOverrides(o),{content:[{kind:`text`,value:b(8358,`Updated artifact rules`)}]}}};bq=k([A(0,mq)],bq);const xq={id:`task_complete`,displayName:`Task Complete`,modelDescription:`Signal that the user's task is fully done. You MUST call this tool when your work is complete — whether you made code changes, answered a question, or completed any other kind of task. Provide a brief summary of what was accomplished. Do not restate the summary in your message text — it is shown to the user directly.
|
|
174
|
+
|
|
175
|
+
IMPORTANT: Before calling this tool, you MUST output a brief text message summarizing what was done. The task is not complete until both your summary message AND this tool call are present.
|
|
176
|
+
|
|
177
|
+
When to call:
|
|
178
|
+
- After answering the user's question or completing a conversational request
|
|
179
|
+
- After you have completed ALL requested changes
|
|
180
|
+
- After verifying results: tests pass, terminal commands succeeded, tool calls returned expected output
|
|
181
|
+
|
|
182
|
+
When NOT to call:
|
|
183
|
+
- If a terminal command failed or produced unexpected output
|
|
184
|
+
- If an MCP or external tool call returned an error
|
|
185
|
+
- If you encountered errors you have not resolved
|
|
186
|
+
- If there are remaining steps to complete
|
|
187
|
+
- If you have not verified your changes work`,source:Fb.Internal,inputSchema:{type:`object`,properties:{summary:{type:`string`,description:`Brief summary of what was accomplished. Omit for trivial interactions.`}}}};var Sq=class{async prepareToolInvocation(e,t){return{presentation:Lb.Hidden}}async invoke(e,t,n,r){return{content:[{kind:`text`,value:e.parameters?.summary??`All done!`}]}}};let Cq=class extends v{static{this.ID=`chat.builtinTools`}constructor(e,t,n){super();let r=t.createInstance(aK);this._register(e.registerTool(iK,r));let i=this._register(t.createInstance(gK));this._register(e.registerTool(hK,i)),this._register(e.vscodeToolSet.addTool(hK));let a=this._register(t.createInstance(kK));this._register(e.registerTool(OK,a));let o=wK(),s=this._register(t.createInstance(TK));this._register(e.registerTool(o,s));let c=t.createInstance(bK);this._register(e.registerTool(_K,c)),this._register(e.registerTool(vK,c));let l=t.createInstance(xK);this._register(e.registerTool(yK,l));let u=t.createInstance(Sq);this._register(e.registerTool(xq,u));let d=t.createInstance(gq),f=t.createInstance(bq),p=this._register(new wt),m=this._register(new wt),ee=()=>{n.getValue(hy.ArtifactsEnabled)?(p.value||=e.registerTool(hq,d),m.value||=e.registerTool(yq,f)):(p.clear(),m.clear())};ee(),this._register(n.onDidChangeConfiguration(e=>{e.affectsConfiguration(hy.ArtifactsEnabled)&&ee()}));let te=this._register(t.createInstance(pq)),ne,h,re=()=>{ne?.dispose(),h?.dispose(),e.flushToolUpdates();let t=te.getToolData();ne=e.registerTool(t,te),h=e.agentToolSet.addTool(t)};re(),this._register(te.onDidUpdateToolData(re)),this._register({dispose:()=>{ne?.dispose(),h?.dispose()}})}};Cq=k([A(0,oK),A(1,As),A(2,Oh)],Cq);const wq=O(`commandService`),Tq=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new x,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw Error(`invalid command`);if(typeof e==`string`){if(!t)throw Error(`invalid command`);return this.registerCommand({id:e,handler:t})}if(e.metadata&&Array.isArray(e.metadata.args)){let t=[];for(let n of e.metadata.args)t.push(n.constraint);let n=e.handler;e.handler=function(e,...r){return ht(r,t),n(e,...r)}}let{id:n}=e,r=this._commands.get(n);r||(r=new nn,this._commands.set(n,r));let i=r.unshift(e),a=g(()=>{i(),this._commands.get(n)?.isEmpty()&&this._commands.delete(n)});return this._onDidRegisterCommand.fire(n),yt(a)}registerCommandAlias(e,t){return Tq.registerCommand(e,(e,...n)=>e.get(wq).executeCommand(t,...n))}getCommand(e){let t=this._commands.get(e);if(!(!t||t.isEmpty()))return vt.first(t)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let n=this.getCommand(t);n&&e.set(t,n)}return e}};Tq.registerCommand(`noop`,()=>{});var Z;(function(e){e[e.DependsOnKbLayout=-1]=`DependsOnKbLayout`,e[e.Unknown=0]=`Unknown`,e[e.Backspace=1]=`Backspace`,e[e.Tab=2]=`Tab`,e[e.Enter=3]=`Enter`,e[e.Shift=4]=`Shift`,e[e.Ctrl=5]=`Ctrl`,e[e.Alt=6]=`Alt`,e[e.PauseBreak=7]=`PauseBreak`,e[e.CapsLock=8]=`CapsLock`,e[e.Escape=9]=`Escape`,e[e.Space=10]=`Space`,e[e.PageUp=11]=`PageUp`,e[e.PageDown=12]=`PageDown`,e[e.End=13]=`End`,e[e.Home=14]=`Home`,e[e.LeftArrow=15]=`LeftArrow`,e[e.UpArrow=16]=`UpArrow`,e[e.RightArrow=17]=`RightArrow`,e[e.DownArrow=18]=`DownArrow`,e[e.Insert=19]=`Insert`,e[e.Delete=20]=`Delete`,e[e.Digit0=21]=`Digit0`,e[e.Digit1=22]=`Digit1`,e[e.Digit2=23]=`Digit2`,e[e.Digit3=24]=`Digit3`,e[e.Digit4=25]=`Digit4`,e[e.Digit5=26]=`Digit5`,e[e.Digit6=27]=`Digit6`,e[e.Digit7=28]=`Digit7`,e[e.Digit8=29]=`Digit8`,e[e.Digit9=30]=`Digit9`,e[e.KeyA=31]=`KeyA`,e[e.KeyB=32]=`KeyB`,e[e.KeyC=33]=`KeyC`,e[e.KeyD=34]=`KeyD`,e[e.KeyE=35]=`KeyE`,e[e.KeyF=36]=`KeyF`,e[e.KeyG=37]=`KeyG`,e[e.KeyH=38]=`KeyH`,e[e.KeyI=39]=`KeyI`,e[e.KeyJ=40]=`KeyJ`,e[e.KeyK=41]=`KeyK`,e[e.KeyL=42]=`KeyL`,e[e.KeyM=43]=`KeyM`,e[e.KeyN=44]=`KeyN`,e[e.KeyO=45]=`KeyO`,e[e.KeyP=46]=`KeyP`,e[e.KeyQ=47]=`KeyQ`,e[e.KeyR=48]=`KeyR`,e[e.KeyS=49]=`KeyS`,e[e.KeyT=50]=`KeyT`,e[e.KeyU=51]=`KeyU`,e[e.KeyV=52]=`KeyV`,e[e.KeyW=53]=`KeyW`,e[e.KeyX=54]=`KeyX`,e[e.KeyY=55]=`KeyY`,e[e.KeyZ=56]=`KeyZ`,e[e.Meta=57]=`Meta`,e[e.ContextMenu=58]=`ContextMenu`,e[e.F1=59]=`F1`,e[e.F2=60]=`F2`,e[e.F3=61]=`F3`,e[e.F4=62]=`F4`,e[e.F5=63]=`F5`,e[e.F6=64]=`F6`,e[e.F7=65]=`F7`,e[e.F8=66]=`F8`,e[e.F9=67]=`F9`,e[e.F10=68]=`F10`,e[e.F11=69]=`F11`,e[e.F12=70]=`F12`,e[e.F13=71]=`F13`,e[e.F14=72]=`F14`,e[e.F15=73]=`F15`,e[e.F16=74]=`F16`,e[e.F17=75]=`F17`,e[e.F18=76]=`F18`,e[e.F19=77]=`F19`,e[e.F20=78]=`F20`,e[e.F21=79]=`F21`,e[e.F22=80]=`F22`,e[e.F23=81]=`F23`,e[e.F24=82]=`F24`,e[e.NumLock=83]=`NumLock`,e[e.ScrollLock=84]=`ScrollLock`,e[e.Semicolon=85]=`Semicolon`,e[e.Equal=86]=`Equal`,e[e.Comma=87]=`Comma`,e[e.Minus=88]=`Minus`,e[e.Period=89]=`Period`,e[e.Slash=90]=`Slash`,e[e.Backquote=91]=`Backquote`,e[e.BracketLeft=92]=`BracketLeft`,e[e.Backslash=93]=`Backslash`,e[e.BracketRight=94]=`BracketRight`,e[e.Quote=95]=`Quote`,e[e.OEM_8=96]=`OEM_8`,e[e.IntlBackslash=97]=`IntlBackslash`,e[e.Numpad0=98]=`Numpad0`,e[e.Numpad1=99]=`Numpad1`,e[e.Numpad2=100]=`Numpad2`,e[e.Numpad3=101]=`Numpad3`,e[e.Numpad4=102]=`Numpad4`,e[e.Numpad5=103]=`Numpad5`,e[e.Numpad6=104]=`Numpad6`,e[e.Numpad7=105]=`Numpad7`,e[e.Numpad8=106]=`Numpad8`,e[e.Numpad9=107]=`Numpad9`,e[e.NumpadMultiply=108]=`NumpadMultiply`,e[e.NumpadAdd=109]=`NumpadAdd`,e[e.NUMPAD_SEPARATOR=110]=`NUMPAD_SEPARATOR`,e[e.NumpadSubtract=111]=`NumpadSubtract`,e[e.NumpadDecimal=112]=`NumpadDecimal`,e[e.NumpadDivide=113]=`NumpadDivide`,e[e.KEY_IN_COMPOSITION=114]=`KEY_IN_COMPOSITION`,e[e.ABNT_C1=115]=`ABNT_C1`,e[e.ABNT_C2=116]=`ABNT_C2`,e[e.AudioVolumeMute=117]=`AudioVolumeMute`,e[e.AudioVolumeUp=118]=`AudioVolumeUp`,e[e.AudioVolumeDown=119]=`AudioVolumeDown`,e[e.BrowserSearch=120]=`BrowserSearch`,e[e.BrowserHome=121]=`BrowserHome`,e[e.BrowserBack=122]=`BrowserBack`,e[e.BrowserForward=123]=`BrowserForward`,e[e.MediaTrackNext=124]=`MediaTrackNext`,e[e.MediaTrackPrevious=125]=`MediaTrackPrevious`,e[e.MediaStop=126]=`MediaStop`,e[e.MediaPlayPause=127]=`MediaPlayPause`,e[e.LaunchMediaPlayer=128]=`LaunchMediaPlayer`,e[e.LaunchMail=129]=`LaunchMail`,e[e.LaunchApp2=130]=`LaunchApp2`,e[e.Clear=131]=`Clear`,e[e.MAX_VALUE=132]=`MAX_VALUE`})(Z||={});var Q;(function(e){e[e.DependsOnKbLayout=-1]=`DependsOnKbLayout`,e[e.None=0]=`None`,e[e.Hyper=1]=`Hyper`,e[e.Super=2]=`Super`,e[e.Fn=3]=`Fn`,e[e.FnLock=4]=`FnLock`,e[e.Suspend=5]=`Suspend`,e[e.Resume=6]=`Resume`,e[e.Turbo=7]=`Turbo`,e[e.Sleep=8]=`Sleep`,e[e.WakeUp=9]=`WakeUp`,e[e.KeyA=10]=`KeyA`,e[e.KeyB=11]=`KeyB`,e[e.KeyC=12]=`KeyC`,e[e.KeyD=13]=`KeyD`,e[e.KeyE=14]=`KeyE`,e[e.KeyF=15]=`KeyF`,e[e.KeyG=16]=`KeyG`,e[e.KeyH=17]=`KeyH`,e[e.KeyI=18]=`KeyI`,e[e.KeyJ=19]=`KeyJ`,e[e.KeyK=20]=`KeyK`,e[e.KeyL=21]=`KeyL`,e[e.KeyM=22]=`KeyM`,e[e.KeyN=23]=`KeyN`,e[e.KeyO=24]=`KeyO`,e[e.KeyP=25]=`KeyP`,e[e.KeyQ=26]=`KeyQ`,e[e.KeyR=27]=`KeyR`,e[e.KeyS=28]=`KeyS`,e[e.KeyT=29]=`KeyT`,e[e.KeyU=30]=`KeyU`,e[e.KeyV=31]=`KeyV`,e[e.KeyW=32]=`KeyW`,e[e.KeyX=33]=`KeyX`,e[e.KeyY=34]=`KeyY`,e[e.KeyZ=35]=`KeyZ`,e[e.Digit1=36]=`Digit1`,e[e.Digit2=37]=`Digit2`,e[e.Digit3=38]=`Digit3`,e[e.Digit4=39]=`Digit4`,e[e.Digit5=40]=`Digit5`,e[e.Digit6=41]=`Digit6`,e[e.Digit7=42]=`Digit7`,e[e.Digit8=43]=`Digit8`,e[e.Digit9=44]=`Digit9`,e[e.Digit0=45]=`Digit0`,e[e.Enter=46]=`Enter`,e[e.Escape=47]=`Escape`,e[e.Backspace=48]=`Backspace`,e[e.Tab=49]=`Tab`,e[e.Space=50]=`Space`,e[e.Minus=51]=`Minus`,e[e.Equal=52]=`Equal`,e[e.BracketLeft=53]=`BracketLeft`,e[e.BracketRight=54]=`BracketRight`,e[e.Backslash=55]=`Backslash`,e[e.IntlHash=56]=`IntlHash`,e[e.Semicolon=57]=`Semicolon`,e[e.Quote=58]=`Quote`,e[e.Backquote=59]=`Backquote`,e[e.Comma=60]=`Comma`,e[e.Period=61]=`Period`,e[e.Slash=62]=`Slash`,e[e.CapsLock=63]=`CapsLock`,e[e.F1=64]=`F1`,e[e.F2=65]=`F2`,e[e.F3=66]=`F3`,e[e.F4=67]=`F4`,e[e.F5=68]=`F5`,e[e.F6=69]=`F6`,e[e.F7=70]=`F7`,e[e.F8=71]=`F8`,e[e.F9=72]=`F9`,e[e.F10=73]=`F10`,e[e.F11=74]=`F11`,e[e.F12=75]=`F12`,e[e.PrintScreen=76]=`PrintScreen`,e[e.ScrollLock=77]=`ScrollLock`,e[e.Pause=78]=`Pause`,e[e.Insert=79]=`Insert`,e[e.Home=80]=`Home`,e[e.PageUp=81]=`PageUp`,e[e.Delete=82]=`Delete`,e[e.End=83]=`End`,e[e.PageDown=84]=`PageDown`,e[e.ArrowRight=85]=`ArrowRight`,e[e.ArrowLeft=86]=`ArrowLeft`,e[e.ArrowDown=87]=`ArrowDown`,e[e.ArrowUp=88]=`ArrowUp`,e[e.NumLock=89]=`NumLock`,e[e.NumpadDivide=90]=`NumpadDivide`,e[e.NumpadMultiply=91]=`NumpadMultiply`,e[e.NumpadSubtract=92]=`NumpadSubtract`,e[e.NumpadAdd=93]=`NumpadAdd`,e[e.NumpadEnter=94]=`NumpadEnter`,e[e.Numpad1=95]=`Numpad1`,e[e.Numpad2=96]=`Numpad2`,e[e.Numpad3=97]=`Numpad3`,e[e.Numpad4=98]=`Numpad4`,e[e.Numpad5=99]=`Numpad5`,e[e.Numpad6=100]=`Numpad6`,e[e.Numpad7=101]=`Numpad7`,e[e.Numpad8=102]=`Numpad8`,e[e.Numpad9=103]=`Numpad9`,e[e.Numpad0=104]=`Numpad0`,e[e.NumpadDecimal=105]=`NumpadDecimal`,e[e.IntlBackslash=106]=`IntlBackslash`,e[e.ContextMenu=107]=`ContextMenu`,e[e.Power=108]=`Power`,e[e.NumpadEqual=109]=`NumpadEqual`,e[e.F13=110]=`F13`,e[e.F14=111]=`F14`,e[e.F15=112]=`F15`,e[e.F16=113]=`F16`,e[e.F17=114]=`F17`,e[e.F18=115]=`F18`,e[e.F19=116]=`F19`,e[e.F20=117]=`F20`,e[e.F21=118]=`F21`,e[e.F22=119]=`F22`,e[e.F23=120]=`F23`,e[e.F24=121]=`F24`,e[e.Open=122]=`Open`,e[e.Help=123]=`Help`,e[e.Select=124]=`Select`,e[e.Again=125]=`Again`,e[e.Undo=126]=`Undo`,e[e.Cut=127]=`Cut`,e[e.Copy=128]=`Copy`,e[e.Paste=129]=`Paste`,e[e.Find=130]=`Find`,e[e.AudioVolumeMute=131]=`AudioVolumeMute`,e[e.AudioVolumeUp=132]=`AudioVolumeUp`,e[e.AudioVolumeDown=133]=`AudioVolumeDown`,e[e.NumpadComma=134]=`NumpadComma`,e[e.IntlRo=135]=`IntlRo`,e[e.KanaMode=136]=`KanaMode`,e[e.IntlYen=137]=`IntlYen`,e[e.Convert=138]=`Convert`,e[e.NonConvert=139]=`NonConvert`,e[e.Lang1=140]=`Lang1`,e[e.Lang2=141]=`Lang2`,e[e.Lang3=142]=`Lang3`,e[e.Lang4=143]=`Lang4`,e[e.Lang5=144]=`Lang5`,e[e.Abort=145]=`Abort`,e[e.Props=146]=`Props`,e[e.NumpadParenLeft=147]=`NumpadParenLeft`,e[e.NumpadParenRight=148]=`NumpadParenRight`,e[e.NumpadBackspace=149]=`NumpadBackspace`,e[e.NumpadMemoryStore=150]=`NumpadMemoryStore`,e[e.NumpadMemoryRecall=151]=`NumpadMemoryRecall`,e[e.NumpadMemoryClear=152]=`NumpadMemoryClear`,e[e.NumpadMemoryAdd=153]=`NumpadMemoryAdd`,e[e.NumpadMemorySubtract=154]=`NumpadMemorySubtract`,e[e.NumpadClear=155]=`NumpadClear`,e[e.NumpadClearEntry=156]=`NumpadClearEntry`,e[e.ControlLeft=157]=`ControlLeft`,e[e.ShiftLeft=158]=`ShiftLeft`,e[e.AltLeft=159]=`AltLeft`,e[e.MetaLeft=160]=`MetaLeft`,e[e.ControlRight=161]=`ControlRight`,e[e.ShiftRight=162]=`ShiftRight`,e[e.AltRight=163]=`AltRight`,e[e.MetaRight=164]=`MetaRight`,e[e.BrightnessUp=165]=`BrightnessUp`,e[e.BrightnessDown=166]=`BrightnessDown`,e[e.MediaPlay=167]=`MediaPlay`,e[e.MediaRecord=168]=`MediaRecord`,e[e.MediaFastForward=169]=`MediaFastForward`,e[e.MediaRewind=170]=`MediaRewind`,e[e.MediaTrackNext=171]=`MediaTrackNext`,e[e.MediaTrackPrevious=172]=`MediaTrackPrevious`,e[e.MediaStop=173]=`MediaStop`,e[e.Eject=174]=`Eject`,e[e.MediaPlayPause=175]=`MediaPlayPause`,e[e.MediaSelect=176]=`MediaSelect`,e[e.LaunchMail=177]=`LaunchMail`,e[e.LaunchApp2=178]=`LaunchApp2`,e[e.LaunchApp1=179]=`LaunchApp1`,e[e.SelectTask=180]=`SelectTask`,e[e.LaunchScreenSaver=181]=`LaunchScreenSaver`,e[e.BrowserSearch=182]=`BrowserSearch`,e[e.BrowserHome=183]=`BrowserHome`,e[e.BrowserBack=184]=`BrowserBack`,e[e.BrowserForward=185]=`BrowserForward`,e[e.BrowserStop=186]=`BrowserStop`,e[e.BrowserRefresh=187]=`BrowserRefresh`,e[e.BrowserFavorites=188]=`BrowserFavorites`,e[e.ZoomToggle=189]=`ZoomToggle`,e[e.MailReply=190]=`MailReply`,e[e.MailForward=191]=`MailForward`,e[e.MailSend=192]=`MailSend`,e[e.MAX_VALUE=193]=`MAX_VALUE`})(Q||={});var Eq=class{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()]||Z.Unknown}};const Dq=new Eq,Oq=new Eq,kq=new Eq,Aq=Array(230),jq={},Mq=[],Nq=Object.create(null),Pq=Object.create(null),Fq=[],Iq=[];for(let e=0;e<=Q.MAX_VALUE;e++)Fq[e]=Z.DependsOnKbLayout;for(let e=0;e<=Z.MAX_VALUE;e++)Iq[e]=Q.DependsOnKbLayout;(function(){let e=[[1,Q.None,`None`,Z.Unknown,`unknown`,0,`VK_UNKNOWN`,``,``],[1,Q.Hyper,`Hyper`,Z.Unknown,``,0,``,``,``],[1,Q.Super,`Super`,Z.Unknown,``,0,``,``,``],[1,Q.Fn,`Fn`,Z.Unknown,``,0,``,``,``],[1,Q.FnLock,`FnLock`,Z.Unknown,``,0,``,``,``],[1,Q.Suspend,`Suspend`,Z.Unknown,``,0,``,``,``],[1,Q.Resume,`Resume`,Z.Unknown,``,0,``,``,``],[1,Q.Turbo,`Turbo`,Z.Unknown,``,0,``,``,``],[1,Q.Sleep,`Sleep`,Z.Unknown,``,0,`VK_SLEEP`,``,``],[1,Q.WakeUp,`WakeUp`,Z.Unknown,``,0,``,``,``],[0,Q.KeyA,`KeyA`,Z.KeyA,`A`,65,`VK_A`,``,``],[0,Q.KeyB,`KeyB`,Z.KeyB,`B`,66,`VK_B`,``,``],[0,Q.KeyC,`KeyC`,Z.KeyC,`C`,67,`VK_C`,``,``],[0,Q.KeyD,`KeyD`,Z.KeyD,`D`,68,`VK_D`,``,``],[0,Q.KeyE,`KeyE`,Z.KeyE,`E`,69,`VK_E`,``,``],[0,Q.KeyF,`KeyF`,Z.KeyF,`F`,70,`VK_F`,``,``],[0,Q.KeyG,`KeyG`,Z.KeyG,`G`,71,`VK_G`,``,``],[0,Q.KeyH,`KeyH`,Z.KeyH,`H`,72,`VK_H`,``,``],[0,Q.KeyI,`KeyI`,Z.KeyI,`I`,73,`VK_I`,``,``],[0,Q.KeyJ,`KeyJ`,Z.KeyJ,`J`,74,`VK_J`,``,``],[0,Q.KeyK,`KeyK`,Z.KeyK,`K`,75,`VK_K`,``,``],[0,Q.KeyL,`KeyL`,Z.KeyL,`L`,76,`VK_L`,``,``],[0,Q.KeyM,`KeyM`,Z.KeyM,`M`,77,`VK_M`,``,``],[0,Q.KeyN,`KeyN`,Z.KeyN,`N`,78,`VK_N`,``,``],[0,Q.KeyO,`KeyO`,Z.KeyO,`O`,79,`VK_O`,``,``],[0,Q.KeyP,`KeyP`,Z.KeyP,`P`,80,`VK_P`,``,``],[0,Q.KeyQ,`KeyQ`,Z.KeyQ,`Q`,81,`VK_Q`,``,``],[0,Q.KeyR,`KeyR`,Z.KeyR,`R`,82,`VK_R`,``,``],[0,Q.KeyS,`KeyS`,Z.KeyS,`S`,83,`VK_S`,``,``],[0,Q.KeyT,`KeyT`,Z.KeyT,`T`,84,`VK_T`,``,``],[0,Q.KeyU,`KeyU`,Z.KeyU,`U`,85,`VK_U`,``,``],[0,Q.KeyV,`KeyV`,Z.KeyV,`V`,86,`VK_V`,``,``],[0,Q.KeyW,`KeyW`,Z.KeyW,`W`,87,`VK_W`,``,``],[0,Q.KeyX,`KeyX`,Z.KeyX,`X`,88,`VK_X`,``,``],[0,Q.KeyY,`KeyY`,Z.KeyY,`Y`,89,`VK_Y`,``,``],[0,Q.KeyZ,`KeyZ`,Z.KeyZ,`Z`,90,`VK_Z`,``,``],[0,Q.Digit1,`Digit1`,Z.Digit1,`1`,49,`VK_1`,``,``],[0,Q.Digit2,`Digit2`,Z.Digit2,`2`,50,`VK_2`,``,``],[0,Q.Digit3,`Digit3`,Z.Digit3,`3`,51,`VK_3`,``,``],[0,Q.Digit4,`Digit4`,Z.Digit4,`4`,52,`VK_4`,``,``],[0,Q.Digit5,`Digit5`,Z.Digit5,`5`,53,`VK_5`,``,``],[0,Q.Digit6,`Digit6`,Z.Digit6,`6`,54,`VK_6`,``,``],[0,Q.Digit7,`Digit7`,Z.Digit7,`7`,55,`VK_7`,``,``],[0,Q.Digit8,`Digit8`,Z.Digit8,`8`,56,`VK_8`,``,``],[0,Q.Digit9,`Digit9`,Z.Digit9,`9`,57,`VK_9`,``,``],[0,Q.Digit0,`Digit0`,Z.Digit0,`0`,48,`VK_0`,``,``],[1,Q.Enter,`Enter`,Z.Enter,`Enter`,13,`VK_RETURN`,``,``],[1,Q.Escape,`Escape`,Z.Escape,`Escape`,27,`VK_ESCAPE`,``,``],[1,Q.Backspace,`Backspace`,Z.Backspace,`Backspace`,8,`VK_BACK`,``,``],[1,Q.Tab,`Tab`,Z.Tab,`Tab`,9,`VK_TAB`,``,``],[1,Q.Space,`Space`,Z.Space,`Space`,32,`VK_SPACE`,``,``],[0,Q.Minus,`Minus`,Z.Minus,`-`,189,`VK_OEM_MINUS`,`-`,`OEM_MINUS`],[0,Q.Equal,`Equal`,Z.Equal,`=`,187,`VK_OEM_PLUS`,`=`,`OEM_PLUS`],[0,Q.BracketLeft,`BracketLeft`,Z.BracketLeft,`[`,219,`VK_OEM_4`,`[`,`OEM_4`],[0,Q.BracketRight,`BracketRight`,Z.BracketRight,`]`,221,`VK_OEM_6`,`]`,`OEM_6`],[0,Q.Backslash,`Backslash`,Z.Backslash,`\\`,220,`VK_OEM_5`,`\\`,`OEM_5`],[0,Q.IntlHash,`IntlHash`,Z.Unknown,``,0,``,``,``],[0,Q.Semicolon,`Semicolon`,Z.Semicolon,`;`,186,`VK_OEM_1`,`;`,`OEM_1`],[0,Q.Quote,`Quote`,Z.Quote,`'`,222,`VK_OEM_7`,`'`,`OEM_7`],[0,Q.Backquote,`Backquote`,Z.Backquote,"`",192,`VK_OEM_3`,"`",`OEM_3`],[0,Q.Comma,`Comma`,Z.Comma,`,`,188,`VK_OEM_COMMA`,`,`,`OEM_COMMA`],[0,Q.Period,`Period`,Z.Period,`.`,190,`VK_OEM_PERIOD`,`.`,`OEM_PERIOD`],[0,Q.Slash,`Slash`,Z.Slash,`/`,191,`VK_OEM_2`,`/`,`OEM_2`],[1,Q.CapsLock,`CapsLock`,Z.CapsLock,`CapsLock`,20,`VK_CAPITAL`,``,``],[1,Q.F1,`F1`,Z.F1,`F1`,112,`VK_F1`,``,``],[1,Q.F2,`F2`,Z.F2,`F2`,113,`VK_F2`,``,``],[1,Q.F3,`F3`,Z.F3,`F3`,114,`VK_F3`,``,``],[1,Q.F4,`F4`,Z.F4,`F4`,115,`VK_F4`,``,``],[1,Q.F5,`F5`,Z.F5,`F5`,116,`VK_F5`,``,``],[1,Q.F6,`F6`,Z.F6,`F6`,117,`VK_F6`,``,``],[1,Q.F7,`F7`,Z.F7,`F7`,118,`VK_F7`,``,``],[1,Q.F8,`F8`,Z.F8,`F8`,119,`VK_F8`,``,``],[1,Q.F9,`F9`,Z.F9,`F9`,120,`VK_F9`,``,``],[1,Q.F10,`F10`,Z.F10,`F10`,121,`VK_F10`,``,``],[1,Q.F11,`F11`,Z.F11,`F11`,122,`VK_F11`,``,``],[1,Q.F12,`F12`,Z.F12,`F12`,123,`VK_F12`,``,``],[1,Q.PrintScreen,`PrintScreen`,Z.Unknown,``,0,``,``,``],[1,Q.ScrollLock,`ScrollLock`,Z.ScrollLock,`ScrollLock`,145,`VK_SCROLL`,``,``],[1,Q.Pause,`Pause`,Z.PauseBreak,`PauseBreak`,19,`VK_PAUSE`,``,``],[1,Q.Insert,`Insert`,Z.Insert,`Insert`,45,`VK_INSERT`,``,``],[1,Q.Home,`Home`,Z.Home,`Home`,36,`VK_HOME`,``,``],[1,Q.PageUp,`PageUp`,Z.PageUp,`PageUp`,33,`VK_PRIOR`,``,``],[1,Q.Delete,`Delete`,Z.Delete,`Del`,46,`VK_DELETE`,`Delete`,``],[1,Q.End,`End`,Z.End,`End`,35,`VK_END`,``,``],[1,Q.PageDown,`PageDown`,Z.PageDown,`PageDown`,34,`VK_NEXT`,``,``],[1,Q.ArrowRight,`ArrowRight`,Z.RightArrow,`RightArrow`,39,`VK_RIGHT`,`Right`,``],[1,Q.ArrowLeft,`ArrowLeft`,Z.LeftArrow,`LeftArrow`,37,`VK_LEFT`,`Left`,``],[1,Q.ArrowDown,`ArrowDown`,Z.DownArrow,`DownArrow`,40,`VK_DOWN`,`Down`,``],[1,Q.ArrowUp,`ArrowUp`,Z.UpArrow,`UpArrow`,38,`VK_UP`,`Up`,``],[1,Q.NumLock,`NumLock`,Z.NumLock,`NumLock`,144,`VK_NUMLOCK`,``,``],[1,Q.NumpadDivide,`NumpadDivide`,Z.NumpadDivide,`NumPad_Divide`,111,`VK_DIVIDE`,``,``],[1,Q.NumpadMultiply,`NumpadMultiply`,Z.NumpadMultiply,`NumPad_Multiply`,106,`VK_MULTIPLY`,``,``],[1,Q.NumpadSubtract,`NumpadSubtract`,Z.NumpadSubtract,`NumPad_Subtract`,109,`VK_SUBTRACT`,``,``],[1,Q.NumpadAdd,`NumpadAdd`,Z.NumpadAdd,`NumPad_Add`,107,`VK_ADD`,``,``],[1,Q.NumpadEnter,`NumpadEnter`,Z.Enter,``,0,``,``,``],[1,Q.Numpad1,`Numpad1`,Z.Numpad1,`NumPad1`,97,`VK_NUMPAD1`,``,``],[1,Q.Numpad2,`Numpad2`,Z.Numpad2,`NumPad2`,98,`VK_NUMPAD2`,``,``],[1,Q.Numpad3,`Numpad3`,Z.Numpad3,`NumPad3`,99,`VK_NUMPAD3`,``,``],[1,Q.Numpad4,`Numpad4`,Z.Numpad4,`NumPad4`,100,`VK_NUMPAD4`,``,``],[1,Q.Numpad5,`Numpad5`,Z.Numpad5,`NumPad5`,101,`VK_NUMPAD5`,``,``],[1,Q.Numpad6,`Numpad6`,Z.Numpad6,`NumPad6`,102,`VK_NUMPAD6`,``,``],[1,Q.Numpad7,`Numpad7`,Z.Numpad7,`NumPad7`,103,`VK_NUMPAD7`,``,``],[1,Q.Numpad8,`Numpad8`,Z.Numpad8,`NumPad8`,104,`VK_NUMPAD8`,``,``],[1,Q.Numpad9,`Numpad9`,Z.Numpad9,`NumPad9`,105,`VK_NUMPAD9`,``,``],[1,Q.Numpad0,`Numpad0`,Z.Numpad0,`NumPad0`,96,`VK_NUMPAD0`,``,``],[1,Q.NumpadDecimal,`NumpadDecimal`,Z.NumpadDecimal,`NumPad_Decimal`,110,`VK_DECIMAL`,``,``],[0,Q.IntlBackslash,`IntlBackslash`,Z.IntlBackslash,`OEM_102`,226,`VK_OEM_102`,``,``],[1,Q.ContextMenu,`ContextMenu`,Z.ContextMenu,`ContextMenu`,93,``,``,``],[1,Q.Power,`Power`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadEqual,`NumpadEqual`,Z.Unknown,``,0,``,``,``],[1,Q.F13,`F13`,Z.F13,`F13`,124,`VK_F13`,``,``],[1,Q.F14,`F14`,Z.F14,`F14`,125,`VK_F14`,``,``],[1,Q.F15,`F15`,Z.F15,`F15`,126,`VK_F15`,``,``],[1,Q.F16,`F16`,Z.F16,`F16`,127,`VK_F16`,``,``],[1,Q.F17,`F17`,Z.F17,`F17`,128,`VK_F17`,``,``],[1,Q.F18,`F18`,Z.F18,`F18`,129,`VK_F18`,``,``],[1,Q.F19,`F19`,Z.F19,`F19`,130,`VK_F19`,``,``],[1,Q.F20,`F20`,Z.F20,`F20`,131,`VK_F20`,``,``],[1,Q.F21,`F21`,Z.F21,`F21`,132,`VK_F21`,``,``],[1,Q.F22,`F22`,Z.F22,`F22`,133,`VK_F22`,``,``],[1,Q.F23,`F23`,Z.F23,`F23`,134,`VK_F23`,``,``],[1,Q.F24,`F24`,Z.F24,`F24`,135,`VK_F24`,``,``],[1,Q.Open,`Open`,Z.Unknown,``,0,``,``,``],[1,Q.Help,`Help`,Z.Unknown,``,0,``,``,``],[1,Q.Select,`Select`,Z.Unknown,``,0,``,``,``],[1,Q.Again,`Again`,Z.Unknown,``,0,``,``,``],[1,Q.Undo,`Undo`,Z.Unknown,``,0,``,``,``],[1,Q.Cut,`Cut`,Z.Unknown,``,0,``,``,``],[1,Q.Copy,`Copy`,Z.Unknown,``,0,``,``,``],[1,Q.Paste,`Paste`,Z.Unknown,``,0,``,``,``],[1,Q.Find,`Find`,Z.Unknown,``,0,``,``,``],[1,Q.AudioVolumeMute,`AudioVolumeMute`,Z.AudioVolumeMute,`AudioVolumeMute`,173,`VK_VOLUME_MUTE`,``,``],[1,Q.AudioVolumeUp,`AudioVolumeUp`,Z.AudioVolumeUp,`AudioVolumeUp`,175,`VK_VOLUME_UP`,``,``],[1,Q.AudioVolumeDown,`AudioVolumeDown`,Z.AudioVolumeDown,`AudioVolumeDown`,174,`VK_VOLUME_DOWN`,``,``],[1,Q.NumpadComma,`NumpadComma`,Z.NUMPAD_SEPARATOR,`NumPad_Separator`,108,`VK_SEPARATOR`,``,``],[0,Q.IntlRo,`IntlRo`,Z.ABNT_C1,`ABNT_C1`,193,`VK_ABNT_C1`,``,``],[1,Q.KanaMode,`KanaMode`,Z.Unknown,``,0,``,``,``],[0,Q.IntlYen,`IntlYen`,Z.Unknown,``,0,``,``,``],[1,Q.Convert,`Convert`,Z.Unknown,``,0,``,``,``],[1,Q.NonConvert,`NonConvert`,Z.Unknown,``,0,``,``,``],[1,Q.Lang1,`Lang1`,Z.Unknown,``,0,``,``,``],[1,Q.Lang2,`Lang2`,Z.Unknown,``,0,``,``,``],[1,Q.Lang3,`Lang3`,Z.Unknown,``,0,``,``,``],[1,Q.Lang4,`Lang4`,Z.Unknown,``,0,``,``,``],[1,Q.Lang5,`Lang5`,Z.Unknown,``,0,``,``,``],[1,Q.Abort,`Abort`,Z.Unknown,``,0,``,``,``],[1,Q.Props,`Props`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadParenLeft,`NumpadParenLeft`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadParenRight,`NumpadParenRight`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadBackspace,`NumpadBackspace`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryStore,`NumpadMemoryStore`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryRecall,`NumpadMemoryRecall`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryClear,`NumpadMemoryClear`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemoryAdd,`NumpadMemoryAdd`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadMemorySubtract,`NumpadMemorySubtract`,Z.Unknown,``,0,``,``,``],[1,Q.NumpadClear,`NumpadClear`,Z.Clear,`Clear`,12,`VK_CLEAR`,``,``],[1,Q.NumpadClearEntry,`NumpadClearEntry`,Z.Unknown,``,0,``,``,``],[1,Q.None,``,Z.Ctrl,`Ctrl`,17,`VK_CONTROL`,``,``],[1,Q.None,``,Z.Shift,`Shift`,16,`VK_SHIFT`,``,``],[1,Q.None,``,Z.Alt,`Alt`,18,`VK_MENU`,``,``],[1,Q.None,``,Z.Meta,`Meta`,91,`VK_COMMAND`,``,``],[1,Q.ControlLeft,`ControlLeft`,Z.Ctrl,``,0,`VK_LCONTROL`,``,``],[1,Q.ShiftLeft,`ShiftLeft`,Z.Shift,``,0,`VK_LSHIFT`,``,``],[1,Q.AltLeft,`AltLeft`,Z.Alt,``,0,`VK_LMENU`,``,``],[1,Q.MetaLeft,`MetaLeft`,Z.Meta,``,0,`VK_LWIN`,``,``],[1,Q.ControlRight,`ControlRight`,Z.Ctrl,``,0,`VK_RCONTROL`,``,``],[1,Q.ShiftRight,`ShiftRight`,Z.Shift,``,0,`VK_RSHIFT`,``,``],[1,Q.AltRight,`AltRight`,Z.Alt,``,0,`VK_RMENU`,``,``],[1,Q.MetaRight,`MetaRight`,Z.Meta,``,0,`VK_RWIN`,``,``],[1,Q.BrightnessUp,`BrightnessUp`,Z.Unknown,``,0,``,``,``],[1,Q.BrightnessDown,`BrightnessDown`,Z.Unknown,``,0,``,``,``],[1,Q.MediaPlay,`MediaPlay`,Z.Unknown,``,0,``,``,``],[1,Q.MediaRecord,`MediaRecord`,Z.Unknown,``,0,``,``,``],[1,Q.MediaFastForward,`MediaFastForward`,Z.Unknown,``,0,``,``,``],[1,Q.MediaRewind,`MediaRewind`,Z.Unknown,``,0,``,``,``],[1,Q.MediaTrackNext,`MediaTrackNext`,Z.MediaTrackNext,`MediaTrackNext`,176,`VK_MEDIA_NEXT_TRACK`,``,``],[1,Q.MediaTrackPrevious,`MediaTrackPrevious`,Z.MediaTrackPrevious,`MediaTrackPrevious`,177,`VK_MEDIA_PREV_TRACK`,``,``],[1,Q.MediaStop,`MediaStop`,Z.MediaStop,`MediaStop`,178,`VK_MEDIA_STOP`,``,``],[1,Q.Eject,`Eject`,Z.Unknown,``,0,``,``,``],[1,Q.MediaPlayPause,`MediaPlayPause`,Z.MediaPlayPause,`MediaPlayPause`,179,`VK_MEDIA_PLAY_PAUSE`,``,``],[1,Q.MediaSelect,`MediaSelect`,Z.LaunchMediaPlayer,`LaunchMediaPlayer`,181,`VK_MEDIA_LAUNCH_MEDIA_SELECT`,``,``],[1,Q.LaunchMail,`LaunchMail`,Z.LaunchMail,`LaunchMail`,180,`VK_MEDIA_LAUNCH_MAIL`,``,``],[1,Q.LaunchApp2,`LaunchApp2`,Z.LaunchApp2,`LaunchApp2`,183,`VK_MEDIA_LAUNCH_APP2`,``,``],[1,Q.LaunchApp1,`LaunchApp1`,Z.Unknown,``,0,`VK_MEDIA_LAUNCH_APP1`,``,``],[1,Q.SelectTask,`SelectTask`,Z.Unknown,``,0,``,``,``],[1,Q.LaunchScreenSaver,`LaunchScreenSaver`,Z.Unknown,``,0,``,``,``],[1,Q.BrowserSearch,`BrowserSearch`,Z.BrowserSearch,`BrowserSearch`,170,`VK_BROWSER_SEARCH`,``,``],[1,Q.BrowserHome,`BrowserHome`,Z.BrowserHome,`BrowserHome`,172,`VK_BROWSER_HOME`,``,``],[1,Q.BrowserBack,`BrowserBack`,Z.BrowserBack,`BrowserBack`,166,`VK_BROWSER_BACK`,``,``],[1,Q.BrowserForward,`BrowserForward`,Z.BrowserForward,`BrowserForward`,167,`VK_BROWSER_FORWARD`,``,``],[1,Q.BrowserStop,`BrowserStop`,Z.Unknown,``,0,`VK_BROWSER_STOP`,``,``],[1,Q.BrowserRefresh,`BrowserRefresh`,Z.Unknown,``,0,`VK_BROWSER_REFRESH`,``,``],[1,Q.BrowserFavorites,`BrowserFavorites`,Z.Unknown,``,0,`VK_BROWSER_FAVORITES`,``,``],[1,Q.ZoomToggle,`ZoomToggle`,Z.Unknown,``,0,``,``,``],[1,Q.MailReply,`MailReply`,Z.Unknown,``,0,``,``,``],[1,Q.MailForward,`MailForward`,Z.Unknown,``,0,``,``,``],[1,Q.MailSend,`MailSend`,Z.Unknown,``,0,``,``,``],[1,Q.None,``,Z.KEY_IN_COMPOSITION,`KeyInComposition`,229,``,``,``],[1,Q.None,``,Z.ABNT_C2,`ABNT_C2`,194,`VK_ABNT_C2`,``,``],[1,Q.None,``,Z.OEM_8,`OEM_8`,223,`VK_OEM_8`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_KANA`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_HANGUL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_JUNJA`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_FINAL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_HANJA`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_KANJI`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_CONVERT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_NONCONVERT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_ACCEPT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_MODECHANGE`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_SELECT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PRINT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_EXECUTE`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_SNAPSHOT`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_HELP`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_APPS`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PROCESSKEY`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PACKET`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_DBE_SBCSCHAR`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_DBE_DBCSCHAR`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_ATTN`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_CRSEL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_EXSEL`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_EREOF`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PLAY`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_ZOOM`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_NONAME`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_PA1`,``,``],[1,Q.None,``,Z.Unknown,``,0,`VK_OEM_CLEAR`,``,``]],t=[],n=[];for(let r of e){let[e,i,a,o,s,c,l,u,d]=r;if(n[i]||(n[i]=!0,Mq[i]=a,Nq[a]=i,Pq[a.toLowerCase()]=i,e&&(Fq[i]=o,o!==Z.Unknown&&o!==Z.Enter&&!zq(o)&&(Iq[o]=i))),!t[o]){if(t[o]=!0,!s)throw Error(`String representation missing for key code ${o} around scan code ${a}`);Dq.define(o,s),Oq.define(o,u||s),kq.define(o,d||u||s)}c&&(Aq[c]=o),l&&(jq[l]=o)}Iq[Z.Enter]=Q.Enter})();var Lq;(function(e){function t(e){return Dq.keyCodeToStr(e)}e.toString=t;function n(e){return Dq.strToKeyCode(e)}e.fromString=n;function r(e){return Oq.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return kq.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Oq.strToKeyCode(e)||kq.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=Z.Numpad0&&e<=Z.NumpadDivide)return null;switch(e){case Z.UpArrow:return`Up`;case Z.DownArrow:return`Down`;case Z.LeftArrow:return`Left`;case Z.RightArrow:return`Right`;case Z.Delete:return`Delete`}return Dq.keyCodeToStr(e)}e.toElectronAccelerator=o})(Lq||={});var Rq;(function(e){e[e.CtrlCmd=2048]=`CtrlCmd`,e[e.Shift=1024]=`Shift`,e[e.Alt=512]=`Alt`,e[e.WinCtrl=256]=`WinCtrl`})(Rq||={});function zq(e){return e===Z.Ctrl||e===Z.Shift||e===Z.Alt||e===Z.Meta}var Bq;(function(e){e[e.CtrlCmd=2048]=`CtrlCmd`,e[e.Shift=1024]=`Shift`,e[e.Alt=512]=`Alt`,e[e.WinCtrl=256]=`WinCtrl`,e[e.KeyCode=255]=`KeyCode`})(Bq||={});function Vq(e,t){if(typeof e==`number`){if(e===0)return null;let n=(e&65535)>>>0,r=(e&4294901760)>>>16;return r===0?new Wq([Hq(n,t)]):new Wq([Hq(n,t),Hq(r,t)])}else{let n=[];for(let r=0;r<e.length;r++)n.push(Hq(e[r],t));return new Wq(n)}}function Hq(e,t){let n=!!(e&Bq.CtrlCmd),r=!!(e&Bq.WinCtrl);return new Uq(t===Bn.Macintosh?r:n,!!(e&Bq.Shift),!!(e&Bq.Alt),t===Bn.Macintosh?n:r,e&Bq.KeyCode)}var Uq=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===Z.Unknown||this.keyCode===Z.Ctrl||this.keyCode===Z.Meta||this.keyCode===Z.Alt||this.keyCode===Z.Shift}toKeybinding(){return new Wq([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===Z.Ctrl||this.shiftKey&&this.keyCode===Z.Shift||this.altKey&&this.keyCode===Z.Alt||this.metaKey&&this.keyCode===Z.Meta}},Wq=class{constructor(e){if(e.length===0)throw se(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;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}},Gq;(function(e){e[e.EditorCore=0]=`EditorCore`,e[e.EditorContrib=100]=`EditorContrib`,e[e.WorkbenchContrib=200]=`WorkbenchContrib`,e[e.BuiltinExtension=300]=`BuiltinExtension`,e[e.ExternalExtension=400]=`ExternalExtension`})(Gq||={});const Kq=new class e{constructor(){this._coreKeybindings=new nn,this._coreKeybindingRules=new nn,this._extensionKeybindings=[],this._cachedMergedKeybindings=null}static bindToPlatform(e,t){if(t===Bn.Windows){if(e&&e.win)return e.win}else if(t===Bn.Macintosh){if(e&&e.mac)return e.mac}else if(e&&e.linux)return e.linux;return e}static bindToCurrentPlatform(t){return e.bindToPlatform(t,Vn)}registerKeybindingRule(t){let n=e.bindToCurrentPlatform(t),r=new _;if(n&&n.primary){let e=Vq(n.primary,Vn);e&&r.add(this._registerDefaultKeybinding(e,t.id,t.args,t.weight,0,t.when))}if(n&&Array.isArray(n.secondary))for(let e=0,i=n.secondary.length;e<i;e++){let i=n.secondary[e],a=Vq(i,Vn);a&&r.add(this._registerDefaultKeybinding(a,t.id,t.args,t.weight,-e-1,t.when))}let i=this._coreKeybindingRules.push(t);return r.add(g(()=>{i()})),r}setExtensionKeybindings(e){let t=[],n=0;for(let r of e)r.keybinding&&(t[n++]={keybinding:r.keybinding,command:r.id,commandArgs:r.args,when:r.when,weight1:r.weight,weight2:0,extensionId:r.extensionId||null,isBuiltinExtension:r.isBuiltinExtension||!1});this._extensionKeybindings=t,this._cachedMergedKeybindings=null}registerCommandAndKeybindingRule(e){return St(this.registerKeybindingRule(e),Tq.registerCommand(e))}_registerDefaultKeybinding(e,t,n,r,i,a){let o=this._coreKeybindings.push({keybinding:e,command:t,commandArgs:n,when:a,weight1:r,weight2:i,extensionId:null,isBuiltinExtension:!1});return this._cachedMergedKeybindings=null,g(()=>{o(),this._cachedMergedKeybindings=null})}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(qq)),this._cachedMergedKeybindings.slice(0)}getDefaultKeybindingsForOS(t){let n=[];for(let r of this._coreKeybindingRules){let i=e.bindToPlatform(r,t);if(i&&i.primary){let e=Vq(i.primary,t);e&&n.push({keybinding:e,command:r.id,commandArgs:r.args,when:r.when,weight1:r.weight,weight2:0,extensionId:null,isBuiltinExtension:!1})}if(i&&Array.isArray(i.secondary))for(let e=0,a=i.secondary.length;e<a;e++){let a=i.secondary[e],o=Vq(a,t);o&&n.push({keybinding:o,command:r.id,commandArgs:r.args,when:r.when,weight1:r.weight,weight2:-e-1,extensionId:null,isBuiltinExtension:!1})}}return n.sort(qq),n}};Am.add({EditorModes:`platform.keybindingsRegistry`}.EditorModes,Kq);function qq(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.command<t.command)return-1;if(e.command>t.command)return 1}return e.weight2-t.weight2}var Jq;function Yq(e){return e.command!==void 0}var Xq=class e{static{this._instances=new Map}static{this.CommandPalette=new e(`CommandPalette`)}static{this.DebugBreakpointsContext=new e(`DebugBreakpointsContext`)}static{this.DebugCallStackContext=new e(`DebugCallStackContext`)}static{this.DebugConsoleContext=new e(`DebugConsoleContext`)}static{this.DebugVariablesContext=new e(`DebugVariablesContext`)}static{this.NotebookVariablesContext=new e(`NotebookVariablesContext`)}static{this.DebugHoverContext=new e(`DebugHoverContext`)}static{this.DebugWatchContext=new e(`DebugWatchContext`)}static{this.DebugToolBar=new e(`DebugToolBar`)}static{this.DebugToolBarStop=new e(`DebugToolBarStop`)}static{this.DebugDisassemblyContext=new e(`DebugDisassemblyContext`)}static{this.DebugCallStackToolbar=new e(`DebugCallStackToolbar`)}static{this.DebugCreateConfiguration=new e(`DebugCreateConfiguration`)}static{this.DebugScopesContext=new e(`DebugScopesContext`)}static{this.EditorContext=new e(`EditorContext`)}static{this.SimpleEditorContext=new e(`SimpleEditorContext`)}static{this.EditorContent=new e(`EditorContent`)}static{this.EditorLineNumberContext=new e(`EditorLineNumberContext`)}static{this.EditorContextCopy=new e(`EditorContextCopy`)}static{this.EditorContextPeek=new e(`EditorContextPeek`)}static{this.EditorContextShare=new e(`EditorContextShare`)}static{this.EditorTitle=new e(`EditorTitle`)}static{this.EditorTitleLayout=new e(`EditorTitleLayout`)}static{this.ModalEditorTitle=new e(`ModalEditorTitle`)}static{this.ModalEditorTitleContext=new e(`ModalEditorTitleContext`)}static{this.ModalEditorEditorTitle=new e(`ModalEditorEditorTitle`)}static{this.CompactWindowEditorTitle=new e(`CompactWindowEditorTitle`)}static{this.EditorTitleRun=new e(`EditorTitleRun`)}static{this.EditorTitleContext=new e(`EditorTitleContext`)}static{this.EditorTitleContextShare=new e(`EditorTitleContextShare`)}static{this.EmptyEditorGroup=new e(`EmptyEditorGroup`)}static{this.EmptyEditorGroupContext=new e(`EmptyEditorGroupContext`)}static{this.EditorTabsBarContext=new e(`EditorTabsBarContext`)}static{this.EditorTabsBarShowTabsSubmenu=new e(`EditorTabsBarShowTabsSubmenu`)}static{this.EditorTabsBarShowTabsZenModeSubmenu=new e(`EditorTabsBarShowTabsZenModeSubmenu`)}static{this.EditorActionsPositionSubmenu=new e(`EditorActionsPositionSubmenu`)}static{this.EditorRenderWhitespaceSubmenu=new e(`EditorRenderWhitespaceSubmenu`)}static{this.EditorSplitMoveSubmenu=new e(`EditorSplitMoveSubmenu`)}static{this.ExplorerContext=new e(`ExplorerContext`)}static{this.ExplorerContextShare=new e(`ExplorerContextShare`)}static{this.ExtensionContext=new e(`ExtensionContext`)}static{this.ExtensionEditorContextMenu=new e(`ExtensionEditorContextMenu`)}static{this.GlobalActivity=new e(`GlobalActivity`)}static{this.CommandCenter=new e(`CommandCenter`)}static{this.CommandCenterCenter=new e(`CommandCenterCenter`)}static{this.LayoutControlMenuSubmenu=new e(`LayoutControlMenuSubmenu`)}static{this.LayoutControlMenu=new e(`LayoutControlMenu`)}static{this.MenubarMainMenu=new e(`MenubarMainMenu`)}static{this.MenubarAppearanceMenu=new e(`MenubarAppearanceMenu`)}static{this.MenubarDebugMenu=new e(`MenubarDebugMenu`)}static{this.MenubarEditMenu=new e(`MenubarEditMenu`)}static{this.MenubarCopy=new e(`MenubarCopy`)}static{this.MenubarFileMenu=new e(`MenubarFileMenu`)}static{this.MenubarGoMenu=new e(`MenubarGoMenu`)}static{this.MenubarHelpMenu=new e(`MenubarHelpMenu`)}static{this.MenubarLayoutMenu=new e(`MenubarLayoutMenu`)}static{this.MenubarNewBreakpointMenu=new e(`MenubarNewBreakpointMenu`)}static{this.PanelAlignmentMenu=new e(`PanelAlignmentMenu`)}static{this.PanelPositionMenu=new e(`PanelPositionMenu`)}static{this.ActivityBarPositionMenu=new e(`ActivityBarPositionMenu`)}static{this.NotificationsCenterPositionMenu=new e(`NotificationsCenterPositionMenu`)}static{this.MenubarPreferencesMenu=new e(`MenubarPreferencesMenu`)}static{this.MenubarRecentMenu=new e(`MenubarRecentMenu`)}static{this.MenubarSelectionMenu=new e(`MenubarSelectionMenu`)}static{this.MenubarShare=new e(`MenubarShare`)}static{this.MenubarSwitchEditorMenu=new e(`MenubarSwitchEditorMenu`)}static{this.MenubarSwitchGroupMenu=new e(`MenubarSwitchGroupMenu`)}static{this.MenubarTerminalMenu=new e(`MenubarTerminalMenu`)}static{this.MenubarTerminalSuggestStatusMenu=new e(`MenubarTerminalSuggestStatusMenu`)}static{this.MenubarViewMenu=new e(`MenubarViewMenu`)}static{this.MenubarHomeMenu=new e(`MenubarHomeMenu`)}static{this.OpenEditorsContext=new e(`OpenEditorsContext`)}static{this.OpenEditorsContextShare=new e(`OpenEditorsContextShare`)}static{this.ProblemsPanelContext=new e(`ProblemsPanelContext`)}static{this.SCMInputBox=new e(`SCMInputBox`)}static{this.SCMChangeContext=new e(`SCMChangeContext`)}static{this.SCMResourceContext=new e(`SCMResourceContext`)}static{this.SCMResourceContextShare=new e(`SCMResourceContextShare`)}static{this.SCMResourceFolderContext=new e(`SCMResourceFolderContext`)}static{this.SCMResourceGroupContext=new e(`SCMResourceGroupContext`)}static{this.SCMSourceControl=new e(`SCMSourceControl`)}static{this.SCMSourceControlInline=new e(`SCMSourceControlInline`)}static{this.SCMSourceControlTitle=new e(`SCMSourceControlTitle`)}static{this.SCMHistoryTitle=new e(`SCMHistoryTitle`)}static{this.SCMHistoryItemContext=new e(`SCMHistoryItemContext`)}static{this.SCMHistoryItemChangeContext=new e(`SCMHistoryItemChangeContext`)}static{this.SCMHistoryItemRefContext=new e(`SCMHistoryItemRefContext`)}static{this.SCMArtifactGroupContext=new e(`SCMArtifactGroupContext`)}static{this.SCMArtifactContext=new e(`SCMArtifactContext`)}static{this.SCMQuickDiffDecorations=new e(`SCMQuickDiffDecorations`)}static{this.SCMTitle=new e(`SCMTitle`)}static{this.SearchContext=new e(`SearchContext`)}static{this.SearchActionMenu=new e(`SearchActionContext`)}static{this.StatusBarWindowIndicatorMenu=new e(`StatusBarWindowIndicatorMenu`)}static{this.StatusBarRemoteIndicatorMenu=new e(`StatusBarRemoteIndicatorMenu`)}static{this.StickyScrollContext=new e(`StickyScrollContext`)}static{this.TestItem=new e(`TestItem`)}static{this.TestItemGutter=new e(`TestItemGutter`)}static{this.TestProfilesContext=new e(`TestProfilesContext`)}static{this.TestMessageContext=new e(`TestMessageContext`)}static{this.TestMessageContent=new e(`TestMessageContent`)}static{this.TestPeekElement=new e(`TestPeekElement`)}static{this.TestPeekTitle=new e(`TestPeekTitle`)}static{this.TestCallStack=new e(`TestCallStack`)}static{this.TestCoverageFilterItem=new e(`TestCoverageFilterItem`)}static{this.TouchBarContext=new e(`TouchBarContext`)}static{this.TitleBar=new e(`TitleBar`)}static{this.TitleBarAdjacentCenter=new e(`TitleBarAdjacentCenter`)}static{this.TitleBarContext=new e(`TitleBarContext`)}static{this.TitleBarTitleContext=new e(`TitleBarTitleContext`)}static{this.TunnelContext=new e(`TunnelContext`)}static{this.TunnelPrivacy=new e(`TunnelPrivacy`)}static{this.TunnelProtocol=new e(`TunnelProtocol`)}static{this.TunnelPortInline=new e(`TunnelInline`)}static{this.TunnelTitle=new e(`TunnelTitle`)}static{this.TunnelLocalAddressInline=new e(`TunnelLocalAddressInline`)}static{this.TunnelOriginInline=new e(`TunnelOriginInline`)}static{this.ViewItemContext=new e(`ViewItemContext`)}static{this.ViewContainerTitle=new e(`ViewContainerTitle`)}static{this.ViewContainerTitleContext=new e(`ViewContainerTitleContext`)}static{this.ViewTitle=new e(`ViewTitle`)}static{this.ViewTitleContext=new e(`ViewTitleContext`)}static{this.CommentEditorActions=new e(`CommentEditorActions`)}static{this.CommentThreadTitle=new e(`CommentThreadTitle`)}static{this.CommentThreadActions=new e(`CommentThreadActions`)}static{this.CommentThreadAdditionalActions=new e(`CommentThreadAdditionalActions`)}static{this.CommentThreadTitleContext=new e(`CommentThreadTitleContext`)}static{this.CommentThreadCommentContext=new e(`CommentThreadCommentContext`)}static{this.CommentTitle=new e(`CommentTitle`)}static{this.CommentActions=new e(`CommentActions`)}static{this.CommentsViewThreadActions=new e(`CommentsViewThreadActions`)}static{this.InteractiveToolbar=new e(`InteractiveToolbar`)}static{this.InteractiveCellTitle=new e(`InteractiveCellTitle`)}static{this.InteractiveCellDelete=new e(`InteractiveCellDelete`)}static{this.InteractiveCellExecute=new e(`InteractiveCellExecute`)}static{this.InteractiveInputExecute=new e(`InteractiveInputExecute`)}static{this.InteractiveInputConfig=new e(`InteractiveInputConfig`)}static{this.ReplInputExecute=new e(`ReplInputExecute`)}static{this.IssueReporter=new e(`IssueReporter`)}static{this.NotebookToolbar=new e(`NotebookToolbar`)}static{this.NotebookToolbarContext=new e(`NotebookToolbarContext`)}static{this.NotebookStickyScrollContext=new e(`NotebookStickyScrollContext`)}static{this.NotebookCellTitle=new e(`NotebookCellTitle`)}static{this.NotebookCellDelete=new e(`NotebookCellDelete`)}static{this.NotebookCellInsert=new e(`NotebookCellInsert`)}static{this.NotebookCellBetween=new e(`NotebookCellBetween`)}static{this.NotebookCellListTop=new e(`NotebookCellTop`)}static{this.NotebookCellExecute=new e(`NotebookCellExecute`)}static{this.NotebookCellExecuteGoTo=new e(`NotebookCellExecuteGoTo`)}static{this.NotebookCellExecutePrimary=new e(`NotebookCellExecutePrimary`)}static{this.NotebookDiffCellInputTitle=new e(`NotebookDiffCellInputTitle`)}static{this.NotebookDiffDocumentMetadata=new e(`NotebookDiffDocumentMetadata`)}static{this.NotebookDiffCellMetadataTitle=new e(`NotebookDiffCellMetadataTitle`)}static{this.NotebookDiffCellOutputsTitle=new e(`NotebookDiffCellOutputsTitle`)}static{this.NotebookOutputToolbar=new e(`NotebookOutputToolbar`)}static{this.NotebookOutlineFilter=new e(`NotebookOutlineFilter`)}static{this.NotebookOutlineActionMenu=new e(`NotebookOutlineActionMenu`)}static{this.NotebookEditorLayoutConfigure=new e(`NotebookEditorLayoutConfigure`)}static{this.NotebookKernelSource=new e(`NotebookKernelSource`)}static{this.BulkEditTitle=new e(`BulkEditTitle`)}static{this.BulkEditContext=new e(`BulkEditContext`)}static{this.TimelineItemContext=new e(`TimelineItemContext`)}static{this.TimelineTitle=new e(`TimelineTitle`)}static{this.TimelineTitleContext=new e(`TimelineTitleContext`)}static{this.TimelineFilterSubMenu=new e(`TimelineFilterSubMenu`)}static{this.AccountsContext=new e(`AccountsContext`)}static{this.SidebarTitle=new e(`SidebarTitle`)}static{this.PanelTitle=new e(`PanelTitle`)}static{this.AuxiliaryBarTitle=new e(`AuxiliaryBarTitle`)}static{this.TerminalInstanceContext=new e(`TerminalInstanceContext`)}static{this.TerminalEditorInstanceContext=new e(`TerminalEditorInstanceContext`)}static{this.TerminalNewDropdownContext=new e(`TerminalNewDropdownContext`)}static{this.TerminalTabContext=new e(`TerminalTabContext`)}static{this.TerminalTabEmptyAreaContext=new e(`TerminalTabEmptyAreaContext`)}static{this.TerminalStickyScrollContext=new e(`TerminalStickyScrollContext`)}static{this.WebviewContext=new e(`WebviewContext`)}static{this.InlineCompletionsActions=new e(`InlineCompletionsActions`)}static{this.InlineEditsActions=new e(`InlineEditsActions`)}static{this.NewFile=new e(`NewFile`)}static{this.MergeInput1Toolbar=new e(`MergeToolbar1Toolbar`)}static{this.MergeInput2Toolbar=new e(`MergeToolbar2Toolbar`)}static{this.MergeBaseToolbar=new e(`MergeBaseToolbar`)}static{this.MergeInputResultToolbar=new e(`MergeToolbarResultToolbar`)}static{this.InlineSuggestionToolbar=new e(`InlineSuggestionToolbar`)}static{this.InlineEditToolbar=new e(`InlineEditToolbar`)}static{this.ChatContext=new e(`ChatContext`)}static{this.ChatCodeBlock=new e(`ChatCodeblock`)}static{this.ChatCompareBlock=new e(`ChatCompareBlock`)}static{this.ChatMessageTitle=new e(`ChatMessageTitle`)}static{this.ChatWelcomeContext=new e(`ChatWelcomeContext`)}static{this.ChatMessageFooter=new e(`ChatMessageFooter`)}static{this.ChatExecute=new e(`ChatExecute`)}static{this.ChatExecuteQueue=new e(`ChatExecuteQueue`)}static{this.ChatInput=new e(`ChatInput`)}static{this.ChatInputSecondary=new e(`ChatInputSecondary`)}static{this.ChatInputStatus=new e(`ChatInputStatus`)}static{this.ChatInputSide=new e(`ChatInputSide`)}static{this.ChatModePicker=new e(`ChatModePicker`)}static{this.ChatEditingWidgetToolbar=new e(`ChatEditingWidgetToolbar`)}static{this.ChatEditingSessionChangesToolbar=new e(`ChatEditingSessionChangesToolbar`)}static{this.ChatEditingSessionTitleToolbar=new e(`ChatEditingSessionTitleToolbar`)}static{this.ChatEditingSessionChangesVersionsSubmenu=new e(`ChatEditingSessionChangesVersionsSubmenu`)}static{this.ChatEditingSessionChangesFileHeaderToolbar=new e(`ChatEditingSessionChangesFileHeaderToolbar`)}static{this.ChatEditingSessionChangesFileHeaderRightToolbar=new e(`ChatEditingSessionChangesFileHeaderRightToolbar`)}static{this.ChatEditingEditorContent=new e(`ChatEditingEditorContent`)}static{this.ChatEditingEditorHunk=new e(`ChatEditingEditorHunk`)}static{this.ChatEditingDeletedNotebookCell=new e(`ChatEditingDeletedNotebookCell`)}static{this.ChatInputAttachmentToolbar=new e(`ChatInputAttachmentToolbar`)}static{this.ChatEditingWidgetModifiedFilesToolbar=new e(`ChatEditingWidgetModifiedFilesToolbar`)}static{this.ChatInputResourceAttachmentContext=new e(`ChatInputResourceAttachmentContext`)}static{this.ChatInputSymbolAttachmentContext=new e(`ChatInputSymbolAttachmentContext`)}static{this.ChatInlineResourceAnchorContext=new e(`ChatInlineResourceAnchorContext`)}static{this.ChatInlineSymbolAnchorContext=new e(`ChatInlineSymbolAnchorContext`)}static{this.ChatMessageCheckpoint=new e(`ChatMessageCheckpoint`)}static{this.ChatMessageRestoreCheckpoint=new e(`ChatMessageRestoreCheckpoint`)}static{this.ChatNewMenu=new e(`ChatNewMenu`)}static{this.ChatEditingCodeBlockContext=new e(`ChatEditingCodeBlockContext`)}static{this.ChatTitleBarMenu=new e(`ChatTitleBarMenu`)}static{this.ChatAttachmentsContext=new e(`ChatAttachmentsContext`)}static{this.ChatTipContext=new e(`ChatTipContext`)}static{this.ChatTipToolbar=new e(`ChatTipToolbar`)}static{this.ChatToolOutputResourceToolbar=new e(`ChatToolOutputResourceToolbar`)}static{this.ChatTextEditorMenu=new e(`ChatTextEditorMenu`)}static{this.ChatToolOutputResourceContext=new e(`ChatToolOutputResourceContext`)}static{this.ChatMultiDiffContext=new e(`ChatMultiDiffContext`)}static{this.ChatConfirmationMenu=new e(`ChatConfirmationMenu`)}static{this.ChatEditorInlineMenu=new e(`ChatEditorInlineGutter`)}static{this.ChatEditorInlineExecute=new e(`ChatEditorInputExecute`)}static{this.ChatEditorInlineInputSide=new e(`ChatEditorInputSide`)}static{this.InlineChatEditorAffordance=new e(`InlineChatEditorAffordance`)}static{this.AccessibleView=new e(`AccessibleView`)}static{this.MultiDiffEditorContent=new e(`MultiDiffEditorContent`)}static{this.MultiDiffEditorFileToolbar=new e(`MultiDiffEditorFileToolbar`)}static{this.DiffEditorHunkToolbar=new e(`DiffEditorHunkToolbar`)}static{this.DiffEditorSelectionToolbar=new e(`DiffEditorSelectionToolbar`)}static{this.BrowserNavigationToolbar=new e(`BrowserNavigationToolbar`)}static{this.BrowserActionsToolbar=new e(`BrowserActionsToolbar`)}static{this.BrowserChatActionsMenu=new e(`BrowserChatActionsMenu`)}static{this.BrowserEmulationToolbar=new e(`BrowserEmulationToolbar`)}static{this.AgentSessionsViewerFilterSubMenu=new e(`AgentSessionsViewerFilterSubMenu`)}static{this.AgentSessionsContext=new e(`AgentSessionsContext`)}static{this.AgentSessionSectionContext=new e(`AgentSessionSectionContext`)}static{this.AgentSessionsCreateSubMenu=new e(`AgentSessionsCreateSubMenu`)}static{this.AgentSessionsToolbar=new e(`AgentSessionsToolbar`)}static{this.AgentSessionItemToolbar=new e(`AgentSessionItemToolbar`)}static{this.AgentSessionSectionToolbar=new e(`AgentSessionSectionToolbar`)}static{this.SessionItemContextMenu=new e(`SessionItemContextMenu`)}static{this.SessionHeaderContext=new e(`SessionsSessionHeaderContext`)}static{this.AgentsTitleBarControlMenu=new e(`AgentsTitleBarControlMenu`)}static{this.AgentsChangesToolbar=new e(`AgentsChangesToolbar`)}static{this.AgentsChangesPrimaryActionSubMenu=new e(`AgentsChangesPrimaryActionSubMenu`)}static{this.AgentsChangeInlineToolbar=new e(`AgentsChangeInlineToolbar`)}static{this.ChatViewSessionTitleNavigationToolbar=new e(`ChatViewSessionTitleNavigationToolbar`)}static{this.ChatViewSessionTitleToolbar=new e(`ChatViewSessionTitleToolbar`)}static{this.ChatContextUsageActions=new e(`ChatContextUsageActions`)}static{this.MarkerHoverStatusBar=new e(`MarkerHoverParticipant.StatusBar`)}static for(t){return e._instances.get(t)??new e(t)}constructor(t){if(e._instances.has(t))throw TypeError(`MenuId with identifier '${t}' already exists. Use MenuId.for(ident) or a unique identifier`);e._instances.set(t,this),this.id=t}},Zq=class e{static{this._all=new Map}static for(t){let n=this._all.get(t);return n||(n=new e(t),this._all.set(t,n)),n}static merge(t){let n=new Set;for(let r of t)r instanceof e&&n.add(r.id);return n}constructor(e){this.id=e,this.has=t=>t===e}};new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new _r({merge:Zq.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(Zq.for(Xq.CommandPalette)),yt(g(()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(Zq.for(Xq.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;return this._commands.forEach((t,n)=>e.set(n,t)),e}appendMenuItem(e,t){let n=this._menuItems.get(e);n||(n=new nn,this._menuItems.set(e,n));let r=n.push(t);return this._onDidChangeMenu.fire(Zq.for(e)),yt(g(()=>{r(),this._onDidChangeMenu.fire(Zq.for(e))}))}appendMenuItems(e){let t=new _;for(let{id:n,item:r}of e)t.add(this.appendMenuItem(n,r));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===Xq.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){let t=new Set;for(let n of e)Yq(n)&&(t.add(n.command.id),n.alt&&t.add(n.alt.id));this._commands.forEach((n,r)=>{t.has(r)||e.push({command:n})})}};let Qq=Jq=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,n,r,i,a,o){this.hideActions=r,this.menuKeybinding=i,this._commandService=o,this.id=e.id,this.label=Jq.label(e,n),this.tooltip=(typeof e.tooltip==`string`?e.tooltip:e.tooltip?.value)??``,this.enabled=!e.precondition||a.contextMatchesRules(e.precondition),this.checked=void 0;let s;if(e.toggled){let t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=a.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip=typeof t.tooltip==`string`?t.tooltip:t.tooltip.value),this.checked&&vl.isThemeIcon(t.icon)&&(s=t.icon),this.checked&&t.title&&(this.label=typeof t.title==`string`?t.title:t.title.value)}s||=vl.isThemeIcon(e.icon)?e.icon:void 0,this.item=e,this.alt=t?new Jq(t,void 0,n,r,void 0,a,o):void 0,this._options=n,this.class=s&&vl.asClassName(s)}run(...e){let t=[];return this._options?.args?t=[...t,...this._options.args]:this._options?.arg&&(t=[...t,this._options.arg]),this._options?.shouldForwardArgs&&(t=[...t,...e]),this._commandService.executeCommand(this.id,...t)}};Qq=Jq=k([A(5,kh),A(6,wq)],Qq);var $q;(function(e){e.ExtensionQueryService=`ExtensionQueryService`,e.ExtensionLatestVersionUri=`ExtensionLatestVersionUriTemplate`,e.ExtensionStatisticsUri=`ExtensionStatisticsUriTemplate`,e.PublisherViewUri=`PublisherViewUriTemplate`,e.ExtensionDetailsViewUri=`ExtensionDetailsViewUriTemplate`,e.ExtensionRatingViewUri=`ExtensionRatingViewUriTemplate`,e.ExtensionResourceUri=`ExtensionResourceUriTemplate`,e.ContactSupportUri=`ContactSupportUri`})($q||={});var eJ;(function(e){e.None=`None`,e.IncludeVersions=`IncludeVersions`,e.IncludeFiles=`IncludeFiles`,e.IncludeCategoryAndTags=`IncludeCategoryAndTags`,e.IncludeSharedAccounts=`IncludeSharedAccounts`,e.IncludeVersionProperties=`IncludeVersionProperties`,e.ExcludeNonValidated=`ExcludeNonValidated`,e.IncludeInstallationTargets=`IncludeInstallationTargets`,e.IncludeAssetUri=`IncludeAssetUri`,e.IncludeStatistics=`IncludeStatistics`,e.IncludeLatestVersionOnly=`IncludeLatestVersionOnly`,e.Unpublished=`Unpublished`,e.IncludeNameConflictInfo=`IncludeNameConflictInfo`,e.IncludeLatestPrereleaseAndStableVersionOnly=`IncludeLatestPrereleaseAndStableVersionOnly`})(eJ||={});var tJ;(function(e){e.Available=`available`,e.RequiresSignIn=`requiresSignIn`,e.AccessDenied=`accessDenied`,e.Unavailable=`unavailable`})(tJ||={});const nJ=O(`extensionsWorkbenchService`);ln(10236,`Extensions`);var rJ;(function(e){e[e.Installing=0]=`Installing`,e[e.Installed=1]=`Installed`,e[e.Uninstalling=2]=`Uninstalling`,e[e.Uninstalled=3]=`Uninstalled`})(rJ||={});var iJ;(function(e){e.ReloadWindow=`reloadWindow`,e.RestartExtensions=`restartExtensions`,e.DownloadUpdate=`downloadUpdate`,e.ApplyUpdate=`applyUpdate`,e.QuitAndInstall=`quitAndInstall`})(iJ||={});var aJ;(function(e){e.Readme=`readme`,e.Features=`features`,e.Changelog=`changelog`,e.Dependencies=`dependencies`,e.ExtensionPack=`extensionPack`})(aJ||={});let oJ=class extends v{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(let t of this.containers)e&&t.extension?Ow(t.extension.identifier,e.identifier)&&(t.extension.server&&e.server&&t.extension.server!==e.server?t.updateWhenCounterExtensionChanges&&t.update():t.extension=e):t.update()}};oJ=k([A(1,nJ)],oJ),new F(`defaultExtensionViews`,!0),new F(`hasOutdatedExtensions`,!1),new F(`hasGallery`,!1),new F(`extensionsGalleryStatus`,tJ.Unavailable),new F(`extensionResultListFocused `,!0),new F(`searchMcpServers`,!1),new F(`searchAgentPlugins`,!1),new Xq(`extensionsSearchActionsMenu`),new Xq(`extensionsFilterSubMenu`),vl.fromId(N.extensions.id),b(10249,`Search Extensions`),b(10250,`Search for VS Code extensions`),Fb.Internal;let sJ=class{constructor(e){this.extensionWorkbenchService=e}async invoke(e,t,n,r){let i=e.parameters;if(!i.keywords?.length&&!i.category&&!i.ids?.length)return{content:[{kind:`text`,value:b(10251,`Please provide a category or keywords or ids to search for.`)}]};let a=new Map,o=e=>{for(let t of e)t.deprecationInfo||t.isMalicious||a.set(t.identifier.id.toLowerCase(),{id:t.identifier.id,name:t.displayName,description:t.description,installed:t.state===rJ.Installed,installCount:t.installCount??0,rating:t.rating??0,categories:t.categories??[],tags:t.gallery?.tags??[]})},s=async e=>{let t=await this.extensionWorkbenchService.queryGallery({text:e,pageSize:10,sortBy:Qb.InstallCount},r);t.firstPage.length&&o(t.firstPage)};if(i.ids?.length&&o(await this.extensionWorkbenchService.getExtensions(i.ids.map(e=>({id:e})),r)),i.keywords?.length)for(let e of i.keywords??[])if(e===`featured`)await s(`featured`);else{let t=i.category?`category:"${i.category}"`:``;t=e?`${t} ${e}`.trim():t,await s(t)}else await s(`category:"${i.category}"`);let c=Array.from(a.values());return{content:[{kind:`text`,value:`Here are the list of extensions:\n${JSON.stringify(c)}\n. 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.\n\`\`\`vscode-extensions\nextensionId1,extensionId2\n\`\`\`\n.`}],toolResultDetails:{input:JSON.stringify(i),output:[{type:`embed`,isText:!0,value:JSON.stringify(c.map(e=>e.id))}]}}}};sJ=k([A(0,nJ)],sJ);var cJ=class{constructor(e){this._data=e}update(e){this._data=e,this._apiObject=void 0,this._apiObjectWithChatParticipantAdditions=void 0}get data(){return this._data}get apiObject(){return this._apiObject||=Object.freeze({name:this._data.id,description:this._data.modelDescription,inputSchema:this._data.inputSchema,tags:this._data.tags??[],source:void 0}),this._apiObject}get apiObjectWithChatParticipantAdditions(){return this._apiObjectWithChatParticipantAdditions||=Object.freeze({name:this._data.id,description:this._data.modelDescription,inputSchema:this._data.inputSchema,tags:this._data.tags??[],source:IN.to(this._data.source),fullReferenceName:this._data.fullReferenceName}),this._apiObjectWithChatParticipantAdditions}},lJ=class{constructor(e,t){this._languageModels=t,this._registeredTools=new Map,this._tokenCountFuncs=new Map,this._allTools=new Map,this._proxy=e.getProxy(T.MainThreadLanguageModelTools),this._proxy.$getTools().then(e=>{for(let t of e)this._allTools.set(t.id,new cJ(Ju(t)))})}async $countTokensForInvocation(e,t,n){let r=this._tokenCountFuncs.get(e);if(!r)throw Error(`Tool invocation call ${e} not found`);return await r(t,n)}async invokeTool(e,t,n,r){let i=typeof t==`string`?t:t.name,a=Gc();n.tokenizationOptions&&this._tokenCountFuncs.set(a,n.tokenizationOptions.countTokens);try{if(n.toolInvocationToken&&!Ib(n.toolInvocationToken))throw Error(`Invalid tool invocation token`);if((i===`vscode_editFile_internal`||i===`vscode_editFile`)&&!Mw(e,`chatParticipantPrivate`))throw Error(`Invalid tool: ${i}`);let t=await this._proxy.$invokeTool({toolId:i,callId:a,parameters:n.input,tokenBudget:n.tokenizationOptions?.tokenBudget,context:n.toolInvocationToken,chatRequestId:Mw(e,`chatParticipantPrivate`)?n.chatRequestId:void 0,chatInteractionId:Mw(e,`chatParticipantPrivate`)?n.chatInteractionId:void 0,subAgentInvocationId:Mw(e,`chatParticipantPrivate`)?n.subAgentInvocationId:void 0,chatStreamToolCallId:Mw(e,`chatParticipantAdditions`)?n.chatStreamToolCallId:void 0,preToolUseResult:Mw(e,`chatParticipantPrivate`)?n.preToolUseResult:void 0,traceparent:Mw(e,`chatParticipantPrivate`)?n.traceparent:void 0,tracestate:Mw(e,`chatParticipantPrivate`)?n.tracestate:void 0},r),o=t instanceof Ci?t.value:t;return LN.to(Ju(o))}finally{this._tokenCountFuncs.delete(a)}}$onDidChangeTools(e){let t=new Set(this._allTools.keys());for(let n of e){t.delete(n.id);let e=this._allTools.get(n.id);e?e.update(n):this._allTools.set(n.id,new cJ(Ju(n)))}for(let e of t)this._allTools.delete(e)}getTools(e){let t=Mw(e);return Array.from(this._allTools.values()).map(e=>t?e.apiObjectWithChatParticipantAdditions:e.apiObject).filter(t=>{switch(t.name){case rK:case`vscode_editFile`:case`vscode_fetchWebPage_internal`:case`vscode_searchExtensions_internal`:return Mw(e);default:return!0}})}async $invokeTool(e,t){let n=this._registeredTools.get(e.toolId);if(!n)throw Error(`Unknown tool ${e.toolId}`);let r={input:e.parameters,toolInvocationToken:Ju(e.context)};Mw(n.extension)&&(r.chatRequestId=e.chatRequestId,r.chatInteractionId=e.chatInteractionId,r.chatSessionResource=C.revive(e.context?.sessionResource),r.workingDirectory=C.revive(e.context?.workingDirectory),r.subAgentInvocationId=e.subAgentInvocationId,r.traceparent=e.traceparent,r.tracestate=e.tracestate),Mw(n.extension)&&e.modelId&&(r.model=await this.getModel(e.modelId,n.extension)),Mw(n.extension)&&e.chatStreamToolCallId&&(r.chatStreamToolCallId=e.chatStreamToolCallId),e.tokenBudget!==void 0&&(r.tokenizationOptions={tokenBudget:e.tokenBudget,countTokens:this._tokenCountFuncs.get(e.callId)||((t,n=Bi.None)=>this._proxy.$countTokensForInvocation(e.callId,t,n))});let i;if(Mw(n.extension)){let t;i={report:n=>{n.increment!==void 0&&(t=(t??0)+n.increment),this._proxy.$acceptToolProgress(e.callId,{message:Y.fromStrict(n.message),progress:t===void 0?void 0:t/100})}}}let a=await bo(Promise.resolve(n.tool.invoke(r,t,i)),t);if(!a)throw new ie;return LN.from(a,n.extension)}async getModel(e,t){let n;if(e&&(n=await this._languageModels.getLanguageModelByIdentifier(t,e)),!n&&(n=await this._languageModels.getDefaultLanguageModel(t),!n))throw Error(`Language model unavailable`);return n}async $handleToolStream(e,t,n){let r=this._registeredTools.get(e);if(!r)throw Error(`Unknown tool ${e}`);if(!r.tool.handleToolStream)return;K(r.extension,`chatParticipantAdditions`);let i={rawInput:t.rawInput,chatRequestId:t.chatRequestId,chatSessionResource:t.chatSessionResource,chatInteractionId:t.chatInteractionId},a=await r.tool.handleToolStream(i,n);if(a)return{invocationMessage:Y.fromStrict(a.invocationMessage)}}async $prepareToolInvocation(e,t,n){let r=this._registeredTools.get(e);if(!r)throw Error(`Unknown tool ${e}`);let i={input:t.parameters,chatRequestId:t.chatRequestId,chatSessionResource:t.chatSessionResource,chatInteractionId:t.chatInteractionId,workingDirectory:C.revive(t.workingDirectory),forceConfirmationReason:t.forceConfirmationReason};if(t.forceConfirmationReason&&K(r.extension,`chatParticipantPrivate`),r.tool.prepareInvocation){let a=await r.tool.prepareInvocation(i,n);if(!a)return;(a.pastTenseMessage||a.presentation)&&K(r.extension,`chatParticipantPrivate`),a.confirmationMessages?.approveCombination!==void 0&&K(r.extension,`toolInvocationApproveCombination`);let o=a.confirmationMessages?.approveCombination,s=o?Y.fromStrict(o.message):void 0,c=s?await $G(e,t.parameters):void 0;return{confirmationMessages:a.confirmationMessages?{title:typeof a.confirmationMessages.title==`string`?a.confirmationMessages.title:Y.from(a.confirmationMessages.title),message:typeof a.confirmationMessages.message==`string`?a.confirmationMessages.message:Y.from(a.confirmationMessages.message),approveCombination:s&&c?{label:s,key:c,arguments:o.arguments}:void 0}:void 0,invocationMessage:Y.fromStrict(a.invocationMessage),pastTenseMessage:Y.fromStrict(a.pastTenseMessage),presentation:a.presentation}}}registerTool(e,t,n){return this._registeredTools.set(t,{extension:e,tool:n}),this._proxy.$registerTool(t,typeof n.handleToolStream==`function`),g(()=>{this._registeredTools.delete(t),this._proxy.$unregisterTool(t)})}registerToolDefinition(e,t,n){K(e,`languageModelToolSupportsModel`);let r=t.name,i={id:r,displayName:t.displayName,toolReferenceName:t.toolReferenceName,userDescription:t.userDescription,modelDescription:t.description,inputSchema:t.inputSchema,source:{type:`extension`,label:e.displayName??e.name,extensionId:e.identifier},icon:RN.from(t.icon),models:t.models,toolSet:t.toolSet};return this._registeredTools.set(r,{extension:e,tool:n}),this._proxy.$registerToolWithDefinition(e.identifier,i,typeof n.handleToolStream==`function`),g(()=>{this._registeredTools.delete(r),this._proxy.$unregisterTool(r)})}},uJ=class{constructor(e,t,n,r){this._documents=t,this._commands=n,this._uriTransformer=r,this._languageIds=[],this._handlePool=0,this._ids=new Set,this._proxy=e.getProxy(T.MainThreadLanguages)}$acceptLanguageIds(e){this._languageIds=e}async getLanguages(){return this._languageIds.slice(0)}async changeLanguage(e,t){await this._proxy.$changeLanguage(e,t);let n=this._documents.getDocumentData(e);if(!n)throw Error(`document '${e.toString()}' NOT found`);return n.document}async tokenAtPosition(e,t){let n=e.version,r=fj.from(t),i=await this._proxy.$tokensAtPosition(e.uri,r),a={type:WO.Other,range:e.getWordRangeAtPosition(t)??new sT(t.line,t.character,t.line,t.character)};if(!i)return a;let o={range:J.to(i.range),type:dj.to(i.type)};return!o.range.contains(t)||n!==e.version?a:o}createLanguageStatusItem(e,t,n){let r=this._handlePool++,i=this._proxy,a=this._ids,o=`${e.identifier.value}/${t}`;if(a.has(o))throw Error(`LanguageStatusItem with id '${t}' ALREADY exists`);a.add(o);let s={selector:n,id:t,name:e.displayName??e.name,severity:mE.Information,command:void 0,text:``,detail:``,busy:!1},c,l=new _,u=()=>{if(c?.dispose(),!a.has(o)){console.warn(`LanguageStatusItem (${t}) from ${e.identifier.value} has been disposed and CANNOT be updated anymore`);return}c=No(()=>{l.clear(),this._proxy.$setLanguageStatus(r,{id:o,name:s.name??e.displayName??e.name,source:e.displayName??e.name,selector:pj.from(s.selector,this._uriTransformer),label:s.text,detail:s.detail??``,severity:s.severity===mE.Error?Nc.Error:s.severity===mE.Warning?Nc.Warning:Nc.Info,command:s.command&&this._commands.toInternal(s.command,l),accessibilityInfo:s.accessibilityInformation,busy:s.busy})},0)};return u(),{dispose(){l.dispose(),c?.dispose(),i.$removeLanguageStatus(r),a.delete(o)},get id(){return s.id},get name(){return s.name},set name(e){s.name=e,u()},get selector(){return s.selector},set selector(e){s.selector=e,u()},get text(){return s.text},set text(e){s.text=e,u()},set text2(t){K(e,`languageStatusText`),s.text=t,u()},get text2(){return K(e,`languageStatusText`),s.text},get detail(){return s.detail},set detail(e){s.detail=e,u()},get severity(){return s.severity},set severity(e){s.severity=e,u()},get accessibilityInformation(){return s.accessibilityInformation},set accessibilityInformation(e){s.accessibilityInformation=e,u()},get command(){return s.command},set command(e){s.command=e,u()},get busy(){return s.busy},set busy(e){s.busy=e,u()}}}};function dJ(e){return e&&e.title}let fJ=class{constructor(e,t){this._logService=t,this._proxy=e.getProxy(T.MainThreadMessageService)}showMessage(e,t,n,r,i){let a={source:{identifier:e.identifier,label:e.displayName||e.name}},o;typeof r==`string`||dJ(r)?o=[r,...i]:(a.modal=r?.modal,a.useCustom=r?.useCustom,a.detail=r?.detail,o=i),a.useCustom&&K(e,`resolvers`);let s=[],c=!1;for(let t=0;t<o.length;t++){let n=o[t];if(typeof n==`string`)s.push({title:n,handle:t,isCloseAffordance:!1});else if(typeof n==`object`){let{title:r,isCloseAffordance:i}=n;s.push({title:r,isCloseAffordance:!!i,handle:t}),i&&(c?this._logService.warn(`[${e.identifier}] Only one message item can have 'isCloseAffordance':`,n):c=!0)}else this._logService.warn(`[${e.identifier}] Invalid message item:`,n)}return this._proxy.$showMessage(t,n,a,s).then(e=>{if(typeof e==`number`)return o[e]})}};fJ=k([A(1,Ns)],fJ);var pJ=class{constructor(e,t,n,r){this.start=e,this.deletedCount=t,this.deletedItems=n,this.items=r}asApiEvent(){return{range:new yT(this.start,this.start+this.deletedCount),addedCells:this.items.map(e=>e.apiCell),removedCells:this.deletedItems}}},mJ=class{static asModelAddData(e){return{EOL:e.eol,lines:e.source,languageId:e.language,uri:e.uri,isDirty:!1,versionId:1,encoding:`utf8`}}constructor(e,t,n){this.notebook=e,this._extHostDocument=t,this._cellData=n,this.handle=n.handle,this.uri=C.revive(n.uri),this.cellKind=n.cellKind,this._outputs=n.outputs.map(xM.to),this._internalMetadata=n.internalMetadata??{},this._metadata=Object.freeze(n.metadata??{}),this._previousResult=Object.freeze(gM.to(n.internalMetadata??{}))}get internalMetadata(){return this._internalMetadata}get apiCell(){if(!this._apiCell){let e=this,t=this._extHostDocument.getDocument(this.uri);if(!t)throw Error(`MISSING extHostDocument for notebook cell: ${this.uri}`);let n={get index(){return e.notebook.getCellIndex(e)},notebook:e.notebook.apiNotebook,kind:_M.to(this._cellData.cellKind),document:t.document,get mime(){return e._mime},set mime(t){e._mime=t},get outputs(){return e._outputs.slice(0)},get metadata(){return e._metadata},get executionSummary(){return e._previousResult}};this._apiCell=Object.freeze(n)}return this._apiCell}setOutputs(e){this._outputs=e.map(xM.to)}setOutputItems(e,t,n){let r=n.map(bM.to),i=this._outputs.find(t=>t.id===e);if(i&&(t||(i.items.length=0),i.items.push(...r),i.items.length>1&&i.items.every(e=>Qu(e.mime)))){let e=new Map,t=[];i.items.forEach(n=>{let r;e.has(n.mime)?r=e.get(n.mime):(r=[],e.set(n.mime,r),t.push(n.mime)),r.push(n.data)}),i.items.length=0,t.forEach(t=>{let n=yC(e.get(t));i.items.push({mime:t,data:n.data.buffer})})}}setMetadata(e){this._metadata=Object.freeze(e)}setInternalMetadata(e){this._internalMetadata=e,this._previousResult=Object.freeze(gM.to(e))}setMime(e){}},hJ=class e{static{this._handlePool=0}constructor(t,n,r,i,a){this._proxy=t,this._textDocumentsAndEditors=n,this._textDocuments=r,this.uri=i,this.handle=e._handlePool++,this._cells=[],this._versionId=0,this._isDirty=!1,this._disposed=!1,this._notebookType=a.viewType,this._metadata=Object.freeze(a.metadata??Object.create(null)),this._spliceNotebookCells([[0,0,a.cells]],!0,void 0),this._versionId=a.versionId}dispose(){this._disposed=!0}get versionId(){return this._versionId}get apiNotebook(){if(!this._notebook){let e=this,t={get uri(){return e.uri},get version(){return e._versionId},get notebookType(){return e._notebookType},get isDirty(){return e._isDirty},get isUntitled(){return e.uri.scheme===D.untitled},get isClosed(){return e._disposed},get metadata(){return e._metadata},get cellCount(){return e._cells.length},cellAt(t){return t=e._validateIndex(t),e._cells[t].apiCell},getCells(t){return(t?e._getCells(t):e._cells).map(e=>e.apiCell)},save(){return e._save()},[Symbol.for(`debug.description`)](){return`NotebookDocument(${this.uri.toString()})`}};this._notebook=Object.freeze(t)}return this._notebook}acceptDocumentPropertiesChanged(e){e.metadata&&(this._metadata=Object.freeze({...this._metadata,...e.metadata}))}acceptDirty(e){this._isDirty=e}acceptModelChanged(e,t,n){this._versionId=e.versionId,this._isDirty=t,this.acceptDocumentPropertiesChanged({metadata:n});let r={notebook:this.apiNotebook,metadata:n,cellChanges:[],contentChanges:[]},i=[];for(let t of e.rawEvents)t.kind===uC.ModelChange?this._spliceNotebookCells(t.changes,!1,r.contentChanges):t.kind===uC.Move?this._moveCells(t.index,t.length,t.newIdx,r.contentChanges):t.kind===uC.Output?(this._setCellOutputs(t.index,t.outputs),i.push({cell:this._cells[t.index].apiCell,outputs:this._cells[t.index].apiCell.outputs})):t.kind===uC.OutputItem?(this._setCellOutputItems(t.index,t.outputId,t.append,t.outputItems),i.push({cell:this._cells[t.index].apiCell,outputs:this._cells[t.index].apiCell.outputs})):t.kind===uC.ChangeCellLanguage?(this._changeCellLanguage(t.index,t.language),i.push({cell:this._cells[t.index].apiCell,document:this._cells[t.index].apiCell.document})):t.kind===uC.ChangeCellContent?i.push({cell:this._cells[t.index].apiCell,document:this._cells[t.index].apiCell.document}):t.kind===uC.ChangeCellMime?this._changeCellMime(t.index,t.mime):t.kind===uC.ChangeCellMetadata?(this._changeCellMetadata(t.index,t.metadata),i.push({cell:this._cells[t.index].apiCell,metadata:this._cells[t.index].apiCell.metadata})):t.kind===uC.ChangeCellInternalMetadata&&(this._changeCellInternalMetadata(t.index,t.internalMetadata),i.push({cell:this._cells[t.index].apiCell,executionSummary:this._cells[t.index].apiCell.executionSummary}));let a=new Map;for(let e=0;e<i.length;e++){let t=i[e],n=a.get(t.cell);if(n===void 0){let e=r.cellChanges.push({document:void 0,executionSummary:void 0,metadata:void 0,outputs:void 0,...t});a.set(t.cell,e-1)}else r.cellChanges[n]={...r.cellChanges[n],...t}}return r}_validateIndex(e){return e|=0,e<0?0:e>=this._cells.length?this._cells.length-1:e}_validateRange(e){let t=e.start|0,n=e.end|0;return t<0&&(t=0),n>this._cells.length&&(n=this._cells.length),e.with({start:t,end:n})}_getCells(e){e=this._validateRange(e);let t=[];for(let n=e.start;n<e.end;n++)t.push(this._cells[n]);return t}async _save(){return this._disposed?Promise.reject(Error(`Notebook has been closed`)):this._proxy.$trySaveNotebook(this.uri)}_spliceNotebookCells(e,t,n){if(this._disposed)return;let r=[],i=[],a=[];if(e.reverse().forEach(e=>{let n=e[2].map(e=>{let n=new mJ(this,this._textDocumentsAndEditors,e);return t||i.push(mJ.asModelAddData(e)),n}),o=new pJ(e[0],e[1],[],n),s=this._cells.splice(e[0],e[1],...n);for(let e of s)a.push(e.uri),o.deletedItems.push(e.apiCell);r.push(o)}),this._textDocumentsAndEditors.acceptDocumentsAndEditorsDelta({addedDocuments:i,removedDocuments:a}),n)for(let e of r)n.push(e.asApiEvent())}_moveCells(e,t,n,r){let i=this._cells.splice(e,t);this._cells.splice(n,0,...i);let a=[new pJ(e,t,i.map(e=>e.apiCell),[]),new pJ(n,0,[],i)];for(let e of a)r.push(e.asApiEvent())}_setCellOutputs(e,t){this._cells[e].setOutputs(t)}_setCellOutputItems(e,t,n,r){this._cells[e].setOutputItems(t,n,r)}_changeCellLanguage(e,t){let n=this._cells[e];n.apiCell.document.languageId!==t&&this._textDocuments.$acceptModelLanguageChanged(n.uri,t)}_changeCellMime(e,t){let n=this._cells[e];n.apiCell.mime=t}_changeCellMetadata(e,t){this._cells[e].setMetadata(t)}_changeCellInternalMetadata(e,t){this._cells[e].setInternalMetadata(t)}getCellFromApiCell(e){return this._cells.find(t=>t.apiCell===e)}getCellFromIndex(e){return this._cells[e]}getCell(e){return this._cells.find(t=>t.handle===e)}getCellIndex(e){return this._cells.indexOf(e)}},gJ=class e{static{this.apiEditorsToExtHost=new WeakMap}constructor(e,t,n,r,i,a,o){this.id=e,this._proxy=t,this.notebookData=n,this._visibleRanges=r,this._selections=i,this._viewColumn=a,this.viewType=o,this._visible=!1}get apiEditor(){if(!this._editor){let t=this;this._editor={get notebook(){return t.notebookData.apiNotebook},get selection(){return t._selections[0]},set selection(e){this.selections=[e]},get selections(){return t._selections},set selections(e){if(!Array.isArray(e)||!e.every(yT.isNotebookRange))throw se(`selections`);t._selections=e.length===0?[new yT(0,0)]:e,t._trySetSelections(t._selections)},get visibleRanges(){return t._visibleRanges},revealRange(e,n){t._proxy.$tryRevealRange(t.id,hM.from(e),n??PO.Default)},get viewColumn(){return t._viewColumn},get replOptions(){if(t.viewType===`repl`)return{appendIndex:this.notebook.cellCount-1}},[Symbol.for(`debug.description`)](){return`NotebookEditor(${this.notebook.uri.toString()})`}},e.apiEditorsToExtHost.set(this._editor,this)}return this._editor}get visible(){return this._visible}_acceptVisibility(e){this._visible=e}_acceptVisibleRanges(e){this._visibleRanges=e}_acceptSelections(e){this._selections=e}_trySetSelections(e){this._proxy.$trySetSelections(this.id,e.map(hM.from))}_acceptViewColumn(e){this._viewColumn=e}},_J=class{constructor(e,t){this.piece=e,this.color=t,this.size_left=0,this.lf_left=0,this.parent=this,this.left=this,this.right=this}next(){if(this.right!==$)return yJ(this.right);let e=this;for(;e.parent!==$&&e.parent.left!==e;)e=e.parent;return e.parent===$?$:e.parent}prev(){if(this.left!==$)return bJ(this.left);let e=this;for(;e.parent!==$&&e.parent.right!==e;)e=e.parent;return e.parent===$?$:e.parent}detach(){this.parent=null,this.left=null,this.right=null}},vJ;(function(e){e[e.Black=0]=`Black`,e[e.Red=1]=`Red`})(vJ||={});const $=new _J(null,vJ.Black);$.parent=$,$.left=$,$.right=$,$.color=vJ.Black;function yJ(e){for(;e.left!==$;)e=e.left;return e}function bJ(e){for(;e.right!==$;)e=e.right;return e}function xJ(e){return e===$?0:e.size_left+e.piece.length+xJ(e.right)}function SJ(e){return e===$?0:e.lf_left+e.piece.lineFeedCnt+SJ(e.right)}function CJ(){$.parent=$}function wJ(e,t){let n=t.right;n.size_left+=t.size_left+(t.piece?t.piece.length:0),n.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=n.left,n.left!==$&&(n.left.parent=t),n.parent=t.parent,t.parent===$?e.root=n:t.parent.left===t?t.parent.left=n:t.parent.right=n,n.left=t,t.parent=n}function TJ(e,t){let n=t.left;t.left=n.right,n.right!==$&&(n.right.parent=t),n.parent=t.parent,t.size_left-=n.size_left+(n.piece?n.piece.length:0),t.lf_left-=n.lf_left+(n.piece?n.piece.lineFeedCnt:0),t.parent===$?e.root=n:t===t.parent.right?t.parent.right=n:t.parent.left=n,n.right=t,t.parent=n}function EJ(e,t){let n,r;if(t.left===$?(r=t,n=r.right):t.right===$?(r=t,n=r.left):(r=yJ(t.right),n=r.right),r===e.root){e.root=n,n.color=vJ.Black,t.detach(),CJ(),e.root.parent=$;return}let i=r.color===vJ.Red;if(r===r.parent.left?r.parent.left=n:r.parent.right=n,r===t?(n.parent=r.parent,kJ(e,n)):(r.parent===t?n.parent=r:n.parent=r.parent,kJ(e,n),r.left=t.left,r.right=t.right,r.parent=t.parent,r.color=t.color,t===e.root?e.root=r:t===t.parent.left?t.parent.left=r:t.parent.right=r,r.left!==$&&(r.left.parent=r),r.right!==$&&(r.right.parent=r),r.size_left=t.size_left,r.lf_left=t.lf_left,kJ(e,r)),t.detach(),n.parent.left===n){let t=xJ(n),r=SJ(n);if(t!==n.parent.size_left||r!==n.parent.lf_left){let i=t-n.parent.size_left,a=r-n.parent.lf_left;n.parent.size_left=t,n.parent.lf_left=r,OJ(e,n.parent,i,a)}}if(kJ(e,n.parent),i){CJ();return}let a;for(;n!==e.root&&n.color===vJ.Black;)n===n.parent.left?(a=n.parent.right,a.color===vJ.Red&&(a.color=vJ.Black,n.parent.color=vJ.Red,wJ(e,n.parent),a=n.parent.right),a.left.color===vJ.Black&&a.right.color===vJ.Black?(a.color=vJ.Red,n=n.parent):(a.right.color===vJ.Black&&(a.left.color=vJ.Black,a.color=vJ.Red,TJ(e,a),a=n.parent.right),a.color=n.parent.color,n.parent.color=vJ.Black,a.right.color=vJ.Black,wJ(e,n.parent),n=e.root)):(a=n.parent.left,a.color===vJ.Red&&(a.color=vJ.Black,n.parent.color=vJ.Red,TJ(e,n.parent),a=n.parent.left),a.left.color===vJ.Black&&a.right.color===vJ.Black?(a.color=vJ.Red,n=n.parent):(a.left.color===vJ.Black&&(a.right.color=vJ.Black,a.color=vJ.Red,wJ(e,a),a=n.parent.left),a.color=n.parent.color,n.parent.color=vJ.Black,a.left.color=vJ.Black,TJ(e,n.parent),n=e.root));n.color=vJ.Black,CJ()}function DJ(e,t){for(kJ(e,t);t!==e.root&&t.parent.color===vJ.Red;)if(t.parent===t.parent.parent.left){let n=t.parent.parent.right;n.color===vJ.Red?(t.parent.color=vJ.Black,n.color=vJ.Black,t.parent.parent.color=vJ.Red,t=t.parent.parent):(t===t.parent.right&&(t=t.parent,wJ(e,t)),t.parent.color=vJ.Black,t.parent.parent.color=vJ.Red,TJ(e,t.parent.parent))}else{let n=t.parent.parent.left;n.color===vJ.Red?(t.parent.color=vJ.Black,n.color=vJ.Black,t.parent.parent.color=vJ.Red,t=t.parent.parent):(t===t.parent.left&&(t=t.parent,TJ(e,t)),t.parent.color=vJ.Black,t.parent.parent.color=vJ.Red,wJ(e,t.parent.parent))}e.root.color=vJ.Black}function OJ(e,t,n,r){for(;t!==e.root&&t!==$;)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}function kJ(e,t){let n=0,r=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(t=t.parent,n=xJ(t.left)-t.size_left,r=SJ(t.left)-t.lf_left,t.size_left+=n,t.lf_left+=r;t!==e.root&&(n!==0||r!==0);)t.parent.left===t&&(t.parent.size_left+=n,t.parent.lf_left+=r),t=t.parent}}const AJ=65535;function jJ(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}var MJ=class{constructor(e,t,n,r,i){this.lineStarts=e,this.cr=t,this.lf=n,this.crlf=r,this.isBasicASCII=i}};function NJ(e,t=!0){let n=[0],r=1;for(let t=0,i=e.length;t<i;t++){let a=e.charCodeAt(t);a===S.CarriageReturn?t+1<i&&e.charCodeAt(t+1)===S.LineFeed?(n[r++]=t+2,t++):n[r++]=t+1:a===S.LineFeed&&(n[r++]=t+1)}return t?jJ(n):n}function PJ(e,t){e.length=0,e[0]=0;let n=1,r=0,i=0,a=0,o=!0;for(let s=0,c=t.length;s<c;s++){let l=t.charCodeAt(s);l===S.CarriageReturn?s+1<c&&t.charCodeAt(s+1)===S.LineFeed?(a++,e[n++]=s+2,s++):(r++,e[n++]=s+1):l===S.LineFeed?(i++,e[n++]=s+1):o&&l!==S.Tab&&(l<32||l>126)&&(o=!1)}let s=new MJ(jJ(e),r,i,a,o);return e.length=0,s}var FJ=class{constructor(e,t,n,r,i){this.bufferIndex=e,this.start=t,this.end=n,this.lineFeedCnt=r,this.length=i}},IJ=class{constructor(e,t){this.buffer=e,this.lineStarts=t}},LJ=class{constructor(e,t){this._pieces=[],this._tree=e,this._BOM=t,this._index=0,e.root!==$&&e.iterate(e.root,e=>(e!==$&&this._pieces.push(e.piece),!0))}read(){return this._pieces.length===0?this._index===0?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:this._index===0?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}},RJ=class{constructor(e){this._limit=e,this._cache=[]}get(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartOffset<=e&&n.nodeStartOffset+n.node.piece.length>=e)return n}return null}get2(e){for(let t=this._cache.length-1;t>=0;t--){let n=this._cache[t];if(n.nodeStartLineNumber&&n.nodeStartLineNumber<e&&n.nodeStartLineNumber+n.node.piece.lineFeedCnt>=e)return n}return null}set(e){this._cache.length>=this._limit&&this._cache.shift(),this._cache.push(e)}validate(e){let t=!1,n=this._cache;for(let r=0;r<n.length;r++){let i=n[r];if(i.node.parent===null||i.nodeStartOffset>=e){n[r]=null,t=!0;continue}}if(t){let e=[];for(let t of n)t!==null&&e.push(t);this._cache=e}}},zJ=class{constructor(e,t,n){this.create(e,t,n)}create(e,t,n){this._buffers=[new IJ(``,[0])],this._lastChangeBufferPos={line:0,column:0},this.root=$,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=n;let r=null;for(let t=0,n=e.length;t<n;t++)if(e[t].buffer.length>0){e[t].lineStarts||(e[t].lineStarts=NJ(e[t].buffer));let n=new FJ(t+1,{line:0,column:0},{line:e[t].lineStarts.length-1,column:e[t].buffer.length-e[t].lineStarts[e[t].lineStarts.length-1]},e[t].lineStarts.length-1,e[t].buffer.length);this._buffers.push(e[t]),r=this.rbInsertRight(r,n)}this._searchCache=new RJ(1),this._lastVisitedLine={lineNumber:0,value:``},this.computeBufferMetadata()}normalizeEOL(e){let t=``,n=0,r=[];if(this.iterate(this.root,i=>{let a=this.getNodeContent(i),o=a.length;if(n<=43690||n+o<87380)return t+=a,n+=o,!0;let s=t.replace(/\r\n|\r|\n/g,e);return r.push(new IJ(s,NJ(s))),t=a,n=o,!0}),n>0){let n=t.replace(/\r\n|\r|\n/g,e);r.push(new IJ(n,NJ(n)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new LJ(this,e)}equal(e){if(this.getLength()!==e.getLength()||this.getLineCount()!==e.getLineCount())return!1;let t=0;return this.iterate(this.root,n=>{if(n===$)return!0;let r=this.getNodeContent(n),i=r.length,a=e.nodeAt(t),o=e.nodeAt(t+i),s=e.getValueInRange2(a,o);return t+=i,r===s})}getOffsetAt(e,t){let n=0,r=this.root;for(;r!==$;)if(r.left!==$&&r.lf_left+1>=e)r=r.left;else if(r.lf_left+r.piece.lineFeedCnt+1>=e){n+=r.size_left;let i=this.getAccumulatedValue(r,e-r.lf_left-2);return n+=i+t-1}else e-=r.lf_left+r.piece.lineFeedCnt,n+=r.size_left+r.piece.length,r=r.right;return n}getPositionAt(e){e=Math.floor(e),e=Math.max(0,e);let t=this.root,n=0,r=e;for(;t!==$;)if(t.size_left!==0&&t.size_left>=e)t=t.left;else if(t.size_left+t.piece.length>=e){let i=this.getIndexOf(t,e-t.size_left);if(n+=t.lf_left+i.index,i.index===0){let e=r-this.getOffsetAt(n+1,1);return new Tp(n+1,e+1)}return new Tp(n+1,i.remainder+1)}else if(e-=t.size_left+t.piece.length,n+=t.lf_left+t.piece.lineFeedCnt,t.right===$){let t=this.getOffsetAt(n+1,1),i=r-e-t;return new Tp(n+1,i+1)}else t=t.right;return new Tp(1,1)}getValueInRange(e,t){if(e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn)return``;let n=this.nodeAt2(e.startLineNumber,e.startColumn),r=this.nodeAt2(e.endLineNumber,e.endColumn),i=this.getValueInRange2(n,r);return t?t!==this._EOL||!this._EOLNormalized?i.replace(/\r\n|\r|\n/g,t):t===this.getEOL()&&this._EOLNormalized?i:i.replace(/\r\n|\r|\n/g,t):i}getValueInRange2(e,t){if(e.node===t.node){let n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r.substring(i+e.remainder,i+t.remainder)}let n=e.node,r=this._buffers[n.piece.bufferIndex].buffer,i=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start),a=r.substring(i+e.remainder,i+n.piece.length);for(n=n.next();n!==$;){let e=this._buffers[n.piece.bufferIndex].buffer,r=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(n===t.node){a+=e.substring(r,r+t.remainder);break}else a+=e.substr(r,n.piece.length);n=n.next()}return a}getLinesContent(){let e=[],t=0,n=``,r=!1;return this.iterate(this.root,i=>{if(i===$)return!0;let a=i.piece,o=a.length;if(o===0)return!0;let s=this._buffers[a.bufferIndex].buffer,c=this._buffers[a.bufferIndex].lineStarts,l=a.start.line,u=a.end.line,d=c[l]+a.start.column;if(r&&(s.charCodeAt(d)===S.LineFeed&&(d++,o--),e[t++]=n,n=``,r=!1,o===0))return!0;if(l===u)return!this._EOLNormalized&&s.charCodeAt(d+o-1)===S.CarriageReturn?(r=!0,n+=s.substr(d,o-1)):n+=s.substr(d,o),!0;n+=this._EOLNormalized?s.substring(d,Math.max(d,c[l+1]-this._EOLLength)):s.substring(d,c[l+1]).replace(/(\r\n|\r|\n)$/,``),e[t++]=n;for(let r=l+1;r<u;r++)n=this._EOLNormalized?s.substring(c[r],c[r+1]-this._EOLLength):s.substring(c[r],c[r+1]).replace(/(\r\n|\r|\n)$/,``),e[t++]=n;return!this._EOLNormalized&&s.charCodeAt(c[u]+a.end.column-1)===S.CarriageReturn?(r=!0,a.end.column===0?t--:n=s.substr(c[u],a.end.column-1)):n=s.substr(c[u],a.end.column),!0}),r&&(e[t++]=n,n=``),e[t++]=n,e}getLength(){return this._length}getLineCount(){return this._lineCnt}getLineContent(e){return this._lastVisitedLine.lineNumber===e?this._lastVisitedLine.value:(this._lastVisitedLine.lineNumber=e,e===this._lineCnt?this._lastVisitedLine.value=this.getLineRawContent(e):this._EOLNormalized?this._lastVisitedLine.value=this.getLineRawContent(e,this._EOLLength):this._lastVisitedLine.value=this.getLineRawContent(e).replace(/(\r\n|\r|\n)$/,``),this._lastVisitedLine.value)}_getCharCode(e){if(e.remainder===e.node.piece.length){let t=e.node.next();if(!t)return 0;let n=this._buffers[t.piece.bufferIndex],r=this.offsetInBuffer(t.piece.bufferIndex,t.piece.start);return n.buffer.charCodeAt(r)}else{let t=this._buffers[e.node.piece.bufferIndex],n=this.offsetInBuffer(e.node.piece.bufferIndex,e.node.piece.start)+e.remainder;return t.buffer.charCodeAt(n)}}getLineCharCode(e,t){let n=this.nodeAt2(e,t+1);return this._getCharCode(n)}getLineLength(e){if(e===this.getLineCount()){let t=this.getOffsetAt(e,1);return this.getLength()-t}return this.getOffsetAt(e+1,1)-this.getOffsetAt(e,1)-this._EOLLength}getCharCode(e){let t=this.nodeAt(e);return this._getCharCode(t)}getNearestChunk(e){let t=this.nodeAt(e);if(t.remainder===t.node.piece.length){let e=t.node.next();if(!e||e===$)return``;let n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start);return n.buffer.substring(r,r+e.piece.length)}else{let e=this._buffers[t.node.piece.bufferIndex],n=this.offsetInBuffer(t.node.piece.bufferIndex,t.node.piece.start),r=n+t.remainder,i=n+t.node.piece.length;return e.buffer.substring(r,i)}}findMatchesInNode(e,t,n,r,i,a,o,s,c,l,u){let d=this._buffers[e.piece.bufferIndex],f=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start),p=this.offsetInBuffer(e.piece.bufferIndex,i),m=this.offsetInBuffer(e.piece.bufferIndex,a),ee,te={line:0,column:0},ne,h;t._wordSeparators?(ne=d.buffer.substring(p,m),h=e=>e+p,t.reset(0)):(ne=d.buffer,h=e=>e,t.reset(p));do if(ee=t.next(ne),ee){if(h(ee.index)>=m)return l;this.positionInBuffer(e,h(ee.index)-f,te);let t=this.getLineFeedCnt(e.piece.bufferIndex,i,te),a=te.line===i.line?te.column-i.column+r:te.column+1,o=a+ee[0].length;if(u[l++]=hR(new Ep(n+t,a,n+t,o),ee,s),h(ee.index)+ee[0].length>=m||l>=c)return l}while(ee);return l}findMatchesLineByLine(e,t,n,r){let i=[],a=0,o=new yR(t.wordSeparators,t.regex),s=this.nodeAt2(e.startLineNumber,e.startColumn);if(s===null)return[];let c=this.nodeAt2(e.endLineNumber,e.endColumn);if(c===null)return[];let l=this.positionInBuffer(s.node,s.remainder),u=this.positionInBuffer(c.node,c.remainder);if(s.node===c.node)return this.findMatchesInNode(s.node,o,e.startLineNumber,e.startColumn,l,u,t,n,r,a,i),i;let d=e.startLineNumber,f=s.node;for(;f!==c.node;){let c=this.getLineFeedCnt(f.piece.bufferIndex,l,f.piece.end);if(c>=1){let s=this._buffers[f.piece.bufferIndex].lineStarts,u=this.offsetInBuffer(f.piece.bufferIndex,f.piece.start),p=s[l.line+c],m=d===e.startLineNumber?e.startColumn:1;if(a=this.findMatchesInNode(f,o,d,m,l,this.positionInBuffer(f,p-u),t,n,r,a,i),a>=r)return i;d+=c}let u=d===e.startLineNumber?e.startColumn-1:0;if(d===e.endLineNumber){let s=this.getLineContent(d).substring(u,e.endColumn-1);return a=this._findMatchesInLine(t,o,s,e.endLineNumber,u,a,i,n,r),i}if(a=this._findMatchesInLine(t,o,this.getLineContent(d).substr(u),d,u,a,i,n,r),a>=r)return i;d++,s=this.nodeAt2(d,1),f=s.node,l=this.positionInBuffer(s.node,s.remainder)}if(d===e.endLineNumber){let s=d===e.startLineNumber?e.startColumn-1:0,c=this.getLineContent(d).substring(s,e.endColumn-1);return a=this._findMatchesInLine(t,o,c,e.endLineNumber,s,a,i,n,r),i}let p=d===e.startLineNumber?e.startColumn:1;return a=this.findMatchesInNode(c.node,o,d,p,l,u,t,n,r,a,i),i}_findMatchesInLine(e,t,n,r,i,a,o,s,c){let l=e.wordSeparators;if(!s&&e.simpleSearch){let t=e.simpleSearch,s=t.length,u=n.length,d=-s;for(;(d=n.indexOf(t,d+s))!==-1;)if((!l||vR(l,n,u,d,s))&&(o[a++]=new _m(new Ep(r,d+1+i,r,d+1+s+i),null),a>=c))return a;return a}let u;t.reset(0);do if(u=t.next(n),u&&(o[a++]=hR(new Ep(r,u.index+1+i,r,u.index+1+u[0].length+i),u,s),a>=c))return a;while(u);return a}insert(e,t,n=!1){if(this._EOLNormalized=this._EOLNormalized&&n,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=``,this.root!==$){let{node:n,remainder:r,nodeStartOffset:i}=this.nodeAt(e),a=n.piece,o=a.bufferIndex,s=this.positionInBuffer(n,r);if(n.piece.bufferIndex===0&&a.end.line===this._lastChangeBufferPos.line&&a.end.column===this._lastChangeBufferPos.column&&i+a.length===e&&t.length<AJ){this.appendToNode(n,t),this.computeBufferMetadata();return}if(i===e)this.insertContentToNodeLeft(t,n),this._searchCache.validate(e);else if(i+n.piece.length>e){let e=[],i=new FJ(a.bufferIndex,s,a.end,this.getLineFeedCnt(a.bufferIndex,s,a.end),this.offsetInBuffer(o,a.end)-this.offsetInBuffer(o,s));if(this.shouldCheckCRLF()&&this.endWithCR(t)&&this.nodeCharCodeAt(n,r)===10){let e={line:i.start.line+1,column:0};i=new FJ(i.bufferIndex,e,i.end,this.getLineFeedCnt(i.bufferIndex,e,i.end),i.length-1),t+=`
|
|
188
|
+
`}if(this.shouldCheckCRLF()&&this.startWithLF(t))if(this.nodeCharCodeAt(n,r-1)===13){let i=this.positionInBuffer(n,r-1);this.deleteNodeTail(n,i),t=`\r`+t,n.piece.length===0&&e.push(n)}else this.deleteNodeTail(n,s);else this.deleteNodeTail(n,s);let c=this.createNewPieces(t);i.length>0&&this.rbInsertRight(n,i);let l=n;for(let e=0;e<c.length;e++)l=this.rbInsertRight(l,c[e]);this.deleteNodes(e)}else this.insertContentToNodeRight(t,n)}else{let e=this.createNewPieces(t),n=this.rbInsertLeft(null,e[0]);for(let t=1;t<e.length;t++)n=this.rbInsertRight(n,e[t])}this.computeBufferMetadata()}delete(e,t){if(this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value=``,t<=0||this.root===$)return;let n=this.nodeAt(e),r=this.nodeAt(e+t),i=n.node,a=r.node;if(i===a){let a=this.positionInBuffer(i,n.remainder),o=this.positionInBuffer(i,r.remainder);if(n.nodeStartOffset===e){if(t===i.piece.length){let e=i.next();EJ(this,i),this.validateCRLFWithPrevNode(e),this.computeBufferMetadata();return}this.deleteNodeHead(i,o),this._searchCache.validate(e),this.validateCRLFWithPrevNode(i),this.computeBufferMetadata();return}if(n.nodeStartOffset+i.piece.length===e+t){this.deleteNodeTail(i,a),this.validateCRLFWithNextNode(i),this.computeBufferMetadata();return}this.shrinkNode(i,a,o),this.computeBufferMetadata();return}let o=[],s=this.positionInBuffer(i,n.remainder);this.deleteNodeTail(i,s),this._searchCache.validate(e),i.piece.length===0&&o.push(i);let c=this.positionInBuffer(a,r.remainder);this.deleteNodeHead(a,c),a.piece.length===0&&o.push(a);let l=i.next();for(let e=l;e!==$&&e!==a;e=e.next())o.push(e);let u=i.piece.length===0?i.prev():i;this.deleteNodes(o),this.validateCRLFWithNextNode(u),this.computeBufferMetadata()}insertContentToNodeLeft(e,t){let n=[];if(this.shouldCheckCRLF()&&this.endWithCR(e)&&this.startWithLF(t)){let r=t.piece,i={line:r.start.line+1,column:0};t.piece=new FJ(r.bufferIndex,i,r.end,this.getLineFeedCnt(r.bufferIndex,i,r.end),r.length-1),e+=`
|
|
189
|
+
`,OJ(this,t,-1,-1),t.piece.length===0&&n.push(t)}let r=this.createNewPieces(e),i=this.rbInsertLeft(t,r[r.length-1]);for(let e=r.length-2;e>=0;e--)i=this.rbInsertLeft(i,r[e]);this.validateCRLFWithPrevNode(i),this.deleteNodes(n)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+=`
|
|
190
|
+
`);let n=this.createNewPieces(e),r=this.rbInsertRight(t,n[0]),i=r;for(let e=1;e<n.length;e++)i=this.rbInsertRight(i,n[e]);this.validateCRLFWithPrevNode(r)}positionInBuffer(e,t,n){let r=e.piece,i=e.piece.bufferIndex,a=this._buffers[i].lineStarts,o=a[r.start.line]+r.start.column+t,s=r.start.line,c=r.end.line,l=0,u=0,d=0;for(;s<=c&&(l=s+(c-s)/2|0,d=a[l],l!==c);)if(u=a[l+1],o<d)c=l-1;else if(o>=u)s=l+1;else break;return n?(n.line=l,n.column=o-d,null):{line:l,column:o-d}}getLineFeedCnt(e,t,n){if(n.column===0)return n.line-t.line;let r=this._buffers[e].lineStarts;if(n.line===r.length-1)return n.line-t.line;let i=r[n.line+1],a=r[n.line]+n.column;if(i>a+1)return n.line-t.line;let o=a-1;return this._buffers[e].buffer.charCodeAt(o)===13?n.line-t.line+1:n.line-t.line}offsetInBuffer(e,t){return this._buffers[e].lineStarts[t.line]+t.column}deleteNodes(e){for(let t=0;t<e.length;t++)EJ(this,e[t])}createNewPieces(e){if(e.length>AJ){let t=[];for(;e.length>AJ;){let n=e.charCodeAt(AJ-1),r;n===S.CarriageReturn||n>=55296&&n<=56319?(r=e.substring(0,AJ-1),e=e.substring(AJ-1)):(r=e.substring(0,AJ),e=e.substring(AJ));let i=NJ(r);t.push(new FJ(this._buffers.length,{line:0,column:0},{line:i.length-1,column:r.length-i[i.length-1]},i.length-1,r.length)),this._buffers.push(new IJ(r,i))}let n=NJ(e);return t.push(new FJ(this._buffers.length,{line:0,column:0},{line:n.length-1,column:e.length-n[n.length-1]},n.length-1,e.length)),this._buffers.push(new IJ(e,n)),t}let t=this._buffers[0].buffer.length,n=NJ(e,!1),r=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&t!==0&&this.startWithLF(e)&&this.endWithCR(this._buffers[0].buffer)){this._lastChangeBufferPos={line:this._lastChangeBufferPos.line,column:this._lastChangeBufferPos.column+1},r=this._lastChangeBufferPos;for(let e=0;e<n.length;e++)n[e]+=t+1;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=`_`+e,t+=1}else{if(t!==0)for(let e=0;e<n.length;e++)n[e]+=t;this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(n.slice(1)),this._buffers[0].buffer+=e}let i=this._buffers[0].buffer.length,a=this._buffers[0].lineStarts.length-1,o={line:a,column:i-this._buffers[0].lineStarts[a]},s=new FJ(0,r,o,this.getLineFeedCnt(0,r,o),i-t);return this._lastChangeBufferPos=o,[s]}getLinesRawContent(){return this.getContentOfSubTree(this.root)}getLineRawContent(e,t=0){let n=this.root,r=``,i=this._searchCache.get2(e);if(i){n=i.node;let a=this.getAccumulatedValue(n,e-i.nodeStartLineNumber-1),o=this._buffers[n.piece.bufferIndex].buffer,s=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);if(i.nodeStartLineNumber+n.piece.lineFeedCnt===e)r=o.substring(s+a,s+n.piece.length);else{let r=this.getAccumulatedValue(n,e-i.nodeStartLineNumber);return o.substring(s+a,s+r-t)}}else{let i=0,a=e;for(;n!==$;)if(n.left!==$&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let r=this.getAccumulatedValue(n,e-n.lf_left-2),o=this.getAccumulatedValue(n,e-n.lf_left-1),s=this._buffers[n.piece.bufferIndex].buffer,c=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return i+=n.size_left,this._searchCache.set({node:n,nodeStartOffset:i,nodeStartLineNumber:a-(e-1-n.lf_left)}),s.substring(c+r,c+o-t)}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let t=this.getAccumulatedValue(n,e-n.lf_left-2),i=this._buffers[n.piece.bufferIndex].buffer,a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r=i.substring(a+t,a+n.piece.length);break}else e-=n.lf_left+n.piece.lineFeedCnt,i+=n.size_left+n.piece.length,n=n.right}for(n=n.next();n!==$;){let e=this._buffers[n.piece.bufferIndex].buffer;if(n.piece.lineFeedCnt>0){let i=this.getAccumulatedValue(n,0),a=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);return r+=e.substring(a,a+i-t),r}else{let t=this.offsetInBuffer(n.piece.bufferIndex,n.piece.start);r+=e.substr(t,n.piece.length)}n=n.next()}return r}computeBufferMetadata(){let e=this.root,t=1,n=0;for(;e!==$;)t+=e.lf_left+e.piece.lineFeedCnt,n+=e.size_left+e.piece.length,e=e.right;this._lineCnt=t,this._length=n,this._searchCache.validate(this._length)}getIndexOf(e,t){let n=e.piece,r=this.positionInBuffer(e,t),i=r.line-n.start.line;if(this.offsetInBuffer(n.bufferIndex,n.end)-this.offsetInBuffer(n.bufferIndex,n.start)===t){let t=this.getLineFeedCnt(e.piece.bufferIndex,n.start,r);if(t!==i)return{index:t,remainder:0}}return{index:i,remainder:r.column}}getAccumulatedValue(e,t){if(t<0)return 0;let n=e.piece,r=this._buffers[n.bufferIndex].lineStarts,i=n.start.line+t+1;return i>n.end.line?r[n.end.line]+n.end.column-r[n.start.line]-n.start.column:r[i]-r[n.start.line]-n.start.column}deleteNodeTail(e,t){let n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.end),a=t,o=this.offsetInBuffer(n.bufferIndex,a),s=this.getLineFeedCnt(n.bufferIndex,n.start,a),c=s-r,l=o-i,u=n.length+l;e.piece=new FJ(n.bufferIndex,n.start,a,s,u),OJ(this,e,l,c)}deleteNodeHead(e,t){let n=e.piece,r=n.lineFeedCnt,i=this.offsetInBuffer(n.bufferIndex,n.start),a=t,o=this.getLineFeedCnt(n.bufferIndex,a,n.end),s=this.offsetInBuffer(n.bufferIndex,a),c=o-r,l=i-s,u=n.length+l;e.piece=new FJ(n.bufferIndex,a,n.end,o,u),OJ(this,e,l,c)}shrinkNode(e,t,n){let r=e.piece,i=r.start,a=r.end,o=r.length,s=r.lineFeedCnt,c=t,l=this.getLineFeedCnt(r.bufferIndex,r.start,c),u=this.offsetInBuffer(r.bufferIndex,t)-this.offsetInBuffer(r.bufferIndex,i);e.piece=new FJ(r.bufferIndex,r.start,c,l,u),OJ(this,e,u-o,l-s);let d=new FJ(r.bufferIndex,n,a,this.getLineFeedCnt(r.bufferIndex,n,a),this.offsetInBuffer(r.bufferIndex,a)-this.offsetInBuffer(r.bufferIndex,n)),f=this.rbInsertRight(e,d);this.validateCRLFWithPrevNode(f)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+=`
|
|
191
|
+
`);let n=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),r=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;let i=NJ(t,!1);for(let e=0;e<i.length;e++)i[e]+=r;if(n){let e=this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-2];this._buffers[0].lineStarts.pop(),this._lastChangeBufferPos={line:this._lastChangeBufferPos.line-1,column:r-e}}this._buffers[0].lineStarts=this._buffers[0].lineStarts.concat(i.slice(1));let a=this._buffers[0].lineStarts.length-1,o={line:a,column:this._buffers[0].buffer.length-this._buffers[0].lineStarts[a]},s=e.piece.length+t.length,c=e.piece.lineFeedCnt,l=this.getLineFeedCnt(0,e.piece.start,o),u=l-c;e.piece=new FJ(e.piece.bufferIndex,e.piece.start,o,l,s),this._lastChangeBufferPos=o,OJ(this,e,t.length,u)}nodeAt(e){let t=this.root,n=this._searchCache.get(e);if(n)return{node:n.node,nodeStartOffset:n.nodeStartOffset,remainder:e-n.nodeStartOffset};let r=0;for(;t!==$;)if(t.size_left>e)t=t.left;else if(t.size_left+t.piece.length>=e){r+=t.size_left;let n={node:t,remainder:e-t.size_left,nodeStartOffset:r};return this._searchCache.set(n),n}else e-=t.size_left+t.piece.length,r+=t.size_left+t.piece.length,t=t.right;return null}nodeAt2(e,t){let n=this.root,r=0;for(;n!==$;)if(n.left!==$&&n.lf_left>=e-1)n=n.left;else if(n.lf_left+n.piece.lineFeedCnt>e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2),a=this.getAccumulatedValue(n,e-n.lf_left-1);return r+=n.size_left,{node:n,remainder:Math.min(i+t-1,a),nodeStartOffset:r}}else if(n.lf_left+n.piece.lineFeedCnt===e-1){let i=this.getAccumulatedValue(n,e-n.lf_left-2);if(i+t-1<=n.piece.length)return{node:n,remainder:i+t-1,nodeStartOffset:r};t-=n.piece.length-i;break}else e-=n.lf_left+n.piece.lineFeedCnt,r+=n.size_left+n.piece.length,n=n.right;for(n=n.next();n!==$;){if(n.piece.lineFeedCnt>0){let e=this.getAccumulatedValue(n,0),r=this.offsetOfNode(n);return{node:n,remainder:Math.min(t-1,e),nodeStartOffset:r}}else if(n.piece.length>=t-1){let e=this.offsetOfNode(n);return{node:n,remainder:t-1,nodeStartOffset:e}}else t-=n.piece.length;n=n.next()}return null}nodeCharCodeAt(e,t){if(e.piece.lineFeedCnt<1)return-1;let n=this._buffers[e.piece.bufferIndex],r=this.offsetInBuffer(e.piece.bufferIndex,e.piece.start)+t;return n.buffer.charCodeAt(r)}offsetOfNode(e){if(!e)return 0;let t=e.size_left;for(;e!==this.root;)e.parent.right===e&&(t+=e.parent.size_left+e.parent.piece.length),e=e.parent;return t}shouldCheckCRLF(){return!(this._EOLNormalized&&this._EOL===`
|
|
192
|
+
`)}startWithLF(e){if(typeof e==`string`)return e.charCodeAt(0)===10;if(e===$||e.piece.lineFeedCnt===0)return!1;let t=e.piece,n=this._buffers[t.bufferIndex].lineStarts,r=t.start.line,i=n[r]+t.start.column;return r===n.length-1||n[r+1]>i+1?!1:this._buffers[t.bufferIndex].buffer.charCodeAt(i)===10}endWithCR(e){return typeof e==`string`?e.charCodeAt(e.length-1)===13:e===$||e.piece.lineFeedCnt===0?!1:this.nodeCharCodeAt(e,e.piece.length-1)===13}validateCRLFWithPrevNode(e){if(this.shouldCheckCRLF()&&this.startWithLF(e)){let t=e.prev();this.endWithCR(t)&&this.fixCRLF(t,e)}}validateCRLFWithNextNode(e){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let t=e.next();this.startWithLF(t)&&this.fixCRLF(e,t)}}fixCRLF(e,t){let n=[],r=this._buffers[e.piece.bufferIndex].lineStarts,i;i=e.piece.end.column===0?{line:e.piece.end.line-1,column:r[e.piece.end.line]-r[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};let a=e.piece.length-1,o=e.piece.lineFeedCnt-1;e.piece=new FJ(e.piece.bufferIndex,e.piece.start,i,o,a),OJ(this,e,-1,-1),e.piece.length===0&&n.push(e);let s={line:t.piece.start.line+1,column:0},c=t.piece.length-1,l=this.getLineFeedCnt(t.piece.bufferIndex,s,t.piece.end);t.piece=new FJ(t.piece.bufferIndex,s,t.piece.end,l,c),OJ(this,t,-1,-1),t.piece.length===0&&n.push(t);let u=this.createNewPieces(`\r
|
|
193
|
+
`);this.rbInsertRight(e,u[0]);for(let e=0;e<n.length;e++)EJ(this,n[e])}adjustCarriageReturnFromNext(e,t){if(this.shouldCheckCRLF()&&this.endWithCR(e)){let n=t.next();if(this.startWithLF(n)){if(e+=`
|
|
194
|
+
`,n.piece.length===1)EJ(this,n);else{let e=n.piece,t={line:e.start.line+1,column:0},r=e.length-1,i=this.getLineFeedCnt(e.bufferIndex,t,e.end);n.piece=new FJ(e.bufferIndex,t,e.end,i,r),OJ(this,n,-1,-1)}return!0}}return!1}iterate(e,t){return e===$?t($):this.iterate(e.left,t)&&t(e)&&this.iterate(e.right,t)}getNodeContent(e){if(e===$)return``;let t=this._buffers[e.piece.bufferIndex],n=e.piece,r=this.offsetInBuffer(n.bufferIndex,n.start),i=this.offsetInBuffer(n.bufferIndex,n.end);return t.buffer.substring(r,i)}getPieceContent(e){let t=this._buffers[e.bufferIndex],n=this.offsetInBuffer(e.bufferIndex,e.start),r=this.offsetInBuffer(e.bufferIndex,e.end);return t.buffer.substring(n,r)}rbInsertRight(e,t){let n=new _J(t,vJ.Red);if(n.left=$,n.right=$,n.parent=$,n.size_left=0,n.lf_left=0,this.root===$)this.root=n,n.color=vJ.Black;else if(e.right===$)e.right=n,n.parent=e;else{let t=yJ(e.right);t.left=n,n.parent=t}return DJ(this,n),n}rbInsertLeft(e,t){let n=new _J(t,vJ.Red);if(n.left=$,n.right=$,n.parent=$,n.size_left=0,n.lf_left=0,this.root===$)this.root=n,n.color=vJ.Black;else if(e.left===$)e.left=n,n.parent=e;else{let t=bJ(e.left);t.right=n,n.parent=t}return DJ(this,n),n}getContentOfSubTree(e){let t=``;return this.iterate(e,e=>(t+=this.getNodeContent(e),!0)),t}},BJ;(function(e){e[e.Unknown=0]=`Unknown`,e[e.Invalid=3]=`Invalid`,e[e.LF=1]=`LF`,e[e.CRLF=2]=`CRLF`})(BJ||={});function VJ(e){let t=0,n=0,r=0,i=BJ.Unknown;for(let a=0,o=e.length;a<o;a++){let s=e.charCodeAt(a);s===S.CarriageReturn?(t===0&&(n=a),t++,a+1<o&&e.charCodeAt(a+1)===S.LineFeed?(i|=BJ.CRLF,a++):i|=BJ.Invalid,r=a+1):s===S.LineFeed&&(i|=BJ.LF,t===0&&(n=a),t++,r=a+1)}return t===0&&(n=e.length),[t,n,e.length-r,i]}let HJ;function UJ(){return HJ||=new TextDecoder(`UTF-16LE`),HJ}function WJ(e,t,n){let r=new Uint16Array(e.buffer,t,n);return n>0&&(r[0]===65279||r[0]===65534)?GJ(e,t,n):UJ().decode(r)}function GJ(e,t,n){let r=[],i=0;for(let a=0;a<n;a++){let n=Rt(e,t);t+=2,r[i++]=String.fromCharCode(n)}return r.join(``)}function KJ(e){return e.replace(/\n/g,`\\n`).replace(/\r/g,`\\r`)}var qJ=class e{get oldLength(){return this.oldText.length}get oldEnd(){return this.oldPosition+this.oldText.length}get newLength(){return this.newText.length}get newEnd(){return this.newPosition+this.newText.length}constructor(e,t,n,r){this.oldPosition=e,this.oldText=t,this.newPosition=n,this.newText=r}toString(){return this.oldText.length===0?`(insert@${this.oldPosition} "${KJ(this.newText)}")`:this.newText.length===0?`(delete@${this.oldPosition} "${KJ(this.oldText)}")`:`(replace@${this.oldPosition} "${KJ(this.oldText)}" with "${KJ(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,n){let r=t.length;Vt(e,r,n),n+=4;for(let i=0;i<r;i++)zt(e,t.charCodeAt(i),n),n+=2;return n}static _readString(e,t){let n=Bt(e,t);return t+=4,WJ(e,t,n)}writeSize(){return 8+e._writeStringSize(this.oldText)+e._writeStringSize(this.newText)}write(t,n){return Vt(t,this.oldPosition,n),n+=4,Vt(t,this.newPosition,n),n+=4,n=e._writeString(t,this.oldText,n),n=e._writeString(t,this.newText,n),n}static read(t,n,r){let i=Bt(t,n);n+=4;let a=Bt(t,n);n+=4;let o=e._readString(t,n);n+=e._writeStringSize(o);let s=e._readString(t,n);return n+=e._writeStringSize(s),r.push(new e(i,o,a,s)),n}},JJ=class e extends v{get onDidChangeContent(){return this._onDidChangeContent.event}constructor(e,t,n,r,i,a,o){super(),this._onDidChangeContent=this._register(new x),this._BOM=t,this._mightContainNonBasicASCII=!a,this._mightContainRTL=r,this._mightContainUnusualLineTerminators=i,this._pieceTree=new zJ(e,n,o)}equals(t){return!(t instanceof e)||this._BOM!==t._BOM||this.getEOL()!==t.getEOL()?!1:this._pieceTree.equal(t._pieceTree)}mightContainRTL(){return this._mightContainRTL}mightContainUnusualLineTerminators(){return this._mightContainUnusualLineTerminators}resetMightContainUnusualLineTerminators(){this._mightContainUnusualLineTerminators=!1}mightContainNonBasicASCII(){return this._mightContainNonBasicASCII}getBOM(){return this._BOM}getEOL(){return this._pieceTree.getEOL()}createSnapshot(e){return this._pieceTree.createSnapshot(e?this._BOM:``)}getOffsetAt(e,t){return this._pieceTree.getOffsetAt(e,t)}getPositionAt(e){return this._pieceTree.getPositionAt(e)}getRangeAt(e,t){let n=e+t,r=this.getPositionAt(e),i=this.getPositionAt(n);return new Ep(r.lineNumber,r.column,i.lineNumber,i.column)}getValueInRange(e,t=mm.TextDefined){if(e.isEmpty())return``;let n=this._getEndOfLine(t);return this._pieceTree.getValueInRange(e,n)}getValueLengthInRange(e,t=mm.TextDefined){if(e.isEmpty())return 0;if(e.startLineNumber===e.endLineNumber)return e.endColumn-e.startColumn;let n=this.getOffsetAt(e.startLineNumber,e.startColumn),r=this.getOffsetAt(e.endLineNumber,e.endColumn),i=0,a=this._getEndOfLine(t),o=this.getEOL();return a.length!==o.length&&(i=(a.length-o.length)*(e.endLineNumber-e.startLineNumber)),r-n+i}getCharacterCountInRange(e,t=mm.TextDefined){if(this._mightContainNonBasicASCII){let n=0,r=e.startLineNumber,i=e.endLineNumber;for(let t=r;t<=i;t++){let a=this.getLineContent(t),o=t===r?e.startColumn-1:0,s=t===i?e.endColumn-1:a.length;for(let e=o;e<s;e++)va(a.charCodeAt(e))?(n+=1,e+=1):n+=1}return n+=this._getEndOfLine(t).length*(i-r),n}return this.getValueLengthInRange(e,t)}getNearestChunk(e){return this._pieceTree.getNearestChunk(e)}getLength(){return this._pieceTree.getLength()}getLineCount(){return this._pieceTree.getLineCount()}getLinesContent(){return this._pieceTree.getLinesContent()}getLineContent(e){return this._pieceTree.getLineContent(e)}getLineCharCode(e,t){return this._pieceTree.getLineCharCode(e,t)}getCharCode(e){return this._pieceTree.getCharCode(e)}getLineLength(e){return this._pieceTree.getLineLength(e)}getLineMinColumn(e){return 1}getLineMaxColumn(e){return this.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){let t=oa(this.getLineContent(e));return t===-1?0:t+1}getLineLastNonWhitespaceColumn(e){let t=sa(this.getLineContent(e));return t===-1?0:t+2}_getEndOfLine(e){switch(e){case mm.LF:return`
|
|
195
|
+
`;case mm.CRLF:return`\r
|
|
196
|
+
`;case mm.TextDefined:return this.getEOL();default:throw Error(`Unknown EOL preference`)}}setEOL(e){this._pieceTree.setEOL(e)}applyEdits(t,n,r){let i=this._mightContainRTL,a=this._mightContainUnusualLineTerminators,o=this._mightContainNonBasicASCII,s=!0,c=[];for(let e=0;e<t.length;e++){let n=t[e];s&&n._isTracked&&(s=!1);let r=n.range;if(n.text){let e=!0;o||=(e=!Aa(n.text),e),!i&&e&&(i=Oa(n.text)),!a&&e&&(a=Ma(n.text))}let l=``,u=0,d=0,f=0;if(n.text){let e;[u,d,f,e]=VJ(n.text);let t=this.getEOL(),r=t===`\r
|
|
197
|
+
`?BJ.CRLF:BJ.LF;l=e===BJ.Unknown||e===r?n.text:n.text.replace(/\r\n|\r|\n/g,t)}c[e]={sortIndex:e,identifier:n.identifier||null,range:r,rangeOffset:this.getOffsetAt(r.startLineNumber,r.startColumn),rangeLength:this.getValueLengthInRange(r),text:l,eolCount:u,firstLineLength:d,lastLineLength:f,forceMoveMarkers:!!n.forceMoveMarkers,isAutoWhitespaceEdit:n.isAutoWhitespaceEdit||!1}}c.sort(e._sortOpsAscending);let l=!1;for(let e=0,t=c.length-1;e<t;e++){let t=c[e].range.getEndPosition(),n=c[e+1].range.getStartPosition();if(n.isBeforeOrEqual(t)){if(n.isBefore(t))throw Error(`Overlapping ranges are not allowed!`);l=!0}}s&&(c=this._reduceOperations(c));let u=r||n?e._getInverseEditRanges(c):[],d=[];if(n)for(let e=0;e<c.length;e++){let t=c[e],n=u[e];if(t.isAutoWhitespaceEdit&&t.range.isEmpty())for(let e=n.startLineNumber;e<=n.endLineNumber;e++){let r=``;e===n.startLineNumber&&(r=this.getLineContent(t.range.startLineNumber),oa(r)!==-1)||d.push({lineNumber:e,oldContent:r})}}let f=null;if(r){let e=0;f=[];for(let t=0;t<c.length;t++){let n=c[t],r=u[t],i=this.getValueInRange(n.range),a=n.rangeOffset+e;e+=n.text.length-i.length,f[t]={sortIndex:n.sortIndex,identifier:n.identifier,range:r,text:i,textChange:new qJ(n.rangeOffset,i,a,n.text)}}l||f.sort((e,t)=>e.sortIndex-t.sortIndex)}this._mightContainRTL=i,this._mightContainUnusualLineTerminators=a,this._mightContainNonBasicASCII=o;let p=this._doApplyEdits(c),m=null;if(n&&d.length>0){d.sort((e,t)=>t.lineNumber-e.lineNumber),m=[];for(let e=0,t=d.length;e<t;e++){let t=d[e].lineNumber;if(e>0&&d[e-1].lineNumber===t)continue;let n=d[e].oldContent,r=this.getLineContent(t);r.length===0||r===n||oa(r)!==-1||m.push(t)}}return this._onDidChangeContent.fire(),new Sm(f,p,m)}_reduceOperations(e){return e.length<1e3?e:[this._toSingleEditOperation(e)]}_toSingleEditOperation(e){let t=!1,n=e[0].range,r=e[e.length-1].range,i=new Ep(n.startLineNumber,n.startColumn,r.endLineNumber,r.endColumn),a=n.startLineNumber,o=n.startColumn,s=[];for(let n=0,r=e.length;n<r;n++){let r=e[n],i=r.range;t||=r.forceMoveMarkers,s.push(this.getValueInRange(new Ep(a,o,i.startLineNumber,i.startColumn))),r.text.length>0&&s.push(r.text),a=i.endLineNumber,o=i.endColumn}let c=s.join(``),[l,u,d]=VJ(c);return{sortIndex:0,identifier:e[0].identifier,range:i,rangeOffset:this.getOffsetAt(i.startLineNumber,i.startColumn),rangeLength:this.getValueLengthInRange(i,mm.TextDefined),text:c,eolCount:l,firstLineLength:u,lastLineLength:d,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(t){t.sort(e._sortOpsDescending);let n=[];for(let e=0;e<t.length;e++){let r=t[e],i=r.range.startLineNumber,a=r.range.startColumn,o=r.range.endLineNumber,s=r.range.endColumn;if(i===o&&a===s&&r.text.length===0)continue;r.text?(this._pieceTree.delete(r.rangeOffset,r.rangeLength),this._pieceTree.insert(r.rangeOffset,r.text,!0)):this._pieceTree.delete(r.rangeOffset,r.rangeLength);let c=new Ep(i,a,o,s);n.push({range:c,rangeLength:r.rangeLength,text:r.text,rangeOffset:r.rangeOffset,forceMoveMarkers:r.forceMoveMarkers})}return n}findMatchesLineByLine(e,t,n,r){return this._pieceTree.findMatchesLineByLine(e,t,n,r)}getPieceTree(){return this._pieceTree}static _getInverseEditRange(e,t){let n=e.startLineNumber,r=e.startColumn,[i,a,o]=VJ(t),s;if(t.length>0){let e=i+1;s=e===1?new Ep(n,r,n,r+a):new Ep(n,r,n+e-1,o+1)}else s=new Ep(n,r,n,r);return s}static _getInverseEditRanges(e){let t=[],n=0,r=0,i=null;for(let a=0,o=e.length;a<o;a++){let o=e[a],s,c;i?i.range.endLineNumber===o.range.startLineNumber?(s=n,c=r+(o.range.startColumn-i.range.endColumn)):(s=n+(o.range.startLineNumber-i.range.endLineNumber),c=o.range.startColumn):(s=o.range.startLineNumber,c=o.range.startColumn);let l;if(o.text.length>0){let e=o.eolCount+1;l=e===1?new Ep(s,c,s,c+o.firstLineLength):new Ep(s,c,s+e-1,o.lastLineLength+1)}else l=new Ep(s,c,s,c);n=l.endLineNumber,r=l.endColumn,t.push(l),i=o}return t}static _sortOpsAscending(e,t){let n=Ep.compareRangesUsingEnds(e.range,t.range);return n===0?e.sortIndex-t.sortIndex:n}static _sortOpsDescending(e,t){let n=Ep.compareRangesUsingEnds(e.range,t.range);return n===0?t.sortIndex-e.sortIndex:-n}},YJ=class{constructor(e,t,n,r,i,a,o,s,c){this._chunks=e,this._bom=t,this._cr=n,this._lf=r,this._crlf=i,this._containsRTL=a,this._containsUnusualLineTerminators=o,this._isBasicASCII=s,this._normalizeEOL=c}_getEOL(e){let t=this._cr+this._lf+this._crlf,n=this._cr+this._crlf;return t===0?e===hm.LF?`
|
|
198
|
+
`:`\r
|
|
199
|
+
`:n>t/2?`\r
|
|
200
|
+
`:`
|
|
201
|
+
`}create(e){let t=this._getEOL(e),n=this._chunks;if(this._normalizeEOL&&(t===`\r
|
|
202
|
+
`&&(this._cr>0||this._lf>0)||t===`
|
|
203
|
+
`&&(this._cr>0||this._crlf>0)))for(let e=0,r=n.length;e<r;e++){let r=n[e].buffer.replace(/\r\n|\r|\n/g,t);n[e]=new IJ(r,NJ(r))}let r=new JJ(n,this._bom,t,this._containsRTL,this._containsUnusualLineTerminators,this._isBasicASCII,this._normalizeEOL);return{textBuffer:r,disposable:r}}getFirstLineText(e){return this._chunks[0].buffer.substr(0,e).split(/\r\n|\r|\n/)[0]}},XJ=class{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&&Pa(e)&&(this.BOM=Na,e=e.substr(1));let t=e.charCodeAt(e.length-1);t===S.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){let t=PJ(this._tmpLineStarts,e);this.chunks.push(new IJ(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||=Oa(e),this.containsUnusualLineTerminators||=Ma(e))}finish(e=!0){return this._finish(),new YJ(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;let e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar),e.lineStarts=NJ(e.buffer),this._previousChar===S.CarriageReturn&&this.cr++}}},ZJ=class extends v{constructor(e,t,n){super(),this._source=e,this._inputTextBuffer=t,this._outputs=n,this._outputTextBuffers=void 0}_getFullModelRange(e){let t=e.getLineCount();return new Ep(1,1,t,this._getLineMaxColumn(e,t))}_getLineMaxColumn(e,t){if(t<1||t>e.getLineCount())throw Error(`Illegal value for lineNumber`);return e.getLineLength(t)+1}get inputTextBuffer(){if(!this._inputTextBuffer){let e=new XJ;e.acceptChunk(this._source);let{textBuffer:t,disposable:n}=e.finish(!0).create(hm.LF);this._inputTextBuffer=t,this._register(n)}return this._inputTextBuffer}get outputTextBuffers(){return this._outputTextBuffers||=this._outputs.map(e=>{let t=new XJ;t.acceptChunk(e);let{textBuffer:n,disposable:r}=t.finish(!0).create(hm.LF);return this._register(r),n}),this._outputTextBuffers}findInInputs(e){let t=new pR(e,!1,!1,null).parseSearchRequest();if(!t)return[];let n=this._getFullModelRange(this.inputTextBuffer);return this.inputTextBuffer.findMatchesLineByLine(n,t,!0,5e3)}findInOutputs(e){let t=new pR(e,!1,!1,null).parseSearchRequest();return t?this.outputTextBuffers.map(e=>{let n=e.findMatchesLineByLine(this._getFullModelRange(e),t,!0,5e3);if(n.length!==0)return{textBuffer:e,matches:n}}).filter(e=>!!e):[]}};function QJ(e,t){let n=-1,r=[],i=[];return e.forEach(e=>{e.range.startLineNumber!==n&&i.length>0&&(r.push([...i]),i=[]),i.push(e),n=e.range.endLineNumber}),i.length>0&&r.push([...i]),r.map(e=>{let n=[],r=e[0].range.startLineNumber,i=e[e.length-1].range.endLineNumber;for(let e=r;e<=i;e++)n.push(t.getLineContent(e));return new eP(n.join(`
|
|
204
|
+
`)+`
|
|
205
|
+
`,e.map(e=>new Ep(e.range.startLineNumber-1,e.range.startColumn-1,e.range.endLineNumber-1,e.range.endColumn-1)))})}const $J=O(`IUserDataProfilesService`),eY=Object.freeze({id:`workbench`,order:7,title:b(4198,`Workbench`),type:`object`}),tY=Object.freeze({id:`security`,scope:fg.APPLICATION,title:b(4199,`Security`),type:`object`,order:7});Object.freeze({id:`problems`,title:b(4200,`Problems`),type:`object`,order:101});const nY=Object.freeze({id:`window`,order:8,title:b(4201,`Window`),type:`object`}),rY={ConfigurationMigration:`base.contributions.configuration.migration`},iY=new class{constructor(){this.migrations=[],this._onDidRegisterConfigurationMigrations=new x,this.onDidRegisterConfigurationMigration=this._onDidRegisterConfigurationMigrations.event}registerConfigurationMigrations(e){this.migrations.push(...e)}};Am.add(rY.ConfigurationMigration,iY);let aY=class extends v{static{this.ID=`workbench.contrib.configurationMigration`}constructor(e,t){super(),this.configurationService=e,this.workspaceService=t,this._register(this.workspaceService.onDidChangeWorkspaceFolders(async e=>{for(let t of e.added)await this.migrateConfigurationsForFolder(t,iY.migrations)})),this.migrateConfigurations(iY.migrations),this._register(iY.onDidRegisterConfigurationMigration(e=>this.migrateConfigurations(e)))}async migrateConfigurations(e){await this.migrateConfigurationsForFolder(void 0,e);for(let t of this.workspaceService.getWorkspace().folders)await this.migrateConfigurationsForFolder(t,e)}async migrateConfigurationsForFolder(e,t){await Promise.all([t.map(t=>this.migrateConfigurationsForFolderAndOverride(t,e?.uri))])}async migrateConfigurationsForFolderAndOverride(e,t){let n=this.configurationService.inspect(e.key,{resource:t}),r=this.workspaceService.getWorkbenchState()===zc.WORKSPACE?[[`user`,Zh.USER],[`userLocal`,Zh.USER_LOCAL],[`userRemote`,Zh.USER_REMOTE],[`workspace`,Zh.WORKSPACE],[`workspaceFolder`,Zh.WORKSPACE_FOLDER]]:[[`user`,Zh.USER],[`userLocal`,Zh.USER_LOCAL],[`userRemote`,Zh.USER_REMOTE],[`workspace`,Zh.WORKSPACE]];for(let[i,a]of r){let r=n[i];if(!r)continue;let o=[];if(r.value!==void 0){let n=await this.runMigration(e,i,r.value,t,void 0);for(let e of n??[])o.push([e,[]])}for(let{identifiers:n,value:a}of r.overrides??[])if(a!==void 0){let r=await this.runMigration(e,i,a,t,n);for(let e of r??[])o.push([e,n])}o.length&&await Promise.allSettled(o.map(async([[e,n],r])=>this.configurationService.updateValue(e,n.value,{resource:t,overrideIdentifiers:r},a)))}}async runMigration(e,t,n,r,i){let a=await e.migrateFn(n,e=>{let n=this.configurationService.inspect(e,{resource:r})[t];if(n)return i?n.overrides?.find(({identifiers:e})=>pc(e,i))?.value:n.value});return Array.isArray(a)?a:[[e.key,a]]}};aY=k([A(0,Oh),A(1,bR)],aY);let oY=class extends v{static{this.ID=`workbench.contrib.dynamicWorkbenchSecurityConfiguration`}constructor(e){super(),this.remoteAgentService=e,this._ready=new Wo,this.ready=this._ready.p,this.create()}async create(){try{await this.doCreate()}finally{this._ready.complete()}}async doCreate(){!Tn&&(await this.remoteAgentService.getEnvironment())?.os!==Bn.Windows||Am.as(dg.Configuration).registerConfiguration({...tY,properties:{"security.allowedUNCHosts":{type:`array`,items:{type:`string`,pattern:`^[^\\\\]+$`,patternErrorMessage:b(4202,`UNC host names must not contain backslashes.`)},default:[],markdownDescription:b(4203,"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:fg.APPLICATION_MACHINE},"security.restrictUNCAccess":{type:`boolean`,default:!0,markdownDescription:b(4204,"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:fg.APPLICATION_MACHINE}}})}};oY=k([A(0,NK)],oY);const sY=`window.newWindowProfile`;let cY=class extends v{static{this.ID=`workbench.contrib.dynamicWindowConfiguration`}constructor(e,t){super(),this.userDataProfilesService=e,this.configurationService=t,this.registerNewWindowProfileConfiguration(),this._register(this.userDataProfilesService.onDidChangeProfiles(e=>this.registerNewWindowProfileConfiguration())),this.setNewWindowProfile(),this.checkAndResetNewWindowProfileConfig(),this._register(t.onDidChangeConfiguration(e=>{e.source!==Zh.DEFAULT&&e.affectsConfiguration(`window.newWindowProfile`)&&this.setNewWindowProfile()})),this._register(this.userDataProfilesService.onDidChangeProfiles(()=>this.checkAndResetNewWindowProfileConfig()))}registerNewWindowProfileConfiguration(){let e=Am.as(dg.Configuration),t={...nY,properties:{[sY]:{type:[`string`,`null`],default:null,enum:[...this.userDataProfilesService.profiles.map(e=>e.name),null],enumItemLabels:[...this.userDataProfilesService.profiles.map(()=>``),b(4205,`Active Window`)],description:b(4206,`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:fg.APPLICATION}}};this.configurationNode?e.updateConfigurations({add:[t],remove:[this.configurationNode]}):e.registerConfiguration(t),this.configurationNode=t}setNewWindowProfile(){let e=this.configurationService.getValue(sY);this.newWindowProfile=e?this.userDataProfilesService.profiles.find(t=>t.name===e):void 0}checkAndResetNewWindowProfileConfig(){let e=this.configurationService.getValue(sY);if(!e)return;let t=this.newWindowProfile?this.userDataProfilesService.profiles.find(e=>e.id===this.newWindowProfile.id):void 0;e!==t?.name&&this.configurationService.updateValue(sY,t?.name)}};cY=k([A(0,$J),A(1,Oh)],cY);const lY=Object.freeze({"*.md":`vscode.markdown.preview.editor`}),uY=Am.as(dg.Configuration),dY={...eY,properties:{"workbench.editorAssociations":{type:`object`,markdownDescription:b(16874,'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`},agentsWindow:{default:lY}},"workbench.diffEditorAssociations":{type:`object`,markdownDescription:b(16875,'Configure [glob patterns](https://aka.ms/vscode-glob-patterns) to editors for diff views (for example `"*.md": "vscode.markdown.preview.editor"`). These override `workbench.editorAssociations` for diffs.'),additionalProperties:{type:`string`}}}};uY.registerConfiguration(dY);var fY;(function(e){e.builtin=`builtin`,e.option=`option`,e.exclusive=`exclusive`,e.default=`default`})(fY||={});var pY;(function(e){e[e.ABORT=1]=`ABORT`,e[e.NONE=2]=`NONE`})(pY||={});function mY(e,t){return new Set([D.extension,D.webviewPanel,D.vscodeWorkspaceTrust,D.vscodeSettings]).has(t.scheme)?!1:GS(e,typeof e==`string`&&e.indexOf(Gr.sep)>=0?`${t.scheme}:${t.path}`:so(t),{ignoreCase:!0})}var hY=class e{static{this._notebookStatusBarItemProviderHandlePool=0}get activeNotebookEditor(){return this._activeNotebookEditor?.apiEditor}get visibleNotebookEditors(){return this._visibleNotebookEditors.map(e=>e.apiEditor)}constructor(t,n,r,i,a,o,s){this._textDocumentsAndEditors=r,this._textDocuments=i,this._extHostFileSystem=a,this._extHostSearch=o,this._logService=s,this._notebookStatusBarItemProviders=new Map,this._documents=new He,this._editors=new Map,this._onDidChangeActiveNotebookEditor=new x,this.onDidChangeActiveNotebookEditor=this._onDidChangeActiveNotebookEditor.event,this._visibleNotebookEditors=[],this._onDidOpenNotebookDocument=new x,this.onDidOpenNotebookDocument=this._onDidOpenNotebookDocument.event,this._onDidCloseNotebookDocument=new x,this.onDidCloseNotebookDocument=this._onDidCloseNotebookDocument.event,this._onDidChangeVisibleNotebookEditors=new x,this.onDidChangeVisibleNotebookEditors=this._onDidChangeVisibleNotebookEditors.event,this._statusBarCache=new EW(`NotebookCellStatusBarCache`),this._handlePool=0,this._notebookSerializer=new Map,this._notebookProxy=t.getProxy(T.MainThreadNotebook),this._notebookDocumentsProxy=t.getProxy(T.MainThreadNotebookDocuments),this._notebookEditorsProxy=t.getProxy(T.MainThreadNotebookEditors),this._commandsConverter=n.converter,n.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Mr.NotebookCellActionContext){let t=e.notebookEditor?.notebookUri,n=e.cell.handle,r=this._documents.get(t)?.getCell(n);if(r)return r.apiCell}if(e&&e.$mid===Mr.NotebookActionContext){let t=e.uri,n=this._documents.get(t);if(n)return n.apiNotebook}return e}}),e._registerApiCommands(n)}getEditorById(e){let t=this._editors.get(e);if(!t)throw Error(`unknown text editor: ${e}. known editors: ${[...this._editors.keys()]} `);return t}getIdByEditor(e){for(let[t,n]of this._editors)if(n.apiEditor===e)return t}get notebookDocuments(){return[...this._documents.values()]}getNotebookDocument(e,t){let n=this._documents.get(e);if(!n&&!t)throw Error(`NO notebook document for '${e}'`);return n}static _convertNotebookRegistrationData(e,t){if(!t)return;let n=t.filenamePattern.map(e=>SM.from(e)).filter(e=>e!==void 0);if(t.filenamePattern&&!n){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:n,priority:t.exclusive?fY.exclusive:void 0}}registerNotebookCellStatusBarItemProvider(t,n,r){let i=e._notebookStatusBarItemProviderHandlePool++,a=typeof r.onDidChangeCellStatusBarItems==`function`?e._notebookStatusBarItemProviderHandlePool++:void 0;this._notebookStatusBarItemProviders.set(i,r),this._notebookProxy.$registerNotebookCellStatusBarItemProvider(i,a,n);let o;return a!==void 0&&(o=r.onDidChangeCellStatusBarItems(e=>this._notebookProxy.$emitCellStatusBarEvent(a))),new YT(()=>{this._notebookStatusBarItemProviders.delete(i),this._notebookProxy.$unregisterNotebookCellStatusBarItemProvider(i,a),o?.dispose()})}async createNotebookDocument(e){let t=await this._notebookDocumentsProxy.$tryCreateNotebook({viewType:e.viewType,content:e.content&&vM.from(e.content)});return C.revive(t)}async openNotebookDocument(e){let t=this._documents.get(e);if(t)return t.apiNotebook;let n=await this._notebookDocumentsProxy.$tryOpenNotebook(e);return dt(this._documents.get(C.revive(n))?.apiNotebook)}async showNotebookDocument(e,t){let n;n=typeof t==`object`?{position:vj.from(t.viewColumn),preserveFocus:t.preserveFocus,selections:t.selections&&t.selections.map(hM.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}:{preserveFocus:!1,pinned:!0};let r=t?.asRepl?`repl`:e.notebookType,i=await this._notebookEditorsProxy.$tryShowNotebookDocument(e.uri,r,n),a=i&&this._editors.get(i)?.apiEditor;if(a)return a;throw Error(i?`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`:`Could NOT open editor for "${e.uri.toString()}".`)}async $provideNotebookCellStatusBarItems(e,t,n,r){let i=this._notebookStatusBarItemProviders.get(e),a=C.revive(t),o=this._documents.get(a);if(!o||!i)return;let s=o.getCellFromIndex(n);if(!s)return;let c=await i.provideCellStatusBarItems(s.apiCell,r);if(!c)return;let l=new _;return{cacheId:this._statusBarCache.add([l]),items:(Array.isArray(c)?c:[c]).map(e=>CM.from(e,this._commandsConverter,l))}}$releaseNotebookCellStatusBarItems(e){this._statusBarCache.delete(e)}registerNotebookSerializer(t,n,r,i,a){if(Ji(n))throw Error(`viewType cannot be empty or just whitespace`);let o=this._handlePool++;return this._notebookSerializer.set(o,{viewType:n,serializer:r,options:i}),this._notebookProxy.$registerNotebookSerializer(o,{id:t.identifier,location:t.extensionLocation},n,TM.from(i),e._convertNotebookRegistrationData(t,a)),g(()=>{this._notebookProxy.$unregisterNotebookSerializer(o)})}async $dataToNotebook(e,t,n){let r=this._notebookSerializer.get(e);if(!r)throw Error(`NO serializer found`);let i=await r.serializer.deserializeNotebook(t.buffer,n);return new Ci(vM.from(i))}async $notebookToData(e,t,n){let r=this._notebookSerializer.get(e);if(!r)throw Error(`NO serializer found`);let i=await r.serializer.serializeNotebook(vM.to(t.value),n);return y.wrap(i)}async $saveNotebook(e,t,n,r,i){let a=C.revive(t),o=this._notebookSerializer.get(e);this.trace(`enter saveNotebook(versionId: ${n}, ${a.toString()})`);try{if(!o)throw new gY(`NO serializer found`);let e=this._documents.get(a);if(!e)throw new gY(`Document NOT found`);if(e.versionId!==n)throw new gY(`Document version mismatch, expected: `+n+`, actual: `+e.versionId);if(!this._extHostFileSystem.value.isWritableFileSystem(a.scheme))throw new Oc(b(2873,`Unable to modify read-only file '{0}'`,this._resourceForError(a)),kc.FILE_PERMISSION_DENIED);let t={metadata:hc(e.apiNotebook.metadata,e=>!(o.options?.transientDocumentMetadata??{})[e]),cells:[]};for(let n of e.apiNotebook.getCells()){let e=new bT(n.kind,n.document.getText(),n.document.languageId,n.mime,o.options?.transientOutputs?[]:[...n.outputs],n.metadata,n.executionSummary);e.metadata=hc(n.metadata,e=>!(o.options?.transientCellMetadata??{})[e]),t.cells.push(e)}if(await this._validateWriteFile(a,r),i.isCancellationRequested)throw new ie;let s=await o.serializer.serializeNotebook(t,i);if(i.isCancellationRequested)throw new ie;this.trace(`serialized versionId: ${n} ${a.toString()}`),await this._extHostFileSystem.value.writeFile(a,s),this.trace(`Finished write versionId: ${n} ${a.toString()}`);let c=this._extHostFileSystem.getFileSystemProviderExtUri(a.scheme),l=await this._extHostFileSystem.value.stat(a),u={name:c.basename(a),isFile:(l.type&_c.File)!==0,isDirectory:(l.type&_c.Directory)!==0,isSymbolicLink:(l.type&_c.SymbolicLink)!==0,mtime:l.mtime,ctime:l.ctime,size:l.size,readonly:!!((l.permissions??0)&vc.Readonly)||!this._extHostFileSystem.value.isWritableFileSystem(a.scheme),locked:!!((l.permissions??0)&vc.Locked),executable:!!((l.permissions??0)&vc.Executable),etag:jc({mtime:l.mtime,size:l.size})};return this.trace(`exit saveNotebook(versionId: ${n}, ${a.toString()})`),u}catch(e){if(e instanceof Oc)return{...e,message:e.message};throw e}}async $searchInNotebooks(e,t,n,r,i){let a=this._notebookSerializer.get(e)?.serializer;if(!a)return{limitHit:!1,results:[]};let o=new Ue;await(async(e,t,n)=>{await Promise.all(e.map(async e=>await Promise.all(e.filenamePatterns.map(i=>{let a={_reason:n._reason,folderQueries:n.folderQueries,includePattern:n.includePattern,excludePattern:n.excludePattern,maxResults:n.maxResults,type:ZN.File,filePattern:i};return this._extHostSearch.doInternalFileSearchWithCustomCallback(a,t,t=>{t.forEach(t=>{o.has(t)||r.some(n=>e.isFromSettings&&!n.isFromSettings?!1:n.filenamePatterns.some(e=>mY(e,t)))||o.add(t)})}).catch(e=>{if(e.code===`ENOENT`)return console.warn(`Could not find notebook search results, ignoring notebook results.`),{limitHit:!1,messages:[]};throw e})}))))})(n,i,t);let s=new He,c=!1,l=Array.from(o).map(async e=>{let n=[];try{if(i.isCancellationRequested)return;if(t.maxResults&&[...s.values()].reduce((e,t)=>e+t.cellResults.length,0)>t.maxResults){c=!0;return}let r=[],o=this._documents.get(e);if(o)o.apiNotebook.getCells().forEach(e=>r.push({input:e.document.getText(),outputs:e.outputs.flatMap(e=>e.items.map(e=>e.data.toString()))}));else{let t=await this._extHostFileSystem.value.readFile(e),n=y.fromString(t.toString()),o=await a.deserializeNotebook(n.buffer,i);if(i.isCancellationRequested)return;vM.from(o).cells.forEach(e=>r.push({input:e.source,outputs:e.outputs.flatMap(e=>e.items.map(e=>e.valueBytes.toString()))}))}if(i.isCancellationRequested)return;r.forEach((e,r)=>{let i=t.contentPattern.pattern,a=new ZJ(e.input,void 0,e.outputs),o=a.findInInputs(i),s=a.findInOutputs(i),c=s.flatMap(e=>QJ(e.matches,e.textBuffer)).map((e,t)=>(e.webviewIndex=t,e));if(o.length>0||s.length>0){let e={index:r,contentResults:QJ(o,a.inputTextBuffer),webviewResults:c};n.push(e)}});let l={resource:e,cellResults:n};s.set(e,l);return}catch{return}});return await Promise.all(l),{limitHit:c,results:[...s.values()]}}async _validateWriteFile(e,t){let n=await this._extHostFileSystem.value.stat(e);if(typeof t?.mtime==`number`&&typeof t.etag==`string`&&t.etag!==``&&typeof n.mtime==`number`&&typeof n.size==`number`&&t.mtime<n.mtime&&t.etag!==jc({mtime:t.mtime,size:n.size}))throw new Oc(b(2874,`File Modified Since`),kc.FILE_MODIFIED_SINCE,t)}_resourceForError(e){return e.scheme===D.file?e.fsPath:e.toString()}_createExtHostEditor(e,t,n){if(this._editors.has(t))throw Error(`editor with id ALREADY EXSIST: ${t}`);let r=new gJ(t,this._notebookEditorsProxy,e,n.visibleRanges.map(hM.to),n.selections.map(hM.to),typeof n.viewColumn==`number`?vj.to(n.viewColumn):void 0,n.viewType);this._editors.set(t,r)}$acceptDocumentAndEditorsDelta(e){if(e.value.removedDocuments)for(let t of e.value.removedDocuments){let e=C.revive(t),n=this._documents.get(e);n&&(n.dispose(),this._documents.delete(e),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({removedDocuments:n.apiNotebook.getCells().map(e=>e.document.uri)}),this._onDidCloseNotebookDocument.fire(n.apiNotebook));for(let t of this._editors.values())t.notebookData.uri.toString()===e.toString()&&this._editors.delete(t.id)}if(e.value.addedDocuments){let t=[];for(let n of e.value.addedDocuments){let e=C.revive(n.uri);if(this._documents.has(e))throw Error(`adding EXISTING notebook ${e} `);let r=new hJ(this._notebookDocumentsProxy,this._textDocumentsAndEditors,this._textDocuments,e,n);t.push(...n.cells.map(e=>mJ.asModelAddData(e))),this._documents.get(e)?.dispose(),this._documents.set(e,r),this._textDocumentsAndEditors.$acceptDocumentsAndEditorsDelta({addedDocuments:t}),this._onDidOpenNotebookDocument.fire(r.apiNotebook)}}if(e.value.addedEditors)for(let t of e.value.addedEditors){if(this._editors.has(t.id))return;let e=C.revive(t.documentUri),n=this._documents.get(e);n&&this._createExtHostEditor(n,t.id,t)}if(e.value.removedEditors)for(let t of e.value.removedEditors){let e=this._editors.get(t);e&&(this._editors.delete(t),this._activeNotebookEditor?.id===e.id&&(this._activeNotebookEditor=void 0))}if(e.value.visibleEditors){this._visibleNotebookEditors=e.value.visibleEditors.map(e=>this._editors.get(e)).filter(e=>!!e);let t=new Set;this._visibleNotebookEditors.forEach(e=>t.add(e.id));for(let e of this._editors.values()){let n=t.has(e.id);e._acceptVisibility(n)}this._visibleNotebookEditors=[...this._editors.values()].map(e=>e).filter(e=>e.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){let t=X.String.with(`notebookType`,`A notebook type`),n=new KI(`vscode.executeDataToNotebook`,`_executeDataToNotebook`,`Invoke notebook serializer`,[t,new X(`data`,`Bytes to convert to data`,e=>e instanceof Uint8Array,e=>y.wrap(e))],new GI(`Notebook Data`,e=>vM.to(e.value))),r=new KI(`vscode.executeNotebookToData`,`_executeNotebookToData`,`Invoke notebook serializer`,[t,new X(`NotebookData`,`Notebook data to convert to bytes`,e=>!0,e=>new Ci(vM.from(e)))],new GI(`Bytes`,e=>e.buffer));e.registerApiCommand(n),e.registerApiCommand(r)}trace(e){this._logService.trace(`[Extension Host Notebook] ${e}`)}},gY=class extends Error{constructor(e){super(e),this.name=`NotebookSaveError`}},_Y=class{constructor(e,t,n,r={timeout:1500,errors:3}){this._logService=e,this._notebooksAndEditors=t,this._mainThreadBulkEdits=n,this._thresholds=r,this._onWillSaveNotebookDocumentEvent=new mr}dispose(){}getOnWillSaveNotebookDocumentEvent(e){return(t,n,r)=>{let i=function(e){t.call(n,e)};return i.extension=e,this._onWillSaveNotebookDocumentEvent.event(i,void 0,r)}}async $participateInSave(e,t,n){let r=C.revive(e),i=this._notebooksAndEditors.getNotebookDocument(r);if(!i)throw Error(`Unable to resolve notebook document`);let a=[];if(await this._onWillSaveNotebookDocumentEvent.fireAsync({notebook:i.apiNotebook,reason:oM.to(t)},n,async(e,t)=>{let r=Date.now(),i=await await Promise.resolve(e);Date.now()-r>this._thresholds.timeout&&this._logService.warn(`onWillSaveNotebookDocument-listener from extension`,t.extension.identifier),!n.isCancellationRequested&&i&&(i instanceof zT?a.push(i):this._logService.warn(`onWillSaveNotebookDocument-listener from extension`,t.extension.identifier,`ignored due to invalid data`))}),n.isCancellationRequested)return!1;if(a.length===0)return!0;let o={edits:[]};for(let e of a){let{edits:t}=Oj.from(e);o.edits=o.edits.concat(t)}return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new Ci(o))}},vY=class{constructor(e){this._notebooksAndEditors=e,this._onDidSaveNotebookDocument=new x,this.onDidSaveNotebookDocument=this._onDidSaveNotebookDocument.event,this._onDidChangeNotebookDocument=new x,this.onDidChangeNotebookDocument=this._onDidChangeNotebookDocument.event}$acceptModelChanged(e,t,n,r){let i=this._notebooksAndEditors.getNotebookDocument(C.revive(e)).acceptModelChanged(t.value,n,r);this._onDidChangeNotebookDocument.fire(i)}$acceptDirtyStateChanged(e,t){this._notebooksAndEditors.getNotebookDocument(C.revive(e)).acceptDirty(t)}$acceptModelSaved(e){let t=this._notebooksAndEditors.getNotebookDocument(C.revive(e));this._onDidSaveNotebookDocument.fire(t.apiNotebook)}};let yY=class{constructor(e,t){this._logService=e,this._notebooksAndEditors=t,this._onDidChangeNotebookEditorSelection=new x,this._onDidChangeNotebookEditorVisibleRanges=new x,this.onDidChangeNotebookEditorSelection=this._onDidChangeNotebookEditorSelection.event,this.onDidChangeNotebookEditorVisibleRanges=this._onDidChangeNotebookEditorVisibleRanges.event}$acceptEditorPropertiesChanged(e,t){this._logService.debug(`ExtHostNotebook#$acceptEditorPropertiesChanged`,e,t);let n=this._notebooksAndEditors.getEditorById(e);t.visibleRanges&&n._acceptVisibleRanges(t.visibleRanges.ranges.map(hM.to)),t.selections&&n._acceptSelections(t.selections.selections.map(hM.to)),t.visibleRanges&&this._onDidChangeNotebookEditorVisibleRanges.fire({notebookEditor:n.apiEditor,visibleRanges:n.apiEditor.visibleRanges}),t.selections&&this._onDidChangeNotebookEditorSelection.fire(Object.freeze({notebookEditor:n.apiEditor,selections:n.apiEditor.selections}))}$acceptEditorViewColumns(e){for(let t in e)this._notebooksAndEditors.getEditorById(t)._acceptViewColumn(vj.to(e[t]))}};yY=k([A(0,Ns)],yY);var bY;(function(e){e[e.Output=1]=`Output`,e[e.OutputItems=2]=`OutputItems`,e[e.ExecutionState=3]=`ExecutionState`})(bY||={});var xY;(function(e){e[e.Disconnected=1]=`Disconnected`,e[e.Connected=2]=`Connected`,e[e.Initializing=3]=`Initializing`})(xY||={});let SY=class{constructor(e,t,n,r,i){this._initData=t,this._extHostNotebook=n,this._commands=r,this._logService=i,this._activeExecutions=new He,this._activeNotebookExecutions=new He,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(T.MainThreadNotebookKernels);let a=new KI(`notebook.selectKernel`,`_notebook.selectKernel`,`Trigger kernel picker for specified notebook editor widget`,[new X(`options`,`Select kernel options`,e=>!0,e=>{if(e&&`notebookEditor`in e&&`id`in e){let t=this._extHostNotebook.getIdByEditor(e.notebookEditor);return{id:e.id,extension:e.extension,notebookEditorId:t}}else if(e&&`notebookEditor`in e){let t=this._extHostNotebook.getIdByEditor(e.notebookEditor);if(t===void 0)throw Error(`Cannot invoke 'notebook.selectKernel' for unrecognized notebook editor ${e.notebookEditor.notebook.uri.toString()}`);return`skipIfAlreadySelected`in e?{notebookEditorId:t,skipIfAlreadySelected:e.skipIfAlreadySelected}:{notebookEditorId:t}}return e})],GI.Void),o=new KI(`vscode.executeNotebookVariableProvider`,`_executeNotebookVariableProvider`,`Execute notebook variable provider`,[X.Uri],new GI(`A promise that resolves to an array of variables`,(e,t)=>e.map(e=>({variable:{name:e.name,value:e.value,expression:e.expression,type:e.type,language:e.language},hasNamedChildren:e.hasNamedChildren,indexedChildrenCount:e.indexedChildrenCount}))));this._commands.registerApiCommand(a),this._commands.registerApiCommand(o)}createNotebookController(e,t,n,r,i,a){for(let n of this._kernelData.values())if(n.controller.id===t&&Ts.equals(e.identifier,n.extensionId))throw Error(`notebook controller with id '${t}' ALREADY exist`);let o=this._handlePool++,s=this;this._logService.trace(`NotebookController[${o}], CREATED by ${e.identifier.value}, ${t}`);let c=()=>console.warn(`NO execute handler from notebook controller '${f.id}' of extension: '${e.identifier}'`),l=!1,u=new x,d=new x,f={id:kY(e.identifier,t),notebookType:n,extensionId:e.identifier,extensionLocation:e.extensionLocation,label:r||e.identifier.value,preloads:a?a.map(EM.from):[]},p=i??c,m,ee,te;this._proxy.$addKernel(o,f).catch(e=>{console.log(e),l=!0});let ne=0,h=()=>{if(l)return;let e=++ne;Promise.resolve().then(()=>{e===ne&&this._proxy.$updateKernel(o,f)})},re=new He,ie={get id(){return t},get notebookType(){return f.notebookType},onDidChangeSelectedNotebooks:u.event,get label(){return f.label},set label(t){f.label=t??e.displayName??e.name,h()},get detail(){return f.detail??``},set detail(e){f.detail=e,h()},get description(){return f.description??``},set description(e){f.description=e,h()},get supportedLanguages(){return f.supportedLanguages},set supportedLanguages(e){f.supportedLanguages=e,h()},get supportsExecutionOrder(){return f.supportsExecutionOrder??!1},set supportsExecutionOrder(e){f.supportsExecutionOrder=e,h()},get rendererScripts(){return f.preloads?f.preloads.map(EM.to):[]},get executeHandler(){return p},set executeHandler(e){p=e??c},get interruptHandler(){return m},set interruptHandler(e){m=e,f.supportsInterrupt=!!e,h()},set variableProvider(t){K(e,`notebookVariableProvider`),te?.dispose(),ee=t,f.hasVariableProvider=!!t,te=t?.onDidChangeVariables(e=>s._proxy.$variablesUpdated(e.uri)),h()},get variableProvider(){return ee},createNotebookCellExecution(t){if(l)throw Error(`notebook controller is DISPOSED`);if(!re.has(t.notebook.uri))throw s._logService.trace(`NotebookController[${o}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(re.keys()).map(e=>e.toString())),Error(`notebook controller is NOT associated to notebook: ${t.notebook.uri.toString()}`);return s._createNotebookCellExecution(t,kY(e.identifier,this.id))},createNotebookExecution(t){if(K(e,`notebookExecution`),l)throw Error(`notebook controller is DISPOSED`);if(!re.has(t.uri))throw s._logService.trace(`NotebookController[${o}] NOT associated to notebook, associated to THESE notebooks:`,Array.from(re.keys()).map(e=>e.toString())),Error(`notebook controller is NOT associated to notebook: ${t.uri.toString()}`);return s._createNotebookExecution(t,kY(e.identifier,this.id))},dispose:()=>{l||(this._logService.trace(`NotebookController[${o}], DISPOSED`),l=!0,this._kernelData.delete(o),u.dispose(),d.dispose(),te?.dispose(),this._proxy.$removeKernel(o))},updateNotebookAffinity(t,n){n===LO.Hidden&&K(e,`notebookControllerAffinityHidden`),s._proxy.$updateNotebookPriority(o,t.uri,n)},onDidReceiveMessage:d.event,postMessage(t,n){return K(e,`notebookMessaging`),s._proxy.$postMessage(o,n&&s._extHostNotebook.getIdByEditor(n),t)},asWebviewUri(t){return K(e,`notebookMessaging`),tW(t,s._initData.remote)}};return this._kernelData.set(o,{extensionId:e.identifier,controller:ie,onDidReceiveMessage:d,onDidChangeSelection:u,associatedNotebooks:re}),ie}getIdByController(e){for(let[t,n]of this._kernelData)if(n.controller===e)return kY(n.extensionId,e.id);return null}createNotebookControllerDetectionTask(e,t){let n=this._kernelDetectionTaskHandlePool++,r=this;this._logService.trace(`NotebookControllerDetectionTask[${n}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelDetectionTask(n,t);let i={dispose:()=>{this._kernelDetectionTask.delete(n),r._proxy.$removeKernelDetectionTask(n)}};return this._kernelDetectionTask.set(n,i),i}registerKernelSourceActionProvider(e,t,n){let r=this._kernelSourceActionProviderHandlePool++,i=typeof n.onDidChangeNotebookKernelSourceActions==`function`?r:void 0,a=this;this._kernelSourceActionProviders.set(r,n),this._logService.trace(`NotebookKernelSourceActionProvider[${r}], CREATED by ${e.identifier.value}`),this._proxy.$addKernelSourceActionProvider(r,r,t);let o;return i!==void 0&&(o=n.onDidChangeNotebookKernelSourceActions(e=>this._proxy.$emitNotebookKernelSourceActionsChangeEvent(i))),{dispose:()=>{this._kernelSourceActionProviders.delete(r),a._proxy.$removeKernelSourceActionProvider(r,r),o?.dispose()}}}async $provideKernelSourceActions(e,t){let n=this._kernelSourceActionProviders.get(e);if(n){let e=new _;return(await n.provideNotebookKernelSourceActions(t)??[]).map(t=>wM.from(t,this._commands.converter,e))}return[]}$acceptNotebookAssociation(e,t,n){let r=this._kernelData.get(e);if(r){let i=this._extHostNotebook.getNotebookDocument(C.revive(t));n?r.associatedNotebooks.set(i.uri,!0):r.associatedNotebooks.delete(i.uri),this._logService.trace(`NotebookController[${e}] ASSOCIATE notebook`,i.uri.toString(),n),r.onDidChangeSelection.fire({selected:n,notebook:i.apiNotebook})}}async $executeCells(e,t,n){let r=this._kernelData.get(e);if(!r)return;let i=this._extHostNotebook.getNotebookDocument(C.revive(t)),a=[];for(let e of n){let t=i.getCell(e);t&&a.push(t.apiCell)}try{this._logService.trace(`NotebookController[${e}] EXECUTE cells`,i.uri.toString(),a.length),await r.controller.executeHandler.call(r.controller,a,i.apiNotebook,r.controller)}catch(t){this._logService.error(`NotebookController[${e}] execute cells FAILED`,t),console.error(t)}}async $cancelCells(e,t,n){let r=this._kernelData.get(e);if(!r)return;let i=this._extHostNotebook.getNotebookDocument(C.revive(t));if(r.controller.interruptHandler)await r.controller.interruptHandler.call(r.controller,i.apiNotebook);else for(let e of n){let t=i.getCell(e);t&&this._activeExecutions.get(t.uri)?.cancel()}if(r.controller.interruptHandler){let e=this._activeNotebookExecutions.get(i.uri);this._activeNotebookExecutions.delete(i.uri),n.length&&Array.isArray(e)&&e.length&&e.forEach(e=>e.dispose())}}async $provideVariables(e,t,n,r,i,a,o){let s=this._kernelData.get(e);if(!s)return;let c=this._extHostNotebook.getNotebookDocument(C.revive(n)),l=s.controller.variableProvider;if(!l)return;let u;if(r!==void 0){if(u=this.variableStore[r],!u)return}else this.variableStore={};let d=i===`named`?BO.Named:BO.Indexed,f=l.provideVariables(c.apiNotebook,u,d,a,o),p=0;for await(let e of f){if(o.isCancellationRequested)return;let n={id:this.id++,name:e.variable.name,value:e.variable.value,type:e.variable.type,interfaces:e.variable.interfaces,language:e.variable.language,expression:e.variable.expression,hasNamedChildren:e.hasNamedChildren,indexedChildrenCount:e.indexedChildrenCount,extensionId:s.extensionId.value};if(this.variableStore[n.id]=e.variable,this._proxy.$receiveVariable(t,n),p++>=100)return}}$acceptKernelMessageFromRenderer(e,t,n){let r=this._kernelData.get(e);if(!r)return;let i=this._extHostNotebook.getEditorById(t);r.onDidReceiveMessage.fire(Object.freeze({editor:i.apiEditor,message:n}))}_createNotebookCellExecution(e,t){if(e.index<0)throw Error(`CANNOT execute cell that has been REMOVED from notebook`);let n=this._extHostNotebook.getNotebookDocument(e.notebook.uri).getCellFromApiCell(e);if(!n)throw Error(`invalid cell`);if(this._activeExecutions.has(n.uri))throw Error(`duplicate execution for ${n.uri}`);let r=new wY(t,n,this._proxy);this._activeExecutions.set(n.uri,r);let i=r.onDidChangeState(()=>{r.state===CY.Resolved&&(r.dispose(),i.dispose(),this._activeExecutions.delete(n.uri))});return r.asApiObject()}_createNotebookExecution(e,t){let n=this._extHostNotebook.getNotebookDocument(e.uri),r=e.getCells().find(e=>{let t=n.getCellFromApiCell(e);return t&&this._activeExecutions.has(t.uri)});if(r)throw Error(`duplicate cell execution for ${r.document.uri}`);if(this._activeNotebookExecutions.has(n.uri))throw Error(`duplicate notebook execution for ${n.uri}`);let i=new DY(t,n,this._proxy),a=i.onDidChangeState(()=>{i.state===EY.Resolved&&(i.dispose(),a.dispose(),this._activeNotebookExecutions.delete(n.uri))});return this._activeNotebookExecutions.set(n.uri,[i,a]),i.asApiObject()}};SY=k([A(4,Ns)],SY);var CY;(function(e){e[e.Init=0]=`Init`,e[e.Started=1]=`Started`,e[e.Resolved=2]=`Resolved`})(CY||={});var wY=class e extends v{static{this.HANDLE=0}get state(){return this._state}constructor(t,n,r){super(),this._cell=n,this._proxy=r,this._handle=e.HANDLE++,this._onDidChangeState=this._register(new x),this.onDidChangeState=this._onDidChangeState.event,this._state=CY.Init,this._tokenSource=this._register(new Hi),this._collector=new OY(10,e=>this.update(e)),this._executionOrder=n.internalMetadata.executionOrder,this._proxy.$createExecution(this._handle,t,this._cell.notebook.uri,this._cell.handle)}cancel(){this._tokenSource.cancel()}async updateSoon(e){await this._collector.addItem(e)}async update(e){let t=Array.isArray(e)?e:[e];return this._proxy.$updateExecution(this._handle,new Ci(t))}verifyStateForOutput(){if(this._state===CY.Init)throw Error(`Must call start before modifying cell output`);if(this._state===CY.Resolved)throw Error(`Cannot modify cell output after calling resolve`)}cellIndexToHandle(e){let t=this._cell;if(e&&(t=this._cell.notebook.getCellFromApiCell(e)),!t)throw Error(`INVALID cell`);return t.handle}validateAndConvertOutputs(e){return e.map(e=>{let t=wT.ensureUniqueMimeTypes(e.items,!0);return t===e.items?xM.from(e):xM.from({items:t,id:e.id,metadata:e.metadata})})}async updateOutputs(e,t,n){let r=this.cellIndexToHandle(t),i=this.validateAndConvertOutputs(ke(e));return this.updateSoon({editType:bY.Output,cellHandle:r,append:n,outputs:i})}async updateOutputItems(e,t,n){return e=wT.ensureUniqueMimeTypes(ke(e),!0),this.updateSoon({editType:bY.OutputItems,items:e.map(bM.from),outputId:t.id,append:n})}asApiObject(){let e=this;return Object.freeze({get token(){return e._tokenSource.token},get cell(){return e._cell.apiCell},get executionOrder(){return e._executionOrder},set executionOrder(t){e._executionOrder=t,e.update([{editType:bY.ExecutionState,executionOrder:e._executionOrder}])},start(t){if(e._state===CY.Resolved||e._state===CY.Started)throw Error(`Cannot call start again`);e._state=CY.Started,e._onDidChangeState.fire(),e.update({editType:bY.ExecutionState,runStartTime:t})},end(t,n,r){if(e._state===CY.Resolved)throw Error(`Cannot call resolve twice`);e._state=CY.Resolved,e._onDidChangeState.fire(),e._collector.flush();let i=TY(r);e._proxy.$completeExecution(e._handle,new Ci({runEndTime:n,lastRunSuccess:t,error:i}))},clearOutput(t){return e.verifyStateForOutput(),e.updateOutputs([],t,!1)},appendOutput(t,n){return e.verifyStateForOutput(),e.updateOutputs(t,n,!0)},replaceOutput(t,n){return e.verifyStateForOutput(),e.updateOutputs(t,n,!1)},appendOutputItems(t,n){return e.verifyStateForOutput(),e.updateOutputItems(t,n,!0)},replaceOutputItems(t,n){return e.verifyStateForOutput(),e.updateOutputItems(t,n,!1)}})}};function TY(e){let t=e=>e?{startLineNumber:e.start.line,startColumn:e.start.character,endLineNumber:e.end.line,endColumn:e.end.character}:void 0,n=e=>({uri:e.uri,position:e.position,label:e.label});return e?{name:e.name,message:e.message,stack:e.stack instanceof Array?e.stack.map(e=>n(e)):e.stack,location:t(e.location),uri:e.uri}:void 0}var EY;(function(e){e[e.Init=0]=`Init`,e[e.Started=1]=`Started`,e[e.Resolved=2]=`Resolved`})(EY||={});var DY=class e extends v{static{this.HANDLE=0}get state(){return this._state}constructor(t,n,r){super(),this._notebook=n,this._proxy=r,this._handle=e.HANDLE++,this._onDidChangeState=this._register(new x),this.onDidChangeState=this._onDidChangeState.event,this._state=EY.Init,this._tokenSource=this._register(new Hi),this._proxy.$createNotebookExecution(this._handle,t,this._notebook.uri)}cancel(){this._tokenSource.cancel()}asApiObject(){return Object.freeze({start:()=>{if(this._state===EY.Resolved||this._state===EY.Started)throw Error(`Cannot call start again`);this._state=EY.Started,this._onDidChangeState.fire(),this._proxy.$beginNotebookExecution(this._handle)},end:()=>{if(this._state===EY.Resolved)throw Error(`Cannot call resolve twice`);this._state=EY.Resolved,this._onDidChangeState.fire(),this._proxy.$completeNotebookExecution(this._handle)}})}},OY=class{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 Wo,this.startedTimer=Date.now(),Mo(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();let e=this.currentDeferred;this.currentDeferred=void 0;let t=this.batch;return this.batch=[],this.callback(t).finally(()=>e.complete())}};function kY(e,t){return`${e.value}/${t}`}var AY=class{constructor(e,t){this._extHostNotebook=t,this._rendererMessageEmitters=new Map,this.proxy=e.getProxy(T.MainThreadNotebookRenderers)}$postRendererMessage(e,t,n){let r=this._extHostNotebook.getEditorById(e);this._rendererMessageEmitters.get(t)?.fire({editor:r.apiEditor,message:n})}createRendererMessaging(e,t){if(!e.contributes?.notebookRenderer?.some(e=>e.id===t))throw Error(`Extensions may only call createRendererMessaging() for renderers they contribute (got ${t})`);return{onDidReceiveMessage:(e,n,r)=>this.getOrCreateEmitterFor(t).event(e,n,r),postMessage:(e,n)=>{gJ.apiEditorsToExtHost.has(e)&&([e,n]=[n,e]);let r=n&&gJ.apiEditorsToExtHost.get(n);return this.proxy.$postMessage(r?.id,t,e)}}}getOrCreateEmitterFor(e){let t=this._rendererMessageEmitters.get(e);return t||(t=new x({onDidRemoveLastListener:()=>{t?.dispose(),this._rendererMessageEmitters.delete(e)}}),this._rendererMessageEmitters.set(e,t),t)}},jY=class{constructor(e){this.handlers=new Map,this.proxy=e.getProxy(T.MainThreadProfileContentHandlers)}registerProfileContentHandler(e,t,n){if(K(e,`profileContentHandlers`),this.handlers.has(t))throw Error(`Handler with id '${t}' already registered`);return this.handlers.set(t,n),this.proxy.$registerProfileContentHandler(t,n.name,n.description,e.identifier.value),g(()=>{this.handlers.delete(t),this.proxy.$unregisterProfileContentHandler(t)})}async $saveProfile(e,t,n,r){let i=this.handlers.get(e);if(!i)throw Error(`Unknown handler with id: ${e}`);return i.saveProfile(t,n,r)}async $readProfile(e,t,n){let r=this.handlers.get(e);if(!r)throw Error(`Unknown handler with id: ${e}`);return r.readProfile(et(t)?t:C.revive(t),n)}},MY=class e{static{this.handlePool=0}constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(T.MainThreadQuickDiff)}$provideOriginalResource(e,t,n){let r=C.revive(t),i=this.providers.get(e);return i?So(()=>i.provideOriginalResource(r,n)).then(e=>e||null):Promise.resolve(null)}registerQuickDiffProvider(t,n,r,i,a,o){let s=e.handlePool++;this.providers.set(s,r);let c=Ts.toKey(t.identifier);return this.proxy.$registerQuickDiffProvider(s,pj.from(n,this.uriTransformer),`${c}.${i}`,a,o),{dispose:()=>{this.proxy.$unregisterQuickDiffProvider(s),this.providers.delete(s)}}}};function NY(e,t,n){let r=e.getProxy(T.MainThreadQuickOpen);class i{constructor(e,t){this._sessions=new Map,this._instances=0,this._workspace=e,this._commands=t}showQuickPick(e,t,n,i=Bi.None){this._onDidSelectItem=void 0;let a=Promise.resolve(t),o=++this._instances,s=r.$show(o,{title:n?.title,placeHolder:n?.placeHolder,prompt:n?.prompt,matchOnDescription:n?.matchOnDescription,matchOnDetail:n?.matchOnDetail,ignoreFocusLost:n?.ignoreFocusOut,canPickMany:n?.canPickMany},i),c={},l=s.then(()=>c);return Promise.race([l,a]).then(t=>{if(t!==c)return a.then(t=>{let i=[];for(let n=0;n<t.length;n++){let r=t[n];typeof r==`string`?i.push({label:r,handle:n}):r.kind===TO.Separator?i.push({type:`separator`,label:r.label}):(r.tooltip&&K(e,`quickPickItemTooltip`),i.push({label:r.label,iconPathDto:RN.from(r.iconPath),description:r.description,detail:r.detail,picked:r.picked,alwaysShow:r.alwaysShow,tooltip:Y.fromStrict(r.tooltip),resourceUri:r.resourceUri,handle:n}))}return n&&typeof n.onDidSelectItem==`function`&&(this._onDidSelectItem=e=>{n.onDidSelectItem(t[e])}),r.$setItems(o,i),s.then(e=>{if(typeof e==`number`)return t[e];if(Array.isArray(e))return e.map(e=>t[e])})})}).then(void 0,e=>{if(!re(e))return r.$setError(o,e),Promise.reject(e)})}$onItemSelected(e){this._onDidSelectItem?.(e)}showInput(e,t=Bi.None){return this._validateInput=e?.validateInput,r.$input(e,typeof this._validateInput==`function`,t).then(void 0,e=>{if(!re(e))return Promise.reject(e)})}async $validateInput(e){if(!this._validateInput)return;let t=await this._validateInput(e);if(!t||typeof t==`string`)return t;let n;switch(t.severity){case EO.Info:n=Nc.Info;break;case EO.Warning:n=Nc.Warning;break;case EO.Error:n=Nc.Error;break;default:n=t.message?Nc.Error:Nc.Ignore;break}return{content:t.message,severity:n}}async showWorkspaceFolderPick(e,t=Bi.None){let n=await this._commands.executeCommand(`_workbench.pickWorkspaceFolder`,[e]);if(!n)return;let r=await this._workspace.getWorkspaceFolders2();if(r)return r.find(e=>e.uri.toString()===n.uri.toString())}createQuickPick(e){let t=new o(e,()=>this._sessions.delete(t._id));return this._sessions.set(t._id,t),t}createInputBox(e){let t=new s(e,()=>this._sessions.delete(t._id));return this._sessions.set(t._id,t),t}$onDidChangeValue(e,t){this._sessions.get(e)?._fireDidChangeValue(t)}$onDidAccept(e){this._sessions.get(e)?._fireDidAccept()}$onDidChangeActive(e,t){let n=this._sessions.get(e);n instanceof o&&n._fireDidChangeActive(t)}$onDidChangeSelection(e,t){let n=this._sessions.get(e);n instanceof o&&n._fireDidChangeSelection(t)}$onDidTriggerButton(e,t,n){this._sessions.get(e)?._fireDidTriggerButton(t,n)}$onDidTriggerItemButton(e,t,n,r){let i=this._sessions.get(e);i instanceof o&&i._fireDidTriggerItemButton(t,n,r)}$onDidHide(e){this._sessions.get(e)?._fireDidHide()}}class a{static{this._nextId=1}constructor(e,t){this._extension=e,this._onDidDispose=t,this._id=o._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 x,this._onDidChangeValueEmitter=new x,this._onDidTriggerButtonEmitter=new x,this._onDidHideEmitter=new x,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(e){this._title=e,this.update({title:e})}get step(){return this._steps}set step(e){this._steps=e,this.update({step:e})}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update({totalSteps:e})}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update({enabled:e})}get busy(){return this._busy}set busy(e){this._busy=e,this.update({busy:e})}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){this._ignoreFocusOut=e,this.update({ignoreFocusOut:e})}get value(){return this._value}set value(e){this._value=e,this.update({value:e})}get valueSelection(){return this._valueSelection}set valueSelection(e){this._valueSelection=e,this.update({valueSelection:e})}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,this.update({placeholder:e})}get buttons(){return this._buttons}set buttons(e){this._buttons=e.slice(),this._handlesToButtons.clear(),e.forEach((e,t)=>{let n=e===wO.Back?-1:t;this._handlesToButtons.set(n,e)}),this.update({buttons:e.map((e,t)=>({iconPathDto:RN.from(e.iconPath),tooltip:e.tooltip,handle:e===wO.Back?-1:t,location:typeof e.location==`number`?e.location:void 0,toggle:typeof e.toggle==`object`&&typeof e.toggle.checked==`boolean`?{checked:e.toggle.checked}: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(e){this._value=e,this._onDidChangeValueEmitter.fire(e)}_fireDidTriggerButton(e,t){let n=this._handlesToButtons.get(e);n&&(t!==void 0&&n.toggle&&(n.toggle.checked=t),this._onDidTriggerButtonEmitter.fire(n))}_fireDidHide(){this._expectingHide&&(this._expectingHide=this._visible,this._onDidHideEmitter.fire())}dispose(){this._disposed||(this._disposed=!0,this._fireDidHide(),this._disposables=xt(this._disposables),this._updateTimeout&&=(clearTimeout(this._updateTimeout),void 0),this._onDidDispose(),r.$dispose(this._id))}update(e){if(!this._disposed){for(let t of Object.keys(e)){let n=e[t];this._pendingUpdate[t]=n===void 0?null:n}`visible`in this._pendingUpdate?(this._updateTimeout&&=(clearTimeout(this._updateTimeout),void 0),this.dispatchUpdate()):this._visible&&!this._updateTimeout&&(this._updateTimeout=setTimeout(()=>{this._updateTimeout=void 0,this.dispatchUpdate()},0))}}dispatchUpdate(){r.$createOrUpdate(this._pendingUpdate),this._pendingUpdate={id:this._id}}}class o extends a{constructor(e,t){super(e,t),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 x,this._selectedItems=[],this._onDidChangeSelectionEmitter=new x,this._onDidTriggerItemButtonEmitter=new x,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(e){this._items=e.slice(),this._handlesToItems.clear(),this._itemsToHandles.clear(),e.forEach((e,t)=>{this._handlesToItems.set(t,e),this._itemsToHandles.set(e,t)});let t=[];for(let n=0;n<e.length;n++){let r=e[n];r.kind===TO.Separator?t.push({type:`separator`,label:r.label}):(r.tooltip&&K(this._extension,`quickPickItemTooltip`),t.push({handle:n,label:r.label,iconPathDto:RN.from(r.iconPath),description:r.description,detail:r.detail,picked:r.picked,alwaysShow:r.alwaysShow,tooltip:Y.fromStrict(r.tooltip),resourceUri:r.resourceUri,buttons:r.buttons?.map((e,t)=>({iconPathDto:RN.from(e.iconPath),tooltip:e.tooltip,handle:t,toggle:typeof e.toggle==`object`&&typeof e.toggle.checked==`boolean`?{checked:e.toggle.checked}:void 0}))}))}this.update({items:t})}get canSelectMany(){return this._canSelectMany}set canSelectMany(e){this._canSelectMany=e,this.update({canSelectMany:e})}get matchOnDescription(){return this._matchOnDescription}set matchOnDescription(e){this._matchOnDescription=e,this.update({matchOnDescription:e})}get matchOnDetail(){return this._matchOnDetail}set matchOnDetail(e){this._matchOnDetail=e,this.update({matchOnDetail:e})}get sortByLabel(){return this._sortByLabel}set sortByLabel(e){this._sortByLabel=e,this.update({sortByLabel:e})}get keepScrollPosition(){return this._keepScrollPosition}set keepScrollPosition(e){this._keepScrollPosition=e,this.update({keepScrollPosition:e})}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.update({prompt:e})}get activeItems(){return this._activeItems}set activeItems(e){this._activeItems=e.filter(e=>this._itemsToHandles.has(e)),this.update({activeItems:this._activeItems.map(e=>this._itemsToHandles.get(e))})}get selectedItems(){return this._selectedItems}set selectedItems(e){this._selectedItems=e.filter(e=>this._itemsToHandles.has(e)),this.update({selectedItems:this._selectedItems.map(e=>this._itemsToHandles.get(e))})}_fireDidChangeActive(e){let t=Se(e.map(e=>this._handlesToItems.get(e)));this._activeItems=t,this._onDidChangeActiveEmitter.fire(t)}_fireDidChangeSelection(e){let t=Se(e.map(e=>this._handlesToItems.get(e)));this._selectedItems=t,this._onDidChangeSelectionEmitter.fire(t)}_fireDidTriggerItemButton(e,t,n){let r=this._handlesToItems.get(e);if(!r||!r.buttons||!r.buttons.length)return;let i=r.buttons[t];i&&(n!==void 0&&i.toggle&&(i.toggle.checked=n),this._onDidTriggerItemButtonEmitter.fire({button:i,item:r}))}}class s extends a{constructor(e,t){super(e,t),this._password=!1,this.update({type:`inputBox`})}get password(){return this._password}set password(e){this._password=e,this.update({password:e})}get prompt(){return this._prompt}set prompt(e){this._prompt=e,this.update({prompt:e})}get validationMessage(){return this._validationMessage}set validationMessage(e){this._validationMessage=e,e?typeof e==`string`?this.update({validationMessage:e,severity:Nc.Error}):this.update({validationMessage:e.message,severity:e.severity??Nc.Error}):this.update({validationMessage:void 0,severity:Nc.Ignore})}}return new i(t,n)}const PY=new u(()=>{let e=oR.Collator(void 0,{numeric:!0,sensitivity:`base`}).value;return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}});new u(()=>({collator:oR.Collator(void 0,{numeric:!0}).value})),new u(()=>({collator:oR.Collator(void 0,{numeric:!0,sensitivity:`accent`}).value}));function FY(e,t,n=!1){let r=e||``,i=t||``,a=PY.value.collator.compare(r,i);return PY.value.collatorIsNumeric&&a===0&&r!==i?r<i?-1:1:a}function IY(e,t,n=!1){return n||(e&&=e.toLowerCase(),t&&=t.toLowerCase()),e===t?0:e<t?-1:1}function LY(e,t,n=!1){let r=e.split(ei),i=t.split(ei),a=r.length-1,o=i.length-1,s,c;for(let e=0;;e++){if(s=a===e,c=o===e,s&&c)return FY(r[e],i[e],n);if(s)return-1;if(c)return 1;let t=IY(r[e],i[e],n);if(t!==0)return t}}function RY(e){return e instanceof C}function zY(e,t){return e.scheme===D.file&&t.scheme===D.file&&Dn?e.toString()===t.toString():e.toString().toLowerCase()===t.toString().toLowerCase()}function BY(e){if(e){if(typeof e.iconPath==`string`)return C.file(e.iconPath);if(C.isUri(e.iconPath)||vl.isThemeIcon(e.iconPath))return e.iconPath}}function VY(e){if(e){if(C.isUri(e)||vl.isThemeIcon(e))return e;{let t=e;return{light:t.light,dark:t.dark}}}}function HY(e){let t=VY(e.authorIcon),n=Array.isArray(e.tooltip)?Y.fromMany(e.tooltip):e.tooltip?Y.from(e.tooltip):void 0,r=e.references?.map(e=>({...e,icon:VY(e.icon)}));return{...e,authorIcon:t,references:r,tooltip:n}}function UY(e){return e?{...e,icon:VY(e.icon)}:void 0}function WY(e,t){return!e.iconPath&&!t.iconPath?0:e.iconPath?t.iconPath?LY(typeof e.iconPath==`string`?e.iconPath:C.isUri(e.iconPath)?e.iconPath.fsPath:e.iconPath.id,typeof t.iconPath==`string`?t.iconPath:C.isUri(t.iconPath)?t.iconPath.fsPath:t.iconPath.id):1:-1}function GY(e,t){let n=0;if(e.strikeThrough!==t.strikeThrough)return e.strikeThrough?1:-1;if(e.faded!==t.faded)return e.faded?1:-1;if(e.tooltip!==t.tooltip)return(e.tooltip||``).localeCompare(t.tooltip||``);if(n=WY(e,t),n!==0)return n;if(e.light&&t.light)n=WY(e.light,t.light);else if(e.light)return 1;else if(t.light)return-1;if(n!==0)return n;if(e.dark&&t.dark)n=WY(e.dark,t.dark);else if(e.dark)return 1;else if(t.dark)return-1;return n}function KY(e,t){if(e.command!==t.command)return e.command<t.command?-1:1;if(e.title!==t.title)return e.title<t.title?-1:1;if(e.tooltip!==t.tooltip){if(e.tooltip!==void 0&&t.tooltip!==void 0)return e.tooltip<t.tooltip?-1:1;if(e.tooltip!==void 0)return 1;if(t.tooltip!==void 0)return-1}if(e.arguments===t.arguments)return 0;if(!e.arguments)return-1;if(!t.arguments)return 1;if(e.arguments.length!==t.arguments.length)return e.arguments.length-t.arguments.length;for(let n=0;n<e.arguments.length;n++){let r=e.arguments[n],i=t.arguments[n];if(r!==i&&!(RY(r)&&RY(i)&&zY(r,i)))return r<i?-1:1}return 0}function qY(e,t){let n=LY(e.resourceUri.fsPath,t.resourceUri.fsPath,!0);if(n!==0)return n;if(e.command&&t.command)n=KY(e.command,t.command);else if(e.command)return 1;else if(t.command)return-1;if(n!==0)return n;if(e.decorations&&t.decorations)n=GY(e.decorations,t.decorations);else if(e.decorations)return 1;else if(t.decorations)return-1;if(n!==0)return n;if(e.multiFileDiffEditorModifiedUri&&t.multiFileDiffEditorModifiedUri)n=LY(e.multiFileDiffEditorModifiedUri.fsPath,t.multiFileDiffEditorModifiedUri.fsPath,!0);else if(e.multiFileDiffEditorModifiedUri)return 1;else if(t.multiFileDiffEditorModifiedUri)return-1;if(n!==0)return n;if(e.multiDiffEditorOriginalUri&&t.multiDiffEditorOriginalUri)n=LY(e.multiDiffEditorOriginalUri.fsPath,t.multiDiffEditorOriginalUri.fsPath,!0);else if(e.multiDiffEditorOriginalUri)return 1;else if(t.multiDiffEditorOriginalUri)return-1;return n}function JY(e,t){for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function YY(e,t){return e.command===t.command&&e.title===t.title&&e.tooltip===t.tooltip&&(e.arguments&&t.arguments?JY(e.arguments,t.arguments):e.arguments===t.arguments)}function XY(e,t){return ge(e,t,YY)}var ZY=class{#e;#t;get value(){return this._value}set value(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 K(this._extension,`scmValidation`),this._validateInput}set validateInput(e){if(K(this._extension,`scmValidation`),e&&typeof e!=`function`)throw 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 K(this._extension,`scmTextDocument`),this.#t.getDocument(this._documentUri)}constructor(e,t,n,r,i){this._extension=e,this._sourceControlHandle=r,this._documentUri=i,this._value=``,this._onDidChange=new x,this._placeholder=``,this._enabled=!0,this._visible=!0,this.#t=t,this.#e=n}showValidationMessage(e,t){K(this._extension,`scmValidation`),this.#e.$showValidationMessage(this._sourceControlHandle,e,VN.from(t))}$onInputBoxValueChange(e){this.updateValue(e)}updateValue(e){this._value=e,this._onDidChange.fire(e)}},QY=class e{static{this._handlePool=0}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(t,n,r,i,a,o,s){this._proxy=t,this._commands=n,this._sourceControlHandle=r,this._id=i,this._label=a,this.multiDiffEditorEnableViewChanges=o,this._extension=s,this._resourceHandlePool=0,this._resourceStates=[],this._resourceStatesMap=new Map,this._resourceStatesCommandsMap=new Map,this._resourceStatesDisposablesMap=new Map,this._onDidUpdateResourceStates=new x,this.onDidUpdateResourceStates=this._onDidUpdateResourceStates.event,this._disposed=!1,this._onDidDispose=new x,this.onDidDispose=this._onDidDispose.event,this._handlesSnapshot=[],this._resourceSnapshot=[],this._contextValue=void 0,this._hideWhenEmpty=void 0,this.handle=e._handlePool++}getResourceState(e){return this._resourceStatesMap.get(e)}$executeResourceCommand(e,t){let n=this._resourceStatesCommandsMap.get(e);return n?So(()=>this._commands.executeCommand(n.command,...n.arguments||[],t)):Promise.resolve(void 0)}_takeResourceStateSnapshot(){let e=[...this._resourceStates].sort(qY),t=be(this._resourceSnapshot,e,qY).map(e=>{let t=e.toInsert.map(e=>{let t=this._resourceHandlePool++;this._resourceStatesMap.set(t,e);let n=e.resourceUri,r;if(e.command)if(e.command.command===`vscode.open`||e.command.command===`vscode.diff`||e.command.command===`vscode.changes`){let n=new _;r=this._commands.converter.toInternal(e.command,n),this._resourceStatesDisposablesMap.set(t,n)}else this._resourceStatesCommandsMap.set(t,e.command);let i=Mw(this._extension),a=i?e.multiDiffEditorOriginalUri:void 0,o=i?e.multiFileDiffEditorModifiedUri:void 0,s=BY(e.decorations);return{rawResource:[t,n,[e.decorations&&BY(e.decorations.light)||s,e.decorations&&BY(e.decorations.dark)||s],e.decorations&&e.decorations.tooltip||``,e.decorations&&!!e.decorations.strikeThrough,e.decorations&&!!e.decorations.faded,e.contextValue||``,r,a,o],handle:t}});return{start:e.start,deleteCount:e.deleteCount,toInsert:t}}),n=t.map(({start:e,deleteCount:t,toInsert:n})=>[e,t,n.map(e=>e.rawResource)]),r=t.reverse();for(let{start:e,deleteCount:t,toInsert:n}of r){let r=n.map(e=>e.handle),i=this._handlesSnapshot.splice(e,t,...r);for(let e of i)this._resourceStatesMap.delete(e),this._resourceStatesCommandsMap.delete(e),this._resourceStatesDisposablesMap.get(e)?.dispose(),this._resourceStatesDisposablesMap.delete(e)}return this._resourceSnapshot=e,n}dispose(){this._disposed=!0,this._onDidDispose.fire(),this._onDidUpdateResourceStates.dispose(),this._onDidDispose.dispose()}},$Y=class e{static{this._handlePool=0}#e;get id(){return this._id}get label(){return this._label}get rootUri(){return this._rootUri}get contextValue(){return K(this._extension,`scmProviderOptions`),this._contextValue}set contextValue(e){K(this._extension,`scmProviderOptions`),this._contextValue!==e&&(this._contextValue=e,this.#e.$updateSourceControl(this.handle,{contextValue:e}))}get inputBox(){return this._inputBox}get count(){return this._count}set count(e){this._count!==e&&(this._count=e,this.#e.$updateSourceControl(this.handle,{count:e}))}get quickDiffProvider(){return this._quickDiffProvider}set quickDiffProvider(e){this._quickDiffProvider=e;let t;Mw(this._extension)&&(t=e?.label),this.#e.$updateSourceControl(this.handle,{hasQuickDiffProvider:!!e,quickDiffLabel:t})}get secondaryQuickDiffProvider(){return K(this._extension,`quickDiffProvider`),this._secondaryQuickDiffProvider}set secondaryQuickDiffProvider(e){K(this._extension,`quickDiffProvider`),this._secondaryQuickDiffProvider=e;let t=e?.label;this.#e.$updateSourceControl(this.handle,{hasSecondaryQuickDiffProvider:!!e,secondaryQuickDiffLabel:t})}get historyProvider(){return K(this._extension,`scmHistoryProvider`),this._historyProvider}set historyProvider(e){K(this._extension,`scmHistoryProvider`),this._historyProvider=e,this._historyProviderDisposable.value=new _,this.#e.$updateSourceControl(this.handle,{hasHistoryProvider:!!e}),e&&(this._historyProviderDisposable.value.add(e.onDidChangeCurrentHistoryItemRefs(()=>{let t=UY(e?.currentHistoryItemRef),n=UY(e?.currentHistoryItemRemoteRef),r=UY(e?.currentHistoryItemBaseRef);this.#e.$onDidChangeHistoryProviderCurrentHistoryItemRefs(this.handle,t,n,r)})),this._historyProviderDisposable.value.add(e.onDidChangeHistoryItemRefs(e=>{if(e.added.length===0&&e.modified.length===0&&e.removed.length===0)return;let t=e.added.map(e=>({...e,icon:VY(e.icon)})),n=e.modified.map(e=>({...e,icon:VY(e.icon)})),r=e.removed.map(e=>({...e,icon:VY(e.icon)}));this.#e.$onDidChangeHistoryProviderHistoryItemRefs(this.handle,{added:t,modified:n,removed:r,silent:e.silent})})))}get artifactProvider(){return K(this._extension,`scmArtifactProvider`),this._artifactProvider}set artifactProvider(e){K(this._extension,`scmArtifactProvider`),this._artifactProvider=e,this._artifactProviderDisposable.value=new _,this.#e.$updateSourceControl(this.handle,{hasArtifactProvider:!!e}),e&&this._artifactProviderDisposable.value.add(e.onDidChangeArtifacts(e=>{e.length!==0&&this.#e.$onDidChangeArtifacts(this.handle,e)}))}get commitTemplate(){return this._commitTemplate}set commitTemplate(e){e!==this._commitTemplate&&(this._commitTemplate=e,this.#e.$updateSourceControl(this.handle,{commitTemplate:e}))}get acceptInputCommand(){return this._acceptInputCommand}set acceptInputCommand(e){this._acceptInputDisposables.value=new _,this._acceptInputCommand=e;let t=this._commands.converter.toInternal(e,this._acceptInputDisposables.value);this.#e.$updateSourceControl(this.handle,{acceptInputCommand:t})}get actionButton(){return K(this._extension,`scmActionButton`),this._actionButton}set actionButton(e){if(K(this._extension,`scmActionButton`),b_(this._actionButton,e))return;let t=this._actionButtonDisposables;this._actionButtonDisposables=new _,this._actionButton=e;let n=e===void 0?null:{command:{...this._commands.converter.toInternal(e.command,this._actionButtonDisposables),shortTitle:e.command.shortTitle},secondaryCommands:e.secondaryCommands?.map(e=>e.map(e=>this._commands.converter.toInternal(e,this._actionButtonDisposables))),enabled:e.enabled};this.#e.$updateSourceControl(this.handle,{actionButton:n}).finally(()=>t.dispose())}get statusBarCommands(){return this._statusBarCommands}set statusBarCommands(e){if(this._statusBarCommands&&e&&XY(this._statusBarCommands,e))return;let t=this._statusBarDisposables;this._statusBarDisposables=new _,this._statusBarCommands=e;let n=(e||[]).map(e=>this._commands.converter.toInternal(e,this._statusBarDisposables));this.#e.$updateSourceControl(this.handle,{statusBarCommands:n}).finally(()=>t.dispose())}get selected(){return this._selected}constructor(t,n,r,i,a,o,s,c,l,u){this._extension=t,this._commands=i,this._id=a,this._label=o,this._rootUri=s,this._onDidDispose=new x,this.onDidDispose=this._onDidDispose.event,this._groups=new Map,this._contextValue=void 0,this._count=void 0,this._quickDiffProvider=void 0,this._secondaryQuickDiffProvider=void 0,this._historyProviderDisposable=new wt,this._artifactProviderDisposable=new wt,this._commitTemplate=void 0,this._acceptInputDisposables=new wt,this._acceptInputCommand=void 0,this._actionButtonDisposables=new _,this._statusBarDisposables=new _,this._statusBarCommands=void 0,this._selected=!1,this._onDidChangeSelection=new x,this.onDidChangeSelection=this._onDidChangeSelection.event,this._artifactCommandsDisposables=new Tt,this.handle=e._handlePool++,this.createdResourceGroups=new Map,this.updatedResourceGroups=new Set,this.#e=r;let d=C.from({scheme:D.vscodeSourceControl,path:`${a}/scm${this.handle}/input`,query:s?`rootUri=${encodeURIComponent(s.toString())}`:void 0});this._inputBox=new ZY(t,n,this.#e,this.handle,d),this.#e.$registerSourceControl(this.handle,u?.handle,a,o,s,VY(c),l,d),this.onDidDisposeParent=u?u.onDidDispose:ir.None}createResourceGroup(e,t,n){let r=Mw(this._extension)&&n?.multiDiffEditorEnableViewChanges===!0,i=new QY(this.#e,this._commands,this.handle,e,t,r,this._extension),a=ir.once(i.onDidDispose)(()=>this.createdResourceGroups.delete(i));return this.createdResourceGroups.set(i,a),this.eventuallyAddResourceGroups(),i}eventuallyAddResourceGroups(){let e=[],t=[];for(let[n,r]of this.createdResourceGroups){r.dispose();let i=n.onDidUpdateResourceStates(()=>{this.updatedResourceGroups.add(n),this.eventuallyUpdateResourceStates()});ir.once(n.onDidDispose)(()=>{this.updatedResourceGroups.delete(n),i.dispose(),this._groups.delete(n.handle),this.#e.$unregisterGroup(this.handle,n.handle)}),e.push([n.handle,n.id,n.label,n.features,n.multiDiffEditorEnableViewChanges]);let a=n._takeResourceStateSnapshot();a.length>0&&t.push([n.handle,a]),this._groups.set(n.handle,n)}this.#e.$registerGroups(this.handle,e,t),this.createdResourceGroups.clear()}eventuallyUpdateResourceStates(){let e=[];this.updatedResourceGroups.forEach(t=>{let n=t._takeResourceStateSnapshot();n.length!==0&&e.push([t.handle,n])}),e.length>0&&this.#e.$spliceResourceStates(this.handle,e),this.updatedResourceGroups.clear()}getResourceGroup(e){return this._groups.get(e)}setSelectionState(e){this._selected=e,this._onDidChangeSelection.fire(e)}async provideArtifacts(e,t){let n=new _,r=(await this.artifactProvider?.provideArtifacts(e,t))?.map(e=>({...e,icon:VY(e.icon),command:e.command?this._commands.converter.toInternal(e.command,n):void 0}));return this._artifactCommandsDisposables.get(e)?.dispose(),this._artifactCommandsDisposables.set(e,n),r}dispose(){this._acceptInputDisposables.dispose(),this._actionButtonDisposables.dispose(),this._statusBarDisposables.dispose(),this._historyProviderDisposable.dispose(),this._artifactProviderDisposable.dispose(),this._artifactCommandsDisposables.dispose(),this._groups.forEach(e=>e.dispose()),this.#e.$unregisterSourceControl(this.handle),this._onDidChangeSelection.dispose(),this._onDidDispose.fire(),this._onDidDispose.dispose()}};$Y.__decorator=k([RL(100)],$Y.prototype,`eventuallyAddResourceGroups`,null),$Y.__decorator=k([RL(100)],$Y.prototype,`eventuallyUpdateResourceStates`,null);let eX=class{get onDidChangeActiveProvider(){return this._onDidChangeActiveProvider.event}constructor(e,t,n,r){this._commands=t,this._extHostDocuments=n,this.logService=r,this._sourceControls=new Map,this._sourceControlsByExtension=new Ds,this._onDidChangeActiveProvider=new x,this._proxy=e.getProxy(T.MainThreadSCM),this._telemetry=e.getProxy(T.MainThreadTelemetry),t.registerArgumentProcessor({processArgument:e=>{if(e&&e.$mid===Mr.ScmResource){let t=this._sourceControls.get(e.sourceControlHandle);if(!t)return e;let n=t.getResourceGroup(e.groupHandle);return n?n.getResourceState(e.handle):e}else if(e&&e.$mid===Mr.ScmResourceGroup){let t=this._sourceControls.get(e.sourceControlHandle);return t?t.getResourceGroup(e.groupHandle):e}else if(e&&e.$mid===Mr.ScmProvider)return this._sourceControls.get(e.handle)||e;return e}})}createSourceControl(e,t,n,r,i,a,o){this.logService.trace(`ExtHostSCM#createSourceControl`,e.identifier.value,t,n,r),this._telemetry.$publicLog2(`api/scm/createSourceControl`,{extensionId:e.identifier.value});let s=o?vt.find(this._sourceControls.values(),e=>e===o):void 0,c=new $Y(e,this._extHostDocuments,this._proxy,this._commands,t,n,r,i,a,s);this._sourceControls.set(c.handle,c);let l=this._sourceControlsByExtension.get(e.identifier)||[];return l.push(c),this._sourceControlsByExtension.set(e.identifier,l),ir.once(c.onDidDispose)(()=>{this.logService.trace(`ExtHostSCM#disposeSourceControl`,e.identifier.value,t,n,r),this._sourceControls.delete(c.handle);let i=this._sourceControlsByExtension.get(e.identifier);if(i){let t=i.indexOf(c);t!==-1&&i.splice(t,1),i.length===0&&this._sourceControlsByExtension.delete(e.identifier)}}),c}getLastInputBox(e){this.logService.trace(`ExtHostSCM#getLastInputBox`,e.identifier.value);let t=this._sourceControlsByExtension.get(e.identifier),n=t&&t[t.length-1];return n&&n.inputBox}$provideOriginalResource(e,t,n){let r=C.revive(t);this.logService.trace(`ExtHostSCM#$provideOriginalResource`,e,r.toString());let i=this._sourceControls.get(e);return!i||!i.quickDiffProvider||!i.quickDiffProvider.provideOriginalResource?Promise.resolve(null):So(()=>i.quickDiffProvider.provideOriginalResource(r,n)).then(e=>e||null)}$provideSecondaryOriginalResource(e,t,n){let r=C.revive(t);this.logService.trace(`ExtHostSCM#$provideSecondaryOriginalResource`,e,r.toString());let i=this._sourceControls.get(e);return!i||!i.secondaryQuickDiffProvider||!i.secondaryQuickDiffProvider.provideOriginalResource?Promise.resolve(null):So(()=>i.secondaryQuickDiffProvider.provideOriginalResource(r,n)).then(e=>e||null)}$onInputBoxValueChange(e,t){this.logService.trace(`ExtHostSCM#$onInputBoxValueChange`,e);let n=this._sourceControls.get(e);return n&&n.inputBox.$onInputBoxValueChange(t),Promise.resolve(void 0)}$executeResourceCommand(e,t,n,r){this.logService.trace(`ExtHostSCM#$executeResourceCommand`,e,t,n);let i=this._sourceControls.get(e);if(!i)return Promise.resolve(void 0);let a=i.getResourceGroup(t);return a?a.$executeResourceCommand(n,r):Promise.resolve(void 0)}$validateInput(e,t,n){this.logService.trace(`ExtHostSCM#$validateInput`,e);let r=this._sourceControls.get(e);return!r||!r.inputBox.validateInput?Promise.resolve(void 0):So(()=>r.inputBox.validateInput(t,n)).then(e=>{if(!e)return Promise.resolve(void 0);let t=Y.fromStrict(e.message);return t?Promise.resolve([t,e.type]):Promise.resolve(void 0)})}$setSelectedSourceControl(e){return this.logService.trace(`ExtHostSCM#$setSelectedSourceControl`,e),this._selectedSourceControlHandle===e?Promise.resolve(void 0):(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 $resolveHistoryItem(e,t,n){try{let r=await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItem(t,n);return r?HY(r):void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItem`,e);return}}async $resolveHistoryItemChatContext(e,t,n){try{return await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItemChatContext(t,n)??void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItemChatContext`,e);return}}async $resolveHistoryItemChangeRangeChatContext(e,t,n,r,i){try{return await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItemChangeRangeChatContext?.(t,n,r,i)??void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItemChangeRangeChatContext`,e);return}}async $resolveHistoryItemRefsCommonAncestor(e,t,n){try{return await(this._sourceControls.get(e)?.historyProvider)?.resolveHistoryItemRefsCommonAncestor(t,n)??void 0}catch(e){this.logService.error(`ExtHostSCM#$resolveHistoryItemRefsCommonAncestor`,e);return}}async $provideHistoryItemRefs(e,t,n){try{return(await(this._sourceControls.get(e)?.historyProvider)?.provideHistoryItemRefs(t,n))?.map(e=>({...e,icon:VY(e.icon)}))??void 0}catch(e){this.logService.error(`ExtHostSCM#$provideHistoryItemRefs`,e);return}}async $provideHistoryItems(e,t,n){try{return(await(this._sourceControls.get(e)?.historyProvider)?.provideHistoryItems(t,n))?.map(e=>HY(e))??void 0}catch(e){this.logService.error(`ExtHostSCM#$provideHistoryItems`,e);return}}async $provideHistoryItemChanges(e,t,n,r){try{return await(this._sourceControls.get(e)?.historyProvider)?.provideHistoryItemChanges(t,n,r)??void 0}catch(e){this.logService.error(`ExtHostSCM#$provideHistoryItemChanges`,e);return}}async $provideArtifactGroups(e,t){try{return(await(this._sourceControls.get(e)?.artifactProvider)?.provideArtifactGroups(t))?.map(e=>({...e,icon:VY(e.icon)}))}catch(e){this.logService.error(`ExtHostSCM#$provideArtifactGroups`,e);return}}async $provideArtifacts(e,t,n){try{return this._sourceControls.get(e)?.provideArtifacts(t,n)}catch(e){this.logService.error(`ExtHostSCM#$provideArtifacts`,e);return}}};eX=k([A(3,Ns)],eX);var tX=class e{static{this.handlePool=0}constructor(e,t){this.uriTransformer=t,this.providers=new Map,this.proxy=e.getProxy(T.MainThreadShare)}async $provideShare(e,t,n){return await this.providers.get(e)?.provideShare({selection:J.to(t.selection),resourceUri:C.revive(t.resourceUri)},n)??void 0}registerShareProvider(t,n){let r=e.handlePool++;return this.providers.set(r,n),this.proxy.$registerShareProvider(r,pj.from(t,this.uriTransformer),n.id,n.label,n.priority),{dispose:()=>{this.proxy.$unregisterShareProvider(r),this.providers.delete(r)}}}},nX=class e{static{this.ID_POOL=1}constructor(e){this.providers=new Map,this.sessions=new Map,this.synthesizers=new Map,this.proxy=e.getProxy(T.MainThreadSpeech)}async $createSpeechToTextSession(e,t,n){let r=this.providers.get(e);if(!r)return;let i=new _,a=new Hi;this.sessions.set(t,a);let o=await r.provideSpeechToTextSession(a.token,n?{language:n}:void 0);o&&(i.add(o.onDidChange(e=>{a.token.isCancellationRequested||this.proxy.$emitSpeechToTextEvent(t,e)})),i.add(a.token.onCancellationRequested(()=>i.dispose())))}async $cancelSpeechToTextSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}async $createTextToSpeechSession(e,t,n){let r=this.providers.get(e);if(!r)return;let i=new _,a=new Hi;this.sessions.set(t,a);let o=await r.provideTextToSpeechSession(a.token,n?{language:n}:void 0);o&&(this.synthesizers.set(t,o),i.add(o.onDidChange(e=>{a.token.isCancellationRequested||this.proxy.$emitTextToSpeechEvent(t,e)})),i.add(a.token.onCancellationRequested(()=>i.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){let n=this.providers.get(e);if(!n)return;let r=new _,i=new Hi;this.sessions.set(t,i);let a=await n.provideKeywordRecognitionSession(i.token);a&&(r.add(a.onDidChange(e=>{i.token.isCancellationRequested||this.proxy.$emitKeywordRecognitionEvent(t,e)})),r.add(i.token.onCancellationRequested(()=>r.dispose())))}async $cancelKeywordRecognitionSession(e){this.sessions.get(e)?.dispose(!0),this.sessions.delete(e)}registerProvider(t,n,r){let i=e.ID_POOL++;return this.providers.set(i,r),this.proxy.$registerProvider(i,n,{extension:t,displayName:t.value}),g(()=>{this.proxy.$unregisterProvider(i),this.providers.delete(i)})}},rX=class{constructor(e,t,n,r){this.id=e,this._proxy=t,this._sessions=n,this._url=r.url,this._title=r.title,this._favicon=r.favicon;let i=this;this.value={get url(){return i._url},get title(){return i._title},get icon(){return i._favicon?C.parse(i._favicon):new ND(N.globe.id)},startCDPSession(){return i._startCDPSession()},close(){return i._close()}}}update(e){let t=!1;return e.url!==this._url&&(this._url=e.url,t=!0),e.title!==this._title&&(this._title=e.title,t=!0),e.favicon!==this._favicon&&(this._favicon=e.favicon,t=!0),t}async _startCDPSession(){let e=Gc();await this._proxy.$startCDPSession(e,this.id);let t=new iX(e,this._proxy);return this._sessions.set(e,t),t.value}async _close(){await this._proxy.$closeBrowserTab(this.id)}},iX=class{constructor(e,t){this.id=e,this._proxy=t,this._onDidReceiveMessage=new x,this._onDidClose=new x,this._closed=!1;let n=this;this.value={get onDidReceiveMessage(){return n._onDidReceiveMessage.event},get onDidClose(){return n._onDidClose.event},sendMessage(e){return n._sendMessage(e)},close(){return n._close()}}}dispose(){this._onDidReceiveMessage.dispose(),this._onDidClose.dispose()}async _sendMessage(e){if(this._closed)throw Error(`Session is closed`);if(!e||typeof e!=`object`)throw Error(`Message must be an object`);if(typeof e.id!=`number`)throw Error(`Message must have a numeric id`);if(typeof e.method!=`string`)throw Error(`Message must have a method string`);if(e.params!==void 0&&typeof e.params!=`object`)throw Error(`Message params must be an object`);if(e.sessionId!==void 0&&typeof e.sessionId!=`string`)throw Error(`Message sessionId must be a string`);await this._proxy.$sendCDPMessage(this.id,{id:e.id,method:e.method,params:e.params,sessionId:e.sessionId})}async _close(){this._closed=!0,await this._proxy.$closeCDPSession(this.id)}_acceptMessage(e){this._onDidReceiveMessage.fire(e)}_acceptClosed(){this._closed=!0,this._onDidClose.fire()}},aX=class extends v{constructor(e){super(),this._browserTabs=new Map,this._sessions=this._register(new Tt),this._onDidOpenBrowserTab=this._register(new x),this.onDidOpenBrowserTab=this._onDidOpenBrowserTab.event,this._onDidCloseBrowserTab=this._register(new x),this.onDidCloseBrowserTab=this._onDidCloseBrowserTab.event,this._onDidChangeActiveBrowserTab=this._register(new x),this.onDidChangeActiveBrowserTab=this._onDidChangeActiveBrowserTab.event,this._onDidChangeBrowserTabState=this._register(new x),this.onDidChangeBrowserTabState=this._onDidChangeBrowserTabState.event,this._proxy=e.getProxy(T.MainThreadBrowsers)}get browserTabs(){return[...this._browserTabs.values()].map(e=>e.value)}get activeBrowserTab(){if(this._activeBrowserTabId)return this._browserTabs.get(this._activeBrowserTabId)?.value}async openBrowserTab(e,t){let n=vj.from(t?.viewColumn),r=await this._proxy.$openBrowserTab(e,n,{preserveFocus:t?.preserveFocus,inactive:t?.background});return this._getOrCreateTab(r).value}_getOrCreateTab(e){let t=this._browserTabs.get(e.id);return t?t.update(e):(t=new rX(e.id,this._proxy,this._sessions,e),this._browserTabs.set(e.id,t),this._onDidOpenBrowserTab.fire(t.value)),t}$onDidOpenBrowserTab(e){this._getOrCreateTab(e)}$onDidCloseBrowserTab(e){let t=this._browserTabs.get(e);t&&(this._browserTabs.delete(e),this._activeBrowserTabId===e&&(this._activeBrowserTabId=void 0),this._onDidCloseBrowserTab.fire(t.value))}$onDidChangeActiveBrowserTab(e){this._activeBrowserTabId=e,this._onDidChangeActiveBrowserTab.fire(this.activeBrowserTab)}$onDidChangeBrowserTabState(e){let t=this._browserTabs.get(e.id);t&&t.update(e)&&this._onDidChangeBrowserTabState.fire(t.value)}$onCDPSessionMessage(e,t){let n=this._sessions.get(e);n&&n._acceptMessage(t)}$onCDPSessionClosed(e){let t=this._sessions.get(e);t&&(t._acceptClosed(),this._sessions.deleteAndDispose(e))}},oX=class e{static{this.ID_GEN=0}static{this.ALLOWED_BACKGROUND_COLORS=new Map([[`statusBarItem.errorBackground`,new PD(`statusBarItem.errorForeground`)],[`statusBarItem.warningBackground`,new PD(`statusBarItem.warningForeground`)]])}#e;#t;constructor(t,n,r,i,a,o=PE.Left,s,c){if(this._onDispose=c,this._disposed=!1,this._text=``,this._staleCommandRegistrations=new _,this.#e=t,this.#t=n,a&&i){this._entryId=FE(i.identifier,a);let e=r.get(this._entryId);e&&(o=e.alignLeft?PE.Left:PE.Right,s=e.priority,this._visible=!0,this.name=e.name,this.text=e.text,this.tooltip=e.tooltip,this.command=e.command,this.accessibilityInformation=e.accessibilityInformation)}else this._entryId=String(e.ID_GEN++);this._extension=i,this._id=a,this._alignment=o,this._priority=this.validatePriority(s)}validatePriority(e){if(at(e))return e===1/0?Number.MAX_VALUE:e===-1/0?-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&&K(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&&K(this._extension,`statusBarItemTooltip`),this._tooltip2=e,this.update()}set color(e){this._color=e,this.update()}set backgroundColor(t){t&&!e.ALLOWED_BACKGROUND_COLORS.has(t.id)&&(t=void 0),this._backgroundColor=t,this.update()}set command(e){this._command?.fromApi!==e&&(this._latestCommandRegistration&&this._staleCommandRegistrations.add(this._latestCommandRegistration),this._latestCommandRegistration=new _,typeof e==`string`?this._command={fromApi:e,internal:this.#t.toInternal({title:``,command:e},this._latestCommandRegistration)}:e?this._command={fromApi:e,internal:this.#t.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,this.#e.$disposeEntry(this._entryId)}update(){this._disposed||!this._visible||(clearTimeout(this._timeoutHandle),this._timeoutHandle=setTimeout(()=>{this._timeoutHandle=void 0;let t;t=this._extension?this._id?`${this._extension.identifier.value}.${this._id}`:this._extension.identifier.value:this._id;let n;n=this._name?this._name:b(2875,`{0} (Extension)`,this._extension.displayName||this._extension.name);let r=this._color;this._backgroundColor&&(r=e.ALLOWED_BACKGROUND_COLORS.get(this._backgroundColor.id));let i,a;typeof this._tooltip2==`function`?(i=Y.fromStrict(this._tooltip),a=!0):(i=Y.fromStrict(this._tooltip2??this._tooltip),a=!1),this.#e.$setEntry(this._entryId,t,this._extension?.identifier.value,n,this._text,i,a,this._command?.internal,r,this._backgroundColor,this._alignment===PE.Left,this._priority,this._accessibilityInformation),this._staleCommandRegistrations.clear()},0))}dispose(){this.hide(),this._staleCommandRegistrations.dispose(),this._latestCommandRegistration?.dispose(),this._onDispose?.(),this._disposed=!0}},sX=class{constructor(e){this._messages=[],this._item=e.createStatusBarEntry(void 0,`status.extensionMessage`,PE.Left,Number.MIN_VALUE),this._item.name=b(2876,`Extension Status`)}dispose(){this._messages.length=0,this._item.dispose()}setMessage(e){let t={message:e};return this._messages.unshift(t),this._update(),new YT(()=>{let e=this._messages.indexOf(t);e>=0&&(this._messages.splice(e,1),this._update())})}_update(){this._messages.length>0?(this._item.text=this._messages[0].message,this._item.show()):this._item.hide()}},cX=class{constructor(e,t){this._entries=new Map,this._existingItems=new Map,this._proxy=e.getProxy(T.MainThreadStatusBar),this._commands=t,this._statusMessage=new sX(this)}$acceptStaticEntries(e){for(let t of e)this._existingItems.set(t.entryId,t)}async $provideTooltip(e,t){let n=this._entries.get(e);if(!n)return;let r=typeof n.tooltip2==`function`?await n.tooltip2(t):n.tooltip2;return t.isCancellationRequested?void 0:Y.fromStrict(r)}createStatusBarEntry(e,t,n,r){let i=new oX(this._proxy,this._commands,this._existingItems,e,t,n,r,()=>this._entries.delete(i.entryId));return this._entries.set(i.entryId,i),i}setStatusBarMessage(e,t){let n=this._statusMessage.setMessage(e),r;return typeof t==`number`?r=setTimeout(()=>n.dispose(),t):t!==void 0&&t.then(()=>n.dispose(),()=>n.dispose()),new YT(()=>{n.dispose(),clearTimeout(r)})}},lX=class extends v{constructor(e,t){super(),this._extHostDocumentsAndEditors=t,this._onDidChangeTextEditorSelection=this._register(new x),this._onDidChangeTextEditorOptions=this._register(new x),this._onDidChangeTextEditorVisibleRanges=this._register(new x),this._onDidChangeTextEditorViewColumn=this._register(new x),this._onDidChangeTextEditorDiffInformation=this._register(new x),this._onDidChangeActiveTextEditor=this._register(new x),this._onDidChangeVisibleTextEditors=this._register(new x),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(T.MainThreadTextEditors),this._register(this._extHostDocumentsAndEditors.onDidChangeVisibleTextEditors(e=>this._onDidChangeVisibleTextEditors.fire(e))),this._register(this._extHostDocumentsAndEditors.onDidChangeActiveTextEditor(e=>this._onDidChangeActiveTextEditor.fire(e)))}getActiveTextEditor(){return this._extHostDocumentsAndEditors.activeEditor()}getVisibleTextEditors(e){let t=this._extHostDocumentsAndEditors.allEditors();return e?t:t.map(e=>e.value)}async showTextDocument(e,t,n){let r;r=typeof t==`number`?{position:vj.from(t),preserveFocus:n}:typeof t==`object`?{position:vj.from(t.viewColumn),preserveFocus:t.preserveFocus,selection:typeof t.selection==`object`?J.from(t.selection):void 0,pinned:typeof t.preview==`boolean`?!t.preview:void 0}:{preserveFocus:!1};let i=await this._proxy.$tryShowTextDocument(e.uri,r),a=i&&this._extHostDocumentsAndEditors.getEditor(i);if(a)return a.value;throw Error(i?`Could NOT open editor for "${e.uri.toString()}" because another editor opened in the meantime.`:`Could NOT open editor for "${e.uri.toString()}".`)}createTextEditorDecorationType(e,t){return new jz(this._proxy,e,t).value}$acceptEditorPropertiesChanged(e,t){let n=this._extHostDocumentsAndEditors.getEditor(e);if(!n)throw Error(`unknown text editor`);if(t.options&&n._acceptOptions(t.options),t.selections){let e=t.selections.selections.map(lj.to);n._acceptSelections(e)}if(t.visibleRanges){let e=Se(t.visibleRanges.map(J.to));n._acceptVisibleRanges(e)}if(t.options&&this._onDidChangeTextEditorOptions.fire({textEditor:n.value,options:{...t.options,lineNumbers:sM.to(t.options.lineNumbers)}}),t.selections){let e=zE.fromValue(t.selections.source),r=t.selections.selections.map(lj.to);this._onDidChangeTextEditorSelection.fire({textEditor:n.value,selections:r,kind:e})}if(t.visibleRanges){let e=Se(t.visibleRanges.map(J.to));this._onDidChangeTextEditorVisibleRanges.fire({textEditor:n.value,visibleRanges:e})}}$acceptEditorPositionData(e){for(let t in e){let n=this._extHostDocumentsAndEditors.getEditor(t);if(!n)throw Error(`Unknown text editor`);let r=vj.to(e[t]);n.value.viewColumn!==r&&(n._acceptViewColumn(r),this._onDidChangeTextEditorViewColumn.fire({textEditor:n.value,viewColumn:r}))}}$acceptEditorDiffInformation(e,t){let n=this._extHostDocumentsAndEditors.getEditor(e);if(!n)throw Error(`unknown text editor`);if(!t){n._acceptDiffInformation(void 0),this._onDidChangeTextEditorDiffInformation.fire({textEditor:n.value,diffInformation:void 0});return}let r=this,i=t.map(e=>{let t=C.revive(e.original),n=C.revive(e.modified),i=e.changes.map(e=>{let[t,n,r,i]=e,a;return a=t===n?BE.Addition:r===i?BE.Deletion:BE.Modification,{original:{startLineNumber:t,endLineNumberExclusive:n},modified:{startLineNumber:r,endLineNumberExclusive:i},kind:a}});return Object.freeze({documentVersion:e.documentVersion,original:t,modified:n,changes:i,get isStale(){return r._extHostDocumentsAndEditors.getDocument(n)?.version!==e.documentVersion}})});n._acceptDiffInformation(i),this._onDidChangeTextEditorDiffInformation.fire({textEditor:n.value,diffInformation:i})}getDiffInformation(e){return Promise.resolve(this._proxy.$getDiffInformation(e))}};let uX=class{constructor(e){this._actual=new kO(AO.Dark),this._onDidChangeActiveColorTheme=new x}get activeColorTheme(){return this._actual}$onColorThemeChange(e){let t;switch(e){case`light`:t=AO.Light;break;case`hcDark`:t=AO.HighContrast;break;case`hcLight`:t=AO.HighContrastLight;break;default:t=AO.Dark}this._actual=new kO(t),this._onDidChangeActiveColorTheme.fire(this._actual)}get onDidChangeActiveColorTheme(){return this._onDidChangeActiveColorTheme.event}};uX=k([A(0,Js)],uX);var dX=class{constructor(e,t){this._providers=new Map,this._itemsBySourceAndUriMap=new Map,this._proxy=e.getProxy(T.MainThreadTimeline),t.registerArgumentProcessor({processArgument:(e,t)=>{if(e&&e.$mid===Mr.TimelineActionContext)if(this._providers.get(e.source)&&t&&Mw(t)){let t=e.uri===void 0?void 0:C.revive(e.uri);return this._itemsBySourceAndUriMap.get(e.source)?.get(fX(t))?.get(e.handle)}else return;return e}})}async $getTimeline(e,t,n,r){return this._providers.get(e)?.provider.provideTimeline(C.revive(t),n,r)}registerTimelineProvider(e,t,n,r){let i=new _,a=this.convertTimelineItem(t.id,r,i).bind(this),o;t.onDidChange&&(o=t.onDidChange(e=>this._proxy.$emitTimelineChangeEvent({uri:void 0,reset:!0,...e,id:t.id}),this));let s=this._itemsBySourceAndUriMap;return this.registerTimelineProviderCore({...t,scheme:e,onDidChange:void 0,async provideTimeline(e,n,r){n?.resetCache&&(i.clear(),s.get(t.id)?.clear());let o=await t.provideTimeline(e,n,r);if(o==null)return;let c=a(e,n);return{...o,source:t.id,items:o.items.map(c)}},dispose(){for(let e of s.values())e.get(t.id)?.clear();o?.dispose(),i.dispose()}},n)}convertTimelineItem(e,t,n){return(r,i)=>{let a;if(i?.cacheResults){let t=this._itemsBySourceAndUriMap.get(e);t===void 0&&(t=new Map,this._itemsBySourceAndUriMap.set(e,t));let n=fX(r);a=t.get(n),a===void 0&&(a=new Map,t.set(n,a))}return r=>{let{iconPath:i,...o}=r,s=`${e}|${r.id??r.timestamp}`;a?.set(s,r);let c,l,u;r.iconPath&&(i instanceof ND?u={id:i.id,color:i.color}:C.isUri(i)?(c=i,l=i):{light:c,dark:l}=i);let d;return rT.isMarkdownString(o.tooltip)?d=Y.from(o.tooltip):et(o.tooltip)?d=o.tooltip:rT.isMarkdownString(o.detail)?(console.warn(`Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip`),d=Y.from(o.detail)):et(o.detail)&&(console.warn(`Using deprecated TimelineItem.detail, migrate to TimelineItem.tooltip`),d=o.detail),{...o,id:o.id??void 0,handle:s,source:e,command:r.command?t.toInternal(r.command,n):void 0,icon:c,iconDark:l,themeIcon:u,tooltip:d,accessibilityInformation:r.accessibilityInformation}}}}registerTimelineProviderCore(e,t){if(this._providers.get(e.id))throw 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}),g(()=>{for(let t of this._itemsBySourceAndUriMap.values())t.get(e.id)?.clear();this._providers.delete(e.id),this._proxy.$unregisterTimelineProvider(e.id),e.dispose()})}};function fX(e){return e?.toString()}b(4458,`Views`),Jz(`default-view-icon`,N.window,b(4459,`Default view icon.`));var pX;(function(e){e.ViewContainersRegistry=`workbench.registry.view.containers`,e.ViewsRegistry=`workbench.registry.view`})(pX||={});var mX;(function(e){e[e.Sidebar=0]=`Sidebar`,e[e.Panel=1]=`Panel`,e[e.AuxiliaryBar=2]=`AuxiliaryBar`})(mX||={});var hX;(function(e){e[e.Editor=1]=`Editor`,e[e.Sessions=2]=`Sessions`,e[e.Both=3]=`Both`})(hX||={});var gX=class extends v{constructor(){super(...arguments),this._onDidRegister=this._register(new x),this.onDidRegister=this._onDidRegister.event,this._onDidDeregister=this._register(new x),this.onDidDeregister=this._onDidDeregister.event,this.viewContainers=new Map,this.defaultViewContainers=[]}get all(){return[...this.viewContainers.values()].flat()}registerViewContainer(e,t,n){let r=this.get(e.id);if(r)return r;let i=e;return i.openCommandActionDescriptor=n?.doNotRegisterOpenCommand?void 0:i.openCommandActionDescriptor??{id:i.id},ze(this.viewContainers,t,[]).push(i),n?.isDefault&&this.defaultViewContainers.push(i),this._onDidRegister.fire({viewContainer:i,viewContainerLocation:t}),i}deregisterViewContainer(e){for(let t of this.viewContainers.keys()){let n=this.viewContainers.get(t),r=n?.indexOf(e);if(r!==-1){n?.splice(r,1),n.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(t=>t?.id===e.id).length>0)[0]}getDefaultViewContainers(e){return this.defaultViewContainers.filter(t=>this.getViewContainerLocation(t)===e)}};Am.add(pX.ViewContainersRegistry,new gX);var _X;(function(e){e.Open=`2_open`,e.Debug=`4_debug`,e.SCM=`5_scm`,e.More=`9_more`})(_X||={});function vX(e,t){let n=e.group??_X.More,r=t.group??_X.More;return n===r?(e.order??5)-(t.order??5):n.localeCompare(r)}var yX=class extends v{constructor(){super(...arguments),this._onViewsRegistered=this._register(new x),this.onViewsRegistered=this._onViewsRegistered.event,this._onViewsDeregistered=this._register(new x),this.onViewsDeregistered=this._onViewsDeregistered.event,this._onDidChangeContainer=this._register(new x),this.onDidChangeContainer=this._onDidChangeContainer.event,this._onDidChangeViewWelcomeContent=this._register(new x),this.onDidChangeViewWelcomeContent=this._onDidChangeViewWelcomeContent.event,this._viewContainers=[],this._views=new Map,this._viewWelcomeContents=new Je}registerViews(e,t){this.registerViews2([{views:e,viewContainer:t}])}registerViews2(e){e.forEach(({views:e,viewContainer:t})=>this.addViews(e,t)),this._onViewsRegistered.fire(e)}deregisterViews(e,t){let n=this.removeViews(e,t);n.length&&this._onViewsDeregistered.fire({views:n,viewContainer:t})}moveViews(e,t){for(let n of this._views.keys())if(n!==t){let r=this.removeViews(e,n);r.length&&(this.addViews(r,t),this._onDidChangeContainer.fire({views:r,from:n,to:t}))}}getViews(e){return this._views.get(e)||[]}getView(e){for(let t of this._viewContainers){let n=(this._views.get(t)||[]).filter(t=>t.id===e)[0];if(n)return n}return null}getViewContainer(e){for(let t of this._viewContainers)if((this._views.get(t)||[]).filter(t=>t.id===e)[0])return t;return null}registerViewWelcomeContent(e,t){return this._viewWelcomeContents.add(e,t),this._onDidChangeViewWelcomeContent.fire(e),g(()=>{this._viewWelcomeContents.delete(e,t),this._onDidChangeViewWelcomeContent.fire(e)})}registerViewWelcomeContent2(e,t){let n=new Map;for(let[r,i]of t)this._viewWelcomeContents.add(e,i),n.set(r,g(()=>{this._viewWelcomeContents.delete(e,i),this._onDidChangeViewWelcomeContent.fire(e)}));return this._onDidChangeViewWelcomeContent.fire(e),n}getViewWelcomeContent(e){let t=[];return this._viewWelcomeContents.forEach(e,e=>t.push(e)),t.sort(vX)}addViews(e,t){let n=this._views.get(t);n||(n=[],this._views.set(t,n),this._viewContainers.push(t));for(let t of e){if(this.getView(t.id)!==null)throw Error(b(4460,`A view with id '{0}' is already registered`,t.id));n.push(t)}}removeViews(e,t){let n=this._views.get(t);if(!n)return[];let r=[],i=[];for(let t of n)e.includes(t)?r.push(t):i.push(t);return r.length&&(i.length?this._views.set(t,i):(this._views.delete(t),this._viewContainers.splice(this._viewContainers.indexOf(t),1))),r}};Am.add(pX.ViewsRegistry,new yX);var bX;(function(e){e[e.Default=0]=`Default`,e[e.Expand=1]=`Expand`})(bX||={});var xX;(function(e){e[e.None=0]=`None`,e[e.Collapsed=1]=`Collapsed`,e[e.Expanded=2]=`Expanded`})(xX||={});var SX=class extends Error{constructor(e){super(b(4461,`No tree view with id '{0}' registered.`,e)),this.name=`NoTreeViewError`}static is(e){return!!e&&e.name===`NoTreeViewError`}},CX=class{constructor(){this._dragOperations=new Map}removeDragOperationTransfer(e){if(e&&this._dragOperations.has(e)){let t=this._dragOperations.get(e);return this._dragOperations.delete(e),t}}addDragOperationTransfer(e,t){this._dragOperations.set(e,t)}};function wX(e,t){if(et(e))return{label:e};if(e&&typeof e==`object`&&e.label){let n;if(Array.isArray(e.highlights)&&(n=e.highlights.filter((e=>e.length===2&&typeof e[0]==`number`&&typeof e[1]==`number`)),n=n.length?n:void 0),et(e.label))return{label:e.label,highlights:n};if(rT.isMarkdownString(e.label))return K(t,`treeItemMarkdownLabel`),{label:Y.from(e.label),highlights:n}}}var TX=class extends v{constructor(e,t,n){super(),this._proxy=e,this._commands=t,this._logService=n,this._treeViews=new Map,this._treeDragAndDropService=new CX;function r(e){return e&&e.$treeViewId&&(e.$treeItemHandle||e.$selectedTreeItems||e.$focusedTreeItem)}t.registerArgumentProcessor({processArgument:e=>r(e)?this._convertArgument(e):Array.isArray(e)&&e.length>0?e.map(e=>r(e)?this._convertArgument(e):e):e})}registerTreeDataProvider(e,t,n){let r=this.createTreeView(e,{treeDataProvider:t},n);return{dispose:()=>r.dispose()}}createTreeView(e,t,n){if(!t||!t.treeDataProvider)throw Error(`Options with treeDataProvider is mandatory`);let r=t.dragAndDropController?.dropMimeTypes??[],i=t.dragAndDropController?.dragMimeTypes??[],a=!!t.dragAndDropController?.handleDrag,o=!!t.dragAndDropController?.handleDrop,s=this._createExtHostTreeView(e,t,n),c={showCollapseAll:!!t.showCollapseAll,canSelectMany:!!t.canSelectMany,dropMimeTypes:r,dragMimeTypes:i,hasHandleDrag:a,hasHandleDrop:o,manuallyManageCheckboxes:!!t.manageCheckboxStateManually},l=this._proxy.$registerTreeViewDataProvider(e,c),u={get onDidCollapseElement(){return s.onDidCollapseElement},get onDidExpandElement(){return s.onDidExpandElement},get selection(){return s.selectedElements},get onDidChangeSelection(){return s.onDidChangeSelection},get activeItem(){return K(n,`treeViewActiveItem`),s.focusedElement},get onDidChangeActiveItem(){return K(n,`treeViewActiveItem`),s.onDidChangeActiveItem},get visible(){return s.visible},get onDidChangeVisibility(){return s.onDidChangeVisibility},get onDidChangeCheckboxState(){return s.onDidChangeCheckboxState},get message(){return s.message},set message(e){wl(e)&&K(n,`treeViewMarkdownMessage`),s.message=e},get title(){return s.title},set title(e){s.title=e},get description(){return s.description},set description(e){s.description=e},get badge(){return s.badge},set badge(e){e!==void 0&&bD.isViewBadge(e)?s.badge={value:Math.floor(Math.abs(e.value)),tooltip:e.tooltip}:e===void 0&&(s.badge=void 0)},reveal:(e,t)=>s.reveal(e,t),dispose:async()=>{await l,this._treeViews.get(e)===s&&(this._treeViews.delete(e),this._proxy.$disposeTree(e)),s.dispose()}};return this._register(u),u}async $getChildren(e,t){let n=this._treeViews.get(e);if(!n)return Promise.reject(new SX(e));if(!t){let e=await n.getChildren();return e?[[0,...e]]:void 0}let r=[];for(let e=0;e<t.length;e++){let i=t[e],a=await n.getChildren(i);a&&r.push([e,...a])}return r}async $handleDrop(e,t,n,r,i,a,o,s){let c=this._treeViews.get(e);if(!c)return Promise.reject(new SX(e));let l=RM.toDataTransfer(n,async n=>(await this._proxy.$resolveDropFileData(e,t,n)).buffer);return o===e&&s&&await this._addAdditionalTransferItems(l,c,s,i,a),c.onDrop(l,r,i)}async _addAdditionalTransferItems(e,t,n,r,i){let a=this._treeDragAndDropService.removeDragOperationTransfer(i);if(a)(await a)?.forEach((t,n)=>{t&&e.set(n,t)});else if(i&&t.handleDrag){let a=t.handleDrag(n,e,r);this._treeDragAndDropService.addDragOperationTransfer(i,a),await a}return e}async $handleDrag(e,t,n,r){let i=this._treeViews.get(e);if(!i)return Promise.reject(new SX(e));let a=await this._addAdditionalTransferItems(new OD,i,t,r,n);if(!(!a||r.isCancellationRequested))return RM.from(a)}async $hasResolve(e){let t=this._treeViews.get(e);if(!t)throw new SX(e);return t.hasResolve}$resolve(e,t,n){let r=this._treeViews.get(e);if(!r)throw new SX(e);return r.resolveTreeItem(t,n)}$setExpanded(e,t,n){let r=this._treeViews.get(e);if(!r)throw new SX(e);r.setExpanded(t,n)}$setSelectionAndFocus(e,t,n){let r=this._treeViews.get(e);if(!r)throw new SX(e);r.setSelectionAndFocus(t,n)}$setVisible(e,t){let n=this._treeViews.get(e);if(!n){if(!t)return;throw new SX(e)}n.setVisible(t)}$changeCheckboxState(e,t){let n=this._treeViews.get(e);if(!n)throw new SX(e);n.setCheckboxState(t)}_createExtHostTreeView(e,t,n){let r=this._register(new EX(e,t,this._proxy,this._commands.converter,this._logService,n));return this._treeViews.set(e,r),r}_convertArgument(e){let t=this._treeViews.get(e.$treeViewId),n=e;return t&&n.$treeItemHandle?t.getExtensionElement(n.$treeItemHandle):t&&e.$focusedTreeItem?t.focusedElement:null}},EX=class e extends v{static{this.LABEL_HANDLE_PREFIX=`0`}static{this.ID_HANDLE_PREFIX=`1`}static{this.ROOT_FETCH_KEY=Symbol(`extHostTreeViewRoot`)}get visible(){return this._visible}get selectedElements(){return this._selectedHandles.map(e=>this.getExtensionElement(e)).filter(e=>!lt(e))}get focusedElement(){return this._focusedHandle?this.getExtensionElement(this._focusedHandle):void 0}constructor(e,t,n,r,i,a){if(super(),this._viewId=e,this._proxy=n,this._commands=r,this._logService=i,this._extension=a,this._roots=void 0,this._elements=new Map,this._nodes=new Map,this._childrenFetchTokens=new Map,this._globalFetchTokenCounter=0,this._visible=!1,this._selectedHandles=[],this._focusedHandle=void 0,this._onDidExpandElement=this._register(new x),this.onDidExpandElement=this._onDidExpandElement.event,this._onDidCollapseElement=this._register(new x),this.onDidCollapseElement=this._onDidCollapseElement.event,this._onDidChangeSelection=this._register(new x),this.onDidChangeSelection=this._onDidChangeSelection.event,this._onDidChangeActiveItem=this._register(new x),this.onDidChangeActiveItem=this._onDidChangeActiveItem.event,this._onDidChangeVisibility=this._register(new x),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._onDidChangeCheckboxState=this._register(new x),this.onDidChangeCheckboxState=this._onDidChangeCheckboxState.event,this._onDidChangeData=this._register(new x),this._refreshPromise=Promise.resolve(),this._refreshQueue=Promise.resolve(),this._nodesToClear=new Set,this._message=``,this._title=``,this._refreshCancellationSource=new Hi,a.contributes&&a.contributes.views)for(let t in a.contributes.views)for(let n of a.contributes.views[t])n.id===e&&(this._title=n.name);this._dataProvider=t.treeDataProvider,this._dndController=t.dragAndDropController,this._dataProvider.onDidChangeTreeData&&this._register(this._dataProvider.onDidChangeTreeData(e=>{Array.isArray(e)&&e.length===0||this._onDidChangeData.fire({message:!1,element:e})}));let o,s,c=ir.debounce(this._onDidChangeData.event,(e,t)=>(e||={message:!1,elements:[]},t.element!==!1&&(o||(o=new Promise(e=>s=e),this._refreshPromise=this._refreshPromise.then(()=>o)),Array.isArray(t.element)?e.elements.push(...t.element):e.elements.push(t.element)),t.message&&(e.message=!0),e),200,!0);this._register(c(({message:e,elements:t})=>{t.length&&(t=Ee(t),this._refreshQueue=this._refreshQueue.then(()=>{let e=s;o=null;let n=Array.from(this._nodesToClear);return this._nodesToClear.clear(),this._debugLogRefresh(`start`,t,n),this._refresh(t).then(()=>(this._debugLogRefresh(`done`,t,n),this._clearNodes(n),e())).catch(r=>{let i=r instanceof Error?r.message:JSON.stringify(r);return this._debugLogRefresh(`error`,t,n),this._clearNodes(n),this._logService.error(`Unable to refresh tree view ${this._viewId}: ${i}`),e()})})),e&&this._proxy.$setMessage(this._viewId,Y.fromStrict(this._message)??``)}))}_debugCollectHandles(e){let t=[];for(let n of e){if(!n){t.push(`<root>`);continue}let e=this._nodes.get(n);e&&t.push(e.item.handle)}return{changed:t,roots:this._roots?.map(e=>e.item.handle)??[]}}_debugLogRefresh(e,t,n){if(this._isDebugLogging())try{let r=this._debugCollectHandles(t);r.clearing=n.map(e=>e.item.handle);let i=r.changed.length,a=n.length;this._logService.debug(`[TreeView:${this._viewId}] refresh ${e} changed=${i} nodesToClear=${a} elements.size=${this._elements.size} nodes.size=${this._nodes.size} handles=${JSON.stringify(r)}`)}catch{this._logService.debug(`[TreeView:${this._viewId}] refresh ${e} (snapshot failed)`)}}_isDebugLogging(){try{let e=this._logService.getLevel();return e===H.Debug||e===H.Trace}catch{return!1}}async getChildren(e){let t=e?this.getExtensionElement(e):void 0;if(e&&!t)return this._logService.error(`No tree item with id \'${e}\' found.`),Promise.resolve([]);let n=this._getChildrenNodes(e);return n||=await this._fetchChildrenNodes(t),n?n.map(e=>e.item):void 0}getExtensionElement(e){return this._elements.get(e)}reveal(e,t){t||={select:!0,focus:!1};let n=lt(t.select)?!0:t.select,r=lt(t.focus)?!1:t.focus,i=lt(t.expand)?!1:t.expand;return typeof this._dataProvider.getParent==`function`?e?this._refreshPromise.then(()=>this._resolveUnknownParentChain(e)).then(t=>this._resolveTreeNode(e,t[t.length-1]).then(e=>this._proxy.$reveal(this._viewId,{item:e.item,parentChain:t.map(e=>e.item)},{select:n,focus:r,expand:i})),e=>this._logService.error(e)):this._proxy.$reveal(this._viewId,void 0,{select:n,focus:r,expand:i}):Promise.reject(Error(`Required registered TreeDataProvider to implement 'getParent' method to access 'reveal' method`))}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=IM.from(e),this._proxy.$setBadge(this._viewId,e))}setExpanded(e,t){let n=this.getExtensionElement(e);n&&(t?this._onDidExpandElement.fire(Object.freeze({element:n})):this._onDidCollapseElement.fire(Object.freeze({element:n})))}setSelectionAndFocus(e,t){let n=!ge(this._selectedHandles,e);this._selectedHandles=e;let r=this._focusedHandle!==t;this._focusedHandle=t,n&&this._onDidChangeSelection.fire(Object.freeze({selection:this.selectedElements})),r&&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){let t=(await Promise.all(e.map(async e=>{let t=this.getExtensionElement(e.treeItemHandle);return t?{extensionItem:t,treeItem:await this._dataProvider.getTreeItem(t),newState:e.newState?CD.Checked:CD.Unchecked}:Promise.resolve(void 0)}))).filter(e=>e!==void 0);t.forEach(e=>{e.treeItem.checkboxState=e.newState?CD.Checked:CD.Unchecked}),this._onDidChangeCheckboxState.fire({items:t.map(e=>[e.extensionItem,e.newState])})}async handleDrag(e,t,n){let r=[];for(let t of e){let e=this.getExtensionElement(t);e&&r.push(e)}if(!(!this._dndController?.handleDrag||r.length===0))return await this._dndController.handleDrag(r,t,n),t}get hasHandleDrag(){return!!this._dndController?.handleDrag}async onDrop(e,t,n){let r=t?this.getExtensionElement(t):void 0;if(!(!r&&t||!this._dndController?.handleDrop))return So(()=>this._dndController?.handleDrop?this._dndController.handleDrop(r,e,n):void 0)}get hasResolve(){return!!this._dataProvider.resolveTreeItem}async resolveTreeItem(e,t){if(!this._dataProvider.resolveTreeItem)return;let n=this._elements.get(e);if(n){let e=this._nodes.get(n);if(e){let r=await this._dataProvider.resolveTreeItem(e.extensionItem,n,t)??e.extensionItem;return this._validateTreeItem(r),e.item.tooltip=this._getTooltip(r.tooltip),e.item.command=this._getCommand(e.disposableStore,r.command),e.item}}}_resolveUnknownParentChain(e){return this._resolveParent(e).then(e=>e?this._resolveUnknownParentChain(e).then(t=>this._resolveTreeNode(e,t[t.length-1]).then(e=>(t.push(e),t))):Promise.resolve([]))}_resolveParent(e){let t=this._nodes.get(e);return t?Promise.resolve(t.parent?this._elements.get(t.parent.item.handle):void 0):So(()=>this._dataProvider.getParent(e))}async _resolveTreeNode(e,t){let n=this._nodes.get(e);if(n)return n;let r=await So(()=>this._dataProvider.getTreeItem(e)),i=this._createHandle(e,r,t,!0);await this.getChildren(t?t.item.handle:void 0);let a=this.getExtensionElement(i);if(a){let e=this._nodes.get(a);if(e)return e}throw this._logService.error(`[TreeView:${this._viewId}] Failed to resolve tree node for element ${i}`),this._proxy.$logResolveTreeNodeFailure(this._extension.identifier.value),Error(`Cannot resolve tree item for element ${i} from extension ${this._extension.identifier.value}`)}_getChildrenNodes(e){if(e){let t;if(typeof e==`string`){let n=this.getExtensionElement(e);t=n?this._nodes.get(n):void 0}else t=e;return t&&t.children||void 0}return this._roots}_getFetchKey(t){return t??e.ROOT_FETCH_KEY}async _fetchChildrenNodes(e){this._addChildrenToClear(e);let t=this._getFetchKey(e),n=++this._globalFetchTokenCounter;this._childrenFetchTokens.set(t,n);let r=new Hi(this._refreshCancellationSource.token);try{let i=await this._dataProvider.getChildren(e);if(this._childrenFetchTokens.get(t)!==n)return;let a=e?this._nodes.get(e):void 0;if(r.token.isCancellationRequested)return;let o=Se(i||[]),s=await Promise.all(Se(o).map(e=>this._dataProvider.getTreeItem(e)));if(this._childrenFetchTokens.get(t)!==n||r.token.isCancellationRequested)return;let c=s.map((e,t)=>e?this._createAndRegisterTreeNode(o[t],e,a):null);return this._childrenFetchTokens.get(t)===n?Se(c):void 0}finally{r.dispose()}}_refresh(e){if(e.some(e=>!e))return this._refreshCancellationSource.dispose(!0),this._refreshCancellationSource=new Hi,this._addChildrenToClear(),this._proxy.$refresh(this._viewId);{let t=this._getHandlesToRefresh(e);if(t.length)return this._refreshHandles(t)}return Promise.resolve(void 0)}_getHandlesToRefresh(e){let t=new Set,n=e.map(e=>this._nodes.get(e));for(let e of n)if(e&&!t.has(e.item.handle)){let r=e;for(;r&&r.parent&&n.findIndex(e=>r&&r.parent&&e&&e.item.handle===r.parent.item.handle)===-1;){let e=this._elements.get(r.parent.item.handle);r=e?this._nodes.get(e):void 0}r&&!r.parent&&t.add(e.item.handle)}let r=[];return t.forEach(e=>{let n=this._elements.get(e);if(n){let i=this._nodes.get(n);i&&(!i.parent||!t.has(i.parent.item.handle))&&r.push(e)}}),r}_refreshHandles(e){let t={};return Promise.all(e.map(e=>this._refreshNode(e).then(n=>{n&&(t[e]=n.item)}))).then(()=>Object.keys(t).length?this._proxy.$refresh(this._viewId,t):void 0)}_refreshNode(e){let t=this.getExtensionElement(e);if(t){let e=this._nodes.get(t);if(e)return this._addChildrenToClear(t),So(()=>this._dataProvider.getTreeItem(t)).then(n=>{if(n){let r=this._createTreeNode(t,n,e.parent);return this._updateNodeCache(t,r,e,e.parent),e.dispose(),r}return null})}return Promise.resolve(null)}_createAndRegisterTreeNode(t,n,r){let i=n.id?`${e.ID_HANDLE_PREFIX}/${n.id}`:void 0;if(i){let e=this._elements.get(i);if(e){let i=this._nodes.get(e);if(e!==t&&this._nodes.delete(e),i){let e=this._createTreeNode(t,n,r);return this._updateNodeCache(t,e,i,r),i.dispose(),e}}}let a=this._createTreeNode(t,n,r);return this._addNodeToCache(t,a),this._addNodeToParentCache(a,r),a}_getTooltip(e){return rT.isMarkdownString(e)?Y.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,n,r;return typeof e.checkboxState==`number`?t=e.checkboxState:(t=e.checkboxState.state,n=e.checkboxState.tooltip,r=e.checkboxState.accessibilityInformation),{isChecked:t===CD.Checked,tooltip:n,accessibilityInformation:r}}_validateTreeItem(e){if(!xD.isTreeItem(e,this._extension))throw Error(`Extension ${this._extension.identifier.value} has provided an invalid tree item.`)}_createTreeNode(e,t,n){this._validateTreeItem(t);let r=this._register(new _),i=this._createHandle(e,t,n),a=this._getLightIconPath(t);return{item:{handle:i,parentHandle:n?n.item.handle:void 0,label:wX(t.label,this._extension),description:t.description,resourceUri:t.resourceUri,tooltip:this._getTooltip(t.tooltip),command:this._getCommand(r,t.command),contextValue:t.contextValue,icon:a,iconDark:this._getDarkIconPath(t)||a,themeIcon:this._getThemeIcon(t),collapsibleState:lt(t.collapsibleState)?SD.None:t.collapsibleState,accessibilityInformation:t.accessibilityInformation,checkbox:this._getCheckbox(t)},extensionItem:t,parent:n,children:void 0,disposableStore:r,dispose(){r.dispose()}}}_getThemeIcon(e){return e.iconPath instanceof ND?e.iconPath:void 0}_createHandle(t,{id:n,label:r,resourceUri:i},a,o){if(n)return`${e.ID_HANDLE_PREFIX}/${n}`;let s=wX(r,this._extension),c=a?a.item.handle:e.LABEL_HANDLE_PREFIX,l=``;s&&(l=wl(s.label)?s.label.value:s.label);let u=l||(i?so(i):``);u=u.indexOf(`/`)===-1?u:u.replace(`/`,`//`);let d=this._nodes.has(t)?this._nodes.get(t).item.handle:void 0,f=this._getChildrenNodes(a)||[],p,m=0;do{if(p=`${c}/${m}:${u}`,o||!this._elements.has(p)||d===p)break;m++}while(m<=f.length);return p}_getLightIconPath(e){if(e.iconPath&&!(e.iconPath instanceof ND))return typeof e.iconPath==`string`||C.isUri(e.iconPath)?this._getIconPath(e.iconPath):this._getIconPath(e.iconPath.light)}_getDarkIconPath(e){if(e.iconPath&&!(e.iconPath instanceof ND)&&e.iconPath.dark)return this._getIconPath(e.iconPath.dark)}_getIconPath(e){return C.isUri(e)?e:C.file(e)}_addNodeToCache(e,t){this._elements.set(t.item.handle,e),this._nodes.set(e,t)}_updateNodeCache(e,t,n,r){this._elements.delete(t.item.handle),this._nodes.delete(e),t.item.handle!==n.item.handle&&this._elements.delete(n.item.handle),this._addNodeToCache(e,t);let i=this._getChildrenNodes(r)||[],a=i.filter(e=>e.item.handle===n.item.handle)[0];a&&i.splice(i.indexOf(a),1,t)}_addNodeToParentCache(e,t){t?(t.children||=[],t.children.push(e)):(this._roots||=[],this._roots.push(e))}_addChildrenToClear(e){if(e){let t=this._nodes.get(e);if(t){if(t.children)for(let e of t.children){this._nodesToClear.add(e);let t=this._elements.get(e.item.handle);t&&(this._addChildrenToClear(t),this._nodes.delete(t),this._elements.delete(e.item.handle))}t.children=void 0}}else this._addAllToClear()}_addAllToClear(){this._roots=void 0,this._nodes.forEach(e=>{this._nodesToClear.add(e)}),this._nodes.clear(),this._elements.clear(),this._childrenFetchTokens.clear()}_clearNodes(e){xt(e)}_clearAll(){this._roots=void 0,this._elements.clear(),xt(this._nodes.values()),this._nodes.clear(),xt(this._nodesToClear),this._nodesToClear.clear(),this._childrenFetchTokens.clear()}dispose(){super.dispose(),this._refreshCancellationSource.dispose(),this._clearAll()}},DX=class e{static{this.supportedSchemes=new Set([D.http,D.https])}constructor(e){this._openers=new Map,this._proxy=e.getProxy(T.MainThreadUriOpeners)}registerExternalUriOpener(t,n,r,i){if(this._openers.has(n))throw Error(`Opener with id '${n}' already registered`);let a=i.schemes.find(t=>!e.supportedSchemes.has(t));if(a)throw Error(`Scheme '${a}' is not supported. Only http and https are currently supported.`);return this._openers.set(n,r),this._proxy.$registerUriOpener(n,i.schemes,t,i.label),g(()=>{this._openers.delete(n),this._proxy.$unregisterUriOpener(n)})}async $canOpenUri(e,t,n){let r=this._openers.get(e);if(!r)throw Error(`Unknown opener with id: ${e}`);let i=C.revive(t);return r.canOpenExternalUri(i,n)}async $openUri(e,t,n){let r=this._openers.get(e);if(!r)throw Error(`Unknown opener id: '${e}'`);return r.openExternalUri(C.revive(t.resolvedUri),{sourceUri:C.revive(t.sourceUri)},n)}},OX=class extends v{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;constructor(e,t,n,r){super(),this.#s=void 0,this.#c=!0,this.#u=!1,this.#d=this._register(new x),this.onDidDispose=this.#d.event,this.#f=this._register(new x),this.onDidChangeViewState=this.#f.event,this.#e=e,this.#t=t,this.#r=n,this.#n=r.viewType,this.#i=r.panelOptions,this.#s=r.viewColumn,this.#a=r.title,this.#l=r.active}dispose(){this.#u||(this.#u=!0,this.#d.fire(),this.#t.$disposeWebview(this.#e),this.#r.dispose(),super.dispose())}get webview(){return this.assertNotDisposed(),this.#r}get viewType(){return this.assertNotDisposed(),this.#n}get title(){return this.assertNotDisposed(),this.#a}set title(e){this.assertNotDisposed(),this.#a!==e&&(this.#a=e,this.#t.$setTitle(this.#e,e))}get iconPath(){return this.assertNotDisposed(),this.#o}set iconPath(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,C.isUri(e)?this.#t.$setIconPath(this.#e,{light:e,dark:e}):this.#t.$setIconPath(this.#e,e))}get options(){return this.#i}get viewColumn(){if(this.assertNotDisposed(),!(typeof this.#s==`number`&&this.#s<0))return this.#s}get active(){return this.assertNotDisposed(),this.#l}get visible(){return this.assertNotDisposed(),this.#c}_updateViewState(e){this.#u||(this.active!==e.active||this.visible!==e.visible||this.viewColumn!==e.viewColumn)&&(this.#l=e.active,this.#c=e.visible,this.#s=e.viewColumn,this.#f.fire({webviewPanel:this}))}reveal(e,t){this.assertNotDisposed(),this.#t.$reveal(this.#e,{viewColumn:e===void 0?void 0:vj.from(e),preserveFocus:!!t})}assertNotDisposed(){if(this.#u)throw Error(`Webview is disposed`)}},kX=class e extends v{static newHandle(){return Gc()}constructor(e,t,n){super(),this.webviews=t,this.workspace=n,this._webviewPanels=new Map,this._serializers=new Map,this._proxy=e.getProxy(T.MainThreadWebviewPanels)}dispose(){super.dispose(),this._webviewPanels.forEach(e=>e.dispose()),this._webviewPanels.clear()}createWebviewPanel(t,n,r,i,a={}){let o=typeof i==`object`?i.viewColumn:i,s={viewColumn:vj.from(o),preserveFocus:typeof i==`object`&&!!i.preserveFocus},c=yW(t),l=e.newHandle();this._proxy.$createWebviewPanel(SW(t),l,n,{title:r,panelOptions:AX(a),webviewOptions:CW(t,this.workspace,a),serializeBuffersForPostMessage:c},s);let u=this.webviews.createNewWebview(l,a,t);return this.createNewWebviewPanel(l,n,r,o,a,u,!0)}$onDidChangeWebviewPanelViewStates(e){let t=Object.keys(e);t.sort((t,n)=>{let r=e[t],i=e[n];return r.active?1:i.active?-1:r.visible-+i.visible});for(let n of t){let t=this.getWebviewPanel(n);if(!t)continue;let r=e[n];t._updateViewState({active:r.active,visible:r.visible,viewColumn:vj.to(r.position)})}}async $onDidDisposeWebviewPanel(e){this.getWebviewPanel(e)?.dispose(),this._webviewPanels.delete(e),this.webviews.deleteWebview(e)}registerWebviewPanelSerializer(e,t,n){if(this._serializers.has(t))throw Error(`Serializer for '${t}' already registered`);return this._serializers.set(t,{serializer:n,extension:e}),this._proxy.$registerSerializer(t,{serializeBuffersForPostMessage:yW(e)}),new YT(()=>{this._serializers.delete(t),this._proxy.$unregisterSerializer(t)})}async $deserializeWebviewPanel(e,t,n,r){let i=this._serializers.get(t);if(!i)throw Error(`No serializer found for '${t}'`);let{serializer:a,extension:o}=i,s=this.webviews.createNewWebview(e,n.webviewOptions,o),c=this.createNewWebviewPanel(e,t,n.title,r,n.panelOptions,s,n.active);await a.deserializeWebviewPanel(c,n.state)}createNewWebviewPanel(e,t,n,r,i,a,o){let s=new OX(e,this._proxy,a,{viewType:t,title:n,viewColumn:r,panelOptions:i,active:o});return this._webviewPanels.set(e,s),s}getWebviewPanel(e){return this._webviewPanels.get(e)}};function AX(e){return{enableFindWidget:e.enableFindWidget,retainContextWhenHidden:e.retainContextWhenHidden}}var jX=class extends v{#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(e,t,n,r,i,a){super(),this.#i=!1,this.#l=this._register(new x),this.onDidChangeVisibility=this.#l.event,this.#u=this._register(new x),this.onDidDispose=this.#u.event,this.#n=n,this.#o=r,this.#e=e,this.#t=t,this.#r=i,this.#a=a}dispose(){this.#i||(this.#i=!0,this.#u.fire(),this.#r.dispose(),super.dispose())}#l;#u;get title(){return this.assertNotDisposed(),this.#o}set title(e){this.assertNotDisposed(),this.#o!==e&&(this.#o=e,this.#t.$setWebviewViewTitle(this.#e,e))}get description(){return this.assertNotDisposed(),this.#s}set description(e){this.assertNotDisposed(),this.#s!==e&&(this.#s=e,this.#t.$setWebviewViewDescription(this.#e,e))}get visible(){return this.#a}get webview(){return this.#r}get viewType(){return this.#n}_setVisible(e){e===this.#a||this.#i||(this.#a=e,this.#l.fire())}get badge(){return this.assertNotDisposed(),this.#c}set badge(e){this.assertNotDisposed(),!(e?.value===this.#c?.value&&e?.tooltip===this.#c?.tooltip)&&(this.#c=IM.from(e),this.#t.$setWebviewViewBadge(this.#e,e))}show(e){this.assertNotDisposed(),this.#t.$show(this.#e,!!e)}assertNotDisposed(){if(this.#i)throw Error(`Webview is disposed`)}},MX=class{constructor(e,t){this._extHostWebview=t,this._viewProviders=new Map,this._webviewViews=new Map,this._proxy=e.getProxy(T.MainThreadWebviewViews)}registerWebviewViewProvider(e,t,n,r){if(this._viewProviders.has(t))throw Error(`View provider for '${t}' already registered`);return this._viewProviders.set(t,{provider:n,extension:e}),this._proxy.$registerWebviewViewProvider(SW(e),t,{retainContextWhenHidden:r?.retainContextWhenHidden,serializeBuffersForPostMessage:yW(e)}),new YT(()=>{this._viewProviders.delete(t),this._proxy.$unregisterWebviewViewProvider(t)})}async $resolveWebviewView(e,t,n,r,i){let a=this._viewProviders.get(t);if(!a)throw Error(`No view provider found for '${t}'`);let{provider:o,extension:s}=a,c=this._extHostWebview.createNewWebview(e,{},s),l=new jX(e,this._proxy,t,n,c,!0);this._webviewViews.set(e,l),await o.resolveWebviewView(l,{state:r},i)}async $onDidChangeWebviewViewVisibility(e,t){this.getWebviewView(e)._setVisible(t)}async $disposeWebviewView(e){let t=this.getWebviewView(e);this._webviewViews.delete(e),t.dispose(),this._extHostWebview.deleteWebview(e)}getWebviewView(e){let t=this._webviewViews.get(e);if(!t)throw Error(`No webview found`);return t}};let NX=class extends v{constructor(e,t){super(),this._commands=t,this._handlePool=0,this._providers=new Map,this._itemPool=0,this._globalItems=new Map,this._providerItems=new Map,this._proxy=e.getProxy(T.MainThreadChatContext)}async $provideWorkspaceChatContext(e,t){this._clearProviderItems(e);let n=this._providers.get(e);if(!n||n.type!==`workspace`)throw Error(`Workspace context provider not found`);let r=n.provider,i=await r.provideWorkspaceChatContext?.(t)??await r.provideChatContext?.(t)??[];return this._convertItems(e,i)}async $provideExplicitChatContext(e,t){this._clearProviderItems(e);let n=this._providers.get(e);if(!n||n.type!==`explicit`)throw Error(`Explicit context provider not found`);let r=n.provider,i=await r.provideExplicitChatContext?.(t)??await r.provideChatContext?.(t)??[];return this._convertItems(e,i)}async $resolveExplicitChatContext(e,t,n){let r=this._providers.get(e);if(!r||r.type!==`explicit`)throw Error(`Explicit context provider not found`);let i=r.provider,a=this._globalItems.get(t.handle);if(!a)throw Error(`Chat context item not found`);return this._doResolve((i.resolveExplicitChatContext??i.resolveChatContext)?.bind(i),t,a,n)}async $provideResourceChatContext(e,t,n){let r=this._providers.get(e);if(!r||r.type!==`resource`)throw Error(`Resource context provider not found`);let i=r.provider,a=await i.provideResourceChatContext?.({resource:C.revive(t.resource)},n)??await i.provideChatContext?.({resource:C.revive(t.resource)},n);if(!a)return;if(a.label===void 0&&a.resourceUri===void 0)throw Error(`ChatContextItem must have either a label or a resourceUri`);let o={handle:this._addTrackedItem(e,a),icon:a.icon,label:a.label,resourceUri:a.resourceUri,modelDescription:a.modelDescription,tooltip:a.tooltip?Y.from(a.tooltip):void 0,value:t.withValue?a.value:void 0,command:a.command?{id:a.command.command}:void 0};if(t.withValue&&!o.value){let e=await(i.resolveResourceChatContext??i.resolveChatContext)?.bind(i)(a,n);o.value=e?.value,o.tooltip=e?.tooltip?Y.from(e.tooltip):o.tooltip}return o}async $resolveResourceChatContext(e,t,n){let r=this._providers.get(e);if(!r||r.type!==`resource`)throw Error(`Resource context provider not found`);let i=r.provider,a=this._globalItems.get(t.handle);if(!a)throw Error(`Chat context item not found`);return this._doResolve((i.resolveResourceChatContext??i.resolveChatContext)?.bind(i),t,a,n)}async $executeChatContextItemCommand(e){let t=this._globalItems.get(e);if(!t)throw Error(`Chat context item not found`);if(!t.command)throw Error(`Chat context item has no command`);let n=t.command.arguments?[t,...t.command.arguments]:[t];await this._commands.executeCommand(t.command.command,...n)}registerChatWorkspaceContextProvider(e,t){let n=this._handlePool++,r=new _;return this._providers.set(n,{type:`workspace`,provider:t,disposables:r}),this._listenForWorkspaceContextChanges(n,t,r),this._proxy.$registerChatWorkspaceContextProvider(n,e),{dispose:()=>{this._providers.delete(n),this._clearProviderItems(n),this._providerItems.delete(n),this._proxy.$unregisterChatContextProvider(n),r.dispose()}}}registerChatExplicitContextProvider(e,t){let n=this._handlePool++,r=new _;return this._providers.set(n,{type:`explicit`,provider:t,disposables:r}),this._proxy.$registerChatExplicitContextProvider(n,e),{dispose:()=>{this._providers.delete(n),this._clearProviderItems(n),this._providerItems.delete(n),this._proxy.$unregisterChatContextProvider(n),r.dispose()}}}registerChatResourceContextProvider(e,t,n){let r=this._handlePool++,i=new _;return this._providers.set(r,{type:`resource`,provider:n,disposables:i}),this._proxy.$registerChatResourceContextProvider(r,t,pj.from(e)),{dispose:()=>{this._providers.delete(r),this._clearProviderItems(r),this._providerItems.delete(r),this._proxy.$unregisterChatContextProvider(r),i.dispose()}}}registerChatContextProvider(e,t,n){let r=[];if(n.provideWorkspaceChatContext){let e={onDidChangeWorkspaceChatContext:n.onDidChangeWorkspaceChatContext,provideWorkspaceChatContext:e=>n.provideWorkspaceChatContext(e)};r.push(this.registerChatWorkspaceContextProvider(t,e))}if(n.provideChatContextExplicit){let e={provideExplicitChatContext:e=>n.provideChatContextExplicit(e),resolveExplicitChatContext:n.resolveChatContext?(e,t)=>n.resolveChatContext(e,t):e=>e};r.push(this.registerChatExplicitContextProvider(t,e))}if(n.provideChatContextForResource&&e){let i={provideResourceChatContext:(e,t)=>n.provideChatContextForResource(e,t),resolveResourceChatContext:n.resolveChatContext?(e,t)=>n.resolveChatContext(e,t):e=>e};r.push(this.registerChatResourceContextProvider(e,t,i))}return{dispose:()=>{for(let e of r)e.dispose()}}}_clearProviderItems(e){let t=this._providerItems.get(e);if(t){for(let e of t)this._globalItems.delete(e);t.clear()}}_addTrackedItem(e,t){let n=this._itemPool++;return this._globalItems.set(n,t),this._providerItems.has(e)||this._providerItems.set(e,new Set),this._providerItems.get(e).add(n),n}_convertItems(e,t){let n=[];for(let r of t){if(r.label===void 0&&r.resourceUri===void 0)throw Error(`ChatContextItem must have either a label or a resourceUri`);let t=this._addTrackedItem(e,r);n.push({handle:t,icon:r.icon,label:r.label,resourceUri:r.resourceUri,modelDescription:r.modelDescription,tooltip:r.tooltip?Y.from(r.tooltip):void 0,value:r.value,command:r.command?{id:r.command.command}:void 0})}return n}async _doResolve(e,t,n,r){let i=await e(n,r);return i?{handle:t.handle,icon:i.icon,label:i.label,resourceUri:i.resourceUri,modelDescription:i.modelDescription,tooltip:i.tooltip?Y.from(i.tooltip):void 0,value:i.value,command:i.command?{id:i.command.command}:void 0}:t}_listenForWorkspaceContextChanges(e,t,n){if(!t.onDidChangeWorkspaceChatContext)return;let r=async()=>{let n=await t.provideWorkspaceChatContext?.(Bi.None)??await t.provideChatContext?.(Bi.None),r=this._convertItems(e,n??[]);return this._proxy.$updateWorkspaceContextItems(e,r)};n.add(t.onDidChangeWorkspaceChatContext(async()=>r())),r()}dispose(){super.dispose();for(let{disposables:e}of this._providers.values())e.dispose()}};NX=k([A(0,Js),A(1,UI)],NX);let PX=class extends v{constructor(e){super(),this._nextHandle=0,this._activeProgress=new Map,this._onDidAddCoreEvent=this._register(new x({onWillAddFirstListener:()=>this._proxy.$subscribeToCoreDebugEvents(),onDidRemoveLastListener:()=>this._proxy.$unsubscribeFromCoreDebugEvents()})),this.onDidAddCoreEvent=this._onDidAddCoreEvent.event,this._proxy=e.getProxy(T.MainThreadChatDebug)}_progressKey(e,t){return`${e}:${C.revive(t).toString()}`}_cleanupProgress(e){let t=this._activeProgress.get(e);t&&(t.dispose(),this._activeProgress.delete(e))}registerChatDebugLogProvider(e){if(this._provider)throw Error(`A ChatDebugLogProvider is already registered.`);this._provider=e;let t=this._nextHandle++;return this._proxy.$registerChatDebugLogProvider(t),g(()=>{this._provider=void 0;for(let[e,n]of this._activeProgress)e.startsWith(`${t}:`)&&(n.dispose(),this._activeProgress.delete(e));this._proxy.$unregisterChatDebugLogProvider(t)})}async $provideChatDebugLog(e,t,n){if(!this._provider)return;let r=this._progressKey(e,t);this._cleanupProgress(r);let i=new _;this._activeProgress.set(r,i);let a=i.add(new x);i.add(a.event(n=>{let r=this._serializeEvent(n);r.sessionResource||=t,this._proxy.$acceptChatDebugEvent(e,r)})),i.add(n.onCancellationRequested(()=>{this._cleanupProgress(r)}));try{let e={report:e=>a.fire(e)},r=C.revive(t),i=await this._provider.provideChatDebugLog(r,e,n);return i?i.map(e=>this._serializeEvent(e)):void 0}catch(e){throw this._cleanupProgress(r),e}}_serializeEvent(e){let t={id:e.id,sessionResource:e.sessionResource,created:e.created.getTime(),parentEventId:e.parentEventId};switch(e._kind){case`toolCall`:{let n=e;return{...t,kind:`toolCall`,toolName:n.toolName,toolCallId:n.toolCallId,input:n.input,output:n.output,result:n.result===pA.Success?`success`:n.result===pA.Error?`error`:void 0,durationInMillis:n.durationInMillis}}case`modelTurn`:{let n=e;return{...t,kind:`modelTurn`,model:n.model,requestName:n.requestName,inputTokens:n.inputTokens,outputTokens:n.outputTokens,cachedTokens:n.cachedTokens,totalTokens:n.totalTokens,copilotUsageNanoAiu:n.copilotUsageNanoAiu,durationInMillis:n.durationInMillis}}case`generic`:{let n=e;return{...t,kind:`generic`,name:n.name,details:n.details,level:n.level,category:n.category}}case`subagentInvocation`:{let n=e;return{...t,kind:`subagentInvocation`,agentName:n.agentName,description:n.description,status:n.status===iA.Running?`running`:n.status===iA.Completed?`completed`:n.status===iA.Failed?`failed`:void 0,durationInMillis:n.durationInMillis,toolCallCount:n.toolCallCount,modelTurnCount:n.modelTurnCount}}case`userMessage`:{let n=e;return{...t,kind:`userMessage`,message:n.message,sections:n.sections.map(e=>({name:e.name,content:e.content}))}}case`agentResponse`:{let n=e;return{...t,kind:`agentResponse`,message:n.message,sections:n.sections.map(e=>({name:e.name,content:e.content}))}}default:{let n=e,r=n.name,i=n.details;return{...t,kind:`generic`,name:typeof r==`string`?r:``,details:typeof i==`string`?i:void 0,level:n.level??1,category:n.category}}}}async $resolveChatDebugLogEvent(e,t,n){if(!this._provider?.resolveChatDebugLogEvent)return;let r=await this._provider.resolveChatDebugLogEvent(t,n);if(r)switch(r._kind){case`text`:return{kind:`text`,value:r.value};case`messageContent`:{let e=r;return{kind:`message`,type:e.type===CA.User?`user`:`agent`,message:e.message,sections:e.sections.map(e=>({name:e.name,content:e.content}))}}case`userMessage`:{let e=r;return{kind:`message`,type:`user`,message:e.message,sections:e.sections.map(e=>({name:e.name,content:e.content}))}}case`agentResponse`:{let e=r;return{kind:`message`,type:`agent`,message:e.message,sections:e.sections.map(e=>({name:e.name,content:e.content}))}}case`toolCallContent`:{let e=r;return{kind:`toolCall`,toolName:e.toolName,result:e.result===pA.Success?`success`:e.result===pA.Error?`error`:void 0,durationInMillis:e.durationInMillis,input:e.input,output:e.output}}case`modelTurnContent`:{let e=r;return{kind:`modelTurn`,requestName:e.requestName,model:e.model,status:e.status,durationInMillis:e.durationInMillis,timeToFirstTokenInMillis:e.timeToFirstTokenInMillis,requestId:e.requestId,maxInputTokens:e.maxInputTokens,maxOutputTokens:e.maxOutputTokens,inputTokens:e.inputTokens,outputTokens:e.outputTokens,cachedTokens:e.cachedTokens,totalTokens:e.totalTokens,requestOptions:e.requestOptions,errorMessage:e.errorMessage,sections:e.sections?.map(e=>({name:e.name,content:e.content}))}}case`hookContent`:{let e=r;return{kind:`hook`,hookType:e.hookType,command:e.command,result:e.result===mA.Success?`success`:e.result===mA.Error?`error`:e.result===mA.NonBlockingError?`nonBlockingError`:void 0,durationInMillis:e.durationInMillis,input:e.input,output:e.output,exitCode:e.exitCode,errorMessage:e.errorMessage}}default:return}}_deserializeEvent(e){let t=new Date(e.created),n=e.sessionResource?C.revive(e.sessionResource):void 0;switch(e.kind){case`toolCall`:{let r=new hA(e.toolName,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.toolCallId=e.toolCallId,r.input=e.input,r.output=e.output,r.result=e.result===`success`?pA.Success:e.result===`error`?pA.Error:void 0,r.durationInMillis=e.durationInMillis,r}case`modelTurn`:{let r=new gA(t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.model=e.model,r.requestName=e.requestName,r.inputTokens=e.inputTokens,r.outputTokens=e.outputTokens,r.cachedTokens=e.cachedTokens,r.totalTokens=e.totalTokens,r.copilotUsageNanoAiu=e.copilotUsageNanoAiu,r.durationInMillis=e.durationInMillis,r}case`generic`:{let r=new _A(e.name,e.level,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.details=e.details,r.category=e.category,r}case`subagentInvocation`:{let r=new vA(e.agentName,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.description=e.description,r.status=e.status===`running`?iA.Running:e.status===`completed`?iA.Completed:e.status===`failed`?iA.Failed:void 0,r.durationInMillis=e.durationInMillis,r.toolCallCount=e.toolCallCount,r.modelTurnCount=e.modelTurnCount,r}case`userMessage`:{let r=new bA(e.message,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.sections=e.sections.map(e=>new yA(e.name,e.content)),r}case`agentResponse`:{let r=new xA(e.message,t);return r.id=e.id,r.sessionResource=n,r.parentEventId=e.parentEventId,r.sections=e.sections.map(e=>new yA(e.name,e.content)),r}default:return}}$onCoreDebugEvent(e){let t=this._deserializeEvent(e);t&&this._onDidAddCoreEvent.fire(t)}async $exportChatDebugLog(e,t,n,r,i){if(!this._provider?.provideChatDebugLogExport)return;let a=C.revive(t),o={coreEvents:n.map(e=>this._deserializeEvent(e)).filter(e=>e!==void 0),sessionTitle:r},s=await this._provider.provideChatDebugLogExport(a,o,i);if(s)return y.wrap(s)}async $importChatDebugLog(e,t,n){if(!this._provider?.resolveChatDebugLogImport)return;let r=await this._provider.resolveChatDebugLogImport(t.buffer,n);if(r)return{uri:r.uri,sessionTitle:r.sessionTitle}}async $getAvailableDebugSessionResources(e,t){return this._provider?.provideAvailableDebugSessionResources?await this._provider.provideAvailableDebugSessionResources(t)??[]:[]}dispose(){for(let e of this._activeProgress.values())e.dispose();this._activeProgress.clear(),super.dispose()}};PX=k([A(0,Js)],PX);function FX(e){let t=e.get(Vs),n=e.get(Wc),r=e.get(BF),i=e.get(XR),a=e.get(eF),o=e.get(VI),s=e.get(yF),c=e.get(Xs),l=e.get(Js),u=e.get(FF),d=e.get(VF),f=e.get(Ps),p=e.get(Ns),m=e.get(tI),te=e.get(tz),ne=e.get(NL),h=e.get(nH),re=e.get(IL),ae=e.get(IR),oe=e.get(JB),se=e.get(BR),ce=e.get(BL),ue=e.get(XL),de=e.get(nR),fe=e.get(EH),pe=e.get(RH),me=e.get(VH),he=e.get(ZH);l.set(E.ExtHostFileSystemInfo,n),l.set(E.ExtHostLogLevelServiceShape,f),l.set(E.ExtHostWorkspace,a),l.set(E.ExtHostConfiguration,s),l.set(E.ExtHostExtensionService,i),l.set(E.ExtHostStorage,u),l.set(E.ExtHostTunnelService,m),l.set(E.ExtHostWindow,ne),l.set(E.ExtHostPower,h),l.set(E.ExtHostUrls,re),l.set(E.ExtHostSecretState,ae),l.set(E.ExtHostTelemetry,o),l.set(E.ExtHostEditorTabs,oe),l.set(E.ExtHostManagedSockets,se),l.set(E.ExtHostProgress,ce),l.set(E.ExtHostAuthentication,ue),l.set(E.ExtHostChatProvider,de),l.set(E.ExtHostDataChannels,pe),l.set(E.ExtHostMeteredConnection,me),l.set(E.ExtHostGitExtension,he);let ge=l.set(E.ExtHostDecorations,e.get(xz)),_e=l.set(E.ExtHostDocumentsAndEditors,e.get(Lz)),ve=l.set(E.ExtHostCommands,e.get(UI)),ye=l.set(E.ExtHostTerminalService,e.get(qI)),be=l.set(E.ExtHostTerminalShellIntegration,e.get(rH)),xe=l.set(E.ExtHostDebugService,e.get(EV)),Se=l.set(E.ExtHostSearch,e.get(ZV)),Ce=l.set(E.ExtHostTask,e.get(RB)),we=l.set(E.ExtHostOutputService,e.get(vz)),Te=l.set(E.ExtHostLocalization,e.get(zR)),Ee=l.set(E.ExtHostDocuments,new KW(l,_e)),De=l.set(E.ExtHostDocumentContentProviders,new WW(l,_e,p)),Oe=l.set(E.ExtHostDocumentSaveParticipant,new GW(p,Ee,l.getProxy(T.MainThreadBulkEdits))),ke=l.set(E.ExtHostNotebook,new hY(l,ve,_e,Ee,r,Se,p)),Ae=l.set(E.ExtHostNotebookDocuments,new vY(ke)),je=l.set(E.ExtHostNotebookEditors,new yY(p,ke)),Me=l.set(E.ExtHostNotebookKernels,new SY(l,t,ke,ve,p)),Ne=l.set(E.ExtHostNotebookRenderers,new AY(l,ke)),Pe=l.set(E.ExtHostNotebookDocumentSaveParticipant,new _Y(p,ke,l.getProxy(T.MainThreadBulkEdits))),Fe=l.set(E.ExtHostEditors,new lX(l,_e)),Ie=l.set(E.ExtHostTreeViews,new TX(l.getProxy(T.MainThreadTreeViews),ve,p)),Le=l.set(E.ExtHostEditorInsets,new rW(l.getProxy(T.MainThreadEditorInsets),Fe,t.remote)),Re=l.set(E.ExtHostDiagnostics,new HW(l,p,n,_e)),ze=l.set(E.ExtHostLanguages,new uJ(l,Ee,ve.converter,c)),Be=l.set(E.ExtHostLanguageFeatures,new QG(l,c,Ee,ve,Re,p,te,o)),Ve=l.set(E.ExtHostCodeMapper,new iW(l)),He=l.set(E.ExtHostFileSystem,new aG(l,Be)),Ue=l.set(E.ExtHostFileSystemEventService,new lG(l,p,_e)),We=l.set(E.ExtHostQuickOpen,NY(l,a,ve)),Ge=l.set(E.ExtHostSCM,new eX(l,ve,Ee,p)),Ke=l.set(E.ExtHostQuickDiff,new MY(l,c)),qe=l.set(E.ExtHostShare,new tX(l,c)),Je=l.set(E.ExtHostComments,aW(l,ve,Ee)),Ye=l.set(E.ExtHostLabelService,new dG(l)),Xe=l.set(E.ExtHostTheming,new uX(l)),Ze=l.set(E.ExtHostTimeline,new dX(l,ve)),Qe=l.set(E.ExtHostWebviews,new xW(l,t.remote,a,p,te)),$e=l.set(E.ExtHostWebviewPanels,new kX(l,Qe,a)),et=l.set(E.ExtHostCustomEditors,new jW(l,Ee,d,Qe,$e)),tt=l.set(E.ExtHostWebviewViews,new MX(l,Qe)),nt=l.set(E.ExtHostTesting,e.get(aV)),rt=l.set(E.ExtHostUriOpeners,new DX(l)),it=l.set(E.ExtHostProfileContentHandlers,new jY(l)),at=l.set(E.ExtHostChatOutputRenderer,new RU(l,Qe));l.set(E.ExtHostInteractive,new uG(l,ke,_e,ve,p));let ot=l.set(E.ExtHostLanguageModelTools,new lJ(l,de)),st=l.set(E.ExtHostChatSessions,new GU(ve,de,l,p)),ct=l.set(E.ExtHostChatAgents2,new MU(l,p,ve,Ee,_e,de,Re,ot,st)),lt=l.set(E.ExtHostChatContext,new NX(l,ve)),ut=l.set(E.ExtHostChatDebug,new PX(l)),dt=l.set(E.ExtHostAiRelatedInformation,new rU(l)),ft=l.set(E.ExtHostAiEmbeddingVector,new JW(l)),pt=l.set(E.ExtHostAiSettingsSearch,new iU(l)),mt=l.set(E.ExtHostStatusBar,new cX(l,ve.converter)),ht=l.set(E.ExtHostSpeech,new nX(l)),gt=l.set(E.ExtHostEmbeddings,new qW(l)),_t=l.set(E.ExtHostBrowsers,new aX(l)),vt=l.set(E.ExtHostChatQuota,new JU(l));l.set(E.ExtHostMcp,e.get(EH));let yt=Object.values(E);l.assertRegistered(yt);let bt=new gU(l,_e),xt=new ZU(l),Ct=new fJ(l,p),g=new UW(l),_=new KU(l),v=new YU(l);return pU.register(ve),function(e,s,c){function u(t){return(n,r,i)=>{let a=t(t=>{try{n.call(r,t)}catch(t){ee(new Os(e.identifier,t,`FAILED to handle event`))}});return i?.push(a),a}}let d=(function(){let t=!e.isUnderDevelopment;function n(){t||=(p.info(`Extension '${e.identifier.value}' uses a document selector without scheme. Learn more about this: https://go.microsoft.com/fwlink/?linkid=872305`),!0)}return function t(r){if(Array.isArray(r))r.forEach(t);else if(typeof r==`string`)n();else{let t=r;t.scheme===void 0&&n(),typeof t.exclusive==`boolean`&&K(e,`documentFiltersExclusive`)}return r}})(),f={getSession(t,n,r){return(typeof r?.forceNewSession==`object`&&r.forceNewSession.learnMore||typeof r?.createIfNone==`object`&&r.createIfNone.learnMore)&&K(e,`authLearnMore`),r?.authorizationServer&&K(e,`authIssuers`),ue.getSession(e,t,n,r)},getAccounts(e){return ue.getAccounts(e)},async hasSession(t,n){return K(e,`authSession`),!!await ue.getSession(e,t,n,{silent:!0})},get onDidChangeSessions(){return u(ue.getExtensionScopedSessionsEvent(e.identifier.value))},registerAuthenticationProvider(t,n,r,i){return i?.supportedAuthorizationServers&&K(e,`authIssuers`),ue.registerAuthenticationProvider(t,n,r,i)}},ae={registerCommand(t,n,r){return ve.registerCommand(!0,t,n,r,void 0,e)},registerTextEditorCommand(t,n,r){return ve.registerCommand(!0,t,(...e)=>{let i=Fe.getActiveTextEditor();if(!i){p.warn(`Cannot execute `+t+` because there is no active text editor.`);return}return i.edit(t=>{n.apply(r,[i,t,...e])}).then(e=>{e||p.warn(`Edits from command `+t+` were not applied.`)},e=>{p.warn(`An error occurred while running command `+t,e)})},void 0,void 0,e)},registerDiffInformationCommand:(t,n,r)=>(K(e,`diffCommand`),ve.registerCommand(!0,t,async(...e)=>{let i=_e.activeEditor(!0);if(!i){p.warn(`Cannot execute `+t+` because there is no active text editor.`);return}let a=await Fe.getDiffInformation(i.id);n.apply(r,[a,...e])},void 0,void 0,e)),executeCommand(e,...t){return ve.executeCommand(e,...t)},getCommands(e=!1){return ve.getCommands(e)}},se={get machineId(){return t.telemetryInfo.machineId},get devDeviceId(){return K(e,`devDeviceId`),t.telemetryInfo.devDeviceId??t.telemetryInfo.machineId},get isAppPortable(){return t.environment.isPortable??!1},get sessionId(){return t.telemetryInfo.sessionId},get language(){return t.environment.appLanguage},get appName(){return t.environment.appName},get appRoot(){return t.environment.appRoot?.fsPath??``},get appHost(){return t.environment.appHost},get uriScheme(){return t.environment.appUriScheme},get clipboard(){return xt.value},get shell(){return ye.getDefaultShell(!1)},get onDidChangeShell(){return u(ye.onDidChangeShell)},get isTelemetryEnabled(){return o.getTelemetryConfiguration()},get onDidChangeTelemetryEnabled(){return u(o.onDidChangeTelemetryEnabled)},get telemetryConfiguration(){return K(e,`telemetry`),o.getTelemetryDetails()},get onDidChangeTelemetryConfiguration(){return K(e,`telemetry`),u(o.onDidChangeTelemetryConfiguration)},get isMeteredConnection(){return K(e,`envIsConnectionMetered`),me.isConnectionMetered},get onDidChangeMeteredConnection(){return K(e,`envIsConnectionMetered`),u(me.onDidChangeIsConnectionMetered)},get isNewAppInstall(){return BI(t.telemetryInfo.firstSessionDate)},createTelemetryLogger(t,n){return zI.validateSender(t),o.instantiateLogger(e,t,n)},async openExternal(e,n){return ne.openUri(e,{allowTunneling:t.remote.isRemote??(t.remote.authority?await m.hasTunnelProvider():!1),allowContributedOpeners:n?.allowContributedOpeners})},async asExternalUri(e){if(e.scheme===t.environment.appUriScheme)return re.createAppUri(e);try{return await ne.asExternalUri(e,{allowTunneling:!!t.remote.authority})}catch(t){if(Ya(e,D.http)||Ya(e,D.https))return e;throw t}},get remoteName(){return xs(t.remote.authority)},get remoteAuthority(){return K(e,`resolvers`),t.remote.authority},get uiKind(){return t.uiKind},get logLevel(){return p.getLevel()},get onDidChangeLogLevel(){return u(p.onDidChangeLogLevel)},get appQuality(){return K(e,`resolvers`),t.quality},get appCommit(){return K(e,`resolvers`),t.commit},getDataChannel(t){return K(e,`dataChannels`),pe.createDataChannel(e,t)},get power(){return K(e,`environmentPower`),{get onDidSuspend(){return u(h.onDidSuspend)},get onDidResume(){return u(h.onDidResume)},get onDidChangeOnBatteryPower(){return u(h.onDidChangeOnBatteryPower)},get onDidChangeThermalState(){return u(h.onDidChangeThermalState)},get onDidChangeSpeedLimit(){return u(h.onDidChangeSpeedLimit)},get onWillShutdown(){return u(h.onWillShutdown)},get onDidLockScreen(){return u(h.onDidLockScreen)},get onDidUnlockScreen(){return u(h.onDidUnlockScreen)},getSystemIdleState(e){return h.getSystemIdleState(e)},getSystemIdleTime(){return h.getSystemIdleTime()},getCurrentThermalState(){return h.getCurrentThermalState()},isOnBatteryPower(){return h.isOnBatteryPower()},async startPowerSaveBlocker(e){let t=await h.startPowerSaveBlocker(e);return{id:t.id,get isStarted(){return t.isStarted},dispose(){t.dispose()}}}}}},he={createTestController(t,n,r){return nt.createTestController(e,t,n,r)},createTestObserver(){return K(e,`testObserver`),nt.createTestObserver()},runTests(t){return K(e,`testObserver`),nt.runTests(t)},registerTestFollowupProvider(t){return K(e,`testObserver`),nt.registerTestFollowupProvider(t)},get onDidChangeTestResults(){return K(e,`testObserver`),u(nt.onResultsChanged)},get testResults(){return K(e,`testObserver`),nt.results}},Qe=t.remote.isRemote?DO.Workspace:DO.UI,yt={getExtension(t,n){Mw(e)||(n=!1);let r=s.mine.getExtensionDescription(t);if(r)return new ZR(i,e.identifier,r,Qe,!1);if(n){let n=s.all.getExtensionDescription(t);if(n)return new ZR(i,e.identifier,n,Qe,!0)}},get all(){let t=[];for(let n of s.mine.getAllExtensionDescriptions())t.push(new ZR(i,e.identifier,n,Qe,!1));return t},get allAcrossExtensionHosts(){K(e,`extensionsAny`);let t=new Es(s.mine.getAllExtensionDescriptions().map(e=>e.identifier)),n=[];for(let r of s.all.getAllExtensionDescriptions()){let a=!t.has(r.identifier);n.push(new ZR(i,e.identifier,r,Qe,a))}return n},get onDidChange(){return Mw(e)?u(ir.any(s.mine.onDidChange,s.all.onDidChange)):u(s.mine.onDidChange)}},wt={createDiagnosticCollection(t){return Re.createDiagnosticCollection(e.identifier,t)},get onDidChangeDiagnostics(){return u(Re.onDidChangeDiagnostics)},getDiagnostics:e=>Re.getDiagnostics(e),getLanguages(){return ze.getLanguages()},setTextDocumentLanguage(e,t){return ze.changeLanguage(e.uri,t)},match(e,t){let n=mM.from(e),r;return eU(n)&&(r=ke.notebookDocuments.find(e=>e.apiNotebook.getCells().find(e=>e.document===t))?.apiNotebook),$H(n,t.uri,t.languageId,!0,r?.uri,r?.notebookType)},registerCodeActionsProvider(t,n,r){return Be.registerCodeActionProvider(e,d(t),n,r)},registerDocumentPasteEditProvider(t,n,r){return Be.registerDocumentPasteEditProvider(e,d(t),n,r)},registerCodeLensProvider(t,n){return Be.registerCodeLensProvider(e,d(t),n)},registerDefinitionProvider(t,n){return Be.registerDefinitionProvider(e,d(t),n)},registerDeclarationProvider(t,n){return Be.registerDeclarationProvider(e,d(t),n)},registerImplementationProvider(t,n){return Be.registerImplementationProvider(e,d(t),n)},registerTypeDefinitionProvider(t,n){return Be.registerTypeDefinitionProvider(e,d(t),n)},registerHoverProvider(t,n){return Be.registerHoverProvider(e,d(t),n,e.identifier)},registerEvaluatableExpressionProvider(t,n){return Be.registerEvaluatableExpressionProvider(e,d(t),n,e.identifier)},registerInlineValuesProvider(t,n){return Be.registerInlineValuesProvider(e,d(t),n,e.identifier)},registerDocumentHighlightProvider(t,n){return Be.registerDocumentHighlightProvider(e,d(t),n)},registerMultiDocumentHighlightProvider(t,n){return Be.registerMultiDocumentHighlightProvider(e,d(t),n)},registerLinkedEditingRangeProvider(t,n){return Be.registerLinkedEditingRangeProvider(e,d(t),n)},registerReferenceProvider(t,n){return Be.registerReferenceProvider(e,d(t),n)},registerRenameProvider(t,n){return Be.registerRenameProvider(e,d(t),n)},registerNewSymbolNamesProvider(t,n){return K(e,`newSymbolNamesProvider`),Be.registerNewSymbolNamesProvider(e,d(t),n)},registerDocumentSymbolProvider(t,n,r){return Be.registerDocumentSymbolProvider(e,d(t),n,r)},registerWorkspaceSymbolProvider(t){return Be.registerWorkspaceSymbolProvider(e,t)},registerDocumentFormattingEditProvider(t,n){return Be.registerDocumentFormattingEditProvider(e,d(t),n)},registerDocumentRangeFormattingEditProvider(t,n){return Be.registerDocumentRangeFormattingEditProvider(e,d(t),n)},registerOnTypeFormattingEditProvider(t,n,r,...i){return Be.registerOnTypeFormattingEditProvider(e,d(t),n,[r].concat(i))},registerDocumentSemanticTokensProvider(t,n,r){return Be.registerDocumentSemanticTokensProvider(e,d(t),n,r)},registerDocumentRangeSemanticTokensProvider(t,n,r){return Be.registerDocumentRangeSemanticTokensProvider(e,d(t),n,r)},registerSignatureHelpProvider(t,n,r,...i){return typeof r==`object`?Be.registerSignatureHelpProvider(e,d(t),n,r):Be.registerSignatureHelpProvider(e,d(t),n,r===void 0?[]:[r,...i])},registerCompletionItemProvider(t,n,...r){return Be.registerCompletionItemProvider(e,d(t),n,r)},registerInlineCompletionItemProvider(t,n,r){return n.handleDidShowCompletionItem&&K(e,`inlineCompletionsAdditions`),n.handleDidPartiallyAcceptCompletionItem&&K(e,`inlineCompletionsAdditions`),r&&K(e,`inlineCompletionsAdditions`),Be.registerInlineCompletionsProvider(e,d(t),n,r)},get inlineCompletionsUnificationState(){return K(e,`inlineCompletionsAdditions`),Be.inlineCompletionsUnificationState},onDidChangeCompletionsUnificationState(t,n,r){return K(e,`inlineCompletionsAdditions`),u(Be.onDidChangeInlineCompletionsUnificationState)(t,n,r)},registerDocumentLinkProvider(t,n){return Be.registerDocumentLinkProvider(e,d(t),n)},registerColorProvider(t,n){return Be.registerColorProvider(e,d(t),n)},registerFoldingRangeProvider(t,n){return Be.registerFoldingRangeProvider(e,d(t),n)},registerSelectionRangeProvider(t,n){return Be.registerSelectionRangeProvider(e,t,n)},registerCallHierarchyProvider(t,n){return Be.registerCallHierarchyProvider(e,t,n)},registerTypeHierarchyProvider(t,n){return Be.registerTypeHierarchyProvider(e,t,n)},setLanguageConfiguration:(t,n)=>Be.setLanguageConfiguration(e,t,n),getTokenInformationAtPosition(t,n){return K(e,`tokenInformation`),ze.tokenAtPosition(t,n)},registerInlayHintsProvider(t,n){return Be.registerInlayHintsProvider(e,t,n)},createLanguageStatusItem(t,n){return ze.createLanguageStatusItem(e,t,n)},registerDocumentDropEditProvider(t,n,r){return Be.registerDocumentOnDropEditProvider(e,t,n,r)}},Tt={get activeTextEditor(){return Fe.getActiveTextEditor()},get visibleTextEditors(){return Fe.getVisibleTextEditors()},get activeTerminal(){return ye.activeTerminal},get terminals(){return ye.terminals},async showTextDocument(t,n,r){C.isUri(t)&&t.scheme===D.vscodeRemote&&!t.authority&&te.report(`workspace.showTextDocument`,e,`A URI of 'vscode-remote' scheme requires an authority.`);let i=await(C.isUri(t)?Promise.resolve(Et.openTextDocument(t)):Promise.resolve(t));return Fe.showTextDocument(i,n,r)},createTextEditorDecorationType(t){return Fe.createTextEditorDecorationType(e,t)},onDidChangeActiveTextEditor(e,t,n){return u(Fe.onDidChangeActiveTextEditor)(e,t,n)},onDidChangeVisibleTextEditors(e,t,n){return u(Fe.onDidChangeVisibleTextEditors)(e,t,n)},onDidChangeTextEditorSelection(e,t,n){return u(Fe.onDidChangeTextEditorSelection)(e,t,n)},onDidChangeTextEditorOptions(e,t,n){return u(Fe.onDidChangeTextEditorOptions)(e,t,n)},onDidChangeTextEditorVisibleRanges(e,t,n){return u(Fe.onDidChangeTextEditorVisibleRanges)(e,t,n)},onDidChangeTextEditorViewColumn(e,t,n){return u(Fe.onDidChangeTextEditorViewColumn)(e,t,n)},onDidChangeTextEditorDiffInformation(t,n,r){return K(e,`textEditorDiffInformation`),u(Fe.onDidChangeTextEditorDiffInformation)(t,n,r)},onDidCloseTerminal(e,t,n){return u(ye.onDidCloseTerminal)(e,t,n)},onDidOpenTerminal(e,t,n){return u(ye.onDidOpenTerminal)(e,t,n)},onDidChangeActiveTerminal(e,t,n){return u(ye.onDidChangeActiveTerminal)(e,t,n)},onDidChangeTerminalDimensions(t,n,r){return K(e,`terminalDimensions`),u(ye.onDidChangeTerminalDimensions)(t,n,r)},onDidChangeTerminalState(e,t,n){return u(ye.onDidChangeTerminalState)(e,t,n)},onDidWriteTerminalData(t,n,r){return K(e,`terminalDataWriteEvent`),u(ye.onDidWriteTerminalData)(t,n,r)},onDidExecuteTerminalCommand(t,n,r){return K(e,`terminalExecuteCommandEvent`),u(ye.onDidExecuteTerminalCommand)(t,n,r)},onDidChangeTerminalShellIntegration(e,t,n){return u(be.onDidChangeTerminalShellIntegration)(e,t,n)},onDidStartTerminalShellExecution(e,t,n){return u(be.onDidStartTerminalShellExecution)(e,t,n)},onDidEndTerminalShellExecution(e,t,n){return u(be.onDidEndTerminalShellExecution)(e,t,n)},get state(){return ne.getState()},onDidChangeWindowState(e,t,n){return u(ne.onDidChangeWindowState)(e,t,n)},showInformationMessage(t,...n){return Ct.showMessage(e,Nc.Info,t,n[0],n.slice(1))},showWarningMessage(t,...n){return Ct.showMessage(e,Nc.Warning,t,n[0],n.slice(1))},showErrorMessage(t,...n){return Ct.showMessage(e,Nc.Error,t,n[0],n.slice(1))},showQuickPick(t,n,r){return We.showQuickPick(e,t,n,r)},showWorkspaceFolderPick(e){return We.showWorkspaceFolderPick(e)},showInputBox(e,t){return We.showInput(e,t)},showOpenDialog(e){return g.showOpenDialog(e)},showSaveDialog(e){return g.showSaveDialog(e)},createStatusBarItem(t,n,r){let i,a,o;return typeof t==`string`?(i=t,a=n,o=r):(a=t,o=n),mt.createStatusBarEntry(e,i,a,o)},setStatusBarMessage(e,t){return mt.setStatusBarMessage(e,t)},withScmProgress(t){return te.report(`window.withScmProgress`,e,`Use 'withProgress' instead.`),ce.withProgress(e,{location:yD.SourceControl},(e,n)=>t({report(e){}}))},withProgress(t,n){return ce.withProgress(e,t,n)},createOutputChannel(t,n){return we.createOutputChannel(t,n,e)},createWebviewPanel(t,n,r,i){return $e.createWebviewPanel(e,t,n,r,i)},createWebviewTextEditorInset(t,n,r,i){return K(e,`editorInsets`),Le.createWebviewEditorInset(t,n,r,i,e)},createTerminal(t,n,r){if(typeof t==`object`){let n=t;return!Mw(e)&&`titleTemplate`in t&&t.titleTemplate!==void 0&&(console.error(`[${e.identifier.value}] \`titleTemplate\` was provided to window.createTerminal but is ignored because the \`terminalTitle\` proposed API is not enabled.`),n={...t,titleTemplate:void 0}),`pty`in n?ye.createExtensionTerminal(n):ye.createTerminalFromOptions(n)}return ye.createTerminal(t,n,r)},registerTerminalLinkProvider(e){return ye.registerLinkProvider(e)},registerTerminalProfileProvider(t,n){return ye.registerProfileProvider(e,t,n)},registerTerminalCompletionProvider(t,...n){return K(e,`terminalCompletionProvider`),ye.registerTerminalCompletionProvider(e,t,...n)},registerTerminalQuickFixProvider(t,n){return K(e,`terminalQuickFixProvider`),ye.registerTerminalQuickFixProvider(t,e.identifier.value,n)},registerTreeDataProvider(t,n){return Ie.registerTreeDataProvider(t,n,e)},createTreeView(t,n){return Ie.createTreeView(t,n,e)},registerWebviewPanelSerializer:(t,n)=>$e.registerWebviewPanelSerializer(e,t,n),registerCustomEditorProvider:(t,n,r={})=>et.registerCustomEditorProvider(e,t,n,r),registerFileDecorationProvider(t){return ge.registerFileDecorationProvider(t,e)},registerUriHandler(t){return re.registerUriHandler(e,t)},createQuickPick(){return We.createQuickPick(e)},createInputBox(){return We.createInputBox(e)},get activeColorTheme(){return Xe.activeColorTheme},onDidChangeActiveColorTheme(e,t,n){return u(Xe.onDidChangeActiveColorTheme)(e,t,n)},registerWebviewViewProvider(t,n,r){return tt.registerWebviewViewProvider(e,t,n,r?.webviewOptions)},get activeNotebookEditor(){return ke.activeNotebookEditor},onDidChangeActiveNotebookEditor(e,t,n){return u(ke.onDidChangeActiveNotebookEditor)(e,t,n)},get visibleNotebookEditors(){return ke.visibleNotebookEditors},get onDidChangeVisibleNotebookEditors(){return u(ke.onDidChangeVisibleNotebookEditors)},onDidChangeNotebookEditorSelection(e,t,n){return u(je.onDidChangeNotebookEditorSelection)(e,t,n)},onDidChangeNotebookEditorVisibleRanges(e,t,n){return u(je.onDidChangeNotebookEditorVisibleRanges)(e,t,n)},showNotebookDocument(e,t){return ke.showNotebookDocument(e,t)},registerExternalUriOpener(t,n,r){return K(e,`externalUriOpener`),rt.registerExternalUriOpener(e.identifier,t,n,r)},registerProfileContentHandler(t,n){return K(e,`profileContentHandlers`),it.registerProfileContentHandler(e,t,n)},registerQuickDiffProvider(t,n,r,i,a){return K(e,`quickDiffProvider`),Ke.registerQuickDiffProvider(e,d(t),n,r,i,a)},get tabGroups(){return oe.tabGroups},registerShareProvider(t,n){return K(e,`shareProvider`),qe.registerShareProvider(d(t),n)},get nativeHandle(){return K(e,`nativeWindowHandle`),ne.nativeHandle},createChatStatusItem:t=>(K(e,`chatStatusItem`),_.createChatStatusItem(e,t)),get activeChatPanelSessionResource(){return K(e,`chatParticipantPrivate`),ct.activeChatPanelSessionResource},onDidChangeActiveChatPanelSessionResource:(t,n,r)=>(K(e,`chatParticipantPrivate`),u(ct.onDidChangeActiveChatPanelSessionResource)(t,n,r)),get browserTabs(){return K(e,`browser`),_t.browserTabs},onDidOpenBrowserTab(t,n,r){return K(e,`browser`),u(_t.onDidOpenBrowserTab)(t,n,r)},onDidCloseBrowserTab(t,n,r){return K(e,`browser`),u(_t.onDidCloseBrowserTab)(t,n,r)},get activeBrowserTab(){return K(e,`browser`),_t.activeBrowserTab},onDidChangeActiveBrowserTab(t,n,r){return K(e,`browser`),u(_t.onDidChangeActiveBrowserTab)(t,n,r)},onDidChangeBrowserTabState(t,n,r){return K(e,`browser`),u(_t.onDidChangeBrowserTabState)(t,n,r)},openBrowserTab(t,n){return K(e,`browser`),_t.openBrowserTab(t,n)}},Et={get rootPath(){return te.report(`workspace.rootPath`,e,`Please use 'workspace.workspaceFolders' instead. More details: https://aka.ms/vscode-eliminating-rootpath`),a.getPath()},set rootPath(e){throw new le(`rootPath`)},getWorkspaceFolder(e){return a.getWorkspaceFolder(e)},get workspaceFolders(){return a.getWorkspaceFolders()},get name(){return a.name},set name(e){throw new le(`name`)},get workspaceFile(){return a.workspaceFile},set workspaceFile(e){throw new le(`workspaceFile`)},get isAgentSessionsWorkspace(){return K(e,`agentSessionsWorkspace`),!!t.environment.isSessionsWindow},updateWorkspaceFolders:(t,n,...r)=>a.updateWorkspaceFolders(e,t,n||0,...r),onDidChangeWorkspaceFolders:function(e,t,n){return u(a.onDidChangeWorkspace)(e,t,n)},asRelativePath:(e,t)=>a.getRelativePath(e,t),findFiles:(t,n,r,i)=>a.findFiles(t,n,r,e.identifier,i),findFiles2:(t,n,r)=>(K(e,`findFiles2`),a.findFiles2(t,n,e.identifier,r)),findTextInFiles:(t,n,r,i)=>{K(e,`findTextInFiles`);let o,s;return typeof n==`object`?(o=n,s=r):(o={},s=n,i=r),a.findTextInFiles(t,o||{},s,e.identifier,i)},findTextInFiles2:(t,n,r)=>(K(e,`findTextInFiles2`),K(e,`textSearchProvider2`),a.findTextInFiles2(t,n,e.identifier,r)),getTextDiff(t,n,r,i){K(e,`documentDiff`);let a=l.getProxy(T.MainThreadDocumentDiff);if(i?.isCancellationRequested){let e=new ie;return{changes:qo.EMPTY,complete:Promise.reject(e)}}let o=a.$computeDocumentDiff(t.uri,n.uri,r?.ignoreTrimWhitespace??!1,r?.maxComputationTimeMs??5e3,r?.computeMoves??!1),s=(i?xo(o,i):o).then(e=>{if(!e)throw Error(`Could not compute diff. Make sure both documents are available.`);return e}),c=e=>({originalRange:J.to(e.originalRange),modifiedRange:J.to(e.modifiedRange),innerChanges:e.innerChanges?.map(e=>({originalRange:J.to(e.originalRange),modifiedRange:J.to(e.modifiedRange)}))});return{changes:new qo(async e=>{let t=await s;e.emitMany(t.changes.map(c))}),complete:s.then(e=>({identical:e.identical,mayBeIncomplete:e.quitEarly,moves:e.moves.map(e=>({originalRange:J.to(e.originalRange),modifiedRange:J.to(e.modifiedRange),changes:e.changes.map(c)}))}))}},save:e=>a.save(e),saveAs:e=>a.saveAs(e),saveAll:e=>a.saveAll(e),applyEdit(t,n){return bt.applyWorkspaceEdit(t,e,n)},createFileSystemWatcher:(t,r,i,o)=>{let s={ignoreCreateEvents:!!r,ignoreChangeEvents:!!i,ignoreDeleteEvents:!!o};return Ue.createFileSystemWatcher(a,c,n,e,t,s)},get textDocuments(){return Ee.getAllDocumentData().map(e=>e.document)},set textDocuments(e){throw new le(`textDocuments`)},openTextDocument(t,n){let r;if(n??=t,typeof t==`string`)r=Promise.resolve(C.file(t));else if(C.isUri(t))r=Promise.resolve(t);else if(!n||typeof n==`object`)r=Ee.createDocumentData(n);else throw Error(`illegal argument - uriOrFileNameOrOptions`);return r.then(t=>(p.trace(`openTextDocument from ${e.identifier}`),t.scheme===D.vscodeRemote&&!t.authority&&te.report(`workspace.openTextDocument`,e,`A URI of 'vscode-remote' scheme requires an authority.`),Ee.ensureDocumentData(t,n).then(e=>e.document)))},onDidOpenTextDocument:(e,t,n)=>u(Ee.onDidAddDocument)(e,t,n),onDidCloseTextDocument:(e,t,n)=>u(Ee.onDidRemoveDocument)(e,t,n),onDidChangeTextDocument:(t,n,r)=>Mw(e)?u(Ee.onDidChangeDocumentWithReason)(t,n,r):u(Ee.onDidChangeDocument)(t,n,r),onDidSaveTextDocument:(e,t,n)=>u(Ee.onDidSaveDocument)(e,t,n),onWillSaveTextDocument:(t,n,r)=>u(Oe.getOnWillSaveTextDocumentEvent(e))(t,n,r),get notebookDocuments(){return ke.notebookDocuments.map(e=>e.apiNotebook)},async openNotebookDocument(e,t){let n;if(C.isUri(e))n=e,await ke.openNotebookDocument(e);else if(typeof e==`string`)n=C.revive(await ke.createNotebookDocument({viewType:e,content:t}));else throw Error(`Invalid arguments`);return ke.getNotebookDocument(n).apiNotebook},onDidSaveNotebookDocument(e,t,n){return u(Ae.onDidSaveNotebookDocument)(e,t,n)},onDidChangeNotebookDocument(e,t,n){return u(Ae.onDidChangeNotebookDocument)(e,t,n)},onWillSaveNotebookDocument(t,n,r){return u(Pe.getOnWillSaveNotebookDocumentEvent(e))(t,n,r)},get onDidOpenNotebookDocument(){return u(ke.onDidOpenNotebookDocument)},get onDidCloseNotebookDocument(){return u(ke.onDidCloseNotebookDocument)},registerNotebookSerializer(t,n,r,i){return ke.registerNotebookSerializer(e,t,n,r,Mw(e)?i:void 0)},onDidChangeConfiguration:(e,t,n)=>u(c.onDidChangeConfiguration)(e,t,n),getConfiguration(t,n){return n=arguments.length===1?void 0:n,c.getConfiguration(t,n,e)},registerTextDocumentContentProvider(e,t){return De.registerTextDocumentContentProvider(e,t)},registerTaskProvider:(t,n)=>(te.report(`window.registerTaskProvider`,e,`Use the corresponding function on the 'tasks' namespace instead`),Ce.registerTaskProvider(e,t,n)),registerFileSystemProvider(t,n,i){return St(He.registerFileSystemProvider(e,t,n,i),r.addFileSystemProvider(t,n,i))},get fs(){return r.value},registerFileSearchProvider:(t,n)=>(K(e,`fileSearchProvider`),Se.registerFileSearchProviderOld(t,n)),registerTextSearchProvider:(t,n)=>(K(e,`textSearchProvider`),Se.registerTextSearchProviderOld(t,n)),registerAITextSearchProvider:(t,n)=>(K(e,`aiTextSearchProvider`),K(e,`textSearchProvider2`),Se.registerAITextSearchProvider(t,n)),registerFileSearchProvider2:(t,n)=>(K(e,`fileSearchProvider2`),Se.registerFileSearchProvider(t,n)),registerTextSearchProvider2:(t,n)=>(K(e,`textSearchProvider2`),Se.registerTextSearchProvider(t,n)),registerRemoteAuthorityResolver:(t,n)=>(K(e,`resolvers`),i.registerRemoteAuthorityResolver(t,n)),registerResourceLabelFormatter:t=>(K(e,`resolvers`),Ye.$registerResourceLabelFormatter(t)),getRemoteExecServer:t=>(K(e,`resolvers`),i.getRemoteExecServer(t)),onDidCreateFiles:(e,t,n)=>u(Ue.onDidCreateFile)(e,t,n),onDidDeleteFiles:(e,t,n)=>u(Ue.onDidDeleteFile)(e,t,n),onDidRenameFiles:(e,t,n)=>u(Ue.onDidRenameFile)(e,t,n),onWillCreateFiles:(t,n,r)=>u(Ue.getOnWillCreateFileEvent(e))(t,n,r),onWillDeleteFiles:(t,n,r)=>u(Ue.getOnWillDeleteFileEvent(e))(t,n,r),onWillRenameFiles:(t,n,r)=>u(Ue.getOnWillRenameFileEvent(e))(t,n,r),openTunnel:t=>(K(e,`tunnels`),m.openTunnel(e,t).then(e=>{if(!e)throw Error(`cannot open tunnel`);return e})),get tunnels(){return K(e,`tunnels`),m.getTunnels()},onDidChangeTunnels:(t,n,r)=>(K(e,`tunnels`),u(m.onDidChangeTunnels)(t,n,r)),registerPortAttributesProvider:(t,n)=>(K(e,`portsAttributes`),m.registerPortsAttributesProvider(t,n)),registerTunnelProvider:(t,n)=>(K(e,`tunnelFactory`),m.registerTunnelProvider(t,n)),registerTimelineProvider:(t,n)=>(K(e,`timeline`),Ze.registerTimelineProvider(t,n,e.identifier,ve.converter)),get isTrusted(){return a.trusted},requestResourceTrust:t=>(K(e,`workspaceTrust`),a.requestResourceTrust(t)),requestWorkspaceTrust:t=>(K(e,`workspaceTrust`),a.requestWorkspaceTrust(t)),isResourceTrusted:t=>(K(e,`workspaceTrust`),a.isResourceTrusted(t)),onDidChangeWorkspaceTrustedFolders:(t,n,r)=>(K(e,`workspaceTrust`),u(a.onDidChangeWorkspaceTrustedFolders)(t,n,r)),onDidGrantWorkspaceTrust:(e,t,n)=>u(a.onDidGrantWorkspaceTrust)(e,t,n),registerEditSessionIdentityProvider:(t,n)=>(K(e,`editSessionIdentityProvider`),a.registerEditSessionIdentityProvider(t,n)),onWillCreateEditSessionIdentity:(t,n,r)=>(K(e,`editSessionIdentityProvider`),u(a.getOnWillCreateEditSessionIdentityEvent(e))(t,n,r)),registerCanonicalUriProvider:(t,n)=>(K(e,`canonicalUriProvider`),a.registerCanonicalUriProvider(t,n)),getCanonicalUri:(t,n,r)=>(K(e,`canonicalUriProvider`),a.provideCanonicalUri(t,n,r)),decode(e,t){return a.decode(e,t)},encode(e,t){return a.encode(e,t)}};return{version:t.version,ai:{getRelatedInformation(t,n){return K(e,`aiRelatedInformation`),dt.getRelatedInformation(e,t,n)},registerRelatedInformationProvider(t,n){return K(e,`aiRelatedInformation`),dt.registerRelatedInformationProvider(e,t,n)},registerEmbeddingVectorProvider(t,n){return K(e,`aiRelatedInformation`),ft.registerEmbeddingVectorProvider(e,t,n)},registerSettingsSearchProvider(t){return K(e,`aiSettingsSearch`),pt.registerSettingsSearchProvider(e,t)}},authentication:f,commands:ae,comments:{createCommentController(t,n){return Je.createCommentController(e,t,n)}},chat:{registerMappedEditsProvider(t,n){return K(e,`mappedEditsProvider`),{dispose(){}}},registerMappedEditsProvider2(t){return K(e,`mappedEditsProvider`),Ve.registerMappedEditsProvider(e,t)},createChatParticipant(t,n){return ct.createChatAgent(e,t,n)},createDynamicChatParticipant(t,n,r){return K(e,`chatParticipantPrivate`),ct.createDynamicChatAgent(e,t,n,r)},registerChatParticipantDetectionProvider(t){return K(e,`chatParticipantPrivate`),ct.registerChatParticipantDetectionProvider(e,t)},onDidDisposeChatSession:(t,n,r)=>(K(e,`chatParticipantPrivate`),u(ct.onDidDisposeChatSession)(t,n,r)),updateQuotas:t=>{K(e,`chatParticipantPrivate`),vt.updateQuotas(t)},registerChatSessionItemProvider:(t,n)=>(K(e,`chatSessionsProvider`),te.report(`chat.registerChatSessionItemProvider`,e,`Please migrate to the new chat session controller API`,{usageId:t}),st.registerChatSessionItemProvider(e,t,n)),createChatSessionItemController:(t,n)=>(K(e,`chatSessionsProvider`),st.createChatSessionItemController(e,t,n)),registerChatSessionContentProvider(t,n,r,i){return K(e,`chatSessionsProvider`),st.registerChatSessionContentProvider(e,t,r,n,i)},registerChatOutputRenderer:(t,n)=>(K(e,`chatOutputRenderer`),at.registerChatOutputRenderer(e,t,n)),registerChatWorkspaceContextProvider(t,n){return K(e,`chatContextProvider`),lt.registerChatWorkspaceContextProvider(`${e.id}-${t}`,n)},registerChatExplicitContextProvider(t,n){return K(e,`chatContextProvider`),lt.registerChatExplicitContextProvider(`${e.id}-${t}`,n)},registerChatResourceContextProvider(t,n,r){return K(e,`chatContextProvider`),lt.registerChatResourceContextProvider(d(t),`${e.id}-${n}`,r)},registerChatContextProvider(t,n,r){return K(e,`chatContextProvider`),lt.registerChatContextProvider(t?d(t):void 0,`${e.id}-${n}`,r)},registerCustomAgentProvider(t){return K(e,`chatPromptFiles`),ct.registerPromptFileProvider(e,bb.agent,t)},registerInstructionsProvider(t){return K(e,`chatPromptFiles`),ct.registerPromptFileProvider(e,bb.instructions,t)},registerPromptFileProvider(t){return K(e,`chatPromptFiles`),ct.registerPromptFileProvider(e,bb.prompt,t)},registerSkillProvider(t){return K(e,`chatPromptFiles`),ct.registerPromptFileProvider(e,bb.skill,t)},registerHookProvider(t){return K(e,`chatPromptFiles`),ct.registerPromptFileProvider(e,bb.hook,t)},registerChatDebugLogProvider(t){return K(e,`chatDebug`),ut.registerChatDebugLogProvider(t)},onDidReceiveChatDebugEvent:(t,n,r)=>(K(e,`chatDebug`),ut.onDidAddCoreEvent(t,n,r)),getCustomAgents(t){return K(e,`chatPromptFiles`),ct.provideCustomAgents(t)},onDidChangeCustomAgents:(t,n,r)=>(K(e,`chatPromptFiles`),ct.onDidChangeCustomAgents(t,n,r)),getInstructions(t){return K(e,`chatPromptFiles`),ct.provideInstructions(t)},onDidChangeInstructions:(t,n,r)=>(K(e,`chatPromptFiles`),ct.onDidChangeInstructions(t,n,r)),getSkills(t){return K(e,`chatPromptFiles`),ct.provideSkills(t)},onDidChangeSkills:(t,n,r)=>(K(e,`chatPromptFiles`),ct.onDidChangeSkills(t,n,r)),getSlashCommands(t){return K(e,`chatPromptFiles`),ct.provideSlashCommands(t)},onDidChangeSlashCommands:(t,n,r)=>(K(e,`chatPromptFiles`),ct.onDidChangeSlashCommands(t,n,r)),getHooks(t){return K(e,`chatPromptFiles`),ct.provideHooks(t)},onDidChangeHooks:(t,n,r)=>(K(e,`chatPromptFiles`),ct.onDidChangeHooks(t,n,r)),getPlugins(t){return K(e,`chatPromptFiles`),ct.providePlugins(t)},onDidChangePlugins:(t,n,r)=>(K(e,`chatPromptFiles`),ct.onDidChangePlugins(t,n,r)),registerChatSessionCustomizationProvider(t,n,r){return K(e,`chatSessionCustomizationProvider`),ct.registerChatSessionCustomizationProvider(e,t,n,r)},createInputNotification(t){return K(e,`chatInputNotification`),v.createInputNotification(e,t)}},debug:{get activeDebugSession(){return xe.activeDebugSession},get activeDebugConsole(){return xe.activeDebugConsole},get breakpoints(){return xe.breakpoints},get activeStackItem(){return xe.activeStackItem},registerDebugVisualizationProvider(t,n){return K(e,`debugVisualization`),xe.registerDebugVisualizationProvider(e,t,n)},registerDebugVisualizationTreeProvider(t,n){return K(e,`debugVisualization`),xe.registerDebugVisualizationTree(e,t,n)},onDidStartDebugSession(e,t,n){return u(xe.onDidStartDebugSession)(e,t,n)},onDidTerminateDebugSession(e,t,n){return u(xe.onDidTerminateDebugSession)(e,t,n)},onDidChangeActiveDebugSession(e,t,n){return u(xe.onDidChangeActiveDebugSession)(e,t,n)},onDidReceiveDebugSessionCustomEvent(e,t,n){return u(xe.onDidReceiveDebugSessionCustomEvent)(e,t,n)},onDidChangeBreakpoints(e,t,n){return u(xe.onDidChangeBreakpoints)(e,t,n)},onDidChangeActiveStackItem(e,t,n){return u(xe.onDidChangeActiveStackItem)(e,t,n)},registerDebugConfigurationProvider(e,t,n){return xe.registerDebugConfigurationProvider(e,t,n||Hx.Initial)},registerDebugAdapterDescriptorFactory(t,n){return xe.registerDebugAdapterDescriptorFactory(e,t,n)},registerDebugAdapterTrackerFactory(e,t){return xe.registerDebugAdapterTrackerFactory(e,t)},startDebugging(e,t,n){return!n||typeof n==`object`&&`configuration`in n?xe.startDebugging(e,t,{parentSession:n}):xe.startDebugging(e,t,n||{})},stopDebugging(e){return xe.stopDebugging(e)},addBreakpoints(e){return xe.addBreakpoints(e)},removeBreakpoints(e){return xe.removeBreakpoints(e)},asDebugSourceUri(e,t){return xe.asDebugSourceUri(e,t)}},env:se,extensions:yt,interactive:{transferActiveChat(t){return K(e,`interactive`),ct.transferActiveChat(t)}},l10n:{t(...t){if(typeof t[0]==`string`){let n=t.shift(),r=!t||typeof t[0]!=`object`?t:t[0];return Te.getMessage(e.identifier.value,{message:n,args:r})}return Te.getMessage(e.identifier.value,t[0])},get bundle(){return Te.getBundle(e.identifier.value)},get uri(){return Te.getBundleUri(e.identifier.value)}},languages:wt,lm:{selectChatModels:t=>de.selectLanguageModels(e,t??{}),onDidChangeChatModels:(e,t,n)=>de.onDidChangeProviders(e,t,n),registerLanguageModelChatProvider:(t,n)=>de.registerLanguageModelChatProvider(e,t,n),get isModelProxyAvailable(){return K(e,`languageModelProxy`),de.isModelProxyAvailable},onDidChangeModelProxyAvailability:(t,n,r)=>(K(e,`languageModelProxy`),de.onDidChangeModelProxyAvailability(t,n,r)),getModelProxy:()=>(K(e,`languageModelProxy`),de.getModelProxy(e)),registerLanguageModelProxyProvider:t=>(K(e,`chatParticipantPrivate`),de.registerLanguageModelProxyProvider(e,t)),get embeddingModels(){return K(e,`embeddings`),gt.embeddingsModels},onDidChangeEmbeddingModels:(t,n,r)=>(K(e,`embeddings`),gt.onDidChange(t,n,r)),registerEmbeddingsProvider(t,n){return K(e,`embeddings`),gt.registerEmbeddingsProvider(e,t,n)},async computeEmbeddings(t,n,r){return K(e,`embeddings`),gt.computeEmbeddings(t,n,r)},registerTool(t,n){return ot.registerTool(e,t,n)},registerToolDefinition(t,n){return ot.registerToolDefinition(e,t,n)},invokeTool(t,n,r){return typeof t!=`string`&&K(e,`chatParticipantAdditions`),ot.invokeTool(e,t,n,r)},get tools(){return ot.getTools(e)},fileIsIgnored(t,n){return de.fileIsIgnored(e,t,n)},registerIgnoredFileProvider(t){return de.registerIgnoredFileProvider(e,t)},registerMcpServerDefinitionProvider(t,n){return fe.registerMcpConfigurationProvider(e,t,n)},onDidChangeMcpServerDefinitions:(...t)=>(K(e,`mcpServerDefinitions`),u(fe.onDidChangeMcpServerDefinitions)(...t)),get mcpServerDefinitions(){return K(e,`mcpServerDefinitions`),fe.mcpServerDefinitions},startMcpGateway(t){return K(e,`mcpServerDefinitions`),fe.startMcpGateway(t)},onDidChangeChatRequestTools(...t){return K(e,`chatParticipantAdditions`),u(ct.onDidChangeChatRequestTools)(...t)}},notebooks:{createNotebookController(t,n,r,i,a){return Me.createNotebookController(e,t,n,r,i,Mw(e)?a:void 0)},registerNotebookCellStatusBarItemProvider:(t,n)=>ke.registerNotebookCellStatusBarItemProvider(e,t,n),createRendererMessaging(t){return Ne.createRendererMessaging(e,t)},createNotebookControllerDetectionTask(t){return K(e,`notebookKernelSource`),Me.createNotebookControllerDetectionTask(e,t)},registerKernelSourceActionProvider(t,n){return K(e,`notebookKernelSource`),Me.registerKernelSourceActionProvider(e,t,n)}},scm:{get inputBox(){return te.report(`scm.inputBox`,e,`Use 'SourceControl.inputBox' instead`),Ge.getLastInputBox(e)},createSourceControl(t,n,r,i,a,o){return(i||a||o)&&K(e,`scmProviderOptions`),Ge.createSourceControl(e,t,n,r,i,a,o)}},speech:{registerSpeechProvider(t,n){return K(e,`speech`),ht.registerProvider(e.identifier,t,n)}},tasks:{registerTaskProvider:(t,n)=>Ce.registerTaskProvider(e,t,n),fetchTasks:e=>Ce.fetchTasks(e),executeTask:t=>Ce.executeTask(e,t),get taskExecutions(){return Ce.taskExecutions},onDidStartTask:(t,n,r)=>u(Ce.onDidStartTask)(r=>{Mw(e)||r?.execution?.terminal!==void 0&&(r.execution.terminal=void 0);let i={...r,execution:r.execution};return t.call(n,i)},n,r),onDidEndTask:(e,t,n)=>u(Ce.onDidEndTask)(e,t,n),onDidStartTaskProcess:(e,t,n)=>u(Ce.onDidStartTaskProcess)(e,t,n),onDidEndTaskProcess:(e,t,n)=>u(Ce.onDidEndTaskProcess)(e,t,n),onDidStartTaskProblemMatchers:(t,n,r)=>(K(e,`taskProblemMatcherStatus`),u(Ce.onDidStartTaskProblemMatchers)(t,n,r)),onDidEndTaskProblemMatchers:(t,n,r)=>(K(e,`taskProblemMatcherStatus`),u(Ce.onDidEndTaskProblemMatchers)(t,n,r))},tests:he,window:Tt,workspace:Et,Breakpoint:zD,TerminalOutputAnchor:qT,ChatResultFeedbackKind:Ok,ChatVariableLevel:Ck,ChatCompletionItem:wk,ChatReferenceDiagnostic:PA,CallHierarchyIncomingCall:fE,CallHierarchyItem:dE,CallHierarchyOutgoingCall:pE,CancellationError:ie,CancellationTokenSource:Hi,CandidatePortSource:ji,CodeAction:lE,CodeActionKind:uT,CodeActionTriggerKind:cE,CodeLens:hE,Color:GE,ColorInformation:KE,ColorPresentation:qE,ColorThemeKind:AO,CommentMode:uO,CommentState:dO,CommentThreadCollapsibleState:lO,CommentThreadState:fO,CommentThreadApplicability:pO,CommentThreadFocus:mO,CompletionItem:EE,CompletionItemKind:wE,CompletionItemTag:TE,CompletionList:DE,CompletionTriggerKind:CE,ConfigurationTarget:FD,CustomExecution:_D,DebugAdapterExecutable:UD,DebugAdapterInlineImplementation:KD,DebugAdapterNamedPipeServer:GD,DebugAdapterServer:WD,DebugConfigurationProviderTriggerKind:Hx,DebugConsoleMode:xO,DebugVisualization:SO,DecorationRangeBehavior:HE,Diagnostic:mT,DiagnosticRelatedInformation:pT,DiagnosticSeverity:fT,DiagnosticTag:dT,Disposable:YT,DocumentHighlight:aE,DocumentHighlightKind:iE,MultiDocumentHighlight:oE,DocumentLink:WE,DocumentSymbol:sE,EndOfLine:FT,EnvironmentVariableMutatorType:eE,EvaluatableExpression:YD,InlineValueText:QD,InlineValueVariableLookup:$D,InlineValueEvaluatableExpression:eO,InlineCompletionTriggerKind:XD,InlineCompletionsDisposeReasonKind:ZD,EventEmitter:x,ExtensionKind:DO,ExtensionMode:HO,ExternalUriOpenerPriority:ok,FileChangeType:aO,FileDecoration:OO,FileDecoration2:OO,FileSystemError:oO,FileType:_c,FilePermission:vc,FoldingRange:sO,FoldingRangeKind:cO,FunctionBreakpoint:VD,InlineCompletionItem:OE,InlineCompletionList:kE,Hover:tE,VerboseHover:nE,HoverVerbosityAction:rE,IndentAction:tU,Location:gT,MarkdownString:rT,OverviewRulerLane:cm,ParameterInformation:gE,PortAutoForwardAction:ck,Position:aT,ProcessExecution:fD,ProgressLocation:yD,QuickInputButtonLocation:CO,QuickInputButtons:wO,Range:sT,RelativePattern:ID,Selection:ET,SelectionRange:uE,SemanticTokens:vO,SemanticTokensBuilder:_O,SemanticTokensEdit:yO,SemanticTokensEdits:bO,SemanticTokensLegend:hO,ShellExecution:pD,ShellQuoting:mD,SignatureHelp:vE,SignatureHelpTriggerKind:yE,SignatureInformation:_E,SnippetString:kT,SourceBreakpoint:BD,StandardTokenType:WO,StatusBarAlignment:PE,SymbolInformation:NT,SymbolKind:jT,SymbolTag:MT,Task:vD,TaskEventKind:cD,TaskGroup:uD,TaskPanelKind:lD,TaskRevealKind:sD,TaskRunOn:gD,TaskScope:hD,TerminalLink:$E,TerminalQuickFixTerminalCommand:tD,TerminalQuickFixOpener:eD,TerminalLocation:nD,TerminalProfile:rD,TerminalExitReason:XE,TerminalShellExecutionCommandLineConfidence:ZE,TerminalCompletionItem:aD,TerminalCompletionItemKind:iD,TerminalCompletionList:oD,TerminalShellType:QE,TextDocumentSaveReason:LE,TextEdit:IT,SnippetTextEdit:LT,TextEditorCursorStyle:Ef,TextEditorChangeKind:BE,TextEditorLineNumbersStyle:IE,TextEditorRevealType:RE,TextEditorSelectionChangeKind:zE,SyntaxTokenType:UE,TextDocumentChangeReason:VE,ThemeColor:PD,ThemeIcon:ND,TreeItem:xD,TreeItemCheckboxState:CD,TreeItemCollapsibleState:SD,TypeHierarchyItem:lk,UIKind:br,Uri:C,ViewColumn:NE,WorkspaceEdit:zT,DocumentPasteTriggerKind:AD,DocumentDropEdit:kD,DocumentDropOrPasteEditKind:jD,DocumentPasteEdit:MD,InlayHint:SE,InlayHintLabelPart:xE,InlayHintKind:bE,RemoteAuthorityResolverError:$T,ResolvedAuthority:ZT,ManagedResolvedAuthority:QT,SourceControlInputBoxValidationType:YE,ExtensionRuntime:UO,TimelineItem:VO,NotebookRange:yT,NotebookCellKind:vT,NotebookCellExecutionState:MO,NotebookCellData:bT,NotebookData:xT,NotebookRendererScript:RO,NotebookCellStatusBarAlignment:NO,NotebookEditorRevealType:PO,NotebookCellOutput:wT,NotebookCellOutputItem:CT,CellErrorStackFrame:jO,NotebookCellStatusBarItem:FO,NotebookControllerAffinity:IO,NotebookControllerAffinity2:LO,NotebookEdit:ST,NotebookKernelSourceAction:zO,NotebookVariablesRequestKind:BO,PortAttributes:KO,LinkedEditingRanges:GO,TestResultState:qO,TestRunRequest:XO,TestMessage:ZO,TestMessageStackFrame:$O,TestTag:QO,TestRunProfileKind:JO,TextSearchCompleteMessageType:YN,DataTransfer:OD,DataTransferItem:wD,TestCoverageCount:ek,FileCoverage:nk,StatementCoverage:rk,BranchCoverage:ik,DeclarationCoverage:ak,WorkspaceTrustState:sk,LanguageStatusSeverity:mE,QuickPickItemKind:TO,InputBoxValidationSeverity:EO,TabInputText:uk,TabInputTextDiff:dk,TabInputTextMerge:fk,TabInputCustom:pk,TabInputNotebook:hk,TabInputNotebookDiff:gk,TabInputWebview:mk,TabInputTerminal:_k,TabInputInteractiveWindow:vk,TabInputChat:yk,TabInputTextMultiDiff:bk,TelemetryTrustedValue:bw,LogLevel:H,EditSessionIdentityMatch:nU,InteractiveSessionVoteDirection:xk,ChatCopyKind:Sk,ChatSessionChangedFile:OA,ChatEditingSessionActionOutcome:Tk,InteractiveEditorResponseFeedbackKind:Dk,DebugStackFrame:qD,DebugThread:JD,RelatedInformationType:tj,SpeechToTextStatus:rj,TextToSpeechStatus:ij,PartialAcceptTriggerKind:AE,InlineCompletionEndOfLifeReasonKind:jE,InlineCompletionDisplayLocationKind:ME,KeywordRecognitionStatus:aj,ChatImageMimeType:GA,ChatResponseMarkdownPart:kk,ChatResponseFileTreePart:Mk,ChatResponseAnchorPart:Lk,ChatResponseProgressPart:Rk,ChatResponseProgressPart2:zk,ChatResponseThinkingProgressPart:Bk,ChatResponseHookPart:Vk,ChatResponseReferencePart:Gk,ChatResponseReferencePart2:Gk,ChatResponseCodeCitationPart:qk,ChatResponseCodeblockUriPart:Kk,ChatResponseWarningPart:Hk,ChatResponseInfoPart:Uk,ChatResponseTextEditPart:eA,ChatResponseNotebookEditPart:tA,ChatResponseWorkspaceEditPart:nA,ChatResponseMarkdownWithVulnerabilitiesPart:Ak,ChatResponseCommandButtonPart:Wk,ChatResponseConfirmationPart:jk,ChatQuestion:Qk,ChatQuestionType:Zk,ChatResponseQuestionCarouselPart:$k,ChatResponseMovePart:Jk,ChatResponseExtensionsPart:Yk,ChatResponseExternalEditPart:Ik,ChatResponsePullRequestPart:Xk,ChatResponseMultiDiffPart:Nk,ChatResponseReferencePartStatusKind:kA,ChatResponseClearToPreviousToolInvocationReason:AA,ChatRequestTurn:oA,ChatRequestTurn2:oA,ChatResponseTurn:sA,ChatResponseTurn2:cA,ChatSubagentToolInvocationData:Fk,ChatToolInvocationPart:aA,ChatLocation:lA,ChatSessionStatus:uA,ChatSessionCustomizationType:dA,ChatDebugLogLevel:fA,ChatDebugToolCallResult:pA,ChatDebugHookResult:mA,ChatDebugToolCallEvent:hA,ChatDebugModelTurnEvent:gA,ChatDebugGenericEvent:_A,ChatDebugSubagentInvocationEvent:vA,ChatDebugUserMessageEvent:bA,ChatDebugAgentResponseEvent:xA,ChatDebugMessageSection:yA,ChatDebugEventTextContent:SA,ChatDebugMessageContentType:CA,ChatDebugEventMessageContent:wA,ChatDebugEventToolCallContent:TA,ChatDebugEventModelTurnContent:EA,ChatDebugEventHookContent:DA,ChatRequestEditorData:jA,ChatRequestNotebookData:MA,ChatReferenceBinaryData:NA,ChatRequestEditedFileEventKind:Ek,LanguageModelChatMessageRole:FA,LanguageModelChatMessage:zA,LanguageModelChatMessage2:BA,LanguageModelToolResultPart:IA,LanguageModelToolResultPart2:IA,LanguageModelTextPart:UA,LanguageModelTextPart2:UA,LanguageModelPartAudience:HA,ToolResultAudience:HA,LanguageModelToolCallPart:VA,LanguageModelThinkingPart:KA,LanguageModelError:JA,LanguageModelToolResult:YA,LanguageModelToolResult2:XA,LanguageModelDataPart:WA,LanguageModelDataPart2:WA,LanguageModelToolExtensionSource:$A,LanguageModelToolMCPSource:ej,ExtendedLanguageModelToolResult:ZA,LanguageModelChatToolMode:QA,LanguageModelPromptTsxPart:qA,NewSymbolName:iO,NewSymbolNameTag:nO,NewSymbolNameTriggerKind:rO,ExcludeSettingOptions:JN,TextSearchContext2:KN,TextSearchMatch2:GN,AISearchKeyword:qN,TextSearchCompleteMessageTypeNew:YN,ChatErrorLevel:LA,ChatInputNotificationSeverity:RA,McpHttpServerDefinition:cj,McpHttpServerDefinition2:cj,McpStdioServerDefinition:sj,McpStdioServerDefinition2:sj,McpToolAvailability:oj,McpToolInvocationContentData:Pk,SettingsSearchResultKind:nj,ChatTodoStatus:rA,ChatDebugSubagentStatus:iA}}}var IX;let LX=class{constructor(e,t,n,r,i,a,o){this._apiFactory=e,this._extensionRegistry=t,this._instaService=n,this._extHostConfiguration=r,this._extHostExtensionService=i,this._initData=a,this._logService=o,this._factories=new Map,this._alternatives=[]}async install(){this._installInterceptor(),Ar(`code/extHost/willWaitForConfig`);let e=await this._extHostConfiguration.getConfigProvider();Ar(`code/extHost/didWaitForConfig`);let t=await this._extHostExtensionService.getExtensionPathIndex();this.register(new zX(this._apiFactory,t,this._extensionRegistry,e,this._logService)),this.register(this._instaService.createInstance(RX)),this._initData.remote.isRemote&&this.register(this._instaService.createInstance(BX,t,this._initData.environment.appUriScheme))}register(e){if(`nodeModuleName`in e)if(Array.isArray(e.nodeModuleName))for(let 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))}};LX=k([A(2,As),A(3,yF),A(4,XR),A(5,Vs),A(6,Ns)],LX);let RX=class{static{IX=this}static{this.aliased=new Map([[`vscode-ripgrep`,`@vscode/ripgrep-universal`],[`@vscode/ripgrep`,`@vscode/ripgrep-universal`],[`vscode-windows-registry`,`@vscode/windows-registry`]])}constructor(e){if(e.environment.appRoot&&IX.aliased.size){let t=$i(this.forceForwardSlashes(e.environment.appRoot.fsPath)),n=`[a-z0-9_.-]`,r=`@${n}+\\/${n}+|${n}+`;this.re=RegExp(`^(${t}/node_modules|node_modules\\.asar(?:\\.unpacked)?\\/)(${r})(.*)$`,`i`)}}alternativeModuleName(e){if(!this.re)return;let t=this.re.exec(this.forceForwardSlashes(e));if(!t)return;let[,n,r,i]=t,a=IX.aliased.get(r);if(a!==void 0)return console.warn(`${r} as been renamed to ${a}, please update your imports`),n+a+i}forceForwardSlashes(e){return e.replace(/\\/g,`/`)}};RX=IX=k([A(0,Vs)],RX);var zX=class{constructor(e,t,n,r,i){this._apiFactory=e,this._extensionPaths=t,this._extensionRegistry=n,this._configProvider=r,this._logService=i,this.nodeModuleName=`vscode`,this._extApiImpl=new Ds}load(e,t){let n=this._extensionPaths.findSubstr(t);if(n){let e=this._extApiImpl.get(n.identifier);return e||(e=this._apiFactory(n,this._extensionRegistry,this._configProvider),this._extApiImpl.set(n.identifier,e)),e}if(!this._defaultApiImpl){let e=``;this._extensionPaths.forEach((t,n)=>e+=`\t${n} -> ${t.identifier.value}\n`),this._logService.warn(`Could not identify extension for 'vscode' require call from ${t}. These are the extension path mappings: \n${e}`),this._defaultApiImpl=this._apiFactory(kw,this._extensionRegistry,this._configProvider)}return this._defaultApiImpl}};let BX=class{constructor(e,t,n){this._extensionPaths=e,this._appUriScheme=t,this.nodeModuleName=[`open`,`opn`],this._mainThreadTelemetry=n.getProxy(T.MainThreadTelemetry);let r=n.getProxy(T.MainThreadWindow);this._impl=(e,t)=>{let n=C.parse(e);return t?this.callOriginal(e,t):n.scheme===`http`||n.scheme===`https`?r.$openUri(n,e,{allowTunneling:!0}):n.scheme===`mailto`||n.scheme===this._appUriScheme?r.$openUri(n,e,{}):this.callOriginal(e,t)}}load(e,t,n){let r=this._extensionPaths.findSubstr(t);return r&&(this._extensionId=r.identifier.value,this.sendShimmingTelemetry()),this._original=n(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})}};BX=k([A(2,Js)],BX);let VX=class{constructor(e,t){this._mainThreadConsole=e.getProxy(T.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){let n=this,r=console[e];Object.defineProperty(console,e,{set:()=>{},get:()=>(...i)=>{n._handleConsoleCall(e,t,r,i)}})}_handleConsoleCall(e,t,n,r){this._mainThreadConsole.$logExtensionHostMessage({type:`__$console`,severity:t,arguments:HX(r,this._includeStack)}),this._logNative&&this._nativeConsoleLogMessage(e,n,r)}};VX=k([A(0,Js),A(1,Vs)],VX);function HX(e,t){let n=[];if(e.length)for(let t=0;t<e.length;t++){let r=e[t];if(r===void 0)r=`undefined`;else if(r instanceof Error){let e=r;r=e.stack?e.stack:e.toString()}n.push(r)}if(t){let e=Error().stack;e&&n.push({__$stack:e.split(`
|
|
206
|
+
`).slice(3).join(`
|
|
207
|
+
`)})}try{let e=mc(n);return e.length>1e5?`Output omitted for a large object that exceeds the limits`:e}catch(e){return`Output omitted for an object that cannot be inspected ('${e.toString()}')`}}let UX=class extends VX{constructor(e,t){super(e,t)}_nativeConsoleLogMessage(e,t,n){t.apply(console,n)}};UX=k([A(0,Js),A(1,Vs)],UX);var WX=class extends LX{_installInterceptor(){}getModule(e,t){for(let t of this._alternatives){let n=t(e);if(n){e=n;break}}if(this._factories.has(e))return this._factories.get(e).load(e,t,()=>{throw Error(`CANNOT LOAD MODULE from here.`)})}},GX=class extends KR{constructor(){super(...arguments),this.extensionRuntime=UO.Webworker}async _beforeAlmostReadyToRunExtensions(){An&&this._instaService.createInstance(UX),this._apiFactory=this._instaService.invokeFunction(FX),this._fakeModules=this._instaService.createInstance(WX,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,n){t=t.with({path:KX(t.path,`.js`)});let r=e?.identifier.value;r&&performance.mark(`code/extHost/willFetchExtensionCode/${r}`);let i=C.revive(await this._mainThreadExtensionsProxy.$asBrowserUri(t)),a=await fetch(i.toString(!0));if(r&&performance.mark(`code/extHost/didFetchExtensionCode/${r}`),a.status!==200)throw Error(a.statusText);let o=`${await a.text()}\n//# sourceURL=${`${t.toString(!0)}#vscode-extension`}`,s;try{s=Function(`module`,`exports`,`require`,o)}catch(e){throw console.error(r?`Loading code for extension ${r} failed: ${e.message}`:`Loading code failed: ${e.message}`),console.error(`${t.toString(!0)}${typeof e.line==`number`?` line ${e.line}`:``}${typeof e.column==`number`?` column ${e.column}`:``}`),console.error(e),e}e&&await this._extHostLocalizationService.initializeLocalizedMessages(e);let c={},l={exports:c},u=e=>{let n=this._fakeModules.getModule(e,t);if(n===void 0)throw Error(`Cannot load module '${e}'`);return n};try{return n.codeLoadingStart(),r&&performance.mark(`code/extHost/willLoadExtensionCode/${r}`),s(l,c,u),l.exports===c?c:l.exports}finally{r&&performance.mark(`code/extHost/didLoadExtensionCode/${r}`),n.codeLoadingStop()}}_loadESMModule(e,t,n){throw 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;let t=Date.now()+e;for(;Date.now()<t&&!(`__jsDebugIsReady`in globalThis);)await Mo(10)}};function KX(e,t){return $r(e)?e:e+t}Rs(XL,ZL,Ls.Eager),Rs(XR,GX,Ls.Eager),Rs(VF,HF,Ls.Eager),Rs(VI,new Fs(RI,[!0],!0));const qX=self.close.bind(self);self.close=()=>console.trace(`'close' has been blocked`);const JX=postMessage.bind(self);self.postMessage=()=>console.trace(`'postMessage' has been blocked`);function YX(e){return/^(file|extension-file|vscode-remote):/i.test(e)}const XX=fetch.bind(self);function ZX(e){self.fetch=async function(t,n){return t instanceof Request||YX(String(t))&&(t=(await e(C.parse(String(t)))).toString(!0)),XX(t,n)},self.XMLHttpRequest=class extends XMLHttpRequest{open(t,n,r,i,a){(async()=>{YX(n.toString())&&(n=(await e(C.parse(n.toString()))).toString(!0)),super.open(t,n,r??!0,i,a)})()}}}self.importScripts=()=>{throw 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 QX(e,t){if(self.Worker){let n=self.Worker;Worker=function(r,i){if(/^vscode-remote:/i.test(r.toString()))throw Error(`Creating workers from remote extensions is currently not supported.`);async function a(n){let[r,i]=await Promise.all([e(n).then(e=>e.toString(!0)),t().then(e=>Object.fromEntries(e.map(([e,t])=>[e.toString(!0),t.toString(!0)])))]),a=`(${(function(e,t){function n(e){return typeof e==`string`||e instanceof URL?(e=String(e).replace(/^file:\/\//i,`vscode-file://vscode-app`),t[e]??e):e}let r=fetch.bind(self);self.fetch=function(e,t){return e instanceof Request?r(e,t):r(n(e),t)},self.XMLHttpRequest=class extends XMLHttpRequest{constructor(){super(...arguments),this.notFound=!1}open(e,t,r,i,a){let o=n(t);return this.notFound=o.startsWith(`extension-file:`),super.open(e,o,r??!0,i,a)}send(e){this.notFound||super.send(e)}get status(){return this.notFound?404:super.status}};let i=importScripts.bind(self);self.importScripts=(...e)=>{i(...e.map(n))},self.importExt=e=>Function(`url`,`return import(url)`)(n(e)),i(e)}).toString()}('${r}', ${JSON.stringify(i)}))`,o=new Blob([a],{type:`application/javascript`});return URL.createObjectURL(o)}i||={},i.name=`${name} -> ${i.name||Qr(r.toString())}`;class o{constructor(e,t){this._onmessage=null,this._onmessageerror=null,this._onerror=null,this.workerPromise=a(C.parse(e instanceof URL?e.toString():e)).then(e=>new n(e,t))}set onmessage(e){this._onmessage=e,this.workerPromise.then(t=>{t.onmessage=e},console.error)}get onmessage(){return this._onmessage}set onmessageerror(e){this._onmessageerror=e,this.workerPromise.then(t=>{t.onmessageerror=e},console.error)}get onmessageerror(){return this._onmessageerror}set onerror(e){this._onerror=e,this.workerPromise.then(t=>{t.onerror=e},console.error)}get onerror(){return this._onerror}postMessage(e,t){this.workerPromise.then(n=>{n.postMessage(e,t)},console.error)}terminate(){this.workerPromise.then(e=>{e.terminate()},console.error)}addEventListener(e,t,n){this.workerPromise.then(r=>{r.addEventListener(e,t,n)},console.error)}removeEventListener(e,t,n){this.workerPromise.then(r=>{r.removeEventListener(e,t,n)},console.error)}dispatchEvent(e){return this.workerPromise.then(t=>{t.dispatchEvent(e)},console.error),!1}}return new o(r,i)}}else self.Worker=class extends uz{constructor(e,t){super(JX,e,{name:Qr(e.toString()),...t})}}}const $X=new class{constructor(){this.pid=void 0}exit(e){qX()}};var eZ=class{constructor(){let e=new MessageChannel,t=new x,n=!1;JX(e.port2,[e.port2]),e.port1.onmessage=e=>{let{data:r}=e;if(!(r instanceof ArrayBuffer)){console.warn(`UNKNOWN data received`,r);return}let i=y.wrap(new Uint8Array(r,0,r.byteLength));if(wr(i,Sr.Terminate)){n=!0,nZ(`received terminate message from renderer`);return}t.fire(i)},this.protocol={onMessage:t.event,send:t=>{if(!n){let n=t.buffer.buffer.slice(t.buffer.byteOffset,t.buffer.byteOffset+t.buffer.byteLength);e.port1.postMessage(n,[n])}}}}};function tZ(e){return new Promise(t=>{let n=e.onMessage(r=>{n.dispose();let i=JSON.parse(r.toString());e.send(Cr(Sr.Initialized)),t({protocol:e,initData:i})});e.send(Cr(Sr.Ready))})}let nZ=e=>qX();function rZ(e){return!!e&&typeof e==`object`&&e.type===`vscode.init`&&e.data instanceof Map}function iZ(){Ar(`code/extHost/willConnectToRenderer`);let e=new eZ;return{onmessage(t){rZ(t)&&tZ(e.protocol).then(e=>{Ar(`code/extHost/didWaitForInitData`);let n=new cz(e.protocol,e.initData,$X,null,t.data);ZX(e=>n.asBrowserUri(e)),QX(e=>n.asBrowserUri(e),()=>n.getAllStaticBrowserUris()),nZ=e=>n.terminate(e)})}}}const aZ=iZ();self.onmessage=e=>aZ.onmessage(e.data);export{o as t};
|