code-server
Version:
Run VS Code on a remote server.
29 lines (21 loc) • 11.3 MB
JavaScript
"use strict";/*!--------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/var LDe=function(i,e){return LDe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,s){t.__proto__=s}||function(t,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])},LDe(i,e)};export function __extends(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");LDe(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}export var __assign=function(){return __assign=Object.assign||function(e){for(var t,s=1,n=arguments.length;s<n;s++){t=arguments[s];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},__assign.apply(this,arguments)};export function __rest(i,e){var t={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(i);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(i,s[n])&&(t[s[n]]=i[s[n]]);return t}export function __decorate(i,e,t,s){var n=arguments.length,r=n<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,t):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(i,e,t,s);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r}export function __param(i,e){return function(t,s){e(t,s,i)}}export function __esDecorate(i,e,t,s,n,r){function o(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var a=s.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&i?s.static?i:i.prototype:null,h=e||(c?Object.getOwnPropertyDescriptor(c,s.name):{}),u,f=!1,g=t.length-1;g>=0;g--){var p={};for(var m in s)p[m]=m==="access"?{}:s[m];for(var m in s.access)p.access[m]=s.access[m];p.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");r.push(o(v||null))};var b=(0,t[g])(a==="accessor"?{get:h.get,set:h.set}:h[l],p);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(u=o(b.get))&&(h.get=u),(u=o(b.set))&&(h.set=u),(u=o(b.init))&&n.unshift(u)}else(u=o(b))&&(a==="field"?n.unshift(u):h[l]=u)}c&&Object.defineProperty(c,s.name,h),f=!0}export function __runInitializers(i,e,t){for(var s=arguments.length>2,n=0;n<e.length;n++)t=s?e[n].call(i,t):e[n].call(i);return s?t:void 0}export function __propKey(i){return typeof i=="symbol"?i:"".concat(i)}export function __setFunctionName(i,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(i,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}export function __metadata(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}export function __awaiter(i,e,t,s){function n(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(h){try{c(s.next(h))}catch(u){o(u)}}function l(h){try{c(s.throw(h))}catch(u){o(u)}}function c(h){h.done?r(h.value):n(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})}export function __generator(i,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,n,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(c){return function(h){return l([c,h])}}function l(c){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(t=0)),t;)try{if(s=1,n&&(r=c[0]&2?n.return:c[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,c[1])).done)return r;switch(n=0,r&&(c=[c[0]&2,r.value]),c[0]){case 0:case 1:r=c;break;case 4:return t.label++,{value:c[1],done:!1};case 5:t.label++,n=c[1],c=[0];continue;case 7:c=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){t.label=c[1];break}if(c[0]===6&&t.label<r[1]){t.label=r[1],r=c;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(c);break}r[2]&&t.ops.pop(),t.trys.pop();continue}c=e.call(i,t)}catch(h){c=[6,h],n=0}finally{s=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}export var __createBinding=Object.create?function(i,e,t,s){s===void 0&&(s=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,s,n)}:function(i,e,t,s){s===void 0&&(s=t),i[s]=e[t]};export function __exportStar(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(e,i,t)}export function __values(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],s=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&s>=i.length&&(i=void 0),{value:i&&i[s++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}export function __read(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var s=t.call(i),n,r=[],o;try{for(;(e===void 0||e-- >0)&&!(n=s.next()).done;)r.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(t=s.return)&&t.call(s)}finally{if(o)throw o.error}}return r}export function __spread(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(__read(arguments[e]));return i}export function __spreadArrays(){for(var i=0,e=0,t=arguments.length;e<t;e++)i+=arguments[e].length;for(var s=Array(i),n=0,e=0;e<t;e++)for(var r=arguments[e],o=0,a=r.length;o<a;o++,n++)s[n]=r[o];return s}export function __spreadArray(i,e,t){if(t||arguments.length===2)for(var s=0,n=e.length,r;s<n;s++)(r||!(s in e))&&(r||(r=Array.prototype.slice.call(e,0,s)),r[s]=e[s]);return i.concat(r||Array.prototype.slice.call(e))}export function __await(i){return this instanceof __await?(this.v=i,this):new __await(i)}export function __asyncGenerator(i,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=t.apply(i,e||[]),n,r=[];return n={},a("next"),a("throw"),a("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(g){return function(p){return Promise.resolve(p).then(g,u)}}function a(g,p){s[g]&&(n[g]=function(m){return new Promise(function(b,v){r.push([g,m,b,v])>1||l(g,m)})},p&&(n[g]=p(n[g])))}function l(g,p){try{c(s[g](p))}catch(m){f(r[0][3],m)}}function c(g){g.value instanceof __await?Promise.resolve(g.value.v).then(h,u):f(r[0][2],g)}function h(g){l("next",g)}function u(g){l("throw",g)}function f(g,p){g(p),r.shift(),r.length&&l(r[0][0],r[0][1])}}export function __asyncDelegator(i){var e,t;return e={},s("next"),s("throw",function(n){throw n}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(n,r){e[n]=i[n]?function(o){return(t=!t)?{value:__await(i[n](o)),done:!1}:r?r(o):o}:r}}export function __asyncValues(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof __values=="function"?__values(i):i[Symbol.iterator](),t={},s("next"),s("throw"),s("return"),t[Symbol.asyncIterator]=function(){return this},t);function s(r){t[r]=i[r]&&function(o){return new Promise(function(a,l){o=i[r](o),n(a,l,o.done,o.value)})}}function n(r,o,a,l){Promise.resolve(l).then(function(c){r({value:c,done:a})},o)}}export function __makeTemplateObject(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}var pEi=Object.create?function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}:function(i,e){i.default=e};export function __importStar(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t in i)t!=="default"&&Object.prototype.hasOwnProperty.call(i,t)&&__createBinding(e,i,t);return pEi(e,i),e}export function __importDefault(i){return i&&i.__esModule?i:{default:i}}export function __classPrivateFieldGet(i,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(i):s?s.value:e.get(i)}export function __classPrivateFieldSet(i,e,t,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(i,t):n?n.value=t:e.set(i,t),t}export function __classPrivateFieldIn(i,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof i=="function"?e===i:i.has(e)}export function __addDisposableResource(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var s,n;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=e[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=e[Symbol.dispose],t&&(n=s)}if(typeof s!="function")throw new TypeError("Object not disposable.");n&&(s=function(){try{n.call(this)}catch(r){return Promise.reject(r)}}),i.stack.push({value:e,dispose:s,async:t})}else t&&i.stack.push({async:!0});return e}var mEi=typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var s=new Error(t);return s.name="SuppressedError",s.error=i,s.suppressed=e,s};export function __disposeResources(i){function e(s){i.error=i.hasError?new mEi(s,i.error,"An error was suppressed during disposal."):s,i.hasError=!0}function t(){for(;i.stack.length;){var s=i.stack.pop();try{var n=s.dispose&&s.dispose.call(s.value);if(s.async)return Promise.resolve(n).then(t,function(r){return e(r),t()})}catch(r){e(r)}}if(i.hasError)throw i.error}return t()}export default{__extends,__assign,__rest,__decorate,__param,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__addDisposableResource,__disposeResources};function cwt(i,e){const t=i;typeof t.vscodeWindowId!="number"&&Object.defineProperty(t,"vscodeWindowId",{get:()=>e})}var Fe=window;function Kie(i){return i===Fe?!1:typeof i?.vscodeWindowId=="number"}var hwt;function NM(i,e){const t=Object.create(null);for(const s of i){const n=e(s);let r=t[n];r||(r=t[n]=[]),r.push(s)}return t}function A5(i,e){const t=[],s=[];for(const n of i)e.has(n)||t.push(n);for(const n of e)i.has(n)||s.push(n);return{removed:t,added:s}}function TDe(i,e){const t=[],s=[];for(const[n,r]of i)e.has(n)||t.push(r);for(const[n,r]of e)i.has(n)||s.push(r);return{removed:t,added:s}}function bEi(i,e){const t=new Set;for(const s of e)i.has(s)&&t.add(s);return t}var vEi=class{static{hwt=Symbol.toStringTag}constructor(i,e){this.b=e,this.a=new Map,this[hwt]="SetWithKey";for(const t of i)this.add(t)}get size(){return this.a.size}add(i){const e=this.b(i);return this.a.set(e,i),this}delete(i){return this.a.delete(this.b(i))}has(i){return this.a.has(this.b(i))}*entries(){for(const i of this.a.values())yield[i,i]}keys(){return this.values()}*values(){for(const i of this.a.values())yield i}clear(){this.a.clear()}forEach(i,e){this.a.forEach(t=>i.call(e,t,t,this))}[Symbol.iterator](){return this.values()}},wEi=class{constructor(){this.b=[],this.a=function(i){setTimeout(()=>{throw i.stack?Do.isErrorNoTelemetry(i)?new Do(i.message+`
`+i.stack):new Error(i.message+`
`+i.stack):i},0)}}addListener(i){return this.b.push(i),()=>{this.d(i)}}c(i){this.b.forEach(e=>{e(i)})}d(i){this.b.splice(this.b.indexOf(i),1)}setUnexpectedErrorHandler(i){this.a=i}getUnexpectedErrorHandler(){return this.a}onUnexpectedError(i){this.a(i),this.c(i)}onUnexpectedExternalError(i){this.a(i)}},H3=new wEi;function yEi(i){H3.setUnexpectedErrorHandler(i)}function Jie(i){H3.onUnexpectedError(i)}function wt(i){ms(i)||H3.onUnexpectedError(i)}function Io(i){ms(i)||H3.onUnexpectedExternalError(i)}function P5(i){if(i instanceof Error){const{name:e,message:t,cause:s}=i,n=i.stacktrace||i.stack;return{$isError:!0,name:e,message:t,stack:n,noTelemetry:Do.isErrorNoTelemetry(i),cause:s?P5(s):void 0,code:i.code}}return i}function j3(i){let e;return i.noTelemetry?e=new Do:(e=new Error,e.name=i.name),e.message=i.message,e.stack=i.stack,i.code&&(e.code=i.code),i.cause&&(e.cause=j3(i.cause)),e}var Xie="Canceled";function ms(i){return i instanceof Gs?!0:i instanceof Error&&i.name===Xie&&i.message===Xie}var Gs=class extends Error{constructor(){super(Xie),this.name=this.message}};function I0(){const i=new Error(Xie);return i.name=i.message,i}function Fn(i){return i?new Error(`Illegal argument: ${i}`):new Error("Illegal argument")}function _3(i){return i?new Error(`Illegal state: ${i}`):new Error("Illegal state")}function Ps(i){return i?i.message?i.message:i.stack?i.stack.split(`
`)[0]:String(i):"Error"}var JI=class extends Error{constructor(i){super("NotSupported"),i&&(this.message=i)}},Do=class Ypt extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Ypt)return e;const t=new Ypt;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Ci=class Yvi extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,Yvi.prototype)}};function ng(i,e){const t=this;let s=!1,n;return function(){if(s)return n;if(s=!0,e)try{n=i.apply(t,arguments)}finally{e()}else n=i.apply(t,arguments);return n}}function D0(i,e,t=i.length-1){const s=MDe(i,e,t);if(s!==-1)return i[s]}function MDe(i,e,t=i.length-1){for(let s=t;s>=0;s--){const n=i[s];if(e(n))return s}return-1}function $5(i,e){const t=B5(i,e);return t===-1?void 0:i[t]}function B5(i,e,t=0,s=i.length){let n=t,r=s;for(;n<r;){const o=Math.floor((n+r)/2);e(i[o])?n=o+1:r=o}return n-1}function CEi(i,e){const t=L0(i,e);return t===i.length?void 0:i[t]}function L0(i,e,t=0,s=i.length){let n=t,r=s;for(;n<r;){const o=Math.floor((n+r)/2);e(i[o])?r=o:n=o+1}return n}var dwt=class Qvi{static{this.assertInvariants=!1}constructor(e){this.e=e,this.c=0}findLastMonotonous(e){if(Qvi.assertInvariants){if(this.d){for(const s of this.e)if(this.d(s)&&!e(s))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this.d=e}const t=B5(this.e,e,this.c);return this.c=t+1,t===-1?void 0:this.e[t]}};function RDe(i,e){if(i.length===0)return;let t=i[0];for(let s=1;s<i.length;s++){const n=i[s];e(n,t)>0&&(t=n)}return t}function uwt(i,e){if(i.length===0)return;let t=i[0];for(let s=1;s<i.length;s++){const n=i[s];e(n,t)>=0&&(t=n)}return t}function fwt(i,e){return RDe(i,(t,s)=>-e(t,s))}function SEi(i,e){if(i.length===0)return-1;let t=0;for(let s=1;s<i.length;s++){const n=i[s];e(n,i[t])>0&&(t=s)}return t}function O5(i,e){for(const t of i){const s=e(t);if(s!==void 0)return s}}function jh(i){if(i.length===0)throw new Error("Invalid tail call");return[i.slice(0,i.length-1),i[i.length-1]]}function Fi(i,e,t=(s,n)=>s===n){if(i===e)return!0;if(!i||!e||i.length!==e.length)return!1;for(let s=0,n=i.length;s<n;s++)if(!t(i[s],e[s]))return!1;return!0}function kEi(i,e){const t=i.length-1;e<t&&(i[e]=i[t]),i.pop()}function XI(i,e,t){return F5(i.length,s=>t(i[s],e))}function F5(i,e){let t=0,s=i-1;for(;t<=s;){const n=(t+s)/2|0,r=e(n);if(r<0)t=n+1;else if(r>0)s=n-1;else return n}return-(t+1)}function Yie(i,e,t){if(i=i|0,i>=e.length)throw new TypeError("invalid index");const s=e[Math.floor(e.length*Math.random())],n=[],r=[],o=[];for(const a of e){const l=t(a,s);l<0?n.push(a):l>0?r.push(a):o.push(a)}return i<n.length?Yie(i,n,t):i<n.length+o.length?o[0]:Yie(i-(n.length+o.length),r,t)}function vb(i,e){const t=[];let s;for(const n of i.slice(0).sort(e))!s||e(s[0],n)!==0?(s=[n],t.push(s)):s.push(n);return t}function*Qie(i,e){let t,s;for(const n of i)s!==void 0&&e(s,n)?t.push(n):(t&&(yield t),t=[n]),s=n;t&&(yield t)}function gwt(i,e){for(let t=0;t<=i.length;t++)e(t===0?void 0:i[t-1],t===i.length?void 0:i[t])}function xEi(i,e){for(let t=0;t<i.length;t++)e(t===0?void 0:i[t-1],i[t],t+1===i.length?void 0:i[t+1])}function NDe(i,e,t){const s=[];function n(a,l,c){if(l===0&&c.length===0)return;const h=s[s.length-1];h&&h.start+h.deleteCount===a?(h.deleteCount+=l,h.toInsert.push(...c)):s.push({start:a,deleteCount:l,toInsert:c})}let r=0,o=0;for(;;){if(r===i.length){n(r,0,e.slice(o));break}if(o===e.length){n(r,i.length-r,[]);break}const a=i[r],l=e[o],c=t(a,l);c===0?(r+=1,o+=1):c<0?(n(r,1,[]),r+=1):c>0&&(n(r,0,[l]),o+=1)}return s}function tx(i,e,t){const s=NDe(i,e,t),n=[],r=[];for(const o of s)n.push(...i.slice(o.start,o.start+o.deleteCount)),r.push(...o.toInsert);return{removed:n,added:r}}function EEi(i,e,t){if(t===0)return[];const s=i.slice(0,t).sort(e);return IEi(i,e,s,t,i.length),s}function IEi(i,e,t,s,n){for(const r=t.length;s<n;s++){const o=i[s];if(e(o,t[r-1])<0){t.pop();const a=L0(t,l=>e(o,l)<0);t.splice(a,0,o)}}}function ci(i){return i.filter(e=>!!e)}function a$(i){let e=0;for(let t=0;t<i.length;t++)i[t]&&(i[e]=i[t],e+=1);i.length=e}function DEi(i,e,t){i.splice(t,0,i.splice(e,1)[0])}function Zie(i){return!Array.isArray(i)||i.length===0}function qn(i){return Array.isArray(i)&&i.length>0}function bs(i,e=t=>t){const t=new Set;return i.filter(s=>{const n=e(s);return t.has(n)?!1:(t.add(n),!0)})}function LEi(i){const e=new Set;return t=>{const s=i(t);return e.has(s)?!1:(e.add(s),!0)}}function TEi(i,e,t=(s,n)=>s===n){let s=0;for(let n=0,r=Math.min(i.length,e.length);n<r&&t(i[n],e[n]);n++)s++;return s}function gf(i,e){let t=typeof e=="number"?i:0;typeof e=="number"?t=i:(t=0,e=i);const s=[];if(t<=e)for(let n=t;n<e;n++)s.push(n);else for(let n=t;n>e;n--)s.push(n);return s}function U3(i,e,t){return i.reduce((s,n)=>(s[e(n)]=t?t(n):n,s),Object.create(null))}function ix(i,e){return i.push(e),()=>pwt(i,e)}function pwt(i,e){const t=i.indexOf(e);if(t>-1)return i.splice(t,1),e}function z3(i,e,t){const s=i.slice(0,e),n=i.slice(e);return s.concat(t,n)}function q3(i,e){let t;if(typeof e=="number"){let s=e;t=()=>{const n=Math.sin(s++)*179426549;return n-Math.floor(n)}}else t=Math.random;for(let s=i.length-1;s>0;s-=1){const n=Math.floor(t()*(s+1)),r=i[s];i[s]=i[n],i[n]=r}}function ADe(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.unshift(e))}function ese(i,e){const t=i.indexOf(e);t>-1&&(i.splice(t,1),i.push(e))}function PDe(i,e){for(const t of e)i.push(t)}function MEi(i,e){return Array.isArray(i)?i.map(e):e(i)}function pf(i){return Array.isArray(i)?i:[i]}function tse(i,e,t){const s=mwt(i,e),n=i.length,r=t.length;i.length=n+r;for(let o=n-1;o>=s;o--)i[o+r]=i[o];for(let o=0;o<r;o++)i[o+s]=t[o]}function ise(i,e,t,s){const n=mwt(i,e);let r=i.splice(n,t);return r===void 0&&(r=[]),tse(i,n,s),r}function mwt(i,e){return e<0?Math.max(e+i.length,0):Math.min(e,i.length)}var V5=i=>e=>e[i],wb;(function(i){function e(r){return r<0}i.isLessThan=e;function t(r){return r<=0}i.isLessThanOrEqual=t;function s(r){return r>0}i.isGreaterThan=s;function n(r){return r===0}i.isNeitherLessOrGreaterThan=n,i.greaterThan=1,i.lessThan=-1,i.neitherLessOrGreaterThan=0})(wb||(wb={}));function Dl(i,e){return(t,s)=>e(i(t),i(s))}function bwt(...i){return(e,t)=>{for(const s of i){const n=s(e,t);if(!wb.isNeitherLessOrGreaterThan(n))return n}return wb.neitherLessOrGreaterThan}}var zd=(i,e)=>i-e,REi=(i,e)=>zd(i?1:0,e?1:0);function vwt(i){return(e,t)=>-i(e,t)}function NEi(i){return(e,t)=>e===void 0?t===void 0?wb.neitherLessOrGreaterThan:wb.lessThan:t===void 0?wb.greaterThan:i(e,t)}var O1=class{constructor(i){this.g=i,this.c=0,this.d=this.g.length-1}get length(){return this.d-this.c+1}takeWhile(i){let e=this.c;for(;e<this.g.length&&i(this.g[e]);)e++;const t=e===this.c?null:this.g.slice(this.c,e);return this.c=e,t}takeFromEndWhile(i){let e=this.d;for(;e>=0&&i(this.g[e]);)e--;const t=e===this.d?null:this.g.slice(e+1,this.d+1);return this.d=e,t}peek(){if(this.length!==0)return this.g[this.c]}peekLast(){if(this.length!==0)return this.g[this.d]}dequeue(){const i=this.g[this.c];return this.c++,i}removeLast(){const i=this.g[this.d];return this.d--,i}takeCount(i){const e=this.g.slice(this.c,this.c+i);return this.c+=i,e}},G3=class sIe{static{this.empty=new sIe(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){const e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(e){return new sIe(t=>this.iterate(s=>e(s)?t(s):!0))}map(e){return new sIe(t=>this.iterate(s=>t(e(s))))}some(e){let t=!1;return this.iterate(s=>(t=e(s),!t)),t}findFirst(e){let t;return this.iterate(s=>e(s)?(t=s,!1):!0),t}findLast(e){let t;return this.iterate(s=>(e(s)&&(t=s),!0)),t}findLastMaxBy(e){let t,s=!0;return this.iterate(n=>((s||wb.isGreaterThan(e(n,t)))&&(s=!1,t=n),!0)),t}},AEi=class Qpt{constructor(e){this.c=e}static createSortPermutation(e,t){const s=Array.from(e.keys()).sort((n,r)=>t(e[n],e[r]));return new Qpt(s)}apply(e){return e.map((t,s)=>e[this.c[s]])}inverse(){const e=this.c.slice();for(let t=0;t<this.c.length;t++)e[this.c[t]]=t;return new Qpt(e)}};async function PEi(i,e){return(await Promise.all(i.map(async(s,n)=>({element:s,ok:await e(s,n)})))).find(s=>s.ok)?.element}var wwt,ywt,Cwt;function l$(i,e,t){let s=i.get(e);return s===void 0&&(s=t,i.set(e,s)),s}var $Ei=class{constructor(i,e){this.uri=i,this.value=e}};function BEi(i){return Array.isArray(i)}var Rt=class die{static{this.c=e=>e.toString()}constructor(e,t){if(this[wwt]="ResourceMap",e instanceof die)this.d=new Map(e.d),this.e=t??die.c;else if(BEi(e)){this.d=new Map,this.e=t??die.c;for(const[s,n]of e)this.set(s,n)}else this.d=new Map,this.e=e??die.c}set(e,t){return this.d.set(this.e(e),new $Ei(e,t)),this}get(e){return this.d.get(this.e(e))?.value}has(e){return this.d.has(this.e(e))}get size(){return this.d.size}clear(){this.d.clear()}delete(e){return this.d.delete(this.e(e))}forEach(e,t){typeof t<"u"&&(e=e.bind(t));for(const[s,n]of this.d)e(n.value,n.uri,this)}*values(){for(const e of this.d.values())yield e.value}*keys(){for(const e of this.d.values())yield e.uri}*entries(){for(const e of this.d.values())yield[e.uri,e.value]}*[(wwt=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.d)yield[e.uri,e.value]}},oa=class{constructor(i,e){this[ywt]="ResourceSet",!i||typeof i=="function"?this.c=new Rt(i):(this.c=new Rt(e),i.forEach(this.add,this))}get size(){return this.c.size}add(i){return this.c.set(i,i),this}clear(){this.c.clear()}delete(i){return this.c.delete(i)}forEach(i,e){this.c.forEach((t,s)=>i.call(e,s,s,this))}has(i){return this.c.has(i)}entries(){return this.c.entries()}keys(){return this.c.keys()}values(){return this.c.keys()}[(ywt=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},Swt;(function(i){i[i.None=0]="None",i[i.AsOld=1]="AsOld",i[i.AsNew=2]="AsNew"})(Swt||(Swt={}));var K3=class{constructor(){this[Cwt]="LinkedMap",this.c=new Map,this.d=void 0,this.e=void 0,this.f=0,this.g=0}clear(){this.c.clear(),this.d=void 0,this.e=void 0,this.f=0,this.g++}isEmpty(){return!this.d&&!this.e}get size(){return this.f}get first(){return this.d?.value}get last(){return this.e?.value}has(i){return this.c.has(i)}get(i,e=0){const t=this.c.get(i);if(t)return e!==0&&this.n(t,e),t.value}set(i,e,t=0){let s=this.c.get(i);if(s)s.value=e,t!==0&&this.n(s,t);else{switch(s={key:i,value:e,next:void 0,previous:void 0},t){case 0:this.l(s);break;case 1:this.k(s);break;case 2:this.l(s);break;default:this.l(s);break}this.c.set(i,s),this.f++}return this}delete(i){return!!this.remove(i)}remove(i){const e=this.c.get(i);if(e)return this.c.delete(i),this.m(e),this.f--,e.value}shift(){if(!this.d&&!this.e)return;if(!this.d||!this.e)throw new Error("Invalid list");const i=this.d;return this.c.delete(i.key),this.m(i),this.f--,i.value}forEach(i,e){const t=this.g;let s=this.d;for(;s;){if(e?i.bind(e)(s.value,s.key,this):i(s.value,s.key,this),this.g!==t)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const i=this,e=this.g;let t=this.d;const s={[Symbol.iterator](){return s},next(){if(i.g!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:t.key,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return s}values(){const i=this,e=this.g;let t=this.d;const s={[Symbol.iterator](){return s},next(){if(i.g!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:t.value,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return s}entries(){const i=this,e=this.g;let t=this.d;const s={[Symbol.iterator](){return s},next(){if(i.g!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const n={value:[t.key,t.value],done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return s}[(Cwt=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}h(i){if(i>=this.size)return;if(i===0){this.clear();return}let e=this.d,t=this.size;for(;e&&t>i;)this.c.delete(e.key),e=e.next,t--;this.d=e,this.f=t,e&&(e.previous=void 0),this.g++}j(i){if(i>=this.size)return;if(i===0){this.clear();return}let e=this.e,t=this.size;for(;e&&t>i;)this.c.delete(e.key),e=e.previous,t--;this.e=e,this.f=t,e&&(e.next=void 0),this.g++}k(i){if(!this.d&&!this.e)this.e=i;else if(this.d)i.next=this.d,this.d.previous=i;else throw new Error("Invalid list");this.d=i,this.g++}l(i){if(!this.d&&!this.e)this.d=i;else if(this.e)i.previous=this.e,this.e.next=i;else throw new Error("Invalid list");this.e=i,this.g++}m(i){if(i===this.d&&i===this.e)this.d=void 0,this.e=void 0;else if(i===this.d){if(!i.next)throw new Error("Invalid list");i.next.previous=void 0,this.d=i.next}else if(i===this.e){if(!i.previous)throw new Error("Invalid list");i.previous.next=void 0,this.e=i.previous}else{const e=i.next,t=i.previous;if(!e||!t)throw new Error("Invalid list");e.previous=t,t.next=e}i.next=void 0,i.previous=void 0,this.g++}n(i,e){if(!this.d||!this.e)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(i===this.d)return;const t=i.next,s=i.previous;i===this.e?(s.next=void 0,this.e=s):(t.previous=s,s.next=t),i.previous=void 0,i.next=this.d,this.d.previous=i,this.d=i,this.g++}else if(e===2){if(i===this.e)return;const t=i.next,s=i.previous;i===this.d?(t.previous=void 0,this.d=t):(t.previous=s,s.next=t),i.next=void 0,i.previous=this.e,this.e.next=i,this.e=i,this.g++}}}toJSON(){const i=[];return this.forEach((e,t)=>{i.push([t,e])}),i}fromJSON(i){this.clear();for(const[e,t]of i)this.set(e,t)}},kwt=class extends K3{constructor(i,e=1){super(),this.o=i,this.p=Math.min(Math.max(0,e),1)}get limit(){return this.o}set limit(i){this.o=i,this.q()}get ratio(){return this.p}set ratio(i){this.p=Math.min(Math.max(0,i),1),this.q()}get(i,e=2){return super.get(i,e)}peek(i){return super.get(i,0)}set(i,e){return super.set(i,e,2),this}q(){this.size>this.o&&this.r(Math.round(this.o*this.p))}},Uc=class extends kwt{constructor(i,e=1){super(i,e)}r(i){this.h(i)}set(i,e){return super.set(i,e),this.q(),this}},OEi=class extends kwt{constructor(i,e=1){super(i,e)}r(i){this.j(i)}set(i,e){return this.o<=this.size&&!this.has(i)&&this.r(Math.round(this.o*this.p)-1),super.set(i,e),this}},xwt=class{constructor(){this.c=new Map}add(i){return this.c.set(i,(this.c.get(i)||0)+1),this}delete(i){let e=this.c.get(i)||0;return e===0?!1:(e--,e===0?this.c.delete(i):this.c.set(i,e),!0)}has(i){return this.c.has(i)}},FEi=class{constructor(i){if(this.c=new Map,this.d=new Map,i)for(const[e,t]of i)this.set(e,t)}clear(){this.c.clear(),this.d.clear()}set(i,e){this.c.set(i,e),this.d.set(e,i)}get(i){return this.c.get(i)}getKey(i){return this.d.get(i)}delete(i){const e=this.c.get(i);return e===void 0?!1:(this.c.delete(i),this.d.delete(e),!0)}forEach(i,e){this.c.forEach((t,s)=>{i.call(e,t,s,this)})}keys(){return this.c.keys()}values(){return this.c.values()}},J3=class{constructor(){this.c=new Map}add(i,e){let t=this.c.get(i);t||(t=new Set,this.c.set(i,t)),t.add(e)}delete(i,e){const t=this.c.get(i);t&&(t.delete(e),t.size===0&&this.c.delete(i))}forEach(i,e){const t=this.c.get(i);t&&t.forEach(e)}get(i){const e=this.c.get(i);return e||new Set}};function Ewt(i,e){if(i===e)return!0;if(i.size!==e.size)return!1;for(const[t,s]of i)if(!e.has(t)||e.get(t)!==s)return!1;for(const[t]of e)if(!i.has(t))return!1;return!0}var sse=class{constructor(){this.c=new Map}set(i,...e){let t=this.c;for(let s=0;s<e.length-1;s++)t.has(e[s])||t.set(e[s],new Map),t=t.get(e[s]);t.set(e[e.length-1],i)}get(...i){let e=this.c;for(let t=0;t<i.length-1;t++){if(!e.has(i[t]))return;e=e.get(i[t])}return e.get(i[i.length-1])}clear(){this.c.clear()}*values(){function*i(e){for(const t of e.values())t instanceof Map?yield*i(t):yield t}yield*i(this.c)}toString(){const i=(e,t)=>{let s="";for(const[n,r]of e)s+=`${" ".repeat(t)}${n}: `,r instanceof Map?s+=`
`+i(r,t+1):s+=`${r}
`;return s};return i(this.c,0)}};function W5(i,e){if(!i)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function mh(i,e="Unreachable"){throw new Error(e)}function vs(i,e="unexpected state"){if(!i)throw typeof e=="string"?new Ci(`Assertion Failed: ${e}`):e}function Iwt(i,e="Soft Assertion Failed"){i||wt(new Ci(e))}function yb(i){if(!i()){debugger;i(),wt(new Ci("Assertion Failed"))}}function sx(i,e){let t=0;for(;t<i.length-1;){const s=i[t],n=i[t+1];if(!e(s,n))return!1;t++}return!0}function Ae(i){return typeof i=="string"}function _w(i){return Array.isArray(i)&&i.every(e=>Ae(e))}function Yi(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function VEi(i){const e=Object.getPrototypeOf(Uint8Array);return typeof i=="object"&&i instanceof e}function Lo(i){return typeof i=="number"&&!isNaN(i)}function $De(i){return!!i&&typeof i[Symbol.iterator]=="function"}function Jo(i){return i===!0||i===!1}function Gi(i){return typeof i>"u"}function ks(i){return!wn(i)}function wn(i){return Gi(i)||i===null}function ei(i,e){if(!i)throw new Error(e?`Unexpected type, expected '${e}'`:"Unexpected type")}function $t(i){return vs(i!=null,"Argument is `undefined` or `null`."),i}function F1(i,e){if(i==null)throw typeof e=="string"?new Error(e):e}function Uw(...i){const e=[];for(let t=0;t<i.length;t++){const s=i[t];if(wn(s))throw new Error(`Assertion Failed: argument at index ${t} is undefined or null`);e.push(s)}return e}function WEi(i,e,t){vs(e.includes(i),`${t}: Expected '${i}' to be one of [${e.join(", ")}].`)}var HEi=Object.prototype.hasOwnProperty;function T0(i){if(!Yi(i))return!1;for(const e in i)if(HEi.call(i,e))return!1;return!0}function c$(i){return typeof i=="function"}function Dwt(...i){return i.length>0&&i.every(c$)}function jEi(i,e){const t=Math.min(i.length,e.length);for(let s=0;s<t;s++)_Ei(i[s],e[s])}function _Ei(i,e){if(Ae(e)){if(typeof i!==e)throw new Error(`argument does not match constraint: typeof ${e}`)}else if(c$(e)){try{if(i instanceof e)return}catch{}if(!wn(i)&&i.constructor===e||e.length===1&&e.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Xzs(i){return i}var gt;(function(i){function e(k){return k&&typeof k=="object"&&typeof k[Symbol.iterator]=="function"}i.is=e;const t=Object.freeze([]);function s(){return t}i.empty=s;function*n(k){yield k}i.single=n;function r(k){return e(k)?k:n(k)}i.wrap=r;function o(k){return k||t}i.from=o;function*a(k){for(let I=k.length-1;I>=0;I--)yield k[I]}i.reverse=a;function l(k){return!k||k[Symbol.iterator]().next().done===!0}i.isEmpty=l;function c(k){return k[Symbol.iterator]().next().value}i.first=c;function h(k,I){let M=0;for(const $ of k)if(I($,M++))return!0;return!1}i.some=h;function u(k,I){for(const M of k)if(I(M))return M}i.find=u;function*f(k,I){for(const M of k)I(M)&&(yield M)}i.filter=f;function*g(k,I){let M=0;for(const $ of k)yield I($,M++)}i.map=g;function*p(k,I){let M=0;for(const $ of k)yield*I($,M++)}i.flatMap=p;function*m(...k){for(const I of k)$De(I)?yield*I:yield I}i.concat=m;function b(k,I,M){let $=M;for(const F of k)$=I($,F);return $}i.reduce=b;function v(k){let I=0;for(const M of k)I++;return I}i.length=v;function*w(k,I,M=k.length){for(I<-k.length&&(I=0),I<0&&(I+=k.length),M<0?M+=k.length:M>k.length&&(M=k.length);I<M;I++)yield k[I]}i.slice=w;function C(k,I=Number.POSITIVE_INFINITY){const M=[];if(I===0)return[M,k];const $=k[Symbol.iterator]();for(let F=0;F<I;F++){const z=$.next();if(z.done)return[M,i.empty()];M.push(z.value)}return[M,{[Symbol.iterator](){return $}}]}i.consume=C;async function S(k){const I=[];for await(const M of k)I.push(M);return Promise.resolve(I)}i.asyncToArray=S})(gt||(gt={}));var UEi=!1,h$=null,zEi=class{constructor(){this.a=new FinalizationRegistry(i=>{console.warn(`[LEAKED DISPOSABLE] ${i}`)})}trackDisposable(i){const e=new Error("CREATED via:").stack;this.a.register(i,e,i)}setParent(i,e){e?this.a.unregister(i):this.trackDisposable(i)}markAsDisposed(i){this.a.unregister(i)}markAsSingleton(i){this.a.unregister(i)}},qEi=class Zvi{constructor(){this.b=new Map}static{this.a=0}c(e){let t=this.b.get(e);return t||(t={parent:null,source:null,isSingleton:!1,value:e,idx:Zvi.a++},this.b.set(e,t)),t}trackDisposable(e){const t=this.c(e);t.source||(t.source=new Error().stack)}setParent(e,t){const s=this.c(e);s.parent=t}markAsDisposed(e){this.b.delete(e)}markAsSingleton(e){this.c(e).isSingleton=!0}f(e,t){const s=t.get(e);if(s)return s;const n=e.parent?this.f(this.c(e.parent),t):e;return t.set(e,n),n}getTrackedDisposables(){const e=new Map;return[...this.b.entries()].filter(([,s])=>s.source!==null&&!this.f(s,e).isSingleton).flatMap(([s])=>s)}computeLeakingDisposables(e=10,t){let s;if(t)s=t;else{const l=new Map,c=[...this.b.values()].filter(u=>u.source!==null&&!this.f(u,l).isSingleton);if(c.length===0)return;const h=new Set(c.map(u=>u.value));if(s=c.filter(u=>!(u.parent&&h.has(u.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function n(l){function c(u,f){for(;u.length>0&&f.some(g=>typeof g=="string"?g===u[0]:u[0].match(g));)u.shift()}const h=l.source.split(`
`).map(u=>u.trim().replace("at ","")).filter(u=>u!=="");return c(h,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),h.reverse()}const r=new J3;for(const l of s){const c=n(l);for(let h=0;h<=c.length;h++)r.add(c.slice(0,h).join(`
`),l)}s.sort(Dl(l=>l.idx,zd));let o="",a=0;for(const l of s.slice(0,e)){a++;const c=n(l),h=[];for(let u=0;u<c.length;u++){let f=c[u];f=`(shared with ${r.get(c.slice(0,u+1).join(`
`)).size}/${s.length} leaks) at ${f}`;const p=r.get(c.slice(0,u).join(`
`)),m=NM([...p].map(b=>n(b)[u]),b=>b);delete m[c[u]];for(const[b,v]of Object.entries(m))h.unshift(` - stacktraces of ${v.length} other leaks continue with ${b}`);h.unshift(f)}o+=`
==================== Leaking disposable ${a}/${s.length}: ${l.value.constructor.name} ====================
${h.join(`
`)}
============================================================
`}return s.length>e&&(o+=`
... and ${s.length-e} more leaking disposables
`),{leaks:s,details:o}}};function nse(i){h$=i}if(UEi){const i="__is_disposable_tracked__";nse(new class{trackDisposable(e){const t=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[i]||console.log(t)},3e3)}setParent(e,t){if(e&&e!==T.None)try{e[i]=!0}catch{}}markAsDisposed(e){if(e&&e!==T.None)try{e[i]=!0}catch{}}markAsSingleton(e){}})}function H5(i){return h$?.trackDisposable(i),i}function j5(i){h$?.markAsDisposed(i)}function X3(i,e){h$?.setParent(i,e)}function GEi(i,e){if(h$)for(const t of i)h$.setParent(t,e)}function Cb(i){return h$?.markAsSingleton(i),i}function Tv(i){return typeof i=="object"&&i!==null&&typeof i.dispose=="function"&&i.dispose.length===0}function Te(i){if(gt.is(i)){const e=[];for(const t of i)if(t)try{t.dispose()}catch(s){e.push(s)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(i)?[]:i}else if(i)return i.dispose(),i}function BDe(i){for(const e of i)Tv(e)&&e.dispose();return[]}function Xn(...i){const e=se(()=>Te(i));return GEi(i,e),e}function se(i){const e=H5({dispose:ng(()=>{j5(e),i()})});return e}var B=class ewi{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this.f=new Set,this.g=!1,H5(this)}dispose(){this.g||(j5(this),this.g=!0,this.clear())}get isDisposed(){return this.g}clear(){if(this.f.size!==0)try{Te(this.f)}finally{this.f.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return X3(e,this),this.g?ewi.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this.f.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this.f.delete(e),e.dispose()}}deleteAndLeak(e){e&&this.f.has(e)&&(this.f.delete(e),X3(e,null))}},T=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this.q=new B,H5(this),X3(this.q,this)}dispose(){j5(this),this.q.dispose()}B(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this.q.add(i)}},Le=class{constructor(){this.b=!1,H5(this)}get value(){return this.b?void 0:this.a}set value(i){this.b||i===this.a||(this.a?.dispose(),i&&X3(i,this),this.a=i)}clear(){this.value=void 0}dispose(){this.b=!0,j5(this),this.a?.dispose(),this.a=void 0}clearAndLeak(){const i=this.a;return this.a=void 0,i&&X3(i,null),i}},KEi=class{constructor(i){this.a=new Le,this.b=!1,this.a.value=i}get value(){return this.a.value}set value(i){this.b||i===this.a.value||(this.a.value=i)}dispose(){this.b=!0,this.a.dispose()}},rse=class{constructor(i){this.b=i,this.a=1}acquire(){return this.a++,this}release(){return--this.a===0&&this.b.dispose(),this}},_5=class{constructor(){this.c=new Map}acquire(i,...e){let t=this.c.get(i);t||(t={counter:0,object:this.f(i,...e)},this.c.set(i,t));const{object:s}=t,n=ng(()=>{--t.counter===0&&(this.g(i,t.object),this.c.delete(i))});return t.counter++,{object:s,dispose:n}}},Lwt=class{constructor(i){this.a=i}async acquire(i,...e){const t=this.a.acquire(i,...e);try{return{object:await t.object,dispose:()=>t.dispose()}}catch(s){throw t.dispose(),s}}},JEi=class{constructor(i){this.object=i}dispose(){}},Vi=class{constructor(){this.a=new Map,this.b=!1,H5(this)}dispose(){j5(this),this.b=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this.a.size)try{Te(this.a.values())}finally{this.a.clear()}}has(i){return this.a.has(i)}get size(){return this.a.size}get(i){return this.a.get(i)}set(i,e,t=!1){this.b&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),t||this.a.get(i)?.dispose(),this.a.set(i,e)}deleteAndDispose(i){this.a.get(i)?.dispose(),this.a.delete(i)}deleteAndLeak(i){const e=this.a.get(i);return this.a.delete(i),e}keys(){return this.a.keys()}values(){return this.a.values()}[Symbol.iterator](){return this.a[Symbol.iterator]()}};function Twt(i,e){let t=!1;return i.then(s=>{t||e(s)}),se(()=>{t=!0})}var _h=class nIe{static{this.Undefined=new nIe(void 0)}constructor(e){this.element=e,this.next=nIe.Undefined,this.prev=nIe.Undefined}},cl=class{constructor(){this.a=_h.Undefined,this.b=_h.Undefined,this.c=0}get size(){return this.c}isEmpty(){return this.a===_h.Undefined}clear(){let i=this.a;for(;i!==_h.Undefined;){const e=i.next;i.prev=_h.Undefined,i.next=_h.Undefined,i=e}this.a=_h.Undefined,this.b=_h.Undefined,this.c=0}unshift(i){return this.d(i,!1)}push(i){return this.d(i,!0)}d(i,e){const t=new _h(i);if(this.a===_h.Undefined)this.a=t,this.b=t;else if(e){const n=this.b;this.b=t,t.prev=n,n.next=t}else{const n=this.a;this.a=t,t.next=n,n.prev=t}this.c+=1;let s=!1;return()=>{s||(s=!0,this.e(t))}}shift(){if(this.a!==_h.Undefined){const i=this.a.element;return this.e(this.a),i}}pop(){if(this.b!==_h.Undefined){const i=this.b.element;return this.e(this.b),i}}e(i){if(i.prev!==_h.Undefined&&i.next!==_h.Undefined){const e=i.prev;e.next=i.next,i.next.prev=e}else i.prev===_h.Undefined&&i.next===_h.Undefined?(this.a=_h.Undefined,this.b=_h.Undefined):i.next===_h.Undefined?(this.b=this.b.prev,this.b.next=_h.Undefined):i.prev===_h.Undefined&&(this.a=this.a.next,this.a.prev=_h.Undefined);this.c-=1}*[Symbol.iterator](){let i=this.a;for(;i!==_h.Undefined;)yield i.element,i=i.next}},XEi=globalThis.performance&&typeof globalThis.performance.now=="function",lr=class twi{static create(e){return new twi(e)}constructor(e){this.c=XEi&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this.a=this.c(),this.b=-1}stop(){this.b=this.c()}reset(){this.a=this.c(),this.b=-1}elapsed(){return this.b!==-1?this.b-this.a:this.c()-this.a}},Mwt=!1,YEi=!1,H;(function(i){i.None=()=>T.None;function e(Q){if(YEi){const{onDidAddListener:ce}=Q,Pe=FDe.create();let we=0;Q.onDidAddListener=()=>{++we===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),Pe.print()),ce?.()}}}function t(Q,ce){return g(Q,()=>{},0,void 0,!0,void 0,ce)}i.defer=t;function s(Q){return(ce,Pe=null,we)=>{let De=!1,Ke;return Ke=Q(mt=>{if(!De)return Ke?Ke.dispose():De=!0,ce.call(Pe,mt)},null,we),De&&Ke.dispose(),Ke}}i.once=s;function n(Q,ce){return i.once(i.filter(Q,ce))}i.onceIf=n;function r(Q,ce,Pe){return u((we,De=null,Ke)=>Q(mt=>we.call(De,ce(mt)),null,Ke),Pe)}i.map=r;function o(Q,ce,Pe){return u((we,De=null,Ke)=>Q(mt=>{ce(mt),we.call(De,mt)},null,Ke),Pe)}i.forEach=o;function a(Q,ce,Pe){return u((we,De=null,Ke)=>Q(mt=>ce(mt)&&we.call(De,mt),null,Ke),Pe)}i.filter=a;function l(Q){return Q}i.signal=l;function c(...Q){return(ce,Pe=null,we)=>{const De=Xn(...Q.map(Ke=>Ke(mt=>ce.call(Pe,mt))));return f(De,we)}}i.any=c;function h(Q,ce,Pe,we){let De=Pe;return r(Q,Ke=>(De=ce(De,Ke),De),we)}i.reduce=h;function u(Q,ce){let Pe;const we={onWillAddFirstListener(){Pe=Q(De.fire,De)},onDidRemoveLastListener(){Pe?.dispose()}};ce||e(we);const De=new E(we);return ce?.add(De),De.event}function f(Q,ce){return ce instanceof Array?ce.push(Q):ce&&ce.add(Q),Q}function g(Q,ce,Pe=100,we=!1,De=!1,Ke,mt){let Ne,yi,Ui,ps=0,Qi;const Dr={leakWarningThreshold:Ke,onWillAddFirstListener(){Ne=Q(eg=>{ps++,yi=ce(yi,eg),we&&!Ui&&(al.fire(yi),yi=void 0),Qi=()=>{const Eo=yi;yi=void 0,Ui=void 0,(!we||ps>1)&&al.fire(Eo),ps=0},typeof Pe=="number"?(clearTimeout(Ui),Ui=setTimeout(Qi,Pe)):Ui===void 0&&(Ui=0,queueMicrotask(Qi))})},onWillRemoveListener(){De&&ps>0&&Qi?.()},onDidRemoveLastListener(){Qi=void 0,Ne.dispose()}};mt||e(Dr);const al=new E(Dr);return mt?.add(al),al.event}i.debounce=g;function p(Q,ce=0,Pe){return i.debounce(Q,(we,De)=>we?(we.push(De),we):[De],ce,void 0,!0,void 0,Pe)}i.accumulate=p;function m(Q,ce=(we,De)=>we===De,Pe){let we=!0,De;return a(Q,Ke=>{const mt=we||!ce(Ke,De);return we=!1,De=Ke,mt},Pe)}i.latch=m;function b(Q,ce,Pe){return[i.filter(Q,ce,Pe),i.filter(Q,we=>!ce(we),Pe)]}i.split=b;function v(Q,ce=!1,Pe=[],we){let De=Pe.slice(),Ke=Q(yi=>{De?De.push(yi):Ne.fire(yi)});we&&we.add(Ke);const mt=()=>{De?.forEach(yi=>Ne.fire(yi)),De=null},Ne=new E({onWillAddFirstListener(){Ke||(Ke=Q(yi=>Ne.fire(yi)),we&&we.add(Ke))},onDidAddFirstListener(){De&&(ce?setTimeout(mt):mt())},onDidRemoveLastListener(){Ke&&Ke.dispose(),Ke=null}});return we&&we.add(Ne),Ne.event}i.buffer=v;function w(Q,ce){return(we,De,Ke)=>{const mt=ce(new S);return Q(function(Ne){const yi=mt.evaluate(Ne);yi!==C&&we.call(De,yi)},void 0,Ke)}}i.chain=w;const C=Symbol("HaltChainable");class S{constructor(){this.f=[]}map(ce){return this.f.push(ce),this}forEach(ce){return this.f.push(Pe=>(ce(Pe),Pe)),this}filter(ce){return this.f.push(Pe=>ce(Pe)?Pe:C),this}reduce(ce,Pe){let we=Pe;return this.f.push(De=>(we=ce(we,De),we)),this}latch(ce=(Pe,we)=>Pe===we){let Pe=!0,we;return this.f.push(De=>{const Ke=Pe||!ce(De,we);return Pe=!1,we=De,Ke?De:C}),this}evaluate(ce){for(const Pe of this.f)if(ce=Pe(ce),ce===C)break;return ce}}function k(Q,ce,Pe=we=>we){const we=(...Ne)=>mt.fire(Pe(...Ne)),De=()=>Q.on(ce,we),Ke=()=>Q.removeListener(ce,we),mt=new E({onWillAddFirstListener:De,onDidRemoveLastListener:Ke});return mt.event}i.fromNodeEventEmitter=k;function I(Q,ce,Pe=we=>we){const we=(...Ne)=>mt.fire(Pe(...Ne)),De=()=>Q.addEventListener(ce,we),Ke=()=>Q.removeEventListener(ce,we),mt=new E({onWillAddFirstListener:De,onDidRemoveLastListener:Ke});return mt.event}i.fromDOMEventEmitter=I;function M(Q,ce){return new Promise(Pe=>s(Q)(Pe,null,ce))}i.toPromise=M;function $(Q){const ce=new E;return Q.then(Pe=>{ce.fire(Pe)},()=>{ce.fire(void 0)}).finally(()=>{ce.dispose()}),ce.event}i.fromPromise=$;function F(Q,ce){return Q(Pe=>ce.fire(Pe))}i.forward=F;function z(Q,ce,Pe){return ce(Pe),Q(we=>ce(we))}i.runAndSubscribe=z;class K{constructor(ce,Pe){this._observable=ce,this.f=0,this.g=!1;const we={onWillAddFirstListener:()=>{ce.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{ce.removeObserver(this)}};Pe||e(we),this.emitter=new E(we),Pe&&Pe.add(this.emitter)}beginUpdate(ce){this.f++}handlePossibleChange(ce){}handleChange(ce,Pe){this.g=!0}endUpdate(ce){this.f--,this.f===0&&(this._observable.reportChanges(),this.g&&(this.g=!1,this.emitter.fire(this._observable.get())))}}function ie(Q,ce){return new K(Q,ce).emitter.event}i.fromObservable=ie;function le(Q){return(ce,Pe,we)=>{let De=0,Ke=!1;const mt={beginUpdate(){De++},endUpdate(){De--,De===0&&(Q.reportChanges(),Ke&&(Ke=!1,ce.call(Pe)))},handlePossibleChange(){},handleChange(){Ke=!0}};Q.addObserver(mt),Q.reportChanges();const Ne={dispose(){Q.removeObserver(mt)}};return we instanceof B?we.add(Ne):Array.isArray(we)&&we.push(Ne),Ne}}i.fromObservableLight=le})(H||(H={}));var ODe=class Zpt{static{this.all=new Set}static{this.f=0}constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Zpt.f++}`,Zpt.all.add(this)}start(e){this.g=new lr,this.listenerCount=e}stop(){if(this.g){const e=this.g.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this.g=void 0}}},Y3=-1;function QEi(i){const e=Y3;return Y3=i,{dispose(){Y3=e}}}var ZEi=class iwi{static{this.f=1}constructor(e,t,s=(iwi.f++).toString(16).padStart(3,"0")){this.j=e,this.threshold=t,this.name=s,this.h=0}dispose(){this.g?.clear()}check(e,t){const s=this.threshold;if(s<=0||t<s)return;this.g||(this.g=new Map);const n=this.g.get(e.value)||0;if(this.g.set(e.value,n+1),this.h-=1,this.h<=0){this.h=s*.5;const[r,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(r);const l=new eIi(a,r);this.j(l)}return()=>{const r=this.g.get(e.value)||0;this.g.set(e.value,r-1)}}getMostFrequentStack(){if(!this.g)return;let e,t=0;for(const[s,n]of this.g)(!e||t<n)&&(e=[s,n],t=n);return e}},FDe=class swi{static create(){const e=new Error;return new swi(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},eIi=class extends Error{constructor(i,e){super(i),this.name="ListenerLeakError",this.stack=e}},tIi=class extends Error{constructor(i,e){super(i),this.name="ListenerRefusalError",this.stack=e}},iIi=0,ose=class{constructor(i){this.value=i,this.id=iIi++}},sIi=2,Rwt=(i,e)=>{if(i instanceof ose)e(i);else for(let t=0;t<i.length;t++){const s=i[t];s&&e(s)}},E=class{constructor(i){this.z=0,this.f=i,this.g=Y3>0||this.f?.leakWarningThreshold?new ZEi(i?.onListenerError??wt,this.f?.leakWarningThreshold??Y3):void 0,this.j=this.f?._profName?new ODe(this.f._profName):void 0,this.w=this.f?.deliveryQueue}dispose(){if(!this.m){if(this.m=!0,this.w?.current===this&&this.w.reset(),this.u){if(Mwt){const i=this.u;queueMicrotask(()=>{Rwt(i,e=>e.stack?.print())})}this.u=void 0,this.z=0}this.f?.onDidRemoveLastListener?.(),this.g?.dispose()}}get event(){return this.q??=(i,e,t)=>{if(this.g&&this.z>this.g.threshold**2){const a=`[${this.g.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this.z} vs ${this.g.threshold})`;console.warn(a);const l=this.g.getMostFrequentStack()??["UNKNOWN stack",-1],c=new tIi(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this.f?.onListenerError||wt)(c),T.None}if(this.m)return T.None;e&&(i=i.bind(e));const s=new ose(i);let n,r;this.g&&this.z>=Math.ceil(this.g.threshold*.2)&&(s.stack=FDe.create(),n=this.g.check(s.stack,this.z+1)),Mwt&&(s.stack=r??FDe.create()),this.u?this.u instanceof ose?(this.w??=new Nwt,this.u=[this.u,s]):this.u.push(s):(this.f?.onWillAddFirstListener?.(this),this.u=s,this.f?.onDidAddFirstListener?.(this)),this.f?.onDidAddListener?.(this),this.z++;const o=se(()=>{n?.(),this.A(s)});return t instanceof B?t.add(o):Array.isArray(t)&&t.push(o),o},this.q}A(i){if(this.f?.onWillRemoveListener?.(this),!this.u)return;if(this.z===1){this.u=void 0,this.f?.onDidRemoveLastListener?.(this),this.z=0;return}const e=this.u,t=e.indexOf(i);if(t===-1)throw console.log("disposed?",this.m),console.log("size?",this.z),console.log("arr?",JSON.stringify(this.u)),new Error("Attempted to dispose unknown listener");this.z--,e[t]=void 0;const s=this.w.current===this;if(this.z*sIi<=e.length){let n=0;for(let r=0;r<e.length;r++)e[r]?e[n++]=e[r]:s&&n<this.w.end&&(this.w.end--,n<this.w.i&&this.w.i--);e.length=n}}B(i,e){if(!i)return;const t=this.f?.onListenerError||wt;if(!t){i.value(e);return}try{i.value(e)}catch(s){t(s)}}C(i){const e=i.current.u;for(;i.i<i.end;)this.B(e[i.i++],i.value);i.reset()}fire(i){if(this.w?.current&&(this.C(this.w),this.j?.stop()),this.j?.start(this.z),this.u)if(this.u instanceof ose)this.B(this.u,i);else{const e=this.w;e.enqueue(this,i,th