UNPKG

code-server

Version:

Run VS Code on a remote server.

403 lines (356 loc) • 16.2 MB
/*!-------------------------------------------------------- * Copyright (C) Microsoft Corporation. All rights reserved. *--------------------------------------------------------*/ /****************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; export function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } export var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } export function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } export function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } export function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); var _, done = false; for (var i = decorators.length - 1; i >= 0; i--) { var context = {}; for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; for (var p in contextIn.access) context.access[p] = contextIn.access[p]; context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); if (kind === "accessor") { if (result === void 0) continue; if (result === null || typeof result !== "object") throw new TypeError("Object expected"); if (_ = accept(result.get)) descriptor.get = _; if (_ = accept(result.set)) descriptor.set = _; if (_ = accept(result.init)) initializers.unshift(_); } else if (_ = accept(result)) { if (kind === "field") initializers.unshift(_); else descriptor[key] = _; } } if (target) Object.defineProperty(target, contextIn.name, descriptor); done = true; }; export function __runInitializers(thisArg, initializers, value) { var useValue = arguments.length > 2; for (var i = 0; i < initializers.length; i++) { value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); } return useValue ? value : void 0; }; export function __propKey(x) { return typeof x === "symbol" ? x : "".concat(x); }; export function __setFunctionName(f, name, prefix) { if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); }; export function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } export function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } export function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (g && (g = 0, op[0] && (_ = 0)), _) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } export var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); export function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } export function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } export function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ export function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ export function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } export function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || Array.prototype.slice.call(from)); } export function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } export function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } export function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } } export function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } export function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; export function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } export function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } export function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } export function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } export function __classPrivateFieldIn(state, receiver) { if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); return typeof state === "function" ? receiver === state : state.has(receiver); } export function __addDisposableResource(env, value, async) { if (value !== null && value !== void 0) { if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); var dispose, inner; if (async) { if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); dispose = value[Symbol.asyncDispose]; } if (dispose === void 0) { if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); dispose = value[Symbol.dispose]; if (async) inner = dispose; } if (typeof dispose !== "function") throw new TypeError("Object not disposable."); if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; env.stack.push({ value: value, dispose: dispose, async: async }); } else if (async) { env.stack.push({ async: true }); } return value; } var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { var e = new Error(message); return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; }; export function __disposeResources(env) { function fail(e) { env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; env.hasError = true; } function next() { while (env.stack.length) { var rec = env.stack.pop(); try { var result = rec.dispose && rec.dispose.call(rec.value); if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); } catch (e) { fail(e); } } if (env.hasError) throw env.error; } return next(); } export default { __extends: __extends, __assign: __assign, __rest: __rest, __decorate: __decorate, __param: __param, __metadata: __metadata, __awaiter: __awaiter, __generator: __generator, __createBinding: __createBinding, __exportStar: __exportStar, __values: __values, __read: __read, __spread: __spread, __spreadArrays: __spreadArrays, __spreadArray: __spreadArray, __await: __await, __asyncGenerator: __asyncGenerator, __asyncDelegator: __asyncDelegator, __asyncValues: __asyncValues, __makeTemplateObject: __makeTemplateObject, __importStar: __importStar, __importDefault: __importDefault, __classPrivateFieldGet: __classPrivateFieldGet, __classPrivateFieldSet: __classPrivateFieldSet, __classPrivateFieldIn: __classPrivateFieldIn, __addDisposableResource: __addDisposableResource, __disposeResources: __disposeResources, }; var lRo=Object.defineProperty;var cRo=Object.getOwnPropertyDescriptor;var dHi=a=>{throw TypeError(a)};var I=(a,i,e,t)=>{for(var o=t>1?void 0:t?cRo(i,e):i,n=a.length-1,r;n>=0;n--)(r=a[n])&&(o=(t?r(i,e,o):r(o))||o);return t&&o&&lRo(i,e,o),o},m=(a,i)=>(e,t)=>i(e,t,a);var f6t=(a,i,e)=>i.has(a)||dHi("Cannot "+e);var Lf=(a,i,e)=>(f6t(a,i,"read from private field"),e?e.call(a):i.get(a)),wbe=(a,i,e)=>i.has(a)?dHi("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,e),pGe=(a,i,e,t)=>(f6t(a,i,"write to private field"),t?t.call(a,e):i.set(a,e),e),mGe=(a,i,e)=>(f6t(a,i,"access private method"),e);function dut(a,i){let e=a;typeof e.vscodeWindowId!="number"&&Object.defineProperty(e,"vscodeWindowId",{get:()=>i})}var rt=window;function a_(a){return a===rt?!1:typeof a?.vscodeWindowId=="number"}function II(a,i){let e=Object.create(null);for(let t of a){let o=i(t),n=e[o];n||(n=e[o]=[]),n.push(t)}return e}function mHi(a,i){let e=new Map;for(let t of a){let o=i(t),n=e.get(o);n||(n=[],e.set(o,n)),n.push(t)}return e}function LH(a,i){let e=[],t=[];for(let o of a)i.has(o)||e.push(o);for(let o of i)a.has(o)||t.push(o);return{removed:e,added:t}}function hGe(a,i){let e=[],t=[];for(let[o,n]of a)i.has(o)||e.push(n);for(let[o,n]of i)a.has(o)||t.push(n);return{removed:e,added:t}}function uut(a,i){let e=new Set;for(let t of i)a.has(t)&&e.add(t);return e}var uHi,pHi,Mre=class{constructor(i,e){this.toKey=e;this._map=new Map;this[uHi]="SetWithKey";for(let t of i)this.add(t)}get size(){return this._map.size}add(i){let e=this.toKey(i);return this._map.set(e,i),this}delete(i){return this._map.delete(this.toKey(i))}has(i){return this._map.has(this.toKey(i))}*entries(){for(let i of this._map.values())yield[i,i]}keys(){return this.values()}*values(){for(let i of this._map.values())yield i}clear(){this._map.clear()}forEach(i,e){this._map.forEach(t=>i.call(e,t,t,this))}[(pHi=Symbol.iterator,uHi=Symbol.toStringTag,pHi)](){return this.values()}};var v6t=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(i){setTimeout(()=>{throw i.stack?ia.isErrorNoTelemetry(i)?new ia(i.message+` `+i.stack):new Error(i.message+` `+i.stack):i},0)}}addListener(i){return this.listeners.push(i),()=>{this._removeListener(i)}}emit(i){this.listeners.forEach(e=>{e(i)})}_removeListener(i){this.listeners.splice(this.listeners.indexOf(i),1)}setUnexpectedErrorHandler(i){this.unexpectedErrorHandler=i}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(i){this.unexpectedErrorHandler(i),this.emit(i)}onUnexpectedExternalError(i){this.unexpectedErrorHandler(i)}},Cbe=new v6t;function hHi(a){Cbe.setUnexpectedErrorHandler(a)}function O6(a){Cbe.onUnexpectedError(a)}function pt(a){so(a)||Cbe.onUnexpectedError(a)}function ws(a){so(a)||Cbe.onUnexpectedExternalError(a)}function Kq(a){if(a instanceof Error){let{name:i,message:e,cause:t}=a,o=a.stacktrace||a.stack;return{$isError:!0,name:i,message:e,stack:o,noTelemetry:ia.isErrorNoTelemetry(a),cause:t?Kq(t):void 0,code:a.code}}return a}function F6(a){let i;return a.noTelemetry?i=new ia:(i=new Error,i.name=a.name),i.message=a.message,i.stack=a.stack,a.code&&(i.code=a.code),a.cause&&(i.cause=F6(a.cause)),i}var N6="Canceled";function so(a){return a instanceof vo?!0:a instanceof Error&&a.name===N6&&a.message===N6}var vo=class extends Error{constructor(){super(N6),this.name=this.message}},put=class a extends Error{static{this._name="PendingMigrationError"}static is(i){return i instanceof a||i instanceof Error&&i.name===a._name}constructor(i){super(i),this.name=a._name}};function yI(){let a=new Error(N6);return a.name=a.message,a}function Qr(a){return a?new Error(`Illegal argument: ${a}`):new Error("Illegal argument")}function xbe(a){return a?new Error(`Illegal state: ${a}`):new Error("Illegal state")}function cn(a){return a?a.message?a.message:a.stack?a.stack.split(` `)[0]:String(a):"Error"}var l_=class extends Error{constructor(i){super("NotSupported"),i&&(this.message=i)}};var ia=class a extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof a)return i;let e=new a;return e.message=i.message,e.stack=i.stack,e}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},ni=class a extends Error{constructor(i){super(i||"An unexpected bug occurred."),Object.setPrototypeOf(this,a.prototype)}};function _u(a,i){let e=this,t=!1,o;return function(){if(t)return o;if(t=!0,i)try{o=a.apply(e,arguments)}finally{i()}else o=a.apply(e,arguments);return o}}function Jd(a,i,e=a.length-1){let t=kbe(a,i,e);if(t!==-1)return a[t]}function kbe(a,i,e=a.length-1){for(let t=e;t>=0;t--){let o=a[t];if(i(o,t))return t}return-1}function mut(a,i,e=0){let t=uRo(a,i,e);if(t!==-1)return a[t]}function uRo(a,i,e=0){for(let t=e;t<a.length;t++){let o=a[t];if(i(o,t))return t}return-1}function Gq(a,i){let e=qq(a,i);return e===-1?void 0:a[e]}function qq(a,i,e=0,t=a.length){let o=e,n=t;for(;o<n;){let r=Math.floor((o+n)/2);i(a[r])?o=r+1:n=r}return o-1}function gHi(a,i){let e=Ey(a,i);return e===a.length?void 0:a[e]}function Ey(a,i,e=0,t=a.length){let o=e,n=t;for(;o<n;){let r=Math.floor((o+n)/2);i(a[r])?n=r:o=r+1}return o}var gGe=class a{constructor(i){this._array=i;this._findLastMonotonousLastIdx=0}static{this.assertInvariants=!1}findLastMonotonous(i){if(a.assertInvariants){if(this._prevFindLastPredicate){for(let t of this._array)if(this._prevFindLastPredicate(t)&&!i(t))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}this._prevFindLastPredicate=i}let e=qq(this._array,i,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=e+1,e===-1?void 0:this._array[e]}};function fGe(a,i){if(a.length===0)return;let e=a[0];for(let t=1;t<a.length;t++){let o=a[t];i(o,e)>0&&(e=o)}return e}function hut(a,i){if(a.length===0)return;let e=a[0];for(let t=1;t<a.length;t++){let o=a[t];i(o,e)>=0&&(e=o)}return e}function gut(a,i){return fGe(a,(e,t)=>-i(e,t))}function fHi(a,i){if(a.length===0)return-1;let e=0;for(let t=1;t<a.length;t++){let o=a[t];i(o,a[e])>0&&(e=t)}return e}function c_(a,i){for(let e of a){let t=i(e);if(t!==void 0)return t}}function Zg(a){if(a.length===0)throw new Error("Invalid tail call");return[a.slice(0,a.length-1),a[a.length-1]]}function Wi(a,i,e=(t,o)=>t===o){if(a===i)return!0;if(!a||!i||a.length!==i.length)return!1;for(let t=0,o=a.length;t<o;t++)if(!e(a[t],i[t]))return!1;return!0}function vHi(a,i){let e=a.length-1;i<e&&(a[i]=a[e]),a.pop()}function gx(a,i,e){return jM(a.length,t=>e(a[t],i))}function jM(a,i){let e=0,t=a-1;for(;e<=t;){let o=(e+t)/2|0,n=i(o);if(n<0)e=o+1;else if(n>0)t=o-1;else return o}return-(e+1)}function W6(a,i,e){if(a=a|0,a>=i.length)throw new TypeError("invalid index");let t=i[Math.floor(i.length*Math.random())],o=[],n=[],r=[];for(let s of i){let l=e(s,t);l<0?o.push(s):l>0?n.push(s):r.push(s)}return a<o.length?W6(a,o,e):a<o.length+r.length?r[0]:W6(a-(o.length+r.length),n,e)}function ef(a,i){let e=[],t;for(let o of a.slice(0).sort(i))!t||i(t[0],o)!==0?(t=[o],e.push(t)):t.push(o);return e}function*V6(a,i){let e,t;for(let o of a)t!==void 0&&i(t,o)?e.push(o):(e&&(yield e),e=[o]),t=o;e&&(yield e)}function vut(a,i){for(let e=0;e<=a.length;e++)i(e===0?void 0:a[e-1],e===a.length?void 0:a[e])}function bHi(a,i){for(let e=0;e<a.length;e++)i(e===0?void 0:a[e-1],a[e],e+1===a.length?void 0:a[e+1])}function but(...a){return[].concat(...a)}function vGe(a,i,e){let t=[];function o(s,l,c){if(l===0&&c.length===0)return;let u=t[t.length-1];u&&u.start+u.deleteCount===s?(u.deleteCount+=l,u.toInsert.push(...c)):t.push({start:s,deleteCount:l,toInsert:c})}let n=0,r=0;for(;;){if(n===a.length){o(n,0,i.slice(r));break}if(r===i.length){o(n,a.length-n,[]);break}let s=a[n],l=i[r],c=e(s,l);c===0?(n+=1,r+=1):c<0?(o(n,1,[]),n+=1):c>0&&(o(n,0,[l]),r+=1)}return t}function d_(a,i,e){let t=vGe(a,i,e),o=[],n=[];for(let r of t)o.push(...a.slice(r.start,r.start+r.deleteCount)),n.push(...r.toInsert);return{removed:o,added:n}}function SHi(a,i,e){if(e===0)return[];let t=a.slice(0,e).sort(i);return pRo(a,i,t,e,a.length),t}function pRo(a,i,e,t,o){for(let n=e.length;t<o;t++){let r=a[t];if(i(r,e[n-1])<0){e.pop();let s=Ey(e,l=>i(r,l)<0);e.splice(s,0,r)}}}function li(a){return a.filter(i=>!!i)}function jq(a){let i=0;for(let e=0;e<a.length;e++)a[e]&&(a[i]=a[e],i+=1);a.length=i}function IHi(a,i,e){a.splice(e,0,a.splice(i,1)[0])}function NN(a){return!Array.isArray(a)||a.length===0}function lr(a){return Array.isArray(a)&&a.length>0}function Oo(a,i=e=>e){let e=new Set;return a.filter(t=>{let o=i(t);return e.has(o)?!1:(e.add(o),!0)})}function yHi(a){let i=new Set;return e=>{let t=a(e);return i.has(t)?!1:(i.add(t),!0)}}function wHi(a,i,e=(t,o)=>t===o){let t=0;for(let o=0,n=Math.min(a.length,i.length);o<n&&e(a[o],i[o]);o++)t++;return t}function Ig(a,i){let e=typeof i=="number"?a:0;typeof i=="number"?e=a:(e=0,i=a);let t=[];if(e<=i)for(let o=e;o<i;o++)t.push(o);else for(let o=e;o>i;o--)t.push(o);return t}function B6(a,i,e){return a.reduce((t,o)=>(t[i(o)]=e?e(o):o,t),Object.create(null))}function tf(a,i){return a.push(i),()=>bGe(a,i)}function bGe(a,i){let e=a.indexOf(i);if(e>-1)return a.splice(e,1),i}function RH(a,i,e){let t=a.slice(0,i),o=a.slice(i);return t.concat(e,o)}function U6(a,i){let e;if(typeof i=="number"){let t=i;e=()=>{let o=Math.sin(t++)*179426549;return o-Math.floor(o)}}else e=Math.random;for(let t=a.length-1;t>0;t-=1){let o=Math.floor(e()*(t+1)),n=a[t];a[t]=a[o],a[o]=n}}function Sut(a,i){let e=a.indexOf(i);e>-1&&(a.splice(e,1),a.unshift(i))}function SGe(a,i){let e=a.indexOf(i);e>-1&&(a.splice(e,1),a.push(i))}function Qq(a,i){for(let e of i)a.push(e)}function CHi(a,i){return Array.isArray(a)?a.map(i):i(a)}function xHi(a,i){let e=[];for(let t of a){let o=i(t);o!==void 0&&e.push(o)}return e}function kHi(a){let i=new Set(a);return Array.from(i)}function Yl(a){return Array.isArray(a)?a:[a]}function Pre(a,i,e){let t=EHi(a,i),o=a.length,n=e.length;a.length=o+n;for(let r=o-1;r>=t;r--)a[r+n]=a[r];for(let r=0;r<n;r++)a[r+t]=e[r]}function Are(a,i,e,t){let o=EHi(a,i),n=a.splice(o,e);return n===void 0&&(n=[]),Pre(a,o,t),n}function EHi(a,i){return i<0?Math.max(i+a.length,0):Math.min(i,a.length)}var $w;(s=>{function a(l){return l<0}s.isLessThan=a;function i(l){return l<=0}s.isLessThanOrEqual=i;function e(l){return l>0}s.isGreaterThan=e;function t(l){return l===0}s.isNeitherLessOrGreaterThan=t,s.greaterThan=1,s.lessThan=-1,s.neitherLessOrGreaterThan=0})($w||={});function gl(a,i){return(e,t)=>i(a(e),a(t))}function Iut(...a){return(i,e)=>{for(let t of a){let o=t(i,e);if(!$w.isNeitherLessOrGreaterThan(o))return o}return $w.neitherLessOrGreaterThan}}var gu=(a,i)=>a-i,yut=(a,i)=>gu(a?1:0,i?1:0);function Nre(a){return(i,e)=>-a(i,e)}function THi(a){return(i,e)=>i===void 0?e===void 0?$w.neitherLessOrGreaterThan:$w.lessThan:e===void 0?$w.greaterThan:a(i,e)}var tE=class{constructor(i){this.firstIdx=0;this.items=i,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(i){let e=this.firstIdx;for(;e<this.items.length&&i(this.items[e]);)e++;let t=e===this.firstIdx?null:this.items.slice(this.firstIdx,e);return this.firstIdx=e,t}takeFromEndWhile(i){let e=this.lastIdx;for(;e>=0&&i(this.items[e]);)e--;let t=e===this.lastIdx?null:this.items.slice(e+1,this.lastIdx+1);return this.lastIdx=e,t}peek(){if(this.length!==0)return this.items[this.firstIdx]}peekLast(){if(this.length!==0)return this.items[this.lastIdx]}dequeue(){let i=this.items[this.firstIdx];return this.firstIdx++,i}removeLast(){let i=this.items[this.lastIdx];return this.lastIdx--,i}takeCount(i){let e=this.items.slice(this.firstIdx,this.firstIdx+i);return this.firstIdx+=i,e}},$q=class a{constructor(i){this.iterate=i}static{this.empty=new a(i=>{})}forEach(i){this.iterate(e=>(i(e),!0))}toArray(){let i=[];return this.iterate(e=>(i.push(e),!0)),i}filter(i){return new a(e=>this.iterate(t=>i(t)?e(t):!0))}map(i){return new a(e=>this.iterate(t=>e(i(t))))}some(i){let e=!1;return this.iterate(t=>(e=i(t),!e)),e}findFirst(i){let e;return this.iterate(t=>i(t)?(e=t,!1):!0),e}findLast(i){let e;return this.iterate(t=>(i(t)&&(e=t),!0)),e}findLastMaxBy(i){let e,t=!0;return this.iterate(o=>((t||$w.isGreaterThan(i(o,e)))&&(t=!1,e=o),!0)),e}},fut=class a{constructor(i){this._indexMap=i}static createSortPermutation(i,e){let t=Array.from(i.keys()).sort((o,n)=>e(i[o],i[n]));return new a(t)}apply(i){return i.map((e,t)=>i[this._indexMap[t]])}inverse(){let i=this._indexMap.slice();for(let e=0;e<this._indexMap.length;e++)i[this._indexMap[e]]=e;return new a(i)}};async function _Hi(a,i){return(await Promise.all(a.map(async(t,o)=>({element:t,ok:await i(t,o)})))).find(t=>t.ok)?.element}function Ebe(a){return a.reduce((i,e)=>i+e,0)}function Ty(a,i){return a.reduce((e,t)=>e+i(t),0)}function DW(a,i,e){let t=a.get(i);return t===void 0&&(t=e,a.set(i,t)),t}var b6t=class{constructor(i,e){this.uri=i;this.value=e}};function mRo(a){return Array.isArray(a)}var DHi,ut=class a{constructor(i,e){this[DHi]="ResourceMap";if(i instanceof a)this.map=new Map(i.map),this.toKey=e??a.defaultToKey;else if(mRo(i)){this.map=new Map,this.toKey=e??a.defaultToKey;for(let[t,o]of i)this.set(t,o)}else this.map=new Map,this.toKey=i??a.defaultToKey}static{this.defaultToKey=i=>i.toString()}set(i,e){return this.map.set(this.toKey(i),new b6t(i,e)),this}get(i){return this.map.get(this.toKey(i))?.value}has(i){return this.map.has(this.toKey(i))}get size(){return this.map.size}clear(){this.map.clear()}delete(i){return this.map.delete(this.toKey(i))}forEach(i,e){typeof e<"u"&&(i=i.bind(e));for(let[t,o]of this.map)i(o.value,o.uri,this)}*values(){for(let i of this.map.values())yield i.value}*keys(){for(let i of this.map.values())yield i.uri}*entries(){for(let i of this.map.values())yield[i.uri,i.value]}*[(DHi=Symbol.toStringTag,Symbol.iterator)](){for(let[,i]of this.map)yield[i.uri,i.value]}},LHi,Gn=class{constructor(i,e){this[LHi]="ResourceSet";!i||typeof i=="function"?this._map=new ut(i):(this._map=new ut(e),i.forEach(this.add,this))}get size(){return this._map.size}add(i){return this._map.set(i,i),this}clear(){this._map.clear()}delete(i){return this._map.delete(i)}forEach(i,e){this._map.forEach((t,o)=>i.call(e,o,o,this))}has(i){return this._map.has(i)}entries(){return this._map.entries()}keys(){return this._map.keys()}values(){return this._map.keys()}[(LHi=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}};var RHi,MH=class{constructor(){this[RHi]="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(i){return this._map.has(i)}get(i,e=0){let t=this._map.get(i);if(t)return e!==0&&this.touch(t,e),t.value}set(i,e,t=0){let o=this._map.get(i);if(o)o.value=e,t!==0&&this.touch(o,t);else{switch(o={key:i,value:e,next:void 0,previous:void 0},t){case 0:this.addItemLast(o);break;case 1:this.addItemFirst(o);break;case 2:this.addItemLast(o);break;default:this.addItemLast(o);break}this._map.set(i,o),this._size++}return this}delete(i){return!!this.remove(i)}remove(i){let e=this._map.get(i);if(e)return this._map.delete(i),this.removeItem(e),this._size--,e.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let i=this._head;return this._map.delete(i.key),this.removeItem(i),this._size--,i.value}forEach(i,e){let t=this._state,o=this._head;for(;o;){if(e?i.bind(e)(o.value,o.key,this):i(o.value,o.key,this),this._state!==t)throw new Error("LinkedMap got modified during iteration.");o=o.next}}keys(){let i=this,e=this._state,t=this._head,o={[Symbol.iterator](){return o},next(){if(i._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let n={value:t.key,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return o}values(){let i=this,e=this._state,t=this._head,o={[Symbol.iterator](){return o},next(){if(i._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let n={value:t.value,done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return o}entries(){let i=this,e=this._state,t=this._head,o={[Symbol.iterator](){return o},next(){if(i._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let n={value:[t.key,t.value],done:!1};return t=t.next,n}else return{value:void 0,done:!0}}};return o}[(RHi=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(i){if(i>=this.size)return;if(i===0){this.clear();return}let e=this._head,t=this.size;for(;e&&t>i;)this._map.delete(e.key),e=e.next,t--;this._head=e,this._size=t,e&&(e.previous=void 0),this._state++}trimNew(i){if(i>=this.size)return;if(i===0){this.clear();return}let e=this._tail,t=this.size;for(;e&&t>i;)this._map.delete(e.key),e=e.previous,t--;this._tail=e,this._size=t,e&&(e.next=void 0),this._state++}addItemFirst(i){if(!this._head&&!this._tail)this._tail=i;else if(this._head)i.next=this._head,this._head.previous=i;else throw new Error("Invalid list");this._head=i,this._state++}addItemLast(i){if(!this._head&&!this._tail)this._head=i;else if(this._tail)i.previous=this._tail,this._tail.next=i;else throw new Error("Invalid list");this._tail=i,this._state++}removeItem(i){if(i===this._head&&i===this._tail)this._head=void 0,this._tail=void 0;else if(i===this._head){if(!i.next)throw new Error("Invalid list");i.next.previous=void 0,this._head=i.next}else if(i===this._tail){if(!i.previous)throw new Error("Invalid list");i.previous.next=void 0,this._tail=i.previous}else{let 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._state++}touch(i,e){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(i===this._head)return;let t=i.next,o=i.previous;i===this._tail?(o.next=void 0,this._tail=o):(t.previous=o,o.next=t),i.previous=void 0,i.next=this._head,this._head.previous=i,this._head=i,this._state++}else if(e===2){if(i===this._tail)return;let t=i.next,o=i.previous;i===this._head?(t.previous=void 0,this._head=t):(t.previous=o,o.next=t),i.next=void 0,i.previous=this._tail,this._tail.next=i,this._tail=i,this._state++}}}toJSON(){let i=[];return this.forEach((e,t)=>{i.push([t,e])}),i}fromJSON(i){this.clear();for(let[e,t]of i)this.set(e,t)}},wut=class extends MH{constructor(i,e=1){super(),this._limit=i,this._ratio=Math.min(Math.max(0,e),1)}get limit(){return this._limit}set limit(i){this._limit=i,this.checkTrim()}get ratio(){return this._ratio}set ratio(i){this._ratio=Math.min(Math.max(0,i),1),this.checkTrim()}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}checkTrim(){this.size>this._limit&&this.trim(Math.round(this._limit*this._ratio))}},qa=class extends wut{constructor(i,e=1){super(i,e)}trim(i){this.trimOld(i)}set(i,e){return super.set(i,e),this.checkTrim(),this}},Cut=class extends wut{constructor(i,e=1){super(i,e)}trim(i){this.trimNew(i)}set(i,e){return this._limit<=this.size&&!this.has(i)&&this.trim(Math.round(this._limit*this._ratio)-1),super.set(i,e),this}},Tbe=class{constructor(){this.map=new Map}add(i){return this.map.set(i,(this.map.get(i)||0)+1),this}delete(i){let e=this.map.get(i)||0;return e===0?!1:(e--,e===0?this.map.delete(i):this.map.set(i,e),!0)}has(i){return this.map.has(i)}},xut=class{constructor(i){this._m1=new Map;this._m2=new Map;if(i)for(let[e,t]of i)this.set(e,t)}clear(){this._m1.clear(),this._m2.clear()}set(i,e){this._m1.set(i,e),this._m2.set(e,i)}get(i){return this._m1.get(i)}getKey(i){return this._m2.get(i)}delete(i){let e=this._m1.get(i);return e===void 0?!1:(this._m1.delete(i),this._m2.delete(e),!0)}forEach(i,e){this._m1.forEach((t,o)=>{i.call(e,t,o,this)})}keys(){return this._m1.keys()}values(){return this._m1.values()}},PH=class{constructor(){this.map=new Map}add(i,e){let t=this.map.get(i);t||(t=new Set,this.map.set(i,t)),t.add(e)}delete(i,e){let t=this.map.get(i);t&&(t.delete(e),t.size===0&&this.map.delete(i))}forEach(i,e){let t=this.map.get(i);t&&t.forEach(e)}get(i){let e=this.map.get(i);return e||new Set}};function Ore(a,i){if(a===i)return!0;if(a.size!==i.size)return!1;for(let[e,t]of a)if(!i.has(e)||i.get(e)!==t)return!1;for(let[e]of i)if(!a.has(e))return!1;return!0}var AH=class{constructor(){this._data=new Map}set(i,...e){let t=this._data;for(let o=0;o<e.length-1;o++){let n=t.get(e[o]);n===void 0&&(n=new Map,t.set(e[o],n)),t=n}t.set(e[e.length-1],i)}get(...i){let e=this._data;for(let t=0;t<i.length-1;t++){let o=e.get(i[t]);if(o===void 0)return;e=o}return e.get(i[i.length-1])}clear(){this._data.clear()}*values(){function*i(e){for(let t of e.values())t instanceof Map?yield*i(t):yield t}yield*i(this._data)}toString(){let i=(e,t)=>{let o="";for(let[n,r]of e)o+=`${" ".repeat(t)}${n}: `,r instanceof Map?o+=` `+i(r,t+1):o+=`${r} `;return o};return i(this._data,0)}};function H6(a,i){if(!a)throw new Error(i?`Assertion failed (${i})`:"Assertion Failed")}function Cs(a,i="Unreachable"){throw new Error(i)}function fx(a,i="unexpected state"){if(!a)throw typeof i=="string"?new ni(`Assertion Failed: ${i}`):i}function S6t(a,i="Soft Assertion Failed"){a||pt(new ni(i))}function nh(a){if(!a()){debugger;a(),pt(new ni("Assertion Failed"))}}function _y(a,i){let e=0;for(;e<a.length-1;){let t=a[e],o=a[e+1];if(!i(t,o))return!1;e++}return!0}function Ne(a){return typeof a=="string"}function PS(a){return I6t(a,Ne)}function I6t(a,i){return Array.isArray(a)&&a.every(i)}function Ti(a){return typeof a=="object"&&a!==null&&!Array.isArray(a)&&!(a instanceof RegExp)&&!(a instanceof Date)}function PHi(a){let i=Object.getPrototypeOf(Uint8Array);return typeof a=="object"&&a instanceof i}function nn(a){return typeof a=="number"&&!isNaN(a)}function IGe(a){return!!a&&typeof a[Symbol.iterator]=="function"}function $a(a){return a===!0||a===!1}function qo(a){return typeof a>"u"}function uo(a){return!Zn(a)}function Zn(a){return qo(a)||a===null}function bo(a,i){if(!a)throw new Error(i?`Unexpected type, expected '${i}'`:"Unexpected type")}function Ii(a){return fx(a!=null,"Argument is `undefined` or `null`."),a}function yGe(a,i){if(a==null)throw typeof i=="string"?new Error(i):i}function Dy(...a){let i=[];for(let e=0;e<a.length;e++){let t=a[e];if(Zn(t))throw new Error(`Assertion Failed: argument at index ${e} is undefined or null`);i.push(t)}return i}var hRo=Object.prototype.hasOwnProperty;function Rf(a){if(!Ti(a))return!1;for(let i in a)if(hRo.call(a,i))return!1;return!0}function IL(a){return typeof a=="function"}function kut(...a){return a.length>0&&a.every(IL)}function AHi(a,i){let e=Math.min(a.length,i.length);for(let t=0;t<e;t++)gRo(a[t],i[t])}function gRo(a,i){if(Ne(i)){if(typeof a!==i)throw new Error(`argument does not match constraint: typeof ${i}`)}else if(IL(i)){try{if(a instanceof i)return}catch{}if(!Zn(a)&&a.constructor===i||i.length===1&&i.call(void 0,a)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Eo(a,i){for(let e in i)if(!(e in a))return!1;return!0}var ht;(P=>{function a(N){return!!N&&typeof N=="object"&&typeof N[Symbol.iterator]=="function"}P.is=a;let i=Object.freeze([]);function e(){return i}P.empty=e;function*t(N){yield N}P.single=t;function o(N){return a(N)?N:t(N)}P.wrap=o;function n(N){return N??i}P.from=n;function*r(N){for(let W=N.length-1;W>=0;W--)yield N[W]}P.reverse=r;function s(N){return!N||N[Symbol.iterator]().next().done===!0}P.isEmpty=s;function l(N){return N[Symbol.iterator]().next().value}P.first=l;function c(N,W){let U=0;for(let K of N)if(W(K,U++))return!0;return!1}P.some=c;function u(N,W){let U=0;for(let K of N)if(!W(K,U++))return!1;return!0}P.every=u;function p(N,W){for(let U of N)if(W(U))return U}P.find=p;function*h(N,W){for(let U of N)W(U)&&(yield U)}P.filter=h;function*g(N,W){let U=0;for(let K of N)yield W(K,U++)}P.map=g;function*f(N,W){let U=0;for(let K of N)yield*W(K,U++)}P.flatMap=f;function*v(...N){for(let W of N)IGe(W)?yield*W:yield W}P.concat=v;function b(N,W,U){let K=U;for(let j of N)K=W(K,j);return K}P.reduce=b;function S(N){let W=0;for(let U of N)W++;return W}P.length=S;function*y(N,W,U=N.length){for(W<-N.length&&(W=0),W<0&&(W+=N.length),U<0?U+=N.length:U>N.length&&(U=N.length);W<U;W++)yield N[W]}P.slice=y;function w(N,W=Number.POSITIVE_INFINITY){let U=[];if(W===0)return[U,N];let K=N[Symbol.iterator]();for(let j=0;j<W;j++){let J=K.next();if(J.done)return[U,P.empty()];U.push(J.value)}return[U,{[Symbol.iterator](){return K}}]}P.consume=w;async function k(N){let W=[];for await(let U of N)W.push(U);return W}P.asyncToArray=k;async function T(N){let W=[];for await(let U of N)W=W.concat(U);return W}P.asyncToArrayFlat=T})(ht||={});var fRo=!1,Fre=null,Eut=class{constructor(){this._registry=new FinalizationRegistry(i=>{console.warn(`[LEAKED DISPOSABLE] ${i}`)})}trackDisposable(i){let e=new Error("CREATED via:").stack;this._registry.register(i,e,i)}setParent(i,e){e?this._registry.unregister(i):this.trackDisposable(i)}markAsDisposed(i){this._registry.unregister(i)}markAsSingleton(i){this._registry.unregister(i)}},Tut=class a{constructor(){this.livingDisposables=new Map}static{this.idx=0}getDisposableData(i){let e=this.livingDisposables.get(i);return e||(e={parent:null,source:null,isSingleton:!1,value:i,idx:a.idx++},this.livingDisposables.set(i,e)),e}trackDisposable(i){let e=this.getDisposableData(i);e.source||(e.source=new Error().stack)}setParent(i,e){let t=this.getDisposableData(i);t.parent=e}markAsDisposed(i){this.livingDisposables.delete(i)}markAsSingleton(i){this.getDisposableData(i).isSingleton=!0}getRootParent(i,e){let t=e.get(i);if(t)return t;let o=i.parent?this.getRootParent(this.getDisposableData(i.parent),e):i;return e.set(i,o),o}getTrackedDisposables(){let i=new Map;return[...this.livingDisposables.entries()].filter(([,t])=>t.source!==null&&!this.getRootParent(t,i).isSingleton).flatMap(([t])=>t)}computeLeakingDisposables(i=10,e){let t;if(e)t=e;else{let l=new Map,c=[...this.livingDisposables.values()].filter(p=>p.source!==null&&!this.getRootParent(p,l).isSingleton);if(c.length===0)return;let u=new Set(c.map(p=>p.value));if(t=c.filter(p=>!(p.parent&&u.has(p.parent))),t.length===0)throw new Error("There are cyclic diposable chains!")}if(!t)return;function o(l){function c(p,h){for(;p.length>0&&h.some(g=>typeof g=="string"?g===p[0]:p[0].match(g));)p.shift()}let u=l.source.split(` `).map(p=>p.trim().replace("at ","")).filter(p=>p!=="");return c(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}let n=new PH;for(let l of t){let c=o(l);for(let u=0;u<=c.length;u++)n.add(c.slice(0,u).join(` `),l)}t.sort(gl(l=>l.idx,gu));let r="",s=0;for(let l of t.slice(0,i)){s++;let c=o(l),u=[];for(let p=0;p<c.length;p++){let h=c[p];h=`(shared with ${n.get(c.slice(0,p+1).join(` `)).size}/${t.length} leaks) at ${h}`;let f=n.get(c.slice(0,p).join(` `)),v=II([...f].map(b=>o(b)[p]),b=>b);delete v[c[p]];for(let[b,S]of Object.entries(v))S&&u.unshift(` - stacktraces of ${S.length} other leaks continue with ${b}`);u.unshift(h)}r+=` ==================== Leaking disposable ${s}/${t.length}: ${l.value.constructor.name} ==================== ${u.join(` `)} ============================================================ `}return t.length>i&&(r+=` ... and ${t.length-i} more leaking disposables `),{leaks:t,details:r}}};function Lbe(a){Fre=a}if(fRo){let a="__is_disposable_tracked__";Lbe(new class{trackDisposable(i){let e=new Error("Potentially leaked disposable").stack;setTimeout(()=>{i[a]||console.log(e)},3e3)}setParent(i,e){if(i&&i!==x.None)try{i[a]=!0}catch{}}markAsDisposed(i){if(i&&i!==x.None)try{i[a]=!0}catch{}}markAsSingleton(i){}})}function Xq(a){return Fre?.trackDisposable(a),a}function Jq(a){Fre?.markAsDisposed(a)}function Yq(a,i){Fre?.setParent(a,i)}function vRo(a,i){if(Fre)for(let e of a)Fre.setParent(e,i)}function gp(a){return Fre?.markAsSingleton(a),a}function td(a){return typeof a=="object"&&a!==null&&typeof a.dispose=="function"&&a.dispose.length===0}function Ue(a){if(ht.is(a)){let i=[];for(let e of a)if(e)try{e.dispose()}catch(t){i.push(t)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(a)?[]:a}else if(a)return a.dispose(),a}function OH(a){for(let i of a)td(i)&&i.dispose();return[]}function xn(...a){let i=Z(()=>Ue(a));return vRo(a,i),i}var y6t=class{constructor(i){this._isDisposed=!1,this._fn=i,Xq(this)}dispose(){if(!this._isDisposed){if(!this._fn)throw new Error("Unbound disposable context: Need to use an arrow function to preserve the value of this");this._isDisposed=!0,Jq(this),this._fn()}}};function Z(a){return new y6t(a)}var A=class a{constructor(){this._toDispose=new Set;this._isDisposed=!1;Xq(this)}static{this.DISABLE_DISPOSED_WARNING=!1}dispose(){this._isDisposed||(Jq(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ue(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i||i===x.None)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return Yq(i,this),this._isDisposed?a.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._toDispose.add(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.delete(i)&&Yq(i,null)}assertNotDisposed(){this._isDisposed&&pt(new ni("Object disposed"))}},x=class{constructor(){this._store=new A;Xq(this),Yq(this._store,this)}static{this.None=Object.freeze({dispose(){}})}dispose(){Jq(this),this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}},me=class{constructor(){this._isDisposed=!1;Xq(this)}get value(){return this._isDisposed?void 0:this._value}set value(i){this._isDisposed||i===this._value||(this._value?.dispose(),i&&Yq(i,this),this._value=i)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Jq(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i&&Yq(i,null),i}},_ut=class{constructor(i){this._disposable=new me;this._isDisposed=!1;this._disposable.value=i}get value(){return this._disposable.value}set value(i){this._isDisposed||i===this._disposable.value||(this._disposable.value=i)}dispose(){this._isDisposed=!0,this._disposable.dispose()}},NH=class{constructor(i){this._disposable=i;this._counter=1}acquire(){return this._counter++,this}release(){return--this._counter===0&&this._disposable.dispose(),this}},jw=class{constructor(){this.references=new Map}acquire(i,...e){let t=this.references.get(i);t||(t={counter:0,object:this.createReferencedObject(i,...e)},this.references.set(i,t));let{object:o}=t,n=_u(()=>{--t.counter===0&&(this.destroyReferencedObject(i,t.object),this.references.delete(i))});return t.counter++,{object:o,dispose:n}}},_be=class{constructor(i){this.referenceCollection=i}async acquire(i,...e){let t=this.referenceCollection.acquire(i,...e);try{return{object:await t.object,dispose:()=>t.dispose()}}catch(o){throw t.dispose(),o}}},Dut=class{constructor(i){this.object=i}dispose(){}};var Wt=class{constructor(i=new Map){this._isDisposed=!1;this._store=i,Xq(this)}dispose(){Jq(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{Ue(this._store.values())}finally{this._store.clear()}}has(i){return this._store.has(i)}get size(){return this._store.size}get(i){return this._store.get(i)}set(i,e,t=!1){this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that ha