HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-172-31-4-197 6.8.0-1036-aws #38~22.04.1-Ubuntu SMP Fri Aug 22 15:44:33 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/code/resources/app/out/vs/code/node/cliProcessMain.js
/*!--------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/var fo=function(t,e){return fo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,s){i.__proto__=s}||function(i,s){for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(i[r]=s[r])},fo(t,e)};export function __extends(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");fo(t,e);function i(){this.constructor=t}t.prototype=e===null?Object.create(e):(i.prototype=e.prototype,new i)}export var __assign=function(){return __assign=Object.assign||function(e){for(var i,s=1,r=arguments.length;s<r;s++){i=arguments[s];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},__assign.apply(this,arguments)};export function __rest(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(i[s[r]]=t[s[r]]);return i}export function __decorate(t,e,i,s){var r=arguments.length,n=r<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,i):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,i,s);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n}export function __param(t,e){return function(i,s){e(i,s,t)}}export function __esDecorate(t,e,i,s,r,n){function o(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=s.kind,l=a==="getter"?"get":a==="setter"?"set":"value",c=!e&&t?s.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,s.name):{}),f,d=!1,p=i.length-1;p>=0;p--){var m={};for(var w in s)m[w]=w==="access"?{}:s[w];for(var w in s.access)m.access[w]=s.access[w];m.addInitializer=function(b){if(d)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(b||null))};var y=(0,i[p])(a==="accessor"?{get:u.get,set:u.set}:u[l],m);if(a==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(f=o(y.get))&&(u.get=f),(f=o(y.set))&&(u.set=f),(f=o(y.init))&&r.unshift(f)}else(f=o(y))&&(a==="field"?r.unshift(f):u[l]=f)}c&&Object.defineProperty(c,s.name,u),d=!0}export function __runInitializers(t,e,i){for(var s=arguments.length>2,r=0;r<e.length;r++)i=s?e[r].call(t,i):e[r].call(t);return s?i:void 0}export function __propKey(t){return typeof t=="symbol"?t:"".concat(t)}export function __setFunctionName(t,e,i){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:i?"".concat(i," ",e):e})}export function __metadata(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}export function __awaiter(t,e,i,s){function r(n){return n instanceof i?n:new i(function(o){o(n)})}return new(i||(i=Promise))(function(n,o){function a(u){try{c(s.next(u))}catch(f){o(f)}}function l(u){try{c(s.throw(u))}catch(f){o(f)}}function c(u){u.done?n(u.value):r(u.value).then(a,l)}c((s=s.apply(t,e||[])).next())})}export function __generator(t,e){var i={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,r,n,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(u){return l([c,u])}}function l(c){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(s=1,r&&(n=c[0]&2?r.return:c[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,c[1])).done)return n;switch(r=0,n&&(c=[c[0]&2,n.value]),c[0]){case 0:case 1:n=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(n=i.trys,!(n=n.length>0&&n[n.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!n||c[1]>n[0]&&c[1]<n[3])){i.label=c[1];break}if(c[0]===6&&i.label<n[1]){i.label=n[1],n=c;break}if(n&&i.label<n[2]){i.label=n[2],i.ops.push(c);break}n[2]&&i.ops.pop(),i.trys.pop();continue}c=e.call(t,i)}catch(u){c=[6,u],r=0}finally{s=n=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}export var __createBinding=Object.create?function(t,e,i,s){s===void 0&&(s=i);var r=Object.getOwnPropertyDescriptor(e,i);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,s,r)}:function(t,e,i,s){s===void 0&&(s=i),t[s]=e[i]};export function __exportStar(t,e){for(var i in t)i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&__createBinding(e,t,i)}export function __values(t){var e=typeof Symbol=="function"&&Symbol.iterator,i=e&&t[e],s=0;if(i)return i.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}export function __read(t,e){var i=typeof Symbol=="function"&&t[Symbol.iterator];if(!i)return t;var s=i.call(t),r,n=[],o;try{for(;(e===void 0||e-- >0)&&!(r=s.next()).done;)n.push(r.value)}catch(a){o={error:a}}finally{try{r&&!r.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return n}export function __spread(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(__read(arguments[e]));return t}export function __spreadArrays(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;for(var s=Array(t),r=0,e=0;e<i;e++)for(var n=arguments[e],o=0,a=n.length;o<a;o++,r++)s[r]=n[o];return s}export function __spreadArray(t,e,i){if(i||arguments.length===2)for(var s=0,r=e.length,n;s<r;s++)(n||!(s in e))&&(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}export function __await(t){return this instanceof __await?(this.v=t,this):new __await(t)}export function __asyncGenerator(t,e,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=i.apply(t,e||[]),r,n=[];return r={},a("next"),a("throw"),a("return",o),r[Symbol.asyncIterator]=function(){return this},r;function o(p){return function(m){return Promise.resolve(m).then(p,f)}}function a(p,m){s[p]&&(r[p]=function(w){return new Promise(function(y,b){n.push([p,w,y,b])>1||l(p,w)})},m&&(r[p]=m(r[p])))}function l(p,m){try{c(s[p](m))}catch(w){d(n[0][3],w)}}function c(p){p.value instanceof __await?Promise.resolve(p.value.v).then(u,f):d(n[0][2],p)}function u(p){l("next",p)}function f(p){l("throw",p)}function d(p,m){p(m),n.shift(),n.length&&l(n[0][0],n[0][1])}}export function __asyncDelegator(t){var e,i;return e={},s("next"),s("throw",function(r){throw r}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(r,n){e[r]=t[r]?function(o){return(i=!i)?{value:__await(t[r](o)),done:!1}:n?n(o):o}:n}}export function __asyncValues(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],i;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i);function s(n){i[n]=t[n]&&function(o){return new Promise(function(a,l){o=t[n](o),r(a,l,o.done,o.value)})}}function r(n,o,a,l){Promise.resolve(l).then(function(c){n({value:c,done:a})},o)}}export function __makeTemplateObject(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var fd=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};export function __importStar(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var i in t)i!=="default"&&Object.prototype.hasOwnProperty.call(t,i)&&__createBinding(e,t,i);return fd(e,t),e}export function __importDefault(t){return t&&t.__esModule?t:{default:t}}export function __classPrivateFieldGet(t,e,i,s){if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(t):s?s.value:e.get(t)}export function __classPrivateFieldSet(t,e,i,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(t,i):r?r.value=i:e.set(t,i),i}export function __classPrivateFieldIn(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}export function __addDisposableResource(t,e,i){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var s,r;if(i){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],i&&(r=s)}if(typeof s!="function")throw new TypeError("Object not disposable.");r&&(s=function(){try{r.call(this)}catch(n){return Promise.reject(n)}}),t.stack.push({value:e,dispose:s,async:i})}else i&&t.stack.push({async:!0});return e}var dd=typeof SuppressedError=="function"?SuppressedError:function(t,e,i){var s=new Error(i);return s.name="SuppressedError",s.error=t,s.suppressed=e,s};export function __disposeResources(t){function e(s){t.error=t.hasError?new dd(s,t.error,"An error was suppressed during disposal."):s,t.hasError=!0}function i(){for(;t.stack.length;){var s=t.stack.pop();try{var r=s.dispose&&s.dispose.call(s.value);if(s.async)return Promise.resolve(r).then(i,function(n){return e(n),i()})}catch(n){e(n)}}if(t.hasError)throw t.error}return i()}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};var pd=Object.create,Jl=Object.defineProperty,gd=Object.getOwnPropertyDescriptor,Ql=Object.getOwnPropertyNames,md=Object.getPrototypeOf,wd=Object.prototype.hasOwnProperty,vd=(t,e)=>function(){return e||(0,t[Ql(t)[0]])((e={exports:{}}).exports,e),e.exports},yd=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Ql(e))!wd.call(t,r)&&r!==i&&Jl(t,r,{get:()=>e[r],enumerable:!(s=gd(e,r))||s.enumerable});return t},bd=(t,e,i)=>(i=t!=null?pd(md(t)):{},yd(e||!t||!t.__esModule?Jl(i,"default",{value:t,enumerable:!0}):i,t)),Ed=vd({"node_modules/minimist/index.js"(t,e){"use strict";function i(n,o){var a=n;o.slice(0,-1).forEach(function(c){a=a[c]||{}});var l=o[o.length-1];return l in a}function s(n){return typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function r(n,o){return o==="constructor"&&typeof n[o]=="function"||o==="__proto__"}e.exports=function(n,o){o||(o={});var a={bools:{},strings:{},unknownFn:null};typeof o.unknown=="function"&&(a.unknownFn=o.unknown),typeof o.boolean=="boolean"&&o.boolean?a.allBools=!0:[].concat(o.boolean).filter(Boolean).forEach(function($){a.bools[$]=!0});var l={};function c($){return l[$].some(function(j){return a.bools[j]})}Object.keys(o.alias||{}).forEach(function($){l[$]=[].concat(o.alias[$]),l[$].forEach(function(j){l[j]=[$].concat(l[$].filter(function(ve){return j!==ve}))})}),[].concat(o.string).filter(Boolean).forEach(function($){a.strings[$]=!0,l[$]&&[].concat(l[$]).forEach(function(j){a.strings[j]=!0})});var u=o.default||{},f={_:[]};function d($,j){return a.allBools&&/^--[^=]+$/.test(j)||a.strings[$]||a.bools[$]||l[$]}function p($,j,ve){for(var B=$,st=0;st<j.length-1;st++){var A=j[st];if(r(B,A))return;B[A]===void 0&&(B[A]={}),(B[A]===Object.prototype||B[A]===Number.prototype||B[A]===String.prototype)&&(B[A]={}),B[A]===Array.prototype&&(B[A]=[]),B=B[A]}var P=j[j.length-1];r(B,P)||((B===Object.prototype||B===Number.prototype||B===String.prototype)&&(B={}),B===Array.prototype&&(B=[]),B[P]===void 0||a.bools[P]||typeof B[P]=="boolean"?B[P]=ve:Array.isArray(B[P])?B[P].push(ve):B[P]=[B[P],ve])}function m($,j,ve){if(!(ve&&a.unknownFn&&!d($,ve)&&a.unknownFn(ve)===!1)){var B=!a.strings[$]&&s(j)?Number(j):j;p(f,$.split("."),B),(l[$]||[]).forEach(function(st){p(f,st.split("."),B)})}}Object.keys(a.bools).forEach(function($){m($,u[$]===void 0?!1:u[$])});var w=[];n.indexOf("--")!==-1&&(w=n.slice(n.indexOf("--")+1),n=n.slice(0,n.indexOf("--")));for(var y=0;y<n.length;y++){var b=n[y],S,I;if(/^--.+=/.test(b)){var M=b.match(/^--([^=]+)=([\s\S]*)$/);S=M[1];var te=M[2];a.bools[S]&&(te=te!=="false"),m(S,te,b)}else if(/^--no-.+/.test(b))S=b.match(/^--no-(.+)/)[1],m(S,!1,b);else if(/^--.+/.test(b))S=b.match(/^--(.+)/)[1],I=n[y+1],I!==void 0&&!/^(-|--)[^-]/.test(I)&&!a.bools[S]&&!a.allBools&&(!l[S]||!c(S))?(m(S,I,b),y+=1):/^(true|false)$/.test(I)?(m(S,I==="true",b),y+=1):m(S,a.strings[S]?"":!0,b);else if(/^-[^-]+/.test(b)){for(var we=b.slice(1,-1).split(""),D=!1,O=0;O<we.length;O++){if(I=b.slice(O+2),I==="-"){m(we[O],I,b);continue}if(/[A-Za-z]/.test(we[O])&&I[0]==="="){m(we[O],I.slice(1),b),D=!0;break}if(/[A-Za-z]/.test(we[O])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(I)){m(we[O],I,b),D=!0;break}if(we[O+1]&&we[O+1].match(/\W/)){m(we[O],b.slice(O+2),b),D=!0;break}else m(we[O],a.strings[we[O]]?"":!0,b)}S=b.slice(-1)[0],!D&&S!=="-"&&(n[y+1]&&!/^(-|--)[^-]/.test(n[y+1])&&!a.bools[S]&&(!l[S]||!c(S))?(m(S,n[y+1],b),y+=1):n[y+1]&&/^(true|false)$/.test(n[y+1])?(m(S,n[y+1]==="true",b),y+=1):m(S,a.strings[S]?"":!0,b))}else if((!a.unknownFn||a.unknownFn(b)!==!1)&&f._.push(a.strings._||!s(b)?b:Number(b)),o.stopEarly){f._.push.apply(f._,n.slice(y+1));break}}return Object.keys(u).forEach(function($){i(f,$.split("."))||(p(f,$.split("."),u[$]),(l[$]||[]).forEach(function(j){p(f,j.split("."),u[$])}))}),o["--"]?f["--"]=w.slice():w.forEach(function($){f._.push($)}),f}}});import*as xd from"fs";import{hostname as Sd,release as $d}from"os";var Zl;function Pd(t,e){const i=Object.create(null);for(const s of t){const r=e(s);let n=i[r];n||(n=i[r]=[]),n.push(s)}return i}var r7=class{static{Zl=Symbol.toStringTag}constructor(t,e){this.b=e,this.a=new Map,this[Zl]="SetWithKey";for(const i of t)this.add(i)}get size(){return this.a.size}add(t){const e=this.b(t);return this.a.set(e,t),this}delete(t){return this.a.delete(this.b(t))}has(t){return this.a.has(this.b(t))}*entries(){for(const t of this.a.values())yield[t,t]}keys(){return this.values()}*values(){for(const t of this.a.values())yield t}clear(){this.a.clear()}forEach(t,e){this.a.forEach(i=>t.call(e,i,i,this))}[Symbol.iterator](){return this.values()}},kd=class{constructor(){this.b=[],this.a=function(t){setTimeout(()=>{throw t.stack?es.isErrorNoTelemetry(t)?new es(t.message+`

`+t.stack):new Error(t.message+`

`+t.stack):t},0)}}addListener(t){return this.b.push(t),()=>{this.d(t)}}c(t){this.b.forEach(e=>{e(t)})}d(t){this.b.splice(this.b.indexOf(t),1)}setUnexpectedErrorHandler(t){this.a=t}getUnexpectedErrorHandler(){return this.a}onUnexpectedError(t){this.a(t),this.c(t)}onUnexpectedExternalError(t){this.a(t)}},Xl=new kd;function Id(t){Xl.setUnexpectedErrorHandler(t)}function Dd(t){if(!t||typeof t!="object")return!1;const e=t;return e.code==="EPIPE"&&e.syscall?.toUpperCase()==="WRITE"}function At(t){Di(t)||Xl.onUnexpectedError(t)}var Ur="Canceled";function Di(t){return t instanceof Te?!0:t instanceof Error&&t.name===Ur&&t.message===Ur}var Te=class extends Error{constructor(){super(Ur),this.name=this.message}},n7=class Yn extends Error{static{this.a="PendingMigrationError"}static is(e){return e instanceof Yn||e instanceof Error&&e.name===Yn.a}constructor(e){super(e),this.name=Yn.a}};function Kl(){const t=new Error(Ur);return t.name=t.message,t}function Ad(t){return t?new Error(`Illegal argument: ${t}`):new Error("Illegal argument")}function Yl(t){return t?new Error(`Illegal state: ${t}`):new Error("Illegal state")}function G(t){return t?t.message?t.message:t.stack?t.stack.split(`
`)[0]:String(t):"Error"}var es=class Ul extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Ul)return e;const i=new Ul;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Rd=class T1 extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,T1.prototype)}};function ec(t,e){const i=this;let s=!1,r;return function(){if(s)return r;if(s=!0,e)try{r=t.apply(i,arguments)}finally{e()}else r=t.apply(i,arguments);return r}}function Ld(t,e,i=0,s=t.length){let r=i,n=s;for(;r<n;){const o=Math.floor((r+n)/2);e(t[o])?r=o+1:n=o}return r-1}var o7=class U1{static{this.assertInvariants=!1}constructor(e){this.e=e,this.c=0}findLastMonotonous(e){if(U1.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 i=Ld(this.e,e,this.c);return this.c=i+1,i===-1?void 0:this.e[i]}};function ts(t,e,i=(s,r)=>s===r){if(t===e)return!0;if(!t||!e||t.length!==e.length)return!1;for(let s=0,r=t.length;s<r;s++)if(!i(t[s],e[s]))return!1;return!0}function is(t){return t.filter(e=>!!e)}function tc(t){return Array.isArray(t)&&t.length>0}function Yt(t,e=i=>i){const i=new Set;return t.filter(s=>{const r=e(s);return i.has(r)?!1:(i.add(r),!0)})}function ic(t,e){return t.push(e),()=>Od(t,e)}function Od(t,e){const i=t.indexOf(e);if(i>-1)return t.splice(i,1),e}function sc(t,e){let i;if(typeof e=="number"){let s=e;i=()=>{const r=Math.sin(s++)*179426549;return r-Math.floor(r)}}else i=Math.random;for(let s=t.length-1;s>0;s-=1){const r=Math.floor(i()*(s+1)),n=t[s];t[s]=t[r],t[r]=n}}var po;(function(t){function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(po||(po={}));function Nd(t,e){return(i,s)=>e(t(i),t(s))}var Cd=(t,e)=>t-e,a7=class eo{static{this.empty=new eo(e=>{})}constructor(e){this.iterate=e}forEach(e){this.iterate(i=>(e(i),!0))}toArray(){const e=[];return this.iterate(i=>(e.push(i),!0)),e}filter(e){return new eo(i=>this.iterate(s=>e(s)?i(s):!0))}map(e){return new eo(i=>this.iterate(s=>i(e(s))))}some(e){let i=!1;return this.iterate(s=>(i=e(s),!i)),i}findFirst(e){let i;return this.iterate(s=>e(s)?(i=s,!1):!0),i}findLast(e){let i;return this.iterate(s=>(e(s)&&(i=s),!0)),i}findLastMaxBy(e){let i,s=!0;return this.iterate(r=>((s||po.isGreaterThan(e(r,i)))&&(s=!1,i=r),!0)),i}},rc,nc,oc,Fd=class{constructor(t,e){this.uri=t,this.value=e}};function Td(t){return Array.isArray(t)}var Je=class $r{static{this.c=e=>e.toString()}constructor(e,i){if(this[rc]="ResourceMap",e instanceof $r)this.d=new Map(e.d),this.e=i??$r.c;else if(Td(e)){this.d=new Map,this.e=i??$r.c;for(const[s,r]of e)this.set(s,r)}else this.d=new Map,this.e=e??$r.c}set(e,i){return this.d.set(this.e(e),new Fd(e,i)),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,i){typeof i<"u"&&(e=e.bind(i));for(const[s,r]of this.d)e(r.value,r.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]}*[(rc=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.d)yield[e.uri,e.value]}},go=class{constructor(t,e){this[nc]="ResourceSet",!t||typeof t=="function"?this.c=new Je(t):(this.c=new Je(e),t.forEach(this.add,this))}get size(){return this.c.size}add(t){return this.c.set(t,t),this}clear(){this.c.clear()}delete(t){return this.c.delete(t)}forEach(t,e){this.c.forEach((i,s)=>t.call(e,s,s,this))}has(t){return this.c.has(t)}entries(){return this.c.entries()}keys(){return this.c.keys()}values(){return this.c.keys()}[(nc=Symbol.toStringTag,Symbol.iterator)](){return this.keys()}},ac;(function(t){t[t.None=0]="None",t[t.AsOld=1]="AsOld",t[t.AsNew=2]="AsNew"})(ac||(ac={}));var Ud=class{constructor(){this[oc]="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(t){return this.c.has(t)}get(t,e=0){const i=this.c.get(t);if(i)return e!==0&&this.n(i,e),i.value}set(t,e,i=0){let s=this.c.get(t);if(s)s.value=e,i!==0&&this.n(s,i);else{switch(s={key:t,value:e,next:void 0,previous:void 0},i){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(t,s),this.f++}return this}delete(t){return!!this.remove(t)}remove(t){const e=this.c.get(t);if(e)return this.c.delete(t),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 t=this.d;return this.c.delete(t.key),this.m(t),this.f--,t.value}forEach(t,e){const i=this.g;let s=this.d;for(;s;){if(e?t.bind(e)(s.value,s.key,this):t(s.value,s.key,this),this.g!==i)throw new Error("LinkedMap got modified during iteration.");s=s.next}}keys(){const t=this,e=this.g;let i=this.d;const s={[Symbol.iterator](){return s},next(){if(t.g!==e)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.key,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}values(){const t=this,e=this.g;let i=this.d;const s={[Symbol.iterator](){return s},next(){if(t.g!==e)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:i.value,done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}entries(){const t=this,e=this.g;let i=this.d;const s={[Symbol.iterator](){return s},next(){if(t.g!==e)throw new Error("LinkedMap got modified during iteration.");if(i){const r={value:[i.key,i.value],done:!1};return i=i.next,r}else return{value:void 0,done:!0}}};return s}[(oc=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}h(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this.d,i=this.size;for(;e&&i>t;)this.c.delete(e.key),e=e.next,i--;this.d=e,this.f=i,e&&(e.previous=void 0),this.g++}j(t){if(t>=this.size)return;if(t===0){this.clear();return}let e=this.e,i=this.size;for(;e&&i>t;)this.c.delete(e.key),e=e.previous,i--;this.e=e,this.f=i,e&&(e.next=void 0),this.g++}k(t){if(!this.d&&!this.e)this.e=t;else if(this.d)t.next=this.d,this.d.previous=t;else throw new Error("Invalid list");this.d=t,this.g++}l(t){if(!this.d&&!this.e)this.d=t;else if(this.e)t.previous=this.e,this.e.next=t;else throw new Error("Invalid list");this.e=t,this.g++}m(t){if(t===this.d&&t===this.e)this.d=void 0,this.e=void 0;else if(t===this.d){if(!t.next)throw new Error("Invalid list");t.next.previous=void 0,this.d=t.next}else if(t===this.e){if(!t.previous)throw new Error("Invalid list");t.previous.next=void 0,this.e=t.previous}else{const e=t.next,i=t.previous;if(!e||!i)throw new Error("Invalid list");e.previous=i,i.next=e}t.next=void 0,t.previous=void 0,this.g++}n(t,e){if(!this.d||!this.e)throw new Error("Invalid list");if(!(e!==1&&e!==2)){if(e===1){if(t===this.d)return;const i=t.next,s=t.previous;t===this.e?(s.next=void 0,this.e=s):(i.previous=s,s.next=i),t.previous=void 0,t.next=this.d,this.d.previous=t,this.d=t,this.g++}else if(e===2){if(t===this.e)return;const i=t.next,s=t.previous;t===this.d?(i.previous=void 0,this.d=i):(i.previous=s,s.next=i),t.next=void 0,t.previous=this.e,this.e.next=t,this.e=t,this.g++}}}toJSON(){const t=[];return this.forEach((e,i)=>{t.push([i,e])}),t}fromJSON(t){this.clear();for(const[e,i]of t)this.set(e,i)}},Md=class extends Ud{constructor(t,e=1){super(),this.o=t,this.p=Math.min(Math.max(0,e),1)}get limit(){return this.o}set limit(t){this.o=t,this.q()}get ratio(){return this.p}set ratio(t){this.p=Math.min(Math.max(0,t),1),this.q()}get(t,e=2){return super.get(t,e)}peek(t){return super.get(t,0)}set(t,e){return super.set(t,e,2),this}q(){this.size>this.o&&this.r(Math.round(this.o*this.p))}},Mr=class extends Md{constructor(t,e=1){super(t,e)}r(t){this.h(t)}set(t,e){return super.set(t,e),this.q(),this}},jd=class{constructor(){this.c=new Map}add(t,e){let i=this.c.get(t);i||(i=new Set,this.c.set(t,i)),i.add(e)}delete(t,e){const i=this.c.get(t);i&&(i.delete(e),i.size===0&&this.c.delete(t))}forEach(t,e){const i=this.c.get(t);i&&i.forEach(e)}get(t){const e=this.c.get(t);return e||new Set}};function mo(t,e){if(!t)throw new Error(e?`Assertion failed (${e})`:"Assertion Failed")}function wo(t,e="unexpected state"){if(!t)throw typeof e=="string"?new Rd(`Assertion Failed: ${e}`):e}function xe(t){return typeof t=="string"}function Oe(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&!(t instanceof RegExp)&&!(t instanceof Date)}function _d(t){const e=Object.getPrototypeOf(Uint8Array);return typeof t=="object"&&t instanceof e}function lc(t){return typeof t=="number"&&!isNaN(t)}function Vd(t){return!!t&&typeof t[Symbol.iterator]=="function"}function Et(t){return t===!0||t===!1}function xt(t){return typeof t>"u"}function cc(t){return!Qe(t)}function Qe(t){return xt(t)||t===null}function uc(t){return wo(t!=null,"Argument is `undefined` or `null`."),t}var zd=Object.prototype.hasOwnProperty;function hc(t){if(!Oe(t))return!1;for(const e in t)if(zd.call(t,e))return!1;return!0}function Bd(t){return typeof t=="function"}var Ai;(function(t){function e(D){return!!D&&typeof D=="object"&&typeof D[Symbol.iterator]=="function"}t.is=e;const i=Object.freeze([]);function s(){return i}t.empty=s;function*r(D){yield D}t.single=r;function n(D){return e(D)?D:r(D)}t.wrap=n;function o(D){return D||i}t.from=o;function*a(D){for(let O=D.length-1;O>=0;O--)yield D[O]}t.reverse=a;function l(D){return!D||D[Symbol.iterator]().next().done===!0}t.isEmpty=l;function c(D){return D[Symbol.iterator]().next().value}t.first=c;function u(D,O){let $=0;for(const j of D)if(O(j,$++))return!0;return!1}t.some=u;function f(D,O){let $=0;for(const j of D)if(!O(j,$++))return!1;return!0}t.every=f;function d(D,O){for(const $ of D)if(O($))return $}t.find=d;function*p(D,O){for(const $ of D)O($)&&(yield $)}t.filter=p;function*m(D,O){let $=0;for(const j of D)yield O(j,$++)}t.map=m;function*w(D,O){let $=0;for(const j of D)yield*O(j,$++)}t.flatMap=w;function*y(...D){for(const O of D)Vd(O)?yield*O:yield O}t.concat=y;function b(D,O,$){let j=$;for(const ve of D)j=O(j,ve);return j}t.reduce=b;function S(D){let O=0;for(const $ of D)O++;return O}t.length=S;function*I(D,O,$=D.length){for(O<-D.length&&(O=0),O<0&&(O+=D.length),$<0?$+=D.length:$>D.length&&($=D.length);O<$;O++)yield D[O]}t.slice=I;function M(D,O=Number.POSITIVE_INFINITY){const $=[];if(O===0)return[$,D];const j=D[Symbol.iterator]();for(let ve=0;ve<O;ve++){const B=j.next();if(B.done)return[$,t.empty()];$.push(B.value)}return[$,{[Symbol.iterator](){return j}}]}t.consume=M;async function te(D){const O=[];for await(const $ of D)O.push($);return O}t.asyncToArray=te;async function we(D){let O=[];for await(const $ of D)O=O.concat($);return O}t.asyncToArrayFlat=we})(Ai||(Ai={}));var qd=!1,ss=null,l7=class M1{constructor(){this.b=new Map}static{this.a=0}c(e){let i=this.b.get(e);return i||(i={parent:null,source:null,isSingleton:!1,value:e,idx:M1.a++},this.b.set(e,i)),i}trackDisposable(e){const i=this.c(e);i.source||(i.source=new Error().stack)}setParent(e,i){const s=this.c(e);s.parent=i}markAsDisposed(e){this.b.delete(e)}markAsSingleton(e){this.c(e).isSingleton=!0}f(e,i){const s=i.get(e);if(s)return s;const r=e.parent?this.f(this.c(e.parent),i):e;return i.set(e,r),r}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,i){let s;if(i)s=i;else{const l=new Map,c=[...this.b.values()].filter(f=>f.source!==null&&!this.f(f,l).isSingleton);if(c.length===0)return;const u=new Set(c.map(f=>f.value));if(s=c.filter(f=>!(f.parent&&u.has(f.parent))),s.length===0)throw new Error("There are cyclic diposable chains!")}if(!s)return;function r(l){function c(f,d){for(;f.length>0&&d.some(p=>typeof p=="string"?p===f[0]:f[0].match(p));)f.shift()}const u=l.source.split(`
`).map(f=>f.trim().replace("at ","")).filter(f=>f!=="");return c(u,["Error",/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),u.reverse()}const n=new jd;for(const l of s){const c=r(l);for(let u=0;u<=c.length;u++)n.add(c.slice(0,u).join(`
`),l)}s.sort(Nd(l=>l.idx,Cd));let o="",a=0;for(const l of s.slice(0,e)){a++;const c=r(l),u=[];for(let f=0;f<c.length;f++){let d=c[f];d=`(shared with ${n.get(c.slice(0,f+1).join(`
`)).size}/${s.length} leaks) at ${d}`;const m=n.get(c.slice(0,f).join(`
`)),w=Pd([...m].map(y=>r(y)[f]),y=>y);delete w[c[f]];for(const[y,b]of Object.entries(w))u.unshift(`    - stacktraces of ${b.length} other leaks continue with ${y}`);u.unshift(d)}o+=`


==================== Leaking disposable ${a}/${s.length}: ${l.value.constructor.name} ====================
${u.join(`
`)}
============================================================

`}return s.length>e&&(o+=`


... and ${s.length-e} more leaking disposables

`),{leaks:s,details:o}}};function Wd(t){ss=t}if(qd){const t="__is_disposable_tracked__";Wd(new class{trackDisposable(e){const i=new Error("Potentially leaked disposable").stack;setTimeout(()=>{e[t]||console.log(i)},3e3)}setParent(e,i){if(e&&e!==J.None)try{e[t]=!0}catch{}}markAsDisposed(e){if(e&&e!==J.None)try{e[t]=!0}catch{}}markAsSingleton(e){}})}function Us(t){return ss?.trackDisposable(t),t}function Ms(t){ss?.markAsDisposed(t)}function js(t,e){ss?.setParent(t,e)}function Hd(t,e){if(ss)for(const i of t)ss.setParent(i,e)}function fc(t){return typeof t=="object"&&t!==null&&typeof t.dispose=="function"&&t.dispose.length===0}function St(t){if(Ai.is(t)){const e=[];for(const i of t)if(i)try{i.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(t)?[]:t}else if(t)return t.dispose(),t}function dc(...t){const e=Se(()=>St(t));return Hd(t,e),e}function Se(t){const e=Us({dispose:ec(()=>{Ms(e),t()})});return e}var ot=class j1{static{this.DISABLE_DISPOSED_WARNING=!1}constructor(){this.f=new Set,this.g=!1,Us(this)}dispose(){this.g||(Ms(this),this.g=!0,this.clear())}get isDisposed(){return this.g}clear(){if(this.f.size!==0)try{St(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 js(e,this),this.g?j1.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),js(e,null))}},J=class{static{this.None=Object.freeze({dispose(){}})}constructor(){this.q=new ot,Us(this),js(this.q,this)}dispose(){Ms(this),this.q.dispose()}B(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this.q.add(t)}},_s=class{constructor(){this.b=!1,Us(this)}get value(){return this.b?void 0:this.a}set value(t){this.b||t===this.a||(this.a?.dispose(),t&&js(t,this),this.a=t)}clear(){this.value=void 0}dispose(){this.b=!0,Ms(this),this.a?.dispose(),this.a=void 0}clearAndLeak(){const t=this.a;return this.a=void 0,t&&js(t,null),t}},vo=class{constructor(){this.a=new Map,this.b=!1,Us(this)}dispose(){Ms(this),this.b=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this.a.size)try{St(this.a.values())}finally{this.a.clear()}}has(t){return this.a.has(t)}get size(){return this.a.size}get(t){return this.a.get(t)}set(t,e,i=!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),i||this.a.get(t)?.dispose(),this.a.set(t,e)}deleteAndDispose(t){this.a.get(t)?.dispose(),this.a.delete(t)}deleteAndLeak(t){const e=this.a.get(t);return this.a.delete(t),e}keys(){return this.a.keys()}values(){return this.a.values()}[Symbol.iterator](){return this.a[Symbol.iterator]()}},$e=class to{static{this.Undefined=new to(void 0)}constructor(e){this.element=e,this.next=to.Undefined,this.prev=to.Undefined}},pc=class{constructor(){this.a=$e.Undefined,this.b=$e.Undefined,this.c=0}get size(){return this.c}isEmpty(){return this.a===$e.Undefined}clear(){let t=this.a;for(;t!==$e.Undefined;){const e=t.next;t.prev=$e.Undefined,t.next=$e.Undefined,t=e}this.a=$e.Undefined,this.b=$e.Undefined,this.c=0}unshift(t){return this.d(t,!1)}push(t){return this.d(t,!0)}d(t,e){const i=new $e(t);if(this.a===$e.Undefined)this.a=i,this.b=i;else if(e){const r=this.b;this.b=i,i.prev=r,r.next=i}else{const r=this.a;this.a=i,i.next=r,r.prev=i}this.c+=1;let s=!1;return()=>{s||(s=!0,this.e(i))}}shift(){if(this.a!==$e.Undefined){const t=this.a.element;return this.e(this.a),t}}pop(){if(this.b!==$e.Undefined){const t=this.b.element;return this.e(this.b),t}}e(t){if(t.prev!==$e.Undefined&&t.next!==$e.Undefined){const e=t.prev;e.next=t.next,t.next.prev=e}else t.prev===$e.Undefined&&t.next===$e.Undefined?(this.a=$e.Undefined,this.b=$e.Undefined):t.next===$e.Undefined?(this.b=this.b.prev,this.b.next=$e.Undefined):t.prev===$e.Undefined&&(this.a=this.a.next,this.a.prev=$e.Undefined);this.c-=1}*[Symbol.iterator](){let t=this.a;for(;t!==$e.Undefined;)yield t.element,t=t.next}},Gd=globalThis.performance.now.bind(globalThis.performance),jr=class _1{static create(e){return new _1(e)}constructor(e){this.c=e===!1?Date.now:Gd,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}},gc=!1,Jd=!1,oe;(function(t){t.None=()=>J.None;function e(A){if(Jd){const{onDidAddListener:P}=A,L=yo.create();let R=0;A.onDidAddListener=()=>{++R===2&&(console.warn("snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here"),L.print()),P?.()}}}function i(A,P){return p(A,()=>{},0,void 0,!0,void 0,P)}t.defer=i;function s(A){return(P,L=null,R)=>{let T=!1,H;return H=A(Y=>{if(!T)return H?H.dispose():T=!0,P.call(L,Y)},null,R),T&&H.dispose(),H}}t.once=s;function r(A,P){return t.once(t.filter(A,P))}t.onceIf=r;function n(A,P,L){return f((R,T=null,H)=>A(Y=>R.call(T,P(Y)),null,H),L)}t.map=n;function o(A,P,L){return f((R,T=null,H)=>A(Y=>{P(Y),R.call(T,Y)},null,H),L)}t.forEach=o;function a(A,P,L){return f((R,T=null,H)=>A(Y=>P(Y)&&R.call(T,Y),null,H),L)}t.filter=a;function l(A){return A}t.signal=l;function c(...A){return(P,L=null,R)=>{const T=dc(...A.map(H=>H(Y=>P.call(L,Y))));return d(T,R)}}t.any=c;function u(A,P,L,R){let T=L;return n(A,H=>(T=P(T,H),T),R)}t.reduce=u;function f(A,P){let L;const R={onWillAddFirstListener(){L=A(T.fire,T)},onDidRemoveLastListener(){L?.dispose()}};P||e(R);const T=new N(R);return P?.add(T),T.event}function d(A,P){return P instanceof Array?P.push(A):P&&P.add(A),A}function p(A,P,L=100,R=!1,T=!1,H,Y){let Ee,Ae,_t,Pi=0,Xt;const Ki={leakWarningThreshold:H,onWillAddFirstListener(){Ee=A(Lr=>{Pi++,Ae=P(Ae,Lr),R&&!_t&&(Vt.fire(Ae),Ae=void 0),Xt=()=>{const Or=Ae;Ae=void 0,_t=void 0,(!R||Pi>1)&&Vt.fire(Or),Pi=0},typeof L=="number"?(_t&&clearTimeout(_t),_t=setTimeout(Xt,L)):_t===void 0&&(_t=null,queueMicrotask(Xt))})},onWillRemoveListener(){T&&Pi>0&&Xt?.()},onDidRemoveLastListener(){Xt=void 0,Ee.dispose()}};Y||e(Ki);const Vt=new N(Ki);return Y?.add(Vt),Vt.event}t.debounce=p;function m(A,P=0,L){return t.debounce(A,(R,T)=>R?(R.push(T),R):[T],P,void 0,!0,void 0,L)}t.accumulate=m;function w(A,P=(R,T)=>R===T,L){let R=!0,T;return a(A,H=>{const Y=R||!P(H,T);return R=!1,T=H,Y},L)}t.latch=w;function y(A,P,L){return[t.filter(A,P,L),t.filter(A,R=>!P(R),L)]}t.split=y;function b(A,P=!1,L=[],R){let T=L.slice(),H=A(Ae=>{T?T.push(Ae):Ee.fire(Ae)});R&&R.add(H);const Y=()=>{T?.forEach(Ae=>Ee.fire(Ae)),T=null},Ee=new N({onWillAddFirstListener(){H||(H=A(Ae=>Ee.fire(Ae)),R&&R.add(H))},onDidAddFirstListener(){T&&(P?setTimeout(Y):Y())},onDidRemoveLastListener(){H&&H.dispose(),H=null}});return R&&R.add(Ee),Ee.event}t.buffer=b;function S(A,P){return(R,T,H)=>{const Y=P(new M);return A(function(Ee){const Ae=Y.evaluate(Ee);Ae!==I&&R.call(T,Ae)},void 0,H)}}t.chain=S;const I=Symbol("HaltChainable");class M{constructor(){this.f=[]}map(P){return this.f.push(P),this}forEach(P){return this.f.push(L=>(P(L),L)),this}filter(P){return this.f.push(L=>P(L)?L:I),this}reduce(P,L){let R=L;return this.f.push(T=>(R=P(R,T),R)),this}latch(P=(L,R)=>L===R){let L=!0,R;return this.f.push(T=>{const H=L||!P(T,R);return L=!1,R=T,H?T:I}),this}evaluate(P){for(const L of this.f)if(P=L(P),P===I)break;return P}}function te(A,P,L=R=>R){const R=(...Ee)=>Y.fire(L(...Ee)),T=()=>A.on(P,R),H=()=>A.removeListener(P,R),Y=new N({onWillAddFirstListener:T,onDidRemoveLastListener:H});return Y.event}t.fromNodeEventEmitter=te;function we(A,P,L=R=>R){const R=(...Ee)=>Y.fire(L(...Ee)),T=()=>A.addEventListener(P,R),H=()=>A.removeEventListener(P,R),Y=new N({onWillAddFirstListener:T,onDidRemoveLastListener:H});return Y.event}t.fromDOMEventEmitter=we;function D(A,P){let L;const R=new Promise((T,H)=>{const Y=s(A)(T,null,P);L=()=>Y.dispose()});return R.cancel=L,R}t.toPromise=D;function O(A){const P=new N;return A.then(L=>{P.fire(L)},()=>{P.fire(void 0)}).finally(()=>{P.dispose()}),P.event}t.fromPromise=O;function $(A,P){return A(L=>P.fire(L))}t.forward=$;function j(A,P,L){return P(L),A(R=>P(R))}t.runAndSubscribe=j;class ve{constructor(P,L){this._observable=P,this.f=0,this.g=!1;const R={onWillAddFirstListener:()=>{P.addObserver(this),this._observable.reportChanges()},onDidRemoveLastListener:()=>{P.removeObserver(this)}};L||e(R),this.emitter=new N(R),L&&L.add(this.emitter)}beginUpdate(P){this.f++}handlePossibleChange(P){}handleChange(P,L){this.g=!0}endUpdate(P){this.f--,this.f===0&&(this._observable.reportChanges(),this.g&&(this.g=!1,this.emitter.fire(this._observable.get())))}}function B(A,P){return new ve(A,P).emitter.event}t.fromObservable=B;function st(A){return(P,L,R)=>{let T=0,H=!1;const Y={beginUpdate(){T++},endUpdate(){T--,T===0&&(A.reportChanges(),H&&(H=!1,P.call(L)))},handlePossibleChange(){},handleChange(){H=!0}};A.addObserver(Y),A.reportChanges();const Ee={dispose(){A.removeObserver(Y)}};return R instanceof ot?R.add(Ee):Array.isArray(R)&&R.push(Ee),Ee}}t.fromObservableLight=st})(oe||(oe={}));var Qd=class Ml{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}_${Ml.f++}`,Ml.all.add(this)}start(e){this.g=new jr,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}}},mc=-1,Zd=class V1{static{this.f=1}constructor(e,i,s=(V1.f++).toString(16).padStart(3,"0")){this.j=e,this.threshold=i,this.name=s,this.h=0}dispose(){this.g?.clear()}check(e,i){const s=this.threshold;if(s<=0||i<s)return;this.g||(this.g=new Map);const r=this.g.get(e.value)||0;if(this.g.set(e.value,r+1),this.h-=1,this.h<=0){this.h=s*.5;const[n,o]=this.getMostFrequentStack(),a=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(a),console.warn(n);const l=new Xd(a,n);this.j(l)}return()=>{const n=this.g.get(e.value)||0;this.g.set(e.value,n-1)}}getMostFrequentStack(){if(!this.g)return;let e,i=0;for(const[s,r]of this.g)(!e||i<r)&&(e=[s,r],i=r);return e}},yo=class z1{static create(){const e=new Error;return new z1(e.stack??"")}constructor(e){this.value=e}print(){console.warn(this.value.split(`
`).slice(2).join(`
`))}},Xd=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},Kd=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},Yd=0,_r=class{constructor(t){this.value=t,this.id=Yd++}},e0=2,t0=(t,e)=>{if(t instanceof _r)e(t);else for(let i=0;i<t.length;i++){const s=t[i];s&&e(s)}},N=class{constructor(t){this.z=0,this.f=t,this.g=mc>0||this.f?.leakWarningThreshold?new Zd(t?.onListenerError??At,this.f?.leakWarningThreshold??mc):void 0,this.j=this.f?._profName?new Qd(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(gc){const t=this.u;queueMicrotask(()=>{t0(t,e=>e.stack?.print())})}this.u=void 0,this.z=0}this.f?.onDidRemoveLastListener?.(),this.g?.dispose()}}get event(){return this.q??=(t,e,i)=>{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 Kd(`${a}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this.f?.onListenerError||At)(c),J.None}if(this.m)return J.None;e&&(t=t.bind(e));const s=new _r(t);let r,n;this.g&&this.z>=Math.ceil(this.g.threshold*.2)&&(s.stack=yo.create(),r=this.g.check(s.stack,this.z+1)),gc&&(s.stack=n??yo.create()),this.u?this.u instanceof _r?(this.w??=new i0,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(()=>{r?.(),this.A(s)});return i instanceof ot?i.add(o):Array.isArray(i)&&i.push(o),o},this.q}A(t){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,i=e.indexOf(t);if(i===-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[i]=void 0;const s=this.w.current===this;if(this.z*e0<=e.length){let r=0;for(let n=0;n<e.length;n++)e[n]?e[r++]=e[n]:s&&r<this.w.end&&(this.w.end--,r<this.w.i&&this.w.i--);e.length=r}}B(t,e){if(!t)return;const i=this.f?.onListenerError||At;if(!i){t.value(e);return}try{t.value(e)}catch(s){i(s)}}C(t){const e=t.current.u;for(;t.i<t.end;)this.B(e[t.i++],t.value);t.reset()}fire(t){if(this.w?.current&&(this.C(this.w),this.j?.stop()),this.j?.start(this.z),this.u)if(this.u instanceof _r)this.B(this.u,t);else{const e=this.w;e.enqueue(this,t,this.u.length),this.C(e)}this.j?.stop()}hasListeners(){return this.z>0}},i0=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},bo=class extends N{get isPaused(){return this.h!==0}constructor(t){super(t),this.h=0,this.s=new pc,this.t=t?.merge}pause(){this.h++}resume(){if(this.h!==0&&--this.h===0)if(this.t){if(this.s.size>0){const t=Array.from(this.s);this.s.clear(),super.fire(this.t(t))}}else for(;!this.h&&this.s.size!==0;)super.fire(this.s.shift())}fire(t){this.z&&(this.h!==0?this.s.push(t):super.fire(t))}},s0=class{constructor(){this.f=!1,this.g=oe.None,this.h=J.None,this.j=new N({onDidAddFirstListener:()=>{this.f=!0,this.h=this.g(this.j.fire,this.j)},onDidRemoveLastListener:()=>{this.f=!1,this.h.dispose()}}),this.event=this.j.event}set input(t){this.g=t,this.f&&(this.h.dispose(),this.h=t(this.j.fire,this.j))}dispose(){this.h.dispose(),this.j.dispose()}},wc=Object.freeze(function(t,e){const i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),pe;(function(t){function e(i){return i===t.None||i===t.Cancelled||i instanceof Vr?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:oe.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:wc})})(pe||(pe={}));var Vr=class{constructor(){this.a=!1,this.b=null}cancel(){this.a||(this.a=!0,this.b&&(this.b.fire(void 0),this.dispose()))}get isCancellationRequested(){return this.a}get onCancellationRequested(){return this.a?wc:(this.b||(this.b=new N),this.b.event)}dispose(){this.b&&(this.b.dispose(),this.b=null)}},rs=class{constructor(t){this.f=void 0,this.g=void 0,this.g=t&&t.onCancellationRequested(this.cancel,this)}get token(){return this.f||(this.f=new Vr),this.f}cancel(){this.f?this.f instanceof Vr&&this.f.cancel():this.f=pe.Cancelled}dispose(t=!1){t&&this.cancel(),this.g?.dispose(),this.f?this.f instanceof Vr&&this.f.dispose():this.f=pe.None}};function r0(){return globalThis._VSCODE_NLS_MESSAGES}function vc(){return globalThis._VSCODE_NLS_LANGUAGE}var n0=vc()==="pseudo"||typeof document<"u"&&document.location&&typeof document.location.hash=="string"&&document.location.hash.indexOf("pseudo=true")>=0;function zr(t,e){let i;return e.length===0?i=t:i=t.replace(/\{(\d+)\}/g,(s,r)=>{const n=r[0],o=e[n];let a=s;return typeof o=="string"?a=o:(typeof o=="number"||typeof o=="boolean"||o===void 0||o===null)&&(a=String(o)),a}),n0&&(i="\uFF3B"+i.replace(/[aouei]/g,"$&$&")+"\uFF3D"),i}function g(t,e,...i){return zr(typeof t=="number"?yc(t,e):e,i)}function yc(t,e){const i=r0()?.[t];if(typeof i!="string"){if(typeof e=="string")return e;throw new Error(`!!! NLS MISSING: ${t} !!!`)}return i}function bc(t,e,...i){let s;typeof t=="number"?s=yc(t,e):s=e;const r=zr(s,i);return{value:r,original:e===s?r:zr(e,i)}}var ns="en",Vs=!1,zs=!1,Bs=!1,Ec=!1,xc=!1,Eo=!1,o0=!1,Sc=!1,a0=!1,l0=!1,Br=void 0,qr=ns,$c=ns,Pc=void 0,ei=void 0,ti=globalThis,vt=void 0;typeof ti.vscode<"u"&&typeof ti.vscode.process<"u"?vt=ti.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(vt=process);var kc=typeof vt?.versions?.electron=="string",c0=kc&&vt?.type==="renderer";if(typeof vt=="object"){Vs=vt.platform==="win32",zs=vt.platform==="darwin",Bs=vt.platform==="linux",Ec=Bs&&!!vt.env.SNAP&&!!vt.env.SNAP_REVISION,o0=kc,a0=!!vt.env.CI||!!vt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Br=ns,qr=ns;const t=vt.env.VSCODE_NLS_CONFIG;if(t)try{const e=JSON.parse(t);Br=e.userLocale,$c=e.osLocale,qr=e.resolvedLanguage||ns,Pc=e.languagePack?.translationsConfigFile}catch{}xc=!0}else typeof navigator=="object"&&!c0?(ei=navigator.userAgent,Vs=ei.indexOf("Windows")>=0,zs=ei.indexOf("Macintosh")>=0,Sc=(ei.indexOf("Macintosh")>=0||ei.indexOf("iPad")>=0||ei.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Bs=ei.indexOf("Linux")>=0,l0=ei?.indexOf("Mobi")>=0,Eo=!0,qr=vc()||ns,Br=navigator.language.toLowerCase(),$c=Br):console.error("Unable to resolve platform.");var Ic;(function(t){t[t.Web=0]="Web",t[t.Mac=1]="Mac",t[t.Linux=2]="Linux",t[t.Windows=3]="Windows"})(Ic||(Ic={}));function u0(t){switch(t){case 0:return"Web";case 1:return"Mac";case 2:return"Linux";case 3:return"Windows"}}var Wr=0;zs?Wr=1:Vs?Wr=3:Bs&&(Wr=2);var me=Vs,Rt=zs,at=Bs,h0=Ec,f0=xc,$t=Eo,d0=Eo&&typeof ti.importScripts=="function",p0=d0?ti.origin:void 0,Hr=Wr,Bt=ei,qt=qr,Dc;(function(t){function e(){return qt}t.value=e;function i(){return qt.length===2?qt==="en":qt.length>=3?qt[0]==="e"&&qt[1]==="n"&&qt[2]==="-":!1}t.isDefaultVariant=i;function s(){return qt==="en"}t.isDefault=s})(Dc||(Dc={}));var Ac=Pc,g0=typeof ti.postMessage=="function"&&!ti.importScripts,m0=(()=>{if(g0){const t=[];ti.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s<r;s++){const n=t[s];if(n.id===i.data.vscodeScheduleAsyncWork){t.splice(s,1),n.callback();return}}});let e=0;return i=>{const s=++e;t.push({id:s,callback:i}),ti.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})(),Rc;(function(t){t[t.Windows=1]="Windows",t[t.Macintosh=2]="Macintosh",t[t.Linux=3]="Linux"})(Rc||(Rc={}));var xo=zs||Sc?2:Vs?1:3,Lc=!!(Bt&&Bt.indexOf("Chrome")>=0),w0=!!(Bt&&Bt.indexOf("Firefox")>=0),v0=!!(!Lc&&Bt&&Bt.indexOf("Safari")>=0),y0=!!(Bt&&Bt.indexOf("Edg/")>=0),c7=!!(Bt&&Bt.indexOf("Android")>=0),Ri,So=globalThis.vscode;if(typeof So<"u"&&typeof So.process<"u"){const t=So.process;Ri={get platform(){return t.platform},get arch(){return t.arch},get env(){return t.env},cwd(){return t.cwd()}}}else typeof process<"u"&&typeof process?.versions?.node=="string"?Ri={get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd(){return process.env.VSCODE_CWD||process.cwd()}}:Ri={get platform(){return me?"win32":Rt?"darwin":"linux"},get arch(){},get env(){return{}},cwd(){return"/"}};var os=Ri.cwd,Lt=Ri.env,Oc=Ri.platform,Nc=Ri.arch,b0=65,E0=97,x0=90,S0=122,Li=46,_e=47,lt=92,ii=58,$0=63,Cc=class extends Error{constructor(t,e,i){let s;typeof e=="string"&&e.indexOf("not ")===0?(s="must not be",e=e.replace(/^not /,"")):s="must be";const r=t.indexOf(".")!==-1?"property":"argument";let n=`The "${t}" ${r} ${s} of type ${e}`;n+=`. Received type ${typeof i}`,super(n),this.code="ERR_INVALID_ARG_TYPE"}};function P0(t,e){if(t===null||typeof t!="object")throw new Cc(e,"Object",t)}function ke(t,e){if(typeof t!="string")throw new Cc(e,"string",t)}var ct=Oc==="win32";function Z(t){return t===_e||t===lt}function $o(t){return t===_e}function si(t){return t>=b0&&t<=x0||t>=E0&&t<=S0}function Gr(t,e,i,s){let r="",n=0,o=-1,a=0,l=0;for(let c=0;c<=t.length;++c){if(c<t.length)l=t.charCodeAt(c);else{if(s(l))break;l=_e}if(s(l)){if(!(o===c-1||a===1))if(a===2){if(r.length<2||n!==2||r.charCodeAt(r.length-1)!==Li||r.charCodeAt(r.length-2)!==Li){if(r.length>2){const u=r.lastIndexOf(i);u===-1?(r="",n=0):(r=r.slice(0,u),n=r.length-1-r.lastIndexOf(i)),o=c,a=0;continue}else if(r.length!==0){r="",n=0,o=c,a=0;continue}}e&&(r+=r.length>0?`${i}..`:"..",n=2)}else r.length>0?r+=`${i}${t.slice(o+1,c)}`:r=t.slice(o+1,c),n=c-o-1;o=c,a=0}else l===Li&&a!==-1?++a:a=-1}return r}function k0(t){return t?`${t[0]==="."?"":"."}${t}`:""}function Fc(t,e){P0(e,"pathObject");const i=e.dir||e.root,s=e.base||`${e.name||""}${k0(e.ext)}`;return i?i===e.root?`${i}${s}`:`${i}${t}${s}`:s}var Ne={resolve(...t){let e="",i="",s=!1;for(let r=t.length-1;r>=-1;r--){let n;if(r>=0){if(n=t[r],ke(n,`paths[${r}]`),n.length===0)continue}else e.length===0?n=os():(n=Lt[`=${e}`]||os(),(n===void 0||n.slice(0,2).toLowerCase()!==e.toLowerCase()&&n.charCodeAt(2)===lt)&&(n=`${e}\\`));const o=n.length;let a=0,l="",c=!1;const u=n.charCodeAt(0);if(o===1)Z(u)&&(a=1,c=!0);else if(Z(u))if(c=!0,Z(n.charCodeAt(1))){let f=2,d=f;for(;f<o&&!Z(n.charCodeAt(f));)f++;if(f<o&&f!==d){const p=n.slice(d,f);for(d=f;f<o&&Z(n.charCodeAt(f));)f++;if(f<o&&f!==d){for(d=f;f<o&&!Z(n.charCodeAt(f));)f++;(f===o||f!==d)&&(l=`\\\\${p}\\${n.slice(d,f)}`,a=f)}}}else a=1;else si(u)&&n.charCodeAt(1)===ii&&(l=n.slice(0,2),a=2,o>2&&Z(n.charCodeAt(2))&&(c=!0,a=3));if(l.length>0)if(e.length>0){if(l.toLowerCase()!==e.toLowerCase())continue}else e=l;if(s){if(e.length>0)break}else if(i=`${n.slice(a)}\\${i}`,s=c,c&&e.length>0)break}return i=Gr(i,!s,"\\",Z),s?`${e}\\${i}`:`${e}${i}`||"."},normalize(t){ke(t,"path");const e=t.length;if(e===0)return".";let i=0,s,r=!1;const n=t.charCodeAt(0);if(e===1)return $o(n)?"\\":t;if(Z(n))if(r=!0,Z(t.charCodeAt(1))){let a=2,l=a;for(;a<e&&!Z(t.charCodeAt(a));)a++;if(a<e&&a!==l){const c=t.slice(l,a);for(l=a;a<e&&Z(t.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!Z(t.charCodeAt(a));)a++;if(a===e)return`\\\\${c}\\${t.slice(l)}\\`;a!==l&&(s=`\\\\${c}\\${t.slice(l,a)}`,i=a)}}}else i=1;else si(n)&&t.charCodeAt(1)===ii&&(s=t.slice(0,2),i=2,e>2&&Z(t.charCodeAt(2))&&(r=!0,i=3));let o=i<e?Gr(t.slice(i),!r,"\\",Z):"";if(o.length===0&&!r&&(o="."),o.length>0&&Z(t.charCodeAt(e-1))&&(o+="\\"),!r&&s===void 0&&t.includes(":")){if(o.length>=2&&si(o.charCodeAt(0))&&o.charCodeAt(1)===ii)return`.\\${o}`;let a=t.indexOf(":");do if(a===e-1||Z(t.charCodeAt(a+1)))return`.\\${o}`;while((a=t.indexOf(":",a+1))!==-1)}return s===void 0?r?`\\${o}`:o:r?`${s}\\${o}`:`${s}${o}`},isAbsolute(t){ke(t,"path");const e=t.length;if(e===0)return!1;const i=t.charCodeAt(0);return Z(i)||e>2&&si(i)&&t.charCodeAt(1)===ii&&Z(t.charCodeAt(2))},join(...t){if(t.length===0)return".";let e,i;for(let n=0;n<t.length;++n){const o=t[n];ke(o,"path"),o.length>0&&(e===void 0?e=i=o:e+=`\\${o}`)}if(e===void 0)return".";let s=!0,r=0;if(typeof i=="string"&&Z(i.charCodeAt(0))){++r;const n=i.length;n>1&&Z(i.charCodeAt(1))&&(++r,n>2&&(Z(i.charCodeAt(2))?++r:s=!1))}if(s){for(;r<e.length&&Z(e.charCodeAt(r));)r++;r>=2&&(e=`\\${e.slice(r)}`)}return Ne.normalize(e)},relative(t,e){if(ke(t,"from"),ke(e,"to"),t===e)return"";const i=Ne.resolve(t),s=Ne.resolve(e);if(i===s||(t=i.toLowerCase(),e=s.toLowerCase(),t===e))return"";if(i.length!==t.length||s.length!==e.length){const m=i.split("\\"),w=s.split("\\");m[m.length-1]===""&&m.pop(),w[w.length-1]===""&&w.pop();const y=m.length,b=w.length,S=y<b?y:b;let I;for(I=0;I<S&&m[I].toLowerCase()===w[I].toLowerCase();I++);return I===0?s:I===S?b>S?w.slice(I).join("\\"):y>S?"..\\".repeat(y-1-I)+"..":"":"..\\".repeat(y-I)+w.slice(I).join("\\")}let r=0;for(;r<t.length&&t.charCodeAt(r)===lt;)r++;let n=t.length;for(;n-1>r&&t.charCodeAt(n-1)===lt;)n--;const o=n-r;let a=0;for(;a<e.length&&e.charCodeAt(a)===lt;)a++;let l=e.length;for(;l-1>a&&e.charCodeAt(l-1)===lt;)l--;const c=l-a,u=o<c?o:c;let f=-1,d=0;for(;d<u;d++){const m=t.charCodeAt(r+d);if(m!==e.charCodeAt(a+d))break;m===lt&&(f=d)}if(d!==u){if(f===-1)return s}else{if(c>u){if(e.charCodeAt(a+d)===lt)return s.slice(a+d+1);if(d===2)return s.slice(a+d)}o>u&&(t.charCodeAt(r+d)===lt?f=d:d===2&&(f=3)),f===-1&&(f=0)}let p="";for(d=r+f+1;d<=n;++d)(d===n||t.charCodeAt(d)===lt)&&(p+=p.length===0?"..":"\\..");return a+=f,p.length>0?`${p}${s.slice(a,l)}`:(s.charCodeAt(a)===lt&&++a,s.slice(a,l))},toNamespacedPath(t){if(typeof t!="string"||t.length===0)return t;const e=Ne.resolve(t);if(e.length<=2)return t;if(e.charCodeAt(0)===lt){if(e.charCodeAt(1)===lt){const i=e.charCodeAt(2);if(i!==$0&&i!==Li)return`\\\\?\\UNC\\${e.slice(2)}`}}else if(si(e.charCodeAt(0))&&e.charCodeAt(1)===ii&&e.charCodeAt(2)===lt)return`\\\\?\\${e}`;return e},dirname(t){ke(t,"path");const e=t.length;if(e===0)return".";let i=-1,s=0;const r=t.charCodeAt(0);if(e===1)return Z(r)?t:".";if(Z(r)){if(i=s=1,Z(t.charCodeAt(1))){let a=2,l=a;for(;a<e&&!Z(t.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&Z(t.charCodeAt(a));)a++;if(a<e&&a!==l){for(l=a;a<e&&!Z(t.charCodeAt(a));)a++;if(a===e)return t;a!==l&&(i=s=a+1)}}}}else si(r)&&t.charCodeAt(1)===ii&&(i=e>2&&Z(t.charCodeAt(2))?3:2,s=i);let n=-1,o=!0;for(let a=e-1;a>=s;--a)if(Z(t.charCodeAt(a))){if(!o){n=a;break}}else o=!1;if(n===-1){if(i===-1)return".";n=i}return t.slice(0,n)},basename(t,e){e!==void 0&&ke(e,"suffix"),ke(t,"path");let i=0,s=-1,r=!0,n;if(t.length>=2&&si(t.charCodeAt(0))&&t.charCodeAt(1)===ii&&(i=2),e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(n=t.length-1;n>=i;--n){const l=t.charCodeAt(n);if(Z(l)){if(!r){i=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return i===s?s=a:s===-1&&(s=t.length),t.slice(i,s)}for(n=t.length-1;n>=i;--n)if(Z(t.charCodeAt(n))){if(!r){i=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":t.slice(i,s)},extname(t){ke(t,"path");let e=0,i=-1,s=0,r=-1,n=!0,o=0;t.length>=2&&t.charCodeAt(1)===ii&&si(t.charCodeAt(0))&&(e=s=2);for(let a=t.length-1;a>=e;--a){const l=t.charCodeAt(a);if(Z(l)){if(!n){s=a+1;break}continue}r===-1&&(n=!1,r=a+1),l===Li?i===-1?i=a:o!==1&&(o=1):i!==-1&&(o=-1)}return i===-1||r===-1||o===0||o===1&&i===r-1&&i===s+1?"":t.slice(i,r)},format:Fc.bind(null,"\\"),parse(t){ke(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;const i=t.length;let s=0,r=t.charCodeAt(0);if(i===1)return Z(r)?(e.root=e.dir=t,e):(e.base=e.name=t,e);if(Z(r)){if(s=1,Z(t.charCodeAt(1))){let f=2,d=f;for(;f<i&&!Z(t.charCodeAt(f));)f++;if(f<i&&f!==d){for(d=f;f<i&&Z(t.charCodeAt(f));)f++;if(f<i&&f!==d){for(d=f;f<i&&!Z(t.charCodeAt(f));)f++;f===i?s=f:f!==d&&(s=f+1)}}}}else if(si(r)&&t.charCodeAt(1)===ii){if(i<=2)return e.root=e.dir=t,e;if(s=2,Z(t.charCodeAt(2))){if(i===3)return e.root=e.dir=t,e;s=3}}s>0&&(e.root=t.slice(0,s));let n=-1,o=s,a=-1,l=!0,c=t.length-1,u=0;for(;c>=s;--c){if(r=t.charCodeAt(c),Z(r)){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),r===Li?n===-1?n=c:u!==1&&(u=1):n!==-1&&(u=-1)}return a!==-1&&(n===-1||u===0||u===1&&n===a-1&&n===o+1?e.base=e.name=t.slice(o,a):(e.name=t.slice(o,n),e.base=t.slice(o,a),e.ext=t.slice(n,a))),o>0&&o!==s?e.dir=t.slice(0,o-1):e.dir=e.root,e},sep:"\\",delimiter:";",win32:null,posix:null},I0=(()=>{if(ct){const t=/\\/g;return()=>{const e=os().replace(t,"/");return e.slice(e.indexOf("/"))}}return()=>os()})(),se={resolve(...t){let e="",i=!1;for(let s=t.length-1;s>=0&&!i;s--){const r=t[s];ke(r,`paths[${s}]`),r.length!==0&&(e=`${r}/${e}`,i=r.charCodeAt(0)===_e)}if(!i){const s=I0();e=`${s}/${e}`,i=s.charCodeAt(0)===_e}return e=Gr(e,!i,"/",$o),i?`/${e}`:e.length>0?e:"."},normalize(t){if(ke(t,"path"),t.length===0)return".";const e=t.charCodeAt(0)===_e,i=t.charCodeAt(t.length-1)===_e;return t=Gr(t,!e,"/",$o),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)},isAbsolute(t){return ke(t,"path"),t.length>0&&t.charCodeAt(0)===_e},join(...t){if(t.length===0)return".";const e=[];for(let i=0;i<t.length;++i){const s=t[i];ke(s,"path"),s.length>0&&e.push(s)}return e.length===0?".":se.normalize(e.join("/"))},relative(t,e){if(ke(t,"from"),ke(e,"to"),t===e||(t=se.resolve(t),e=se.resolve(e),t===e))return"";const i=1,s=t.length,r=s-i,n=1,o=e.length-n,a=r<o?r:o;let l=-1,c=0;for(;c<a;c++){const f=t.charCodeAt(i+c);if(f!==e.charCodeAt(n+c))break;f===_e&&(l=c)}if(c===a)if(o>a){if(e.charCodeAt(n+c)===_e)return e.slice(n+c+1);if(c===0)return e.slice(n+c)}else r>a&&(t.charCodeAt(i+c)===_e?l=c:c===0&&(l=0));let u="";for(c=i+l+1;c<=s;++c)(c===s||t.charCodeAt(c)===_e)&&(u+=u.length===0?"..":"/..");return`${u}${e.slice(n+l)}`},toNamespacedPath(t){return t},dirname(t){if(ke(t,"path"),t.length===0)return".";const e=t.charCodeAt(0)===_e;let i=-1,s=!0;for(let r=t.length-1;r>=1;--r)if(t.charCodeAt(r)===_e){if(!s){i=r;break}}else s=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)},basename(t,e){e!==void 0&&ke(e,"suffix"),ke(t,"path");let i=0,s=-1,r=!0,n;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(n=t.length-1;n>=0;--n){const l=t.charCodeAt(n);if(l===_e){if(!r){i=n+1;break}}else a===-1&&(r=!1,a=n+1),o>=0&&(l===e.charCodeAt(o)?--o===-1&&(s=n):(o=-1,s=a))}return i===s?s=a:s===-1&&(s=t.length),t.slice(i,s)}for(n=t.length-1;n>=0;--n)if(t.charCodeAt(n)===_e){if(!r){i=n+1;break}}else s===-1&&(r=!1,s=n+1);return s===-1?"":t.slice(i,s)},extname(t){ke(t,"path");let e=-1,i=0,s=-1,r=!0,n=0;for(let o=t.length-1;o>=0;--o){const a=t[o];if(a==="/"){if(!r){i=o+1;break}continue}s===-1&&(r=!1,s=o+1),a==="."?e===-1?e=o:n!==1&&(n=1):e!==-1&&(n=-1)}return e===-1||s===-1||n===0||n===1&&e===s-1&&e===i+1?"":t.slice(e,s)},format:Fc.bind(null,"/"),parse(t){ke(t,"path");const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;const i=t.charCodeAt(0)===_e;let s;i?(e.root="/",s=1):s=0;let r=-1,n=0,o=-1,a=!0,l=t.length-1,c=0;for(;l>=s;--l){const u=t.charCodeAt(l);if(u===_e){if(!a){n=l+1;break}continue}o===-1&&(a=!1,o=l+1),u===Li?r===-1?r=l:c!==1&&(c=1):r!==-1&&(c=-1)}if(o!==-1){const u=n===0&&i?1:n;r===-1||c===0||c===1&&r===o-1&&r===n+1?e.base=e.name=t.slice(u,o):(e.name=t.slice(u,r),e.base=t.slice(u,o),e.ext=t.slice(r,o))}return n>0?e.dir=t.slice(0,n-1):i&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};se.win32=Ne.win32=Ne,se.posix=Ne.posix=se;var pi=ct?Ne.normalize:se.normalize,qs=ct?Ne.isAbsolute:se.isAbsolute,U=ct?Ne.join:se.join,Oi=ct?Ne.resolve:se.resolve,Tc=ct?Ne.relative:se.relative,Ot=ct?Ne.dirname:se.dirname,Nt=ct?Ne.basename:se.basename,Uc=ct?Ne.extname:se.extname,u7=ct?Ne.format:se.format,h7=ct?Ne.parse:se.parse,f7=ct?Ne.toNamespacedPath:se.toNamespacedPath,Ye=ct?Ne.sep:se.sep,D0=ct?Ne.delimiter:se.delimiter;function A0(t){return t}var R0=class{constructor(t,e){this.a=void 0,this.b=void 0,typeof t=="function"?(this.c=t,this.d=A0):(this.c=e,this.d=t.getCacheKey)}get(t){const e=this.d(t);return this.b!==e&&(this.b=e,this.a=this.c(t)),this.a}},Ni=class{constructor(t){this.d=t,this.a=!1}get hasValue(){return this.a}get value(){if(!this.a)try{this.b=this.d()}catch(t){this.c=t}finally{this.a=!0}if(this.c)throw this.c;return this.b}get rawValue(){return this.b}};function L0(t){return!t||typeof t!="string"?!0:t.trim().length===0}var O0=/{([^}]+)}/g;function as(t,e){return Object.keys(e).length===0?t:t.replace(O0,(i,s)=>e[s]??i)}function ls(t){return t.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function N0(t,e){if(!t||!e)return t;const i=e.length;if(i===0||t.length===0)return t;let s=0;for(;t.indexOf(e,s)===s;)s=s+i;return t.substring(s)}function Po(t,e){if(!t||!e)return t;const i=e.length,s=t.length;if(i===0||s===0)return t;let r=s,n=-1;for(;n=t.lastIndexOf(e,r-1),!(n===-1||n+i!==r);){if(n===0)return"";r=n}return t.substring(0,r)}function ko(t,e){return t<e?-1:t>e?1:0}function Io(t,e,i=0,s=t.length,r=0,n=e.length){for(;i<s&&r<n;i++,r++){const l=t.charCodeAt(i),c=e.charCodeAt(r);if(l<c)return-1;if(l>c)return 1}const o=s-i,a=n-r;return o<a?-1:o>a?1:0}function Jr(t,e){return Ws(t,e,0,t.length,0,e.length)}function Ws(t,e,i=0,s=t.length,r=0,n=e.length){for(;i<s&&r<n;i++,r++){let l=t.charCodeAt(i),c=e.charCodeAt(r);if(l===c)continue;if(l>=128||c>=128)return Io(t.toLowerCase(),e.toLowerCase(),i,s,r,n);Mc(l)&&(l-=32),Mc(c)&&(c-=32);const u=l-c;if(u!==0)return u}const o=s-i,a=n-r;return o<a?-1:o>a?1:0}function Mc(t){return t>=97&&t<=122}function jc(t){return t>=65&&t<=90}function gi(t,e){return t.length===e.length&&Ws(t,e)===0}function Do(t,e){const i=e.length;return e.length>t.length?!1:Ws(t,e,0,i)===0}function C0(t){return 55296<=t&&t<=56319}function _c(t){return 56320<=t&&t<=57343}function F0(t,e){return(t-55296<<10)+(e-56320)+65536}var T0=/(?:\x1b\[|\x9b)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/,U0=/(?:\x1b\]|\x9d).*?(?:\x1b\\|\x07|\x9c)/,M0=/\x1b(?:[ #%\(\)\*\+\-\.\/]?[a-zA-Z0-9\|}~@])/,d7=new RegExp("(?:"+[T0.source,U0.source,M0.source].join("|")+")","g"),p7="\uFEFF",Vc;(function(t){t[t.Other=0]="Other",t[t.Prepend=1]="Prepend",t[t.CR=2]="CR",t[t.LF=3]="LF",t[t.Control=4]="Control",t[t.Extend=5]="Extend",t[t.Regional_Indicator=6]="Regional_Indicator",t[t.SpacingMark=7]="SpacingMark",t[t.L=8]="L",t[t.V=9]="V",t[t.T=10]="T",t[t.LV=11]="LV",t[t.LVT=12]="LVT",t[t.ZWJ=13]="ZWJ",t[t.Extended_Pictographic=14]="Extended_Pictographic"})(Vc||(Vc={}));var g7=class Pr{static{this.c=null}static getInstance(){return Pr.c||(Pr.c=new Pr),Pr.c}constructor(){this.d=j0()}getGraphemeBreakType(e){if(e<32)return e===10?3:e===13?2:4;if(e<127)return 0;const i=this.d,s=i.length/3;let r=1;for(;r<=s;)if(e<i[3*r])r=2*r;else if(e>i[3*r+1])r=2*r+1;else return i[3*r+2];return 0}};function j0(){return JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}var zc;(function(t){t[t.zwj=8205]="zwj",t[t.emojiVariantSelector=65039]="emojiVariantSelector",t[t.enclosingKeyCap=8419]="enclosingKeyCap",t[t.space=32]="space"})(zc||(zc={}));var m7=class kr{static{this.c=new Ni(()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,1523,96,8242,96,1370,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,118002,50,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,118003,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,118004,52,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,118005,53,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,118006,54,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,118007,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,118008,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,118009,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,117974,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,117975,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71913,67,71922,67,65315,67,8557,67,8450,67,8493,67,117976,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,117977,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,117978,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,117979,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,117980,71,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,117981,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,117983,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,117984,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,118001,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,117982,108,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,117985,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,117986,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,117987,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,118000,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,117988,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,117989,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,117990,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,117991,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,117992,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,117993,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,117994,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,117995,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71910,87,71919,87,117996,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,117997,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,117998,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,71909,90,66293,90,65338,90,8484,90,8488,90,117999,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65283,35,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"cs":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"es":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"fr":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"it":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ja":[8211,45,8218,44,65281,33,8216,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65292,44,65297,49,65307,59],"ko":[8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"pt-BR":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"ru":[65374,126,8218,44,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,8218,44,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41,65292,44,65297,49,65307,59,65311,63],"zh-hans":[160,32,65374,126,8218,44,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65297,49],"zh-hant":[8211,45,65374,126,8218,44,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89]}'))}static{this.d=new R0({getCacheKey:JSON.stringify},e=>{function i(u){const f=new Map;for(let d=0;d<u.length;d+=2)f.set(u[d],u[d+1]);return f}function s(u,f){const d=new Map(u);for(const[p,m]of f)d.set(p,m);return d}function r(u,f){if(!u)return f;const d=new Map;for(const[p,m]of u)f.has(p)&&d.set(p,m);return d}const n=this.c.value;let o=e.filter(u=>!u.startsWith("_")&&u in n);o.length===0&&(o=["_default"]);let a;for(const u of o){const f=i(n[u]);a=r(a,f)}const l=i(n._common),c=s(l,a);return new kr(c)})}static getInstance(e){return kr.d.get(Array.from(e))}static{this.e=new Ni(()=>Object.keys(kr.c.value).filter(e=>!e.startsWith("_")))}static getLocales(){return kr.e.value}constructor(e){this.f=e}isAmbiguous(e){return this.f.has(e)}containsAmbiguousCharacter(e){for(let i=0;i<e.length;i++){const s=e.codePointAt(i);if(typeof s=="number"&&this.isAmbiguous(s))return!0}return!1}getPrimaryConfusable(e){return this.f.get(e)}getConfusableCodePoints(){return new Set(this.f.keys())}},w7=class Ir{static c(){return JSON.parse('{"_common":[11,12,13,127,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999],"cs":[173,8203,12288],"de":[173,8203,12288],"es":[8203,12288],"fr":[173,8203,12288],"it":[160,173,12288],"ja":[173],"ko":[173,12288],"pl":[173,8203,12288],"pt-BR":[173,8203,12288],"qps-ploc":[160,173,8203,12288],"ru":[173,12288],"tr":[160,173,8203,12288],"zh-hans":[160,173,8203,12288],"zh-hant":[173,12288]}')}static{this.d=void 0}static e(){return this.d||(this.d=new Set([...Object.values(Ir.c())].flat())),this.d}static isInvisibleCharacter(e){return Ir.e().has(e)}static containsInvisibleCharacter(e){for(let i=0;i<e.length;i++){const s=e.codePointAt(i);if(typeof s=="number"&&(Ir.isInvisibleCharacter(s)||s===32))return!0}return!1}static get codePoints(){return Ir.e()}};function mi(t){return t===47||t===92}function Bc(t){return t.replace(/[\\/]/g,se.sep)}function _0(t){return t.indexOf("/")===-1&&(t=Bc(t)),/^[a-zA-Z]:(\/|$)/.test(t)&&(t="/"+t),t}function qc(t,e=se.sep){if(!t)return"";const i=t.length,s=t.charCodeAt(0);if(mi(s)){if(mi(t.charCodeAt(1))&&!mi(t.charCodeAt(2))){let n=3;const o=n;for(;n<i&&!mi(t.charCodeAt(n));n++);if(o!==n&&!mi(t.charCodeAt(n+1))){for(n+=1;n<i;n++)if(mi(t.charCodeAt(n)))return t.slice(0,n+1).replace(/[\\/]/g,e)}}return e}else if(Wc(s)&&t.charCodeAt(1)===58)return mi(t.charCodeAt(2))?t.slice(0,2)+e:t.slice(0,2);let r=t.indexOf("://");if(r!==-1){for(r+=3;r<i;r++)if(mi(t.charCodeAt(r)))return t.slice(0,r+1)}return""}function Qr(t,e,i){const s=t===e;return!i||s?s:!t||!e?!1:gi(t,e)}function Hs(t,e,i,s=Ye){if(t===e)return!0;if(!t||!e||e.length>t.length)return!1;if(i){if(!Do(t,e))return!1;if(e.length===t.length)return!0;let n=e.length;return e.charAt(e.length-1)===s&&n--,t.charAt(n)===s}return e.charAt(e.length-1)!==s&&(e+=s),t.indexOf(e)===0}function Wc(t){return t>=65&&t<=90||t>=97&&t<=122}function V0(t){return me?(t=Po(t,Ye),t.endsWith(":")&&(t+=Ye)):(t=Po(t,Ye),t||(t=Ye)),t}function z0(t){const e=pi(t);return me?t.length>3?!1:B0(e)&&(t.length===2||e.charCodeAt(2)===92):e===se.sep}function B0(t,e=me){return e?Wc(t.charCodeAt(0))&&t.charCodeAt(1)===58:!1}var q0="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",W0="BDEFGHIJKMOQRSTUVWXYZbdefghijkmoqrstuvwxyz0123456789";function H0(t,e,i=8){let s="";for(let n=0;n<i;n++){let o;n===0&&me&&!e&&(i===3||i===4)?o=W0:o=q0,s+=o.charAt(Math.floor(Math.random()*o.length))}let r;return e?r=`${e}-${s}`:r=s,t?U(t,r):r}var G0=/^\w[\w\d+.-]*$/,J0=/^\//,Q0=/^\/\//;function Z0(t,e){if(!t.scheme&&e)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${t.authority}", path: "${t.path}", query: "${t.query}", fragment: "${t.fragment}"}`);if(t.scheme&&!G0.test(t.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(t.path){if(t.authority){if(!J0.test(t.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Q0.test(t.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function X0(t,e){return!t&&!e?"file":t}function K0(t,e){switch(t){case"https":case"http":case"file":e?e[0]!==Ct&&(e=Ct+e):e=Ct;break}return e}var ge="",Ct="/",Y0=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,k=class io{static isUri(e){return e instanceof io?!0:!e||typeof e!="object"?!1:typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="string"&&typeof e.with=="function"&&typeof e.toString=="function"}constructor(e,i,s,r,n,o=!1){typeof e=="object"?(this.scheme=e.scheme||ge,this.authority=e.authority||ge,this.path=e.path||ge,this.query=e.query||ge,this.fragment=e.fragment||ge):(this.scheme=X0(e,o),this.authority=i||ge,this.path=K0(this.scheme,s||ge),this.query=r||ge,this.fragment=n||ge,Z0(this,o))}get fsPath(){return Zr(this,!1)}with(e){if(!e)return this;let{scheme:i,authority:s,path:r,query:n,fragment:o}=e;return i===void 0?i=this.scheme:i===null&&(i=ge),s===void 0?s=this.authority:s===null&&(s=ge),r===void 0?r=this.path:r===null&&(r=ge),n===void 0?n=this.query:n===null&&(n=ge),o===void 0?o=this.fragment:o===null&&(o=ge),i===this.scheme&&s===this.authority&&r===this.path&&n===this.query&&o===this.fragment?this:new cs(i,s,r,n,o)}static parse(e,i=!1){const s=Y0.exec(e);return s?new cs(s[2]||ge,Xr(s[4]||ge),Xr(s[5]||ge),Xr(s[7]||ge),Xr(s[9]||ge),i):new cs(ge,ge,ge,ge,ge)}static file(e){let i=ge;if(me&&(e=e.replace(/\\/g,Ct)),e[0]===Ct&&e[1]===Ct){const s=e.indexOf(Ct,2);s===-1?(i=e.substring(2),e=Ct):(i=e.substring(2,s),e=e.substring(s)||Ct)}return new cs("file",i,e,ge,ge)}static from(e,i){return new cs(e.scheme,e.authority,e.path,e.query,e.fragment,i)}static joinPath(e,...i){if(!e.path)throw new Error("[UriError]: cannot call joinPath on URI without path");let s;return me&&e.scheme==="file"?s=io.file(Ne.join(Zr(e,!0),...i)).path:s=se.join(e.path,...i),e.with({path:s})}toString(e=!1){return Ao(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof io)return e;{const i=new cs(e);return i._formatted=e.external??null,i._fsPath=e._sep===Hc?e.fsPath??null:null,i}}else return e}[Symbol.for("debug.description")](){return`URI(${this.toString()})`}},Hc=me?1:void 0,cs=class extends k{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=Zr(this,!1)),this._fsPath}toString(t=!1){return t?Ao(this,!0):(this._formatted||(this._formatted=Ao(this,!1)),this._formatted)}toJSON(){const t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=Hc),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t}},Gc={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function Jc(t,e,i){let s,r=-1;for(let n=0;n<t.length;n++){const o=t.charCodeAt(n);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47||i&&o===91||i&&o===93||i&&o===58)r!==-1&&(s+=encodeURIComponent(t.substring(r,n)),r=-1),s!==void 0&&(s+=t.charAt(n));else{s===void 0&&(s=t.substr(0,n));const a=Gc[o];a!==void 0?(r!==-1&&(s+=encodeURIComponent(t.substring(r,n)),r=-1),s+=a):r===-1&&(r=n)}}return r!==-1&&(s+=encodeURIComponent(t.substring(r))),s!==void 0?s:t}function ep(t){let e;for(let i=0;i<t.length;i++){const s=t.charCodeAt(i);s===35||s===63?(e===void 0&&(e=t.substr(0,i)),e+=Gc[s]):e!==void 0&&(e+=t[i])}return e!==void 0?e:t}function Zr(t,e){let i;return t.authority&&t.path.length>1&&t.scheme==="file"?i=`//${t.authority}${t.path}`:t.path.charCodeAt(0)===47&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&t.path.charCodeAt(2)===58?e?i=t.path.substr(1):i=t.path[1].toLowerCase()+t.path.substr(2):i=t.path,me&&(i=i.replace(/\//g,"\\")),i}function Ao(t,e){const i=e?ep:Jc;let s="",{scheme:r,authority:n,path:o,query:a,fragment:l}=t;if(r&&(s+=r,s+=":"),(n||r==="file")&&(s+=Ct,s+=Ct),n){let c=n.indexOf("@");if(c!==-1){const u=n.substr(0,c);n=n.substr(c+1),c=u.lastIndexOf(":"),c===-1?s+=i(u,!1,!1):(s+=i(u.substr(0,c),!1,!1),s+=":",s+=i(u.substr(c+1),!1,!0)),s+="@"}n=n.toLowerCase(),c=n.lastIndexOf(":"),c===-1?s+=i(n,!1,!0):(s+=i(n.substr(0,c),!1,!0),s+=n.substr(c))}if(o){if(o.length>=3&&o.charCodeAt(0)===47&&o.charCodeAt(2)===58){const c=o.charCodeAt(1);c>=65&&c<=90&&(o=`/${String.fromCharCode(c+32)}:${o.substr(3)}`)}else if(o.length>=2&&o.charCodeAt(1)===58){const c=o.charCodeAt(0);c>=65&&c<=90&&(o=`${String.fromCharCode(c+32)}:${o.substr(2)}`)}s+=i(o,!0,!1)}return a&&(s+="?",s+=i(a,!1,!1)),l&&(s+="#",s+=e?l:Jc(l,!1,!1)),s}function Qc(t){try{return decodeURIComponent(t)}catch{return t.length>3?t.substr(0,3)+Qc(t.substr(3)):t}}var Zc=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function Xr(t){return t.match(Zc)?t.replace(Zc,e=>Qc(e)):t}var ie;(function(t){t.inMemory="inmemory",t.vscode="vscode",t.internal="private",t.walkThrough="walkThrough",t.walkThroughSnippet="walkThroughSnippet",t.http="http",t.https="https",t.file="file",t.mailto="mailto",t.untitled="untitled",t.data="data",t.command="command",t.vscodeRemote="vscode-remote",t.vscodeRemoteResource="vscode-remote-resource",t.vscodeManagedRemoteResource="vscode-managed-remote-resource",t.vscodeUserData="vscode-userdata",t.vscodeCustomEditor="vscode-custom-editor",t.vscodeNotebookCell="vscode-notebook-cell",t.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",t.vscodeNotebookCellMetadataDiff="vscode-notebook-cell-metadata-diff",t.vscodeNotebookCellOutput="vscode-notebook-cell-output",t.vscodeNotebookCellOutputDiff="vscode-notebook-cell-output-diff",t.vscodeNotebookMetadata="vscode-notebook-metadata",t.vscodeInteractiveInput="vscode-interactive-input",t.vscodeSettings="vscode-settings",t.vscodeWorkspaceTrust="vscode-workspace-trust",t.vscodeTerminal="vscode-terminal",t.vscodeChatCodeBlock="vscode-chat-code-block",t.vscodeChatCodeCompareBlock="vscode-chat-code-compare-block",t.vscodeChatSesssion="vscode-chat-editor",t.webviewPanel="webview-panel",t.vscodeWebview="vscode-webview",t.extension="extension",t.vscodeFileResource="vscode-file",t.tmp="tmp",t.vsls="vsls",t.vscodeSourceControl="vscode-scm",t.commentsInput="comment",t.codeSetting="code-setting",t.outputChannel="output",t.accessibleView="accessible-view"})(ie||(ie={}));var tp="tkn",ip=class{constructor(){this.a=Object.create(null),this.b=Object.create(null),this.c=Object.create(null),this.d="http",this.e=null,this.f="/"}setPreferredWebSchema(t){this.d=t}setDelegate(t){this.e=t}setServerRootPath(t,e){this.f=se.join(e??"/",rp(t))}getServerRootPath(){return this.f}get g(){return se.join(this.f,ie.vscodeRemoteResource)}set(t,e,i){this.a[t]=e,this.b[t]=i}setConnectionToken(t,e){this.c[t]=e}getPreferredWebSchema(){return this.d}rewrite(t){if(this.e)try{return this.e(t)}catch(o){return At(o),t}const e=t.authority;let i=this.a[e];i&&i.indexOf(":")!==-1&&i.indexOf("[")===-1&&(i=`[${i}]`);const s=this.b[e],r=this.c[e];let n=`path=${encodeURIComponent(t.path)}`;return typeof r=="string"&&(n+=`&${tp}=${encodeURIComponent(r)}`),k.from({scheme:$t?this.d:ie.vscodeRemoteResource,authority:`${i}:${s}`,path:this.g,query:n})}},sp=new ip;function rp(t){return`${t.quality??"oss"}-${t.commit??"dev"}`}var np="vs/../../node_modules",op="vs/../../node_modules.asar",Xc="vscode-app",ap=class so{static{this.a=Xc}asBrowserUri(e){const i=this.b(e);return this.uriToBrowserUri(i)}uriToBrowserUri(e){return e.scheme===ie.vscodeRemote?sp.rewrite(e):e.scheme===ie.file&&(f0||p0===`${ie.vscodeFileResource}://${so.a}`)?e.with({scheme:ie.vscodeFileResource,authority:e.authority||so.a,query:null,fragment:null}):e}asFileUri(e){const i=this.b(e);return this.uriToFileUri(i)}uriToFileUri(e){return e.scheme===ie.vscodeFileResource?e.with({scheme:ie.file,authority:e.authority!==so.a?e.authority:null,query:null,fragment:null}):e}b(e){if(k.isUri(e))return e;if(globalThis._VSCODE_FILE_ROOT){const i=globalThis._VSCODE_FILE_ROOT;if(/^\w[\w\d+.-]*:\/\//.test(i))return k.joinPath(k.parse(i,!0),e);const s=U(i,e);return k.file(s)}throw new Error("Cannot determine URI for module id!")}},Gs=new ap,v7=Object.freeze({"Cache-Control":"no-cache, no-store"}),y7=Object.freeze({"Document-Policy":"include-js-call-stacks-in-crash-reports"}),Kc;(function(t){const e=new Map([["1",{"Cross-Origin-Opener-Policy":"same-origin"}],["2",{"Cross-Origin-Embedder-Policy":"require-corp"}],["3",{"Cross-Origin-Opener-Policy":"same-origin","Cross-Origin-Embedder-Policy":"require-corp"}]]);t.CoopAndCoep=Object.freeze(e.get("3"));const i="vscode-coi";function s(n){let o;typeof n=="string"?o=new URL(n).searchParams:n instanceof URL?o=n.searchParams:k.isUri(n)&&(o=new URL(n.toString(!0)).searchParams);const a=o?.get(i);if(a)return e.get(a)}t.getHeadersFromQuery=s;function r(n,o,a){if(!globalThis.crossOriginIsolated)return;const l=o&&a?"3":a?"2":"1";n instanceof URLSearchParams?n.set(i,l):n[i]=l}t.addSearchParam=r})(Kc||(Kc={}));function ri(t){return Zr(t,!0)}var Kr=class{constructor(t){this.a=t}compare(t,e,i=!1){return t===e?0:ko(this.getComparisonKey(t,i),this.getComparisonKey(e,i))}isEqual(t,e,i=!1){return t===e?!0:!t||!e?!1:this.getComparisonKey(t,i)===this.getComparisonKey(e,i)}getComparisonKey(t,e=!1){return t.with({path:this.a(t)?t.path.toLowerCase():void 0,fragment:e?null:void 0}).toString()}ignorePathCasing(t){return this.a(t)}isEqualOrParent(t,e,i=!1){if(t.scheme===e.scheme){if(t.scheme===ie.file)return Hs(ri(t),ri(e),this.a(t))&&t.query===e.query&&(i||t.fragment===e.fragment);if(tu(t.authority,e.authority))return Hs(t.path,e.path,this.a(t),"/")&&t.query===e.query&&(i||t.fragment===e.fragment)}return!1}joinPath(t,...e){return k.joinPath(t,...e)}basenameOrAuthority(t){return us(t)||t.authority}basename(t){return se.basename(t.path)}extname(t){return se.extname(t.path)}dirname(t){if(t.path.length===0)return t;let e;return t.scheme===ie.file?e=k.file(Ot(ri(t))).path:(e=se.dirname(t.path),t.authority&&e.length&&e.charCodeAt(0)!==47&&(console.error(`dirname("${t.toString})) resulted in a relative path`),e="/")),t.with({path:e})}normalizePath(t){if(!t.path.length)return t;let e;return t.scheme===ie.file?e=k.file(pi(ri(t))).path:e=se.normalize(t.path),t.with({path:e})}relativePath(t,e){if(t.scheme!==e.scheme||!tu(t.authority,e.authority))return;if(t.scheme===ie.file){const r=Tc(ri(t),ri(e));return me?Bc(r):r}let i=t.path||"/";const s=e.path||"/";if(this.a(t)){let r=0;for(const n=Math.min(i.length,s.length);r<n&&!(i.charCodeAt(r)!==s.charCodeAt(r)&&i.charAt(r).toLowerCase()!==s.charAt(r).toLowerCase());r++);i=s.substr(0,r)+i.substr(r)}return se.relative(i,s)}resolvePath(t,e){if(t.scheme===ie.file){const i=k.file(Oi(ri(t),e));return t.with({authority:i.authority,path:i.path})}return e=_0(e),t.with({path:se.resolve(t.path,e)})}isAbsolutePath(t){return!!t.path&&t.path[0]==="/"}isEqualAuthority(t,e){return t===e||t!==void 0&&e!==void 0&&gi(t,e)}hasTrailingPathSeparator(t,e=Ye){if(t.scheme===ie.file){const i=ri(t);return i.length>qc(i).length&&i[i.length-1]===e}else{const i=t.path;return i.length>1&&i.charCodeAt(i.length-1)===47&&!/^[a-zA-Z]:(\/$|\\$)/.test(t.fsPath)}}removeTrailingPathSeparator(t,e=Ye){return iu(t,e)?t.with({path:t.path.substr(0,t.path.length-1)}):t}addTrailingPathSeparator(t,e=Ye){let i=!1;if(t.scheme===ie.file){const s=ri(t);i=s!==void 0&&s.length===qc(s).length&&s[s.length-1]===e}else{e="/";const s=t.path;i=s.length===1&&s.charCodeAt(s.length-1)===47}return!i&&!iu(t,e)?t.with({path:t.path+"/"}):t}},ee=new Kr(()=>!1),Ro=new Kr(t=>t.scheme===ie.file?!at:!0),lp=new Kr(t=>!0),Yc=ee.isEqual.bind(ee),eu=ee.isEqualOrParent.bind(ee),b7=ee.getComparisonKey.bind(ee),E7=ee.basenameOrAuthority.bind(ee),us=ee.basename.bind(ee),x7=ee.extname.bind(ee),cp=ee.dirname.bind(ee),W=ee.joinPath.bind(ee),up=ee.normalizePath.bind(ee),S7=ee.relativePath.bind(ee),$7=ee.resolvePath.bind(ee),hp=ee.isAbsolutePath.bind(ee),tu=ee.isEqualAuthority.bind(ee),iu=ee.hasTrailingPathSeparator.bind(ee),P7=ee.removeTrailingPathSeparator.bind(ee),k7=ee.addTrailingPathSeparator.bind(ee),su;(function(t){t.META_DATA_LABEL="label",t.META_DATA_DESCRIPTION="description",t.META_DATA_SIZE="size",t.META_DATA_MIME="mime";function e(i){const s=new Map;i.path.substring(i.path.indexOf(";")+1,i.path.lastIndexOf(";")).split(";").forEach(o=>{const[a,l]=o.split(":");a&&l&&s.set(a,l)});const n=i.path.substring(0,i.path.indexOf(";"));return n&&s.set(t.META_DATA_MIME,n),s}t.parseMetaData=e})(su||(su={}));var fp=Symbol("MicrotaskDelay");function Lo(t){return!!t&&typeof t.then=="function"}function ni(t){const e=new rs,i=t(e.token);let s=!1;const r=new Promise((n,o)=>{const a=e.token.onCancellationRequested(()=>{s=!0,a.dispose(),o(new Te)});Promise.resolve(i).then(l=>{a.dispose(),e.dispose(),s?fc(l)&&l.dispose():n(l)},l=>{a.dispose(),e.dispose(),o(l)})});return new class{cancel(){e.cancel(),e.dispose()}then(n,o){return r.then(n,o)}catch(n){return this.then(void 0,n)}finally(n){return r.finally(n)}}}function dp(t,e,i){let s;const r=setTimeout(()=>{s?.(void 0),i?.()},e);return Promise.race([t.finally(()=>clearTimeout(r)),new Promise(n=>s=n)])}var ru=class{constructor(){this.f=!1,this.a=null,this.b=null,this.d=null}queue(t){if(this.f)return Promise.reject(new Error("Throttler is disposed"));if(this.a){if(this.d=t,!this.b){const e=()=>{if(this.b=null,this.f)return;const i=this.queue(this.d);return this.d=null,i};this.b=new Promise(i=>{this.a.then(e,e).then(i)})}return new Promise((e,i)=>{this.b.then(e,i)})}return this.a=t(),new Promise((e,i)=>{this.a.then(s=>{this.a=null,e(s)},s=>{this.a=null,i(s)})})}dispose(){this.f=!0}},pp=class{constructor(){this.d=Promise.resolve(null)}queue(t){return this.d=this.d.then(()=>t(),()=>t())}},gp=(t,e)=>{let i=!0;const s=setTimeout(()=>{i=!1,e()},t);return{isTriggered:()=>i,dispose:()=>{clearTimeout(s),i=!1}}},mp=t=>{let e=!0;return queueMicrotask(()=>{e&&(e=!1,t())}),{isTriggered:()=>e,dispose:()=>{e=!1}}},nu=class{constructor(t){this.defaultDelay=t,this.a=null,this.b=null,this.d=null,this.f=null,this.g=null}trigger(t,e=this.defaultDelay){this.g=t,this.h(),this.b||(this.b=new Promise((s,r)=>{this.d=s,this.f=r}).then(()=>{if(this.b=null,this.d=null,this.g){const s=this.g;return this.g=null,s()}}));const i=()=>{this.a=null,this.d?.(null)};return this.a=e===fp?mp(i):gp(e,i),this.b}isTriggered(){return!!this.a?.isTriggered()}cancel(){this.h(),this.b&&(this.f?.(new Te),this.b=null)}h(){this.a?.dispose(),this.a=null}dispose(){this.cancel()}},Ci=class{constructor(t){this.a=new nu(t),this.b=new ru}trigger(t,e){return this.a.trigger(()=>this.b.queue(t),e)}isTriggered(){return this.a.isTriggered()}cancel(){this.a.cancel()}dispose(){this.a.dispose(),this.b.dispose()}},ou=class{constructor(){this.a=!1,this.b=new Promise((t,e)=>{this.d=t})}isOpen(){return this.a}open(){this.a=!0,this.d(!0)}wait(){return this.b}};function Js(t,e){return e?new Promise((i,s)=>{const r=setTimeout(()=>{n.dispose(),i()},t),n=e.onCancellationRequested(()=>{clearTimeout(r),n.dispose(),s(new Te)})}):ni(i=>Js(t,i))}function wp(t,e=s=>!!s,i=null){let s=0;const r=t.length,n=()=>{if(s>=r)return Promise.resolve(i);const o=t[s++];return Promise.resolve(o()).then(l=>e(l)?Promise.resolve(l):n())};return n()}var au=class{constructor(t){this.a=0,this.b=!1,this.f=t,this.g=[],this.d=0,this.h=new N}whenIdle(){return this.size>0?oe.toPromise(this.onDrained):Promise.resolve()}get onDrained(){return this.h.event}get size(){return this.a}queue(t){if(this.b)throw new Error("Object has been disposed");return this.a++,new Promise((e,i)=>{this.g.push({factory:t,c:e,e:i}),this.j()})}j(){for(;this.g.length&&this.d<this.f;){const t=this.g.shift();this.d++;const e=t.factory();e.then(t.c,t.e),e.then(()=>this.k(),()=>this.k())}}k(){this.b||(this.d--,--this.a===0&&this.h.fire(),this.g.length>0&&this.j())}clear(){if(this.b)throw new Error("Object has been disposed");this.g.length=0,this.a=this.d}dispose(){this.b=!0,this.g.length=0,this.a=0,this.h.dispose()}},Qs=class extends au{constructor(){super(1)}},lu=class{constructor(){this.a=new Map,this.b=new Set,this.d=void 0,this.f=0}async whenDrained(){if(this.g())return;const t=new Oo;return this.b.add(t),t.p}g(){for(const[,t]of this.a)if(t.size>0)return!1;return!0}queueSize(t,e=ee){const i=e.getComparisonKey(t);return this.a.get(i)?.size??0}queueFor(t,e,i=ee){const s=i.getComparisonKey(t);let r=this.a.get(s);if(!r){r=new Qs;const n=this.f++,o=oe.once(r.onDrained)(()=>{r?.dispose(),this.a.delete(s),this.h(),this.d?.deleteAndDispose(n),this.d?.size===0&&(this.d.dispose(),this.d=void 0)});this.d||(this.d=new vo),this.d.set(n,o),this.a.set(s,r)}return r.queue(e)}h(){this.g()&&this.j()}j(){for(const t of this.b)t.complete();this.b.clear()}dispose(){for(const[,t]of this.a)t.dispose();this.a.clear(),this.j(),this.d?.dispose()}},Yr=class{constructor(t,e){this.b=void 0,this.a=t,this.d=e,this.f=this.g.bind(this)}dispose(){this.cancel(),this.a=null}cancel(){this.isScheduled()&&(clearTimeout(this.b),this.b=void 0)}schedule(t=this.d){this.cancel(),this.b=setTimeout(this.f,t)}get delay(){return this.d}set delay(t){this.d=t}isScheduled(){return this.b!==void 0}flush(){this.isScheduled()&&(this.cancel(),this.h())}g(){this.b=void 0,this.a&&this.h()}h(){this.a?.()}},vp=class extends Yr{constructor(t,e){super(t,e),this.j=[]}work(t){this.j.push(t),this.isScheduled()||this.schedule()}h(){const t=this.j;this.j=[],this.a?.(t)}dispose(){this.j=[],super.dispose()}},cu=class extends J{constructor(t,e){super(),this.h=t,this.j=e,this.a=[],this.b=this.B(new _s),this.f=!1,this.g=0}get pending(){return this.a.length}work(t){if(this.f)return!1;if(typeof this.h.maxBufferedWork=="number"){if(this.b.value){if(this.pending+t.length>this.h.maxBufferedWork)return!1}else if(this.pending+t.length-this.h.maxWorkChunkSize>this.h.maxBufferedWork)return!1}for(const i of t)this.a.push(i);const e=Date.now()-this.g;return!this.b.value&&(!this.h.waitThrottleDelayBetweenWorkUnits||e>=this.h.throttleDelay)?this.m():!this.b.value&&this.h.waitThrottleDelayBetweenWorkUnits&&this.r(Math.max(this.h.throttleDelay-e,0)),!0}m(){this.g=Date.now(),this.j(this.a.splice(0,this.h.maxWorkChunkSize)),this.a.length>0&&this.r()}r(t=this.h.throttleDelay){this.b.value=new Yr(()=>{this.b.clear(),this.m()},t),this.b.value.schedule()}dispose(){super.dispose(),this.a.length=0,this.f=!0}},uu,en;(function(){typeof globalThis.requestIdleCallback!="function"||typeof globalThis.cancelIdleCallback!="function"?en=(t,e,i)=>{m0(()=>{if(s)return;const r=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining(){return Math.max(0,r-Date.now())}}))});let s=!1;return{dispose(){s||(s=!0)}}}:en=(t,e,i)=>{const s=t.requestIdleCallback(e,typeof i=="number"?{timeout:i}:void 0);let r=!1;return{dispose(){r||(r=!0,t.cancelIdleCallback(s))}}},uu=(t,e)=>en(globalThis,t,e)})();var yp=class{constructor(t,e){this.g=!1,this.d=()=>{try{this.j=e()}catch(i){this.l=i}finally{this.g=!0}},this.f=en(t,()=>this.d())}dispose(){this.f.dispose()}get value(){if(this.g||(this.f.dispose(),this.d()),this.l)throw this.l;return this.j}get isInitialized(){return this.g}},bp=class extends yp{constructor(t){super(globalThis,t)}};async function Ep(t,e,i){let s;for(let r=0;r<i;r++)try{return await t()}catch(n){s=n,await Js(e)}throw s}var hu;(function(t){t[t.Resolved=0]="Resolved",t[t.Rejected=1]="Rejected"})(hu||(hu={}));var Oo=class{get isRejected(){return this.d?.outcome===1}get isResolved(){return this.d?.outcome===0}get isSettled(){return!!this.d}get value(){return this.d?.outcome===0?this.d?.value:void 0}constructor(){this.p=new Promise((t,e)=>{this.a=t,this.b=e})}complete(t){return new Promise(e=>{this.a(t),this.d={outcome:0,value:t},e()})}error(t){return new Promise(e=>{this.b(t),this.d={outcome:1,value:t},e()})}settleWith(t){return t.then(e=>this.complete(e),e=>this.error(e))}cancel(){return this.error(new Te)}},ut;(function(t){async function e(s){let r;const n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(ut||(ut={}));var fu;(function(t){t[t.Initial=0]="Initial",t[t.DoneOK=1]="DoneOK",t[t.DoneError=2]="DoneError"})(fu||(fu={}));var I7=class yt{static fromArray(e){return new yt(i=>{i.emitMany(e)})}static fromPromise(e){return new yt(async i=>{i.emitMany(await e)})}static fromPromisesResolveOrder(e){return new yt(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new yt(async i=>{await Promise.all(e.map(async s=>{for await(const r of s)i.emitOne(r)}))})}static{this.EMPTY=yt.fromArray([])}constructor(e,i){this.a=0,this.b=[],this.d=null,this.f=i,this.g=new N,queueMicrotask(async()=>{const s={emitOne:r=>this.h(r),emitMany:r=>this.j(r),reject:r=>this.l(r)};try{await Promise.resolve(e(s)),this.k()}catch(r){this.l(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this.a===2)throw this.d;if(e<this.b.length)return{done:!1,value:this.b[e++]};if(this.a===1)return{done:!0,value:void 0};await oe.toPromise(this.g.event)}while(!0)},return:async()=>(this.f?.(),{done:!0,value:void 0})}}static map(e,i){return new yt(async s=>{for await(const r of e)s.emitOne(i(r))})}map(e){return yt.map(this,e)}static filter(e,i){return new yt(async s=>{for await(const r of e)i(r)&&s.emitOne(r)})}filter(e){return yt.filter(this,e)}static coalesce(e){return yt.filter(e,i=>!!i)}coalesce(){return yt.coalesce(this)}static async toPromise(e){const i=[];for await(const s of e)i.push(s);return i}toPromise(){return yt.toPromise(this)}h(e){this.a===0&&(this.b.push(e),this.g.fire())}j(e){this.a===0&&(this.b=this.b.concat(e),this.g.fire())}k(){this.a===0&&(this.a=1,this.g.fire())}l(e){this.a===0&&(this.a=2,this.d=e,this.g.fire())}};function No(t,e){return e&&(t.stack||t.stacktrace)?g(110,null,pu(t),du(t.stack)||du(t.stacktrace)):pu(t)}function du(t){return Array.isArray(t)?t.join(`
`):t}function pu(t){return t.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${t.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof t.code=="string"&&typeof t.errno=="number"&&typeof t.syscall=="string"?g(111,null,t.message):t.message||g(112,null)}function Fi(t=null,e=!1){if(!t)return g(113,null);if(Array.isArray(t)){const i=is(t),s=Fi(i[0],e);return i.length>1?g(114,null,s,i.length):s}if(xe(t))return t;if(t.detail){const i=t.detail;if(i.error)return No(i.error,e);if(i.exception)return No(i.exception,e)}return t.stack?No(t,e):t.message?t.message:g(115,null)}var Ft;(function(t){t.serviceIds=new Map,t.DI_TARGET="$di$target",t.DI_DEPENDENCIES="$di$dependencies";function e(i){return i[t.DI_DEPENDENCIES]||[]}t.getServiceDependencies=e})(Ft||(Ft={}));var tn=ue("instantiationService");function xp(t,e,i){e[Ft.DI_TARGET]===e?e[Ft.DI_DEPENDENCIES].push({id:t,index:i}):(e[Ft.DI_DEPENDENCIES]=[{id:t,index:i}],e[Ft.DI_TARGET]=e)}function ue(t){if(Ft.serviceIds.has(t))return Ft.serviceIds.get(t);const e=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");xp(e,i,r)};return e.toString=()=>t,Ft.serviceIds.set(t,e),e}function D7(t){return t}var oi=ue("configurationService");function Co(t){return t&&typeof t=="object"&&(!t.overrideIdentifier||typeof t.overrideIdentifier=="string")&&(!t.resource||t.resource instanceof k)}function Sp(t){return t&&typeof t=="object"&&(!t.overrideIdentifiers||Array.isArray(t.overrideIdentifiers))&&!t.overrideIdentifier&&(!t.resource||t.resource instanceof k)}var gu;(function(t){t[t.APPLICATION=1]="APPLICATION",t[t.USER=2]="USER",t[t.USER_LOCAL=3]="USER_LOCAL",t[t.USER_REMOTE=4]="USER_REMOTE",t[t.WORKSPACE=5]="WORKSPACE",t[t.WORKSPACE_FOLDER=6]="WORKSPACE_FOLDER",t[t.DEFAULT=7]="DEFAULT",t[t.MEMORY=8]="MEMORY"})(gu||(gu={}));function Fo(t,e){const i=Object.create(null);for(const s in t)mu(i,s,t[s],e);return i}function mu(t,e,i,s){const r=e.split("."),n=r.pop();let o=t;for(let a=0;a<r.length;a++){const l=r[a];let c=o[l];switch(typeof c){case"undefined":c=o[l]=Object.create(null);break;case"object":if(c===null){s(`Ignoring ${e} as ${r.slice(0,a+1).join(".")} is null`);return}break;default:s(`Ignoring ${e} as ${r.slice(0,a+1).join(".")} is ${JSON.stringify(c)}`);return}o=c}if(typeof o=="object"&&o!==null)try{o[n]=i}catch{s(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(o)}`)}else s(`Ignoring ${e} as ${r.join(".")} is ${JSON.stringify(o)}`)}function $p(t,e){const i=e.split(".");wu(t,i)}function wu(t,e){if(!t)return;const i=e.shift();if(e.length===0){delete t[i];return}if(Object.keys(t).indexOf(i)!==-1){const s=t[i];typeof s=="object"&&!Array.isArray(s)&&(wu(s,e),Object.keys(s).length===0&&delete t[i])}}function sn(t,e,i){function s(o,a){let l=o;for(const c of a){if(typeof l!="object"||l===null)return;l=l[c]}return l}const r=e.split("."),n=s(t,r);return typeof n>"u"?i:n}function Pp(t){return t.replace(/[\[\]]/g,"")}function rn(t){const e=t;return e?[e.on,e.pause,e.resume,e.destroy].every(i=>typeof i=="function"):!1}function To(t){const e=t;return e?rn(e.stream)&&Array.isArray(e.buffer)&&typeof e.ended=="boolean":!1}function nn(t,e){return new kp(t,e)}var kp=class{constructor(t,e){this.e=t,this.f=e,this.a={flowing:!1,ended:!1,destroyed:!1},this.b={data:[],error:[]},this.c={data:[],error:[],end:[]},this.d=[]}pause(){this.a.destroyed||(this.a.flowing=!1)}resume(){this.a.destroyed||this.a.flowing||(this.a.flowing=!0,this.j(),this.k(),this.l())}write(t){if(!this.a.destroyed){if(this.a.flowing)this.g(t);else if(this.b.data.push(t),typeof this.f?.highWaterMark=="number"&&this.b.data.length>this.f.highWaterMark)return new Promise(e=>this.d.push(e))}}error(t){this.a.destroyed||(this.a.flowing?this.h(t):this.b.error.push(t))}end(t){this.a.destroyed||(typeof t<"u"&&this.write(t),this.a.flowing?(this.i(),this.destroy()):this.a.ended=!0)}g(t){this.c.data.slice(0).forEach(e=>e(t))}h(t){this.c.error.length===0?At(t):this.c.error.slice(0).forEach(e=>e(t))}i(){this.c.end.slice(0).forEach(t=>t())}on(t,e){if(!this.a.destroyed)switch(t){case"data":this.c.data.push(e),this.resume();break;case"end":this.c.end.push(e),this.a.flowing&&this.l()&&this.destroy();break;case"error":this.c.error.push(e),this.a.flowing&&this.k();break}}removeListener(t,e){if(this.a.destroyed)return;let i;switch(t){case"data":i=this.c.data;break;case"end":i=this.c.end;break;case"error":i=this.c.error;break}if(i){const s=i.indexOf(e);s>=0&&i.splice(s,1)}}j(){if(this.b.data.length===0)return;if(typeof this.e=="function"){const e=this.e(this.b.data);this.g(e)}else for(const e of this.b.data)this.g(e);this.b.data.length=0;const t=[...this.d];this.d.length=0,t.forEach(e=>e())}k(){if(this.c.error.length>0){for(const t of this.b.error)this.h(t);this.b.error.length=0}}l(){return this.a.ended?(this.i(),this.c.end.length>0):!1}destroy(){this.a.destroyed||(this.a.destroyed=!0,this.a.ended=!0,this.b.data.length=0,this.b.error.length=0,this.c.data.length=0,this.c.error.length=0,this.c.end.length=0,this.d.length=0)}};function Ip(t,e){const i=[];let s;for(;(s=t.read())!==null;)i.push(s);return e(i)}function Dp(t,e,i){const s=[];let r;for(;(r=t.read())!==null&&s.length<i;)s.push(r);return r===null&&s.length>0?e(s):{read:()=>{if(s.length>0)return s.shift();if(typeof r<"u"){const n=r;return r=void 0,n}return t.read()}}}function vu(t,e){return new Promise((i,s)=>{const r=[];Uo(t,{onData:n=>{e&&r.push(n)},onError:n=>{e?s(n):i(void 0)},onEnd:()=>{i(e?e(r):void 0)}})})}function Uo(t,e,i){t.on("error",s=>{i?.isCancellationRequested||e.onError(s)}),t.on("end",()=>{i?.isCancellationRequested||e.onEnd()}),t.on("data",s=>{i?.isCancellationRequested||e.onData(s)})}function Ap(t,e){return new Promise((i,s)=>{const r=new ot,n=[],o=c=>{if(n.push(c),n.length>e)return r.dispose(),t.pause(),i({stream:t,buffer:n,ended:!1})},a=c=>(r.dispose(),s(c)),l=()=>(r.dispose(),i({stream:t,buffer:n,ended:!0}));r.add(Se(()=>t.removeListener("error",a))),t.on("error",a),r.add(Se(()=>t.removeListener("end",l))),t.on("end",l),r.add(Se(()=>t.removeListener("data",o))),t.on("data",o)})}function Rp(t){let e=!1;return{read:()=>e?null:(e=!0,t)}}function yu(t,e,i){const s=nn(i);return Uo(t,{onData:r=>s.write(e.data(r)),onError:r=>s.error(e.error?e.error(r):r),onEnd:()=>s.end()}),s}var on=typeof Buffer<"u",Lp=new Ni(()=>new Uint8Array(256)),Mo,jo,V=class It{static alloc(e){return on?new It(Buffer.allocUnsafe(e)):new It(new Uint8Array(e))}static wrap(e){return on&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new It(e)}static fromString(e,i){return!(i?.dontUseNodeBuffer||!1)&&on?new It(Buffer.from(e)):(Mo||(Mo=new TextEncoder),new It(Mo.encode(e)))}static fromByteArray(e){const i=It.alloc(e.length);for(let s=0,r=e.length;s<r;s++)i.buffer[s]=e[s];return i}static concat(e,i){if(typeof i>"u"){i=0;for(let n=0,o=e.length;n<o;n++)i+=e[n].byteLength}const s=It.alloc(i);let r=0;for(let n=0,o=e.length;n<o;n++){const a=e[n];s.set(a,r),r+=a.byteLength}return s}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}clone(){const e=It.alloc(this.byteLength);return e.set(this),e}toString(){return on?this.buffer.toString():(jo||(jo=new TextDecoder),jo.decode(this.buffer))}slice(e,i){return new It(this.buffer.subarray(e,i))}set(e,i){if(e instanceof It)this.buffer.set(e.buffer,i);else if(e instanceof Uint8Array)this.buffer.set(e,i);else if(e instanceof ArrayBuffer)this.buffer.set(new Uint8Array(e),i);else if(ArrayBuffer.isView(e))this.buffer.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i);else throw new Error("Unknown argument 'array'")}readUInt32BE(e){return Np(this.buffer,e)}writeUInt32BE(e,i){Cp(this.buffer,e,i)}readUInt32LE(e){return Fp(this.buffer,e)}writeUInt32LE(e,i){Tp(this.buffer,e,i)}readUInt8(e){return Up(this.buffer,e)}writeUInt8(e,i){Mp(this.buffer,e,i)}indexOf(e,i=0){return Op(this.buffer,e instanceof It?e.buffer:e,i)}equals(e){return this===e?!0:this.byteLength!==e.byteLength?!1:this.buffer.every((i,s)=>i===e.buffer[s])}};function Op(t,e,i=0){const s=e.byteLength,r=t.byteLength;if(s===0)return 0;if(s===1)return t.indexOf(e[0]);if(s>r-i)return-1;const n=Lp.value;n.fill(e.length);for(let c=0;c<e.length;c++)n[e[c]]=e.length-c-1;let o=i+e.length-1,a=o,l=-1;for(;o<r;)if(t[o]===e[a]){if(a===0){l=o;break}o--,a--}else o+=Math.max(e.length-a,n[t[o]]),a=e.length-1;return l}function Np(t,e){return t[e]*2**24+t[e+1]*2**16+t[e+2]*2**8+t[e+3]}function Cp(t,e,i){t[i+3]=e,e=e>>>8,t[i+2]=e,e=e>>>8,t[i+1]=e,e=e>>>8,t[i]=e}function Fp(t,e){return t[e+0]<<0>>>0|t[e+1]<<8>>>0|t[e+2]<<16>>>0|t[e+3]<<24>>>0}function Tp(t,e,i){t[i+0]=e&255,e=e>>>8,t[i+1]=e&255,e=e>>>8,t[i+2]=e&255,e=e>>>8,t[i+3]=e&255}function Up(t,e){return t[e]}function Mp(t,e,i){t[i]=e}function jp(t){return Ip(t,e=>V.concat(e))}function _p(t){return Rp(t)}function Ti(t){return vu(t,e=>V.concat(e))}async function Vp(t){return t.ended?V.concat(t.buffer):V.concat([...t.buffer,await Ti(t.stream)])}function zp(t){return yu(t,{data:e=>typeof e=="string"?V.fromString(e):V.wrap(e)},e=>V.concat(e))}function Bp(t){return nn(e=>V.concat(e),t)}var bu="0123456789abcdef";function qp({buffer:t}){let e="";for(let i=0;i<t.length;i++){const s=t[i];e+=bu[s>>>4],e+=bu[s&15]}return e}var Eu;(function(t){t[t.None=0]="None",t[t.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=2]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",t[t.InvalidUnicode=4]="InvalidUnicode",t[t.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",t[t.InvalidCharacter=6]="InvalidCharacter"})(Eu||(Eu={}));var xu;(function(t){t[t.OpenBraceToken=1]="OpenBraceToken",t[t.CloseBraceToken=2]="CloseBraceToken",t[t.OpenBracketToken=3]="OpenBracketToken",t[t.CloseBracketToken=4]="CloseBracketToken",t[t.CommaToken=5]="CommaToken",t[t.ColonToken=6]="ColonToken",t[t.NullKeyword=7]="NullKeyword",t[t.TrueKeyword=8]="TrueKeyword",t[t.FalseKeyword=9]="FalseKeyword",t[t.StringLiteral=10]="StringLiteral",t[t.NumericLiteral=11]="NumericLiteral",t[t.LineCommentTrivia=12]="LineCommentTrivia",t[t.BlockCommentTrivia=13]="BlockCommentTrivia",t[t.LineBreakTrivia=14]="LineBreakTrivia",t[t.Trivia=15]="Trivia",t[t.Unknown=16]="Unknown",t[t.EOF=17]="EOF"})(xu||(xu={}));var Su;(function(t){t[t.InvalidSymbol=1]="InvalidSymbol",t[t.InvalidNumberFormat=2]="InvalidNumberFormat",t[t.PropertyNameExpected=3]="PropertyNameExpected",t[t.ValueExpected=4]="ValueExpected",t[t.ColonExpected=5]="ColonExpected",t[t.CommaExpected=6]="CommaExpected",t[t.CloseBraceExpected=7]="CloseBraceExpected",t[t.CloseBracketExpected=8]="CloseBracketExpected",t[t.EndOfFileExpected=9]="EndOfFileExpected",t[t.InvalidCommentToken=10]="InvalidCommentToken",t[t.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",t[t.UnexpectedEndOfString=12]="UnexpectedEndOfString",t[t.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",t[t.InvalidUnicode=14]="InvalidUnicode",t[t.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",t[t.InvalidCharacter=16]="InvalidCharacter"})(Su||(Su={}));var Zs;(function(t){t.DEFAULT={allowTrailingComma:!0}})(Zs||(Zs={}));function $u(t,e=!1){let i=0;const s=t.length;let r="",n=0,o=16,a=0;function l(w){let y=0,b=0;for(;y<w;){const S=t.charCodeAt(i);if(S>=48&&S<=57)b=b*16+S-48;else if(S>=65&&S<=70)b=b*16+S-65+10;else if(S>=97&&S<=102)b=b*16+S-97+10;else break;i++,y++}return y<w&&(b=-1),b}function c(w){i=w,r="",n=0,o=16,a=0}function u(){const w=i;if(t.charCodeAt(i)===48)i++;else for(i++;i<t.length&&hs(t.charCodeAt(i));)i++;if(i<t.length&&t.charCodeAt(i)===46)if(i++,i<t.length&&hs(t.charCodeAt(i)))for(i++;i<t.length&&hs(t.charCodeAt(i));)i++;else return a=3,t.substring(w,i);let y=i;if(i<t.length&&(t.charCodeAt(i)===69||t.charCodeAt(i)===101))if(i++,(i<t.length&&t.charCodeAt(i)===43||t.charCodeAt(i)===45)&&i++,i<t.length&&hs(t.charCodeAt(i))){for(i++;i<t.length&&hs(t.charCodeAt(i));)i++;y=i}else a=3;return t.substring(w,y)}function f(){let w="",y=i;for(;;){if(i>=s){w+=t.substring(y,i),a=2;break}const b=t.charCodeAt(i);if(b===34){w+=t.substring(y,i),i++;break}if(b===92){if(w+=t.substring(y,i),i++,i>=s){a=2;break}switch(t.charCodeAt(i++)){case 34:w+='"';break;case 92:w+="\\";break;case 47:w+="/";break;case 98:w+="\b";break;case 102:w+="\f";break;case 110:w+=`
`;break;case 114:w+="\r";break;case 116:w+="	";break;case 117:{const I=l(4);I>=0?w+=String.fromCharCode(I):a=4;break}default:a=5}y=i;continue}if(b>=0&&b<=31)if(an(b)){w+=t.substring(y,i),a=2;break}else a=6;i++}return w}function d(){if(r="",a=0,n=i,i>=s)return n=s,o=17;let w=t.charCodeAt(i);if(_o(w)){do i++,r+=String.fromCharCode(w),w=t.charCodeAt(i);while(_o(w));return o=15}if(an(w))return i++,r+=String.fromCharCode(w),w===13&&t.charCodeAt(i)===10&&(i++,r+=`
`),o=14;switch(w){case 123:return i++,o=1;case 125:return i++,o=2;case 91:return i++,o=3;case 93:return i++,o=4;case 58:return i++,o=6;case 44:return i++,o=5;case 34:return i++,r=f(),o=10;case 47:{const y=i-1;if(t.charCodeAt(i+1)===47){for(i+=2;i<s&&!an(t.charCodeAt(i));)i++;return r=t.substring(y,i),o=12}if(t.charCodeAt(i+1)===42){i+=2;const b=s-1;let S=!1;for(;i<b;){if(t.charCodeAt(i)===42&&t.charCodeAt(i+1)===47){i+=2,S=!0;break}i++}return S||(i++,a=1),r=t.substring(y,i),o=13}return r+=String.fromCharCode(w),i++,o=16}case 45:if(r+=String.fromCharCode(w),i++,i===s||!hs(t.charCodeAt(i)))return o=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=u(),o=11;default:for(;i<s&&p(w);)i++,w=t.charCodeAt(i);if(n!==i){switch(r=t.substring(n,i),r){case"true":return o=8;case"false":return o=9;case"null":return o=7}return o=16}return r+=String.fromCharCode(w),i++,o=16}}function p(w){if(_o(w)||an(w))return!1;switch(w){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function m(){let w;do w=d();while(w>=12&&w<=15);return w}return{setPosition:c,getPosition:()=>i,scan:e?m:d,getToken:()=>o,getTokenValue:()=>r,getTokenOffset:()=>n,getTokenLength:()=>i-n,getTokenError:()=>a}}function _o(t){return t===32||t===9||t===11||t===12||t===160||t===5760||t>=8192&&t<=8203||t===8239||t===8287||t===12288||t===65279}function an(t){return t===10||t===13||t===8232||t===8233}function hs(t){return t>=48&&t<=57}var Pu;(function(t){t[t.nullCharacter=0]="nullCharacter",t[t.maxAsciiCharacter=127]="maxAsciiCharacter",t[t.lineFeed=10]="lineFeed",t[t.carriageReturn=13]="carriageReturn",t[t.lineSeparator=8232]="lineSeparator",t[t.paragraphSeparator=8233]="paragraphSeparator",t[t.nextLine=133]="nextLine",t[t.space=32]="space",t[t.nonBreakingSpace=160]="nonBreakingSpace",t[t.enQuad=8192]="enQuad",t[t.emQuad=8193]="emQuad",t[t.enSpace=8194]="enSpace",t[t.emSpace=8195]="emSpace",t[t.threePerEmSpace=8196]="threePerEmSpace",t[t.fourPerEmSpace=8197]="fourPerEmSpace",t[t.sixPerEmSpace=8198]="sixPerEmSpace",t[t.figureSpace=8199]="figureSpace",t[t.punctuationSpace=8200]="punctuationSpace",t[t.thinSpace=8201]="thinSpace",t[t.hairSpace=8202]="hairSpace",t[t.zeroWidthSpace=8203]="zeroWidthSpace",t[t.narrowNoBreakSpace=8239]="narrowNoBreakSpace",t[t.ideographicSpace=12288]="ideographicSpace",t[t.mathematicalSpace=8287]="mathematicalSpace",t[t.ogham=5760]="ogham",t[t._=95]="_",t[t.$=36]="$",t[t._0=48]="_0",t[t._1=49]="_1",t[t._2=50]="_2",t[t._3=51]="_3",t[t._4=52]="_4",t[t._5=53]="_5",t[t._6=54]="_6",t[t._7=55]="_7",t[t._8=56]="_8",t[t._9=57]="_9",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.ampersand=38]="ampersand",t[t.asterisk=42]="asterisk",t[t.at=64]="at",t[t.backslash=92]="backslash",t[t.bar=124]="bar",t[t.caret=94]="caret",t[t.closeBrace=125]="closeBrace",t[t.closeBracket=93]="closeBracket",t[t.closeParen=41]="closeParen",t[t.colon=58]="colon",t[t.comma=44]="comma",t[t.dot=46]="dot",t[t.doubleQuote=34]="doubleQuote",t[t.equals=61]="equals",t[t.exclamation=33]="exclamation",t[t.greaterThan=62]="greaterThan",t[t.lessThan=60]="lessThan",t[t.minus=45]="minus",t[t.openBrace=123]="openBrace",t[t.openBracket=91]="openBracket",t[t.openParen=40]="openParen",t[t.percent=37]="percent",t[t.plus=43]="plus",t[t.question=63]="question",t[t.semicolon=59]="semicolon",t[t.singleQuote=39]="singleQuote",t[t.slash=47]="slash",t[t.tilde=126]="tilde",t[t.backspace=8]="backspace",t[t.formFeed=12]="formFeed",t[t.byteOrderMark=65279]="byteOrderMark",t[t.tab=9]="tab",t[t.verticalTab=11]="verticalTab"})(Pu||(Pu={}));function Xs(t,e=[],i=Zs.DEFAULT){let s=null,r=[];const n=[];function o(l){Array.isArray(r)?r.push(l):s!==null&&(r[s]=l)}return ln(t,{onObjectBegin:()=>{const l={};o(l),n.push(r),r=l,s=null},onObjectProperty:l=>{s=l},onObjectEnd:()=>{r=n.pop()},onArrayBegin:()=>{const l=[];o(l),n.push(r),r=l,s=null},onArrayEnd:()=>{r=n.pop()},onLiteralValue:o,onError:(l,c,u)=>{e.push({error:l,offset:c,length:u})}},i),r[0]}function Wp(t,e=[],i=Zs.DEFAULT){let s={type:"array",offset:-1,length:-1,children:[],parent:void 0};function r(l){s.type==="property"&&(s.length=l-s.offset,s=s.parent)}function n(l){return s.children.push(l),l}ln(t,{onObjectBegin:l=>{s=n({type:"object",offset:l,length:-1,parent:s,children:[]})},onObjectProperty:(l,c,u)=>{s=n({type:"property",offset:c,length:-1,parent:s,children:[]}),s.children.push({type:"string",value:l,offset:c,length:u,parent:s})},onObjectEnd:(l,c)=>{s.length=l+c-s.offset,s=s.parent,r(l+c)},onArrayBegin:(l,c)=>{s=n({type:"array",offset:l,length:-1,parent:s,children:[]})},onArrayEnd:(l,c)=>{s.length=l+c-s.offset,s=s.parent,r(l+c)},onLiteralValue:(l,c,u)=>{n({type:Ks(l),offset:c,length:u,parent:s,value:l}),r(c+u)},onSeparator:(l,c,u)=>{s.type==="property"&&(l===":"?s.colonOffset=c:l===","&&r(c))},onError:(l,c,u)=>{e.push({error:l,offset:c,length:u})}},i);const a=s.children[0];return a&&delete a.parent,a}function ku(t,e){if(!t)return;let i=t;for(const s of e)if(typeof s=="string"){if(i.type!=="object"||!Array.isArray(i.children))return;let r=!1;for(const n of i.children)if(Array.isArray(n.children)&&n.children[0].value===s){i=n.children[1],r=!0;break}if(!r)return}else{const r=s;if(i.type!=="array"||r<0||!Array.isArray(i.children)||r>=i.children.length)return;i=i.children[r]}return i}function ln(t,e,i=Zs.DEFAULT){const s=$u(t,!1);function r($){return $?()=>$(s.getTokenOffset(),s.getTokenLength()):()=>!0}function n($){return $?j=>$(j,s.getTokenOffset(),s.getTokenLength()):()=>!0}const o=r(e.onObjectBegin),a=n(e.onObjectProperty),l=r(e.onObjectEnd),c=r(e.onArrayBegin),u=r(e.onArrayEnd),f=n(e.onLiteralValue),d=n(e.onSeparator),p=r(e.onComment),m=n(e.onError),w=i&&i.disallowComments,y=i&&i.allowTrailingComma;function b(){for(;;){const $=s.scan();switch(s.getTokenError()){case 4:S(14);break;case 5:S(15);break;case 3:S(13);break;case 1:w||S(11);break;case 2:S(12);break;case 6:S(16);break}switch($){case 12:case 13:w?S(10):p();break;case 16:S(1);break;case 15:case 14:break;default:return $}}}function S($,j=[],ve=[]){if(m($),j.length+ve.length>0){let B=s.getToken();for(;B!==17;){if(j.indexOf(B)!==-1){b();break}else if(ve.indexOf(B)!==-1)break;B=b()}}}function I($){const j=s.getTokenValue();return $?f(j):a(j),b(),!0}function M(){switch(s.getToken()){case 11:{let $=0;try{$=JSON.parse(s.getTokenValue()),typeof $!="number"&&(S(2),$=0)}catch{S(2)}f($);break}case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return b(),!0}function te(){return s.getToken()!==10?(S(3,[],[2,5]),!1):(I(!1),s.getToken()===6?(d(":"),b(),O()||S(4,[],[2,5])):S(5,[],[2,5]),!0)}function we(){o(),b();let $=!1;for(;s.getToken()!==2&&s.getToken()!==17;){if(s.getToken()===5){if($||S(4,[],[]),d(","),b(),s.getToken()===2&&y)break}else $&&S(6,[],[]);te()||S(4,[],[2,5]),$=!0}return l(),s.getToken()!==2?S(7,[2],[]):b(),!0}function D(){c(),b();let $=!1;for(;s.getToken()!==4&&s.getToken()!==17;){if(s.getToken()===5){if($||S(4,[],[]),d(","),b(),s.getToken()===4&&y)break}else $&&S(6,[],[]);O()||S(4,[],[4,5]),$=!0}return u(),s.getToken()!==4?S(8,[4],[]):b(),!0}function O(){switch(s.getToken()){case 3:return D();case 1:return we();case 10:return I(!0);default:return M()}}return b(),s.getToken()===17?i.allowEmptyContent?!0:(S(4,[],[]),!1):O()?(s.getToken()!==17&&S(9,[],[]),!0):(S(4,[],[]),!1)}function Ks(t){switch(typeof t){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(t){if(Array.isArray(t))return"array"}else return"null";return"object"}default:return"null"}}function Hp(t,e,i){let s,r,n,o,a;if(e){for(o=e.offset,a=o+e.length,n=o;n>0&&!cn(t,n-1);)n--;let I=a;for(;I<t.length&&!cn(t,I);)I++;r=t.substring(n,I),s=Gp(r,i)}else r=t,s=0,n=0,o=0,a=t.length;const l=Jp(i,t);let c=!1,u=0,f;i.insertSpaces?f=Vo(" ",i.tabSize||4):f="	";const d=$u(r,!1);let p=!1;function m(){return l+Vo(f,s+u)}function w(){let I=d.scan();for(c=!1;I===15||I===14;)c=c||I===14,I=d.scan();return p=I===16||d.getTokenError()!==0,I}const y=[];function b(I,M,te){!p&&M<a&&te>o&&t.substring(M,te)!==I&&y.push({offset:M,length:te-M,content:I})}let S=w();if(S!==17){const I=d.getTokenOffset()+n,M=Vo(f,s);b(M,n,I)}for(;S!==17;){let I=d.getTokenOffset()+d.getTokenLength()+n,M=w(),te="";for(;!c&&(M===12||M===13);){const D=d.getTokenOffset()+n;b(" ",I,D),I=d.getTokenOffset()+d.getTokenLength()+n,te=M===12?m():"",M=w()}if(M===2)S!==1&&(u--,te=m());else if(M===4)S!==3&&(u--,te=m());else{switch(S){case 3:case 1:u++,te=m();break;case 5:case 12:te=m();break;case 13:c?te=m():te=" ";break;case 6:te=" ";break;case 10:if(M===6){te="";break}case 7:case 8:case 9:case 11:case 2:case 4:M===12||M===13?te=" ":M!==5&&M!==17&&(p=!0);break;case 16:p=!0;break}c&&(M===12||M===13)&&(te=m())}const we=d.getTokenOffset()+n;b(te,I,we),S=M}return y}function Vo(t,e){let i="";for(let s=0;s<e;s++)i+=t;return i}function Gp(t,e){let i=0,s=0;const r=e.tabSize||4;for(;i<t.length;){const n=t.charAt(i);if(n===" ")s++;else if(n==="	")s+=r;else break;i++}return Math.floor(s/r)}function Jp(t,e){for(let i=0;i<e.length;i++){const s=e.charAt(i);if(s==="\r")return i+1<e.length&&e.charAt(i+1)===`
`?`\r
`:"\r";if(s===`
`)return`
`}return t&&t.eol||`
`}function cn(t,e){return`\r
`.indexOf(t.charAt(e))!==-1}function Qp(t,e,i,s,r){const n=e.slice(),a=Wp(t,[]);let l,c;for(;n.length>0&&(c=n.pop(),l=ku(a,n),l===void 0&&i!==void 0);)typeof c=="string"?i={[c]:i}:i=[i];if(l)if(l.type==="object"&&typeof c=="string"&&Array.isArray(l.children)){const u=ku(l,[c]);if(u!==void 0)if(i===void 0){if(!u.parent)throw new Error("Malformed AST");const f=l.children.indexOf(u.parent);let d,p=u.parent.offset+u.parent.length;if(f>0){const m=l.children[f-1];d=m.offset+m.length}else d=l.offset+1,l.children.length>1&&(p=l.children[1].offset);return fs(t,{offset:d,length:p-d,content:""},s)}else return fs(t,{offset:u.offset,length:u.length,content:JSON.stringify(i)},s);else{if(i===void 0)return[];const f=`${JSON.stringify(c)}: ${JSON.stringify(i)}`,d=r?r(l.children.map(m=>m.children[0].value)):l.children.length;let p;if(d>0){const m=l.children[d-1];p={offset:m.offset+m.length,length:0,content:","+f}}else l.children.length===0?p={offset:l.offset+1,length:0,content:f}:p={offset:l.offset+1,length:0,content:f+","};return fs(t,p,s)}}else if(l.type==="array"&&typeof c=="number"&&Array.isArray(l.children))if(i!==void 0){const u=`${JSON.stringify(i)}`;let f;if(l.children.length===0||c===0)f={offset:l.offset+1,length:0,content:l.children.length===0?u:u+","};else{const d=c===-1||c>l.children.length?l.children.length:c,p=l.children[d-1];f={offset:p.offset+p.length,length:0,content:","+u}}return fs(t,f,s)}else{const u=c,f=l.children[u];let d;if(l.children.length===1)d={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===u){const p=l.children[u-1],m=p.offset+p.length,w=l.offset+l.length;d={offset:m,length:w-2-m,content:""}}else d={offset:f.offset,length:l.children[u+1].offset-f.offset,content:""};return fs(t,d,s)}else throw new Error(`Can not add ${typeof c!="number"?"index":"property"} to parent of type ${l.type}`);else return i===void 0?[]:fs(t,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(i)},s)}function fs(t,e,i){let s=zo(t,e),r=e.offset,n=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;r>0&&!cn(s,r-1);)r--;for(;n<s.length&&!cn(s,n);)n++}const o=Hp(s,{offset:r,length:n-r},i);for(let l=o.length-1;l>=0;l--){const c=o[l];s=zo(s,c),r=Math.min(r,c.offset),n=Math.max(n,c.offset+c.length),n+=c.content.length-c.length}const a=t.length-(s.length-n)-r;return[{offset:r,length:a,content:s.substring(r,n)}]}function zo(t,e){return t.substring(0,e.offset)+e.content+t.substring(e.offset+e.length)}function Zp(t,e){const i=e.slice(0).sort((r,n)=>{const o=r.offset-n.offset;return o===0?r.length-n.length:o});let s=t.length;for(let r=i.length-1;r>=0;r--){const n=i[r];if(n.offset+n.length<=s)t=zo(t,n);else throw new Error("Overlapping edit");s=n.offset}return t}function ai(t){if(!t||typeof t!="object"||t instanceof RegExp)return t;const e=Array.isArray(t)?[]:{};return Object.entries(t).forEach(([i,s])=>{e[i]=s&&typeof s=="object"?ai(s):s}),e}function Xp(t){if(!t||typeof t!="object")return t;const e=[t];for(;e.length>0;){const i=e.shift();Object.freeze(i);for(const s in i)if(Iu.call(i,s)){const r=i[s];typeof r=="object"&&!Object.isFrozen(r)&&!_d(r)&&e.push(r)}}return t}var Iu=Object.prototype.hasOwnProperty;function Kp(t,e){return Bo(t,e,new Set)}function Bo(t,e,i){if(Qe(t))return t;const s=e(t);if(typeof s<"u")return s;if(Array.isArray(t)){const r=[];for(const n of t)r.push(Bo(n,e,i));return r}if(Oe(t)){if(i.has(t))throw new Error("Cannot clone recursive data-structure");i.add(t);const r={};for(const n in t)Iu.call(t,n)&&(r[n]=Bo(t[n],e,i));return i.delete(t),r}return t}function un(t,e,i=!0){return Oe(t)?(Oe(e)&&Object.keys(e).forEach(s=>{s in t?i&&(Oe(t[s])&&Oe(e[s])?un(t[s],e[s],i):t[s]=e[s]):t[s]=e[s]}),t):e}function Wt(t,e){if(t===e)return!0;if(t==null||e===null||e===void 0||typeof t!=typeof e||typeof t!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let i,s;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(i=0;i<t.length;i++)if(!Wt(t[i],e[i]))return!1}else{const r=[];for(s in t)r.push(s);r.sort();const n=[];for(s in e)n.push(s);if(n.sort(),!Wt(r,n))return!1;for(i=0;i<r.length;i++)if(!Wt(t[r[i]],e[r[i]]))return!1}return!0}function Du(t){const e=new Set;return JSON.stringify(t,(i,s)=>{if(Oe(s)||Array.isArray(s)){if(e.has(s))return"[Circular]";e.add(s)}return typeof s=="bigint"?`[BigInt ${s.toString()}]`:s})}function Au(t,e){const i=e.toLowerCase(),s=Object.keys(t).find(r=>r.toLowerCase()===i);return s?t[s]:t[e]}function Yp(t){let e=!1;const i=new Map,s=new Map;if(eg(t,u=>{if(t===u)return!0;const f=JSON.stringify(u);if(f.length<30)return!0;const d=i.get(f);if(!d){const p={schemas:[u]};return i.set(f,p),s.set(u,p),!0}return d.schemas.push(u),s.set(u,d),e=!0,!1}),i.clear(),!e)return JSON.stringify(t);let n="$defs";for(;t.hasOwnProperty(n);)n+="_";const o=[];function a(u){return JSON.stringify(u,(f,d)=>{if(d!==u){const p=s.get(d);if(p&&p.schemas.length>1)return p.id||(p.id=`_${o.length}`,o.push(p.schemas[0])),{$ref:`#/${n}/${p.id}`}}return d})}const l=a(t),c=[];for(let u=0;u<o.length;u++)c.push(`"_${u}":${a(o[u])}`);return c.length?`${l.substring(0,l.length-1)},"${n}":{${c.join(",")}}}`:l}function ds(t){return typeof t=="object"&&t!==null}function eg(t,e){if(!t||typeof t!="object")return;const i=(...l)=>{for(const c of l)ds(c)&&o.push(c)},s=(...l)=>{for(const c of l)if(ds(c))for(const u in c){const f=c[u];ds(f)&&o.push(f)}},r=(...l)=>{for(const c of l)if(Array.isArray(c))for(const u of c)ds(u)&&o.push(u)},n=l=>{if(Array.isArray(l))for(const c of l)ds(c)&&o.push(c);else ds(l)&&o.push(l)},o=[t];let a=o.pop();for(;a;)e(a)&&(i(a.additionalItems,a.additionalProperties,a.not,a.contains,a.propertyNames,a.if,a.then,a.else,a.unevaluatedItems,a.unevaluatedProperties),s(a.definitions,a.$defs,a.properties,a.patternProperties,a.dependencies,a.dependentSchemas),r(a.anyOf,a.allOf,a.oneOf,a.prefixItems),n(a.items)),a=o.pop()}var tg=class{constructor(){this.a=new Map}add(t,e){mo(xe(t)),mo(Oe(e)),mo(!this.a.has(t),"There is already an extension with this id"),this.a.set(t,e)}knows(t){return this.a.has(t)}as(t){return this.a.get(t)||null}dispose(){this.a.forEach(t=>{Bd(t.dispose)&&t.dispose()}),this.a.clear()}},Tt=new tg,Ru={JSONContribution:"base.contributions.json"};function Lu(t){return t.length>0&&t.charAt(t.length-1)==="#"?t.substring(0,t.length-1):t}var ig=class extends J{constructor(){super(...arguments),this.a={},this.b={},this.c=this.B(new N),this.onDidChangeSchema=this.c.event,this.f=this.B(new N),this.onDidChangeSchemaAssociations=this.f.event}registerSchema(t,e,i){const s=Lu(t);this.a[s]=e,this.c.fire(t),i&&i.add(Se(()=>{delete this.a[s],this.c.fire(t)}))}registerSchemaAssociation(t,e){const i=Lu(t);return this.b[i]||(this.b[i]=[]),this.b[i].includes(e)||(this.b[i].push(e),this.f.fire()),Se(()=>{const s=this.b[i];if(s){const r=s.indexOf(e);r!==-1&&(s.splice(r,1),s.length===0&&delete this.b[i],this.f.fire())}})}notifySchemaChanged(t){this.c.fire(t)}getSchemaContributions(){return{schemas:this.a}}getSchemaContent(t){const e=this.a[t];return e?Yp(e):void 0}hasSchemaContent(t){return!!this.a[t]}getSchemaAssociations(){return this.b}},sg=new ig;Tt.add(Ru.JSONContribution,sg);var Ou;(function(t){t.Multiline="multilineText",t.Singleline="singlelineText"})(Ou||(Ou={}));var li={Configuration:"base.contributions.configuration"},Nu;(function(t){t[t.APPLICATION=1]="APPLICATION",t[t.MACHINE=2]="MACHINE",t[t.APPLICATION_MACHINE=3]="APPLICATION_MACHINE",t[t.WINDOW=4]="WINDOW",t[t.RESOURCE=5]="RESOURCE",t[t.LANGUAGE_OVERRIDABLE=6]="LANGUAGE_OVERRIDABLE",t[t.MACHINE_OVERRIDABLE=7]="MACHINE_OVERRIDABLE"})(Nu||(Nu={}));var hn={properties:{},patternProperties:{}},fn={properties:{},patternProperties:{}},dn={properties:{},patternProperties:{}},pn={properties:{},patternProperties:{}},gn={properties:{},patternProperties:{}},mn={properties:{},patternProperties:{}},Ys={properties:{},patternProperties:{}},Ui="vscode://schemas/settings/resourceLanguage",wn=Tt.as(Ru.JSONContribution),rg=class extends J{constructor(){super(),this.a=[],this.n=new Set,this.r=this.B(new N),this.onDidSchemaChange=this.r.event,this.s=this.B(new N),this.onDidUpdateConfiguration=this.s.event,this.b=new Map,this.c={id:"defaultOverrides",title:g(1787,null),properties:{}},this.f=[this.c],this.m={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.g={},this.h=new Map,this.j={},wn.registerSchema(Ui,this.m),this.N()}registerConfiguration(t,e=!0){return this.registerConfigurations([t],e),t}registerConfigurations(t,e=!0){const i=new Set;this.F(t,e,i),wn.registerSchema(Ui,this.m),this.r.fire(),this.s.fire({properties:i})}deregisterConfigurations(t){const e=new Set;this.G(t,e),wn.registerSchema(Ui,this.m),this.r.fire(),this.s.fire({properties:e})}updateConfigurations({add:t,remove:e}){const i=new Set;this.G(e,i),this.F(t,!1,i),wn.registerSchema(Ui,this.m),this.r.fire(),this.s.fire({properties:i})}registerDefaultConfigurations(t){const e=new Set;this.u(t,e),this.r.fire(),this.s.fire({properties:e,defaultsOverrides:!0})}u(t,e){this.a.push(...t);const i=[];for(const{overrides:s,source:r}of t)for(const n in s){e.add(n);const o=this.b.get(n)??this.b.set(n,{configurationDefaultOverrides:[]}).get(n),a=s[n];if(o.configurationDefaultOverrides.push({value:a,source:r}),ci.test(n)){const l=this.z(n,a,r,o.configurationDefaultOverrideValue);if(!l)continue;o.configurationDefaultOverrideValue=l,this.y(n,l,r),i.push(...er(n))}else{const l=this.C(n,a,r,o.configurationDefaultOverrideValue);if(!l)continue;o.configurationDefaultOverrideValue=l;const c=this.g[n];c&&(this.O(n,c),this.J(n,c))}}this.D(i)}deregisterDefaultConfigurations(t){const e=new Set;this.w(t,e),this.r.fire(),this.s.fire({properties:e,defaultsOverrides:!0})}w(t,e){for(const i of t){const s=this.a.indexOf(i);s!==-1&&this.a.splice(s,1)}for(const{overrides:i,source:s}of t)for(const r in i){const n=this.b.get(r);if(!n)continue;const o=n.configurationDefaultOverrides.findIndex(a=>s?a.source?.id===s.id:a.value===i[r]);if(o!==-1){if(n.configurationDefaultOverrides.splice(o,1),n.configurationDefaultOverrides.length===0&&this.b.delete(r),ci.test(r)){let a;for(const l of n.configurationDefaultOverrides)a=this.z(r,l.value,l.source,a);a&&!hc(a.value)?(n.configurationDefaultOverrideValue=a,this.y(r,a,s)):(this.b.delete(r),delete this.g[r],delete this.c.properties[r])}else{let a;for(const c of n.configurationDefaultOverrides)a=this.C(r,c.value,c.source,a);n.configurationDefaultOverrideValue=a;const l=this.g[r];l&&(this.O(r,l),this.J(r,l))}e.add(r)}}this.M()}y(t,e,i){const s={type:"object",default:e.value,description:g(1788,null,Pp(t)),$ref:Ui,defaultDefaultValue:e.value,source:i,defaultValueSource:i};this.g[t]=s,this.c.properties[t]=s}z(t,e,i,s){const r=s?.value||{},n=s?.source??new Map;if(!(n instanceof Map)){console.error("objectConfigurationSources is not a Map");return}for(const o of Object.keys(e)){const a=e[o];if(Oe(a)&&(xt(r[o])||Oe(r[o]))){if(r[o]={...r[o]??{},...a},i)for(const c in a)n.set(`${o}.${c}`,i)}else r[o]=a,i?n.set(o,i):n.delete(o)}return{value:r,source:n}}C(t,e,i,s){const r=this.g[t],n=s?.value??r?.defaultDefaultValue;let o=i;if(Oe(e)&&(r!==void 0&&r.type==="object"||r===void 0&&(xt(n)||Oe(n)))){if(o=s?.source??new Map,!(o instanceof Map)){console.error("defaultValueSource is not a Map");return}for(const l in e)i&&o.set(`${t}.${l}`,i);e={...Oe(n)?n:{},...e}}return{value:e,source:o}}deltaConfiguration(t){let e=!1;const i=new Set;t.removedDefaults&&(this.w(t.removedDefaults,i),e=!0),t.addedDefaults&&(this.u(t.addedDefaults,i),e=!0),t.removedConfigurations&&this.G(t.removedConfigurations,i),t.addedConfigurations&&this.F(t.addedConfigurations,!1,i),this.r.fire(),this.s.fire({properties:i,defaultsOverrides:e})}notifyConfigurationSchemaUpdated(...t){this.r.fire()}registerOverrideIdentifiers(t){this.D(t),this.r.fire()}D(t){for(const e of t)this.n.add(e);this.M()}F(t,e,i){t.forEach(s=>{this.H(s,e,s.extensionInfo,s.restrictedProperties,void 0,i),this.f.push(s),this.I(s)})}G(t,e){const i=s=>{if(s.properties)for(const r in s.properties){e.add(r);const n=this.g[r];n?.policy?.name&&this.h.delete(n.policy.name),delete this.g[r],this.L(r,s.properties[r])}s.allOf?.forEach(r=>i(r))};for(const s of t){i(s);const r=this.f.indexOf(s);r!==-1&&this.f.splice(r,1)}}H(t,e=!0,i,s,r=4,n){r=Qe(t.scope)?r:t.scope;const o=t.properties;if(o)for(const l in o){const c=o[l];if(e&&ag(l,c)){delete o[l];continue}c.source=i,c.defaultDefaultValue=o[l].default,this.O(l,c),ci.test(l)?c.scope=void 0:(c.scope=Qe(c.scope)?r:c.scope,c.restricted=Qe(c.restricted)?!!s?.includes(l):c.restricted);const u=o[l].hasOwnProperty("included")&&!o[l].included,f=o[l].policy?.name;u?(this.j[l]=o[l],f&&(this.h.set(f,l),n.add(l)),delete o[l]):(n.add(l),f&&this.h.set(f,l),this.g[l]=o[l],!o[l].deprecationMessage&&o[l].markdownDeprecationMessage&&(o[l].deprecationMessage=o[l].markdownDeprecationMessage))}const a=t.allOf;if(a)for(const l of a)this.H(l,e,i,s,r,n)}getConfigurations(){return this.f}getConfigurationProperties(){return this.g}getPolicyConfigurations(){return this.h}getExcludedConfigurationProperties(){return this.j}getRegisteredDefaultConfigurations(){return[...this.a]}getConfigurationDefaultsOverrides(){const t=new Map;for(const[e,i]of this.b)i.configurationDefaultOverrideValue&&t.set(e,i.configurationDefaultOverrideValue);return t}I(t){const e=i=>{const s=i.properties;if(s)for(const n in s)this.J(n,s[n]);i.allOf?.forEach(e)};e(t)}J(t,e){switch(hn.properties[t]=e,e.scope){case 1:fn.properties[t]=e;break;case 2:pn.properties[t]=e;break;case 3:dn.properties[t]=e;break;case 7:gn.properties[t]=e;break;case 4:mn.properties[t]=e;break;case 5:Ys.properties[t]=e;break;case 6:Ys.properties[t]=e,this.m.properties[t]=e;break}}L(t,e){switch(delete hn.properties[t],e.scope){case 1:delete fn.properties[t];break;case 2:delete pn.properties[t];break;case 3:delete dn.properties[t];break;case 7:delete gn.properties[t];break;case 4:delete mn.properties[t];break;case 5:case 6:delete Ys.properties[t],delete this.m.properties[t];break}}M(){for(const t of this.n.values()){const e=`[${t}]`,i={type:"object",description:g(1789,null),errorMessage:g(1790,null),$ref:Ui};this.O(e,i),hn.properties[e]=i,fn.properties[e]=i,dn.properties[e]=i,pn.properties[e]=i,gn.properties[e]=i,mn.properties[e]=i,Ys.properties[e]=i}}N(){const t={type:"object",description:g(1791,null),errorMessage:g(1792,null),$ref:Ui};hn.patternProperties[wi]=t,fn.patternProperties[wi]=t,dn.patternProperties[wi]=t,pn.patternProperties[wi]=t,gn.patternProperties[wi]=t,mn.patternProperties[wi]=t,Ys.patternProperties[wi]=t,this.r.fire()}O(t,e){const i=this.b.get(t)?.configurationDefaultOverrideValue;let s,r;i&&(!e.disallowConfigurationDefault||!i.source)&&(s=i.value,r=i.source),xt(s)&&(s=e.defaultDefaultValue,r=void 0),xt(s)&&(s=og(e.type)),e.default=s,e.defaultValueSource=r}},Cu="\\[([^\\]]+)\\]",Fu=new RegExp(Cu,"g"),wi=`^(${Cu})+$`,ci=new RegExp(wi);function er(t){const e=[];if(ci.test(t)){let i=Fu.exec(t);for(;i?.length;){const s=i[1].trim();s&&e.push(s),i=Fu.exec(t)}}return Yt(e)}function ng(t){return t.reduce((e,i)=>`${e}[${i}]`,"")}function og(t){switch(Array.isArray(t)?t[0]:t){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}var vn=new rg;Tt.add(li.Configuration,vn);function ag(t,e){return t.trim()?ci.test(t)?g(1794,null,t):vn.getConfigurationProperties()[t]!==void 0?g(1795,null,t):e.policy?.name&&vn.getPolicyConfigurations().get(e.policy?.name)!==void 0?g(1796,null,t,e.policy?.name,vn.getPolicyConfigurations().get(e.policy?.name)):null:g(1793,null)}function tr(t){return Object.isFrozen(t)?t:Xp(t)}var Ce=class Zi{static createEmptyModel(e){return new Zi({},[],[],void 0,e)}constructor(e,i,s,r,n){this.b=e,this.c=i,this.d=s,this.raw=r,this.f=n,this.a=new Map}get rawConfiguration(){if(!this.g)if(this.raw){const e=(Array.isArray(this.raw)?this.raw:[this.raw]).map(i=>{if(i instanceof Zi)return i;const s=new Tu("",this.f);return s.parseRaw(i),s.configurationModel});this.g=e.reduce((i,s)=>s===i?s:i.merge(s),e[0])}else this.g=this;return this.g}get contents(){return this.b}get overrides(){return this.d}get keys(){return this.c}isEmpty(){return this.c.length===0&&Object.keys(this.b).length===0&&this.d.length===0}getValue(e){return e?sn(this.contents,e):this.contents}inspect(e,i){const s=this;return{get value(){return tr(s.rawConfiguration.getValue(e))},get override(){return i?tr(s.rawConfiguration.getOverrideValue(e,i)):void 0},get merged(){return tr(i?s.rawConfiguration.override(i).getValue(e):s.rawConfiguration.getValue(e))},get overrides(){const r=[];for(const{contents:n,identifiers:o,keys:a}of s.rawConfiguration.overrides){const l=new Zi(n,a,[],void 0,s.f).getValue(e);l!==void 0&&r.push({identifiers:o,value:l})}return r.length?tr(r):void 0}}}getOverrideValue(e,i){const s=this.j(i);return s?e?sn(s,e):s:void 0}getKeysForOverrideIdentifier(e){const i=[];for(const s of this.overrides)s.identifiers.includes(e)&&i.push(...s.keys);return Yt(i)}getAllOverrideIdentifiers(){const e=[];for(const i of this.overrides)e.push(...i.identifiers);return Yt(e)}override(e){let i=this.a.get(e);return i||(i=this.h(e),this.a.set(e,i)),i}merge(...e){const i=ai(this.contents),s=ai(this.overrides),r=[...this.keys],n=this.raw?Array.isArray(this.raw)?[...this.raw]:[this.raw]:[this];for(const o of e)if(n.push(...o.raw?Array.isArray(o.raw)?o.raw:[o.raw]:[o]),!o.isEmpty()){this.i(i,o.contents);for(const a of o.overrides){const[l]=s.filter(c=>ts(c.identifiers,a.identifiers));l?(this.i(l.contents,a.contents),l.keys.push(...a.keys),l.keys=Yt(l.keys)):s.push(ai(a))}for(const a of o.keys)r.indexOf(a)===-1&&r.push(a)}return new Zi(i,r,s,!n.length||n.every(o=>o instanceof Zi)?void 0:n,this.f)}h(e){const i=this.j(e);if(!i||typeof i!="object"||!Object.keys(i).length)return this;const s={};for(const r of Yt([...Object.keys(this.contents),...Object.keys(i)])){let n=this.contents[r];const o=i[r];o&&(typeof n=="object"&&typeof o=="object"?(n=ai(n),this.i(n,o)):n=o),s[r]=n}return new Zi(s,this.keys,this.overrides,void 0,this.f)}i(e,i){for(const s of Object.keys(i)){if(s in e&&Oe(e[s])&&Oe(i[s])){this.i(e[s],i[s]);continue}e[s]=ai(i[s])}}j(e){let i=null,s=null;const r=n=>{n&&(s?this.i(s,n):s=ai(n))};for(const n of this.overrides)n.identifiers.length===1&&n.identifiers[0]===e?i=n.contents:n.identifiers.includes(e)&&r(n.contents);return r(i),s}toJSON(){return{contents:this.contents,overrides:this.overrides,keys:this.keys}}addValue(e,i){this.k(e,i,!0)}setValue(e,i){this.k(e,i,!1)}removeValue(e){const i=this.keys.indexOf(e);i!==-1&&(this.keys.splice(i,1),$p(this.contents,e),ci.test(e)&&this.overrides.splice(this.overrides.findIndex(s=>ts(s.identifiers,er(e))),1))}k(e,i,s){if(mu(this.contents,e,i,r=>this.f.error(r)),s=s||this.keys.indexOf(e)===-1,s&&this.keys.push(e),ci.test(e)){const r=er(e),n={identifiers:r,keys:Object.keys(this.contents[e]),contents:Fo(this.contents[e],a=>this.f.error(a))},o=this.overrides.findIndex(a=>ts(a.identifiers,r));o!==-1?this.overrides[o]=n:this.overrides.push(n)}}},Tu=class{constructor(t,e){this.f=t,this.g=e,this.a=null,this.b=null,this.c=[],this.d=[]}get configurationModel(){return this.b||Ce.createEmptyModel(this.g)}get restrictedConfigurations(){return this.c}get errors(){return this.d}parse(t,e){if(!Qe(t)){const i=this.h(t);this.parseRaw(i,e)}}reparse(t){this.a&&this.parseRaw(this.a,t)}parseRaw(t,e){this.a=t;const{contents:i,keys:s,overrides:r,restricted:n,hasExcludedProperties:o}=this.i(t,e);this.b=new Ce(i,s,r,o?[t]:void 0,this.g),this.c=n||[]}h(t){let e={},i=null,s=[];const r=[],n=[];function o(l){Array.isArray(s)?s.push(l):i!==null&&(s[i]=l)}const a={onObjectBegin:()=>{const l={};o(l),r.push(s),s=l,i=null},onObjectProperty:l=>{i=l},onObjectEnd:()=>{s=r.pop()},onArrayBegin:()=>{const l=[];o(l),r.push(s),s=l,i=null},onArrayEnd:()=>{s=r.pop()},onLiteralValue:o,onError:(l,c,u)=>{n.push({error:l,offset:c,length:u})}};if(t)try{ln(t,a),e=s[0]||{}}catch(l){this.g.error(`Error while parsing settings file ${this.f}: ${l}`),this.d=[l]}return e}i(t,e){const i=Tt.as(li.Configuration).getConfigurationProperties(),s=this.j(t,i,!0,e);t=s.raw;const r=Fo(t,a=>this.g.error(`Conflict in settings file ${this.f}: ${a}`)),n=Object.keys(t),o=this.m(t,a=>this.g.error(`Conflict in settings file ${this.f}: ${a}`));return{contents:r,keys:n,overrides:o,restricted:s.restricted,hasExcludedProperties:s.hasExcludedProperties}}j(t,e,i,s){let r=!1;if(!s?.scopes&&!s?.skipRestricted&&!s?.exclude?.length)return{raw:t,restricted:[],hasExcludedProperties:r};const n={},o=[];for(const a in t)if(ci.test(a)&&i){const l=this.j(t[a],e,!1,s);n[a]=l.raw,r=r||l.hasExcludedProperties,o.push(...l.restricted)}else{const l=e[a];l?.restricted&&o.push(a),this.l(a,l,s)?n[a]=t[a]:r=!0}return{raw:n,restricted:o,hasExcludedProperties:r}}l(t,e,i){if(i.exclude?.includes(t))return!1;if(i.include?.includes(t))return!0;if(i.skipRestricted&&e?.restricted||i.skipUnregistered&&!e)return!1;const s=e?typeof e.scope<"u"?e.scope:4:void 0;return s===void 0||i.scopes===void 0?!0:i.scopes.includes(s)}m(t,e){const i=[];for(const s of Object.keys(t))if(ci.test(s)){const r={};for(const n in t[s])r[n]=t[s][n];i.push({identifiers:er(s),keys:Object.keys(r),contents:Fo(r,e)})}return i}},lg=class extends J{constructor(t,e,i,s,r){super(),this.c=t,this.f=e,this.g=s,this.h=r,this.b=this.B(new N),this.onDidChange=this.b.event,this.a=new Tu(this.c.toString(),r),this.B(this.g.watch(i.dirname(this.c))),this.B(this.g.watch(this.c)),this.B(oe.any(oe.filter(this.g.onDidFilesChange,n=>n.contains(this.c)),oe.filter(this.g.onDidRunOperation,n=>(n.isOperation(0)||n.isOperation(3)||n.isOperation(1)||n.isOperation(4))&&i.isEqual(n.resource,t)))(()=>this.b.fire()))}async loadConfiguration(){try{const t=await this.g.readFile(this.c);return this.a.parse(t.value.toString()||"{}",this.f),this.a.configurationModel}catch{return Ce.createEmptyModel(this.h)}}reparse(t){return t&&(this.f=t),this.a.reparse(this.f),this.a.configurationModel}getRestrictedSettings(){return this.a.restrictedConfigurations}},cg=class{constructor(t,e,i,s,r,n,o,a,l,c,u,f,d){this.a=t,this.b=e,this.c=i,this.overrideIdentifiers=s,this.d=r,this.f=n,this.g=o,this.h=a,this.i=l,this.j=c,this.k=u,this.l=f,this.m=d}get value(){return tr(this.c)}n(t){return t?.value!==void 0||t?.override!==void 0||t?.overrides!==void 0?t:void 0}get q(){return this.p||(this.p=this.d.inspect(this.a,this.b.overrideIdentifier)),this.p}get defaultValue(){return this.q.merged}get default(){return this.n(this.q)}get s(){return this.r===void 0&&(this.r=this.f?this.f.inspect(this.a):null),this.r}get policyValue(){return this.s?.merged}get policy(){return this.s?.value!==void 0?{value:this.s.value}:void 0}get u(){return this.t===void 0&&(this.t=this.g?this.g.inspect(this.a):null),this.t}get applicationValue(){return this.u?.merged}get application(){return this.n(this.u)}get w(){return this.v||(this.v=this.h.inspect(this.a,this.b.overrideIdentifier)),this.v}get userValue(){return this.w.merged}get user(){return this.n(this.w)}get y(){return this.x||(this.x=this.i.inspect(this.a,this.b.overrideIdentifier)),this.x}get userLocalValue(){return this.y.merged}get userLocal(){return this.n(this.y)}get A(){return this.z||(this.z=this.j.inspect(this.a,this.b.overrideIdentifier)),this.z}get userRemoteValue(){return this.A.merged}get userRemote(){return this.n(this.A)}get D(){return this.B===void 0&&(this.B=this.k?this.k.inspect(this.a,this.b.overrideIdentifier):null),this.B}get workspaceValue(){return this.D?.merged}get workspace(){return this.n(this.D)}get F(){return this.E===void 0&&(this.E=this.l?this.l.inspect(this.a,this.b.overrideIdentifier):null),this.E}get workspaceFolderValue(){return this.F?.merged}get workspaceFolder(){return this.n(this.F)}get H(){return this.G===void 0&&(this.G=this.m.inspect(this.a,this.b.overrideIdentifier)),this.G}get memoryValue(){return this.H.merged}get memory(){return this.n(this.H)}},qo=class B1{constructor(e,i,s,r,n,o,a,l,c,u){this.j=e,this.l=i,this.m=s,this.n=r,this.p=n,this.q=o,this.r=a,this.s=l,this.t=c,this.u=u,this.h=null,this.i=new Je,this.v=null}getValue(e,i,s){return this.w(e,i,s).getValue(e)}updateValue(e,i,s={}){let r;s.resource?(r=this.t.get(s.resource),r||(r=Ce.createEmptyModel(this.u),this.t.set(s.resource,r))):r=this.s,i===void 0?r.removeValue(e):r.setValue(e,i),s.resource||(this.h=null)}inspect(e,i,s){const r=this.w(e,i,s),n=this.A(i.resource,s),o=i.resource?this.t.get(i.resource)||this.s:this.s,a=new Set;for(const l of r.overrides)for(const c of l.identifiers)r.getOverrideValue(e,c)!==void 0&&a.add(c);return new cg(e,i,r.getValue(e),a.size?[...a]:void 0,this.j,this.l.isEmpty()?void 0:this.l,this.applicationConfiguration.isEmpty()?void 0:this.applicationConfiguration,this.userConfiguration,this.localUserConfiguration,this.remoteUserConfiguration,s?this.q:void 0,n||void 0,o)}keys(e){const i=this.A(void 0,e);return{default:this.j.keys.slice(0),user:this.userConfiguration.keys.slice(0),workspace:this.q.keys.slice(0),workspaceFolder:i?i.keys.slice(0):[]}}updateDefaultConfiguration(e){this.j=e,this.h=null,this.i.clear()}updatePolicyConfiguration(e){this.l=e}updateApplicationConfiguration(e){this.m=e,this.h=null,this.i.clear()}updateLocalUserConfiguration(e){this.n=e,this.v=null,this.h=null,this.i.clear()}updateRemoteUserConfiguration(e){this.p=e,this.v=null,this.h=null,this.i.clear()}updateWorkspaceConfiguration(e){this.q=e,this.h=null,this.i.clear()}updateFolderConfiguration(e,i){this.r.set(e,i),this.i.delete(e)}deleteFolderConfiguration(e){this.folderConfigurations.delete(e),this.i.delete(e)}compareAndUpdateDefaultConfiguration(e,i){const s=[];if(!i){const{added:r,updated:n,removed:o}=vi(this.j,e);i=[...r,...n,...o]}for(const r of i)for(const n of er(r)){const o=this.j.getKeysForOverrideIdentifier(n),a=e.getKeysForOverrideIdentifier(n),l=[...a.filter(c=>o.indexOf(c)===-1),...o.filter(c=>a.indexOf(c)===-1),...o.filter(c=>!Wt(this.j.override(n).getValue(c),e.override(n).getValue(c)))];s.push([n,l])}return this.updateDefaultConfiguration(e),{keys:i,overrides:s}}compareAndUpdatePolicyConfiguration(e){const{added:i,updated:s,removed:r}=vi(this.l,e),n=[...i,...s,...r];return n.length&&this.updatePolicyConfiguration(e),{keys:n,overrides:[]}}compareAndUpdateApplicationConfiguration(e){const{added:i,updated:s,removed:r,overrides:n}=vi(this.applicationConfiguration,e),o=[...i,...s,...r];return o.length&&this.updateApplicationConfiguration(e),{keys:o,overrides:n}}compareAndUpdateLocalUserConfiguration(e){const{added:i,updated:s,removed:r,overrides:n}=vi(this.localUserConfiguration,e),o=[...i,...s,...r];return o.length&&this.updateLocalUserConfiguration(e),{keys:o,overrides:n}}compareAndUpdateRemoteUserConfiguration(e){const{added:i,updated:s,removed:r,overrides:n}=vi(this.remoteUserConfiguration,e),o=[...i,...s,...r];return o.length&&this.updateRemoteUserConfiguration(e),{keys:o,overrides:n}}compareAndUpdateWorkspaceConfiguration(e){const{added:i,updated:s,removed:r,overrides:n}=vi(this.workspaceConfiguration,e),o=[...i,...s,...r];return o.length&&this.updateWorkspaceConfiguration(e),{keys:o,overrides:n}}compareAndUpdateFolderConfiguration(e,i){const s=this.folderConfigurations.get(e),{added:r,updated:n,removed:o,overrides:a}=vi(s,i),l=[...r,...n,...o];return(l.length||!s)&&this.updateFolderConfiguration(e,i),{keys:l,overrides:a}}compareAndDeleteFolderConfiguration(e){const i=this.folderConfigurations.get(e);if(!i)throw new Error("Unknown folder");this.deleteFolderConfiguration(e);const{added:s,updated:r,removed:n,overrides:o}=vi(i,void 0);return{keys:[...s,...r,...n],overrides:o}}get defaults(){return this.j}get applicationConfiguration(){return this.m}get userConfiguration(){if(!this.v)if(this.p.isEmpty())this.v=this.n;else{const e=this.n.merge(this.p);this.v=new Ce(e.contents,e.keys,e.overrides,void 0,this.u)}return this.v}get localUserConfiguration(){return this.n}get remoteUserConfiguration(){return this.p}get workspaceConfiguration(){return this.q}get folderConfigurations(){return this.r}w(e,i,s){let r=this.x(i,s);if(i.overrideIdentifier&&(r=r.override(i.overrideIdentifier)),!this.l.isEmpty()&&this.l.getValue(e)!==void 0){r=r.merge();for(const n of this.l.keys)r.setValue(n,this.l.getValue(n))}return r}x({resource:e},i){let s=this.y();if(i&&e){const r=i.getFolder(e);r&&(s=this.z(r.uri)||s);const n=this.t.get(e);n&&(s=s.merge(n))}return s}y(){return this.h||(this.h=this.j.merge(this.applicationConfiguration,this.userConfiguration,this.q,this.s)),this.h}z(e){let i=this.i.get(e);if(!i){const s=this.y(),r=this.r.get(e);r?(i=s.merge(r),this.i.set(e,i)):i=s}return i}A(e,i){if(i&&e){const s=i.getFolder(e);if(s)return this.r.get(s.uri)}}toData(){return{defaults:{contents:this.j.contents,overrides:this.j.overrides,keys:this.j.keys},policy:{contents:this.l.contents,overrides:this.l.overrides,keys:this.l.keys},application:{contents:this.applicationConfiguration.contents,overrides:this.applicationConfiguration.overrides,keys:this.applicationConfiguration.keys,raw:Array.isArray(this.applicationConfiguration.raw)?void 0:this.applicationConfiguration.raw},userLocal:{contents:this.localUserConfiguration.contents,overrides:this.localUserConfiguration.overrides,keys:this.localUserConfiguration.keys,raw:Array.isArray(this.localUserConfiguration.raw)?void 0:this.localUserConfiguration.raw},userRemote:{contents:this.remoteUserConfiguration.contents,overrides:this.remoteUserConfiguration.overrides,keys:this.remoteUserConfiguration.keys,raw:Array.isArray(this.remoteUserConfiguration.raw)?void 0:this.remoteUserConfiguration.raw},workspace:{contents:this.q.contents,overrides:this.q.overrides,keys:this.q.keys},folders:[...this.r.keys()].reduce((e,i)=>{const{contents:s,overrides:r,keys:n}=this.r.get(i);return e.push([i,{contents:s,overrides:r,keys:n}]),e},[])}}allKeys(){const e=new Set;return this.j.keys.forEach(i=>e.add(i)),this.userConfiguration.keys.forEach(i=>e.add(i)),this.q.keys.forEach(i=>e.add(i)),this.r.forEach(i=>i.keys.forEach(s=>e.add(s))),[...e.values()]}B(){const e=new Set;return this.j.getAllOverrideIdentifiers().forEach(i=>e.add(i)),this.userConfiguration.getAllOverrideIdentifiers().forEach(i=>e.add(i)),this.q.getAllOverrideIdentifiers().forEach(i=>e.add(i)),this.r.forEach(i=>i.getAllOverrideIdentifiers().forEach(s=>e.add(s))),[...e.values()]}D(e){const i=new Set;return this.j.getKeysForOverrideIdentifier(e).forEach(s=>i.add(s)),this.userConfiguration.getKeysForOverrideIdentifier(e).forEach(s=>i.add(s)),this.q.getKeysForOverrideIdentifier(e).forEach(s=>i.add(s)),this.r.forEach(s=>s.getKeysForOverrideIdentifier(e).forEach(r=>i.add(r))),[...i.values()]}static parse(e,i){const s=this.E(e.defaults,i),r=this.E(e.policy,i),n=this.E(e.application,i),o=this.E(e.userLocal,i),a=this.E(e.userRemote,i),l=this.E(e.workspace,i),c=e.folders.reduce((u,f)=>(u.set(k.revive(f[0]),this.E(f[1],i)),u),new Je);return new B1(s,r,n,o,a,l,c,Ce.createEmptyModel(i),new Je,i)}static E(e,i){return new Ce(e.contents,e.keys,e.overrides,e.raw,i)}},ug=class{constructor(t,e,i,s,r){this.change=t,this.f=e,this.g=i,this.h=s,this.i=r,this.a=`
`,this.b=this.a.charCodeAt(0),this.c=46,this.affectedKeys=new Set,this.j=void 0;for(const n of t.keys)this.affectedKeys.add(n);for(const[,n]of t.overrides)for(const o of n)this.affectedKeys.add(o);this.d=this.a;for(const n of this.affectedKeys)this.d+=n+this.a}get previousConfiguration(){return!this.j&&this.f&&(this.j=qo.parse(this.f.data,this.i)),this.j}affectsConfiguration(t,e){const i=this.a+t,s=this.d.indexOf(i);if(s<0)return!1;const r=s+i.length;if(r>=this.d.length)return!1;const n=this.d.charCodeAt(r);if(n!==this.b&&n!==this.c)return!1;if(e){const o=this.previousConfiguration?this.previousConfiguration.getValue(t,e,this.f?.workspace):void 0,a=this.g.getValue(t,e,this.h);return!Wt(o,a)}return!0}};function vi(t,e){const{added:i,removed:s,updated:r}=Uu(e?.rawConfiguration,t?.rawConfiguration),n=[],o=t?.getAllOverrideIdentifiers()||[],a=e?.getAllOverrideIdentifiers()||[];if(e){const l=a.filter(c=>!o.includes(c));for(const c of l)n.push([c,e.getKeysForOverrideIdentifier(c)])}if(t){const l=o.filter(c=>!a.includes(c));for(const c of l)n.push([c,t.getKeysForOverrideIdentifier(c)])}if(e&&t){for(const l of o)if(a.includes(l)){const c=Uu({contents:t.getOverrideValue(void 0,l)||{},keys:t.getKeysForOverrideIdentifier(l)},{contents:e.getOverrideValue(void 0,l)||{},keys:e.getKeysForOverrideIdentifier(l)});n.push([l,[...c.added,...c.removed,...c.updated]])}}return{added:i,removed:s,updated:r,overrides:n}}function Uu(t,e){const i=t?e?t.keys.filter(n=>e.keys.indexOf(n)===-1):[...t.keys]:[],s=e?t?e.keys.filter(n=>t.keys.indexOf(n)===-1):[...e.keys]:[],r=[];if(t&&e){for(const n of e.keys)if(t.keys.indexOf(n)!==-1){const o=sn(e.contents,n),a=sn(t.contents,n);Wt(o,a)||r.push(n)}}return{added:i,removed:s,updated:r}}function ps(t){return Wo(t,0)}function Wo(t,e){switch(typeof t){case"object":return t===null?ui(349,e):Array.isArray(t)?fg(t,e):dg(t,e);case"string":return Mu(t,e);case"boolean":return hg(t,e);case"number":return ui(t,e);case"undefined":return ui(937,e);default:return ui(617,e)}}function ui(t,e){return(e<<5)-e+t|0}function hg(t,e){return ui(t?433:863,e)}function Mu(t,e){e=ui(149417,e);for(let i=0,s=t.length;i<s;i++)e=ui(t.charCodeAt(i),e);return e}function fg(t,e){return e=ui(104579,e),t.reduce((i,s)=>Wo(s,i),e)}function dg(t,e){return e=ui(181387,e),Object.keys(t).sort().reduce((i,s)=>(i=Mu(s,i),Wo(t[s],i)),e)}var ju;(function(t){t[t.BLOCK_SIZE=64]="BLOCK_SIZE",t[t.UNICODE_REPLACEMENT=65533]="UNICODE_REPLACEMENT"})(ju||(ju={}));function Ho(t,e,i=32){const s=i-e,r=~((1<<s)-1);return(t<<e|(r&t)>>>s)>>>0}function ir(t,e=32){return t instanceof ArrayBuffer?qp(V.wrap(new Uint8Array(t))):(t>>>0).toString(16).padStart(e/4,"0")}var A7=class q1{static{this.g=new DataView(new ArrayBuffer(320))}constructor(){this.h=1732584193,this.l=4023233417,this.m=2562383102,this.n=271733878,this.o=3285377520,this.p=new Uint8Array(67),this.q=new DataView(this.p.buffer),this.r=0,this.t=0,this.u=0,this.v=!1}update(e){const i=e.length;if(i===0)return;const s=this.p;let r=this.r,n=this.u,o,a;for(n!==0?(o=n,a=-1,n=0):(o=e.charCodeAt(0),a=0);;){let l=o;if(C0(o))if(a+1<i){const c=e.charCodeAt(a+1);_c(c)?(a++,l=F0(o,c)):l=65533}else{n=o;break}else _c(o)&&(l=65533);if(r=this.w(s,r,l),a++,a<i)o=e.charCodeAt(a);else break}this.r=r,this.u=n}w(e,i,s){return s<128?e[i++]=s:s<2048?(e[i++]=192|(s&1984)>>>6,e[i++]=128|(s&63)>>>0):s<65536?(e[i++]=224|(s&61440)>>>12,e[i++]=128|(s&4032)>>>6,e[i++]=128|(s&63)>>>0):(e[i++]=240|(s&1835008)>>>18,e[i++]=128|(s&258048)>>>12,e[i++]=128|(s&4032)>>>6,e[i++]=128|(s&63)>>>0),i>=64&&(this.y(),i-=64,this.t+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),i}digest(){return this.v||(this.v=!0,this.u&&(this.u=0,this.r=this.w(this.p,this.r,65533)),this.t+=this.r,this.x()),ir(this.h)+ir(this.l)+ir(this.m)+ir(this.n)+ir(this.o)}x(){this.p[this.r++]=128,this.p.subarray(this.r).fill(0),this.r>56&&(this.y(),this.p.fill(0));const e=8*this.t;this.q.setUint32(56,Math.floor(e/4294967296),!1),this.q.setUint32(60,e%4294967296,!1),this.y()}y(){const e=q1.g,i=this.q;for(let f=0;f<64;f+=4)e.setUint32(f,i.getUint32(f,!1),!1);for(let f=64;f<320;f+=4)e.setUint32(f,Ho(e.getUint32(f-12,!1)^e.getUint32(f-32,!1)^e.getUint32(f-56,!1)^e.getUint32(f-64,!1),1),!1);let s=this.h,r=this.l,n=this.m,o=this.n,a=this.o,l,c,u;for(let f=0;f<80;f++)f<20?(l=r&n|~r&o,c=1518500249):f<40?(l=r^n^o,c=1859775393):f<60?(l=r&n|r&o|n&o,c=2400959708):(l=r^n^o,c=3395469782),u=Ho(s,5)+l+a+c+e.getUint32(f*4,!1)&4294967295,a=o,o=n,n=Ho(r,30),r=s,s=u;this.h=this.h+s&4294967295,this.l=this.l+r&4294967295,this.m=this.m+n&4294967295,this.n=this.n+o&4294967295,this.o=this.o+a&4294967295}},_u;(function(t){t[t.LParen=0]="LParen",t[t.RParen=1]="RParen",t[t.Neg=2]="Neg",t[t.Eq=3]="Eq",t[t.NotEq=4]="NotEq",t[t.Lt=5]="Lt",t[t.LtEq=6]="LtEq",t[t.Gt=7]="Gt",t[t.GtEq=8]="GtEq",t[t.RegexOp=9]="RegexOp",t[t.RegexStr=10]="RegexStr",t[t.True=11]="True",t[t.False=12]="False",t[t.In=13]="In",t[t.Not=14]="Not",t[t.And=15]="And",t[t.Or=16]="Or",t[t.Str=17]="Str",t[t.QuotedStr=18]="QuotedStr",t[t.Error=19]="Error",t[t.EOF=20]="EOF"})(_u||(_u={}));function Go(...t){switch(t.length){case 1:return g(1818,null,t[0]);case 2:return g(1819,null,t[0],t[1]);case 3:return g(1820,null,t[0],t[1],t[2]);default:return}}var pg=g(1821,null),gg=g(1822,null),sr=class jl{constructor(){this.c="",this.d=0,this.e=0,this.f=[],this.g=[],this.m=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:return">=";case 8:return">=";case 9:return"=~";case 10:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 17:return e.lexeme;case 18:return e.lexeme;case 19:return e.lexeme;case 20:return"EOF";default:throw Yl(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}static{this.a=new Set(["i","g","s","m","y","u"].map(e=>e.charCodeAt(0)))}static{this.b=new Map([["not",14],["in",13],["false",12],["true",11]])}get errors(){return this.g}reset(e){return this.c=e,this.d=0,this.e=0,this.f=[],this.g=[],this}scan(){for(;!this.r();)switch(this.d=this.e,this.i()){case 40:this.k(0);break;case 41:this.k(1);break;case 33:if(this.h(61)){const i=this.h(61);this.f.push({type:4,offset:this.d,isTripleEq:i})}else this.k(2);break;case 39:this.o();break;case 47:this.q();break;case 61:if(this.h(61)){const i=this.h(61);this.f.push({type:3,offset:this.d,isTripleEq:i})}else this.h(126)?this.k(9):this.l(Go("==","=~"));break;case 60:this.k(this.h(61)?6:5);break;case 62:this.k(this.h(61)?8:7);break;case 38:this.h(38)?this.k(15):this.l(Go("&&"));break;case 124:this.h(124)?this.k(16):this.l(Go("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this.n()}return this.d=this.e,this.k(20),Array.from(this.f)}h(e){return this.r()||this.c.charCodeAt(this.e)!==e?!1:(this.e++,!0)}i(){return this.c.charCodeAt(this.e++)}j(){return this.r()?0:this.c.charCodeAt(this.e)}k(e){this.f.push({type:e,offset:this.d})}l(e){const i=this.d,s=this.c.substring(this.d,this.e),r={type:19,offset:this.d,lexeme:s};this.g.push({offset:i,lexeme:s,additionalInfo:e}),this.f.push(r)}n(){this.m.lastIndex=this.d;const e=this.m.exec(this.c);if(e){this.e=this.d+e[0].length;const i=this.c.substring(this.d,this.e),s=jl.b.get(i);s?this.k(s):this.f.push({type:17,lexeme:i,offset:this.d})}}o(){for(;this.j()!==39&&!this.r();)this.i();if(this.r()){this.l(pg);return}this.i(),this.f.push({type:18,lexeme:this.c.substring(this.d+1,this.e-1),offset:this.d+1})}q(){let e=this.e,i=!1,s=!1;for(;;){if(e>=this.c.length){this.e=e,this.l(gg);return}const n=this.c.charCodeAt(e);if(i)i=!1;else if(n===47&&!s){e++;break}else n===91?s=!0:n===92?i=!0:n===93&&(s=!1);e++}for(;e<this.c.length&&jl.a.has(this.c.charCodeAt(e));)e++;this.e=e;const r=this.c.substring(this.d,this.e);this.f.push({type:10,lexeme:r,offset:this.d})}r(){return this.e>=this.c.length}},Ue=new Map;Ue.set("false",!1),Ue.set("true",!0),Ue.set("isMac",Rt),Ue.set("isLinux",at),Ue.set("isWindows",me),Ue.set("isWeb",$t),Ue.set("isMacNative",Rt&&!$t),Ue.set("isEdge",y0),Ue.set("isFirefox",w0),Ue.set("isChrome",Lc),Ue.set("isSafari",v0);var mg=Object.prototype.hasOwnProperty,Vu;(function(t){t[t.False=0]="False",t[t.True=1]="True",t[t.Defined=2]="Defined",t[t.Not=3]="Not",t[t.Equals=4]="Equals",t[t.NotEquals=5]="NotEquals",t[t.And=6]="And",t[t.Regex=7]="Regex",t[t.NotRegex=8]="NotRegex",t[t.Or=9]="Or",t[t.In=10]="In",t[t.NotIn=11]="NotIn",t[t.Greater=12]="Greater",t[t.GreaterEquals=13]="GreaterEquals",t[t.Smaller=14]="Smaller",t[t.SmallerEquals=15]="SmallerEquals"})(Vu||(Vu={}));var wg={regexParsingWithErrorRecovery:!0},vg=g(1798,null),yg=g(1799,null),bg=g(1800,null),zu=g(1801,null),Eg=g(1802,null),xg=g(1803,null),Sg=g(1804,null),$g=g(1805,null),Pg=class Dr{static{this.c=new Error}get lexingErrors(){return this.d.errors}get parsingErrors(){return this.h}constructor(e=wg){this.k=e,this.d=new sr,this.f=[],this.g=0,this.h=[],this.v=/g|y/g}parse(e){if(e===""){this.h.push({message:vg,offset:0,lexeme:"",additionalInfo:yg});return}this.f=this.d.reset(e).scan(),this.g=0,this.h=[];try{const i=this.l();if(!this.E()){const s=this.D(),r=s.type===17?xg:void 0;throw this.h.push({message:Eg,offset:s.offset,lexeme:sr.getLexeme(s),additionalInfo:r}),Dr.c}return i}catch(i){if(i!==Dr.c)throw i;return}}l(){return this.m()}m(){const e=[this.o()];for(;this.y(16);){const i=this.o();e.push(i)}return e.length===1?e[0]:Ze.or(...e)}o(){const e=[this.s()];for(;this.y(15);){const i=this.s();e.push(i)}return e.length===1?e[0]:Ze.and(...e)}s(){if(this.y(2)){const e=this.D();switch(e.type){case 11:return this.z(),et.INSTANCE;case 12:return this.z(),ht.INSTANCE;case 0:{this.z();const i=this.l();return this.A(1,zu),i?.negate()}case 17:return this.z(),or.create(e.lexeme);default:throw this.B("KEY | true | false | '(' expression ')'",e)}}return this.t()}t(){const e=this.D();switch(e.type){case 11:return this.z(),Ze.true();case 12:return this.z(),Ze.false();case 0:{this.z();const i=this.l();return this.A(1,zu),i}case 17:{const i=e.lexeme;if(this.z(),this.y(9)){const r=this.D();if(!this.k.regexParsingWithErrorRecovery){if(this.z(),r.type!==10)throw this.B("REGEX",r);const n=r.lexeme,o=n.lastIndexOf("/"),a=o===n.length-1?void 0:this.w(n.substring(o+1));let l;try{l=new RegExp(n.substring(1,o),a)}catch{throw this.B("REGEX",r)}return Yo.create(i,l)}switch(r.type){case 10:case 19:{const n=[r.lexeme];this.z();let o=this.D(),a=0;for(let d=0;d<r.lexeme.length;d++)r.lexeme.charCodeAt(d)===40?a++:r.lexeme.charCodeAt(d)===41&&a--;for(;!this.E()&&o.type!==15&&o.type!==16;){switch(o.type){case 0:a++;break;case 1:a--;break;case 10:case 18:for(let d=0;d<o.lexeme.length;d++)o.lexeme.charCodeAt(d)===40?a++:r.lexeme.charCodeAt(d)===41&&a--}if(a<0)break;n.push(sr.getLexeme(o)),this.z(),o=this.D()}const l=n.join(""),c=l.lastIndexOf("/"),u=c===l.length-1?void 0:this.w(l.substring(c+1));let f;try{f=new RegExp(l.substring(1,c),u)}catch{throw this.B("REGEX",r)}return Ze.regex(i,f)}case 18:{const n=r.lexeme;this.z();let o=null;if(!L0(n)){const a=n.indexOf("/"),l=n.lastIndexOf("/");if(a!==l&&a>=0){const c=n.slice(a+1,l),u=n[l+1]==="i"?"i":"";try{o=new RegExp(c,u)}catch{throw this.B("REGEX",r)}}}if(o===null)throw this.B("REGEX",r);return Yo.create(i,o)}default:throw this.B("REGEX",this.D())}}if(this.y(14)){this.A(13,bg);const r=this.u();return Ze.notIn(i,r)}switch(this.D().type){case 3:{this.z();const r=this.u();if(this.x().type===18)return Ze.equals(i,r);switch(r){case"true":return Ze.has(i);case"false":return Ze.not(i);default:return Ze.equals(i,r)}}case 4:{this.z();const r=this.u();if(this.x().type===18)return Ze.notEquals(i,r);switch(r){case"true":return Ze.not(i);case"false":return Ze.has(i);default:return Ze.notEquals(i,r)}}case 5:return this.z(),Xo.create(i,this.u());case 6:return this.z(),Ko.create(i,this.u());case 7:return this.z(),bn.create(i,this.u());case 8:return this.z(),Zo.create(i,this.u());case 13:return this.z(),Ze.in(i,this.u());default:return Ze.has(i)}}case 20:throw this.h.push({message:Sg,offset:e.offset,lexeme:"",additionalInfo:$g}),Dr.c;default:throw this.B(`true | false | KEY 
	| KEY '=~' REGEX 
	| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value`,this.D())}}u(){const e=this.D();switch(e.type){case 17:case 18:return this.z(),e.lexeme;case 11:return this.z(),"true";case 12:return this.z(),"false";case 13:return this.z(),"in";default:return""}}w(e){return e.replaceAll(this.v,"")}x(){return this.f[this.g-1]}y(e){return this.C(e)?(this.z(),!0):!1}z(){return this.E()||this.g++,this.x()}A(e,i){if(this.C(e))return this.z();throw this.B(i,this.D())}B(e,i,s){const r=g(1806,null,e,sr.getLexeme(i)),n=i.offset,o=sr.getLexeme(i);return this.h.push({message:r,offset:n,lexeme:o,additionalInfo:s}),Dr.c}C(e){return this.D().type===e}D(){return this.f[this.g]}E(){return this.D().type===20}},Ze=class{static false(){return et.INSTANCE}static true(){return ht.INSTANCE}static has(t){return nr.create(t)}static equals(t,e){return Jo.create(t,e)}static notEquals(t,e){return Qo.create(t,e)}static regex(t,e){return Yo.create(t,e)}static in(t,e){return Bu.create(t,e)}static notIn(t,e){return qu.create(t,e)}static not(t){return or.create(t)}static and(...t){return Hu.create(t,null,!0)}static or(...t){return ea.create(t,null,!0)}static greater(t,e){return bn.create(t,e)}static greaterEquals(t,e){return Zo.create(t,e)}static smaller(t,e){return Xo.create(t,e)}static smallerEquals(t,e){return Ko.create(t,e)}static{this.c=new Pg({regexParsingWithErrorRecovery:!1})}static deserialize(t){return t==null?void 0:this.c.parse(t)}};function rr(t,e){return t.cmp(e)}var et=class W1{static{this.INSTANCE=new W1}constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}map(e){return this}negate(){return ht.INSTANCE}},ht=class H1{static{this.INSTANCE=new H1}constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}map(e){return this}negate(){return et.INSTANCE}},nr=class G1{static create(e,i=null){const s=Ue.get(e);return typeof s=="boolean"?s?ht.INSTANCE:et.INSTANCE:new G1(e,i)}constructor(e,i){this.key=e,this.c=i,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:Gu(this.key,e.key)}equals(e){return e.type===this.type?this.key===e.key:!1}substituteConstants(){const e=Ue.get(this.key);return typeof e=="boolean"?e?ht.INSTANCE:et.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}map(e){return e.mapDefined(this.key)}negate(){return this.c||(this.c=or.create(this.key,this)),this.c}},Jo=class J1{static create(e,i,s=null){if(typeof i=="boolean")return i?nr.create(e,s):or.create(e,s);const r=Ue.get(e);return typeof r=="boolean"?i===(r?"true":"false")?ht.INSTANCE:et.INSTANCE:new J1(e,i,s)}constructor(e,i,s){this.c=e,this.d=i,this.f=s,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Mi(this.c,this.d,e.c,e.d)}equals(e){return e.type===this.type?this.c===e.c&&this.d===e.d:!1}substituteConstants(){const e=Ue.get(this.c);if(typeof e=="boolean"){const i=e?"true":"false";return this.d===i?ht.INSTANCE:et.INSTANCE}return this}evaluate(e){return e.getValue(this.c)==this.d}serialize(){return`${this.c} == '${this.d}'`}keys(){return[this.c]}map(e){return e.mapEquals(this.c,this.d)}negate(){return this.f||(this.f=Qo.create(this.c,this.d,this)),this.f}},Bu=class Q1{static create(e,i){return new Q1(e,i)}constructor(e,i){this.d=e,this.f=i,this.type=10,this.c=null}cmp(e){return e.type!==this.type?this.type-e.type:Mi(this.d,this.f,e.d,e.f)}equals(e){return e.type===this.type?this.d===e.d&&this.f===e.f:!1}substituteConstants(){return this}evaluate(e){const i=e.getValue(this.f),s=e.getValue(this.d);return Array.isArray(i)?i.includes(s):typeof s=="string"&&typeof i=="object"&&i!==null?mg.call(i,s):!1}serialize(){return`${this.d} in '${this.f}'`}keys(){return[this.d,this.f]}map(e){return e.mapIn(this.d,this.f)}negate(){return this.c||(this.c=qu.create(this.d,this.f)),this.c}},qu=class Z1{static create(e,i){return new Z1(e,i)}constructor(e,i){this.d=e,this.f=i,this.type=11,this.c=Bu.create(e,i)}cmp(e){return e.type!==this.type?this.type-e.type:this.c.cmp(e.c)}equals(e){return e.type===this.type?this.c.equals(e.c):!1}substituteConstants(){return this}evaluate(e){return!this.c.evaluate(e)}serialize(){return`${this.d} not in '${this.f}'`}keys(){return this.c.keys()}map(e){return e.mapNotIn(this.d,this.f)}negate(){return this.c}},Qo=class X1{static create(e,i,s=null){if(typeof i=="boolean")return i?or.create(e,s):nr.create(e,s);const r=Ue.get(e);return typeof r=="boolean"?i===(r?"true":"false")?et.INSTANCE:ht.INSTANCE:new X1(e,i,s)}constructor(e,i,s){this.c=e,this.d=i,this.f=s,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Mi(this.c,this.d,e.c,e.d)}equals(e){return e.type===this.type?this.c===e.c&&this.d===e.d:!1}substituteConstants(){const e=Ue.get(this.c);if(typeof e=="boolean"){const i=e?"true":"false";return this.d===i?et.INSTANCE:ht.INSTANCE}return this}evaluate(e){return e.getValue(this.c)!=this.d}serialize(){return`${this.c} != '${this.d}'`}keys(){return[this.c]}map(e){return e.mapNotEquals(this.c,this.d)}negate(){return this.f||(this.f=Jo.create(this.c,this.d,this)),this.f}},or=class K1{static create(e,i=null){const s=Ue.get(e);return typeof s=="boolean"?s?et.INSTANCE:ht.INSTANCE:new K1(e,i)}constructor(e,i){this.c=e,this.d=i,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:Gu(this.c,e.c)}equals(e){return e.type===this.type?this.c===e.c:!1}substituteConstants(){const e=Ue.get(this.c);return typeof e=="boolean"?e?et.INSTANCE:ht.INSTANCE:this}evaluate(e){return!e.getValue(this.c)}serialize(){return`!${this.c}`}keys(){return[this.c]}map(e){return e.mapNot(this.c)}negate(){return this.d||(this.d=nr.create(this.c,this)),this.d}};function yn(t,e){if(typeof t=="string"){const i=parseFloat(t);isNaN(i)||(t=i)}return typeof t=="string"||typeof t=="number"?e(t):et.INSTANCE}var bn=class Y1{static create(e,i,s=null){return yn(i,r=>new Y1(e,r,s))}constructor(e,i,s){this.c=e,this.d=i,this.f=s,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Mi(this.c,this.d,e.c,e.d)}equals(e){return e.type===this.type?this.c===e.c&&this.d===e.d:!1}substituteConstants(){return this}evaluate(e){return typeof this.d=="string"?!1:parseFloat(e.getValue(this.c))>this.d}serialize(){return`${this.c} > ${this.d}`}keys(){return[this.c]}map(e){return e.mapGreater(this.c,this.d)}negate(){return this.f||(this.f=Ko.create(this.c,this.d,this)),this.f}},Zo=class ed{static create(e,i,s=null){return yn(i,r=>new ed(e,r,s))}constructor(e,i,s){this.c=e,this.d=i,this.f=s,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Mi(this.c,this.d,e.c,e.d)}equals(e){return e.type===this.type?this.c===e.c&&this.d===e.d:!1}substituteConstants(){return this}evaluate(e){return typeof this.d=="string"?!1:parseFloat(e.getValue(this.c))>=this.d}serialize(){return`${this.c} >= ${this.d}`}keys(){return[this.c]}map(e){return e.mapGreaterEquals(this.c,this.d)}negate(){return this.f||(this.f=Xo.create(this.c,this.d,this)),this.f}},Xo=class td{static create(e,i,s=null){return yn(i,r=>new td(e,r,s))}constructor(e,i,s){this.c=e,this.d=i,this.f=s,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Mi(this.c,this.d,e.c,e.d)}equals(e){return e.type===this.type?this.c===e.c&&this.d===e.d:!1}substituteConstants(){return this}evaluate(e){return typeof this.d=="string"?!1:parseFloat(e.getValue(this.c))<this.d}serialize(){return`${this.c} < ${this.d}`}keys(){return[this.c]}map(e){return e.mapSmaller(this.c,this.d)}negate(){return this.f||(this.f=Zo.create(this.c,this.d,this)),this.f}},Ko=class id{static create(e,i,s=null){return yn(i,r=>new id(e,r,s))}constructor(e,i,s){this.c=e,this.d=i,this.f=s,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Mi(this.c,this.d,e.c,e.d)}equals(e){return e.type===this.type?this.c===e.c&&this.d===e.d:!1}substituteConstants(){return this}evaluate(e){return typeof this.d=="string"?!1:parseFloat(e.getValue(this.c))<=this.d}serialize(){return`${this.c} <= ${this.d}`}keys(){return[this.c]}map(e){return e.mapSmallerEquals(this.c,this.d)}negate(){return this.f||(this.f=bn.create(this.c,this.d,this)),this.f}},Yo=class sd{static create(e,i){return new sd(e,i)}constructor(e,i){this.d=e,this.f=i,this.type=7,this.c=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.d<e.d)return-1;if(this.d>e.d)return 1;const i=this.f?this.f.source:"",s=e.f?e.f.source:"";return i<s?-1:i>s?1:0}equals(e){if(e.type===this.type){const i=this.f?this.f.source:"",s=e.f?e.f.source:"";return this.d===e.d&&i===s}return!1}substituteConstants(){return this}evaluate(e){const i=e.getValue(this.d);return this.f?this.f.test(i):!1}serialize(){const e=this.f?`/${this.f.source}/${this.f.flags}`:"/invalid/";return`${this.d} =~ ${e}`}keys(){return[this.d]}map(e){return e.mapRegex(this.d,this.f)}negate(){return this.c||(this.c=kg.create(this)),this.c}},kg=class _l{static create(e){return new _l(e)}constructor(e){this.c=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this.c.cmp(e.c)}equals(e){return e.type===this.type?this.c.equals(e.c):!1}substituteConstants(){return this}evaluate(e){return!this.c.evaluate(e)}serialize(){return`!(${this.c.serialize()})`}keys(){return this.c.keys()}map(e){return new _l(this.c.map(e))}negate(){return this.c}};function Wu(t){let e=null;for(let i=0,s=t.length;i<s;i++){const r=t[i].substituteConstants();if(t[i]!==r&&e===null){e=[];for(let n=0;n<i;n++)e[n]=t[n]}e!==null&&(e[i]=r)}return e===null?t:e}var Hu=class Os{static create(e,i,s){return Os.d(e,i,s)}constructor(e,i){this.expr=e,this.c=i,this.type=6}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let i=0,s=this.expr.length;i<s;i++){const r=rr(this.expr[i],e.expr[i]);if(r!==0)return r}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let i=0,s=this.expr.length;i<s;i++)if(!this.expr[i].equals(e.expr[i]))return!1;return!0}return!1}substituteConstants(){const e=Wu(this.expr);return e===this.expr?this:Os.create(e,this.c,!1)}evaluate(e){for(let i=0,s=this.expr.length;i<s;i++)if(!this.expr[i].evaluate(e))return!1;return!0}static d(e,i,s){const r=[];let n=!1;for(const o of e)if(o){if(o.type===1){n=!0;continue}if(o.type===0)return et.INSTANCE;if(o.type===6){r.push(...o.expr);continue}r.push(o)}if(r.length===0&&n)return ht.INSTANCE;if(r.length!==0){if(r.length===1)return r[0];r.sort(rr);for(let o=1;o<r.length;o++)r[o-1].equals(r[o])&&(r.splice(o,1),o--);if(r.length===1)return r[0];for(;r.length>1;){const o=r[r.length-1];if(o.type!==9)break;r.pop();const a=r.pop(),l=r.length===0,c=ea.create(o.expr.map(u=>Os.create([u,a],null,s)),null,l);c&&(r.push(c),r.sort(rr))}if(r.length===1)return r[0];if(s){for(let o=0;o<r.length;o++)for(let a=o+1;a<r.length;a++)if(r[o].negate().equals(r[a]))return et.INSTANCE;if(r.length===1)return r[0]}return new Os(r,i)}}serialize(){return this.expr.map(e=>e.serialize()).join(" && ")}keys(){const e=[];for(const i of this.expr)e.push(...i.keys());return e}map(e){return new Os(this.expr.map(i=>i.map(e)),null)}negate(){if(!this.c){const e=[];for(const i of this.expr)e.push(i.negate());this.c=ea.create(e,this,!0)}return this.c}},ea=class Xi{static create(e,i,s){return Xi.d(e,i,s)}constructor(e,i){this.expr=e,this.c=i,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.length<e.expr.length)return-1;if(this.expr.length>e.expr.length)return 1;for(let i=0,s=this.expr.length;i<s;i++){const r=rr(this.expr[i],e.expr[i]);if(r!==0)return r}return 0}equals(e){if(e.type===this.type){if(this.expr.length!==e.expr.length)return!1;for(let i=0,s=this.expr.length;i<s;i++)if(!this.expr[i].equals(e.expr[i]))return!1;return!0}return!1}substituteConstants(){const e=Wu(this.expr);return e===this.expr?this:Xi.create(e,this.c,!1)}evaluate(e){for(let i=0,s=this.expr.length;i<s;i++)if(this.expr[i].evaluate(e))return!0;return!1}static d(e,i,s){let r=[],n=!1;if(e){for(let o=0,a=e.length;o<a;o++){const l=e[o];if(l){if(l.type===0){n=!0;continue}if(l.type===1)return ht.INSTANCE;if(l.type===9){r=r.concat(l.expr);continue}r.push(l)}}if(r.length===0&&n)return et.INSTANCE;r.sort(rr)}if(r.length!==0){if(r.length===1)return r[0];for(let o=1;o<r.length;o++)r[o-1].equals(r[o])&&(r.splice(o,1),o--);if(r.length===1)return r[0];if(s){for(let o=0;o<r.length;o++)for(let a=o+1;a<r.length;a++)if(r[o].negate().equals(r[a]))return ht.INSTANCE;if(r.length===1)return r[0]}return new Xi(r,i)}}serialize(){return this.expr.map(e=>e.serialize()).join(" || ")}keys(){const e=[];for(const i of this.expr)e.push(...i.keys());return e}map(e){return new Xi(this.expr.map(i=>i.map(e)),null)}negate(){if(!this.c){const e=[];for(const i of this.expr)e.push(i.negate());for(;e.length>1;){const i=e.shift(),s=e.shift(),r=[];for(const n of Ju(i))for(const o of Ju(s))r.push(Hu.create([n,o],null,!1));e.unshift(Xi.create(r,null,!1))}this.c=Xi.create(e,this,!0)}return this.c}},Ig=class ro extends nr{static{this.d=[]}static all(){return ro.d.values()}constructor(e,i,s){super(e,null),this.f=i,typeof s=="object"?ro.d.push({...s,key:e}):s!==!0&&ro.d.push({key:e,description:s,type:i!=null?typeof i:void 0})}bindTo(e){return e.createKey(this.key,this.f)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return Jo.create(this.key,e)}notEqualsTo(e){return Qo.create(this.key,e)}greater(e){return bn.create(this.key,e)}},R7=ue("contextKeyService");function Gu(t,e){return t<e?-1:t>e?1:0}function Mi(t,e,i,s){return t<i?-1:t>i?1:e<s?-1:e>s?1:0}function Ju(t){return t.type===9?t.expr:[t]}var he=ue("logService"),Dg=ue("loggerService"),F;(function(t){t[t.Off=0]="Off",t[t.Trace=1]="Trace",t[t.Debug=2]="Debug",t[t.Info=3]="Info",t[t.Warning=4]="Warning",t[t.Error=5]="Error"})(F||(F={}));var ta=F.Info;function Ag(t,e){return t!==F.Off&&t<=e}function gs(t,e=!1){let i="";for(let s=0;s<t.length;s++){let r=t[s];if(r instanceof Error&&(r=Fi(r,e)),typeof r=="object")try{r=JSON.stringify(r)}catch{}i+=(s>0?" ":"")+r}return i}var ia=class extends J{constructor(){super(...arguments),this.b=ta,this.c=this.B(new N),this.onDidChangeLogLevel=this.c.event}setLevel(t){this.b!==t&&(this.b=t,this.c.fire(this.b))}getLevel(){return this.b}f(t){return Ag(this.b,t)}g(t){return this.q.isDisposed?!1:this.f(t)}},Rg=class extends ia{constructor(t){super(),this.h=t}f(t){return this.h||super.f(t)}trace(t,...e){this.g(F.Trace)&&this.m(F.Trace,gs([t,...e],!0))}debug(t,...e){this.g(F.Debug)&&this.m(F.Debug,gs([t,...e]))}info(t,...e){this.g(F.Info)&&this.m(F.Info,gs([t,...e]))}warn(t,...e){this.g(F.Warning)&&this.m(F.Warning,gs([t,...e]))}error(t,...e){if(this.g(F.Error))if(t instanceof Error){const i=Array.prototype.slice.call(arguments);i[0]=t.stack,this.m(F.Error,gs(i))}else this.m(F.Error,gs([t,...e]))}flush(){}},ji=class extends ia{constructor(t=ta,e=!0){super(),this.h=e,this.setLevel(t)}trace(t,...e){this.g(F.Trace)&&(this.h?console.log("%cTRACE","color: #888",t,...e):console.log(t,...e))}debug(t,...e){this.g(F.Debug)&&(this.h?console.log("%cDEBUG","background: #eee; color: #888",t,...e):console.log(t,...e))}info(t,...e){this.g(F.Info)&&(this.h?console.log("%c INFO","color: #33f",t,...e):console.log(t,...e))}warn(t,...e){this.g(F.Warning)&&(this.h?console.warn("%c WARN","color: #993",t,...e):console.log(t,...e))}error(t,...e){this.g(F.Error)&&(this.h?console.error("%c  ERR","color: #f33",t,...e):console.error(t,...e))}flush(){}},Lg=class extends ia{constructor(t){super(),this.h=t,t.length&&this.setLevel(t[0].getLevel())}setLevel(t){for(const e of this.h)e.setLevel(t);super.setLevel(t)}trace(t,...e){for(const i of this.h)i.trace(t,...e)}debug(t,...e){for(const i of this.h)i.debug(t,...e)}info(t,...e){for(const i of this.h)i.info(t,...e)}warn(t,...e){for(const i of this.h)i.warn(t,...e)}error(t,...e){for(const i of this.h)i.error(t,...e)}flush(){for(const t of this.h)t.flush()}dispose(){for(const t of this.h)t.dispose();super.dispose()}},Og=class extends J{constructor(t,e,i){if(super(),this.j=t,this.m=e,this.b=new Je,this.f=this.B(new N),this.onDidChangeLoggers=this.f.event,this.g=this.B(new N),this.onDidChangeLogLevel=this.g.event,this.h=this.B(new N),this.onDidChangeVisibility=this.h.event,i)for(const s of i)this.b.set(s.resource,{logger:void 0,info:s})}n(t){return xe(t)?[...this.b.values()].find(e=>e.info.id===t):this.b.get(t)}getLogger(t){return this.n(t)?.logger}createLogger(t,e){const i=this.s(t),s=xe(t)?t:e?.id??ps(i.toString()).toString(16);let r=this.b.get(i)?.logger;const n=e?.logLevel==="always"?F.Trace:e?.logLevel;r||(r=this.t(i,n??this.getLogLevel(i)??this.j,{...e,id:s}));const o={logger:r,info:{resource:i,id:s,logLevel:n,name:e?.name,hidden:e?.hidden,group:e?.group,extensionId:e?.extensionId,when:e?.when}};return this.registerLogger(o.info),this.b.set(i,o),r}s(t){return xe(t)?W(this.m,`${t}.log`):t}setLogLevel(t,e){if(k.isUri(t)){const i=t,s=e,r=this.b.get(i);r&&s!==r.info.logLevel&&(r.info.logLevel=s===this.j?void 0:s,r.logger?.setLevel(s),this.b.set(r.info.resource,r),this.g.fire([i,s]))}else{this.j=t;for(const[i,s]of this.b.entries())this.b.get(i)?.info.logLevel===void 0&&s.logger?.setLevel(this.j);this.g.fire(this.j)}}setVisibility(t,e){const i=this.n(t);i&&e!==!i.info.hidden&&(i.info.hidden=!e,this.b.set(i.info.resource,i),this.h.fire([i.info.resource,e]))}getLogLevel(t){let e;return t&&(e=this.b.get(t)?.info.logLevel),e??this.j}registerLogger(t){const e=this.b.get(t.resource);e?e.info.hidden!==t.hidden&&this.setVisibility(t.resource,!t.hidden):(this.b.set(t.resource,{info:t,logger:void 0}),this.f.fire({added:[t],removed:[]}))}deregisterLogger(t){const e=this.s(t),i=this.b.get(e);i&&(i.logger&&i.logger.dispose(),this.b.delete(e),this.f.fire({added:[],removed:[i.info]}))}*getRegisteredLoggers(){for(const t of this.b.values())yield t.info}getRegisteredLogger(t){return this.b.get(t)?.info}dispose(){this.b.forEach(t=>t.logger?.dispose()),this.b.clear(),super.dispose()}},Ng=class{constructor(){this.onDidChangeLogLevel=new N().event}setLevel(t){}getLevel(){return F.Info}trace(t,...e){}debug(t,...e){}info(t,...e){}warn(t,...e){}error(t,...e){}critical(t,...e){}dispose(){}flush(){}},Cg=class extends Ng{};function Fg(t){if(t.verbose)return F.Trace;if(typeof t.logLevel=="string"){const e=Ug(t.logLevel.toLowerCase());if(e!==void 0)return e}return ta}function Tg(t){switch(t){case F.Trace:return"trace";case F.Debug:return"debug";case F.Info:return"info";case F.Warning:return"warn";case F.Error:return"error";case F.Off:return"off"}}function Ug(t){switch(t){case"trace":return F.Trace;case"debug":return F.Debug;case"info":return F.Info;case"warn":return F.Warning;case"error":return F.Error;case"critical":return F.Error;case"off":return F.Off}}var L7=new Ig("logLevel",Tg(F.Info)),Qu=ue("policy"),Zu=class extends J{constructor(){super(...arguments),this.policyDefinitions={},this.f=new Map,this.g=this.B(new N),this.onDidChange=this.g.event}async updatePolicyDefinitions(t){const e=Object.keys(this.policyDefinitions).length;return this.policyDefinitions={...t,...this.policyDefinitions},e!==Object.keys(this.policyDefinitions).length&&await this.h(this.policyDefinitions),Ai.reduce(this.f.entries(),(i,[s,r])=>({...i,[s]:r}),{})}getPolicyValue(t){return this.f.get(t)}serialize(){return Ai.reduce(Object.entries(this.policyDefinitions),(t,[e,i])=>({...t,[e]:{definition:i,value:this.f.get(e)}}),{})}},Xu=class{constructor(){this.onDidChange=oe.None,this.policyDefinitions={}}async updatePolicyDefinitions(){return{}}getPolicyValue(){}serialize(){}},Mg=class extends J{get configurationModel(){return this.b}constructor(t){super(),this.c=t,this.a=this.B(new N),this.onDidChangeConfiguration=this.a.event,this.b=Ce.createEmptyModel(t)}async initialize(){return this.h(),this.B(Tt.as(li.Configuration).onDidUpdateConfiguration(({properties:t,defaultsOverrides:e})=>this.f(Array.from(t),e))),this.configurationModel}reload(){return this.h(),this.configurationModel}f(t,e){this.j(t,Tt.as(li.Configuration).getConfigurationProperties()),this.a.fire({defaults:this.configurationModel,properties:t})}g(){return{}}h(){this.b=Ce.createEmptyModel(this.c);const t=Tt.as(li.Configuration).getConfigurationProperties();this.j(Object.keys(t),t)}j(t,e){const i=this.g();for(const s of t){const r=i[s],n=e[s];r!==void 0?this.b.setValue(s,r):n?this.b.setValue(s,ai(n.default)):this.b.removeValue(s)}}},jg=class{constructor(){this.onDidChangeConfiguration=oe.None,this.configurationModel=Ce.createEmptyModel(new Cg)}async initialize(){return this.configurationModel}},sa=class extends J{get configurationModel(){return this.c}constructor(e,i,s){super(),this.f=e,this.g=i,this.h=s,this.a=this.B(new N),this.onDidChangeConfiguration=this.a.event,this.c=Ce.createEmptyModel(this.h),this.b=Tt.as(li.Configuration)}async initialize(){return this.h.trace("PolicyConfiguration#initialize"),this.n(await this.j(this.f.configurationModel.keys),!1),this.n(await this.j(Object.keys(this.b.getExcludedConfigurationProperties())),!1),this.B(this.g.onDidChange(e=>this.m(e))),this.B(this.f.onDidChangeConfiguration(async({properties:e})=>this.n(await this.j(e),!0))),this.c}async j(e){this.h.trace("PolicyConfiguration#updatePolicyDefinitions",e);const i={},s=[],r=this.b.getConfigurationProperties(),n=this.b.getExcludedConfigurationProperties();for(const o of e){const a=r[o]??n[o];if(!a){s.push(o);continue}if(a.policy){if(a.type!=="string"&&a.type!=="number"&&a.type!=="array"&&a.type!=="object"&&a.type!=="boolean"){this.h.warn(`Policy ${a.policy.name} has unsupported type ${a.type}`);continue}const{defaultValue:l,previewFeature:c}=a.policy;s.push(o),i[a.policy.name]={type:a.type==="number"?"number":a.type==="boolean"?"boolean":"string",previewFeature:c,defaultValue:l}}}return hc(i)||await this.g.updatePolicyDefinitions(i),s}m(e){this.h.trace("PolicyConfiguration#onDidChangePolicies",e);const i=this.b.getPolicyConfigurations(),s=is(e.map(r=>i.get(r)));this.n(s,!0)}n(e,i){this.h.trace("PolicyConfiguration#update",e);const s=this.b.getConfigurationProperties(),r=this.b.getExcludedConfigurationProperties(),n=[],o=this.c.isEmpty();for(const a of e){const l=s[a]??r[a],c=l?.policy?.name;if(c){let u=this.g.getPolicyValue(c);if(xe(u)&&l.type!=="string")try{u=this.r(u)}catch(f){this.h.error(`Error parsing policy value ${c}:`,G(f));continue}(o?u!==void 0:!Wt(this.c.getValue(a),u))&&n.push([a,u])}else this.c.getValue(a)!==void 0&&n.push([a,void 0])}if(n.length){this.h.trace("PolicyConfiguration#changed",n);const a=this.c;this.c=Ce.createEmptyModel(this.h);for(const l of a.keys)this.c.setValue(l,a.getValue(l));for(const[l,c]of n)c===void 0?this.c.removeValue(l):this.c.setValue(l,c);i&&this.a.fire(this.c)}}r(e){let i={},s=null,r=[];const n=[],o=[];function a(c){if(Array.isArray(r))r.push(c);else if(s!==null){if(r[s]!==void 0)throw new Error(`Duplicate property found: ${s}`);r[s]=c}}if(e&&(ln(e,{onObjectBegin:()=>{const c={};a(c),n.push(r),r=c,s=null},onObjectProperty:c=>{s=c},onObjectEnd:()=>{r=n.pop()},onArrayBegin:()=>{const c=[];a(c),n.push(r),r=c,s=null},onArrayEnd:()=>{r=n.pop()},onLiteralValue:a,onError:(c,u,f)=>{o.push({error:c,offset:u,length:f})}}),i=r[0]||{}),o.length>0)throw new Error(o.map(c=>G(c.error)).join(`
`));return i}};sa=__decorate([__param(1,Qu),__param(2,he)],sa);var _g=class extends J{constructor(t,e,i,s){super(),this.m=t,this.n=s,this.h=this.B(new N),this.onDidChangeConfiguration=this.h.event,this.b=this.B(new Mg(s)),this.c=i instanceof Xu?new jg:this.B(new sa(this.b,i,s)),this.f=this.B(new lg(this.m,{},Ro,e,s)),this.a=new qo(this.b.configurationModel,this.c.configurationModel,Ce.createEmptyModel(s),Ce.createEmptyModel(s),Ce.createEmptyModel(s),Ce.createEmptyModel(s),new Je,Ce.createEmptyModel(s),new Je,s),this.j=new Vg(t,e,this),this.g=this.B(new Yr(()=>this.reloadConfiguration(),50)),this.B(this.b.onDidChangeConfiguration(({defaults:r,properties:n})=>this.s(r,n))),this.B(this.c.onDidChangeConfiguration(r=>this.t(r))),this.B(this.f.onDidChange(()=>this.g.schedule()))}async initialize(){const[t,e,i]=await Promise.all([this.b.initialize(),this.c.initialize(),this.f.loadConfiguration()]);this.a=new qo(t,e,Ce.createEmptyModel(this.n),i,Ce.createEmptyModel(this.n),Ce.createEmptyModel(this.n),new Je,Ce.createEmptyModel(this.n),new Je,this.n)}getConfigurationData(){return this.a.toData()}getValue(t,e){const i=typeof t=="string"?t:void 0,s=Co(t)?t:Co(e)?e:{};return this.a.getValue(i,s,void 0)}async updateValue(t,e,i,s,r){const n=Sp(i)?i:Co(i)?{resource:i.resource,overrideIdentifiers:i.overrideIdentifier?[i.overrideIdentifier]:void 0}:void 0,o=n?s:i;if(o!==void 0&&o!==3&&o!==2)throw new Error(`Unable to write ${t} to target ${o}.`);n?.overrideIdentifiers&&(n.overrideIdentifiers=Yt(n.overrideIdentifiers),n.overrideIdentifiers=n.overrideIdentifiers.length?n.overrideIdentifiers:void 0);const a=this.inspect(t,{resource:n?.resource,overrideIdentifier:n?.overrideIdentifiers?n.overrideIdentifiers[0]:void 0});if(a.policyValue!==void 0)throw new Error(`Unable to write ${t} because it is configured in system policy.`);if(Wt(e,a.defaultValue)&&(e=void 0),n?.overrideIdentifiers?.length&&n.overrideIdentifiers.length>1){const c=n.overrideIdentifiers.sort(),u=this.a.localUserConfiguration.overrides.find(f=>ts([...f.identifiers].sort(),c));u&&(n.overrideIdentifiers=u.identifiers)}const l=n?.overrideIdentifiers?.length?[ng(n.overrideIdentifiers),t]:[t];await this.j.write(l,e),await this.reloadConfiguration()}inspect(t,e={}){return this.a.inspect(t,e,void 0)}keys(){return this.a.keys(void 0)}async reloadConfiguration(){const t=await this.f.loadConfiguration();this.r(t)}r(t){const e=this.a.toData(),i=this.a.compareAndUpdateLocalUserConfiguration(t);this.u(i,e,2)}s(t,e){const i=this.a.toData(),s=this.a.compareAndUpdateDefaultConfiguration(t,e);this.u(s,i,7)}t(t){const e=this.a.toData(),i=this.a.compareAndUpdatePolicyConfiguration(t);this.u(i,e,7)}u(t,e,i){const s=new ug(t,{data:e},this.a,void 0,this.n);s.source=i,this.h.fire(s)}},Vg=class{constructor(t,e,i){this.b=t,this.c=e,this.d=i,this.a=new Qs}write(t,e){return this.a.queue(()=>this.e(t,e))}async e(t,e){let i;try{i=(await this.c.readFile(this.b)).value.toString()}catch(n){if(n.fileOperationResult===1)i="{}";else throw n}const s=[];if(Xs(i,s,{allowTrailingComma:!0,allowEmptyContent:!0}),s.length>0)throw new Error("Unable to write into the settings file. Please open the file to correct errors/warnings in the file and try again.");const r=this.f(i,t,e);i=Zp(i,r),await this.c.writeFile(this.b,V.fromString(i))}f(t,e,i){const{tabSize:s,insertSpaces:r,eol:n}=this.h;if(!e.length){const o=JSON.stringify(i,null,r?" ".repeat(s):"	");return[{content:o,length:o.length,offset:0}]}return Qp(t,e,i,{tabSize:s,insertSpaces:r,eol:n})}get h(){if(!this.g){let t=xo===3||xo===2?`
`:`\r
`;const e=this.d.getValue("files.eol",{overrideIdentifier:"jsonc"});e&&typeof e=="string"&&e!=="auto"&&(t=e),this.g={eol:t,insertSpaces:!!this.d.getValue("editor.insertSpaces",{overrideIdentifier:"jsonc"}),tabSize:this.d.getValue("editor.tabSize",{overrideIdentifier:"jsonc"})}}return this.g}},Ku=ue("downloadService"),zg=class{constructor(){this.b="",this.c=0}reset(t){return this.b=t,this.c=0,this}next(){return this.c+=1,this}hasNext(){return this.c<this.b.length-1}cmp(t){const e=t.charCodeAt(0),i=this.b.charCodeAt(this.c);return e-i}value(){return this.b[this.c]}},Bg=class{constructor(t=!0){this.e=t}reset(t){return this.b=t,this.c=0,this.d=0,this.next()}hasNext(){return this.d<this.b.length}next(){this.c=this.d;let t=!0;for(;this.d<this.b.length;this.d++)if(this.b.charCodeAt(this.d)===46)if(t)this.c++;else break;else t=!1;return this}cmp(t){return this.e?Io(t,this.b,0,t.length,this.c,this.d):Ws(t,this.b,0,t.length,this.c,this.d)}value(){return this.b.substring(this.c,this.d)}},Yu=class{constructor(t=!0,e=!0){this.f=t,this.g=e}reset(t){this.d=0,this.e=0,this.b=t,this.c=t.length;for(let e=t.length-1;e>=0;e--,this.c--){const i=this.b.charCodeAt(e);if(!(i===47||this.f&&i===92))break}return this.next()}hasNext(){return this.e<this.c}next(){this.d=this.e;let t=!0;for(;this.e<this.c;this.e++){const e=this.b.charCodeAt(this.e);if(e===47||this.f&&e===92)if(t)this.d++;else break;else t=!1}return this}cmp(t){return this.g?Io(t,this.b,0,t.length,this.d,this.e):Ws(t,this.b,0,t.length,this.d,this.e)}value(){return this.b.substring(this.d,this.e)}},eh;(function(t){t[t.Scheme=1]="Scheme",t[t.Authority=2]="Authority",t[t.Path=3]="Path",t[t.Query=4]="Query",t[t.Fragment=5]="Fragment"})(eh||(eh={}));var qg=class{constructor(t,e){this.f=t,this.g=e,this.d=[],this.e=0}reset(t){return this.c=t,this.d=[],this.c.scheme&&this.d.push(1),this.c.authority&&this.d.push(2),this.c.path&&(this.b=new Yu(!1,!this.f(t)),this.b.reset(t.path),this.b.value()&&this.d.push(3)),this.g(t)||(this.c.query&&this.d.push(4),this.c.fragment&&this.d.push(5)),this.e=0,this}next(){return this.d[this.e]===3&&this.b.hasNext()?this.b.next():this.e+=1,this}hasNext(){return this.d[this.e]===3&&this.b.hasNext()||this.e<this.d.length-1}cmp(t){if(this.d[this.e]===1)return Jr(t,this.c.scheme);if(this.d[this.e]===2)return Jr(t,this.c.authority);if(this.d[this.e]===3)return this.b.cmp(t);if(this.d[this.e]===4)return ko(t,this.c.query);if(this.d[this.e]===5)return ko(t,this.c.fragment);throw new Error}value(){if(this.d[this.e]===1)return this.c.scheme;if(this.d[this.e]===2)return this.c.authority;if(this.d[this.e]===3)return this.b.value();if(this.d[this.e]===4)return this.c.query;if(this.d[this.e]===5)return this.c.fragment;throw new Error}},_i=class Vl{static{this.Val=Symbol("undefined_placeholder")}static wrap(e){return e===void 0?Vl.Val:e}static unwrap(e){return e===Vl.Val?void 0:e}},En=class{constructor(){this.height=1,this.value=void 0,this.key=void 0,this.left=void 0,this.mid=void 0,this.right=void 0}isEmpty(){return!this.left&&!this.mid&&!this.right&&this.value===void 0}rotateLeft(){const t=this.right;return this.right=t.left,t.left=this,this.updateHeight(),t.updateHeight(),t}rotateRight(){const t=this.left;return this.left=t.right,t.right=this,this.updateHeight(),t.updateHeight(),t}updateHeight(){this.height=1+Math.max(this.heightLeft,this.heightRight)}balanceFactor(){return this.heightRight-this.heightLeft}get heightLeft(){return this.left?.height??0}get heightRight(){return this.right?.height??0}},th;(function(t){t[t.Left=-1]="Left",t[t.Mid=0]="Mid",t[t.Right=1]="Right"})(th||(th={}));var ms=class Ar{static forUris(e=()=>!1,i=()=>!1){return new Ar(new qg(e,i))}static forPaths(e=!1){return new Ar(new Yu(void 0,!e))}static forStrings(){return new Ar(new zg)}static forConfigKeys(){return new Ar(new Bg)}constructor(e){this.b=e}clear(){this.c=void 0}fill(e,i){if(i){const s=i.slice(0);sc(s);for(const r of s)this.set(r,e)}else{const s=e.slice(0);sc(s);for(const r of s)this.set(r[0],r[1])}}set(e,i){const s=this.b.reset(e);let r;this.c||(this.c=new En,this.c.segment=s.value());const n=[];for(r=this.c;;){const a=s.cmp(r.segment);if(a>0)r.left||(r.left=new En,r.left.segment=s.value()),n.push([-1,r]),r=r.left;else if(a<0)r.right||(r.right=new En,r.right.segment=s.value()),n.push([1,r]),r=r.right;else if(s.hasNext())s.next(),r.mid||(r.mid=new En,r.mid.segment=s.value()),n.push([0,r]),r=r.mid;else break}const o=_i.unwrap(r.value);r.value=_i.wrap(i),r.key=e;for(let a=n.length-1;a>=0;a--){const l=n[a][1];l.updateHeight();const c=l.balanceFactor();if(c<-1||c>1){const u=n[a][0],f=n[a+1][0];if(u===1&&f===1)n[a][1]=l.rotateLeft();else if(u===-1&&f===-1)n[a][1]=l.rotateRight();else if(u===1&&f===-1)l.right=n[a+1][1]=n[a+1][1].rotateRight(),n[a][1]=l.rotateLeft();else if(u===-1&&f===1)l.left=n[a+1][1]=n[a+1][1].rotateLeft(),n[a][1]=l.rotateRight();else throw new Error;if(a>0)switch(n[a-1][0]){case-1:n[a-1][1].left=n[a][1];break;case 1:n[a-1][1].right=n[a][1];break;case 0:n[a-1][1].mid=n[a][1];break}else this.c=n[0][1]}}return o}get(e){return _i.unwrap(this.d(e)?.value)}d(e){const i=this.b.reset(e);let s=this.c;for(;s;){const r=i.cmp(s.segment);if(r>0)s=s.left;else if(r<0)s=s.right;else if(i.hasNext())i.next(),s=s.mid;else break}return s}has(e){const i=this.d(e);return!(i?.value===void 0&&i?.mid===void 0)}delete(e){return this.e(e,!1)}deleteSuperstr(e){return this.e(e,!0)}e(e,i){const s=this.b.reset(e),r=[];let n=this.c;for(;n;){const o=s.cmp(n.segment);if(o>0)r.push([-1,n]),n=n.left;else if(o<0)r.push([1,n]),n=n.right;else if(s.hasNext())s.next(),r.push([0,n]),n=n.mid;else break}if(n){if(i?(n.left=void 0,n.mid=void 0,n.right=void 0,n.height=1):(n.key=void 0,n.value=void 0),!n.mid&&!n.value)if(n.left&&n.right){const o=[[1,n]],a=this.f(n.right,o);if(a.key){n.key=a.key,n.value=a.value,n.segment=a.segment;const l=a.right;if(o.length>1){const[u,f]=o[o.length-1];switch(u){case-1:f.left=l;break;case 0:wo(!1);case 1:wo(!1)}}else n.right=l;const c=this.g(o);if(r.length>0){const[u,f]=r[r.length-1];switch(u){case-1:f.left=c;break;case 0:f.mid=c;break;case 1:f.right=c;break}}else this.c=c}}else{const o=n.left??n.right;if(r.length>0){const[a,l]=r[r.length-1];switch(a){case-1:l.left=o;break;case 0:l.mid=o;break;case 1:l.right=o;break}}else this.c=o}this.c=this.g(r)??this.c}}f(e,i){for(;e.left;)i.push([-1,e]),e=e.left;return e}g(e){for(let i=e.length-1;i>=0;i--){const s=e[i][1];s.updateHeight();const r=s.balanceFactor();if(r>1?(s.right.balanceFactor()>=0||(s.right=s.right.rotateRight()),e[i][1]=s.rotateLeft()):r<-1&&(s.left.balanceFactor()<=0||(s.left=s.left.rotateLeft()),e[i][1]=s.rotateRight()),i>0)switch(e[i-1][0]){case-1:e[i-1][1].left=e[i][1];break;case 1:e[i-1][1].right=e[i][1];break;case 0:e[i-1][1].mid=e[i][1];break}else return e[0][1]}}findSubstr(e){const i=this.b.reset(e);let s=this.c,r;for(;s;){const n=i.cmp(s.segment);if(n>0)s=s.left;else if(n<0)s=s.right;else if(i.hasNext())i.next(),r=_i.unwrap(s.value)||r,s=s.mid;else break}return s&&_i.unwrap(s.value)||r}findSuperstr(e){return this.h(e,!1)}h(e,i){const s=this.b.reset(e);let r=this.c;for(;r;){const n=s.cmp(r.segment);if(n>0)r=r.left;else if(n<0)r=r.right;else if(s.hasNext())s.next(),r=r.mid;else return r.mid?this.j(r.mid):i?_i.unwrap(r.value):void 0}}hasElementOrSubtree(e){return this.h(e,!0)!==void 0}forEach(e){for(const[i,s]of this)e(s,i)}*[Symbol.iterator](){yield*this.j(this.c)}j(e){const i=[];return this.l(e,i),i[Symbol.iterator]()}l(e,i){e&&(e.left&&this.l(e.left,i),e.value!==void 0&&i.push([e.key,_i.unwrap(e.value)]),e.mid&&this.l(e.mid,i),e.right&&this.l(e.right,i))}_isBalanced(){const e=i=>{if(!i)return!0;const s=i.balanceFactor();return s<-1||s>1?!1:e(i.left)&&e(i.right)};return e(this.c)}},Ie=ue("fileService");function ws(t){return t.create===!0}var ft;(function(t){t[t.Unknown=0]="Unknown",t[t.File=1]="File",t[t.Directory=2]="Directory",t[t.SymbolicLink=64]="SymbolicLink"})(ft||(ft={}));var vs;(function(t){t[t.Readonly=1]="Readonly",t[t.Locked=2]="Locked"})(vs||(vs={}));var ih;(function(t){t[t.UPDATED=2]="UPDATED",t[t.ADDED=4]="ADDED",t[t.DELETED=8]="DELETED"})(ih||(ih={}));var sh;(function(t){t[t.None=0]="None",t[t.FileReadWrite=2]="FileReadWrite",t[t.FileOpenReadWriteClose=4]="FileOpenReadWriteClose",t[t.FileReadStream=16]="FileReadStream",t[t.FileFolderCopy=8]="FileFolderCopy",t[t.PathCaseSensitive=1024]="PathCaseSensitive",t[t.Readonly=2048]="Readonly",t[t.Trash=4096]="Trash",t[t.FileWriteUnlock=8192]="FileWriteUnlock",t[t.FileAtomicRead=16384]="FileAtomicRead",t[t.FileAtomicWrite=32768]="FileAtomicWrite",t[t.FileAtomicDelete=65536]="FileAtomicDelete",t[t.FileClone=131072]="FileClone"})(sh||(sh={}));function Pt(t){return!!(t.capabilities&2)}function ra(t){return!!(t.capabilities&8)}function rh(t){return!!(t.capabilities&131072)}function yi(t){return!!(t.capabilities&4)}function na(t){return!!(t.capabilities&16)}function oa(t){return Pt(t)?!!(t.capabilities&16384):!1}function nh(t){return Pt(t)?!!(t.capabilities&32768):!1}function Wg(t){return!!(t.capabilities&65536)}var z;(function(t){t.FileExists="EntryExists",t.FileNotFound="EntryNotFound",t.FileNotADirectory="EntryNotADirectory",t.FileIsADirectory="EntryIsADirectory",t.FileExceedsStorageQuota="EntryExceedsStorageQuota",t.FileTooLarge="EntryTooLarge",t.FileWriteLocked="EntryWriteLocked",t.NoPermissions="NoPermissions",t.Unavailable="Unavailable",t.Unknown="Unknown"})(z||(z={}));var aa=class rd extends Error{static create(e,i){const s=new rd(e.toString(),i);return Hg(s,i),s}constructor(e,i){super(e),this.code=i}};function hi(t,e){return aa.create(t,e)}function Vi(t){return t||hi(g(2020,null),z.Unknown)}function Hg(t,e){return t.name=e?`${e} (FileSystemError)`:"FileSystemError",t}function xn(t){if(!t)return z.Unknown;if(t instanceof aa)return t.code;const e=/^(.+) \(FileSystemError\)$/.exec(t.name);if(!e)return z.Unknown;switch(e[1]){case z.FileExists:return z.FileExists;case z.FileIsADirectory:return z.FileIsADirectory;case z.FileNotADirectory:return z.FileNotADirectory;case z.FileNotFound:return z.FileNotFound;case z.FileTooLarge:return z.FileTooLarge;case z.FileWriteLocked:return z.FileWriteLocked;case z.NoPermissions:return z.NoPermissions;case z.Unavailable:return z.Unavailable}return z.Unknown}function Me(t){if(t instanceof tt)return t.fileOperationResult;switch(xn(t)){case z.FileNotFound:return 1;case z.FileIsADirectory:return 0;case z.FileNotADirectory:return 9;case z.FileWriteLocked:return 5;case z.NoPermissions:return 6;case z.FileExists:return 4;case z.FileTooLarge:return 7;default:return 10}}var oh;(function(t){t[t.CREATE=0]="CREATE",t[t.DELETE=1]="DELETE",t[t.MOVE=2]="MOVE",t[t.COPY=3]="COPY",t[t.WRITE=4]="WRITE"})(oh||(oh={}));var ys=class{constructor(t,e,i){this.resource=t,this.operation=e,this.target=i}isOperation(t){return this.operation===t}},ah;(function(t){t[t.UPDATED=0]="UPDATED",t[t.ADDED=1]="ADDED",t[t.DELETED=2]="DELETED"})(ah||(ah={}));var Gg=class no{static{this.a=null}constructor(e,i){this.c=i,this.b=void 0,this.d=new Ni(()=>{const s=ms.forUris(()=>this.c);return s.fill(this.rawAdded.map(r=>[r,!0])),s}),this.f=new Ni(()=>{const s=ms.forUris(()=>this.c);return s.fill(this.rawUpdated.map(r=>[r,!0])),s}),this.g=new Ni(()=>{const s=ms.forUris(()=>this.c);return s.fill(this.rawDeleted.map(r=>[r,!0])),s}),this.rawAdded=[],this.rawUpdated=[],this.rawDeleted=[];for(const s of e){switch(s.type){case 1:this.rawAdded.push(s.resource);break;case 0:this.rawUpdated.push(s.resource);break;case 2:this.rawDeleted.push(s.resource);break}this.b!==no.a&&(typeof s.cId=="number"?this.b===void 0?this.b=s.cId:this.b!==s.cId&&(this.b=no.a):this.b!==void 0&&(this.b=no.a))}}contains(e,...i){return this.h(e,{includeChildren:!1},...i)}affects(e,...i){return this.h(e,{includeChildren:!0},...i)}h(e,i,...s){if(!e)return!1;const r=s.length>0;return!!((!r||s.includes(1))&&(this.d.value.get(e)||i.includeChildren&&this.d.value.findSuperstr(e))||(!r||s.includes(0))&&(this.f.value.get(e)||i.includeChildren&&this.f.value.findSuperstr(e))||(!r||s.includes(2))&&(this.g.value.findSubstr(e)||i.includeChildren&&this.g.value.findSuperstr(e)))}gotAdded(){return this.rawAdded.length>0}gotDeleted(){return this.rawDeleted.length>0}gotUpdated(){return this.rawUpdated.length>0}correlates(e){return this.b===e}hasCorrelation(){return typeof this.b=="number"}};function Jg(t,e,i){return!t||!e||t===e||e.length>t.length?!1:(e.charAt(e.length-1)!==Ye&&(e+=Ye),i?Do(t,e):t.indexOf(e)===0)}var tt=class extends Error{constructor(t,e,i){super(t),this.fileOperationResult=e,this.options=i}},la=class extends tt{constructor(t,e,i,s){super(t,e,s),this.fileOperationResult=e,this.size=i}},ca=class extends tt{constructor(t,e,i){super(t,2,i),this.stat=e}},lh;(function(t){t[t.FILE_IS_DIRECTORY=0]="FILE_IS_DIRECTORY",t[t.FILE_NOT_FOUND=1]="FILE_NOT_FOUND",t[t.FILE_NOT_MODIFIED_SINCE=2]="FILE_NOT_MODIFIED_SINCE",t[t.FILE_MODIFIED_SINCE=3]="FILE_MODIFIED_SINCE",t[t.FILE_MOVE_CONFLICT=4]="FILE_MOVE_CONFLICT",t[t.FILE_WRITE_LOCKED=5]="FILE_WRITE_LOCKED",t[t.FILE_PERMISSION_DENIED=6]="FILE_PERMISSION_DENIED",t[t.FILE_TOO_LARGE=7]="FILE_TOO_LARGE",t[t.FILE_INVALID_PATH=8]="FILE_INVALID_PATH",t[t.FILE_NOT_DIRECTORY=9]="FILE_NOT_DIRECTORY",t[t.FILE_OTHER_ERROR=10]="FILE_OTHER_ERROR"})(lh||(lh={}));var ch;(function(t){t[t.FILE=0]="FILE",t[t.FOLDER=1]="FOLDER",t[t.ROOT_FOLDER=2]="ROOT_FOLDER"})(ch||(ch={}));var ua="";function uh(t){if(!(typeof t.size!="number"||typeof t.mtime!="number"))return t.mtime.toString(29)+t.size.toString(31)}var Qg=class it{static{this.KB=1024}static{this.MB=it.KB*it.KB}static{this.GB=it.MB*it.KB}static{this.TB=it.GB*it.KB}static formatSize(e){return lc(e)||(e=0),e<it.KB?g(2021,null,e.toFixed(0)):e<it.MB?g(2022,null,(e/it.KB).toFixed(2)):e<it.GB?g(2023,null,(e/it.MB).toFixed(2)):e<it.TB?g(2024,null,(e/it.GB).toFixed(2)):g(2025,null,(e/it.TB).toFixed(2))}},ar=ue("requestService"),Zg=class{constructor(t){this.b=t}toJSON(){if(!this.a){const t=Object.create(null);for(const e in this.b)e.toLowerCase()==="authorization"||e.toLowerCase()==="proxy-authorization"?t[e]="*****":t[e]=this.b[e];this.a=t}return this.a}},Xg=class extends J{constructor(t){super(),this.b=t,this.a=0}async c(t,e){const i=`#${++this.a}: ${t.url}`;this.b.trace(`${i} - begin`,t.type,new Zg(t.headers??{}));try{const s=await e();return this.b.trace(`${i} - end`,t.type,s.res.statusCode,s.res.headers),s}catch(s){throw this.b.error(`${i} - error`,t.type,G(s)),s}}};function ha(t){return t.res.statusCode&&t.res.statusCode>=200&&t.res.statusCode<300||t.res.statusCode===1223}function hh(t){return t.res.statusCode===204}async function Kg(t){return hh(t)?null:(await Ti(t.stream)).toString()}async function bs(t){if(!ha(t))throw new Error("Server returned "+t.res.statusCode);return Kg(t)}async function Sn(t){if(!ha(t))throw new Error("Server returned "+t.res.statusCode);if(hh(t))return null;const i=(await Ti(t.stream)).toString();try{return JSON.parse(i)}catch(s){throw s.message+=`:
`+i,s}}var fa=[],fh=void 0,dh=void 0;function Yg(t=!0,e=!0){if(fh===t&&dh===e)return;fh=t,dh=e;const i=Tt.as(li.Configuration),s=fa;fa=[{id:"http",order:15,title:g(2205,null),type:"object",scope:2,properties:{"http.useLocalProxyConfiguration":{type:"boolean",default:e,markdownDescription:g(2206,null),restricted:!0}}},{id:"http",order:15,title:g(2207,null),type:"object",scope:1,properties:{"http.electronFetch":{type:"boolean",default:!1,description:g(2208,null),restricted:!0}}},{id:"http",order:15,title:g(2209,null),type:"object",scope:t?1:2,properties:{"http.proxy":{type:"string",pattern:"^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$",markdownDescription:g(2210,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyStrictSSL":{type:"boolean",default:!0,markdownDescription:g(2211,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyKerberosServicePrincipal":{type:"string",markdownDescription:g(2212,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.noProxy":{type:"array",items:{type:"string"},markdownDescription:g(2213,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxyAuthorization":{type:["null","string"],default:null,markdownDescription:g(2214,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.proxySupport":{type:"string",enum:["off","on","fallback","override"],enumDescriptions:[g(2215,null),g(2216,null),g(2217,null),g(2218,null)],default:"override",markdownDescription:g(2219,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.systemCertificates":{type:"boolean",default:!0,markdownDescription:g(2220,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.experimental.systemCertificatesV2":{type:"boolean",tags:["experimental"],default:!1,markdownDescription:g(2221,null,"`#http.useLocalProxyConfiguration#`"),restricted:!0},"http.fetchAdditionalSupport":{type:"boolean",default:!0,markdownDescription:g(2222,null,"`#http.useLocalProxyConfiguration#`","`#http.proxySupport#`","`#http.systemCertificates#`"),restricted:!0}}}],i.updateConfigurations({add:fa,remove:s})}Yg();var da=class{constructor(e,i){this.a=e,this.b=i}async download(e,i,s=pe.None){if(e.scheme===ie.file||e.scheme===ie.vscodeRemote){await this.b.copy(e,i);return}const r={type:"GET",url:e.toString(!0)},n=await this.a.request(r,s);if(n.res.statusCode===200)await this.b.writeFile(i,n.stream);else{const o=await bs(n);throw new Error(`Expected 200, got back ${n.res.statusCode} instead.

${o}`)}}};da=__decorate([__param(0,ar),__param(1,Ie)],da);var fi=ue("environmentService"),kt=fi;import{homedir as e4,tmpdir as t4}from"os";var i4=60,s4=i4*60,pa=s4*24,F7=pa*7,T7=pa*30,U7=pa*365;function r4(t){return t.getFullYear()+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0")+"T"+String(t.getHours()).padStart(2,"0")+":"+String(t.getMinutes()).padStart(2,"0")+":"+String(t.getSeconds()).padStart(2,"0")+"."+(t.getMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"}function ae(t,e,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");const n=`$memoize$${e}`;i[s]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var ph=/^([^.]+\..+)[:=](.+)$/,le=class{get appRoot(){return Ot(Gs.asFileUri("").fsPath)}get userHome(){return k.file(this.b.homeDir)}get userDataPath(){return this.b.userDataDir}get appSettingsHome(){return k.file(U(this.userDataPath,"User"))}get tmpDir(){return k.file(this.b.tmpDir)}get cacheHome(){return k.file(this.userDataPath)}get stateResource(){return W(this.appSettingsHome,"globalStorage","storage.json")}get userRoamingDataHome(){return this.appSettingsHome.with({scheme:ie.vscodeUserData})}get userDataSyncHome(){return W(this.appSettingsHome,"sync")}get logsHome(){if(!this.args.logsPath){const t=r4(new Date).replace(/-|:|\.\d+Z$/g,"");this.args.logsPath=U(this.userDataPath,"logs",t)}return k.file(this.args.logsPath)}get sync(){return this.args.sync}get machineSettingsResource(){return W(k.file(U(this.userDataPath,"Machine")),"settings.json")}get workspaceStorageHome(){return W(this.appSettingsHome,"workspaceStorage")}get localHistoryHome(){return W(this.appSettingsHome,"History")}get keyboardLayoutResource(){return W(this.userRoamingDataHome,"keyboardLayout.json")}get argvResource(){const t=Lt.VSCODE_PORTABLE;return t?k.file(U(t,"argv.json")):W(this.userHome,this.c.dataFolderName,"argv.json")}get isExtensionDevelopment(){return!!this.args.extensionDevelopmentPath}get untitledWorkspacesHome(){return k.file(U(this.userDataPath,"Workspaces"))}get builtinExtensionsPath(){const t=this.args["builtin-extensions-dir"];return t?Oi(t):pi(U(Gs.asFileUri("").fsPath,"..","extensions"))}get extensionsDownloadLocation(){const t=this.args["extensions-download-dir"];return t?k.file(Oi(t)):k.file(U(this.userDataPath,"CachedExtensionVSIXs"))}get extensionsPath(){const t=this.args["extensions-dir"];if(t)return Oi(t);const e=Lt.VSCODE_EXTENSIONS;if(e)return e;const i=Lt.VSCODE_PORTABLE;return i?U(i,"extensions"):W(this.userHome,this.c.dataFolderName,"extensions").fsPath}get extensionDevelopmentLocationURI(){const t=this.args.extensionDevelopmentPath;if(Array.isArray(t))return t.map(e=>/^[^:/?#]+?:\/\//.test(e)?k.parse(e):k.file(pi(e)))}get extensionDevelopmentKind(){return this.args.extensionDevelopmentKind?.map(t=>t==="ui"||t==="workspace"||t==="web"?t:"workspace")}get extensionTestsLocationURI(){const t=this.args.extensionTestsPath;if(t)return/^[^:/?#]+?:\/\//.test(t)?k.parse(t):k.file(pi(t))}get disableExtensions(){if(this.args["disable-extensions"])return!0;const t=this.args["disable-extension"];if(t){if(typeof t=="string")return[t];if(Array.isArray(t)&&t.length>0)return t}return!1}get debugExtensionHost(){return n4(this.args,this.isBuilt)}get debugRenderer(){return!!this.args.debugRenderer}get isBuilt(){return!Lt.VSCODE_DEV}get verbose(){return!!this.args.verbose}get logLevel(){return this.args.log?.find(t=>!ph.test(t))}get extensionLogLevel(){const t=[];for(const e of this.args.log||[]){const i=ph.exec(e);i&&i[1]&&i[2]&&t.push([i[1],i[2]])}return t.length?t:void 0}get serviceMachineIdResource(){return W(k.file(this.userDataPath),"machineid")}get crashReporterId(){return this.args["crash-reporter-id"]}get crashReporterDirectory(){return this.args["crash-reporter-directory"]}get disableTelemetry(){return!!this.args["disable-telemetry"]}get disableWorkspaceTrust(){return!!this.args["disable-workspace-trust"]}get useInMemorySecretStorage(){return!!this.args["use-inmemory-secretstorage"]}get policyFile(){if(this.args["__enable-file-policy"]){const t=Lt.VSCODE_PORTABLE;return t?k.file(U(t,"policy.json")):W(this.userHome,this.c.dataFolderName,"policy.json")}}get editSessionId(){return this.args.editSessionId}get continueOn(){return this.args.continueOn}set continueOn(t){this.args.continueOn=t}get args(){return this.a}constructor(t,e,i){this.a=t,this.b=e,this.c=i}};__decorate([ae],le.prototype,"appRoot",null),__decorate([ae],le.prototype,"userHome",null),__decorate([ae],le.prototype,"userDataPath",null),__decorate([ae],le.prototype,"appSettingsHome",null),__decorate([ae],le.prototype,"tmpDir",null),__decorate([ae],le.prototype,"cacheHome",null),__decorate([ae],le.prototype,"stateResource",null),__decorate([ae],le.prototype,"userRoamingDataHome",null),__decorate([ae],le.prototype,"userDataSyncHome",null),__decorate([ae],le.prototype,"sync",null),__decorate([ae],le.prototype,"machineSettingsResource",null),__decorate([ae],le.prototype,"workspaceStorageHome",null),__decorate([ae],le.prototype,"localHistoryHome",null),__decorate([ae],le.prototype,"keyboardLayoutResource",null),__decorate([ae],le.prototype,"argvResource",null),__decorate([ae],le.prototype,"isExtensionDevelopment",null),__decorate([ae],le.prototype,"untitledWorkspacesHome",null),__decorate([ae],le.prototype,"builtinExtensionsPath",null),__decorate([ae],le.prototype,"extensionsPath",null),__decorate([ae],le.prototype,"extensionDevelopmentLocationURI",null),__decorate([ae],le.prototype,"extensionDevelopmentKind",null),__decorate([ae],le.prototype,"extensionTestsLocationURI",null),__decorate([ae],le.prototype,"debugExtensionHost",null),__decorate([ae],le.prototype,"logLevel",null),__decorate([ae],le.prototype,"extensionLogLevel",null),__decorate([ae],le.prototype,"serviceMachineIdResource",null),__decorate([ae],le.prototype,"disableTelemetry",null),__decorate([ae],le.prototype,"disableWorkspaceTrust",null),__decorate([ae],le.prototype,"useInMemorySecretStorage",null),__decorate([ae],le.prototype,"policyFile",null);function n4(t,e){return o4(t["inspect-extensions"],t["inspect-brk-extensions"],5870,e,t.debugId,t.extensionEnvironment)}function o4(t,e,i,s,r,n){const a=Number(e||t)||(s?null:i),l=a?!!e:!1;let c;if(n)try{c=JSON.parse(n)}catch{}return{port:a,break:l,debugId:r,env:c}}import{homedir as gh}from"os";import{resolve as a4,isAbsolute as l4,join as Es}from"path";var c4=process.env.VSCODE_CWD||process.cwd();function u4(t,e){const i=h4(t,e),s=[i];return l4(i)||s.unshift(c4),a4(...s)}function h4(t,e){process.env.VSCODE_DEV&&(e="code-oss-dev");const i=process.env.VSCODE_PORTABLE;if(i)return Es(i,"user-data");let s=process.env.VSCODE_APPDATA;if(s)return Es(s,e);const r=t["user-data-dir"];if(r)return r;switch(process.platform){case"win32":if(s=process.env.APPDATA,!s){const n=process.env.USERPROFILE;if(typeof n!="string")throw new Error("Windows: Unexpected undefined %USERPROFILE% environment variable");s=Es(n,"AppData","Roaming")}break;case"darwin":s=Es(gh(),"Library","Application Support");break;case"linux":s=process.env.XDG_CONFIG_HOME||Es(gh(),".config");break;default:throw new Error("Platform not supported")}return Es(s,e)}var f4=class extends le{constructor(t,e){super(t,{homeDir:e4(),tmpDir:t4(),userDataDir:u4(t,e.nameShort)},e)}},$n={},X={exports:$n};(function(t,e){if(typeof $n=="object"&&typeof X=="object")X.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var i=e();for(var s in i)(typeof $n=="object"?$n:t)[s]=i[s]}})(typeof self<"u"?self:void 0,function(){return function(t){var e={};function i(s){if(e[s])return e[s].exports;var r=e[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(s,r,n){i.o(s,r)||Object.defineProperty(s,r,{enumerable:!0,get:n})},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},i.t=function(s,r){if(1&r&&(s=i(s)),8&r||4&r&&typeof s=="object"&&s&&s.__esModule)return s;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:s}),2&r&&typeof s!="string")for(var o in s)i.d(n,o,function(a){return s[a]}.bind(null,o));return n},i.n=function(s){var r=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(r,"a",r),r},i.o=function(s,r){return Object.prototype.hasOwnProperty.call(s,r)},i.p="",i(i.s=0)}([function(t,e,i){(function(s){var r;e=t.exports=re,r=typeof s=="object"&&s.env&&s.env.NODE_DEBUG&&/\bsemver\b/i.test(s.env.NODE_DEBUG)?function(){var v=Array.prototype.slice.call(arguments,0);v.unshift("SEMVER"),console.log.apply(console,v)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var n=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=e.re=[],l=e.src=[],c=0,u=c++;l[u]="0|[1-9]\\d*";var f=c++;l[f]="[0-9]+";var d=c++;l[d]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var p=c++;l[p]="("+l[u]+")\\.("+l[u]+")\\.("+l[u]+")";var m=c++;l[m]="("+l[f]+")\\.("+l[f]+")\\.("+l[f]+")";var w=c++;l[w]="(?:"+l[u]+"|"+l[d]+")";var y=c++;l[y]="(?:"+l[f]+"|"+l[d]+")";var b=c++;l[b]="(?:-("+l[w]+"(?:\\."+l[w]+")*))";var S=c++;l[S]="(?:-?("+l[y]+"(?:\\."+l[y]+")*))";var I=c++;l[I]="[0-9A-Za-z-]+";var M=c++;l[M]="(?:\\+("+l[I]+"(?:\\."+l[I]+")*))";var te=c++,we="v?"+l[p]+l[b]+"?"+l[M]+"?";l[te]="^"+we+"$";var D="[v=\\s]*"+l[m]+l[S]+"?"+l[M]+"?",O=c++;l[O]="^"+D+"$";var $=c++;l[$]="((?:<|>)?=?)";var j=c++;l[j]=l[f]+"|x|X|\\*";var ve=c++;l[ve]=l[u]+"|x|X|\\*";var B=c++;l[B]="[v=\\s]*("+l[ve]+")(?:\\.("+l[ve]+")(?:\\.("+l[ve]+")(?:"+l[b]+")?"+l[M]+"?)?)?";var st=c++;l[st]="[v=\\s]*("+l[j]+")(?:\\.("+l[j]+")(?:\\.("+l[j]+")(?:"+l[S]+")?"+l[M]+"?)?)?";var A=c++;l[A]="^"+l[$]+"\\s*"+l[B]+"$";var P=c++;l[P]="^"+l[$]+"\\s*"+l[st]+"$";var L=c++;l[L]="(?:^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])";var R=c++;l[R]="(?:~>?)";var T=c++;l[T]="(\\s*)"+l[R]+"\\s+",a[T]=new RegExp(l[T],"g");var H=c++;l[H]="^"+l[R]+l[B]+"$";var Y=c++;l[Y]="^"+l[R]+l[st]+"$";var Ee=c++;l[Ee]="(?:\\^)";var Ae=c++;l[Ae]="(\\s*)"+l[Ee]+"\\s+",a[Ae]=new RegExp(l[Ae],"g");var _t=c++;l[_t]="^"+l[Ee]+l[B]+"$";var Pi=c++;l[Pi]="^"+l[Ee]+l[st]+"$";var Xt=c++;l[Xt]="^"+l[$]+"\\s*("+D+")$|^$";var Ki=c++;l[Ki]="^"+l[$]+"\\s*("+we+")$|^$";var Vt=c++;l[Vt]="(\\s*)"+l[$]+"\\s*("+D+"|"+l[B]+")",a[Vt]=new RegExp(l[Vt],"g");var Lr=c++;l[Lr]="^\\s*("+l[B]+")\\s+-\\s+("+l[B]+")\\s*$";var Or=c++;l[Or]="^\\s*("+l[st]+")\\s+-\\s+("+l[st]+")\\s*$";var ql=c++;l[ql]="(<|>)?=?\\s*\\*";for(var ki=0;ki<35;ki++)r(ki,l[ki]),a[ki]||(a[ki]=new RegExp(l[ki]));function Ii(v,E){if(v instanceof re)return v;if(typeof v!="string"||v.length>n||!(E?a[O]:a[te]).test(v))return null;try{return new re(v,E)}catch{return null}}function re(v,E){if(v instanceof re){if(v.loose===E)return v;v=v.version}else if(typeof v!="string")throw new TypeError("Invalid Version: "+v);if(v.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof re))return new re(v,E);r("SemVer",v,E),this.loose=E;var x=v.trim().match(E?a[O]:a[te]);if(!x)throw new TypeError("Invalid Version: "+v);if(this.raw=v,this.major=+x[1],this.minor=+x[2],this.patch=+x[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");x[4]?this.prerelease=x[4].split(".").map(function(C){if(/^[0-9]+$/.test(C)){var _=+C;if(_>=0&&_<o)return _}return C}):this.prerelease=[],this.build=x[5]?x[5].split("."):[],this.format()}e.parse=Ii,e.valid=function(v,E){var x=Ii(v,E);return x?x.version:null},e.clean=function(v,E){var x=Ii(v.trim().replace(/^[=v]+/,""),E);return x?x.version:null},e.SemVer=re,re.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},re.prototype.toString=function(){return this.version},re.prototype.compare=function(v){return r("SemVer.compare",this.version,this.loose,v),v instanceof re||(v=new re(v,this.loose)),this.compareMain(v)||this.comparePre(v)},re.prototype.compareMain=function(v){return v instanceof re||(v=new re(v,this.loose)),Yi(this.major,v.major)||Yi(this.minor,v.minor)||Yi(this.patch,v.patch)},re.prototype.comparePre=function(v){if(v instanceof re||(v=new re(v,this.loose)),this.prerelease.length&&!v.prerelease.length)return-1;if(!this.prerelease.length&&v.prerelease.length)return 1;if(!this.prerelease.length&&!v.prerelease.length)return 0;var E=0;do{var x=this.prerelease[E],C=v.prerelease[E];if(r("prerelease compare",E,x,C),x===void 0&&C===void 0)return 0;if(C===void 0)return 1;if(x===void 0)return-1;if(x!==C)return Yi(x,C)}while(++E)},re.prototype.inc=function(v,E){switch(v){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",E);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",E);break;case"prepatch":this.prerelease.length=0,this.inc("patch",E),this.inc("pre",E);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",E),this.inc("pre",E);break;case"major":this.minor===0&&this.patch===0&&this.prerelease.length!==0||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":this.patch===0&&this.prerelease.length!==0||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var x=this.prerelease.length;--x>=0;)typeof this.prerelease[x]=="number"&&(this.prerelease[x]++,x=-2);x===-1&&this.prerelease.push(0)}E&&(this.prerelease[0]===E?isNaN(this.prerelease[1])&&(this.prerelease=[E,0]):this.prerelease=[E,0]);break;default:throw new Error("invalid increment argument: "+v)}return this.format(),this.raw=this.version,this},e.inc=function(v,E,x,C){typeof x=="string"&&(C=x,x=void 0);try{return new re(v,x).inc(E,C).version}catch{return null}},e.diff=function(v,E){if(lo(v,E))return null;var x=Ii(v),C=Ii(E);if(x.prerelease.length||C.prerelease.length){for(var _ in x)if((_==="major"||_==="minor"||_==="patch")&&x[_]!==C[_])return"pre"+_;return"prerelease"}for(var _ in x)if((_==="major"||_==="minor"||_==="patch")&&x[_]!==C[_])return _},e.compareIdentifiers=Yi;var Wl=/^[0-9]+$/;function Yi(v,E){var x=Wl.test(v),C=Wl.test(E);return x&&C&&(v=+v,E=+E),x&&!C?-1:C&&!x?1:v<E?-1:v>E?1:0}function Kt(v,E,x){return new re(v,x).compare(new re(E,x))}function Nr(v,E,x){return Kt(v,E,x)>0}function Cr(v,E,x){return Kt(v,E,x)<0}function lo(v,E,x){return Kt(v,E,x)===0}function Hl(v,E,x){return Kt(v,E,x)!==0}function co(v,E,x){return Kt(v,E,x)>=0}function uo(v,E,x){return Kt(v,E,x)<=0}function Fr(v,E,x,C){var _;switch(E){case"===":typeof v=="object"&&(v=v.version),typeof x=="object"&&(x=x.version),_=v===x;break;case"!==":typeof v=="object"&&(v=v.version),typeof x=="object"&&(x=x.version),_=v!==x;break;case"":case"=":case"==":_=lo(v,x,C);break;case"!=":_=Hl(v,x,C);break;case">":_=Nr(v,x,C);break;case">=":_=co(v,x,C);break;case"<":_=Cr(v,x,C);break;case"<=":_=uo(v,x,C);break;default:throw new TypeError("Invalid operator: "+E)}return _}function bt(v,E){if(v instanceof bt){if(v.loose===E)return v;v=v.value}if(!(this instanceof bt))return new bt(v,E);r("comparator",v,E),this.loose=E,this.parse(v),this.semver===Cs?this.value="":this.value=this.operator+this.semver.version,r("comp",this)}e.rcompareIdentifiers=function(v,E){return Yi(E,v)},e.major=function(v,E){return new re(v,E).major},e.minor=function(v,E){return new re(v,E).minor},e.patch=function(v,E){return new re(v,E).patch},e.compare=Kt,e.compareLoose=function(v,E){return Kt(v,E,!0)},e.rcompare=function(v,E,x){return Kt(E,v,x)},e.sort=function(v,E){return v.sort(function(x,C){return e.compare(x,C,E)})},e.rsort=function(v,E){return v.sort(function(x,C){return e.rcompare(x,C,E)})},e.gt=Nr,e.lt=Cr,e.eq=lo,e.neq=Hl,e.gte=co,e.lte=uo,e.cmp=Fr,e.Comparator=bt;var Cs={};function Pe(v,E){if(v instanceof Pe)return v.loose===E?v:new Pe(v.raw,E);if(v instanceof bt)return new Pe(v.value,E);if(!(this instanceof Pe))return new Pe(v,E);if(this.loose=E,this.raw=v,this.set=v.split(/\s*\|\|\s*/).map(function(x){return this.parseRange(x.trim())},this).filter(function(x){return x.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+v);this.format()}function Ke(v){return!v||v.toLowerCase()==="x"||v==="*"}function ud(v,E,x,C,_,je,ne,rt,Re,Ge,zt,Le,We){return((E=Ke(x)?"":Ke(C)?">="+x+".0.0":Ke(_)?">="+x+"."+C+".0":">="+E)+" "+(rt=Ke(Re)?"":Ke(Ge)?"<"+(+Re+1)+".0.0":Ke(zt)?"<"+Re+"."+(+Ge+1)+".0":Le?"<="+Re+"."+Ge+"."+zt+"-"+Le:"<="+rt)).trim()}function hd(v,E){for(var x=0;x<v.length;x++)if(!v[x].test(E))return!1;if(E.prerelease.length){for(x=0;x<v.length;x++)if(r(v[x].semver),v[x].semver!==Cs&&v[x].semver.prerelease.length>0){var C=v[x].semver;if(C.major===E.major&&C.minor===E.minor&&C.patch===E.patch)return!0}return!1}return!0}function Tr(v,E,x){try{E=new Pe(E,x)}catch{return!1}return E.test(v)}function ho(v,E,x,C){var _,je,ne,rt,Re;switch(v=new re(v,C),E=new Pe(E,C),x){case">":_=Nr,je=uo,ne=Cr,rt=">",Re=">=";break;case"<":_=Cr,je=co,ne=Nr,rt="<",Re="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Tr(v,E,C))return!1;for(var Ge=0;Ge<E.set.length;++Ge){var zt=E.set[Ge],Le=null,We=null;if(zt.forEach(function(nt){nt.semver===Cs&&(nt=new bt(">=0.0.0")),Le=Le||nt,We=We||nt,_(nt.semver,Le.semver,C)?Le=nt:ne(nt.semver,We.semver,C)&&(We=nt)}),Le.operator===rt||Le.operator===Re||(!We.operator||We.operator===rt)&&je(v,We.semver)||We.operator===Re&&ne(v,We.semver))return!1}return!0}bt.prototype.parse=function(v){var E=this.loose?a[Xt]:a[Ki],x=v.match(E);if(!x)throw new TypeError("Invalid comparator: "+v);this.operator=x[1],this.operator==="="&&(this.operator=""),x[2]?this.semver=new re(x[2],this.loose):this.semver=Cs},bt.prototype.toString=function(){return this.value},bt.prototype.test=function(v){return r("Comparator.test",v,this.loose),this.semver===Cs||(typeof v=="string"&&(v=new re(v,this.loose)),Fr(v,this.operator,this.semver,this.loose))},bt.prototype.intersects=function(v,E){if(!(v instanceof bt))throw new TypeError("a Comparator is required");var x;if(this.operator==="")return x=new Pe(v.value,E),Tr(this.value,x,E);if(v.operator==="")return x=new Pe(this.value,E),Tr(v.semver,x,E);var C=!(this.operator!==">="&&this.operator!==">"||v.operator!==">="&&v.operator!==">"),_=!(this.operator!=="<="&&this.operator!=="<"||v.operator!=="<="&&v.operator!=="<"),je=this.semver.version===v.semver.version,ne=!(this.operator!==">="&&this.operator!=="<="||v.operator!==">="&&v.operator!=="<="),rt=Fr(this.semver,"<",v.semver,E)&&(this.operator===">="||this.operator===">")&&(v.operator==="<="||v.operator==="<"),Re=Fr(this.semver,">",v.semver,E)&&(this.operator==="<="||this.operator==="<")&&(v.operator===">="||v.operator===">");return C||_||je&&ne||rt||Re},e.Range=Pe,Pe.prototype.format=function(){return this.range=this.set.map(function(v){return v.join(" ").trim()}).join("||").trim(),this.range},Pe.prototype.toString=function(){return this.range},Pe.prototype.parseRange=function(v){var E=this.loose;v=v.trim(),r("range",v,E);var x=E?a[Or]:a[Lr];v=v.replace(x,ud),r("hyphen replace",v),v=v.replace(a[Vt],"$1$2$3"),r("comparator trim",v,a[Vt]),v=(v=(v=v.replace(a[T],"$1~")).replace(a[Ae],"$1^")).split(/\s+/).join(" ");var C=E?a[Xt]:a[Ki],_=v.split(" ").map(function(je){return function(ne,rt){return r("comp",ne),ne=function(Re,Ge){return Re.trim().split(/\s+/).map(function(zt){return function(Le,We){r("caret",Le,We);var nt=We?a[Pi]:a[_t];return Le.replace(nt,function(Dt,q,K,de,ye){var He;return r("caret",Le,Dt,q,K,de,ye),Ke(q)?He="":Ke(K)?He=">="+q+".0.0 <"+(+q+1)+".0.0":Ke(de)?He=q==="0"?">="+q+"."+K+".0 <"+q+"."+(+K+1)+".0":">="+q+"."+K+".0 <"+(+q+1)+".0.0":ye?(r("replaceCaret pr",ye),ye.charAt(0)!=="-"&&(ye="-"+ye),He=q==="0"?K==="0"?">="+q+"."+K+"."+de+ye+" <"+q+"."+K+"."+(+de+1):">="+q+"."+K+"."+de+ye+" <"+q+"."+(+K+1)+".0":">="+q+"."+K+"."+de+ye+" <"+(+q+1)+".0.0"):(r("no pr"),He=q==="0"?K==="0"?">="+q+"."+K+"."+de+" <"+q+"."+K+"."+(+de+1):">="+q+"."+K+"."+de+" <"+q+"."+(+K+1)+".0":">="+q+"."+K+"."+de+" <"+(+q+1)+".0.0"),r("caret return",He),He})}(zt,Ge)}).join(" ")}(ne,rt),r("caret",ne),ne=function(Re,Ge){return Re.trim().split(/\s+/).map(function(zt){return function(Le,We){var nt=We?a[Y]:a[H];return Le.replace(nt,function(Dt,q,K,de,ye){var He;return r("tilde",Le,Dt,q,K,de,ye),Ke(q)?He="":Ke(K)?He=">="+q+".0.0 <"+(+q+1)+".0.0":Ke(de)?He=">="+q+"."+K+".0 <"+q+"."+(+K+1)+".0":ye?(r("replaceTilde pr",ye),ye.charAt(0)!=="-"&&(ye="-"+ye),He=">="+q+"."+K+"."+de+ye+" <"+q+"."+(+K+1)+".0"):He=">="+q+"."+K+"."+de+" <"+q+"."+(+K+1)+".0",r("tilde return",He),He})}(zt,Ge)}).join(" ")}(ne,rt),r("tildes",ne),ne=function(Re,Ge){return r("replaceXRanges",Re,Ge),Re.split(/\s+/).map(function(zt){return function(Le,We){Le=Le.trim();var nt=We?a[P]:a[A];return Le.replace(nt,function(Dt,q,K,de,ye,He){r("xRange",Le,Dt,q,K,de,ye,He);var Gl=Ke(K),Fs=Gl||Ke(de),Ts=Fs||Ke(ye);return q==="="&&Ts&&(q=""),Gl?Dt=q===">"||q==="<"?"<0.0.0":"*":q&&Ts?(Fs&&(de=0),Ts&&(ye=0),q===">"?(q=">=",Fs?(K=+K+1,de=0,ye=0):Ts&&(de=+de+1,ye=0)):q==="<="&&(q="<",Fs?K=+K+1:de=+de+1),Dt=q+K+"."+de+"."+ye):Fs?Dt=">="+K+".0.0 <"+(+K+1)+".0.0":Ts&&(Dt=">="+K+"."+de+".0 <"+K+"."+(+de+1)+".0"),r("xRange return",Dt),Dt})}(zt,Ge)}).join(" ")}(ne,rt),r("xrange",ne),ne=function(Re,Ge){return r("replaceStars",Re,Ge),Re.trim().replace(a[ql],"")}(ne,rt),r("stars",ne),ne}(je,E)}).join(" ").split(/\s+/);return this.loose&&(_=_.filter(function(je){return!!je.match(C)})),_=_.map(function(je){return new bt(je,E)})},Pe.prototype.intersects=function(v,E){if(!(v instanceof Pe))throw new TypeError("a Range is required");return this.set.some(function(x){return x.every(function(C){return v.set.some(function(_){return _.every(function(je){return C.intersects(je,E)})})})})},e.toComparators=function(v,E){return new Pe(v,E).set.map(function(x){return x.map(function(C){return C.value}).join(" ").trim().split(" ")})},Pe.prototype.test=function(v){if(!v)return!1;typeof v=="string"&&(v=new re(v,this.loose));for(var E=0;E<this.set.length;E++)if(hd(this.set[E],v))return!0;return!1},e.satisfies=Tr,e.maxSatisfying=function(v,E,x){var C=null,_=null;try{var je=new Pe(E,x)}catch{return null}return v.forEach(function(ne){je.test(ne)&&(C&&_.compare(ne)!==-1||(_=new re(C=ne,x)))}),C},e.minSatisfying=function(v,E,x){var C=null,_=null;try{var je=new Pe(E,x)}catch{return null}return v.forEach(function(ne){je.test(ne)&&(C&&_.compare(ne)!==1||(_=new re(C=ne,x)))}),C},e.validRange=function(v,E){try{return new Pe(v,E).range||"*"}catch{return null}},e.ltr=function(v,E,x){return ho(v,E,"<",x)},e.gtr=function(v,E,x){return ho(v,E,">",x)},e.outside=ho,e.prerelease=function(v,E){var x=Ii(v,E);return x&&x.prerelease.length?x.prerelease:null},e.intersects=function(v,E,x){return v=new Pe(v,x),E=new Pe(E,x),v.intersects(E)},e.coerce=function(v){if(v instanceof re)return v;if(typeof v!="string")return null;var E=v.match(a[L]);return E==null?null:Ii((E[1]||"0")+"."+(E[2]||"0")+"."+(E[3]||"0"))}}).call(this,i(1))},function(t,e){var i,s,r=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(y){if(i===setTimeout)return setTimeout(y,0);if((i===n||!i)&&setTimeout)return i=setTimeout,setTimeout(y,0);try{return i(y,0)}catch{try{return i.call(null,y,0)}catch{return i.call(this,y,0)}}}(function(){try{i=typeof setTimeout=="function"?setTimeout:n}catch{i=n}try{s=typeof clearTimeout=="function"?clearTimeout:o}catch{s=o}})();var l,c=[],u=!1,f=-1;function d(){u&&l&&(u=!1,l.length?c=l.concat(c):f=-1,c.length&&p())}function p(){if(!u){var y=a(d);u=!0;for(var b=c.length;b;){for(l=c,c=[];++f<b;)l&&l[f].run();f=-1,b=c.length}l=null,u=!1,function(S){if(s===clearTimeout)return clearTimeout(S);if((s===o||!s)&&clearTimeout)return s=clearTimeout,clearTimeout(S);try{s(S)}catch{try{return s.call(null,S)}catch{return s.call(this,S)}}}(y)}}function m(y,b){this.fun=y,this.array=b}function w(){}r.nextTick=function(y){var b=new Array(arguments.length-1);if(arguments.length>1)for(var S=1;S<arguments.length;S++)b[S-1]=arguments[S];c.push(new m(y,b)),c.length!==1||u||a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=w,r.addListener=w,r.once=w,r.off=w,r.removeListener=w,r.removeAllListeners=w,r.emit=w,r.prependListener=w,r.prependOnceListener=w,r.listeners=function(y){return[]},r.binding=function(y){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(y){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}}])});var _7=X.exports.SEMVER_SPEC_VERSION,V7=X.exports.parse,d4=X.exports.valid,z7=X.exports.coerce,B7=X.exports.clean,q7=X.exports.inc,W7=X.exports.major,H7=X.exports.minor,G7=X.exports.patch,J7=X.exports.prerelease,ga=X.exports.gt,Q7=X.exports.gte,Z7=X.exports.lt,X7=X.exports.lte,p4=X.exports.eq,K7=X.exports.neq,Y7=X.exports.cmp,e6=X.exports.compare,mh=X.exports.rcompare,t6=X.exports.compareIdentifiers,i6=X.exports.rcompareIdentifiers,s6=X.exports.compareBuild,r6=X.exports.sort,n6=X.exports.rsort,o6=X.exports.diff,a6=X.exports.validRange,g4=X.exports.satisfies,l6=X.exports.maxSatisfying,c6=X.exports.minSatisfying,u6=X.exports.minVersion,h6=X.exports.gtr,f6=X.exports.ltr,d6=X.exports.outside,p6=X.exports.intersects,g6=X.exports.SemVer,m6=X.exports.Comparator,w6=X.exports.Range,ma="Offline";function wh(t){return t instanceof m4?!0:t instanceof Error&&t.name===ma&&t.message===ma}var m4=class extends Error{constructor(){super(ma),this.name=this.message}},w4="^([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$",wa=new RegExp(w4),v4="__web_extension",vh="extensionInstallSource",y4="dependecyOrPackExtensionInstall",b4="clientTargetPlatform",yh;(function(t){t.COMMAND="command",t.SETTINGS_SYNC="settingsSync"})(yh||(yh={}));function bh(t){switch(t){case"win32-x64":return"Windows 64 bit";case"win32-arm64":return"Windows ARM";case"linux-x64":return"Linux 64 bit";case"linux-arm64":return"Linux ARM 64";case"linux-armhf":return"Linux ARM";case"alpine-x64":return"Alpine Linux 64 bit";case"alpine-arm64":return"Alpine ARM 64";case"darwin-x64":return"Mac";case"darwin-arm64":return"Mac Silicon";case"web":return"Web";case"universal":return"universal";case"unknown":return"unknown";case"undefined":return"undefined"}}function E4(t){switch(t){case"win32-x64":return"win32-x64";case"win32-arm64":return"win32-arm64";case"linux-x64":return"linux-x64";case"linux-arm64":return"linux-arm64";case"linux-armhf":return"linux-armhf";case"alpine-x64":return"alpine-x64";case"alpine-arm64":return"alpine-arm64";case"darwin-x64":return"darwin-x64";case"darwin-arm64":return"darwin-arm64";case"web":return"web";case"universal":return"universal";default:return"unknown"}}function Eh(t,e){switch(t){case 3:return e==="x64"?"win32-x64":e==="arm64"?"win32-arm64":"unknown";case 2:return e==="x64"?"linux-x64":e==="arm64"?"linux-arm64":e==="arm"?"linux-armhf":"unknown";case"alpine":return e==="x64"?"alpine-x64":e==="arm64"?"alpine-arm64":"unknown";case 1:return e==="x64"?"darwin-x64":e==="arm64"?"darwin-arm64":"unknown";case 0:return"web"}}function xs(t,e){return e==="web"&&!t.includes("web")}function xh(t,e,i){return xs(e,i)?!1:t==="undefined"||t==="universal"?!0:t==="unknown"?!1:t===i}function x4(t){return t&&typeof t=="object"&&typeof t.id=="string"&&(!t.uuid||typeof t.uuid=="string")}var Sh;(function(t){t.NoneOrRelevance="NoneOrRelevance",t.LastUpdatedDate="LastUpdatedDate",t.Title="Title",t.PublisherName="PublisherName",t.InstallCount="InstallCount",t.PublishedDate="PublishedDate",t.AverageRating="AverageRating",t.WeightedRating="WeightedRating"})(Sh||(Sh={}));var $h;(function(t){t[t.Default=0]="Default",t[t.Ascending=1]="Ascending",t[t.Descending=2]="Descending"})($h||($h={}));var Ph;(function(t){t.Category="Category",t.ExtensionId="ExtensionId",t.ExtensionName="ExtensionName",t.ExcludeWithFlags="ExcludeWithFlags",t.Featured="Featured",t.SearchText="SearchText",t.Tag="Tag",t.Target="Target"})(Ph||(Ph={}));var kh;(function(t){t.Install="install",t.Uninstall="uninstall"})(kh||(kh={}));var Ih;(function(t){t[t.None=1]="None",t[t.Install=2]="Install",t[t.Update=3]="Update",t[t.Migrate=4]="Migrate"})(Ih||(Ih={}));var bi=ue("extensionGalleryService"),Dh;(function(t){t.Timeout="Timeout",t.Cancelled="Cancelled",t.Failed="Failed",t.DownloadFailedWriting="DownloadFailedWriting",t.Offline="Offline"})(Dh||(Dh={}));var Pn=class extends Error{constructor(t,e){super(t),this.code=e,this.name=e}},Ah;(function(t){t.NotFound="NotFound",t.Unsupported="Unsupported",t.Deprecated="Deprecated",t.Malicious="Malicious",t.Incompatible="Incompatible",t.IncompatibleApi="IncompatibleApi",t.IncompatibleTargetPlatform="IncompatibleTargetPlatform",t.ReleaseVersionNotFound="ReleaseVersionNotFound",t.Invalid="Invalid",t.Download="Download",t.DownloadSignature="DownloadSignature",t.DownloadFailedWriting="DownloadFailedWriting",t.UpdateMetadata="UpdateMetadata",t.Extract="Extract",t.Scanning="Scanning",t.ScanningExtension="ScanningExtension",t.ReadRemoved="ReadRemoved",t.UnsetRemoved="UnsetRemoved",t.Delete="Delete",t.Rename="Rename",t.IntializeDefaultProfile="IntializeDefaultProfile",t.AddToProfile="AddToProfile",t.InstalledExtensionNotFound="InstalledExtensionNotFound",t.PostInstall="PostInstall",t.CorruptZip="CorruptZip",t.IncompleteZip="IncompleteZip",t.PackageNotSigned="PackageNotSigned",t.SignatureVerificationInternal="SignatureVerificationInternal",t.SignatureVerificationFailed="SignatureVerificationFailed",t.NotAllowed="NotAllowed",t.Gallery="Gallery",t.Cancelled="Cancelled",t.Unknown="Unknown",t.Internal="Internal"})(Ah||(Ah={}));var Fe;(function(t){t.NotSigned="NotSigned",t.Success="Success",t.RequiredArgumentMissing="RequiredArgumentMissing",t.InvalidArgument="InvalidArgument",t.PackageIsUnreadable="PackageIsUnreadable",t.UnhandledException="UnhandledException",t.SignatureManifestIsMissing="SignatureManifestIsMissing",t.SignatureManifestIsUnreadable="SignatureManifestIsUnreadable",t.SignatureIsMissing="SignatureIsMissing",t.SignatureIsUnreadable="SignatureIsUnreadable",t.CertificateIsUnreadable="CertificateIsUnreadable",t.SignatureArchiveIsUnreadable="SignatureArchiveIsUnreadable",t.FileAlreadyExists="FileAlreadyExists",t.SignatureArchiveIsInvalidZip="SignatureArchiveIsInvalidZip",t.SignatureArchiveHasSameSignatureFile="SignatureArchiveHasSameSignatureFile",t.PackageIntegrityCheckFailed="PackageIntegrityCheckFailed",t.SignatureIsInvalid="SignatureIsInvalid",t.SignatureManifestIsInvalid="SignatureManifestIsInvalid",t.SignatureIntegrityCheckFailed="SignatureIntegrityCheckFailed",t.EntryIsMissing="EntryIsMissing",t.EntryIsTampered="EntryIsTampered",t.Untrusted="Untrusted",t.CertificateRevoked="CertificateRevoked",t.SignatureIsNotValid="SignatureIsNotValid",t.UnknownError="UnknownError",t.PackageIsInvalidZip="PackageIsInvalidZip",t.SignatureArchiveHasTooManyEntries="SignatureArchiveHasTooManyEntries"})(Fe||(Fe={}));var be=class extends Error{constructor(t,e){super(t),this.code=e,this.name=e}},va=ue("extensionManagementService"),v6=ue("IGlobalExtensionEnablementService"),y6=ue("IExtensionTipsService"),zi=ue("IAllowedExtensionsService");async function ya(t,e){let i;try{i=await e.resolve(t)}catch(s){if(s.fileOperationResult===1)return 0;throw s}return i.children?(await Promise.all(i.children.map(r=>ya(r.resource,e)))).reduce((r,n)=>r+n,0):i.size??0}var b6=bc(1933,"Extensions"),E6=bc(1934,"Preferences"),kn="extensions.allowed",S4="extensions.verifySignature";Tt.as(li.Configuration).registerConfiguration({id:"extensions",order:30,title:g(1916,null),type:"object",properties:{[kn]:{type:"object",markdownDescription:g(1917,null),default:"*",defaultSnippets:[{body:{},description:g(1918,null)},{body:{"*":!0},description:g(1919,null)}],scope:1,policy:{name:"AllowedExtensions",minimumVersion:"1.96",description:g(1920,null)},additionalProperties:!1,patternProperties:{"([a-z0-9A-Z][a-z0-9-A-Z]*)\\.([a-z0-9A-Z][a-z0-9-A-Z]*)$":{anyOf:[{type:["boolean","string"],enum:[!0,!1,"stable"],description:g(1921,null),enumDescriptions:[g(1922,null),g(1923,null),g(1924,null)]},{type:"array",items:{type:"string"},description:g(1925,null)}]},"([a-z0-9A-Z][a-z0-9-A-Z]*)$":{type:["boolean","string"],enum:[!0,!1,"stable"],description:g(1926,null),enumDescriptions:[g(1927,null),g(1928,null),g(1929,null)]},"\\*":{type:"boolean",enum:[!0,!1],description:g(1930,null),enumDescriptions:[g(1931,null),g(1932,null)]}}}}});function $4(t,e){return t?e?.capabilities.signing?.allPrivateRepositorySigned===!0:e?.capabilities.signing?.allPublicRepositorySigned===!0}var Rh="extensions.user.cache",P4="extensions.builtin.cache",Lh="undefined_publisher",k4=["AI","Azure","Chat","Data Science","Debuggers","Extension Packs","Education","Formatters","Keymaps","Language Packs","Linters","Machine Learning","Notebooks","Programming Languages","SCM Providers","Snippets","Testing","Themes","Visualization","Other"],Oh;(function(t){t[t.System=0]="System",t[t.User=1]="User"})(Oh||(Oh={}));var Nh;(function(t){t.WIN32_X64="win32-x64",t.WIN32_ARM64="win32-arm64",t.LINUX_X64="linux-x64",t.LINUX_ARM64="linux-arm64",t.LINUX_ARMHF="linux-armhf",t.ALPINE_X64="alpine-x64",t.ALPINE_ARM64="alpine-arm64",t.DARWIN_X64="darwin-x64",t.DARWIN_ARM64="darwin-arm64",t.WEB="web",t.UNIVERSAL="universal",t.UNKNOWN="unknown",t.UNDEFINED="undefined"})(Nh||(Nh={}));var Ss=class{constructor(t){this.value=t,this._lower=t.toLowerCase()}static equals(t,e){if(typeof t>"u"||t===null)return typeof e>"u"||e===null;if(typeof e>"u"||e===null)return!1;if(typeof t=="string"||typeof e=="string"){const i=typeof t=="string"?t:t.value,s=typeof e=="string"?e:e.value;return gi(i,s)}return t._lower===e._lower}static toKey(t){return typeof t=="string"?t.toLowerCase():t._lower}},I4=class{constructor(){this.c=new Map}clear(){this.c.clear()}delete(t){this.c.delete(Ss.toKey(t))}get(t){return this.c.get(Ss.toKey(t))}has(t){return this.c.has(Ss.toKey(t))}set(t,e){this.c.set(Ss.toKey(t),e)}values(){return this.c.values()}forEach(t){this.c.forEach(t)}[Symbol.iterator](){return this.c[Symbol.iterator]()}};function Ch(t){return D4(t)}function D4(t){return t.contributes&&t.contributes.localizations?t.contributes.localizations.length>0:!1}function A4(t){return t.map(e=>{const[i,s]=e.split("@");return{proposalName:i,version:s?parseInt(s):void 0}})}function R4(t){return t.map(e=>e.split("@")[0])}var x6=ue("IBuiltinExtensionsScannerService"),L4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function O4(t){return L4.test(t)}var dt=function(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);const t=new Uint8Array(16),e=[];for(let i=0;i<256;i++)e.push(i.toString(16).padStart(2,"0"));return function(){crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let s=0,r="";return r+=e[t[s++]],r+=e[t[s++]],r+=e[t[s++]],r+=e[t[s++]],r+="-",r+=e[t[s++]],r+=e[t[s++]],r+="-",r+=e[t[s++]],r+=e[t[s++]],r+="-",r+=e[t[s++]],r+=e[t[s++]],r+="-",r+=e[t[s++]],r+=e[t[s++]],r+=e[t[s++]],r+=e[t[s++]],r+=e[t[s++]],r+=e[t[s++]],r}}();function N4(t){if(Hr===2&&/^penguin(\.|$)/i.test(t))return"chromebook"}function C4(t,e,i,s,r,n,o,a,l,c){const u=Object.create(null);u["common.machineId"]=n,u["common.sqmId"]=o,u["common.devDeviceId"]=a,u.sessionID=dt()+Date.now(),u.commitHash=s,u.version=r,u["common.platformVersion"]=(t||"").replace(/^(\d+)(\.\d+)?(\.\d+)?(.*)/,"$1$2$3"),u["common.platform"]=u0(Hr),u["common.nodePlatform"]=Oc,u["common.nodeArch"]=i,u["common.product"]=c||"desktop",l&&(u["common.msftInternal"]=l);let f=0;const d=Date.now();Object.defineProperties(u,{timestamp:{get:()=>new Date,enumerable:!0},"common.timesincesessionstart":{get:()=>Date.now()-d,enumerable:!0},"common.sequence":{get:()=>f++,enumerable:!0}}),h0&&(u["common.snap"]="true");const p=N4(e);return p&&(u["common.platformDetail"]=p),u}function F4(t){const e=Lt.USERDNSDOMAIN;if(!e)return!1;const i=e.toLowerCase();return t.some(s=>i===s)}var Ht=ue("telemetryService"),S6=ue("customEndpointTelemetryService"),T4="telemetry.machineId",U4="telemetry.sqmId",M4="telemetry.devDeviceId",j4="telemetry",In="telemetry.telemetryLevel",Fh="telemetry.enableCrashReporter",ba="telemetry.enableTelemetry",Th;(function(t){t[t.NONE=0]="NONE",t[t.CRASH=1]="CRASH",t[t.ERROR=2]="ERROR",t[t.USAGE=3]="USAGE"})(Th||(Th={}));var Uh;(function(t){t.OFF="off",t.CRASH="crash",t.ERROR="error",t.ON="all"})(Uh||(Uh={}));var Dn=class{constructor(t){this.value=t,this.isTrustedTelemetryValue=!0}},_4=class{constructor(){this.telemetryLevel=0,this.sessionId="someValue.sessionId",this.machineId="someValue.machineId",this.sqmId="someValue.sqmId",this.devDeviceId="someValue.devDeviceId",this.firstSessionDate="someValue.firstSessionDate",this.sendErrorTelemetry=!1}publicLog(){}publicLog2(){}publicLogError(){}publicLogError2(){}setExperimentProperty(){}},V4=new _4,z4="telemetry",$6={id:z4,name:g(2246,null)};function Mh(t,e){return!e.isBuilt&&!e.disableTelemetry?!0:!(e.disableTelemetry||!t.enableTelemetry)}function jh(t){const e=t.getValue(In),i=t.getValue(Fh);if(t.getValue(ba)===!1||i===!1)return 0;switch(e??"all"){case"all":return 3;case"error":return 2;case"crash":return 1;case"off":return 0}}function B4(t){const e={},i={},s={};_h(t,s);for(let r in s){r=r.length>150?r.substr(r.length-149):r;const n=s[r];typeof n=="number"?i[r]=n:typeof n=="boolean"?i[r]=n?1:0:typeof n=="string"?(n.length>8192&&console.warn(`Telemetry property: ${r} has been trimmed to 8192, the original length is ${n.length}`),e[r]=n.substring(0,8191)):typeof n<"u"&&n!==null&&(e[r]=n)}return{properties:e,measurements:i}}function _h(t,e,i=0,s){if(t)for(const r of Object.getOwnPropertyNames(t)){const n=t[r],o=s?s+r:r;Array.isArray(n)?e[o]=Du(n):n instanceof Date?e[o]=n.toISOString():Oe(n)?i<2?_h(n,e,i+1,o+"."):e[o]=Du(n):e[o]=n}}function q4(t,e){const i=t.msftInternalDomains||[],s=e.getValue("telemetry.internalTesting");return F4(i)||s}function W4(t){return[t.appRoot,t.extensionsPath,t.userHome.fsPath,t.tmpDir.fsPath,t.userDataPath]}function H4(t,e){if(!t||!t.includes("/")&&!t.includes("\\"))return t;let i=t;const s=[];for(const a of e)for(;;){const l=a.exec(t);if(!l)break;s.push([l.index,a.lastIndex])}const r=/^[\\\/]?(node_modules|node_modules\.asar)[\\\/]/,n=/(file:\/\/)?([a-zA-Z]:(\\\\|\\|\/)|(\\\\|\\|\/))?([\w-\._]+(\\\\|\\|\/))+[\w-\._]*/g;let o=0;for(i="";;){const a=n.exec(t);if(!a)break;const l=s.some(([c,u])=>a.index<u&&c<n.lastIndex);!r.test(a[0])&&!l&&(i+=t.substring(o,a.index)+"<REDACTED: user-file-path>",o=n.lastIndex)}return o<t.length&&(i+=t.substr(o)),i}function G4(t){if(!t)return t;const e=[{label:"Google API Key",regex:/AIza[A-Za-z0-9_\\\-]{35}/},{label:"JWT",regex:/eyJ[0eXAiOiJKV1Qi|hbGci|a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+/},{label:"Slack Token",regex:/xox[pbar]\-[A-Za-z0-9]/},{label:"GitHub Token",regex:/(gh[psuro]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})/},{label:"Generic Secret",regex:/(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i},{label:"CLI Credentials",regex:/((login|psexec|(certutil|psexec)\.exe).{1,50}(\s-u(ser(name)?)?\s+.{3,100})?\s-(admin|user|vm|root)?p(ass(word)?)?\s+["']?[^$\-\/\s]|(^|[\s\r\n\\])net(\.exe)?.{1,5}(user\s+|share\s+\/user:| user -? secrets ? set) \s + [^ $\s \/])/},{label:"Microsoft Entra ID",regex:/eyJ(?:0eXAiOiJKV1Qi|hbGci|[a-zA-Z0-9\-_]+\.[a-zA-Z0-9\-_]+\.)/},{label:"Email",regex:/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/}];for(const i of e)if(i.regex.test(t))return`<REDACTED: ${i.label}>`;return t}function J4(t,e){return Kp(t,i=>{if(i instanceof Dn||Object.hasOwnProperty.call(i,"isTrustedTelemetryValue"))return i.value;if(typeof i=="string"){let s=i.replaceAll("%20"," ");s=H4(s,e);for(const r of e)s=s.replace(r,"");return s=G4(s),s}})}function Q(t,e){return t.uuid&&e.uuid?t.uuid===e.uuid:t.id===e.id?!0:Jr(t.id,e.id)===0}var Q4=/^([^.]+\..+)-(\d+\.\d+\.\d+)(-(.+))?$/,pt=class oo{static create(e){const i=e.manifest?e.manifest.version:e.version,s=e.manifest?e.targetPlatform:e.properties.targetPlatform;return new oo(e.identifier,i,s)}static parse(e){const i=Q4.exec(e);return i&&i[1]&&i[2]?new oo({id:i[1]},i[2],i[4]||void 0):null}constructor(e,i,s="undefined"){this.identifier=e,this.version=i,this.targetPlatform=s,this.id=e.id}toString(){return`${this.id}-${this.version}${this.targetPlatform!=="undefined"?`-${this.targetPlatform}`:""}`}equals(e){return e instanceof oo?Q(this,e)&&this.version===e.version&&this.targetPlatform===e.targetPlatform:!1}},Z4=/^([^.]+\..+)@((prerelease)|(\d+\.\d+\.\d+(-.*)?))$/;function Ea(t){const e=Z4.exec(t);return e&&e[1]?[An(e[1]),e[2]]:[An(t),void 0]}function Vh(t,e){return`${t}.${e}`}function An(t){return t.toLowerCase()}function Ut(t,e){return An(Vh(t??Lh,e))}function zh(t,e){const i=[],s=r=>{for(const n of i)if(n.some(o=>Q(e(o),e(r))))return n;return null};for(const r of t){const n=s(r);n?n.push(r):i.push([r])}return i}function X4(t){return{id:t.identifier.id,name:t.manifest.name,galleryId:null,publisherId:t.publisherId,publisherName:t.manifest.publisher,publisherDisplayName:t.publisherDisplayName,dependencies:t.manifest.extensionDependencies&&t.manifest.extensionDependencies.length>0}}function xa(t){return{id:new Dn(t.identifier.id),name:new Dn(t.name),extensionVersion:t.version,galleryId:t.identifier.uuid,publisherId:t.publisherId,publisherName:t.publisher,publisherDisplayName:t.publisherDisplayName,isPreReleaseVersion:t.properties.isPreReleaseVersion,dependencies:!!(t.properties.dependencies&&t.properties.dependencies.length>0),isSigned:t.isSigned,...t.telemetryData}}var P6=new Ss("pprice.better-merge");async function K4(t,e){if(!at)return!1;let i;try{i=(await t.readFile(k.file("/etc/os-release"))).value.toString()}catch{try{i=(await t.readFile(k.file("/usr/lib/os-release"))).value.toString()}catch(r){e.debug("Error while getting the os-release file.",G(r))}}return!!i&&(i.match(/^ID=([^\u001b\r\n]*)/m)||[])[1]==="alpine"}async function Bh(t,e){const i=await K4(t,e),s=Eh(i?"alpine":Hr,Nc);return e.info("ComputeTargetPlatform:",s),s}function Y4(t,e){return em(t,e)!==void 0}function em(t,e){return e.find(({extensionOrPublisher:i})=>xe(i)?Jr(t.id.split(".")[0],i)===0:Q(t,i))}var lr;(function(t){t[t.Ignore=0]="Ignore",t[t.Info=1]="Info",t[t.Warning=2]="Warning",t[t.Error=3]="Error"})(lr||(lr={})),function(t){const e="error",i="warning",s="warn",r="info",n="ignore";function o(l){return l?gi(e,l)?t.Error:gi(i,l)||gi(s,l)?t.Warning:gi(r,l)?t.Info:t.Ignore:t.Ignore}t.fromValue=o;function a(l){switch(l){case t.Error:return e;case t.Warning:return i;case t.Info:return r;default:return n}}t.toString=a}(lr||(lr={}));var Ve=lr,tm={activeComment:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.activeComment.d.ts"},aiRelatedInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiRelatedInformation.d.ts"},aiSettingsSearch:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiSettingsSearch.d.ts"},aiTextSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.aiTextSearchProvider.d.ts",version:2},authIssuers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authIssuers.d.ts"},authLearnMore:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authLearnMore.d.ts"},authSession:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.authSession.d.ts"},canonicalUriProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.canonicalUriProvider.d.ts"},chatEditing:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatEditing.d.ts"},chatParticipantAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts"},chatParticipantPrivate:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts",version:9},chatProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatProvider.d.ts"},chatReferenceBinaryData:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceBinaryData.d.ts"},chatReferenceDiagnostic:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatReferenceDiagnostic.d.ts"},chatStatusItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatStatusItem.d.ts"},chatTab:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatTab.d.ts"},codeActionAI:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionAI.d.ts"},codeActionRanges:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codeActionRanges.d.ts"},codiconDecoration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.codiconDecoration.d.ts"},commentReactor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReactor.d.ts"},commentReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentReveal.d.ts"},commentThreadApplicability:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentThreadApplicability.d.ts"},commentingRangeHint:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentingRangeHint.d.ts"},commentsDraftState:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.commentsDraftState.d.ts"},contribAccessibilityHelpContent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribAccessibilityHelpContent.d.ts"},contribCommentEditorActionsMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentEditorActionsMenu.d.ts"},contribCommentPeekContext:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentPeekContext.d.ts"},contribCommentThreadAdditionalMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts"},contribCommentsViewThreadMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribCommentsViewThreadMenus.d.ts"},contribDebugCreateConfiguration:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDebugCreateConfiguration.d.ts"},contribDiffEditorGutterToolBarMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribDiffEditorGutterToolBarMenus.d.ts"},contribEditSessions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditSessions.d.ts"},contribEditorContentMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribEditorContentMenu.d.ts"},contribLabelFormatterWorkspaceTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLabelFormatterWorkspaceTooltip.d.ts"},contribLanguageModelToolSets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribLanguageModelToolSets.d.ts"},contribMenuBarHome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMenuBarHome.d.ts"},contribMergeEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMergeEditorMenus.d.ts"},contribMultiDiffEditorMenus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribMultiDiffEditorMenus.d.ts"},contribNotebookStaticPreloads:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribNotebookStaticPreloads.d.ts"},contribRemoteHelp:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribRemoteHelp.d.ts"},contribShareMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribShareMenu.d.ts"},contribSourceControlHistoryItemMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryItemMenu.d.ts"},contribSourceControlHistoryTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlHistoryTitleMenu.d.ts"},contribSourceControlInputBoxMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts"},contribSourceControlTitleMenu:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribSourceControlTitleMenu.d.ts"},contribStatusBarItems:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribStatusBarItems.d.ts"},contribViewContainerTitle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewContainerTitle.d.ts"},contribViewsRemote:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsRemote.d.ts"},contribViewsWelcome:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts"},customEditorMove:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts"},debugVisualization:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts"},defaultChatParticipant:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts",version:4},diffCommand:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts"},diffContentOptions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffContentOptions.d.ts"},documentFiltersExclusive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.documentFiltersExclusive.d.ts"},editSessionIdentityProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editSessionIdentityProvider.d.ts"},editorHoverVerbosityLevel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorHoverVerbosityLevel.d.ts"},editorInsets:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.editorInsets.d.ts"},embeddings:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.embeddings.d.ts"},extensionRuntime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionRuntime.d.ts"},extensionsAny:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.extensionsAny.d.ts"},externalUriOpener:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.externalUriOpener.d.ts"},fileSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider.d.ts"},fileSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fileSearchProvider2.d.ts"},findFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findFiles2.d.ts",version:2},findTextInFiles:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles.d.ts"},findTextInFiles2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.findTextInFiles2.d.ts"},fsChunks:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.fsChunks.d.ts"},idToken:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.idToken.d.ts"},inlineCompletionsAdditions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineCompletionsAdditions.d.ts"},inlineEdit:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.inlineEdit.d.ts"},interactive:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactive.d.ts"},interactiveWindow:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.interactiveWindow.d.ts"},ipc:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.ipc.d.ts"},languageModelCapabilities:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelCapabilities.d.ts"},languageModelDataPart:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelDataPart.d.ts",version:3},languageModelSystem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts"},languageStatusText:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts"},mappedEditsProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.mappedEditsProvider.d.ts"},multiDocumentHighlightProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts"},nativeWindowHandle:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.nativeWindowHandle.d.ts"},newSymbolNamesProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.newSymbolNamesProvider.d.ts"},notebookCellExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookCellExecution.d.ts"},notebookControllerAffinityHidden:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookControllerAffinityHidden.d.ts"},notebookDeprecated:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookDeprecated.d.ts"},notebookExecution:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookExecution.d.ts"},notebookKernelSource:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookKernelSource.d.ts"},notebookLiveShare:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookLiveShare.d.ts"},notebookMessaging:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMessaging.d.ts"},notebookMime:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookMime.d.ts"},notebookReplDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookReplDocument.d.ts"},notebookVariableProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts"},portsAttributes:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.portsAttributes.d.ts"},profileContentHandlers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.profileContentHandlers.d.ts"},quickDiffProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickDiffProvider.d.ts"},quickInputButtonLocation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickInputButtonLocation.d.ts"},quickPickItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickItemTooltip.d.ts"},quickPickSortByLabel:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.quickPickSortByLabel.d.ts"},resolvers:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.resolvers.d.ts"},scmActionButton:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmActionButton.d.ts"},scmHistoryProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts"},scmMultiDiffEditor:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmMultiDiffEditor.d.ts"},scmSelectedProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmSelectedProvider.d.ts"},scmTextDocument:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmTextDocument.d.ts"},scmValidation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.scmValidation.d.ts"},shareProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.shareProvider.d.ts"},speech:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.speech.d.ts"},statusBarItemTooltip:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.statusBarItemTooltip.d.ts"},tabInputMultiDiff:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputMultiDiff.d.ts"},tabInputTextMerge:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tabInputTextMerge.d.ts"},taskPresentationGroup:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskPresentationGroup.d.ts"},taskProblemMatcherStatus:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.taskProblemMatcherStatus.d.ts"},telemetry:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.telemetry.d.ts"},terminalCompletionProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts"},terminalDataWriteEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDataWriteEvent.d.ts"},terminalDimensions:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalDimensions.d.ts"},terminalExecuteCommandEvent:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalExecuteCommandEvent.d.ts"},terminalQuickFixProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts"},terminalSelection:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalSelection.d.ts"},terminalShellEnv:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.terminalShellEnv.d.ts"},testObserver:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testObserver.d.ts"},testRelatedCode:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.testRelatedCode.d.ts"},textEditorDiffInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts"},textSearchComplete2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchComplete2.d.ts"},textSearchProvider:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider.d.ts"},textSearchProvider2:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.textSearchProvider2.d.ts"},timeline:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.timeline.d.ts"},tokenInformation:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tokenInformation.d.ts"},toolProgress:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.toolProgress.d.ts"},treeViewActiveItem:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewActiveItem.d.ts"},treeViewMarkdownMessage:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewMarkdownMessage.d.ts"},treeViewReveal:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.treeViewReveal.d.ts"},tunnelFactory:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnelFactory.d.ts"},tunnels:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.tunnels.d.ts"},valueSelectionInQuickPick:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.valueSelectionInQuickPick.d.ts"},workspaceTrust:{proposal:"https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.workspaceTrust.d.ts"}},im=Object.freeze(tm),qh=/^(\^|>=)?((\d+)|x)\.((\d+)|x)\.((\d+)|x)(\-.*)?$/,sm=/^-(\d{4})(\d{2})(\d{2})$/;function rm(t){return t=t.trim(),t==="*"||qh.test(t)}function Sa(t){if(!rm(t))return null;if(t=t.trim(),t==="*")return{hasCaret:!1,hasGreaterEquals:!1,majorBase:0,majorMustEqual:!1,minorBase:0,minorMustEqual:!1,patchBase:0,patchMustEqual:!1,preRelease:null};const e=t.match(qh);return e?{hasCaret:e[1]==="^",hasGreaterEquals:e[1]===">=",majorBase:e[2]==="x"?0:parseInt(e[2],10),majorMustEqual:e[2]!=="x",minorBase:e[4]==="x"?0:parseInt(e[4],10),minorMustEqual:e[4]!=="x",patchBase:e[6]==="x"?0:parseInt(e[6],10),patchMustEqual:e[6]!=="x",preRelease:e[8]||null}:null}function $a(t){if(!t)return null;const e=t.majorBase,i=t.majorMustEqual,s=t.minorBase;let r=t.minorMustEqual;const n=t.patchBase;let o=t.patchMustEqual;t.hasCaret&&(e===0||(r=!1),o=!1);let a=0;if(t.preRelease){const l=sm.exec(t.preRelease);if(l){const[,c,u,f]=l;a=Date.UTC(Number(c),Number(u)-1,Number(f))}}return{majorBase:e,majorMustEqual:i,minorBase:s,minorMustEqual:r,patchBase:n,patchMustEqual:o,isMinimum:t.hasGreaterEquals,notBefore:a}}function nm(t,e,i){let s;typeof t=="string"?s=$a(Sa(t)):s=t;let r;e instanceof Date?r=e.getTime():typeof e=="string"&&(r=new Date(e).getTime());let n;if(typeof i=="string"?n=$a(Sa(i)):n=i,!s||!n)return!1;const o=s.majorBase,a=s.minorBase,l=s.patchBase;let c=n.majorBase,u=n.minorBase,f=n.patchBase;const d=n.notBefore;let p=n.majorMustEqual,m=n.minorMustEqual,w=n.patchMustEqual;return n.isMinimum?o>c?!0:o<c?!1:a>u?!0:a<u||r&&r<d?!1:l>=f:(o===1&&c===0&&(!p||!m||!w)&&(c=1,u=0,f=0,p=!0,m=!1,w=!1),o<c?!1:o>c?!p:a<u?!1:a>u?!m:l<f?!1:l>f?!w:!(r&&r<d))}function om(t,e,i,s,r,n){const o=[];if(typeof s.publisher<"u"&&typeof s.publisher!="string")return o.push([Ve.Error,g(1986,null)]),o;if(typeof s.name!="string")return o.push([Ve.Error,g(1987,null,"name")]),o;if(typeof s.version!="string")return o.push([Ve.Error,g(1988,null,"version")]),o;if(!s.engines)return o.push([Ve.Error,g(1989,null,"engines")]),o;if(typeof s.engines.vscode!="string")return o.push([Ve.Error,g(1990,null,"engines.vscode")]),o;if(typeof s.extensionDependencies<"u"&&!Hh(s.extensionDependencies))return o.push([Ve.Error,g(1991,null,"extensionDependencies")]),o;if(typeof s.activationEvents<"u"){if(!Hh(s.activationEvents))return o.push([Ve.Error,g(1992,null,"activationEvents")]),o;if(typeof s.main>"u"&&typeof s.browser>"u")return o.push([Ve.Error,g(1993,null,"activationEvents","main","browser")]),o}if(typeof s.extensionKind<"u"&&typeof s.main>"u"&&o.push([Ve.Warning,g(1994,null,"extensionKind")]),typeof s.main<"u"){if(typeof s.main!="string")return o.push([Ve.Error,g(1995,null,"main")]),o;{const c=W(i,s.main);eu(c,i)||o.push([Ve.Warning,g(1996,null,c.path,i.path)])}}if(typeof s.browser<"u"){if(typeof s.browser!="string")return o.push([Ve.Error,g(1997,null,"browser")]),o;{const c=W(i,s.browser);eu(c,i)||o.push([Ve.Warning,g(1998,null,c.path,i.path)])}}if(!d4(s.version))return o.push([Ve.Error,g(1999,null)]),o;const a=[];if(!am(t,e,s,r,a))for(const c of a)o.push([Ve.Error,c]);if(n&&s.enabledApiProposals?.length){const c=[];if(!ka([...s.enabledApiProposals],c))for(const u of c)o.push([Ve.Error,u])}return o}function am(t,e,i,s,r){return s||typeof i.main>"u"&&typeof i.browser>"u"?!0:Wh(t,e,i.engines.vscode,r)}function Pa(t,e,i){return t==="*"||Wh(e,i,t)}function ka(t,e){if(t.length===0)return!0;const i=Array.isArray(e)?e:void 0,s=(i?void 0:e)??im,r=[],n=A4(t);for(const{proposalName:o,version:a}of n){if(!a)continue;s[o]?.version!==a&&r.push(o)}return r.length?(i&&(r.length===1?i.push(g(2e3,null,r[0])):i.push(g(2001,null,r.slice(0,r.length-1).map(o=>`'${o}'`).join(", "),r[r.length-1]))),!1):!0}function Wh(t,e,i,s=[]){const r=$a(Sa(i));if(!r)return s.push(g(2002,null,i)),!1;if(r.majorBase===0){if(!r.majorMustEqual||!r.minorMustEqual)return s.push(g(2003,null,i)),!1}else if(!r.majorMustEqual)return s.push(g(2004,null,i)),!1;return nm(t,e,r)?!0:(s.push(g(2005,null,t,i)),!1)}function Hh(t){if(!Array.isArray(t))return!1;for(let e=0,i=t.length;e<i;e++)if(typeof t[e]!="string")return!1;return!0}var gt=ue("productService");async function lm(t,e,i){let s=i&&i.get("storage.serviceMachineId",-1)||null;if(s)return s;try{const n=(await e.readFile(t.serviceMachineIdResource)).value.toString();s=O4(n)?n:null}catch{s=null}if(!s){s=dt();try{await e.writeFile(t.serviceMachineIdResource,V.fromString(s))}catch{}}return i?.store("storage.serviceMachineId",s,-1,1),s}async function cm(t,e,i,s,r,n,o){const a={"X-Market-Client-Id":`VSCode ${t}`,"User-Agent":`VSCode ${t} (${e.nameShort})`};if(Mh(e,i)&&jh(s)===3){const l=await lm(i,r,n);a["X-Market-User-Id"]=l,a["VSCode-SessionId"]=o.machineId||l}return a}function Ia(t){const e=[];typeof t=="number"&&e.push("code/timeOrigin",t);function i(r,n){e.push(r,n?.startTime??Date.now())}function s(){const r=[];for(let n=0;n<e.length;n+=2)r.push({name:e[n],startTime:e[n+1]});return r}return{mark:i,getMarks:s}}function um(){if(typeof performance=="object"&&typeof performance.mark=="function"&&!performance.nodeTiming)return typeof performance.timeOrigin!="number"&&!performance.timing?Ia():{mark(t,e){performance.mark(t,e)},getMarks(){let t=performance.timeOrigin;typeof t!="number"&&(t=performance.timing.navigationStart||performance.timing.redirectStart||performance.timing.fetchStart);const e=[{name:"code/timeOrigin",startTime:Math.round(t)}];for(const i of performance.getEntriesByType("mark"))e.push({name:i.name,startTime:Math.round(t+i.startTime)});return e}};if(typeof process=="object"){const t=performance?.timeOrigin;return Ia(t)}else return console.trace("perf-util loaded in UNKNOWN environment"),Ia()}function hm(t){return t.MonacoPerformanceMarks||(t.MonacoPerformanceMarks=um()),t.MonacoPerformanceMarks}var Gh=hm(globalThis),Da=Gh.mark,k6=Gh.getMarks;function fm(t){return JSON.stringify(t,pm)}function dm(t){let e=JSON.parse(t);return e=$s(e),e}function pm(t,e){return e instanceof RegExp?{$mid:2,source:e.source,flags:e.flags}:e}function $s(t,e=0){if(!t||e>200)return t;if(typeof t=="object"){switch(t.$mid){case 1:return k.revive(t);case 2:return new RegExp(t.source,t.flags);case 17:return new Date(t.source)}if(t instanceof V||t instanceof Uint8Array)return t;if(Array.isArray(t))for(let i=0;i<t.length;++i)t[i]=$s(t[i],e+1);else for(const i in t)Object.hasOwnProperty.call(t,i)&&(t[i]=$s(t[i],e+1))}return t}var cr;(function(t){t[t.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",t[t.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"})(cr||(cr={}));var Mt;(function(t){t[t.None=0]="None",t[t.Initialized=1]="Initialized",t[t.Closed=2]="Closed"})(Mt||(Mt={}));var I6=class nd extends J{static{this.a=100}constructor(e,i=Object.create(null)){super(),this.r=e,this.s=i,this.b=this.B(new bo),this.onDidChangeStorage=this.b.event,this.c=Mt.None,this.f=new Map,this.g=this.B(new Ci(nd.a)),this.h=new Set,this.j=new Map,this.m=void 0,this.n=[],this.t()}t(){this.B(this.r.onDidChangeItemsExternal(e=>this.u(e)))}u(e){this.b.pause();try{e.changed?.forEach((i,s)=>this.w(s,i)),e.deleted?.forEach(i=>this.w(i,void 0))}finally{this.b.resume()}}w(e,i){if(this.c===Mt.Closed)return;let s=!1;Qe(i)?s=this.f.delete(e):this.f.get(e)!==i&&(this.f.set(e,i),s=!0),s&&this.b.fire({key:e,external:!0})}get items(){return this.f}get size(){return this.f.size}async init(){this.c===Mt.None&&(this.c=Mt.Initialized,this.s.hint!==cr.STORAGE_DOES_NOT_EXIST&&(this.f=await this.r.getItems()))}get(e,i){const s=this.f.get(e);return Qe(s)?i:s}getBoolean(e,i){const s=this.get(e);return Qe(s)?i:s==="true"}getNumber(e,i){const s=this.get(e);return Qe(s)?i:parseInt(s,10)}getObject(e,i){const s=this.get(e);return Qe(s)?i:dm(s)}async set(e,i,s=!1){if(this.c===Mt.Closed)return;if(Qe(i))return this.delete(e,s);const r=Oe(i)||Array.isArray(i)?fm(i):String(i);if(this.f.get(e)!==r)return this.f.set(e,r),this.j.set(e,r),this.h.delete(e),this.b.fire({key:e,external:s}),this.D()}async delete(e,i=!1){if(!(this.c===Mt.Closed||!this.f.delete(e)))return this.h.has(e)||this.h.add(e),this.j.delete(e),this.b.fire({key:e,external:i}),this.D()}async optimize(){if(this.c!==Mt.Closed)return await this.flush(0),this.r.optimize()}async close(){return this.m||(this.m=this.y()),this.m}async y(){this.c=Mt.Closed;try{await this.D(0)}catch{}await this.r.close(()=>this.f)}get z(){return this.j.size>0||this.h.size>0}async C(){if(!this.z)return;const e={insert:this.j,delete:this.h};return this.h=new Set,this.j=new Map,this.r.updateItems(e).finally(()=>{if(!this.z)for(;this.n.length;)this.n.pop()?.()})}async flush(e){if(!(this.c===Mt.Closed||this.m))return this.D(e)}async D(e){return this.s.hint===cr.STORAGE_IN_MEMORY?this.C():this.g.trigger(()=>this.C(),e)}async whenFlushed(){if(this.z)return new Promise(e=>this.n.push(e))}isInMemory(){return this.s.hint===cr.STORAGE_IN_MEMORY}},D6=ue("contextService");function gm(t){const e=t;return typeof e?.id=="string"&&k.isUri(e.uri)}function mm(t){const e=t;return typeof e?.id=="string"&&k.isUri(e.configPath)}var Jh;(function(t){t[t.EMPTY=1]="EMPTY",t[t.FOLDER=2]="FOLDER",t[t.WORKSPACE=3]="WORKSPACE"})(Jh||(Jh={}));var Qh="code-workspace",A6=`.${Qh}`,R6=[{name:g(2661,null),extensions:[Qh]}],ze=ue("IUriIdentityService"),Zh;(function(t){t.Settings="settings",t.Keybindings="keybindings",t.Snippets="snippets",t.Prompts="prompts",t.Tasks="tasks",t.Extensions="extensions",t.GlobalState="globalState"})(Zh||(Zh={}));function wm(t){const e=t;return!!(e&&typeof e=="object"&&typeof e.id=="string"&&typeof e.isDefault=="boolean"&&typeof e.name=="string"&&k.isUri(e.location)&&k.isUri(e.globalStorageHome)&&k.isUri(e.settingsResource)&&k.isUri(e.keybindingsResource)&&k.isUri(e.tasksResource)&&k.isUri(e.snippetsHome)&&k.isUri(e.promptsHome)&&k.isUri(e.extensionsResource))}var jt=ue("IUserDataProfilesService");function Rn(t,e,i,s,r,n){return{id:t,name:e,location:i,isDefault:!1,icon:r?.icon,globalStorageHome:n&&r?.useDefaultFlags?.globalState?n.globalStorageHome:W(i,"globalStorage"),settingsResource:n&&r?.useDefaultFlags?.settings?n.settingsResource:W(i,"settings.json"),keybindingsResource:n&&r?.useDefaultFlags?.keybindings?n.keybindingsResource:W(i,"keybindings.json"),tasksResource:n&&r?.useDefaultFlags?.tasks?n.tasksResource:W(i,"tasks.json"),snippetsHome:n&&r?.useDefaultFlags?.snippets?n.snippetsHome:W(i,"snippets"),promptsHome:n&&r?.useDefaultFlags?.prompts?n.promptsHome:W(i,"prompts"),extensionsResource:n&&r?.useDefaultFlags?.extensions?n.extensionsResource:W(i,"extensions.json"),cacheHome:W(s,t),useDefaultFlags:r?.useDefaultFlags,isTransient:r?.transient,workspaces:r?.workspaces}}var Aa=class extends J{static{this.b="userDataProfiles"}static{this.c="profileAssociations"}get defaultProfile(){return this.profiles[0]}get profiles(){return[...this.C.profiles,...this.r.profiles]}constructor(e,i,s,r){super(),this.s=e,this.t=i,this.u=s,this.y=r,this.g=this.B(new N),this.onDidChangeProfiles=this.g.event,this.h=this.B(new N),this.onWillCreateProfile=this.h.event,this.j=this.B(new N),this.onWillRemoveProfile=this.j.event,this.m=this.B(new N),this.onDidResetWorkspaces=this.m.event,this.n=new Map,this.r={profiles:[],emptyWindows:new Map},this.profilesHome=W(this.s.userRoamingDataHome,"profiles"),this.f=W(this.s.cacheHome,"CachedProfilesData")}init(){this.z=void 0}get C(){if(!this.z){const e=this.D(),i=[e];try{for(const r of this.N()){if(!r.name||!xe(r.name)||!r.location){this.y.warn("Skipping the invalid stored profile",r.location||r.name);continue}i.push(Rn(us(r.location),r.name,r.location,this.f,{icon:r.icon,useDefaultFlags:r.useDefaultFlags},e))}}catch(r){this.y.error(r)}const s=new Map;if(i.length)try{const r=this.P();if(r.workspaces)for(const[n,o]of Object.entries(r.workspaces)){const a=k.parse(n),l=i.find(c=>c.id===o);if(l){const c=l.workspaces?l.workspaces.slice(0):[];c.push(a),l.workspaces=c}}if(r.emptyWindows)for(const[n,o]of Object.entries(r.emptyWindows)){const a=i.find(l=>l.id===o);a&&s.set(n,a)}}catch(r){this.y.error(r)}this.z={profiles:i,emptyWindows:s}}return this.z}D(){const e=Rn("__default__profile__",g(2614,null),this.s.userRoamingDataHome,this.f);return{...e,extensionsResource:this.R()??e.extensionsResource,isDefault:!0}}async createTransientProfile(e){const i="Temp",s=new RegExp(`${ls(i)}\\s(\\d+)`);let r=0;for(const o of this.profiles){const a=s.exec(o.name),l=a?parseInt(a[1]):0;r=l>r?l:r}const n=`${i} ${r+1}`;return this.createProfile(ps(dt()).toString(16),n,{transient:!0},e)}async createNamedProfile(e,i,s){return this.createProfile(ps(dt()).toString(16),e,i,s)}async createProfile(e,i,s,r){return await this.F(e,i,s,r)}async F(e,i,s,r){if(!xe(i)||!i)throw new Error("Name of the profile is mandatory and must be of type `string`");let n=this.n.get(i);return n||(n=(async()=>{try{if(this.profiles.find(u=>u.id===e||!u.isTransient&&!s?.transient&&u.name===i))throw new Error(`Profile with ${i} name already exists`);const a=r?this.G(r):void 0;k.isUri(a)&&(s={...s,workspaces:[a]});const l=Rn(e,i,W(this.profilesHome,e),this.f,s,this.defaultProfile);await this.t.createFolder(l.location);const c=[];return this.h.fire({profile:l,join(u){c.push(u)}}),await ut.settled(c),a&&!k.isUri(a)&&this.L(a,l,!!l.isTransient),this.I([l],[],[]),l}finally{this.n.delete(i)}})(),this.n.set(i,n)),n}async updateProfile(e,i){const s=[];for(const n of this.profiles){let o;if(e.id===n.id)n.isDefault?i.workspaces&&(o=n,o.workspaces=i.workspaces):o=Rn(n.id,i.name??n.name,n.location,this.f,{icon:i.icon===null?void 0:i.icon??n.icon,transient:i.transient??n.isTransient,useDefaultFlags:i.useDefaultFlags??n.useDefaultFlags,workspaces:i.workspaces??n.workspaces},this.defaultProfile);else if(i.workspaces){const a=n.workspaces?.filter(l=>!i.workspaces?.some(c=>this.u.extUri.isEqual(l,c)));n.workspaces?.length!==a?.length&&(o=n,o.workspaces=a)}o&&s.push(o)}if(!s.length)throw e.isDefault?new Error("Cannot update default profile"):new Error(`Profile '${e.name}' does not exist`);this.I([],[],s);const r=this.profiles.find(n=>n.id===e.id);if(!r)throw new Error(`Profile '${e.name}' was not updated`);return r}async removeProfile(e){if(e.isDefault)throw new Error("Cannot remove default profile");const i=this.profiles.find(r=>r.id===e.id);if(!i)throw new Error(`Profile '${e.name}' does not exist`);const s=[];this.j.fire({profile:i,join(r){s.push(r)}});try{await Promise.allSettled(s)}catch(r){this.y.error(r)}this.I([],[i],[]);try{await this.t.del(i.cacheHome,{recursive:!0})}catch(r){Me(r)!==1&&this.y.error(r)}}async setProfileForWorkspace(e,i){const s=this.profiles.find(n=>n.id===i.id);if(!s)throw new Error(`Profile '${i.name}' does not exist`);const r=this.G(e);if(k.isUri(r)){const n=s.workspaces?[...s.workspaces]:[];n.some(o=>this.u.extUri.isEqual(o,r))||(n.push(r),await this.updateProfile(s,{workspaces:n}))}else this.L(r,s,!1),this.M(this.profiles)}unsetWorkspace(e,i=!1){const s=this.G(e);if(k.isUri(s)){const r=this.getProfileForWorkspace(e);r&&this.updateProfile(r,{workspaces:r.workspaces?.filter(n=>!this.u.extUri.isEqual(n,s))})}else this.L(s,void 0,i),this.M(this.profiles)}async resetWorkspaces(){this.r.emptyWindows.clear(),this.C.emptyWindows.clear();for(const e of this.profiles)e.workspaces=void 0;this.I([],[],this.profiles),this.m.fire()}async cleanUp(){if(await this.t.exists(this.profilesHome)){const e=await this.t.resolve(this.profilesHome);await Promise.all((e.children||[]).filter(i=>i.isDirectory&&this.profiles.every(s=>!this.u.extUri.isEqual(s.location,i.resource))).map(i=>this.t.del(i.resource,{recursive:!0})))}}async cleanUpTransientProfiles(){const e=this.r.profiles.filter(i=>!this.H(i));await Promise.allSettled(e.map(i=>this.removeProfile(i)))}getProfileForWorkspace(e){const i=this.G(e);return k.isUri(i)?this.profiles.find(s=>s.workspaces?.some(r=>this.u.extUri.isEqual(r,i))):this.C.emptyWindows.get(i)??this.r.emptyWindows.get(i)}G(e){return gm(e)?e.uri:mm(e)?e.configPath:e.id}H(e){return!!(e.workspaces?.length||[...this.C.emptyWindows.values()].some(i=>this.u.extUri.isEqual(i.location,e.location))||[...this.r.emptyWindows.values()].some(i=>this.u.extUri.isEqual(i.location,e.location)))}I(e,i,s){const r=[...this.profiles,...e],n=this.r.profiles;this.r.profiles=[];const o=[];for(let a of r){if(i.some(l=>a.id===l.id)){for(const l of[...this.C.emptyWindows.keys()])a.id===this.C.emptyWindows.get(l)?.id&&this.C.emptyWindows.delete(l);continue}if(!a.isDefault){a=s.find(c=>a.id===c.id)??a;const l=n.find(c=>a.id===c.id);if(a.isTransient)this.r.profiles.push(a);else if(l){for(const[c,u]of this.r.emptyWindows.entries())if(a.id===u.id){this.r.emptyWindows.delete(c),this.C.emptyWindows.set(c,a);break}}}a.workspaces?.length===0&&(a.workspaces=void 0),o.push(a)}this.M(o),this.J(e,i,s)}J(e,i,s){this.g.fire({added:e,removed:i,updated:s,all:this.profiles})}L(e,i,s){s=i?.isTransient?!0:s,s?i?this.r.emptyWindows.set(e,i):this.r.emptyWindows.delete(e):(this.r.emptyWindows.delete(e),i?this.C.emptyWindows.set(e,i):this.C.emptyWindows.delete(e))}M(e){const i=[],s={},r={};for(const n of e)if(!n.isTransient&&(n.isDefault||i.push({location:n.location,name:n.name,icon:n.icon,useDefaultFlags:n.useDefaultFlags}),n.workspaces))for(const o of n.workspaces)s[o.toString()]=n.id;for(const[n,o]of this.C.emptyWindows.entries())r[n.toString()]=o.id;this.Q({workspaces:s,emptyWindows:r}),this.O(i),this.z=void 0}N(){return[]}O(e){throw new Error("not implemented")}P(){return{}}Q(e){throw new Error("not implemented")}R(){}};Aa=__decorate([__param(0,fi),__param(1,Ie),__param(2,ze),__param(3,he)],Aa);var vm="__$__isNewStorageMarker",Ln="__$__targetStorageMarker",ym=ue("storageService"),Ps;(function(t){t[t.NONE=0]="NONE",t[t.SHUTDOWN=1]="SHUTDOWN"})(Ps||(Ps={}));var Xh;(function(t){t[t.APPLICATION=-1]="APPLICATION",t[t.PROFILE=0]="PROFILE",t[t.WORKSPACE=1]="WORKSPACE"})(Xh||(Xh={}));var Kh;(function(t){t[t.USER=0]="USER",t[t.MACHINE=1]="MACHINE"})(Kh||(Kh={}));function bm(t){const e=t.get(Ln);if(e)try{return JSON.parse(e)}catch{}return Object.create(null)}var O6=class od extends J{static{this.a=60*1e3}constructor(e={flushInterval:od.a}){super(),this.b=this.B(new bo),this.f=this.B(new bo),this.onDidChangeTarget=this.f.event,this.g=this.B(new N),this.onWillSaveState=this.g.event,this.m=this.B(new _s),this.C=void 0,this.F=void 0,this.H=void 0,this.j=this.B(new Yr(()=>this.n(),e.flushInterval))}onDidChangeValue(e,i,s){return oe.filter(this.b.event,r=>r.scope===e&&(i===void 0||r.key===i),s)}n(){this.m.value=uu(()=>{this.r()&&this.flush(),this.j.schedule()})}r(){return!0}t(){St([this.m,this.j])}initialize(){return this.h||(this.h=(async()=>{Da("code/willInitStorage");try{await this.O()}finally{Da("code/didInitStorage")}this.j.schedule()})()),this.h}u(e,i){const{key:s,external:r}=i;if(s===Ln){switch(e){case-1:this.H=void 0;break;case 0:this.F=void 0;break;case 1:this.C=void 0;break}this.f.fire({scope:e})}else this.b.fire({scope:e,key:s,target:this.J(e)[s],external:r})}w(e){this.g.fire({reason:e})}get(e,i,s){return this.P(i)?.get(e,s)}getBoolean(e,i,s){return this.P(i)?.getBoolean(e,s)}getNumber(e,i,s){return this.P(i)?.getNumber(e,s)}getObject(e,i,s){return this.P(i)?.getObject(e,s)}storeAll(e,i){this.y(()=>{for(const s of e)this.store(s.key,s.value,s.scope,s.target,i)})}store(e,i,s,r,n=!1){if(Qe(i)){this.remove(e,s,n);return}this.y(()=>{this.z(e,s,r),this.P(s)?.set(e,i,n)})}remove(e,i,s=!1){this.y(()=>{this.z(e,i,void 0),this.P(i)?.delete(e,s)})}y(e){this.b.pause(),this.f.pause();try{e()}finally{this.b.resume(),this.f.resume()}}keys(e,i){const s=[],r=this.J(e);for(const n of Object.keys(r))r[n]===i&&s.push(n);return s}z(e,i,s,r=!1){const n=this.J(i);typeof s=="number"?n[e]!==s&&(n[e]=s,this.P(i)?.set(Ln,JSON.stringify(n),r)):typeof n[e]=="number"&&(delete n[e],this.P(i)?.set(Ln,JSON.stringify(n),r))}get D(){return this.C||(this.C=this.L(1)),this.C}get G(){return this.F||(this.F=this.L(0)),this.F}get I(){return this.H||(this.H=this.L(-1)),this.H}J(e){switch(e){case-1:return this.I;case 0:return this.G;default:return this.D}}L(e){const i=this.P(e);return i?bm(i):Object.create(null)}isNew(e){return this.getBoolean(vm,e)===!0}async flush(e=Ps.NONE){this.g.fire({reason:e});const i=this.P(-1),s=this.P(0),r=this.P(1);switch(e){case Ps.NONE:await ut.settled([i?.whenFlushed()??Promise.resolve(),s?.whenFlushed()??Promise.resolve(),r?.whenFlushed()??Promise.resolve()]);break;case Ps.SHUTDOWN:await ut.settled([i?.flush(0)??Promise.resolve(),s?.flush(0)??Promise.resolve(),r?.flush(0)??Promise.resolve()]);break}}async log(){const e=this.P(-1)?.items??new Map,i=this.P(0)?.items??new Map,s=this.P(1)?.items??new Map;return Em(e,i,s,this.Q(-1)??"",this.Q(0)??"",this.Q(1)??"")}async optimize(e){return await this.flush(),this.P(e)?.optimize()}async switch(e,i){return this.w(Ps.NONE),wm(e)?this.R(e,i):this.S(e,i)}M(e,i){return!(e.id===i.id||Yh(i)&&Yh(e))}N(e,i,s){this.y(()=>{const r=new Set;for(const[n,o]of e)r.add(n),i.get(n)!==o&&this.u(s,{key:n,external:!0});for(const[n]of i.items)r.has(n)||this.u(s,{key:n,external:!0})})}};function Yh(t){return t.isDefault||!!t.useDefaultFlags?.globalState}async function Em(t,e,i,s,r,n){const o=w=>{try{return JSON.parse(w)}catch{return w}},a=new Map,l=new Map;t.forEach((w,y)=>{a.set(y,w),l.set(y,o(w))});const c=new Map,u=new Map;e.forEach((w,y)=>{c.set(y,w),u.set(y,o(w))});const f=new Map,d=new Map;i.forEach((w,y)=>{f.set(y,w),d.set(y,o(w))}),console.group(s!==r?`Storage: Application (path: ${s})`:`Storage: Application & Profile (path: ${s}, default profile)`);const p=[];if(a.forEach((w,y)=>{p.push({key:y,value:w})}),console.table(p),console.groupEnd(),console.log(l),s!==r){console.group(`Storage: Profile (path: ${r}, profile specific)`);const w=[];c.forEach((y,b)=>{w.push({key:b,value:y})}),console.table(w),console.groupEnd(),console.log(u)}console.group(`Storage: Workspace (path: ${n})`);const m=[];f.forEach((w,y)=>{m.push({key:y,value:w})}),console.table(m),console.groupEnd(),console.log(d)}var ef;(function(t){t.ExtensionQueryService="ExtensionQueryService",t.ExtensionLatestVersionUri="ExtensionLatestVersionUriTemplate",t.ExtensionStatisticsUri="ExtensionStatisticsUriTemplate",t.WebExtensionStatisticsUri="WebExtensionStatisticsUriTemplate",t.PublisherViewUri="PublisherViewUriTemplate",t.ExtensionDetailsViewUri="ExtensionDetailsViewUriTemplate",t.ExtensionRatingViewUri="ExtensionRatingViewUriTemplate",t.ExtensionResourceUri="ExtensionResourceUriTemplate",t.ContactSupportUri="ContactSupportUri"})(ef||(ef={}));var tf;(function(t){t.None="None",t.IncludeVersions="IncludeVersions",t.IncludeFiles="IncludeFiles",t.IncludeCategoryAndTags="IncludeCategoryAndTags",t.IncludeSharedAccounts="IncludeSharedAccounts",t.IncludeVersionProperties="IncludeVersionProperties",t.ExcludeNonValidated="ExcludeNonValidated",t.IncludeInstallationTargets="IncludeInstallationTargets",t.IncludeAssetUri="IncludeAssetUri",t.IncludeStatistics="IncludeStatistics",t.IncludeLatestVersionOnly="IncludeLatestVersionOnly",t.Unpublished="Unpublished",t.IncludeNameConflictInfo="IncludeNameConflictInfo",t.IncludeLatestPrereleaseAndStableVersionOnly="IncludeLatestPrereleaseAndStableVersionOnly"})(tf||(tf={}));var ur=ue("IExtensionGalleryManifestService");function Bi(t,e){const[i,s]=e.split("/");for(const r of t.resources){const[n,o]=r.type.split("/");if(n===i){if(!s||o===s)return r.id;break}}}var hr=$t?"web":Eh(Hr,Nc),fr="X-Market-Search-Activity-Id",Ra="Activityid",La="Server",Oa="X-Vss-E2eid",On=1e4,Be={Icon:"Microsoft.VisualStudio.Services.Icons.Default",Details:"Microsoft.VisualStudio.Services.Content.Details",Changelog:"Microsoft.VisualStudio.Services.Content.Changelog",Manifest:"Microsoft.VisualStudio.Code.Manifest",VSIX:"Microsoft.VisualStudio.Services.VSIXPackage",License:"Microsoft.VisualStudio.Services.Content.License",Repository:"Microsoft.VisualStudio.Services.Links.Source",Signature:"Microsoft.VisualStudio.Services.VsixSignature"},Gt={Dependency:"Microsoft.VisualStudio.Code.ExtensionDependencies",ExtensionPack:"Microsoft.VisualStudio.Code.ExtensionPack",Engine:"Microsoft.VisualStudio.Code.Engine",PreRelease:"Microsoft.VisualStudio.Code.PreRelease",EnabledApiProposals:"Microsoft.VisualStudio.Code.EnabledApiProposals",LocalizedLanguages:"Microsoft.VisualStudio.Code.LocalizedLanguages",WebExtension:"Microsoft.VisualStudio.Code.WebExtension",SponsorLink:"Microsoft.VisualStudio.Code.SponsorLink",SupportLink:"Microsoft.VisualStudio.Services.Links.Support",ExecutesCode:"Microsoft.VisualStudio.Code.ExecutesCode",Private:"PrivateMarketplace"},xm=10,Sm={pageNumber:1,pageSize:xm,sortBy:"NoneOrRelevance",sortOrder:0,flags:[],criteria:[],assetTypes:[]},sf;(function(t){t[t.Release=0]="Release",t[t.Prerelease=1]="Prerelease",t[t.Latest=2]="Latest"})(sf||(sf={}));var Nn=class $i{constructor(e=Sm){this.d=e}get pageNumber(){return this.d.pageNumber}get pageSize(){return this.d.pageSize}get sortBy(){return this.d.sortBy}get sortOrder(){return this.d.sortOrder}get flags(){return this.d.flags}get criteria(){return this.d.criteria}get assetTypes(){return this.d.assetTypes}get source(){return this.d.source}get searchText(){const e=this.d.criteria.filter(i=>i.filterType==="SearchText")[0];return e&&e.value?e.value:""}withPage(e,i=this.d.pageSize){return new $i({...this.d,pageNumber:e,pageSize:i})}withFilter(e,...i){const s=[...this.d.criteria,...i.length?i.map(r=>({filterType:e,value:r})):[{filterType:e}]];return new $i({...this.d,criteria:s})}withSortBy(e){return new $i({...this.d,sortBy:e})}withSortOrder(e){return new $i({...this.d,sortOrder:e})}withFlags(...e){return new $i({...this.d,flags:Yt(e)})}withAssetTypes(...e){return new $i({...this.d,assetTypes:e})}withSource(e){return new $i({...this.d,source:e})}};function Na(t,e){const i=(t||[]).filter(s=>s.statisticName===e)[0];return i?i.value:0}function $m(t){const e="Microsoft.VisualStudio.Code.Translation.";return t.files.filter(s=>s.assetType.indexOf(e)===0).reduce((s,r)=>{const n=Jt(t,r.assetType);return n&&s.push([r.assetType.substring(e.length),n]),s},[])}function Pm(t){if(t.properties){const e=t.properties.filter(r=>r.key===Be.Repository),i=new RegExp("((git|ssh|http(s)?)|(git@[\\w.]+))(:(//)?)([\\w.@:/\\-~]+)(.git)(/)?"),s=e.filter(r=>i.test(r.value))[0];return s?{uri:s.value,fallbackUri:s.value}:null}return Jt(t,Be.Repository)}function km(t){return{uri:`${t.fallbackAssetUri}/${Be.VSIX}?redirect=true${t.targetPlatform?`&targetPlatform=${t.targetPlatform}`:""}`,fallbackUri:`${t.fallbackAssetUri}/${Be.VSIX}${t.targetPlatform?`?targetPlatform=${t.targetPlatform}`:""}`}}function Jt(t,e){return t.files.filter(s=>s.assetType===e)[0]?{uri:`${t.assetUri}/${e}${t.targetPlatform?`?targetPlatform=${t.targetPlatform}`:""}`,fallbackUri:`${t.fallbackAssetUri}/${e}${t.targetPlatform?`?targetPlatform=${t.targetPlatform}`:""}`}:null}function rf(t,e){const i=t.properties?t.properties.filter(r=>r.key===e):[],s=i.length>0&&i[0].value;return s?s.split(",").map(r=>An(r)):[]}function Ca(t){const e=t.properties?t.properties.filter(i=>i.key===Gt.Engine):[];return e.length>0&&e[0].value||""}function dr(t){const e=t.properties?t.properties.filter(i=>i.key===Gt.PreRelease):[];return e.length>0&&e[0].value==="true"}function nf(t,e){return e.extensionProperties?.[t.toLowerCase()]?.hasPrereleaseVersion}function Im(t,e){return e.extensionProperties?.[t.toLowerCase()]?.excludeVersionRange}function Dm(t){const e=t.properties?t.properties.filter(i=>i.key===Gt.Private):[];return e.length>0&&e[0].value==="true"}function Am(t){const e=t.properties?t.properties.filter(i=>i.key===Gt.ExecutesCode):[];return e.length>0?e[0].value==="true":void 0}function Fa(t){const e=t.properties?t.properties.filter(s=>s.key===Gt.EnabledApiProposals):[],i=e.length>0&&e[0].value||"";return i?i.split(","):[]}function Rm(t){const e=t.properties?t.properties.filter(s=>s.key===Gt.LocalizedLanguages):[],i=e.length>0&&e[0].value||"";return i?i.split(","):[]}function Lm(t){return t.properties?.find(e=>e.key===Gt.SponsorLink)?.value}function Om(t){return t.properties?.find(e=>e.key===Gt.SupportLink)?.value}function Nm(t){return t.indexOf("preview")!==-1}function pr(t){return t.targetPlatform?E4(t.targetPlatform):"undefined"}function gr(t){const e=Yt(t.versions.map(pr)),i=!!t.tags?.includes(v4),s=e.indexOf("web");return i?s===-1&&e.push("web"):s!==-1&&e.splice(s,1),e}function of(t,e){for(let i=0;i<t.length;i++){const s=t[i];if(s.version===t[i-1]?.version){let r=i;if(pr(s)===e)for(;r>0&&t[r-1].version===s.version;)r--;r!==i&&(t.splice(i,1),t.splice(r,0,s))}}return t}function af(t,e,i){t.telemetryData={index:e,querySource:i,queryActivityId:t.queryContext?.[fr]}}function Cn(t,e,i,s,r,n){const o=t.versions[0],a={manifest:Jt(e,Be.Manifest),readme:Jt(e,Be.Details),changelog:Jt(e,Be.Changelog),license:Jt(e,Be.License),repository:Pm(e),download:km(e),icon:Jt(e,Be.Icon),signature:Jt(e,Be.Signature),coreTranslations:$m(e)},l=Bi(s,t.linkType??"ExtensionDetailsViewUriTemplate"),c=Bi(s,t.publisher.linkType??"PublisherViewUriTemplate"),u=Bi(s,t.ratingLinkType??"ExtensionRatingViewUriTemplate"),f=Ut(t.publisher.publisherName,t.extensionName);return{type:"gallery",identifier:{id:f,uuid:t.extensionId},name:t.extensionName,version:e.version,displayName:t.displayName,publisherId:t.publisher.publisherId,publisher:t.publisher.publisherName,publisherDisplayName:t.publisher.displayName,publisherDomain:t.publisher.domain?{link:t.publisher.domain,verified:!!t.publisher.isDomainVerified}:void 0,publisherSponsorLink:Lm(o),description:t.shortDescription??"",installCount:Na(t.statistics,"install"),rating:Na(t.statistics,"averagerating"),ratingCount:Na(t.statistics,"ratingcount"),categories:t.categories||[],tags:t.tags||[],releaseDate:Date.parse(t.releaseDate),lastUpdated:Date.parse(t.lastUpdated),allTargetPlatforms:i,assets:a,properties:{dependencies:rf(e,Gt.Dependency),extensionPack:rf(e,Gt.ExtensionPack),engine:Ca(e),enabledApiProposals:Fa(e),localizedLanguages:Rm(e),targetPlatform:pr(e),isPreReleaseVersion:dr(e),executesCode:Am(e)},hasPreReleaseVersion:nf(f,r)??dr(o),hasReleaseVersion:!0,private:Dm(o),preview:Nm(t.flags),isSigned:!!a.signature,queryContext:n,supportLink:Om(o),detailsLink:l?as(l,{publisher:t.publisher.publisherName,name:t.extensionName}):void 0,publisherLink:c?as(c,{publisher:t.publisher.publisherName}):void 0,ratingLink:u?as(u,{publisher:t.publisher.publisherName,name:t.extensionName}):void 0}}var Fn=class{constructor(e,i,s,r,n,o,a,l,c,u,f){this.k=i,this.l=s,this.n=r,this.o=n,this.q=o,this.u=a,this.w=l,this.x=c,this.y=u,this.z=f,this.d=l.extensionsGallery?.controlUrl,this.g=l.extensionsGallery?.extensionUrlTemplate,this.j=l.extensionsEnabledWithApiProposalVersion?.map(d=>d.toLowerCase())??[],this.h=cm(l.version,l,this.o,this.x,this.u,e,this.q)}isEnabled(){return this.z.isEnabled()}async getExtensions(e,i,s){const r=await this.z.getExtensionGalleryManifest();if(!r)throw new Error("No extension gallery service configured.");const n=pe.isCancellationToken(i)?{}:i,o=pe.isCancellationToken(i)?i:s,a=await this.A(r,!!n.updateCheck),l=a?await this.C(e,n,a,r,o):await this.B(e,n,r,o),c=l.map(f=>f.identifier.uuid),u=[];for(const f of e)f.uuid&&!c.includes(f.uuid)&&u.push({...f,uuid:void 0});if(u.length){this.q.publicLog2("galleryService:additionalQueryByName",{count:u.length});const f=await this.B(u,n,r,o);l.push(...f)}return l}async A(e,i){const s=Bi(e,"ExtensionLatestVersionUriTemplate");if(!s)return;if(this.w.quality!=="stable")return{uri:s,fallback:this.g};const r=i?await this.k?.getTreatment("extensions.gallery.useResourceApi")??"marketplace":await this.k?.getTreatment("extensions.gallery.useLatestApi")??"unpkg";if(r==="marketplace")return{uri:s,fallback:this.g};if(r==="unpkg"&&this.g)return{uri:this.g}}async B(e,i,s,r){const n=[],o=[],a=[],l=[];let c=!0;for(const d of e)d.uuid?o.push(d.uuid):n.push(d.id),d.version?l.push({id:d.id,uuid:d.uuid,version:d.version}):a.push({id:d.id,uuid:d.uuid,includePreRelease:!!d.preRelease}),c=c&&!!d.hasPreRelease&&!d.preRelease;if(!o.length&&!n.length)return[];let u=new Nn().withPage(1,e.length);o.length&&(u=u.withFilter("ExtensionId",...o)),n.length&&(u=u.withFilter("ExtensionName",...n)),i.queryAllVersions&&(u=u.withFlags(...u.flags,"IncludeVersions")),i.source&&(u=u.withSource(i.source));const{extensions:f}=await this.H(u,{targetPlatform:i.targetPlatform??hr,includePreRelease:a,versions:l,compatible:!!i.compatible,productVersion:i.productVersion??{version:this.w.version,date:this.w.date},isQueryForReleaseVersionFromPreReleaseVersion:c},s,r);return i.source&&f.forEach((d,p)=>af(d,p,i.source)),f}async C(e,i,s,r,n){const o=[],a=[],l=[];for(const c of e)wa.test(c.id)&&(c.version?a.push(c):l.push(c));if(await Promise.allSettled(l.map(async c=>{let u;try{try{u=await this.D(c,i,s.uri,r,n)}catch(f){if(!s.fallback)throw f;this.n.error(`Error while getting the latest version for the extension ${c.id} from ${s.uri}. Trying the fallback ${s.fallback}`,G(f)),this.q.publicLog2("galleryService:fallbacktounpkg",{extension:c.id,preRelease:!!c.preRelease,compatible:!!i.compatible}),u=await this.D(c,i,s.fallback,r,n)}if(u==="NOT_FOUND"){c.uuid&&a.push(c);return}u&&o.push(u)}catch(f){this.n.error(`Error while getting the latest version for the extension ${c.id}.`,G(f)),this.q.publicLog2("galleryService:fallbacktoquery",{extension:c.id,preRelease:!!c.preRelease,compatible:!!i.compatible,fromFallback:!!s.fallback}),a.push(c)}})),a.length){const c=await this.B(a,i,r,n);o.push(...c)}return o}async D(e,i,s,r,n){const[o,a]=e.id.split("."),l=k.parse(as(s,{publisher:o,name:a})),c=await this.N(e.id,l,n);if(!c)return"NOT_FOUND";const u=gr(c),f=await this.K(c,{targetPlatform:i.targetPlatform??hr,compatible:!!i.compatible,productVersion:i.productVersion??{version:this.w.version,date:this.w.date},version:e.preRelease?2:0},u);return f?Cn(c,f,u,r,this.w):null}async getCompatibleExtension(e,i,s,r={version:this.w.version,date:this.w.date}){return xs(e.allTargetPlatforms,s)?null:await this.isExtensionCompatible(e,i,s)?e:this.y.isAllowed({id:e.identifier.id,publisherDisplayName:e.publisherDisplayName})!==!0?null:(await this.getExtensions([{...e.identifier,preRelease:i,hasPreRelease:e.hasPreReleaseVersion}],{compatible:!0,productVersion:r,queryAllVersions:!0,targetPlatform:s},pe.None))[0]??null}async isExtensionCompatible(e,i,s,r={version:this.w.version,date:this.w.date}){return this.E({id:e.identifier.id,version:e.version,isPreReleaseVersion:e.properties.isPreReleaseVersion,targetPlatform:e.properties.targetPlatform,manifestAsset:e.assets.manifest,engine:e.properties.engine,enabledApiProposals:e.properties.enabledApiProposals},{targetPlatform:s,compatible:!0,productVersion:r,version:i?2:0},e.publisherDisplayName,e.allTargetPlatforms)}async E(e,{targetPlatform:i,compatible:s,productVersion:r,version:n},o,a){const l=nf(e.id,this.w),c=Im(e.id,this.w);if(e.isPreReleaseVersion&&l===!1||c&&g4(e.version,c))return!1;if(xe(n)){if(e.version!==n)return!1}else if((n===0||n===1)&&e.isPreReleaseVersion!==(n===1))return!1;return!(!xh(e.targetPlatform,a,i)||s&&(this.y.isAllowed({id:e.id,publisherDisplayName:o,version:e.version,prerelease:e.isPreReleaseVersion,targetPlatform:e.targetPlatform})!==!0||!this.F(e.id,e.enabledApiProposals)||!await this.G(e.id,e.version,e.engine,e.manifestAsset,r)))}F(e,i){return!i||!this.j.includes(e.toLowerCase())?!0:ka(i)}async G(e,i,s,r,n){if(!s){if(!r)return this.n.error(`Missing engine and manifest asset for the extension ${e} with version ${i}`),!1;try{this.q.publicLog2("galleryService:engineFallback",{extension:e,extensionVersion:i});const o={"Accept-Encoding":"gzip"},a=await this.P(e,r,Be.Manifest,i,{headers:o}),l=await Sn(a);if(!l)return this.n.error(`Manifest was not found for the extension ${e} with version ${i}`),!1;s=l.engines.vscode}catch(o){return this.n.error(`Error while getting the engine for the version ${i}.`,G(o)),!1}}return Pa(s,n.version,n.date)}async query(e,i){const s=await this.z.getExtensionGalleryManifest();if(!s)throw new Error("No extension gallery service configured.");let r=e.text||"";const n=e.pageSize??50;let o=new Nn().withPage(1,n);r?(r=r.replace(/\bcategory:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(f,d,p)=>(o=o.withFilter("Category",p||d),"")),r=r.replace(/\btag:("([^"]*)"|([^"]\S*))(\s+|\b|$)/g,(f,d,p)=>(o=o.withFilter("Tag",p||d),"")),r=r.replace(/\bfeatured(\s+|\b|$)/g,()=>(o=o.withFilter("Featured"),"")),r=r.trim(),r&&(r=r.length<200?r:r.substring(0,200),o=o.withFilter("SearchText",r)),s.capabilities.extensionQuery.sorting?.some(f=>f.name==="NoneOrRelevance")&&(o=o.withSortBy("NoneOrRelevance"))):s.capabilities.extensionQuery.sorting?.some(f=>f.name==="InstallCount")&&(o=o.withSortBy("InstallCount")),e.sortBy&&s.capabilities.extensionQuery.sorting?.some(f=>f.name===e.sortBy)&&(o=o.withSortBy(e.sortBy)),typeof e.sortOrder=="number"&&(o=o.withSortOrder(e.sortOrder)),e.source&&(o=o.withSource(e.source));const a=async(f,d)=>{const{extensions:p,total:m}=await this.H(f,{targetPlatform:hr,compatible:!1,includePreRelease:!!e.includePreRelease,productVersion:e.productVersion??{version:this.w.version,date:this.w.date}},s,d);return p.forEach((w,y)=>af(w,(f.pageNumber-1)*f.pageSize+y,e.source)),{extensions:p,total:m}},{extensions:l,total:c}=await a(o,i),u=async(f,d)=>{if(d.isCancellationRequested)throw new Te;const{extensions:p}=await a(o.withPage(f+1),d);return p};return{firstPage:l,total:c,pageSize:o.pageSize,getPage:u}}async H(e,i,s,r){return this.w.quality!=="stable"&&await this.k?.getTreatment("useLatestPrereleaseAndStableVersionFlag")?this.J(e,i,s,r):this.I(e,i,s,r)}async I(e,i,s,r){const n=e.flags;e.flags.includes("IncludeLatestVersionOnly")&&e.flags.includes("IncludeVersions")&&(e=e.withFlags(...e.flags.filter(d=>d!=="IncludeVersions"))),!e.flags.includes("IncludeLatestVersionOnly")&&!e.flags.includes("IncludeVersions")&&(e=e.withFlags(...e.flags,"IncludeLatestVersionOnly")),(i.versions?.length||i.isQueryForReleaseVersionFromPreReleaseVersion)&&(e=e.withFlags(...e.flags.filter(d=>d!=="IncludeLatestVersionOnly"),"IncludeVersions")),e=e.withFlags(...e.flags,"IncludeAssetUri","IncludeCategoryAndTags","IncludeFiles","IncludeStatistics","IncludeVersionProperties");const{galleryExtensions:o,total:a,context:l}=await this.L(e,s,r);if(!e.flags.includes("IncludeLatestVersionOnly")){const d=[];for(const p of o){const m=gr(p),w={id:Ut(p.publisher.publisherName,p.extensionName),uuid:p.extensionId},y=Et(i.includePreRelease)?i.includePreRelease:!!i.includePreRelease.find(S=>Q(S,w))?.includePreRelease,b=await this.K(p,{compatible:i.compatible,targetPlatform:i.targetPlatform,productVersion:i.productVersion,version:i.versions?.find(S=>Q(S,w))?.version??(y?2:0)},m);b&&d.push(Cn(p,b,m,s,this.w,l))}return{extensions:d,total:a}}const u=[],f=new Map;for(let d=0;d<o.length;d++){const p=o[d],m={id:Ut(p.publisher.publisherName,p.extensionName),uuid:p.extensionId},w=Et(i.includePreRelease)?i.includePreRelease:!!i.includePreRelease.find(I=>Q(I,m))?.includePreRelease,y=gr(p);if(i.compatible&&(xs(y,i.targetPlatform)||this.y.isAllowed({id:m.id,publisherDisplayName:p.publisher.displayName})!==!0))continue;const b=await this.K(p,{compatible:i.compatible,targetPlatform:i.targetPlatform,productVersion:i.productVersion,version:i.versions?.find(I=>Q(I,m))?.version??(w?2:0)},y),S=b?Cn(p,b,y,s,this.w,l):null;!S||S.properties.isPreReleaseVersion&&(!w||!S.hasReleaseVersion)||!S.properties.isPreReleaseVersion&&S.properties.targetPlatform!==i.targetPlatform&&S.hasPreReleaseVersion?f.set(p.extensionId,d):u.push([d,S])}if(f.size){const d=new jr,p=new Nn().withFlags(...n.filter(w=>w!=="IncludeLatestVersionOnly"),"IncludeVersions").withPage(1,f.size).withFilter("ExtensionId",...f.keys()),{extensions:m}=await this.H(p,i,s,r);this.q.publicLog2("galleryService:additionalQuery",{duration:d.elapsed(),count:f.size});for(const w of m){const y=f.get(w.identifier.uuid);u.push([y,w])}}return{extensions:u.sort((d,p)=>d[0]-p[0]).map(([,d])=>d),total:a}}async J(e,i,s,r){i.versions?.length?e=e.withFlags(...e.flags.filter(c=>c!=="IncludeLatestVersionOnly"&&c!=="IncludeLatestPrereleaseAndStableVersionOnly"),"IncludeVersions"):e.flags.includes("IncludeVersions")||(e=(Et(i.includePreRelease)?i.includePreRelease:i.includePreRelease.every(({includePreRelease:u})=>u))?e.withFlags(...e.flags.filter(u=>u!=="IncludeLatestPrereleaseAndStableVersionOnly"),"IncludeLatestVersionOnly"):e.withFlags(...e.flags.filter(u=>u!=="IncludeLatestVersionOnly"),"IncludeLatestPrereleaseAndStableVersionOnly")),e.flags.includes("IncludeVersions")&&(e.flags.includes("IncludeLatestVersionOnly")||e.flags.includes("IncludeLatestPrereleaseAndStableVersionOnly"))&&(e=e.withFlags(...e.flags.filter(c=>c!=="IncludeLatestVersionOnly"&&c!=="IncludeLatestPrereleaseAndStableVersionOnly"),"IncludeVersions")),e=e.withFlags(...e.flags,"IncludeAssetUri","IncludeCategoryAndTags","IncludeFiles","IncludeStatistics","IncludeVersionProperties");const{galleryExtensions:n,total:o,context:a}=await this.L(e,s,r),l=[];for(let c=0;c<n.length;c++){const u=n[c],f={id:Ut(u.publisher.publisherName,u.extensionName),uuid:u.extensionId},d=gr(u);if(i.compatible&&(xs(d,i.targetPlatform)||this.y.isAllowed({id:f.id,publisherDisplayName:u.publisher.displayName})!==!0))continue;const p=i.versions?.find(w=>Q(w,f))?.version??((Et(i.includePreRelease)?i.includePreRelease:i.includePreRelease.find(w=>Q(w,f))?.includePreRelease)?2:0),m=await this.K(u,{compatible:i.compatible,targetPlatform:i.targetPlatform,productVersion:i.productVersion,version:p},d);m&&l.push(Cn(u,m,d,s,this.w,a))}return{extensions:l,total:o}}async K(e,i,s){const r={id:Ut(e.publisher.publisherName,e.extensionName),uuid:e.extensionId},n=of(e.versions,i.targetPlatform);if(i.compatible&&xs(s,i.targetPlatform))return null;const o=xe(i.version)?i.version:void 0;for(let a=0;a<n.length;a++){const l=n[a];if(await this.E({id:r.id,version:l.version,isPreReleaseVersion:dr(l),targetPlatform:pr(l),engine:Ca(l),manifestAsset:Jt(l,Be.Manifest),enabledApiProposals:Fa(l)},i,e.publisher.displayName,s))return l;if(o&&l.version===o)return null}return o||i.compatible?null:e.versions[0]}async L(e,i,s){const r=Bi(i,"ExtensionQueryService");if(!r)throw new Error("No extension gallery query service configured.");e=e.withFlags(...e.flags,"ExcludeNonValidated").withFilter("Target","Microsoft.VisualStudio.Code");const n=i.capabilities.extensionQuery.flags?.find(p=>p.name==="Unpublished");n&&(e=e.withFilter("ExcludeWithFlags",String(n.value)));const o=JSON.stringify({filters:[{criteria:e.criteria.reduce((p,m)=>{const w=i.capabilities.extensionQuery.filtering?.find(y=>y.name===m.filterType);return w&&p.push({filterType:w.value,value:m.value}),p},[]),pageNumber:e.pageNumber,pageSize:e.pageSize,sortBy:i.capabilities.extensionQuery.sorting?.find(p=>p.name===e.sortBy)?.value,sortOrder:e.sortOrder}],assetTypes:e.assetTypes,flags:e.flags.reduce((p,m)=>{const w=i.capabilities.extensionQuery.flags?.find(y=>y.name===m);return w&&(p|=w.value),p},0)}),l={...await this.h,"Content-Type":"application/json",Accept:"application/json;api-version=3.0-preview.1","Accept-Encoding":"gzip","Content-Length":String(o.length)},c=new jr;let u,f,d=0;try{if(u=await this.l.request({type:"POST",url:r,data:o,headers:l},s),u.res.statusCode&&u.res.statusCode>=400&&u.res.statusCode<500)return{galleryExtensions:[],total:d};const p=await Sn(u);if(p){const m=p.results[0],w=m.extensions,y=m.resultMetadata&&m.resultMetadata.filter(b=>b.metadataType==="ResultCount")[0];return d=y&&y.metadataItems.filter(b=>b.name==="TotalCount")[0].count||0,{galleryExtensions:w,total:d,context:u.res.headers.activityid?{[fr]:u.res.headers.activityid}:{}}}return{galleryExtensions:[],total:d}}catch(p){if(Di(p))throw f="Cancelled",p;{const m=G(p);throw f=wh(p)?"Offline":m.startsWith("XHR timeout")?"Timeout":"Failed",new Pn(m,f)}}finally{this.q.publicLog2("galleryService:query",{filterTypes:e.criteria.map(p=>p.filterType),flags:e.flags,sortBy:e.sortBy,sortOrder:String(e.sortOrder),pageNumber:String(e.pageNumber),source:e.source,searchTextLength:e.searchText.length,requestBodySize:String(o.length),duration:c.elapsed(),success:!!u&&ha(u),responseBodySize:u?.res.headers["Content-Length"],statusCode:u?String(u.res.statusCode):void 0,errorCode:f,count:String(d),server:this.M(u?.res.headers,La),activityId:this.M(u?.res.headers,Ra),endToEndId:this.M(u?.res.headers,Oa)})}}M(e,i){const s=e?.[i.toLowerCase()],r=Array.isArray(s)?s[0]:s;return r?new Dn(r):void 0}async N(e,i,s){let r;const n=new jr;let o;try{const l={...await this.h,"Content-Type":"application/json",Accept:"application/json;api-version=7.2-preview","Accept-Encoding":"gzip"};if(o=await this.l.request({type:"GET",url:i.toString(!0),headers:l,timeout:On},s),o.res.statusCode===404)return r="NotFound",null;if(o.res.statusCode&&o.res.statusCode!==200)throw r="GalleryServiceError:"+o.res.statusCode,new Error("Unexpected HTTP response: "+o.res.statusCode);const c=await Sn(o);return c||(r="NoData"),c}catch(a){throw Di(a)?r="Cancelled":wh(a)?r="Offline":G(a).startsWith("XHR timeout")?r="Timeout":r||(r="Failed"),a}finally{this.q.publicLog2("galleryService:getLatest",{extension:e,host:i.authority,duration:n.elapsed(),errorCode:r,server:this.M(o?.res.headers,La),activityId:this.M(o?.res.headers,Ra),endToEndId:this.M(o?.res.headers,Oa)})}}async reportStatistic(e,i,s,r){const n=await this.z.getExtensionGalleryManifest();if(!n)return;let o;if($t){const u=Bi(n,"WebExtensionStatisticsUriTemplate");if(!u)return;o=as(u,{publisher:e,name:i,version:s,statTypeValue:r==="install"?"1":"3"})}else{const u=Bi(n,"ExtensionStatisticsUriTemplate");if(!u)return;o=as(u,{publisher:e,name:i,version:s,statTypeName:r})}const a=$t?"api-version=6.1-preview.1":"*/*;api-version=4.0-preview.1",c={...await this.h,Accept:a};try{await this.l.request({type:"POST",url:o,headers:c},pe.None)}catch{}}async download(e,i,s){this.n.trace("ExtensionGalleryService#download",e.identifier.id);const r=xa(e),n=new Date().getTime(),o=s===2?"install":s===3?"update":"",a=o?{uri:`${e.assets.download.uri}${k.parse(e.assets.download.uri).query?"&":"?"}${o}=true`,fallbackUri:`${e.assets.download.fallbackUri}${k.parse(e.assets.download.fallbackUri).query?"&":"?"}${o}=true`}:e.assets.download,l=e.queryContext?.[fr]?{[fr]:e.queryContext[fr]}:void 0,c=await this.P(e.identifier.id,a,Be.VSIX,e.version,l?{headers:l}:void 0);try{await this.u.writeFile(i,c.stream)}catch(u){try{await this.u.del(i)}catch(f){this.n.warn(`Error while deleting the file ${i.toString()}`,G(f))}throw new Pn(G(u),"DownloadFailedWriting")}this.q.publicLog("galleryService:downloadVSIX",{...r,duration:new Date().getTime()-n})}async downloadSignatureArchive(e,i){if(!e.assets.signature)throw new Error("No signature asset found");this.n.trace("ExtensionGalleryService#downloadSignatureArchive",e.identifier.id);const s=await this.P(e.identifier.id,e.assets.signature,Be.Signature,e.version);try{await this.u.writeFile(i,s.stream)}catch(r){try{await this.u.del(i)}catch(n){this.n.warn(`Error while deleting the file ${i.toString()}`,G(n))}throw new Pn(G(r),"DownloadFailedWriting")}}async getReadme(e,i){if(e.assets.readme){const s=await this.P(e.identifier.id,e.assets.readme,Be.Details,e.version,{},i);return await bs(s)||""}return""}async getManifest(e,i){if(e.assets.manifest){const s=await this.P(e.identifier.id,e.assets.manifest,Be.Manifest,e.version,{},i),r=await bs(s);return r?JSON.parse(r):null}return null}async getCoreTranslation(e,i){const s=e.assets.coreTranslations.filter(r=>r[0]===i.toUpperCase())[0];if(s){const r=await this.P(e.identifier.id,s[1],s[0],e.version),n=await bs(r);return n?JSON.parse(n):null}return null}async getChangelog(e,i){if(e.assets.changelog){const s=await this.P(e.identifier.id,e.assets.changelog,Be.Changelog,e.version,{},i);return await bs(s)||""}return""}async getAllVersions(e){return this.O(e)}async getAllCompatibleVersions(e,i,s){return this.O(e,{version:i?2:0,targetPlatform:s})}async O(e,i){const s=await this.z.getExtensionGalleryManifest();if(!s)throw new Error("No extension gallery service configured.");let r=new Nn().withFlags("IncludeVersions","IncludeCategoryAndTags","IncludeFiles","IncludeVersionProperties").withPage(1,1);e.uuid?r=r.withFilter("ExtensionId",e.uuid):r=r.withFilter("ExtensionName",e.id);const{galleryExtensions:n}=await this.L(r,s,pe.None);if(!n.length)return[];const o=gr(n[0]);if(i&&xs(o,i.targetPlatform))return[];const a=[],l={version:this.w.version,date:this.w.date};await Promise.all(n[0].versions.map(async f=>{try{await this.E({id:e.id,version:f.version,isPreReleaseVersion:dr(f),targetPlatform:pr(f),engine:Ca(f),manifestAsset:Jt(f,Be.Manifest),enabledApiProposals:Fa(f)},{compatible:!!i,productVersion:l,targetPlatform:i?.targetPlatform??hr,version:i?.version??f.version},n[0].publisher.displayName,o)&&a.push(f)}catch{}}));const c=[],u=new Set;for(const f of of(a,i?.targetPlatform??hr))u.has(f.version)||(u.add(f.version),c.push({version:f.version,date:f.lastUpdated,isPreReleaseVersion:dr(f)}));return c}async P(e,i,s,r,n={},o=pe.None){const a=await this.h,l={type:"GET"},c={...a,...n.headers||{}};n={...n,...l,headers:c};const u=i.uri,f=i.fallbackUri,d={...n,url:u,timeout:On};let p;try{if(p=await this.l.request(d,o),p.res.statusCode===200)return p;const m=await bs(p);throw new Error(`Expected 200, got back ${p.res.statusCode} instead.

${m}`)}catch(m){if(Di(m))throw m;const w=G(m);this.q.publicLog2("galleryService:cdnFallback",{extension:e,assetType:s,message:w,extensionVersion:r,server:this.M(p?.res.headers,La),activityId:this.M(p?.res.headers,Ra),endToEndId:this.M(p?.res.headers,Oa)});const y={...n,url:f,timeout:On};return this.l.request(y,o)}}async getExtensionsControlManifest(){if(!this.isEnabled())throw new Error("No extension gallery service configured.");if(!this.d)return{malicious:[],deprecated:{},search:[]};const e=await this.l.request({type:"GET",url:this.d,timeout:On},pe.None);if(e.res.statusCode!==200)throw new Error("Could not get extensions report.");const i=await Sn(e),s=[],r={},n=[];if(i){for(const o of i.malicious){if(!xe(o))continue;const a=wa.test(o)?{id:o}:o;s.push({extensionOrPublisher:a,learnMoreLink:i.learnMoreLinks?.[o]})}if(i.migrateToPreRelease)for(const[o,a]of Object.entries(i.migrateToPreRelease))(!a.engine||Pa(a.engine,this.w.version,this.w.date))&&(r[o.toLowerCase()]={disallowInstall:!0,extension:{id:a.id,displayName:a.displayName,autoMigrate:{storage:!!a.migrateStorage},preRelease:!0}});if(i.deprecated)for(const[o,a]of Object.entries(i.deprecated))a&&(r[o.toLowerCase()]=Et(a)?{}:a);if(i.search)for(const o of i.search)n.push(o)}return{malicious:s,deprecated:r,search:n}}};Fn=__decorate([__param(2,ar),__param(3,he),__param(4,fi),__param(5,Ht),__param(6,Ie),__param(7,gt),__param(8,oi),__param(9,zi),__param(10,ur)],Fn);var lf=class extends Fn{constructor(e,i,s,r,n,o,a,l,c,u){super(e,void 0,i,s,r,n,o,a,l,c,u)}};lf=__decorate([__param(0,ym),__param(1,ar),__param(2,he),__param(3,fi),__param(4,Ht),__param(5,Ie),__param(6,gt),__param(7,oi),__param(8,zi),__param(9,ur)],lf);var Ta=class extends Fn{constructor(e,i,s,r,n,o,a,l,c){super(void 0,void 0,e,i,s,r,n,o,a,l,c)}};Ta=__decorate([__param(0,ar),__param(1,he),__param(2,fi),__param(3,Ht),__param(4,Ie),__param(5,gt),__param(6,oi),__param(7,zi),__param(8,ur)],Ta);var cf=ue("IExtensionSignatureVerificationService"),Ua=class{constructor(e,i){this.b=e,this.c=i}d(){return this.a||(this.a=this.f()),this.a}async f(){return import("@vscode/vsce-sign")}async verify(e,i,s,r,n){let o;try{o=await this.d()}catch(u){this.b.error("Could not load vsce-sign module",G(u)),this.b.info(`Extension signature verification is not done: ${e}`);return}const a=new Date().getTime();let l;try{this.b.trace(`Verifying extension signature for ${e}...`),l=await o.verify(s,r,this.b.getLevel()===F.Trace)}catch(u){l={code:Fe.UnknownError,didExecute:!1,output:G(u)}}const c=new Date().getTime()-a;return this.b.info(`Extension signature verification result for ${e}: ${l.code}. ${cc(l.internalCode)?`Internal Code: ${l.internalCode}. `:""}Executed: ${l.didExecute}. Duration: ${c}ms.`),this.b.trace(`Extension signature verification output for ${e}:
${l.output}`),this.c.publicLog2("extensionsignature:verification",{extensionId:e,extensionVersion:i,code:l.code,internalCode:l.internalCode,duration:c,didExecute:l.didExecute,clientTargetPlatform:n}),{code:l.code}}};Ua=__decorate([__param(0,he),__param(1,Ht)],Ua);var Cm=t=>g(1935,null,t),uf=g(1936,null,"ms-dotnettools.csharp"),qi=class{constructor(e,i,s){this.a=e,this.b=i,this.d=s}get f(){}async listExtensions(e,i,s){let r=await this.b.getInstalled(1,s);const n=k4.map(a=>a.toLowerCase());if(i&&i!==""){if(n.indexOf(i.toLowerCase())<0){this.a.info("Invalid category please enter a valid category. To list valid categories run --category without a category specified");return}r=r.filter(a=>a.manifest.categories?a.manifest.categories.map(c=>c.toLowerCase()).indexOf(i.toLowerCase())>-1:!1)}else if(i===""){this.a.info("Possible Categories: "),n.forEach(a=>{this.a.info(a)});return}this.f&&this.a.info(g(1937,null,this.f)),r=r.sort((a,l)=>a.identifier.id.localeCompare(l.identifier.id));let o;for(const a of r)o!==a.identifier.id&&(o=a.identifier.id,this.a.info(e?`${o}@${a.manifest.version}`:o))}async installExtensions(e,i,s,r){const n=[];try{e.length&&this.a.info(this.f?g(1938,null,this.f):g(1939,null));const o=[],a=[],l=(u,f,d)=>{a.push({id:u,version:f!=="prerelease"?f:void 0,installOptions:{...s,isBuiltin:d,installPreReleaseVersion:f==="prerelease"||s.installPreReleaseVersion}})};for(const u of e)if(u instanceof k)o.push({vsix:u,installOptions:s});else{const[f,d]=Ea(u);l(f,d,!1)}for(const u of i)if(u instanceof k)o.push({vsix:u,installOptions:{...s,isBuiltin:!0,donotIncludePackAndDependencies:!0}});else{const[f,d]=Ea(u);l(f,d,!0)}const c=await this.b.getInstalled(void 0,s.profileLocation);if(o.length&&await Promise.all(o.map(async({vsix:u,installOptions:f})=>{try{await this.h(u,f,r,c)}catch(d){this.a.error(d),n.push(u.toString())}})),a.length){const u=await this.g(a,c,r);n.push(...u)}}catch(o){throw this.a.error(g(1940,null,G(o))),o}if(n.length)throw new Error(g(1941,null,n.join(", ")))}async updateExtensions(e){const i=await this.b.getInstalled(1,e),s=[];for(const a of i)a.identifier.uuid&&s.push({...a.identifier,preRelease:a.preRelease});this.a.trace(g(1942,null,s.length));const r=await this.d.getExtensions(s,{compatible:!0},pe.None),n=[];for(const a of r)for(const l of i)Q(l.identifier,a.identifier)&&ga(a.version,l.manifest.version)&&n.push({extension:a,options:{operation:3,installPreReleaseVersion:l.preRelease,profileLocation:e,isApplicationScoped:l.isApplicationScoped}});if(!n.length){this.a.info(g(1943,null));return}this.a.info(g(1944,null,n.map(a=>a.extension.identifier.id).join(", ")));const o=await this.b.installGalleryExtensions(n);for(const a of o)a.error?this.a.error(g(1945,null,a.identifier.id,G(a.error))):this.a.info(g(1946,null,a.identifier.id,a.local?.manifest.version))}async g(e,i,s){if(e=e.filter(a=>{const{id:l,version:c,installOptions:u}=a,f=i.find(d=>Q(d.identifier,{id:l}));if(f){if(!s&&(!c||c==="prerelease"&&f.preRelease))return this.a.info(g(1947,null,l,f.manifest.version,l)),!1;if(c&&f.manifest.version===c)return this.a.info(g(1948,null,`${l}@${c}`)),!1;f.preRelease&&c!=="prerelease"&&(u.preRelease=!1)}return!0}),!e.length)return[];const r=[],n=[],o=await this.j(e);if(await Promise.all(e.map(async({id:a,version:l,installOptions:c})=>{const u=o.get(a.toLowerCase());if(!u){this.a.error(`${Cm(l?`${a}@${l}`:a)}
${uf}`),r.push(a);return}try{const d=await this.d.getManifest(u,pe.None);if(d&&!this.k(d))return}catch(d){this.a.error(d.message||d.stack||d),r.push(a);return}const f=i.find(d=>Q(d.identifier,u.identifier));if(f){if(u.version===f.manifest.version){this.a.info(g(1949,null,l?`${a}@${l}`:a));return}this.a.info(g(1950,null,a,u.version))}c.isBuiltin?this.a.info(l?g(1951,null,a,l):g(1952,null,a)):this.a.info(l?g(1953,null,a,l):g(1954,null,a)),n.push({extension:u,options:{...c,installGivenVersion:!!l,isApplicationScoped:c.isApplicationScoped||f?.isApplicationScoped}})})),n.length){const a=await this.b.installGalleryExtensions(n);for(const l of a)l.error?(this.a.error(g(1955,null,l.identifier.id,G(l.error))),r.push(l.identifier.id)):this.a.info(g(1956,null,l.identifier.id,l.local?.manifest.version))}return r}async h(e,i,s,r){const n=await this.b.getManifest(e);if(!n)throw new Error("Invalid vsix");if(await this.l(n,s,i.profileLocation,r))try{await this.b.install(e,{...i,installGivenVersion:!0}),this.a.info(g(1957,null,us(e)))}catch(a){if(Di(a))this.a.info(g(1958,null,us(e)));else throw a}}async j(e){const i=new Map,s=e.some(o=>o.installOptions.installPreReleaseVersion),r=await this.b.getTargetPlatform(),n=[];for(const o of e)wa.test(o.id)&&n.push({...o,preRelease:s});if(n.length){const o=await this.d.getExtensions(n,{targetPlatform:r},pe.None);for(const a of o)i.set(a.identifier.id.toLowerCase(),a)}return i}k(e){return!0}async l(e,i,s,r){if(!i){const n={id:Ut(e.publisher,e.name)},o=r.find(a=>Q(n,a.identifier)&&ga(a.manifest.version,e.version));if(o)return this.a.info(g(1959,null,o.identifier.id,o.manifest.version,e.version)),!1}return this.k(e)}async uninstallExtensions(e,i,s){const r=async o=>{if(o instanceof k){const a=await this.b.getManifest(o);return Vh(a.publisher,a.name)}return o},n=[];for(const o of e){const a=await r(o),c=(await this.b.getInstalled(void 0,s)).filter(u=>Q(u.identifier,{id:a}));if(!c.length)throw new Error(`${this.m(a)}
${uf}`);if(c.some(u=>u.type===0)){this.a.info(g(1960,null,a));return}if(!i&&c.some(u=>u.isBuiltin)){this.a.info(g(1961,null,a));return}this.a.info(g(1962,null,a));for(const u of c)await this.b.uninstall(u,{profileLocation:s}),n.push(u);this.f?this.a.info(g(1963,null,a,this.f)):this.a.info(g(1964,null,a))}}async locateExtension(e){const i=await this.b.getInstalled();e.forEach(s=>{i.forEach(r=>{if(r.identifier.id===s&&r.location.scheme===ie.file){this.a.info(r.location.fsPath);return}})})}m(e){return this.f?g(1965,null,e,this.f):g(1966,null,e)}};qi=__decorate([__param(1,va),__param(2,bi)],qi);var hf;(function(t){t.ERROR_PROFILE_NOT_FOUND="ERROR_PROFILE_NOT_FOUND",t.ERROR_INVALID_CONTENT="ERROR_INVALID_CONTENT"})(hf||(hf={}));var Tn=class extends Error{constructor(t,e){super(t),this.code=e}},Ei=ue("IExtensionsProfileScannerService"),Ma=class extends J{constructor(e,i,s,r,n){super(),this.j=e,this.m=i,this.n=s,this.r=r,this.s=n,this.b=this.B(new N),this.onAddExtensions=this.b.event,this.c=this.B(new N),this.onDidAddExtensions=this.c.event,this.f=this.B(new N),this.onRemoveExtensions=this.f.event,this.g=this.B(new N),this.onDidRemoveExtensions=this.g.event,this.h=new Je}scanProfileExtensions(e,i){return this.t(e,void 0,i)}async addExtensionsToProfile(e,i,s){const r=[],n=[];try{return await this.t(i,o=>{const a=[];if(s)a.push(...o);else for(const l of o)e.some(([c])=>Q(c.identifier,l.identifier)&&c.manifest.version!==l.version)?r.push(l):a.push(l);for(const[l,c]of e){const u=a.findIndex(d=>Q(d.identifier,l.identifier)&&d.version===l.manifest.version),f={identifier:l.identifier,version:l.manifest.version,location:l.location,metadata:c};u===-1?(n.push(f),a.push(f)):a.splice(u,1,f)}return n.length&&this.b.fire({extensions:n,profileLocation:i}),r.length&&this.f.fire({extensions:r,profileLocation:i}),a}),n.length&&this.c.fire({extensions:n,profileLocation:i}),r.length&&this.g.fire({extensions:r,profileLocation:i}),n}catch(o){throw n.length&&this.c.fire({extensions:n,error:o,profileLocation:i}),r.length&&this.g.fire({extensions:r,error:o,profileLocation:i}),o}}async updateMetadata(e,i){const s=[];return await this.t(i,r=>{const n=[];for(const o of r){const a=e.find(([l])=>Q({id:l.identifier.id},{id:o.identifier.id})&&l.manifest.version===o.version);a&&(o.metadata={...o.metadata,...a[1]},s.push(o)),n.push(o)}return n}),s}async removeExtensionsFromProfile(e,i){const s=[];try{await this.t(i,r=>{const n=[];for(const o of r)e.some(a=>Q(o.identifier,a))?s.push(o):n.push(o);return s.length&&this.f.fire({extensions:s,profileLocation:i}),n}),s.length&&this.g.fire({extensions:s,profileLocation:i})}catch(r){throw s.length&&this.g.fire({extensions:s,error:r,profileLocation:i}),r}}async t(e,i,s){return this.D(e).queue(async()=>{let r=[],n;try{const o=await this.m.readFile(e);n=JSON.parse(o.value.toString().trim()||"[]")}catch(o){if(Me(o)!==1)throw o;if(this.r.extUri.isEqual(e,this.n.defaultProfile.extensionsResource)&&(n=await this.C()),!n&&s?.bailOutWhenFileNotFound)throw new Tn(G(o),"ERROR_PROFILE_NOT_FOUND")}if(n){Array.isArray(n)||this.u(e);let o=!1;for(const a of n){ff(a)||this.u(e);let l;if(xe(a.relativeLocation)&&a.relativeLocation)l=this.y(a.relativeLocation);else if(xe(a.location)){this.s.warn(`Extensions profile: Ignoring extension with invalid location: ${a.location}`);continue}else{l=k.revive(a.location);const u=this.w(l);u&&(o=!0,a.relativeLocation=u)}xt(a.metadata?.hasPreReleaseVersion)&&a.metadata?.preRelease&&(o=!0,a.metadata.hasPreReleaseVersion=!0);const c=a.metadata?.id??a.identifier.uuid;r.push({identifier:c?{id:a.identifier.id,uuid:c}:{id:a.identifier.id},location:l,version:a.version,metadata:a.metadata})}o&&await this.m.writeFile(e,V.fromString(JSON.stringify(n)))}if(i){r=i(r);const o=r.map(a=>({identifier:a.identifier,version:a.version,location:a.location.toJSON(),relativeLocation:this.w(a.location),metadata:a.metadata}));await this.m.writeFile(e,V.fromString(JSON.stringify(o)))}return r})}u(e){throw new Tn(`Invalid extensions content in ${e.toString()}`,"ERROR_INVALID_CONTENT")}w(e){return this.r.extUri.isEqual(this.r.extUri.dirname(e),this.j)?this.r.extUri.basename(e):void 0}y(e){return this.r.extUri.joinPath(this.j,e)}async C(){return this.z||(this.z=(async()=>{const e=this.r.extUri.joinPath(this.n.defaultProfile.location,"extensions.json"),i=this.r.extUri.joinPath(this.j,".init-default-profile-extensions");let s;try{s=(await this.m.readFile(e)).value.toString()}catch(n){if(Me(n)===1)return;throw n}this.s.info("Migrating extensions from old default profile location",e.toString());let r;try{const n=JSON.parse(s);Array.isArray(n)&&n.every(o=>ff(o))?r=n:this.s.warn("Skipping migrating from old default profile locaiton: Found invalid data",n)}catch(n){this.s.error(n)}if(r)try{await this.m.createFile(this.n.defaultProfile.extensionsResource,V.fromString(JSON.stringify(r)),{overwrite:!1}),this.s.info("Migrated extensions from old default profile location to new location",e.toString(),this.n.defaultProfile.extensionsResource.toString())}catch(n){if(Me(n)===3)this.s.info("Migration from old default profile location to new location is done by another window",e.toString(),this.n.defaultProfile.extensionsResource.toString());else throw n}try{await this.m.del(e)}catch(n){Me(n)!==1&&this.s.error(n)}try{await this.m.del(i)}catch(n){Me(n)!==1&&this.s.error(n)}return r})()),this.z}D(e){let i=this.h.get(e);return i||(i=new Qs,this.h.set(e,i)),i}};Ma=__decorate([__param(1,Ie),__param(2,jt),__param(3,ze),__param(4,he)],Ma);function ff(t){return Oe(t)&&x4(t.identifier)&&(Fm(t.location)||xe(t.location)&&t.location)&&(xt(t.relativeLocation)||xe(t.relativeLocation))&&t.version&&xe(t.version)}function Fm(t){return t?xe(t.path)&&xe(t.scheme):!1}function ja(t){switch(t){case 1:return g(116,null);case 2:return g(117,null);case 3:return g(118,null);case 4:return g(119,null);case 5:return g(120,null);case 6:return g(121,null);case 7:return g(122,null);case 8:return g(123,null);case 9:return g(124,null);default:return""}}function Tm(t,e,i,s){try{Um(t,e,i,s)}catch(r){t.error(r?.message??r)}return e}function Um(t,e,i,s){const r=(n,o,a)=>{const l=n[o];if(xe(l)){const c=l,u=c.length;if(u>1&&c[0]==="%"&&c[u-1]==="%"){const f=c.substr(1,u-2);let d=i[f];d===void 0&&s&&(d=s[f]);const p=typeof d=="string"?d:d?.message,m=s?.[f],w=typeof m=="string"?m:m?.message;if(!p){w||t.warn(`[${e.name}]: ${g(1967,null,f)}`);return}if(a&&(o==="title"||o==="category")&&w&&w!==p){const y={value:p,original:w};n[o]=y}else n[o]=p}}else if(Oe(l))for(const c in l)l.hasOwnProperty(c)&&(c==="commands"?r(l,c,!0):r(l,c,a));else if(Array.isArray(l))for(let c=0;c<l.length;c++)r(l,c,a)};for(const n in e)e.hasOwnProperty(n)&&r(e,n)}var _a;(function(t){function e(i,s){if(i===s)return!0;const r=Object.keys(i),n=new Set;for(const o of Object.keys(s))n.add(o);if(r.length!==n.size)return!1;for(const o of r){if(i[o]!==s[o])return!1;n.delete(o)}return n.size===0}t.equals=e})(_a||(_a={}));var Un=ue("IExtensionsScannerService"),Va=class extends J{constructor(e,i,s,r,n,o,a,l,c,u,f,d){super(),this.systemExtensionsLocation=e,this.userExtensionsLocation=i,this.n=s,this.r=n,this.s=o,this.t=a,this.u=l,this.w=c,this.y=u,this.z=f,this.C=d,this.g=this.B(new N),this.onDidChangeCache=this.g.event,this.G=void 0,this.h=this.B(this.C.createInstance(jn,r)),this.j=this.B(this.C.createInstance(jn,r)),this.m=this.B(this.C.createInstance(Mn)),this.B(this.h.onDidChangeCache(()=>this.g.fire(0))),this.B(this.j.onDidChangeCache(()=>this.g.fire(1)))}F(){return this.D||(this.D=Bh(this.t,this.u)),this.D}async scanAllExtensions(e,i){const[s,r]=await Promise.all([this.scanSystemExtensions(e),this.scanUserExtensions(i)]);return this.J(s,r,[],await this.F(),!0)}async scanSystemExtensions(e){const i=[];i.push(this.L(e.language)),i.push(this.M(e.language,!!e.checkControlFile));const[s,r]=await Promise.all(i);return this.I([...s,...r],0,{pickLatest:!1})}async scanUserExtensions(e){this.u.trace("Started scanning user extensions",e.profileLocation);const i=this.z.extUri.isEqual(e.profileLocation,this.r.defaultProfile.extensionsResource)?{bailOutWhenFileNotFound:!0}:void 0,s=await this.O(e.profileLocation,!0,1,e.language,!0,i,e.productVersion??this.Q()),r=e.useCache&&!s.devMode?this.j:this.m;let n;try{n=await r.scanExtensions(s)}catch(o){if(o instanceof Tn&&o.code==="ERROR_PROFILE_NOT_FOUND")await this.H(),n=await r.scanExtensions(s);else throw o}return n=await this.I(n,1,{includeInvalid:e.includeInvalid,pickLatest:!0}),this.u.trace("Scanned user extensions:",n.length),n}async scanAllUserExtensions(e={includeInvalid:!0,includeAllVersions:!0}){const i=await this.O(this.userExtensionsLocation,!1,1,void 0,!0,void 0,this.Q()),s=await this.m.scanExtensions(i);return this.I(s,1,{includeAllVersions:e.includeAllVersions,includeInvalid:e.includeInvalid})}async scanExtensionsUnderDevelopment(e,i){if(this.w.isExtensionDevelopment&&this.w.extensionDevelopmentLocationURI){const s=(await Promise.all(this.w.extensionDevelopmentLocationURI.filter(r=>r.scheme===ie.file).map(async r=>{const n=await this.O(r,!1,1,i.language,!1,void 0,this.Q());return(await this.m.scanOneOrMultipleExtensions(n)).map(a=>(a.type=e.find(l=>Q(l.identifier,a.identifier))?.type??a.type,this.m.validate(a,n)))}))).flat();return this.I(s,"development",{includeInvalid:i.includeInvalid,pickLatest:!0})}return[]}async scanExistingExtension(e,i,s){const r=await this.O(e,!1,i,s.language,!0,void 0,this.Q()),n=await this.m.scanExtension(r);return!n||!s.includeInvalid&&!n.isValid?null:n}async scanOneOrMultipleExtensions(e,i,s){const r=await this.O(e,!1,i,s.language,!0,void 0,this.Q()),n=await this.m.scanOneOrMultipleExtensions(r);return this.I(n,i,{includeInvalid:s.includeInvalid,pickLatest:!0})}async scanMultipleExtensions(e,i,s){const r=[];return await Promise.all(e.map(async n=>{const o=await this.scanOneOrMultipleExtensions(n,i,s);r.push(...o)})),this.I(r,i,{includeInvalid:s.includeInvalid,pickLatest:!0})}async updateManifestMetadata(e,i){const s=W(e,"package.json"),r=(await this.t.readFile(s)).value.toString(),n=JSON.parse(r);n.__metadata={...n.__metadata,...i},await this.t.writeFile(W(e,"package.json"),V.fromString(JSON.stringify(n,null,"	")))}async initializeDefaultProfileExtensions(){try{await this.s.scanProfileExtensions(this.r.defaultProfile.extensionsResource,{bailOutWhenFileNotFound:!0})}catch(e){if(e instanceof Tn&&e.code==="ERROR_PROFILE_NOT_FOUND")await this.H();else throw e}}async H(){return this.G||(this.G=(async()=>{try{this.u.info("Started initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString());const e=await this.scanAllUserExtensions({includeInvalid:!0});if(e.length)await this.s.addExtensionsToProfile(e.map(i=>[i,i.metadata]),this.r.defaultProfile.extensionsResource);else try{await this.t.createFile(this.r.defaultProfile.extensionsResource,V.fromString(JSON.stringify([])))}catch(i){Me(i)!==1&&this.u.warn("Failed to create default profile extensions manifest in extensions installation folder.",this.userExtensionsLocation.toString(),G(i))}this.u.info("Completed initializing default profile extensions in extensions installation folder.",this.userExtensionsLocation.toString())}catch(e){this.u.error(e)}finally{this.G=void 0}})()),this.G}async I(e,i,s={}){return s.includeAllVersions||(e=this.J(i===0?e:void 0,i===1?e:void 0,i==="development"?e:void 0,await this.F(),!!s.pickLatest)),s.includeInvalid||(e=e.filter(r=>r.isValid)),e.sort((r,n)=>{const o=Nt(r.location.fsPath),a=Nt(n.location.fsPath);return o<a?-1:o>a?1:0})}J(e,i,s,r,n){const o=(l,c,u)=>{if(!u){if(l.metadata?.isApplicationScoped&&!c.metadata?.isApplicationScoped)return!1;if(!l.metadata?.isApplicationScoped&&c.metadata?.isApplicationScoped)return!0}if(l.isValid&&!c.isValid)return!1;if(l.isValid===c.isValid){if(n&&ga(l.manifest.version,c.manifest.version))return this.u.debug(`Skipping extension ${c.location.path} with lower version ${c.manifest.version} in favour of ${l.location.path} with version ${l.manifest.version}`),!1;if(p4(l.manifest.version,c.manifest.version)){if(l.type===0)return this.u.debug(`Skipping extension ${c.location.path} in favour of system extension ${l.location.path} with same version`),!1;if(l.targetPlatform===r)return this.u.debug(`Skipping extension ${c.location.path} from different target platform ${c.targetPlatform}`),!1}}return u?this.u.warn(`Overwriting user extension ${l.location.path} with ${c.location.path}.`):this.u.debug(`Overwriting user extension ${l.location.path} with ${c.location.path}.`),!0},a=new I4;return e?.forEach(l=>{const c=a.get(l.identifier.id);(!c||o(c,l,!1))&&a.set(l.identifier.id,l)}),i?.forEach(l=>{const c=a.get(l.identifier.id);if(!c&&e&&l.type===0){this.u.debug(`Skipping obsolete system extension ${l.location.path}.`);return}(!c||o(c,l,!1))&&a.set(l.identifier.id,l)}),s?.forEach(l=>{const c=a.get(l.identifier.id);(!c||o(c,l,!0))&&a.set(l.identifier.id,l),a.set(l.identifier.id,l)}),[...a.values()]}async L(e){this.u.trace("Started scanning system extensions");const i=await this.O(this.systemExtensionsLocation,!1,0,e,!0,void 0,this.Q()),r=await(i.devMode?this.m:this.h).scanExtensions(i);return this.u.trace("Scanned system extensions:",r.length),r}async M(e,i){const s=this.w.isBuilt?[]:this.y.builtInExtensions;if(!s?.length)return[];this.u.trace("Started scanning dev system extensions");const r=i?await this.N():{},n=[],o=k.file(pi(U(Gs.asFileUri("").fsPath,"..",".build","builtInExtensions")));for(const l of s){const c=r[l.name]||"marketplace";switch(c){case"disabled":break;case"marketplace":n.push(W(o,l.name));break;default:n.push(k.file(c));break}}const a=await Promise.all(n.map(async l=>this.m.scanExtension(await this.O(l,!1,0,e,!0,void 0,this.Q()))));return this.u.trace("Scanned dev system extensions:",a.length),is(a)}async N(){try{const e=await this.t.readFile(this.n);return JSON.parse(e.value.toString())}catch{return{}}}async O(e,i,s,r,n,o,a){const l=await this.f(r??qt),c=await this.P(e),u=i&&!this.z.extUri.isEqual(e,this.r.defaultProfile.extensionsResource)?this.r.defaultProfile.extensionsResource:void 0,f=u?await this.P(u):void 0;return new mr(e,c,u,f,i,o,s,n,a.version,a.date,this.y.commit,!this.w.isBuilt,r,l)}async P(e){try{const i=await this.t.stat(e);if(typeof i.mtime=="number")return i.mtime}catch{}}Q(){return{version:this.y.version,date:this.y.date}}};Va=__decorate([__param(4,jt),__param(5,Ei),__param(6,Ie),__param(7,he),__param(8,fi),__param(9,gt),__param(10,ze),__param(11,tn)],Va);var mr=class{constructor(t,e,i,s,r,n,o,a,l,c,u,f,d,p){this.location=t,this.mtime=e,this.applicationExtensionslocation=i,this.applicationExtensionslocationMtime=s,this.profile=r,this.profileScanOptions=n,this.type=o,this.validate=a,this.productVersion=l,this.productDate=c,this.productCommit=u,this.devMode=f,this.language=d,this.translations=p}static createNlsConfiguration(t){return{language:t.language,pseudo:t.language==="pseudo",devMode:t.devMode,translations:t.translations}}static equals(t,e){return Yc(t.location,e.location)&&t.mtime===e.mtime&&Yc(t.applicationExtensionslocation,e.applicationExtensionslocation)&&t.applicationExtensionslocationMtime===e.applicationExtensionslocationMtime&&t.profile===e.profile&&Wt(t.profileScanOptions,e.profileScanOptions)&&t.type===e.type&&t.validate===e.validate&&t.productVersion===e.productVersion&&t.productDate===e.productDate&&t.productCommit===e.productCommit&&t.devMode===e.devMode&&t.language===e.language&&_a.equals(t.translations,e.translations)}},Mn=class extends J{constructor(e,i,s,r,n,o){super(),this.g=e,this.h=i,this.j=s,this.m=n,this.n=o,this.f=r.extensionsEnabledWithApiProposalVersion?.map(a=>a.toLowerCase())??[]}async scanExtensions(e){return e.profile?this.s(e):this.r(e)}async r(e){const i=await this.j.resolve(e.location);if(!i.children?.length)return[];const s=await Promise.all(i.children.map(async r=>{if(!r.isDirectory||e.type===1&&us(r.resource).indexOf(".")===0)return null;const n=new mr(r.resource,e.mtime,e.applicationExtensionslocation,e.applicationExtensionslocationMtime,e.profile,e.profileScanOptions,e.type,e.validate,e.productVersion,e.productDate,e.productCommit,e.devMode,e.language,e.translations);return this.scanExtension(n)}));return is(s).sort((r,n)=>r.location.path<n.location.path?-1:1)}async s(e){let i=await this.t(e.location,()=>!0,e);if(e.applicationExtensionslocation&&!this.h.extUri.isEqual(e.location,e.applicationExtensionslocation)){i=i.filter(r=>!r.metadata?.isApplicationScoped);const s=await this.t(e.applicationExtensionslocation,r=>!!r.metadata?.isBuiltin||!!r.metadata?.isApplicationScoped,e);i.push(...s)}return i}async t(e,i,s){const r=await this.g.scanProfileExtensions(e,s.profileScanOptions);if(!r.length)return[];const n=await Promise.all(r.map(async o=>{if(i(o)){const a=new mr(o.location,s.mtime,s.applicationExtensionslocation,s.applicationExtensionslocationMtime,s.profile,s.profileScanOptions,s.type,s.validate,s.productVersion,s.productDate,s.productCommit,s.devMode,s.language,s.translations);return this.scanExtension(a,o)}return null}));return is(n)}async scanOneOrMultipleExtensions(e){try{if(await this.j.exists(W(e.location,"package.json"))){const i=await this.scanExtension(e);return i?[i]:[]}else return await this.scanExtensions(e)}catch(i){return this.n.error(`Error scanning extensions at ${e.location.path}:`,G(i)),[]}}async scanExtension(e,i){const s=[];let r=!0,n;try{n=await this.u(e.location)}catch(d){if(i){s.push([Ve.Error,G(d)]),r=!1;const[p,m]=i.identifier.id.split(".");n={name:m,publisher:p,version:i.version,engines:{vscode:""}}}else return e.type!==0&&this.n.error(d),null}n.publisher||(n.publisher=Lh);let o;i?o={...i.metadata,size:n.__metadata?.size}:n.__metadata&&(o={installedTimestamp:n.__metadata.installedTimestamp,size:n.__metadata.size,targetPlatform:n.__metadata.targetPlatform}),delete n.__metadata;const a=Ut(n.publisher,n.name),l=o?.id?{id:a,uuid:o.id}:{id:a},c=o?.isSystem?0:e.type,u=c===0||!!o?.isBuiltin;try{n=await this.w(e.location,n,mr.createNlsConfiguration(e))}catch(d){this.n.warn("Failed to translate manifest",G(d))}let f={type:c,identifier:l,manifest:n,location:e.location,isBuiltin:u,targetPlatform:o?.targetPlatform??"undefined",publisherDisplayName:o?.publisherDisplayName,metadata:o,isValid:r,validations:s,preRelease:!!o?.preRelease};return e.validate&&(f=this.validate(f,e)),n.enabledApiProposals&&(!this.m.isBuilt||this.f.includes(a.toLowerCase()))&&(n.originalEnabledApiProposals=n.enabledApiProposals,n.enabledApiProposals=R4([...n.enabledApiProposals])),f}validate(e,i){let s=e.isValid;const r=this.m.isBuilt&&this.f.includes(e.identifier.id.toLowerCase()),n=om(i.productVersion,i.productDate,i.location,e.manifest,e.isBuiltin,r);for(const[o,a]of n)o===Ve.Error&&(s=!1,this.n.error(this.D(i.location,a)));return e.isValid=s,e.validations=[...e.validations,...n],e}async u(e){const i=W(e,"package.json");let s;try{s=(await this.j.readFile(i)).value.toString()}catch(n){throw Me(n)!==1&&this.n.error(this.D(e,g(1968,null,i.path,n.message))),n}let r;try{r=JSON.parse(s)}catch(n){const o=[];Xs(s,o);for(const a of o)this.n.error(this.D(e,g(1969,null,i.path,a.offset,a.length,ja(a.error))));throw n}if(Ks(r)!=="object"){const n=this.D(e,g(1970,null,i.path));throw this.n.error(n),new Error(n)}return r}async w(e,i,s){const r=await this.y(e,i,s);if(r)try{const n=[],o=await this.z(r.default,n);if(n.length>0)return n.forEach(l=>{this.n.error(this.D(e,g(1971,null,r.default?.path,ja(l.error))))}),i;if(Ks(r)!=="object")return this.n.error(this.D(e,g(1972,null,r.default?.path))),i;const a=r.values||Object.create(null);return Tm(this.n,i,a,o)}catch{}return i}async y(e,i,s){const r=W(e,"package.nls.json"),n=(c,u)=>{u.forEach(f=>{this.n.error(this.D(e,g(1973,null,c?.path,ja(f.error))))})},o=c=>{this.n.error(this.D(e,g(1974,null,c?.path)))},a=`${i.publisher}.${i.name}`,l=s.translations[a];if(l)try{const c=k.file(l),u=(await this.j.readFile(c)).value.toString(),f=[],d=Xs(u,f);return f.length>0?(n(c,f),{values:void 0,default:r}):Ks(d)!=="object"?(o(c),{values:void 0,default:r}):{values:d.contents?d.contents.package:void 0,default:r}}catch{return{values:void 0,default:r}}else{if(!await this.j.exists(r))return;let u;try{u=await this.C(e,s)}catch{return}if(!u.localized)return{values:void 0,default:u.original};try{const f=(await this.j.readFile(u.localized)).value.toString(),d=[],p=Xs(f,d);return d.length>0?(n(u.localized,d),{values:void 0,default:u.original}):Ks(p)!=="object"?(o(u.localized),{values:void 0,default:u.original}):{values:p,default:u.original}}catch{return{values:void 0,default:u.original}}}}async z(e,i){if(e)try{const s=(await this.j.readFile(e)).value.toString();return Xs(s,i)}catch{}}C(e,i){return new Promise((s,r)=>{const n=o=>{const a=W(e,`package.nls.${o}.json`);this.j.exists(a).then(l=>{l&&s({localized:a,original:W(e,"package.nls.json")});const c=o.lastIndexOf("-");c===-1?s({localized:W(e,"package.nls.json"),original:null}):(o=o.substring(0,c),n(o))})};if(i.devMode||i.pseudo||!i.language)return s({localized:W(e,"package.nls.json"),original:null});n(i.language)})}D(e,i){return`[${e.path}]: ${i}`}};Mn=__decorate([__param(0,Ei),__param(1,ze),__param(2,Ie),__param(3,gt),__param(4,fi),__param(5,he)],Mn);var jn=class extends Mn{constructor(e,i,s,r,n,o,a,l){super(s,r,n,o,a,l),this.I=e,this.J=i,this.G=this.B(new Ci(3e3)),this.H=this.B(new N),this.onDidChangeCache=this.H.event}async scanExtensions(e){const i=this.O(e),s=await this.L(i);if(this.F=e,s&&s.input&&mr.equals(s.input,this.F))return this.n.debug("Using cached extensions scan result",e.type===0?"system":"user",e.location.toString()),this.G.trigger(()=>this.N()),s.result.map(n=>(n.location=k.revive(n.location),n));const r=await super.scanExtensions(e);return await this.M(i,{input:e,result:r}),r}async L(e){try{const i=await this.j.readFile(e),s=JSON.parse(i.value.toString());return{result:s.result,input:$s(s.input)}}catch(i){this.n.debug("Error while reading the extension cache file:",e.path,G(i))}return null}async M(e,i){try{await this.j.writeFile(e,V.fromString(JSON.stringify(i)))}catch(s){this.n.debug("Error while writing the extension cache file:",e.path,G(s))}}async N(){if(!this.F)return;const e=this.O(this.F),i=await this.L(e);if(!i)return;const s=i.result,r=JSON.parse(JSON.stringify(await super.scanExtensions(this.F)));if(!Wt(r,s))try{this.n.info("Invalidating Cache",s,r),await this.j.del(e),this.H.fire()}catch(n){this.n.error(n)}}O(e){const i=this.P(e);return this.h.extUri.joinPath(i.cacheHome,e.type===0?P4:Rh)}P(e){return e.type===0?this.J.defaultProfile:e.profile?this.h.extUri.isEqual(e.location,this.I.extensionsResource)?this.I:this.J.profiles.find(i=>this.h.extUri.isEqual(e.location,i.extensionsResource))??this.I:this.J.defaultProfile}};jn=__decorate([__param(1,jt),__param(2,Ei),__param(3,ze),__param(4,Ie),__param(5,gt),__param(6,fi),__param(7,he)],jn);var Mm=class extends Va{constructor(t,e,i,s,r,n,o,a,l,c,u,f){super(t,e,W(i,".vscode-oss-dev","extensions","control.json"),s,r,n,o,a,l,c,u,f),this.R=(async()=>{if(Ac)try{const d=await this.t.readFile(k.file(Ac));return JSON.parse(d.value.toString())}catch{}return Object.create(null)})()}f(t){return this.R}};import*as jm from"fs";import*as fe from"fs";import{tmpdir as _m}from"os";import{promisify as wr}from"util";var Vm=new Mr(1e4);function za(t){return Bm(t,"NFC",Vm)}var q6=new Mr(1e4),zm=/[^\u0000-\u0080]/;function Bm(t,e,i){if(!t)return t;const s=i.get(t);if(s)return s;let r;return zm.test(t)?r=t.normalize(e):r=t,i.set(t,r),r}var ks;(function(t){t[t.UNLINK=0]="UNLINK",t[t.MOVE=1]="MOVE"})(ks||(ks={}));async function df(t,e=ks.UNLINK,i){if(z0(t))throw new Error("rimraf - will refuse to recursively delete root");return e===ks.UNLINK?Ba(t):qm(t,i)}async function qm(t,e=H0(_m())){try{try{await fe.promises.rename(t,e)}catch(i){return i.code==="ENOENT"?void 0:Ba(t)}Ba(e).catch(i=>{})}catch(i){if(i.code!=="ENOENT")throw i}}async function Ba(t){return fe.promises.rm(t,{recursive:!0,force:!0,maxRetries:3})}async function _n(t,e){return Hm(await(e?Wm(t):fe.promises.readdir(t)))}async function Wm(t){try{return await fe.promises.readdir(t,{withFileTypes:!0})}catch(s){console.warn("[node.js fs] readdir with filetypes failed with error: ",s)}const e=[],i=await _n(t);for(const s of i){let r=!1,n=!1,o=!1;try{const a=await fe.promises.lstat(U(t,s));r=a.isFile(),n=a.isDirectory(),o=a.isSymbolicLink()}catch(a){console.warn("[node.js fs] unexpected error from lstat after readdir: ",a)}e.push({name:s,isFile:()=>r,isDirectory:()=>n,isSymbolicLink:()=>o})}return e}function Hm(t){return t.map(e=>typeof e=="string"?Rt?za(e):e:(e.name=Rt?za(e.name):e.name,e))}async function Gm(t){const e=await _n(t),i=[];for(const s of e)await mt.existsDirectory(U(t,s))&&i.push(s);return i}var mt;(function(t){async function e(r){let n;try{if(n=await fe.promises.lstat(r),!n.isSymbolicLink())return{stat:n}}catch{}try{return{stat:await fe.promises.stat(r),symbolicLink:n?.isSymbolicLink()?{dangling:!1}:void 0}}catch(o){if(o.code==="ENOENT"&&n)return{stat:n,symbolicLink:{dangling:!0}};if(me&&o.code==="EACCES")try{return{stat:await fe.promises.stat(await fe.promises.readlink(r)),symbolicLink:{dangling:!1}}}catch(a){if(a.code==="ENOENT"&&n)return{stat:n,symbolicLink:{dangling:!0}};throw a}throw o}}t.stat=e;async function i(r){try{const{stat:n,symbolicLink:o}=await t.stat(r);return n.isFile()&&o?.dangling!==!0}catch{}return!1}t.existsFile=i;async function s(r){try{const{stat:n,symbolicLink:o}=await t.stat(r);return n.isDirectory()&&o?.dangling!==!0}catch{}return!1}t.existsDirectory=s})(mt||(mt={}));var Jm=new lu;function Qm(t,e,i){return Jm.queueFor(k.file(t),()=>{const s=Km(i);return new Promise((r,n)=>Xm(t,e,s,o=>o?n(o):r()))},Ro)}var pf=!0;function Zm(t){pf=t}function Xm(t,e,i,s){if(!pf)return fe.writeFile(t,e,{mode:i.mode,flag:i.flag},s);fe.open(t,i.flag,i.mode,(r,n)=>{if(r)return s(r);fe.writeFile(n,e,o=>{if(o)return fe.close(n,()=>s(o));fe.fdatasync(n,a=>(a&&(console.warn("[node.js fs] fdatasync is now disabled for this session because it failed: ",a),Zm(!1)),fe.close(n,l=>s(l))))})})}function Km(t){return t?{mode:typeof t.mode=="number"?t.mode:438,flag:typeof t.flag=="string"?t.flag:"w"}:{mode:438,flag:"w"}}async function Ym(t,e,i=6e4){if(t!==e)try{me&&typeof i=="number"?await gf(t,e,Date.now(),i):await fe.promises.rename(t,e)}catch(s){if(t.toLowerCase()!==e.toLowerCase()&&s.code==="EXDEV"||t.endsWith("."))await mf(t,e,{preserveSymlinks:!1}),await df(t,ks.MOVE);else throw s}}async function gf(t,e,i,s,r=0){try{return await fe.promises.rename(t,e)}catch(n){if(n.code!=="EACCES"&&n.code!=="EPERM"&&n.code!=="EBUSY")throw n;if(Date.now()-i>=s)throw console.error(`[node.js fs] rename failed after ${r} retries with error: ${n}`),n;if(r===0){let o=!1;try{const{stat:a}=await mt.stat(e);a.isFile()||(o=!0)}catch{}if(o)throw n}return await Js(Math.min(100,r*10)),gf(t,e,i,s,r+1)}}async function mf(t,e,i){return vf(t,e,{root:{source:t,target:e},options:i,handledSourcePaths:new Set})}var wf=511;async function vf(t,e,i){if(i.handledSourcePaths.has(t))return;i.handledSourcePaths.add(t);const{stat:s,symbolicLink:r}=await mt.stat(t);if(r){if(i.options.preserveSymlinks)try{return await i2(t,e,i)}catch{}if(r.dangling)return}return s.isDirectory()?e2(t,e,s.mode&wf,i):t2(t,e,s.mode&wf)}async function e2(t,e,i,s){await fe.promises.mkdir(e,{recursive:!0,mode:i});const r=await _n(t);for(const n of r)await vf(U(t,n),U(e,n),s)}async function t2(t,e,i){await fe.promises.copyFile(t,e),await fe.promises.chmod(e,i)}async function i2(t,e,i){let s=await fe.promises.readlink(t);Hs(s,i.root.source,!at)&&(s=U(i.root.target,s.substr(i.root.source.length+1))),await fe.promises.symlink(s,e)}var ce=new class{get read(){return(t,e,i,s,r)=>new Promise((n,o)=>{fe.read(t,e,i,s,r,(a,l,c)=>a?o(a):n({bytesRead:l,buffer:c}))})}get write(){return(t,e,i,s,r)=>new Promise((n,o)=>{fe.write(t,e,i,s,r,(a,l,c)=>a?o(a):n({bytesWritten:l,buffer:c}))})}get fdatasync(){return wr(fe.fdatasync)}get open(){return wr(fe.open)}get close(){return wr(fe.close)}get realpath(){return wr(fe.realpath)}get ftruncate(){return wr(fe.ftruncate)}async exists(t){try{return await fe.promises.access(t),!0}catch{return!1}}get readdir(){return _n}get readDirsInDir(){return Gm}get writeFile(){return Qm}get rm(){return df}get rename(){return Ym}get copy(){return mf}};import{createWriteStream as yf,promises as bf}from"fs";var Ef="end of central directory record signature not found",s2=new RegExp(Ef),Vn=class extends Error{constructor(t,e){let i=e.message;switch(t){case"CorruptZip":i=`Corrupt ZIP: ${i}`;break}super(i),this.type=t,this.cause=e}};function r2(t){const e=t.externalFileAttributes>>16||33188;return[448,56,7].map(i=>e&i).reduce((i,s)=>i+s,e&61440)}function xf(t){if(t instanceof Vn)return t;let e;return s2.test(t.message)&&(e="CorruptZip"),new Vn(e,t)}function n2(t,e,i,s,r,n){const o=Ot(e),a=U(s,o);if(!a.startsWith(s))return Promise.reject(new Error(g(145,null,e)));const l=U(s,e);let c;return n.onCancellationRequested(()=>{c?.destroy()}),Promise.resolve(bf.mkdir(a,{recursive:!0})).then(()=>new Promise((u,f)=>{if(!n.isCancellationRequested)try{c=yf(l,{mode:i}),c.once("close",()=>u()),c.once("error",f),t.once("error",f),t.pipe(c)}catch(d){f(d)}}))}function o2(t,e,i,s){let r=ni(()=>Promise.resolve()),n=0;const o=s.onCancellationRequested(()=>{r.cancel(),t.close()});return new Promise((a,l)=>{const c=new pp,u=f=>{f.isCancellationRequested||(n++,t.readEntry())};t.once("error",l),t.once("close",()=>r.then(()=>{s.isCancellationRequested||t.entryCount===n?a():l(new Vn("Incomplete",new Error(g(146,null,n,t.entryCount))))},l)),t.readEntry(),t.on("entry",f=>{if(s.isCancellationRequested)return;if(!i.sourcePathRegex.test(f.fileName)){u(s);return}const d=f.fileName.replace(i.sourcePathRegex,"");if(/\/$/.test(d)){const w=U(e,d);r=ni(y=>bf.mkdir(w,{recursive:!0}).then(()=>u(y)).then(void 0,l));return}const p=$f(t,f),m=r2(f);r=ni(w=>c.queue(()=>p.then(y=>n2(y,d,m,e,i,w).then(()=>u(w)))).then(null,l))})}).finally(()=>o.dispose())}async function Sf(t,e=!1){const{open:i}=await import("yauzl");return new Promise((s,r)=>{i(t,e?{lazyEntries:!0}:void 0,(n,o)=>{n?r(xf(n)):s(uc(o))})})}function $f(t,e){return new Promise((i,s)=>{t.openReadStream(e,(r,n)=>{r?s(xf(r)):i(uc(n))})})}async function a2(t,e){const{ZipFile:i}=await import("yazl");return new Promise((s,r)=>{const n=new i;e.forEach(a=>{a.contents?n.addBuffer(typeof a.contents=="string"?Buffer.from(a.contents,"utf8"):a.contents,a.path):a.localPath&&n.addFile(a.localPath,a.path)}),n.end();const o=yf(t);n.outputStream.pipe(o),n.outputStream.once("error",r),o.once("error",r),o.once("finish",()=>s(t))})}function l2(t,e,i={},s){const r=new RegExp(i.sourcePath?`^${i.sourcePath}`:"");let n=Sf(t,!0);return i.overwrite&&(n=n.then(o=>ce.rm(e).then(()=>o))),n.then(o=>o2(o,e,{sourcePathRegex:r},s))}function c2(t,e){return Sf(t).then(i=>new Promise((s,r)=>{i.on("entry",n=>{n.fileName===e&&$f(i,n).then(o=>s(o),o=>r(o))}),i.once("close",()=>r(new Error(g(147,null,e))))}))}function Pf(t,e){return c2(t,e).then(i=>new Promise((s,r)=>{const n=[];i.once("error",r),i.on("data",o=>n.push(o)),i.on("end",()=>s(Buffer.concat(n)))}))}var H6=new Uint32Array(10),kf;(function(t){t[t.InitialConsonant=4352]="InitialConsonant",t[t.Vowel=4449]="Vowel",t[t.FinalConsonant=4520]="FinalConsonant",t[t.CompatibilityJamo=12593]="CompatibilityJamo"})(kf||(kf={}));var If;(function(t){t[t.NUL=0]="NUL",t[t.A=65]="A",t[t.B=66]="B",t[t.C=67]="C",t[t.D=68]="D",t[t.E=69]="E",t[t.F=70]="F",t[t.G=71]="G",t[t.H=72]="H",t[t.I=73]="I",t[t.J=74]="J",t[t.K=75]="K",t[t.L=76]="L",t[t.M=77]="M",t[t.N=78]="N",t[t.O=79]="O",t[t.P=80]="P",t[t.Q=81]="Q",t[t.R=82]="R",t[t.S=83]="S",t[t.T=84]="T",t[t.U=85]="U",t[t.V=86]="V",t[t.W=87]="W",t[t.X=88]="X",t[t.Y=89]="Y",t[t.Z=90]="Z",t[t.a=97]="a",t[t.b=98]="b",t[t.c=99]="c",t[t.d=100]="d",t[t.e=101]="e",t[t.f=102]="f",t[t.g=103]="g",t[t.h=104]="h",t[t.i=105]="i",t[t.j=106]="j",t[t.k=107]="k",t[t.l=108]="l",t[t.m=109]="m",t[t.n=110]="n",t[t.o=111]="o",t[t.p=112]="p",t[t.q=113]="q",t[t.r=114]="r",t[t.s=115]="s",t[t.t=116]="t",t[t.u=117]="u",t[t.v=118]="v",t[t.w=119]="w",t[t.x=120]="x",t[t.y=121]="y",t[t.z=122]="z"})(If||(If={}));var Df;(function(t){t[t.fa=24934]="fa",t[t.fg=26470]="fg",t[t.fq=29030]="fq",t[t.fr=29286]="fr",t[t.ft=29798]="ft",t[t.fv=30310]="fv",t[t.fx=30822]="fx",t[t.hk=27496]="hk",t[t.hl=27752]="hl",t[t.ho=28520]="ho",t[t.ml=27757]="ml",t[t.nj=27246]="nj",t[t.nl=27758]="nl",t[t.np=28782]="np",t[t.qt=29809]="qt",t[t.rt=29810]="rt",t[t.sg=26483]="sg",t[t.sw=30579]="sw"})(Df||(Df={}));var G6=new Uint8Array([114,82,115,101,69,102,97,113,81,116,84,100,119,87,99,122,120,118,103]),J6=new Uint16Array([107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]),Q6=new Uint16Array([114,82,29810,115,30579,26483,101,102,29286,24934,29030,29798,30822,30310,26470,97,113,29809,116,84,100,119,99,122,120,118,103]),Z6=new Uint16Array([114,82,29810,115,30579,26483,101,69,102,29286,24934,29030,29798,30822,30310,26470,97,113,81,29809,116,84,100,119,87,99,122,120,118,103,107,111,105,79,106,112,117,80,104,27496,28520,27752,121,110,27246,28782,27758,98,109,27757,108]);function Af(...t){return function(e,i){for(let s=0,r=t.length;s<r;s++){const n=t[s](e,i);if(n)return n}return null}}var X6=Lf.bind(void 0,!1),Rf=Lf.bind(void 0,!0);function Lf(t,e,i){if(!i||i.length<e.length)return null;let s;return t?s=Do(i,e):s=i.indexOf(e)===0,s?e.length>0?[{start:0,end:e.length}]:[]:null}function u2(t,e){const i=e.toLowerCase().indexOf(t.toLowerCase());return i===-1?null:[{start:i,end:i+t.length}]}function h2(t,e){return qa(t.toLowerCase(),e.toLowerCase(),0,0)}function qa(t,e,i,s){if(i===t.length)return[];if(s===e.length)return null;if(t[i]===e[s]){let r=null;return(r=qa(t,e,i+1,s+1))?Nf({start:s,end:s+1},r):null}return qa(t,e,i,s+1)}function Wa(t){return 97<=t&&t<=122}function zn(t){return 65<=t&&t<=90}function Ha(t){return 48<=t&&t<=57}function f2(t){return t===32||t===9||t===10||t===13}var d2=new Set;"()[]{}<>`'\"-/;:,.?!".split("").forEach(t=>d2.add(t.charCodeAt(0)));function Of(t){return Wa(t)||zn(t)||Ha(t)}function Nf(t,e){return e.length===0?e=[t]:t.end===e[0].start?e[0].start=t.start:e.unshift(t),e}function Cf(t,e){for(let i=e;i<t.length;i++){const s=t.charCodeAt(i);if(zn(s)||Ha(s)||i>0&&!Of(t.charCodeAt(i-1)))return i}return t.length}function Ga(t,e,i,s){if(i===t.length)return[];if(s===e.length)return null;if(t[i]!==e[s].toLowerCase())return null;{let r=null,n=s+1;for(r=Ga(t,e,i+1,s+1);!r&&(n=Cf(e,n))<e.length;)r=Ga(t,e,i+1,n),n++;return r===null?null:Nf({start:s,end:s+1},r)}}function p2(t){let e=0,i=0,s=0,r=0,n=0;for(let u=0;u<t.length;u++)n=t.charCodeAt(u),zn(n)&&e++,Wa(n)&&i++,Of(n)&&s++,Ha(n)&&r++;const o=e/t.length,a=i/t.length,l=s/t.length,c=r/t.length;return{upperPercent:o,lowerPercent:a,alphaPercent:l,numericPercent:c}}function g2(t){const{upperPercent:e,lowerPercent:i}=t;return i===0&&e>.6}function m2(t){const{upperPercent:e,lowerPercent:i,alphaPercent:s,numericPercent:r}=t;return i>.2&&e<.8&&s>.6&&r<.2}function w2(t){let e=0,i=0,s=0,r=0;for(let n=0;n<t.length;n++)s=t.charCodeAt(n),zn(s)&&e++,Wa(s)&&i++,f2(s)&&r++;return(e===0||i===0)&&r===0?t.length<=30:e<=5}function Ff(t,e){if(!e||(e=e.trim(),e.length===0)||!w2(t))return null;e.length>60&&(e=e.substring(0,60));const i=p2(e);if(!m2(i)){if(!g2(i))return null;e=e.toLowerCase()}let s=null,r=0;for(t=t.toLowerCase();r<e.length&&(s=Ga(t,e,0,r))===null;)r=Cf(e,r+1);return s}var K6=Af(Rf,Ff,u2),Y6=Af(Rf,Ff,h2),ew=new Mr(1e4),Bn=128;function Ja(){const t=[],e=[];for(let i=0;i<=Bn;i++)e[i]=0;for(let i=0;i<=Bn;i++)t.push(e.slice(0));return t}function Tf(t){const e=[];for(let i=0;i<=t;i++)e[i]=0;return e}var tw=Tf(2*Bn),iw=Tf(2*Bn),sw=Ja(),rw=Ja(),nw=Ja(),Uf;(function(t){t[t.Diag=1]="Diag",t[t.Left=2]="Left",t[t.LeftLeft=3]="LeftLeft"})(Uf||(Uf={}));var Mf;(function(t){t.Default=[-100,0];function e(i){return!i||i.length===2&&i[0]===-100&&i[1]===0}t.isDefault=e})(Mf||(Mf={}));var ow=class{static{this.default={boostFullMatch:!0,firstMatchCanBeWeak:!1}}constructor(t,e){this.firstMatchCanBeWeak=t,this.boostFullMatch=e}},jf=Object.create(null);function h(t,e){if(xe(e)){const i=jf[e];if(i===void 0)throw new Error(`${t} references an unknown codicon: ${e}`);e=i}return jf[t]=e,{id:t}}var v2={add:h("add",6e4),plus:h("plus",6e4),gistNew:h("gist-new",6e4),repoCreate:h("repo-create",6e4),lightbulb:h("lightbulb",60001),lightBulb:h("light-bulb",60001),repo:h("repo",60002),repoDelete:h("repo-delete",60002),gistFork:h("gist-fork",60003),repoForked:h("repo-forked",60003),gitPullRequest:h("git-pull-request",60004),gitPullRequestAbandoned:h("git-pull-request-abandoned",60004),recordKeys:h("record-keys",60005),keyboard:h("keyboard",60005),tag:h("tag",60006),gitPullRequestLabel:h("git-pull-request-label",60006),tagAdd:h("tag-add",60006),tagRemove:h("tag-remove",60006),person:h("person",60007),personFollow:h("person-follow",60007),personOutline:h("person-outline",60007),personFilled:h("person-filled",60007),gitBranch:h("git-branch",60008),gitBranchCreate:h("git-branch-create",60008),gitBranchDelete:h("git-branch-delete",60008),sourceControl:h("source-control",60008),mirror:h("mirror",60009),mirrorPublic:h("mirror-public",60009),star:h("star",60010),starAdd:h("star-add",60010),starDelete:h("star-delete",60010),starEmpty:h("star-empty",60010),comment:h("comment",60011),commentAdd:h("comment-add",60011),alert:h("alert",60012),warning:h("warning",60012),search:h("search",60013),searchSave:h("search-save",60013),logOut:h("log-out",60014),signOut:h("sign-out",60014),logIn:h("log-in",60015),signIn:h("sign-in",60015),eye:h("eye",60016),eyeUnwatch:h("eye-unwatch",60016),eyeWatch:h("eye-watch",60016),circleFilled:h("circle-filled",60017),primitiveDot:h("primitive-dot",60017),closeDirty:h("close-dirty",60017),debugBreakpoint:h("debug-breakpoint",60017),debugBreakpointDisabled:h("debug-breakpoint-disabled",60017),debugHint:h("debug-hint",60017),terminalDecorationSuccess:h("terminal-decoration-success",60017),primitiveSquare:h("primitive-square",60018),edit:h("edit",60019),pencil:h("pencil",60019),info:h("info",60020),issueOpened:h("issue-opened",60020),gistPrivate:h("gist-private",60021),gitForkPrivate:h("git-fork-private",60021),lock:h("lock",60021),mirrorPrivate:h("mirror-private",60021),close:h("close",60022),removeClose:h("remove-close",60022),x:h("x",60022),repoSync:h("repo-sync",60023),sync:h("sync",60023),clone:h("clone",60024),desktopDownload:h("desktop-download",60024),beaker:h("beaker",60025),microscope:h("microscope",60025),vm:h("vm",60026),deviceDesktop:h("device-desktop",60026),file:h("file",60027),fileText:h("file-text",60027),more:h("more",60028),ellipsis:h("ellipsis",60028),kebabHorizontal:h("kebab-horizontal",60028),mailReply:h("mail-reply",60029),reply:h("reply",60029),organization:h("organization",60030),organizationFilled:h("organization-filled",60030),organizationOutline:h("organization-outline",60030),newFile:h("new-file",60031),fileAdd:h("file-add",60031),newFolder:h("new-folder",60032),fileDirectoryCreate:h("file-directory-create",60032),trash:h("trash",60033),trashcan:h("trashcan",60033),history:h("history",60034),clock:h("clock",60034),folder:h("folder",60035),fileDirectory:h("file-directory",60035),symbolFolder:h("symbol-folder",60035),logoGithub:h("logo-github",60036),markGithub:h("mark-github",60036),github:h("github",60036),terminal:h("terminal",60037),console:h("console",60037),repl:h("repl",60037),zap:h("zap",60038),symbolEvent:h("symbol-event",60038),error:h("error",60039),stop:h("stop",60039),variable:h("variable",60040),symbolVariable:h("symbol-variable",60040),array:h("array",60042),symbolArray:h("symbol-array",60042),symbolModule:h("symbol-module",60043),symbolPackage:h("symbol-package",60043),symbolNamespace:h("symbol-namespace",60043),symbolObject:h("symbol-object",60043),symbolMethod:h("symbol-method",60044),symbolFunction:h("symbol-function",60044),symbolConstructor:h("symbol-constructor",60044),symbolBoolean:h("symbol-boolean",60047),symbolNull:h("symbol-null",60047),symbolNumeric:h("symbol-numeric",60048),symbolNumber:h("symbol-number",60048),symbolStructure:h("symbol-structure",60049),symbolStruct:h("symbol-struct",60049),symbolParameter:h("symbol-parameter",60050),symbolTypeParameter:h("symbol-type-parameter",60050),symbolKey:h("symbol-key",60051),symbolText:h("symbol-text",60051),symbolReference:h("symbol-reference",60052),goToFile:h("go-to-file",60052),symbolEnum:h("symbol-enum",60053),symbolValue:h("symbol-value",60053),symbolRuler:h("symbol-ruler",60054),symbolUnit:h("symbol-unit",60054),activateBreakpoints:h("activate-breakpoints",60055),archive:h("archive",60056),arrowBoth:h("arrow-both",60057),arrowDown:h("arrow-down",60058),arrowLeft:h("arrow-left",60059),arrowRight:h("arrow-right",60060),arrowSmallDown:h("arrow-small-down",60061),arrowSmallLeft:h("arrow-small-left",60062),arrowSmallRight:h("arrow-small-right",60063),arrowSmallUp:h("arrow-small-up",60064),arrowUp:h("arrow-up",60065),bell:h("bell",60066),bold:h("bold",60067),book:h("book",60068),bookmark:h("bookmark",60069),debugBreakpointConditionalUnverified:h("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:h("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:h("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:h("debug-breakpoint-data-unverified",60072),debugBreakpointData:h("debug-breakpoint-data",60073),debugBreakpointDataDisabled:h("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:h("debug-breakpoint-log-unverified",60074),debugBreakpointLog:h("debug-breakpoint-log",60075),debugBreakpointLogDisabled:h("debug-breakpoint-log-disabled",60075),briefcase:h("briefcase",60076),broadcast:h("broadcast",60077),browser:h("browser",60078),bug:h("bug",60079),calendar:h("calendar",60080),caseSensitive:h("case-sensitive",60081),check:h("check",60082),checklist:h("checklist",60083),chevronDown:h("chevron-down",60084),chevronLeft:h("chevron-left",60085),chevronRight:h("chevron-right",60086),chevronUp:h("chevron-up",60087),chromeClose:h("chrome-close",60088),chromeMaximize:h("chrome-maximize",60089),chromeMinimize:h("chrome-minimize",60090),chromeRestore:h("chrome-restore",60091),circleOutline:h("circle-outline",60092),circle:h("circle",60092),debugBreakpointUnverified:h("debug-breakpoint-unverified",60092),terminalDecorationIncomplete:h("terminal-decoration-incomplete",60092),circleSlash:h("circle-slash",60093),circuitBoard:h("circuit-board",60094),clearAll:h("clear-all",60095),clippy:h("clippy",60096),closeAll:h("close-all",60097),cloudDownload:h("cloud-download",60098),cloudUpload:h("cloud-upload",60099),code:h("code",60100),collapseAll:h("collapse-all",60101),colorMode:h("color-mode",60102),commentDiscussion:h("comment-discussion",60103),creditCard:h("credit-card",60105),dash:h("dash",60108),dashboard:h("dashboard",60109),database:h("database",60110),debugContinue:h("debug-continue",60111),debugDisconnect:h("debug-disconnect",60112),debugPause:h("debug-pause",60113),debugRestart:h("debug-restart",60114),debugStart:h("debug-start",60115),debugStepInto:h("debug-step-into",60116),debugStepOut:h("debug-step-out",60117),debugStepOver:h("debug-step-over",60118),debugStop:h("debug-stop",60119),debug:h("debug",60120),deviceCameraVideo:h("device-camera-video",60121),deviceCamera:h("device-camera",60122),deviceMobile:h("device-mobile",60123),diffAdded:h("diff-added",60124),diffIgnored:h("diff-ignored",60125),diffModified:h("diff-modified",60126),diffRemoved:h("diff-removed",60127),diffRenamed:h("diff-renamed",60128),diff:h("diff",60129),diffSidebyside:h("diff-sidebyside",60129),discard:h("discard",60130),editorLayout:h("editor-layout",60131),emptyWindow:h("empty-window",60132),exclude:h("exclude",60133),extensions:h("extensions",60134),eyeClosed:h("eye-closed",60135),fileBinary:h("file-binary",60136),fileCode:h("file-code",60137),fileMedia:h("file-media",60138),filePdf:h("file-pdf",60139),fileSubmodule:h("file-submodule",60140),fileSymlinkDirectory:h("file-symlink-directory",60141),fileSymlinkFile:h("file-symlink-file",60142),fileZip:h("file-zip",60143),files:h("files",60144),filter:h("filter",60145),flame:h("flame",60146),foldDown:h("fold-down",60147),foldUp:h("fold-up",60148),fold:h("fold",60149),folderActive:h("folder-active",60150),folderOpened:h("folder-opened",60151),gear:h("gear",60152),gift:h("gift",60153),gistSecret:h("gist-secret",60154),gist:h("gist",60155),gitCommit:h("git-commit",60156),gitCompare:h("git-compare",60157),compareChanges:h("compare-changes",60157),gitMerge:h("git-merge",60158),githubAction:h("github-action",60159),githubAlt:h("github-alt",60160),globe:h("globe",60161),grabber:h("grabber",60162),graph:h("graph",60163),gripper:h("gripper",60164),heart:h("heart",60165),home:h("home",60166),horizontalRule:h("horizontal-rule",60167),hubot:h("hubot",60168),inbox:h("inbox",60169),issueReopened:h("issue-reopened",60171),issues:h("issues",60172),italic:h("italic",60173),jersey:h("jersey",60174),json:h("json",60175),kebabVertical:h("kebab-vertical",60176),key:h("key",60177),law:h("law",60178),lightbulbAutofix:h("lightbulb-autofix",60179),linkExternal:h("link-external",60180),link:h("link",60181),listOrdered:h("list-ordered",60182),listUnordered:h("list-unordered",60183),liveShare:h("live-share",60184),loading:h("loading",60185),location:h("location",60186),mailRead:h("mail-read",60187),mail:h("mail",60188),markdown:h("markdown",60189),megaphone:h("megaphone",60190),mention:h("mention",60191),milestone:h("milestone",60192),gitPullRequestMilestone:h("git-pull-request-milestone",60192),mortarBoard:h("mortar-board",60193),move:h("move",60194),multipleWindows:h("multiple-windows",60195),mute:h("mute",60196),noNewline:h("no-newline",60197),note:h("note",60198),octoface:h("octoface",60199),openPreview:h("open-preview",60200),package:h("package",60201),paintcan:h("paintcan",60202),pin:h("pin",60203),play:h("play",60204),run:h("run",60204),plug:h("plug",60205),preserveCase:h("preserve-case",60206),preview:h("preview",60207),project:h("project",60208),pulse:h("pulse",60209),question:h("question",60210),quote:h("quote",60211),radioTower:h("radio-tower",60212),reactions:h("reactions",60213),references:h("references",60214),refresh:h("refresh",60215),regex:h("regex",60216),remoteExplorer:h("remote-explorer",60217),remote:h("remote",60218),remove:h("remove",60219),replaceAll:h("replace-all",60220),replace:h("replace",60221),repoClone:h("repo-clone",60222),repoForcePush:h("repo-force-push",60223),repoPull:h("repo-pull",60224),repoPush:h("repo-push",60225),report:h("report",60226),requestChanges:h("request-changes",60227),rocket:h("rocket",60228),rootFolderOpened:h("root-folder-opened",60229),rootFolder:h("root-folder",60230),rss:h("rss",60231),ruby:h("ruby",60232),saveAll:h("save-all",60233),saveAs:h("save-as",60234),save:h("save",60235),screenFull:h("screen-full",60236),screenNormal:h("screen-normal",60237),searchStop:h("search-stop",60238),server:h("server",60240),settingsGear:h("settings-gear",60241),settings:h("settings",60242),shield:h("shield",60243),smiley:h("smiley",60244),sortPrecedence:h("sort-precedence",60245),splitHorizontal:h("split-horizontal",60246),splitVertical:h("split-vertical",60247),squirrel:h("squirrel",60248),starFull:h("star-full",60249),starHalf:h("star-half",60250),symbolClass:h("symbol-class",60251),symbolColor:h("symbol-color",60252),symbolConstant:h("symbol-constant",60253),symbolEnumMember:h("symbol-enum-member",60254),symbolField:h("symbol-field",60255),symbolFile:h("symbol-file",60256),symbolInterface:h("symbol-interface",60257),symbolKeyword:h("symbol-keyword",60258),symbolMisc:h("symbol-misc",60259),symbolOperator:h("symbol-operator",60260),symbolProperty:h("symbol-property",60261),wrench:h("wrench",60261),wrenchSubaction:h("wrench-subaction",60261),symbolSnippet:h("symbol-snippet",60262),tasklist:h("tasklist",60263),telescope:h("telescope",60264),textSize:h("text-size",60265),threeBars:h("three-bars",60266),thumbsdown:h("thumbsdown",60267),thumbsup:h("thumbsup",60268),tools:h("tools",60269),triangleDown:h("triangle-down",60270),triangleLeft:h("triangle-left",60271),triangleRight:h("triangle-right",60272),triangleUp:h("triangle-up",60273),twitter:h("twitter",60274),unfold:h("unfold",60275),unlock:h("unlock",60276),unmute:h("unmute",60277),unverified:h("unverified",60278),verified:h("verified",60279),versions:h("versions",60280),vmActive:h("vm-active",60281),vmOutline:h("vm-outline",60282),vmRunning:h("vm-running",60283),watch:h("watch",60284),whitespace:h("whitespace",60285),wholeWord:h("whole-word",60286),window:h("window",60287),wordWrap:h("word-wrap",60288),zoomIn:h("zoom-in",60289),zoomOut:h("zoom-out",60290),listFilter:h("list-filter",60291),listFlat:h("list-flat",60292),listSelection:h("list-selection",60293),selection:h("selection",60293),listTree:h("list-tree",60294),debugBreakpointFunctionUnverified:h("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:h("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:h("debug-breakpoint-function-disabled",60296),debugStackframeActive:h("debug-stackframe-active",60297),circleSmallFilled:h("circle-small-filled",60298),debugStackframeDot:h("debug-stackframe-dot",60298),terminalDecorationMark:h("terminal-decoration-mark",60298),debugStackframe:h("debug-stackframe",60299),debugStackframeFocused:h("debug-stackframe-focused",60299),debugBreakpointUnsupported:h("debug-breakpoint-unsupported",60300),symbolString:h("symbol-string",60301),debugReverseContinue:h("debug-reverse-continue",60302),debugStepBack:h("debug-step-back",60303),debugRestartFrame:h("debug-restart-frame",60304),debugAlt:h("debug-alt",60305),callIncoming:h("call-incoming",60306),callOutgoing:h("call-outgoing",60307),menu:h("menu",60308),expandAll:h("expand-all",60309),feedback:h("feedback",60310),gitPullRequestReviewer:h("git-pull-request-reviewer",60310),groupByRefType:h("group-by-ref-type",60311),ungroupByRefType:h("ungroup-by-ref-type",60312),account:h("account",60313),gitPullRequestAssignee:h("git-pull-request-assignee",60313),bellDot:h("bell-dot",60314),debugConsole:h("debug-console",60315),library:h("library",60316),output:h("output",60317),runAll:h("run-all",60318),syncIgnored:h("sync-ignored",60319),pinned:h("pinned",60320),githubInverted:h("github-inverted",60321),serverProcess:h("server-process",60322),serverEnvironment:h("server-environment",60323),pass:h("pass",60324),issueClosed:h("issue-closed",60324),stopCircle:h("stop-circle",60325),playCircle:h("play-circle",60326),record:h("record",60327),debugAltSmall:h("debug-alt-small",60328),vmConnect:h("vm-connect",60329),cloud:h("cloud",60330),merge:h("merge",60331),export:h("export",60332),graphLeft:h("graph-left",60333),magnet:h("magnet",60334),notebook:h("notebook",60335),redo:h("redo",60336),checkAll:h("check-all",60337),pinnedDirty:h("pinned-dirty",60338),passFilled:h("pass-filled",60339),circleLargeFilled:h("circle-large-filled",60340),circleLarge:h("circle-large",60341),circleLargeOutline:h("circle-large-outline",60341),combine:h("combine",60342),gather:h("gather",60342),table:h("table",60343),variableGroup:h("variable-group",60344),typeHierarchy:h("type-hierarchy",60345),typeHierarchySub:h("type-hierarchy-sub",60346),typeHierarchySuper:h("type-hierarchy-super",60347),gitPullRequestCreate:h("git-pull-request-create",60348),runAbove:h("run-above",60349),runBelow:h("run-below",60350),notebookTemplate:h("notebook-template",60351),debugRerun:h("debug-rerun",60352),workspaceTrusted:h("workspace-trusted",60353),workspaceUntrusted:h("workspace-untrusted",60354),workspaceUnknown:h("workspace-unknown",60355),terminalCmd:h("terminal-cmd",60356),terminalDebian:h("terminal-debian",60357),terminalLinux:h("terminal-linux",60358),terminalPowershell:h("terminal-powershell",60359),terminalTmux:h("terminal-tmux",60360),terminalUbuntu:h("terminal-ubuntu",60361),terminalBash:h("terminal-bash",60362),arrowSwap:h("arrow-swap",60363),copy:h("copy",60364),personAdd:h("person-add",60365),filterFilled:h("filter-filled",60366),wand:h("wand",60367),debugLineByLine:h("debug-line-by-line",60368),inspect:h("inspect",60369),layers:h("layers",60370),layersDot:h("layers-dot",60371),layersActive:h("layers-active",60372),compass:h("compass",60373),compassDot:h("compass-dot",60374),compassActive:h("compass-active",60375),azure:h("azure",60376),issueDraft:h("issue-draft",60377),gitPullRequestClosed:h("git-pull-request-closed",60378),gitPullRequestDraft:h("git-pull-request-draft",60379),debugAll:h("debug-all",60380),debugCoverage:h("debug-coverage",60381),runErrors:h("run-errors",60382),folderLibrary:h("folder-library",60383),debugContinueSmall:h("debug-continue-small",60384),beakerStop:h("beaker-stop",60385),graphLine:h("graph-line",60386),graphScatter:h("graph-scatter",60387),pieChart:h("pie-chart",60388),bracket:h("bracket",60175),bracketDot:h("bracket-dot",60389),bracketError:h("bracket-error",60390),lockSmall:h("lock-small",60391),azureDevops:h("azure-devops",60392),verifiedFilled:h("verified-filled",60393),newline:h("newline",60394),layout:h("layout",60395),layoutActivitybarLeft:h("layout-activitybar-left",60396),layoutActivitybarRight:h("layout-activitybar-right",60397),layoutPanelLeft:h("layout-panel-left",60398),layoutPanelCenter:h("layout-panel-center",60399),layoutPanelJustify:h("layout-panel-justify",60400),layoutPanelRight:h("layout-panel-right",60401),layoutPanel:h("layout-panel",60402),layoutSidebarLeft:h("layout-sidebar-left",60403),layoutSidebarRight:h("layout-sidebar-right",60404),layoutStatusbar:h("layout-statusbar",60405),layoutMenubar:h("layout-menubar",60406),layoutCentered:h("layout-centered",60407),target:h("target",60408),indent:h("indent",60409),recordSmall:h("record-small",60410),errorSmall:h("error-small",60411),terminalDecorationError:h("terminal-decoration-error",60411),arrowCircleDown:h("arrow-circle-down",60412),arrowCircleLeft:h("arrow-circle-left",60413),arrowCircleRight:h("arrow-circle-right",60414),arrowCircleUp:h("arrow-circle-up",60415),layoutSidebarRightOff:h("layout-sidebar-right-off",60416),layoutPanelOff:h("layout-panel-off",60417),layoutSidebarLeftOff:h("layout-sidebar-left-off",60418),blank:h("blank",60419),heartFilled:h("heart-filled",60420),map:h("map",60421),mapHorizontal:h("map-horizontal",60421),foldHorizontal:h("fold-horizontal",60421),mapFilled:h("map-filled",60422),mapHorizontalFilled:h("map-horizontal-filled",60422),foldHorizontalFilled:h("fold-horizontal-filled",60422),circleSmall:h("circle-small",60423),bellSlash:h("bell-slash",60424),bellSlashDot:h("bell-slash-dot",60425),commentUnresolved:h("comment-unresolved",60426),gitPullRequestGoToChanges:h("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:h("git-pull-request-new-changes",60428),searchFuzzy:h("search-fuzzy",60429),commentDraft:h("comment-draft",60430),send:h("send",60431),sparkle:h("sparkle",60432),insert:h("insert",60433),mic:h("mic",60434),thumbsdownFilled:h("thumbsdown-filled",60435),thumbsupFilled:h("thumbsup-filled",60436),coffee:h("coffee",60437),snake:h("snake",60438),game:h("game",60439),vr:h("vr",60440),chip:h("chip",60441),piano:h("piano",60442),music:h("music",60443),micFilled:h("mic-filled",60444),repoFetch:h("repo-fetch",60445),copilot:h("copilot",60446),lightbulbSparkle:h("lightbulb-sparkle",60447),robot:h("robot",60448),sparkleFilled:h("sparkle-filled",60449),diffSingle:h("diff-single",60450),diffMultiple:h("diff-multiple",60451),surroundWith:h("surround-with",60452),share:h("share",60453),gitStash:h("git-stash",60454),gitStashApply:h("git-stash-apply",60455),gitStashPop:h("git-stash-pop",60456),vscode:h("vscode",60457),vscodeInsiders:h("vscode-insiders",60458),codeOss:h("code-oss",60459),runCoverage:h("run-coverage",60460),runAllCoverage:h("run-all-coverage",60461),coverage:h("coverage",60462),githubProject:h("github-project",60463),mapVertical:h("map-vertical",60464),foldVertical:h("fold-vertical",60464),mapVerticalFilled:h("map-vertical-filled",60465),foldVerticalFilled:h("fold-vertical-filled",60465),goToSearch:h("go-to-search",60466),percentage:h("percentage",60467),sortPercentage:h("sort-percentage",60467),attach:h("attach",60468),goToEditingSession:h("go-to-editing-session",60469),editSession:h("edit-session",60470),codeReview:h("code-review",60471),copilotWarning:h("copilot-warning",60472),python:h("python",60473),copilotLarge:h("copilot-large",60474),copilotWarningLarge:h("copilot-warning-large",60475),keyboardTab:h("keyboard-tab",60476),copilotBlocked:h("copilot-blocked",60477),copilotNotConnected:h("copilot-not-connected",60478),flag:h("flag",60479),lightbulbEmpty:h("lightbulb-empty",60480),symbolMethodArrow:h("symbol-method-arrow",60481),copilotUnavailable:h("copilot-unavailable",60482),repoPinned:h("repo-pinned",60483),keyboardTabAbove:h("keyboard-tab-above",60484),keyboardTabBelow:h("keyboard-tab-below",60485),gitPullRequestDone:h("git-pull-request-done",60486),mcp:h("mcp",60487),extensionsLarge:h("extensions-large",60488),layoutPanelDock:h("layout-panel-dock",60489),layoutSidebarLeftDock:h("layout-sidebar-left-dock",60490),layoutSidebarRightDock:h("layout-sidebar-right-dock",60491)},y2={dialogError:h("dialog-error","error"),dialogWarning:h("dialog-warning","warning"),dialogInfo:h("dialog-info","info"),dialogClose:h("dialog-close","close"),treeItemExpanded:h("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:h("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:h("tree-filter-on-type-off","list-selection"),treeFilterClear:h("tree-filter-clear","close"),treeItemLoading:h("tree-item-loading","loading"),menuSelection:h("menu-selection","check"),menuSubmenu:h("menu-submenu","chevron-right"),menuBarMore:h("menubar-more","more"),scrollbarButtonLeft:h("scrollbar-button-left","triangle-left"),scrollbarButtonRight:h("scrollbar-button-right","triangle-right"),scrollbarButtonUp:h("scrollbar-button-up","triangle-up"),scrollbarButtonDown:h("scrollbar-button-down","triangle-down"),toolBarMore:h("toolbar-more","more"),quickInputBack:h("quick-input-back","arrow-left"),dropDownButton:h("drop-down-button",60084),symbolCustomColor:h("symbol-customcolor",60252),exportIcon:h("export",60332),workspaceUnspecified:h("workspace-unspecified",60355),newLine:h("newline",60394),thumbsDownFilled:h("thumbsdown-filled",60435),thumbsUpFilled:h("thumbsup-filled",60436),gitFetch:h("git-fetch",60445),lightbulbSparkleAutofix:h("lightbulb-sparkle-autofix",60447),debugBreakpointPending:h("debug-breakpoint-pending",60377)},b2={...v2,...y2},Qa;(function(t){function e(i){return!!i&&typeof i=="object"&&typeof i.id=="string"}t.isThemeColor=e})(Qa||(Qa={}));var vr;(function(t){t.iconNameSegment="[A-Za-z0-9]+",t.iconNameExpression="[A-Za-z0-9-]+",t.iconModifierExpression="~[A-Za-z]+",t.iconNameCharacter="[A-Za-z0-9~-]";const e=new RegExp(`^(${t.iconNameExpression})(${t.iconModifierExpression})?$`);function i(d){const p=e.exec(d.id);if(!p)return i(b2.error);const[,m,w]=p,y=["codicon","codicon-"+m];return w&&y.push("codicon-modifier-"+w.substring(1)),y}t.asClassNameArray=i;function s(d){return i(d).join(" ")}t.asClassName=s;function r(d){return"."+i(d).join(".")}t.asCSSSelector=r;function n(d){return!!d&&typeof d=="object"&&typeof d.id=="string"&&(typeof d.color>"u"||Qa.isThemeColor(d.color))}t.isThemeIcon=n;const o=new RegExp(`^\\$\\((${t.iconNameExpression}(?:${t.iconModifierExpression})?)\\)$`);function a(d){const p=o.exec(d);if(!p)return;const[,m]=p;return{id:m}}t.fromString=a;function l(d){return{id:d}}t.fromId=l;function c(d,p){let m=d.id;const w=m.lastIndexOf("~");return w!==-1&&(m=m.substring(0,w)),p&&(m=`${m}~${p}`),{id:m}}t.modify=c;function u(d){const p=d.id.lastIndexOf("~");if(p!==-1)return d.id.substring(p+1)}t.getModifier=u;function f(d,p){return d.id===p.id&&d.color?.id===p.color?.id}t.isEqual=f})(vr||(vr={}));var Za=new RegExp(`\\$\\(${vr.iconNameExpression}(?:${vr.iconModifierExpression})?\\)`,"g"),E2=new RegExp(`(\\\\)?${Za.source}`,"g");function x2(t){return t.replace(E2,(e,i)=>i?e:`\\${e}`)}var aw=new RegExp(`\\\\${Za.source}`,"g"),lw=new RegExp(`(\\s)?(\\\\)?${Za.source}(\\s)?`,"g"),cw=new RegExp(`\\$\\(${vr.iconNameCharacter}+\\)`,"g"),_f;(function(t){t[t.Paragraph=0]="Paragraph",t[t.Break=1]="Break"})(_f||(_f={}));var Wi=class ad{static lift(e){const i=new ad(e.value,e);return i.uris=e.uris,i.baseUri=e.baseUri?k.revive(e.baseUri):void 0,i}constructor(e="",i=!1){if(this.value=e,typeof this.value!="string")throw Ad("value");typeof i=="boolean"?(this.isTrusted=i,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=i.isTrusted??void 0,this.supportThemeIcons=i.supportThemeIcons??!1,this.supportHtml=i.supportHtml??!1)}appendText(e,i=0){return this.value+=S2(this.supportThemeIcons?x2(e):e).replace(/([ \t]+)/g,(s,r)=>"&nbsp;".repeat(r.length)).replace(/\>/gm,"\\>").replace(/\n/g,i===1?`\\
`:`

`),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,i){return this.value+=`
${$2(i,e)}
`,this}appendLink(e,i,s){return this.value+="[",this.value+=this.c(i,"]"),this.value+="](",this.value+=this.c(String(e),")"),s&&(this.value+=` "${this.c(this.c(s,'"'),")")}"`),this.value+=")",this}c(e,i){const s=new RegExp(ls(i),"g");return e.replace(s,(r,n)=>e.charAt(n-1)!=="\\"?`\\${r}`:r)}};function S2(t){return t.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}function $2(t,e){const i=t.match(/^`+/gm)?.reduce((r,n)=>r.length>n.length?r:n).length??0,s=i>=3?i+1:3;return[`${"`".repeat(s)}${e}`,t,`${"`".repeat(s)}`].join(`
`)}var Xa=class extends J{constructor(e,i){super(),this.g=e,this.h=i,this.preferPreReleases=this.g.quality!=="stable"}async canInstall(e){const i=this.h.isAllowed({id:e.identifier.id,publisherDisplayName:e.publisherDisplayName});if(i!==!0)return new Wi(g(1895,null,i.value));if(!await this.j(e)){const s=$t?"https://aka.ms/vscode-web-extensions-guide":"https://aka.ms/vscode-platform-specific-extensions";return new Wi(`${g(1896,null,e.displayName??e.identifier.id,this.g.nameLong,bh(await this.getTargetPlatform()))} [${g(1897,null)}](${s})`)}return!0}async j(e){const i=await this.getTargetPlatform();return e.allTargetPlatforms.some(s=>xh(s,e.allTargetPlatforms,i))}};Xa=__decorate([__param(0,gt),__param(1,zi)],Xa);var Ka=class extends Xa{get onInstallExtension(){return this.u.event}get onDidInstallExtensions(){return this.w.event}get onUninstallExtension(){return this.y.event}get onDidUninstallExtension(){return this.z.event}get onDidUpdateExtensionMetadata(){return this.C.event}constructor(e,i,s,r,n,o,a){super(n,o),this.F=e,this.G=i,this.H=s,this.I=r,this.J=a,this.n=0,this.s=new Map,this.t=new Map,this.u=this.B(new N),this.w=this.B(new N),this.y=this.B(new N),this.z=this.B(new N),this.C=this.B(new N),this.D=[],this.B(Se(()=>{this.s.forEach(({task:l})=>l.cancel()),this.t.forEach(l=>l.cancel()),this.s.clear(),this.t.clear()}))}async installFromGallery(e,i={}){try{const r=(await this.installGalleryExtensions([{extension:e,options:i}])).find(({identifier:n})=>Q(n,e.identifier));if(r?.local)return r?.local;throw r?.error?r.error:new be(`Unknown error while installing extension ${e.identifier.id}`,"Unknown")}catch(s){throw De(s)}}async installGalleryExtensions(e){if(!this.F.isEnabled())throw new be(g(1898,null),"NotAllowed");const i=[],s=[];return await Promise.allSettled(e.map(async({extension:r,options:n})=>{try{const o=await this.Q(r,!!n?.installGivenVersion,!!n?.installPreReleaseVersion,n.productVersion??{version:this.g.version,date:this.g.date});s.push({...o,options:n})}catch(o){i.push({identifier:r.identifier,operation:2,source:r,error:o,profileLocation:n.profileLocation??this.Z()})}})),s.length&&i.push(...await this.L(s)),i}async uninstall(e,i){return this.I.trace("ExtensionManagementService#uninstall",e.identifier.id),this.uninstallExtensions([{extension:e,options:i}])}async toggleApplicationScope(e,i){if(Ch(e.manifest)||e.isBuiltin)return e;if(e.isApplicationScoped){let s=await this.updateMetadata(e,{isApplicationScoped:!1},this.J.defaultProfile.extensionsResource);this.H.extUri.isEqual(i,this.J.defaultProfile.extensionsResource)||(s=await this.bb(e,this.J.defaultProfile.extensionsResource,i));for(const r of this.J.profiles){const n=(await this.getInstalled(1,r.extensionsResource)).find(o=>Q(o.identifier,e.identifier));n?this.C.fire({local:n,profileLocation:r.extensionsResource}):this.z.fire({identifier:e.identifier,profileLocation:r.extensionsResource})}return s}else{const s=this.H.extUri.isEqual(i,this.J.defaultProfile.extensionsResource)?await this.updateMetadata(e,{isApplicationScoped:!0},this.J.defaultProfile.extensionsResource):await this.bb(e,i,this.J.defaultProfile.extensionsResource,{isApplicationScoped:!0});return this.w.fire([{identifier:s.identifier,operation:2,local:s,profileLocation:this.J.defaultProfile.extensionsResource,applicationScoped:!0}]),s}}getExtensionsControlManifest(){const e=new Date().getTime();return(!this.m||e-this.n>1e3*60*5)&&(this.m=this.Y(),this.n=e),this.m}registerParticipant(e){this.D.push(e)}async resetPinnedStateForAllUserExtensions(e){try{await this.O(this.J.profiles.map(async i=>{const s=await this.getInstalled(1,i.extensionsResource);await this.O(s.map(async r=>{r.pinned!==e&&await this.updateMetadata(r,{pinned:e},i.extensionsResource)}))}))}catch(i){throw this.I.error("Error while resetting pinned state for all user extensions",G(i)),i}}async L(e){const i=new Map,s=new Map,r=[],n=(l,c)=>`${pt.create(l).toString()}-${c.toString()}`,o=(l,c,u,f)=>{if(!k.isUri(c)){if(s.has(`${c.identifier.id.toLowerCase()}-${u.profileLocation.toString()}`))return;const m=this.s.get(n(c,u.profileLocation));if(m){if(f&&this.N(f,m.task)){const w=m.task.identifier;this.I.info("Waiting for already requested installing extension",w.id,f.identifier.id,u.profileLocation.toString()),m.waitingTasks.push(f),r.push(oe.toPromise(oe.filter(this.onDidInstallExtensions,y=>y.some(b=>Q(b.identifier,w)))).then(y=>{if(this.I.info("Finished waiting for already requested installing extension",w.id,f.identifier.id,u.profileLocation.toString()),!y.find(S=>Q(S.identifier,w))?.local)throw new Error(`Extension ${w.id} is not installed`)}))}return}}const d=this.$(l,c,u),p=`${Ut(l.publisher,l.name)}-${u.profileLocation.toString()}`;s.set(p,{task:d,root:f}),this.u.fire({identifier:d.identifier,source:c,profileLocation:u.profileLocation}),this.I.info("Installing extension:",d.identifier.id,u),k.isUri(c)||this.s.set(n(c,u.profileLocation),{task:d,waitingTasks:[]})};try{for(const{manifest:c,extension:u,options:f}of e){const d=f.isApplicationScoped||f.isBuiltin||Ch(c),p={...f,isApplicationScoped:d,profileLocation:d?this.J.defaultProfile.extensionsResource:f.profileLocation??this.Z(),productVersion:f.productVersion??{version:this.g.version,date:this.g.date}},m=k.isUri(u)?void 0:this.s.get(n(u,p.profileLocation));m?(this.I.info("Extension is already requested to install",m.task.identifier.id,p.profileLocation.toString()),r.push(m.task.waitUntilTaskIsFinished())):o(c,u,p,void 0)}await Promise.all([...s.values()].map(async({task:c})=>{if(c.options.donotIncludePackAndDependencies)this.I.info("Installing the extension without checking dependencies and pack",c.identifier.id);else try{let u=this.preferPreReleases;c.options.installPreReleaseVersion?u=!0:!k.isUri(c.source)&&c.source.hasPreReleaseVersion&&(u=!1);const f=await this.getInstalled(void 0,c.options.profileLocation,c.options.productVersion),d=await this.P(c.identifier,c.manifest,u,c.options.productVersion,f),p={...c.options,pinned:!1,installGivenVersion:!1,context:{...c.options.context,[y4]:!0}};for(const{gallery:m,manifest:w}of Yt(d,({gallery:y})=>y.identifier.id)){const y=f.find(b=>Q(b.identifier,m.identifier));y&&y.isApplicationScoped===!!p.isApplicationScoped||o(w,m,p,c)}}catch(u){if(k.isUri(c.source))tc(c.manifest.extensionDependencies)&&this.I.warn("Cannot install dependencies of extension:",c.identifier.id,u.message),tc(c.manifest.extensionPack)&&this.I.warn("Cannot install packed extensions of extension:",c.identifier.id,u.message);else throw this.I.error("Error while preparing to install dependencies and extension packs of the extension:",c.identifier.id),u}}));const l=await this.M([...s.values()].map(({task:c})=>c));for(const[c,u]of l)o(u.manifest,u.source,{...u.options,profileLocation:c},void 0);await this.O([...s.entries()].map(async([c,{task:u}])=>{const f=new Date().getTime();let d;try{d=await u.run(),await this.O(this.D.map(p=>p.postInstall(d,u.source,u.options,pe.None)),"PostInstall")}catch(p){const m=De(p);throw k.isUri(u.source)||Ya(this.G,u.operation===3?"extensionGallery:update":"extensionGallery:install",{extensionData:xa(u.source),error:m,source:u.options.context?.[vh]}),i.set(c,{error:m,identifier:u.identifier,operation:u.operation,source:u.source,context:u.options.context,profileLocation:u.options.profileLocation,applicationScoped:u.options.isApplicationScoped}),this.I.error("Error while installing the extension",u.identifier.id,G(m),u.options.profileLocation.toString()),m}if(!k.isUri(u.source)){const p=u.operation===3,m=p?void 0:(new Date().getTime()-u.source.lastUpdated)/1e3;if(Ya(this.G,p?"extensionGallery:update":"extensionGallery:install",{extensionData:xa(u.source),verificationStatus:u.verificationStatus,duration:new Date().getTime()-f,durationSinceUpdate:m,source:u.options.context?.[vh]}),$t&&u.operation!==3)try{await this.F.reportStatistic(d.manifest.publisher,d.manifest.name,d.manifest.version,"install")}catch{}}i.set(c,{local:d,identifier:u.identifier,operation:u.operation,source:u.source,context:u.options.context,profileLocation:u.options.profileLocation,applicationScoped:d.isApplicationScoped})})),r.length&&await this.O(r)}catch(l){const c=(d,p,m)=>{const w=[];d.manifest.extensionDependencies?.length&&w.push(...d.manifest.extensionDependencies),d.manifest.extensionPack?.length&&w.push(...d.manifest.extensionPack);for(const y of w){if(m.includes(y.toLowerCase()))continue;m.push(y.toLowerCase());const b=i.get(`${y.toLowerCase()}-${p.toString()}`);b?.local&&(m=c(b.local,p,m))}return m},u=d=>({identifier:d.identifier,operation:2,source:d.source,context:d.options.context,profileLocation:d.options.profileLocation,error:l}),f=[];for(const[d,{task:p,root:m}]of s){const w=i.get(d);w?w.local&&m&&!i.get(`${m.identifier.id.toLowerCase()}-${p.options.profileLocation.toString()}`)?.local&&(f.push(this.ab(w.local,{versionOnly:!0,profileLocation:p.options.profileLocation})),i.set(d,u(p))):(p.cancel(),i.set(d,u(p)))}for(const[d,{task:p}]of s){const m=i.get(d);if(!m?.local||p.options.donotIncludePackAndDependencies)continue;c(m.local,p.options.profileLocation,[m.local.identifier.id.toLowerCase()]).slice(1).some(y=>s.has(`${y.toLowerCase()}-${p.options.profileLocation.toString()}`)&&!i.get(`${y.toLowerCase()}-${p.options.profileLocation.toString()}`)?.local)&&(f.push(this.ab(m.local,{versionOnly:!0,profileLocation:p.options.profileLocation})),i.set(d,u(p)))}f.length&&await Promise.allSettled(f.map(async d=>{try{await d.run(),this.I.info("Rollback: Uninstalled extension",d.extension.identifier.id)}catch(p){this.I.warn("Rollback: Error while uninstalling extension",d.extension.identifier.id,G(p))}}))}finally{for(const{task:l}of s.values())l.source&&!k.isUri(l.source)&&this.s.delete(n(l.source,l.options.profileLocation))}const a=[...i.values()];for(const l of a)l.local&&this.I.info("Extension installed successfully:",l.identifier.id,l.profileLocation.toString());return this.w.fire(a),a}async M(e){const i=[],s=new Je;for(const r of e)if(!(r.operation!==3||r.options.isApplicationScoped||r.options.pinned||r.options.installGivenVersion||k.isUri(r.source)))for(const n of this.J.profiles){if(this.H.extUri.isEqual(n.extensionsResource,r.options.profileLocation))continue;let o=s.get(n.extensionsResource);o||(o=await this.getInstalled(1,n.extensionsResource),s.set(n.extensionsResource,o));const a=o.find(l=>Q(l.identifier,r.identifier));a&&!a.pinned&&i.push([n.extensionsResource,r])}return i}N(e,i){for(const[,{task:s,waitingTasks:r}]of this.s.entries())if(s===e&&(r.includes(i)||r.some(n=>this.N(n,i)))||s===i&&r[0]&&!this.N(e,r[0]))return!1;return!0}async O(e,i){const s=[],r=[],n=await Promise.allSettled(e);for(const a of n)a.status==="fulfilled"?s.push(a.value):r.push(De(a.reason,i));if(!r.length)return s;if(r.length===1)throw r[0];let o=new be("","Unknown");for(const a of r)o=new be(o.message?`${o.message}, ${a.message}`:a.message,a.code!=="Unknown"&&a.code!=="Internal"?a.code:o.code);throw o}async P(e,i,s,r,n){if(!this.F.isEnabled())return[];const o=[],a=[],l=async(c,u)=>{o.push(c);const f=u.extensionDependencies||[],d=[...f];if(u.extensionPack){const p=n.find(m=>Q(m.identifier,c));for(const m of u.extensionPack)p&&p.manifest.extensionPack&&p.manifest.extensionPack.some(w=>Q({id:w},{id:m}))||d.every(w=>!Q({id:w},{id:m}))&&d.push(m)}if(d.length){const p=d.filter(m=>o.every(w=>!Q(w,{id:m})));if(p.length){const m=await this.F.getExtensions(p.map(w=>({id:w,preRelease:s})),pe.None);for(const w of m){if(o.find(S=>Q(S,w.identifier)))continue;const y=f.some(S=>Q({id:S},w.identifier));let b;try{b=await this.Q(w,!1,s,r)}catch(S){if(y)throw S;this.I.info("Skipping the packed extension as it cannot be installed",w.identifier.id,G(S));continue}a.push({gallery:b.extension,manifest:b.manifest}),await l(b.extension.identifier,b.manifest)}}}};return await l(e,i),a}async Q(e,i,s,r){let n;const o=await this.getExtensionsControlManifest();if(Y4(e.identifier,o.malicious))throw new be(g(1899,null,e.identifier.id),"Malicious");const a=o.deprecated[e.identifier.id.toLowerCase()];if(a?.extension?.autoMigrate){if(this.I.info(`The '${e.identifier.id}' extension is deprecated, fetching the compatible '${a.extension.id}' extension instead.`),n=(await this.F.getExtensions([{id:a.extension.id,preRelease:a.extension.preRelease}],{targetPlatform:await this.getTargetPlatform(),compatible:!0,productVersion:r},pe.None))[0],!n)throw new be(g(1900,null,e.identifier.id,a.extension.id),"Deprecated")}else{if(await this.canInstall(e)!==!0){const c=await this.getTargetPlatform();throw new be(g(1901,null,e.identifier.id,this.g.nameLong,bh(c)),"IncompatibleTargetPlatform")}if(n=await this.R(e,i,s,r),!n){const c=[];throw ka(e.properties.enabledApiProposals??[],c)?!s&&e.hasPreReleaseVersion&&e.properties.isPreReleaseVersion&&(await this.F.getExtensions([e.identifier],pe.None))[0]?new be(g(1903,null,e.displayName??e.identifier.id),"ReleaseVersionNotFound"):new be(g(1904,null,e.identifier.id,this.g.nameLong,this.g.version),"Incompatible"):new be(g(1902,null,e.displayName??e.identifier.id,c[0]),"IncompatibleApi")}}this.I.info("Getting Manifest...",n.identifier.id);const l=await this.F.getManifest(n,pe.None);if(l===null)throw new be(`Missing manifest for extension ${n.identifier.id}`,"Invalid");if(l.version!==n.version)throw new be(`Cannot install '${n.identifier.id}' extension because of version mismatch in Marketplace`,"Invalid");return{extension:n,manifest:l}}async R(e,i,s,r){const n=await this.getTargetPlatform();let o=null;return!i&&e.hasPreReleaseVersion&&e.properties.isPreReleaseVersion!==s&&(o=(await this.F.getExtensions([{...e.identifier,preRelease:s}],{targetPlatform:n,compatible:!0,productVersion:r},pe.None))[0]||null),!o&&await this.F.isExtensionCompatible(e,s,n,r)&&(o=e),o||(i?o=(await this.F.getExtensions([{...e.identifier,version:e.version}],{targetPlatform:n,compatible:!0,productVersion:r},pe.None))[0]||null:o=await this.F.getCompatibleExtension(e,s,n,r)),o}async uninstallExtensions(e){const i=(f,d)=>`${f.identifier.id.toLowerCase()}${d.versionOnly?`-${f.manifest.version}`:""}@${d.profileLocation.toString()}`,s=(f,d)=>{const p=this.ab(f,d);return this.t.set(i(p.extension,d),p),this.I.info("Uninstalling extension from the profile:",`${f.identifier.id}@${f.manifest.version}`,d.profileLocation.toString()),this.y.fire({identifier:f.identifier,profileLocation:d.profileLocation,applicationScoped:f.isApplicationScoped}),p},r=(f,d,p)=>{p?this.I.error("Failed to uninstall extension from the profile:",`${f.identifier.id}@${f.manifest.version}`,d.profileLocation.toString(),p.message):this.I.info("Successfully uninstalled extension from the profile",`${f.identifier.id}@${f.manifest.version}`,d.profileLocation.toString()),Ya(this.G,"extensionGallery:uninstall",{extensionData:X4(f),error:p}),this.z.fire({identifier:f.identifier,error:p?.code,profileLocation:d.profileLocation,applicationScoped:f.isApplicationScoped})},n=[],o=[],a=[],l=[],c=new Je,u=async f=>{let d=c.get(f);return d||c.set(f,d=await this.getInstalled(1,f)),d};for(const{extension:f,options:d}of e){const p={...d,profileLocation:f.isApplicationScoped?this.J.defaultProfile.extensionsResource:d?.profileLocation??this.Z()},m=this.t.get(i(f,p));if(m?(this.I.info("Extensions is already requested to uninstall",f.identifier.id),a.push(m.waitUntilTaskIsFinished())):n.push(s(f,p)),p.remove||f.isApplicationScoped){p.remove&&l.push(f);for(const w of this.J.profiles){if(this.H.extUri.isEqual(w.extensionsResource,p.profileLocation))continue;const b=(await u(w.extensionsResource)).find(S=>Q(S.identifier,f.identifier));if(b){const S={...p,profileLocation:w.extensionsResource},I=this.t.get(i(b,S));I?(this.I.info("Extensions is already requested to uninstall",b.identifier.id),a.push(I.waitUntilTaskIsFinished())):n.push(s(b,S))}}}}try{for(const f of n.slice(0)){const d=await u(f.options.profileLocation);if(f.options.donotIncludePack)this.I.info("Uninstalling the extension without including packed extension",`${f.extension.identifier.id}@${f.extension.manifest.version}`);else{const p=this.W(f.extension,d);for(const m of p)this.t.has(i(m,f.options))?this.I.info("Extensions is already requested to uninstall",m.identifier.id):n.push(s(m,f.options))}f.options.donotCheckDependents?this.I.info("Uninstalling the extension without checking dependents",`${f.extension.identifier.id}@${f.extension.manifest.version}`):this.S(n.map(p=>p.extension),d,f.extension)}await this.O(n.map(async f=>{try{if(await f.run(),await this.O(this.D.map(d=>d.postUninstall(f.extension,f.options,pe.None))),f.extension.identifier.uuid)try{await this.F.reportStatistic(f.extension.manifest.publisher,f.extension.manifest.name,f.extension.manifest.version,"uninstall")}catch{}}catch(d){const p=De(d);throw r(f.extension,f.options,p),p}finally{o.push(f)}})),a.length&&await this.O(a);for(const f of n)r(f.extension,f.options);l.length&&await this.O(l.map(f=>this.eb(f)))}catch(f){const d=De(f);for(const p of n){try{p.cancel()}catch{}o.includes(p)||r(p.extension,p.options,d)}throw d}finally{for(const f of n)this.t.delete(i(f.extension,f.options))||this.I.warn("Uninstallation task is not found in the cache",f.extension.identifier.id)}}S(e,i,s){for(const r of e){const n=this.X(r,i);if(n.length){const o=n.filter(a=>!e.some(l=>Q(l.identifier,a.identifier)));if(o.length)throw new Error(this.U(r,o,s))}}}U(e,i,s){return s===e?i.length===1?g(1905,null,s.manifest.displayName||s.manifest.name,i[0].manifest.displayName||i[0].manifest.name):i.length===2?g(1906,null,s.manifest.displayName||s.manifest.name,i[0].manifest.displayName||i[0].manifest.name,i[1].manifest.displayName||i[1].manifest.name):g(1907,null,s.manifest.displayName||s.manifest.name,i[0].manifest.displayName||i[0].manifest.name,i[1].manifest.displayName||i[1].manifest.name):i.length===1?g(1908,null,s.manifest.displayName||s.manifest.name,e.manifest.displayName||e.manifest.name,i[0].manifest.displayName||i[0].manifest.name):i.length===2?g(1909,null,s.manifest.displayName||s.manifest.name,e.manifest.displayName||e.manifest.name,i[0].manifest.displayName||i[0].manifest.name,i[1].manifest.displayName||i[1].manifest.name):g(1910,null,s.manifest.displayName||s.manifest.name,e.manifest.displayName||e.manifest.name,i[0].manifest.displayName||i[0].manifest.name,i[1].manifest.displayName||i[1].manifest.name)}W(e,i,s=[]){if(s.indexOf(e)!==-1)return[];s.push(e);const r=e.manifest.extensionPack?e.manifest.extensionPack:[];if(r.length){const n=i.filter(a=>!a.isBuiltin&&r.some(l=>Q({id:l},a.identifier))),o=[];for(const a of n)o.push(...this.W(a,i,s));return[...n,...o]}return[]}X(e,i){return i.filter(s=>s.manifest.extensionDependencies&&s.manifest.extensionDependencies.some(r=>Q({id:r},e.identifier)))}async Y(){try{return this.I.trace("ExtensionManagementService.updateControlCache"),await this.F.getExtensionsControlManifest()}catch(e){return this.I.trace("ExtensionManagementService.refreshControlCache - failed to get extension control manifest",G(e)),{malicious:[],deprecated:{},search:[]}}}};Ka=__decorate([__param(0,bi),__param(1,Ht),__param(2,ze),__param(3,he),__param(4,gt),__param(5,zi),__param(6,jt)],Ka);function De(t,e){if(t instanceof be)return t;let i;return t instanceof Pn?i=new be(t.message,t.code==="DownloadFailedWriting"?"DownloadFailedWriting":"Gallery"):i=new be(t.message,Di(t)?"Cancelled":e??"Internal"),i.stack=t.stack,i}function Ya(t,e,{extensionData:i,verificationStatus:s,duration:r,error:n,source:o,durationSinceUpdate:a}){t.publicLog(e,{...i,source:o,duration:r,durationSinceUpdate:a,success:!n,errorcode:n?.code,verificationStatus:s===Fe.Success?"Verified":s??"Unverified"})}var Vf=class{constructor(){this.d=new ou}async waitUntilTaskIsFinished(){return await this.d.wait(),this.g}run(){return this.g||(this.g=ni(t=>this.h(t))),this.d.open(),this.g}cancel(){this.g||(this.g=ni(t=>new Promise((e,i)=>{const s=t.onCancellationRequested(()=>{s.dispose(),i(new Te)})})),this.d.open()),this.g.cancel()}};function el(t){let e="Extract";return t instanceof Vn&&(t.type==="CorruptZip"?e="CorruptZip":t.type==="Incomplete"&&(e="IncompleteZip")),De(t,e)}async function tl(t){let e;try{e=await Pf(t,"extension/package.json")}catch(i){throw el(i)}try{return JSON.parse(e.toString("utf8"))}catch{throw new be(g(1985,null),"Invalid")}}var qn,il=class extends J{static{qn=this}static{this.c=".sigzip"}constructor(e,i,s,r,n,o,a){super(),this.j=i,this.m=s,this.n=r,this.r=n,this.t=o,this.u=a,this.extensionsDownloadDir=e.extensionsDownloadLocation,this.f=o.extUri.joinPath(e.extensionsDownloadLocation,".trash"),this.g=20,this.h=this.F()}async download(e,i,s,r){await this.h;const n=await this.w(e,i);if(!s)return{location:n,verificationStatus:void 0};if(!e.isSigned)return{location:n,verificationStatus:Fe.NotSigned};let o;try{o=await this.y(e);const a=(await this.n.verify(e.identifier.id,e.version,n.fsPath,o.fsPath,r))?.code;if(a===Fe.PackageIsInvalidZip||a===Fe.SignatureArchiveIsInvalidZip){try{await this.delete(n)}catch(l){this.u.error(l)}throw new be(Ef,"CorruptZip")}return{location:n,verificationStatus:a}}catch(a){try{await this.delete(n)}catch(l){this.u.error(l)}throw a}finally{if(o)try{await this.delete(o)}catch(a){this.u.error(a)}}}async w(e,i){try{const s=W(this.extensionsDownloadDir,this.G(e)),r=await this.C(e,"vsix",async()=>{await this.z(e,s,n=>this.m.download(e,n,i));try{await this.D(s.fsPath,"extension/package.json")}catch(n){try{await this.j.del(s)}catch(o){this.u.warn(`Error while deleting: ${s.path}`,G(o))}throw n}},2);return r>1&&this.r.publicLog2("extensiongallery:downloadvsix:retry",{extensionId:e.identifier.id,attempts:r}),s}catch(s){throw De(s,"Download")}}async y(e){try{const i=W(this.extensionsDownloadDir,`${this.G(e)}${qn.c}`),s=await this.C(e,"sigzip",async()=>{await this.m.downloadSignatureArchive(e,i);try{await this.D(i.fsPath,".signature.p7s")}catch(r){try{await this.j.del(i)}catch(n){this.u.warn(`Error while deleting: ${i.path}`,G(n))}throw r}},2);return s>1&&this.r.publicLog2("extensiongallery:downloadsigzip:retry",{extensionId:e.identifier.id,attempts:s}),i}catch(i){throw De(i,"DownloadSignature")}}async z(e,i,s){if(await this.j.exists(i))return;if(i.scheme!==ie.file){await s(i);return}const r=W(this.extensionsDownloadDir,`.${dt()}`);try{await s(r)}catch(n){try{await this.j.del(r)}catch{}throw n}try{await ce.rename(r.fsPath,i.fsPath,2*60*1e3)}catch(n){try{await this.j.del(r)}catch{}let o=!1;try{o=await this.j.exists(i)}catch{}if(o)this.u.info("Rename failed because the file was downloaded by another source. So ignoring renaming.",e.identifier.id,i.path);else throw this.u.info(`Rename failed because of ${G(n)}. Deleted the file from downloaded location`,r.path),n}}async C(e,i,s,r){let n=1;for(;;)try{return await s(),n}catch(o){if(n++>r)throw o;this.u.warn(`Failed downloading ${i}. ${G(o)}. Retry again...`,e.identifier.id)}}async D(e,i){try{await Pf(e,i)}catch(s){throw el(s)}}async delete(e){await this.h;const i=this.t.extUri.relativePath(this.extensionsDownloadDir,e);i?await this.j.move(e,this.t.extUri.joinPath(this.f,i),!0):await this.j.del(e)}async F(){try{if(!await this.j.exists(this.extensionsDownloadDir)){this.u.trace("Extension VSIX downloads cache dir does not exist");return}try{await this.j.del(this.f,{recursive:!0})}catch(i){Me(i)!==1&&this.u.error(i)}const e=await this.j.resolve(this.extensionsDownloadDir,{resolveMetadata:!0});if(e.children){const i=[],s=[],r=[];for(const a of e.children)if(a.name.endsWith(qn.c))r.push(a.resource);else{const l=pt.parse(a.name);l&&s.push([l,a])}const n=zh(s,([a])=>a),o=[];for(const a of n)a.sort((l,c)=>mh(l[0].version,c[0].version)),i.push(...a.slice(1).map(l=>l[1].resource)),o.push(a[0][1]);o.sort((a,l)=>a.mtime-l.mtime),i.push(...o.slice(0,Math.max(0,o.length-this.g)).map(a=>a.resource)),i.push(...r),await ut.settled(i.map(a=>(this.u.trace("Deleting from cache",a.path),this.j.del(a))))}}catch(e){this.u.error(e)}}G(e){return pt.create(e).toString().toLowerCase()}};il=qn=__decorate([__param(0,kt),__param(1,Ie),__param(2,bi),__param(3,cf),__param(4,Ht),__param(5,ze),__param(6,he)],il);import{fork as P2}from"child_process";var sl=class extends J{constructor(e,i){super(),this.b=e,this.f=i,this.a=new au(5)}async postUninstall(e){const i=this.g(e,"uninstall");i&&(this.f.info(e.identifier.id,e.manifest.version,"Running post uninstall script"),await this.a.queue(async()=>{try{await this.h(i.script,"uninstall",i.args,!0,e),this.f.info("Finished running post uninstall script",e.identifier.id,e.manifest.version)}catch(s){this.f.error("Failed to run post uninstall script",e.identifier.id,e.manifest.version),this.f.error(s)}}));try{await ce.rm(this.m(e))}catch(s){this.f.error("Error while removing extension storage path",e.identifier.id),this.f.error(s)}}g(e,i){const s=`vscode:${i}`;if(e.location.scheme===ie.file&&e.manifest&&e.manifest.scripts&&typeof e.manifest.scripts[s]=="string"){const r=e.manifest.scripts[s].split(" ");return r.length<2||r[0]!=="node"||!r[1]?(this.f.warn(e.identifier.id,e.manifest.version,`${s} should be a node script`),null):{script:U(e.location.fsPath,r[1]),args:r.slice(2)||[]}}return null}h(e,i,s,r,n){return new Promise((o,a)=>{const l=this.j(e,i,s,n);let c;const u=f=>{c&&(clearTimeout(c),c=null),f?a(f):o(void 0)};l.on("error",f=>{u(Fi(f)||"Unknown")}),l.on("exit",(f,d)=>{u(f?`post-${i} process exited with code ${f}`:void 0)}),r&&(c=setTimeout(()=>{c=null,l.kill(),a("timed out")},5e3))})}j(e,i,s,r){const n={silent:!0,execArgv:void 0},o=P2(e,[`--type=extension-post-${i}`,...s],n);o.stdout.setEncoding("utf8"),o.stderr.setEncoding("utf8");const a=oe.fromNodeEventEmitter(o.stdout,"data"),l=oe.fromNodeEventEmitter(o.stderr,"data");this.B(a(f=>this.f.info(r.identifier.id,r.manifest.version,`post-${i}`,f))),this.B(l(f=>this.f.error(r.identifier.id,r.manifest.version,`post-${i}`,f)));const c=oe.any(oe.map(a,f=>({data:`%c${f}`,format:[""]}),this.q),oe.map(l,f=>({data:`%c${f}`,format:["color: red"]}),this.q));return oe.debounce(c,(f,d)=>f?{data:f.data+d.data,format:[...f.format,...d.format]}:{data:d.data,format:d.format},100,void 0,void 0,void 0,this.q)(f=>{console.group(r.identifier.id),console.log(f.data,...f.format),console.groupEnd()}),o}m(e){return U(this.b.defaultProfile.globalStorageHome.fsPath,e.identifier.id.toLowerCase())}};sl=__decorate([__param(0,jt),__param(1,he)],sl);var k2=class extends J{constructor(t,e,i,s,r){super(),this.a=t,this.b=e,this.c=i,this.f=r,this.B(s.onDidInstallExtensions(n=>this.g(n))),this.B(s.onDidUninstallExtension(n=>this.h(n)))}g(t){for(const e of t)e.local&&this.invalidate(e.profileLocation)}h(t){t.error||this.invalidate(t.profileLocation)}async invalidate(t){if(t)for(const e of this.a.profiles)this.c.extUri.isEqual(e.extensionsResource,t)&&await this.j(e);else await this.j(this.a.defaultProfile)}async j(t){try{await this.b.del(this.c.extUri.joinPath(t.cacheHome,Rh))}catch(e){Me(e)!==1&&this.f.error(e)}}},I2=class extends J{constructor(t,e,i,s,r,n,o){super(),this.f=t,this.g=e,this.h=i,this.j=s,this.m=r,this.n=n,this.r=o,this.a=this.B(new N),this.onDidChangeExtensionsByAnotherSource=this.a.event,this.b=new Map,this.c=this.B(new vo),this.s().then(null,a=>o.error("Error while initializing Extensions Watcher",G(a)))}async s(){await this.g.initializeDefaultProfileExtensions(),await this.u(this.h.profiles),this.t(),await this.H()}t(){this.B(this.h.onDidChangeProfiles(t=>this.u(t.added))),this.B(this.j.onAddExtensions(t=>this.w(t))),this.B(this.j.onDidAddExtensions(t=>this.y(t))),this.B(this.j.onRemoveExtensions(t=>this.z(t))),this.B(this.j.onDidRemoveExtensions(t=>this.C(t))),this.B(this.n.onDidFilesChange(t=>this.D(t)))}async u(t){try{t.length&&await Promise.all(t.map(e=>(this.c.set(e.id,dc(this.n.watch(this.m.extUri.dirname(e.extensionsResource)),this.n.watch(e.extensionsResource))),this.G(e.extensionsResource))))}catch(e){throw this.r.error(e),e}}async w(t){for(const e of t.extensions)this.I(this.L(e.identifier,e.version),t.profileLocation)}async y(t){for(const e of t.extensions){const i=this.L(e.identifier,e.version);t.error?this.J(i,t.profileLocation):this.I(i,t.profileLocation)}}async z(t){for(const e of t.extensions)this.J(this.L(e.identifier,e.version),t.profileLocation)}async C(t){const e=[],i=[];for(const s of t.extensions){const r=this.L(s.identifier,s.version);t.error?this.I(r,t.profileLocation):(this.J(r,t.profileLocation),this.b.has(r)||(this.r.debug("Extension is removed from all profiles",s.identifier.id,s.version),i.push(this.f.scanInstalledExtensionAtLocation(s.location).then(n=>{n?e.push(n):this.r.info("Extension not found at the location",s.location.toString())},n=>this.r.error(n)))))}try{await Promise.all(i),e.length&&await this.H(e)}catch(s){this.r.error(s)}}D(t){for(const e of this.h.profiles)t.contains(e.extensionsResource,0,1)&&this.F(e.extensionsResource)}async F(t){const e=[],i=[],s=await this.j.scanProfileExtensions(t),r=new Set,n=new Set;for(const[o,a]of this.b)a.has(t)&&n.add(o);for(const o of s){const a=this.L(o.identifier,o.version);r.add(a),n.has(a)||(e.push(o.identifier),this.I(a,t))}for(const o of n)if(!r.has(o)){const a=this.M(o);a&&(i.push(a.identifier),this.J(o,t))}(e.length||i.length)&&this.a.fire({added:e.length?{extensions:e,profileLocation:t}:void 0,removed:i.length?{extensions:i,profileLocation:t}:void 0})}async G(t){const e=await this.j.scanProfileExtensions(t);for(const i of e)this.I(this.L(i.identifier,i.version),t)}async H(t){t||(t=(await this.f.scanAllUserInstalledExtensions()).filter(i=>!this.b.has(this.L(i.identifier,i.manifest.version)))),t.length&&await this.f.deleteExtensions(...t)}I(t,e){let i=this.b.get(t);i||this.b.set(t,i=new go(s=>this.m.extUri.getComparisonKey(s))),i.add(e)}J(t,e){const i=this.b.get(t);i&&i.delete(e),i?.size||this.b.delete(t)}L(t,e){return`${Ss.toKey(t.id)}@${e}`}M(t){const[e,i]=Ea(t);return i?{identifier:{id:e},version:i}:void 0}},D2=va,rl=".vsctmp",nl=class extends Ka{constructor(e,i,s,r,n,o,a,l,c,u,f,d,p,m,w){super(e,i,m,s,d,p,w),this.jb=r,this.kb=n,this.lb=o,this.mb=a,this.nb=l,this.ob=c,this.pb=u,this.qb=f,this.ib=new Map,this.Fb=new go;const y=this.B(l.createInstance(sl));this.fb=this.B(l.createInstance(ol,S=>y.postUninstall(S))),this.gb=this.B(new k2(w,c,m,this,this.I)),this.hb=this.B(l.createInstance(il));const b=this.B(new I2(this,this.kb,w,o,m,c,s));this.B(b.onDidChangeExtensionsByAnotherSource(S=>this.Eb(S))),this.Gb()}getTargetPlatform(){return this.rb||(this.rb=Bh(this.ob,this.I)),this.rb}async zip(e){this.I.trace("ExtensionManagementService#zip",e.identifier.id);const i=await this.Db(e),s=await a2(W(this.hb.extensionsDownloadDir,dt()).fsPath,i);return k.file(s)}async getManifest(e){const{location:i,cleanup:s}=await this.wb(e),r=Oi(i.fsPath);try{return await tl(r)}finally{await s()}}getInstalled(e,i=this.J.defaultProfile.extensionsResource,s={version:this.g.version,date:this.g.date}){return this.fb.scanExtensions(e??null,i,s)}scanAllUserInstalledExtensions(){return this.fb.scanAllUserExtensions()}scanInstalledExtensionAtLocation(e){return this.fb.scanUserExtensionAtLocation(e)}async install(e,i={}){this.I.trace("ExtensionManagementService#install",e.toString());const{location:s,cleanup:r}=await this.wb(e);try{const n=await tl(Oi(s.fsPath)),o=Ut(n.publisher,n.name);if(n.engines&&n.engines.vscode&&!Pa(n.engines.vscode,this.g.version,this.g.date))throw new Error(g(1975,null,o,this.g.version));const a=this.h.isAllowed({id:o,version:n.version,publisherDisplayName:void 0});if(a!==!0)throw new Error(g(1976,null,a.value));const c=(await this.L([{manifest:n,extension:s,options:i}])).find(({identifier:u})=>Q(u,{id:o}));if(c?.local)return c.local;throw c?.error?c.error:De(new Error(`Unknown error while installing extension ${o}`))}finally{await r()}}async installFromLocation(e,i){this.I.trace("ExtensionManagementService#installFromLocation",e.toString());const s=await this.fb.scanUserExtensionAtLocation(e);if(!s||!s.manifest.name||!s.manifest.version)throw new Error(`Cannot find a valid extension from the location ${e.toString()}`);return await this.Ib([[s,{source:"resource"}]],i),this.I.info("Successfully installed extension",s.identifier.id,i.toString()),s}async installExtensionsFromProfile(e,i,s){this.I.trace("ExtensionManagementService#installExtensionsFromProfile",e,i.toString(),s.toString());const r=(await this.getInstalled(1,i)).filter(n=>e.some(o=>Q(o,n.identifier)));if(r.length){const n=await Promise.all(r.map(o=>this.fb.scanMetadata(o,i)));await this.Ib(r.map((o,a)=>[o,n[a]]),s),this.I.info("Successfully installed extensions",r.map(o=>o.identifier.id),s.toString())}return r}async updateMetadata(e,i,s){return this.I.trace("ExtensionManagementService#updateMetadata",e.identifier.id),i.isPreReleaseVersion&&(i.preRelease=!0,i.hasPreReleaseVersion=!0),i.isMachineScoped===!1&&(i.isMachineScoped=void 0),i.isBuiltin===!1&&(i.isBuiltin=void 0),i.pinned===!1&&(i.pinned=void 0),e=await this.fb.updateMetadata(e,i,s),this.gb.invalidate(s),this.C.fire({local:e,profileLocation:s}),e}eb(e){return this.fb.deleteExtension(e,"remove")}bb(e,i,s,r){return this.fb.copyExtension(e,i,s,r)}cb(e,i,s,r){return this.fb.moveExtension(e,i,s,r)}db(e,i){return this.fb.removeExtension(e.identifier,i)}copyExtensions(e,i){return this.fb.copyExtensions(e,i,{version:this.g.version,date:this.g.date})}deleteExtensions(...e){return this.fb.setExtensionsForRemoval(...e)}async cleanUp(){this.I.trace("ExtensionManagementService#cleanUp");try{await this.fb.cleanUp()}catch(e){this.I.error(e)}}async download(e,i,s){const{location:r}=await this.Bb(e,i,!s);return r}async wb(e){if(e.scheme===ie.file)return{location:e,async cleanup(){}};this.I.trace("Downloading extension from",e.toString());const i=W(this.hb.extensionsDownloadDir,dt());return await this.mb.download(e,i),this.I.info("Downloaded extension to",i.toString()),{location:i,cleanup:async()=>{try{await this.ob.del(i)}catch(r){this.I.error(r)}}}}Z(){return this.J.defaultProfile.extensionsResource}$(e,i,s){const r=i instanceof k?new pt({id:Ut(e.publisher,e.name)},e.version):pt.create(i);return this.nb.createInstance(al,r,e,i,s,(n,o)=>{if(i instanceof k)return this.Cb(r,i,s,o);let a=this.ib.get(r.toString());return a||(this.ib.set(r.toString(),a=this.Ab(r,i,n,s,o)),a.finally(()=>this.ib.delete(r.toString()))),a},this.fb)}ab(e,i){return new A2(e,i,this.lb)}async Ab(e,i,s,r,n){const{verificationStatus:o,location:a}=await this.Bb(i,s,!r.donotVerifySignature,r.context?.[b4]);try{if(n.isCancellationRequested)throw new Te;const l=await tl(a.fsPath);if(!new pt(i.identifier,i.version).equals(new pt({id:Ut(l.publisher,l.name)},l.version)))throw new be(g(1977,null,i.identifier.id),"Invalid");const c=await this.fb.extractUserExtension(e,a.fsPath,!1,n);if(o!==Fe.Success&&this.jb.isBuilt)try{await this.hb.delete(a)}catch(u){this.I.warn("Error while deleting the downloaded file",a.toString(),G(u))}return{local:c,verificationStatus:o}}catch(l){try{await this.hb.delete(a)}catch(c){this.I.warn("Error while deleting the downloaded file",a.toString(),G(c))}throw De(l)}}async Bb(e,i,s,r){if(s){const l=this.pb.getValue(S4);s=Et(l)?l:!0}const{location:n,verificationStatus:o}=await this.hb.download(e,i,s,r),a=$4(e.private,await this.qb.getExtensionGalleryManifest());if(o!==Fe.Success&&!(o===Fe.NotSigned&&!a)&&s&&this.jb.isBuilt&&await this.getTargetPlatform()!=="linux-armhf"){try{await this.hb.delete(n)}catch(l){this.I.warn("Error while deleting the downloaded file",n.toString(),G(l))}if(!o)throw new be(g(1978,null),"SignatureVerificationInternal");switch(o){case Fe.PackageIntegrityCheckFailed:case Fe.SignatureIsInvalid:case Fe.SignatureManifestIsInvalid:case Fe.SignatureIntegrityCheckFailed:case Fe.EntryIsMissing:case Fe.EntryIsTampered:case Fe.Untrusted:case Fe.CertificateRevoked:case Fe.SignatureIsNotValid:case Fe.SignatureArchiveHasTooManyEntries:case Fe.NotSigned:throw new be(g(1979,null,o),"SignatureVerificationFailed")}throw new be(g(1980,null,o),"SignatureVerificationInternal")}return{location:n,verificationStatus:o}}async Cb(e,i,s,r){return{local:await this.fb.extractUserExtension(e,Oi(i.fsPath),Et(s.keepExisting)?!s.keepExisting:!0,r)}}async Db(e){const i=async r=>{let n=await ce.readdir(r);n=n.map(l=>U(r,l));const o=await Promise.all(n.map(l=>jm.promises.stat(l)));let a=Promise.resolve([]);return o.forEach((l,c)=>{const u=n[c];l.isFile()&&(a=a.then(f=>[...f,u])),l.isDirectory()&&(a=a.then(f=>i(u).then(d=>[...f,...d])))}),a};return(await i(e.location.fsPath)).map(r=>({path:`extension/${Tc(e.location.fsPath,r)}`,localPath:r}))}async Eb({added:e,removed:i}){if(i){const s=e&&this.H.extUri.isEqual(i.profileLocation,e.profileLocation)?i.extensions.filter(r=>e.extensions.every(n=>!Q(n,r))):i.extensions;for(const r of s)this.I.info("Extensions removed from another source",r.id,i.profileLocation.toString()),this.z.fire({identifier:r,profileLocation:i.profileLocation})}if(e){const r=(await this.getInstalled(1,e.profileLocation)).filter(n=>e.extensions.some(o=>Q(o,n.identifier)));this.w.fire(r.map(n=>(this.I.info("Extensions added from another source",n.identifier.id,e.profileLocation.toString()),{identifier:n.identifier,local:n,profileLocation:e.profileLocation,operation:1})))}}async Gb(){this.B(this.fb.onExtract(i=>this.Fb.add(i)));const e=await this.ob.resolve(this.kb.userExtensionsLocation);for(const i of e.children??[])i.isDirectory&&this.Fb.add(i.resource);this.B(this.ob.watch(this.kb.userExtensionsLocation)),this.B(this.ob.onDidFilesChange(i=>this.Hb(i)))}async Hb(e){if(!e.affects(this.kb.userExtensionsLocation,1))return;const i=[];for(const s of e.rawAdded){if(this.Fb.has(s)||!this.H.extUri.isEqual(this.H.extUri.dirname(s),this.kb.userExtensionsLocation)||this.H.extUri.isEqual(s,this.H.extUri.joinPath(this.kb.userExtensionsLocation,".obsolete"))||this.H.extUri.basename(s).startsWith(".")||this.H.extUri.basename(s).endsWith(rl))continue;try{if(!(await this.ob.stat(s)).isDirectory)continue}catch(n){Me(n)!==1&&this.I.error(n);continue}const r=await this.fb.scanUserExtensionAtLocation(s);r&&r.installedTimestamp===void 0&&(this.Fb.add(s),i.push(r))}i.length&&(await this.Ib(i.map(s=>[s,void 0]),this.J.defaultProfile.extensionsResource),this.I.info("Added extensions to default profile from external source",i.map(s=>s.identifier.id)))}async Ib(e,i){const s=e.map(r=>r[0]);await this.fb.unsetExtensionsForRemoval(...s.map(r=>pt.create(r))),await this.lb.addExtensionsToProfile(e,i),this.w.fire(s.map(r=>({local:r,identifier:r.identifier,operation:1,profileLocation:i})))}};nl=__decorate([__param(0,bi),__param(1,Ht),__param(2,he),__param(3,kt),__param(4,Un),__param(5,Ei),__param(6,Ku),__param(7,tn),__param(8,Ie),__param(9,oi),__param(10,ur),__param(11,gt),__param(12,zi),__param(13,ze),__param(14,jt)],nl);var ol=class extends J{constructor(e,i,s,r,n,o,a){super(),this.n=e,this.s=i,this.t=s,this.u=r,this.w=n,this.y=o,this.z=a,this.h=this.B(new N),this.onExtract=this.h.event,this.j=new Je,this.m=new Je,this.c=W(this.t.userExtensionsLocation,".obsolete"),this.g=new Qs}async cleanUp(){await this.L(),await this.J(),await this.I()}async scanExtensions(e,i,s){try{const r={includeInvalid:!0,profileLocation:i,productVersion:s};let n=[];if(e===null||e===0){let o=this.j.get(i);o||(o=this.t.scanAllExtensions({},r).finally(()=>this.j.delete(i)),this.j.set(i,o)),n.push(...await o)}else if(e===1){let o=this.m.get(i);o||(o=this.t.scanUserExtensions(r).finally(()=>this.m.delete(i)),this.m.set(i,o)),n.push(...await o)}return n=e!==null?n.filter(o=>o.type===e):n,await Promise.all(n.map(o=>this.H(o)))}catch(r){throw De(r,"Scanning")}}async scanAllUserExtensions(){try{const e=await this.t.scanAllUserExtensions();return await Promise.all(e.map(i=>this.H(i)))}catch(e){throw De(e,"Scanning")}}async scanUserExtensionAtLocation(e){try{const i=await this.t.scanExistingExtension(e,1,{includeInvalid:!0});if(i)return await this.H(i)}catch(i){this.z.error(i)}return null}async extractUserExtension(e,i,s,r){const n=e.toString(),o=k.file(U(this.t.userExtensionsLocation.fsPath,`.${dt()}`)),a=k.file(U(this.t.userExtensionsLocation.fsPath,n));if(await this.s.exists(a)){if(!s)try{return await this.scanLocalExtension(a,1)}catch(l){this.z.warn(`Error while scanning the existing extension at ${a.path}. Deleting the existing extension and extracting it.`,G(l))}try{await this.D(e.id,a,"removeExisting")}catch{throw new be(g(1981,null,a.fsPath,e.id),"Delete")}}try{if(r.isCancellationRequested)throw new Te;try{this.z.trace(`Started extracting the extension from ${i} to ${a.fsPath}`),await l2(i,o.fsPath,{sourcePath:"extension",overwrite:!0},r),this.z.info(`Extracted extension to ${a}:`,e.id)}catch(c){throw el(c)}const l={installedTimestamp:Date.now(),targetPlatform:e.targetPlatform};try{l.size=await ya(o,this.s)}catch(c){this.z.warn(`Error while getting the size of the extracted extension : ${o.fsPath}`,G(c))}try{await this.t.updateManifestMetadata(o,l)}catch(c){throw this.y.publicLog2("extension:extract",{extensionId:e.id,code:`${Me(c)}`}),De(c,"UpdateMetadata")}if(r.isCancellationRequested)throw new Te;try{this.z.trace(`Started renaming the extension from ${o.fsPath} to ${a.fsPath}`),await this.G(o.fsPath,a.fsPath),this.z.info("Renamed to",a.fsPath)}catch(c){if(c.code==="ENOTEMPTY"){this.z.info("Rename failed because extension was installed by another source. So ignoring renaming.",e.id);try{await this.s.del(o,{recursive:!0})}catch{}}else throw this.z.info(`Rename failed because of ${G(c)}. Deleted from extracted location`,o),c}this.h.fire(a)}catch(l){try{await this.s.del(o,{recursive:!0})}catch{}throw l}return this.scanLocalExtension(a,1)}async scanMetadata(e,i){return(await this.C(e,i))?.metadata}async C(e,i){return(await this.u.scanProfileExtensions(i)).find(r=>Q(r.identifier,e.identifier))}async updateMetadata(e,i,s){try{await this.u.updateMetadata([[e,i]],s)}catch(r){throw this.y.publicLog2("extension:extract",{extensionId:e.identifier.id,code:`${Me(r)}`,isProfile:!!s}),De(r,"UpdateMetadata")}return this.scanLocalExtension(e.location,e.type,s)}async setExtensionsForRemoval(...e){const i=[];for(const r of e)await this.s.exists(r.location)&&i.push(r);const s=i.map(r=>pt.create(r));await this.F(r=>s.forEach(n=>{r[n.toString()]=!0,this.z.info("Marked extension as removed",n.toString())}))}async unsetExtensionsForRemoval(...e){try{const i=[];return await this.F(s=>e.forEach(r=>{s[r.toString()]?(i.push(!0),delete s[r.toString()]):i.push(!1)})),i}catch(i){throw De(i,"UnsetRemoved")}}async deleteExtension(e,i){this.w.extUri.isEqualOrParent(e.location,this.t.userExtensionsLocation)&&(await this.D(e.identifier.id,e.location,i),await this.unsetExtensionsForRemoval(pt.create(e)))}async copyExtension(e,i,s,r){const n=await this.C(e,i),o=await this.C(e,s);if(r={...n?.metadata,...r},o)if(this.w.extUri.isEqual(o.location,e.location))await this.u.updateMetadata([[e,{...o.metadata,...r}]],s);else{const a=await this.scanLocalExtension(o.location,e.type,s);await this.u.removeExtensionsFromProfile([a.identifier],s),await this.u.addExtensionsToProfile([[e,{...o.metadata,...r}]],s)}else await this.u.addExtensionsToProfile([[e,r]],s);return this.scanLocalExtension(e.location,e.type,s)}async moveExtension(e,i,s,r){const n=await this.C(e,i),o=await this.C(e,s);if(r={...n?.metadata,...r},o)if(this.w.extUri.isEqual(o.location,e.location))await this.u.updateMetadata([[e,{...o.metadata,...r}]],s);else{const a=await this.scanLocalExtension(o.location,e.type,s);await this.removeExtension(a.identifier,s),await this.u.addExtensionsToProfile([[e,{...o.metadata,...r}]],s)}else await this.u.addExtensionsToProfile([[e,r]],s),n&&await this.removeExtension(n.identifier,i);return this.scanLocalExtension(e.location,e.type,s)}async removeExtension(e,i){await this.u.removeExtensionsFromProfile([e],i)}async copyExtensions(e,i,s){const r=await this.scanExtensions(1,e,s),n=await Promise.all(r.filter(o=>!o.isApplicationScoped).map(async o=>[o,await this.scanMetadata(o,e)]));await this.u.addExtensionsToProfile(n,i)}async D(e,i,s){this.z.trace(`Deleting ${s} extension from disk`,e,i.fsPath);const r=this.w.extUri.joinPath(this.w.extUri.dirname(i),`${this.w.extUri.basename(i)}.${ps(dt()).toString(16)}${rl}`);await this.G(i.fsPath,r.fsPath),await this.s.del(r,{recursive:!0}),this.z.info(`Deleted ${s} extension from disk`,e,i.fsPath)}F(e){return this.g.queue(async()=>{let i;try{i=(await this.s.readFile(this.c,"utf8")).value.toString()}catch(r){if(Me(r)!==1)throw r}let s={};if(i)try{s=JSON.parse(i)}catch{}if(e)if(e(s),Object.keys(s).length)await this.s.writeFile(this.c,V.fromString(JSON.stringify(s)));else try{await this.s.del(this.c)}catch(r){if(Me(r)!==1)throw r}return s})}async G(e,i){try{await ce.rename(e,i,2*60*1e3)}catch(s){throw De(s,"Rename")}}async scanLocalExtension(e,i,s){try{if(s){const n=(await this.t.scanUserExtensions({profileLocation:s})).find(o=>this.w.extUri.isEqual(o.location,e));if(n)return await this.H(n)}else{const r=await this.t.scanExistingExtension(e,i,{includeInvalid:!0});if(r)return await this.H(r)}throw new be(g(1982,null,e.path),"ScanningExtension")}catch(r){throw De(r,"ScanningExtension")}}async H(e){let i;try{i=await this.s.resolve(e.location)}catch{}let s,r;return i?.children&&(s=i.children.find(({name:n})=>/^readme(\.txt|\.md|)$/i.test(n))?.resource,r=i.children.find(({name:n})=>/^changelog(\.txt|\.md|)$/i.test(n))?.resource),{identifier:e.identifier,type:e.type,isBuiltin:e.isBuiltin||!!e.metadata?.isBuiltin,location:e.location,manifest:e.manifest,targetPlatform:e.targetPlatform,validations:e.validations,isValid:e.isValid,readmeUrl:s,changelogUrl:r,publisherDisplayName:e.metadata?.publisherDisplayName,publisherId:e.metadata?.publisherId||null,isApplicationScoped:!!e.metadata?.isApplicationScoped,isMachineScoped:!!e.metadata?.isMachineScoped,isPreReleaseVersion:!!e.metadata?.isPreReleaseVersion,hasPreReleaseVersion:!!e.metadata?.hasPreReleaseVersion,preRelease:e.preRelease,installedTimestamp:e.metadata?.installedTimestamp,updated:!!e.metadata?.updated,pinned:!!e.metadata?.pinned,private:!!e.metadata?.private,isWorkspaceScoped:!1,source:e.metadata?.source??(e.identifier.uuid?"gallery":"vsix"),size:e.metadata?.size??0}}async I(){const e=await this.t.scanAllUserExtensions();await Promise.all(e.map(async i=>{if(cc(i.metadata?.installedTimestamp)&&xt(i.metadata?.size)){const s=await ya(i.location,this.s);await this.t.updateManifestMetadata(i.location,{size:s})}}))}async J(){let e;try{e=await this.F()}catch(n){throw De(n,"ReadRemoved")}if(Object.keys(e).length===0){this.z.debug("No extensions are marked as removed.");return}this.z.debug("Deleting extensions marked as removed:",Object.keys(e));const i=await this.scanAllUserExtensions(),s=new Set;for(const n of i)e[pt.create(n).toString()]||s.add(n.identifier.id.toLowerCase());try{const n=zh(i,o=>o.identifier);await ut.settled(n.map(async o=>{const a=o.sort((l,c)=>mh(l.manifest.version,c.manifest.version))[0];s.has(a.identifier.id.toLowerCase())||await this.n(a)}))}catch(n){this.z.error(n)}const r=i.filter(n=>n.installedTimestamp&&e[pt.create(n).toString()]);await Promise.allSettled(r.map(n=>this.deleteExtension(n,"marked for removal")))}async L(){this.z.trace("ExtensionManagementService#removeTempDeleteFolders");let e;try{e=await this.s.resolve(this.t.userExtensionsLocation)}catch(i){Me(i)!==1&&this.z.error(i);return}if(e?.children)try{await Promise.allSettled(e.children.map(async i=>{if(!(!i.isDirectory||!i.name.endsWith(rl))){this.z.trace("Deleting the temporarily deleted folder",i.resource.toString());try{await this.s.del(i.resource,{recursive:!0}),this.z.trace("Deleted the temporarily deleted folder",i.resource.toString())}catch(s){Me(s)!==1&&this.z.error(s)}}}))}catch{}}};ol=__decorate([__param(1,Ie),__param(2,Un),__param(3,Ei),__param(4,ze),__param(5,Ht),__param(6,he)],ol);var al=class extends Vf{get operation(){return this.options.operation??this.j}get verificationStatus(){return this.k}constructor(e,i,s,r,n,o,a,l,c,u,f,d){super(),this.l=e,this.manifest=i,this.source=s,this.options=r,this.m=n,this.n=o,this.o=a,this.p=l,this.q=c,this.s=u,this.t=f,this.u=d,this.j=2,this.identifier=this.l.identifier}async h(e){const s=(await this.n.scanExtensions(1,this.options.profileLocation,this.options.productVersion)).find(a=>Q(a.identifier,this.identifier));s&&(this.j=3);const r={isApplicationScoped:this.options.isApplicationScoped||s?.isApplicationScoped,isMachineScoped:this.options.isMachineScoped||s?.isMachineScoped,isBuiltin:this.options.isBuiltin||s?.isBuiltin,isSystem:s?.type===0?!0:void 0,installedTimestamp:Date.now(),pinned:this.options.installGivenVersion?!0:this.options.pinned??s?.pinned,source:this.source instanceof k?"vsix":"gallery"};let n;if(this.source instanceof k){if(s&&this.l.equals(new pt(s.identifier,s.manifest.version)))try{await this.n.deleteExtension(s,"existing")}catch{throw new Error(g(1983,null,this.manifest.displayName||this.manifest.name))}const a=await this.w(this.l);if(a)try{await this.n.deleteExtension(a,"existing")}catch{throw new Error(g(1984,null,this.manifest.displayName||this.manifest.name))}}else{if(r.id=this.source.identifier.uuid,r.publisherId=this.source.publisherId,r.publisherDisplayName=this.source.publisherDisplayName,r.targetPlatform=this.source.properties.targetPlatform,r.updated=!!s,r.private=this.source.private,r.isPreReleaseVersion=this.source.properties.isPreReleaseVersion,r.hasPreReleaseVersion=s?.hasPreReleaseVersion||this.source.properties.isPreReleaseVersion,r.preRelease=Et(this.options.preRelease)?this.options.preRelease:this.options.installPreReleaseVersion||this.source.properties.isPreReleaseVersion||s?.preRelease,s&&s.type!==0&&s.manifest.version===this.source.version)return this.n.updateMetadata(s,r,this.options.profileLocation);n=await this.w(this.l)}if(e.isCancellationRequested)throw De(new Te);if(!n){const a=await this.m(this.operation,e);n=a.local,this.k=a.verificationStatus}if(this.o.extUri.isEqual(this.q.defaultProfile.extensionsResource,this.options.profileLocation))try{await this.s.initializeDefaultProfileExtensions()}catch(a){throw De(a,"IntializeDefaultProfile")}if(e.isCancellationRequested)throw De(new Te);try{await this.t.addExtensionsToProfile([[n,r]],this.options.profileLocation,!n.isValid)}catch(a){throw De(a,"AddToProfile")}const o=await this.n.scanLocalExtension(n.location,1,this.options.profileLocation);if(!o)throw new be("Cannot find the installed extension","InstalledExtensionNotFound");return this.source instanceof k&&this.x(n,e),o}async w(e){const[i]=await this.n.unsetExtensionsForRemoval(e);if(i)return this.u.info("Removed the extension from removed list:",e.id),(await this.n.scanAllUserExtensions()).find(r=>pt.create(r).equals(e))}async x(e,i){try{let[s]=await this.p.getExtensions([{id:e.identifier.id,version:e.manifest.version}],i);if(s||([s]=await this.p.getExtensions([{id:e.identifier.id}],i)),s){const r={id:s.identifier.uuid,publisherDisplayName:s.publisherDisplayName,publisherId:s.publisherId,isPreReleaseVersion:s.properties.isPreReleaseVersion,hasPreReleaseVersion:e.hasPreReleaseVersion||s.properties.isPreReleaseVersion,preRelease:s.properties.isPreReleaseVersion||this.options.installPreReleaseVersion};await this.n.updateMetadata(e,r,this.options.profileLocation)}}catch{}}};al=__decorate([__param(6,ze),__param(7,bi),__param(8,jt),__param(9,Un),__param(10,Ei),__param(11,he)],al);var A2=class extends Vf{constructor(t,e,i){super(),this.extension=t,this.options=e,this.j=i}h(t){return this.j.removeExtensionsFromProfile([this.extension.identifier],this.options.profileLocation)}},ll=class extends Mm{constructor(e,i,s,r,n,o,a,l){super(k.file(n.builtinExtensionsPath),k.file(n.extensionsPath),n.userHome,e.defaultProfile,e,i,s,r,n,o,a,l)}};ll=__decorate([__param(0,jt),__param(1,Ei),__param(2,Ie),__param(3,he),__param(4,kt),__param(5,gt),__param(6,ze),__param(7,tn)],ll);async function zf(t,e,i,s,r,n){let o;try{await R2(t,e,i,s,r,n)}catch(a){o=a}finally{o&&r.errorTransformer&&(o=r.errorTransformer(o)),typeof o<"u"&&i.error(o),i.end()}}async function R2(t,e,i,s,r,n){cl(n);const o=await t.open(e,{create:!1});try{cl(n);let a=0,l=0,c=r&&typeof r.length=="number"?r.length:void 0,u=V.alloc(Math.min(r.bufferSize,typeof c=="number"?c:r.bufferSize)),f=r&&typeof r.position=="number"?r.position:0,d=0;do l=await t.read(o,f,u.buffer,d,u.byteLength-d),f+=l,d+=l,a+=l,typeof c=="number"&&(c-=l),d===u.byteLength&&(await i.write(s(u)),u=V.alloc(Math.min(r.bufferSize,typeof c=="number"?c:r.bufferSize)),d=0);while(l>0&&(typeof c!="number"||c>0)&&cl(n)&&L2(a,r));if(d>0){let p=d;typeof c=="number"&&(p=Math.min(d,c)),i.write(s(u.slice(0,p)))}}catch(a){throw Vi(a)}finally{await t.close(o)}}function cl(t){if(t.isCancellationRequested)throw Kl();return!0}function L2(t,e){if(typeof e?.limits?.size=="number"&&t>e.limits.size)throw hi(g(2053,null),z.FileTooLarge);return!0}var ul,hl=class extends J{static{ul=this}constructor(e){super(),this.b=e,this.a=256*1024,this.c=this.B(new N),this.onDidChangeFileSystemProviderRegistrations=this.c.event,this.f=this.B(new N),this.onWillActivateFileSystemProvider=this.f.event,this.g=this.B(new N),this.onDidChangeFileSystemProviderCapabilities=this.g.event,this.h=new Map,this.r=this.B(new N),this.onDidRunOperation=this.r.event,this.Y=this.B(new N),this.Z=this.B(new N),this.onDidFilesChange=this.Z.event,this.$=this.B(new N),this.onDidWatchError=this.$.event,this.ab=new Map,this.db=this.B(new lu)}registerProvider(e,i){if(this.h.has(e))throw new Error(`A filesystem provider for the scheme '${e}' is already registered.`);Da(`code/registerFilesystem/${e}`);const s=new ot;return this.h.set(e,i),this.c.fire({added:!0,scheme:e,provider:i}),s.add(i.onDidChangeFile(r=>{const n=new Gg(r,!this.U(i));this.Y.fire(n),n.hasCorrelation()||this.Z.fire(n)})),typeof i.onDidWatchError=="function"&&s.add(i.onDidWatchError(r=>this.$.fire(new Error(r)))),s.add(i.onDidChangeCapabilities(()=>this.g.fire({provider:i,scheme:e}))),Se(()=>{this.c.fire({added:!1,scheme:e,provider:i}),this.h.delete(e),St(s)})}getProvider(e){return this.h.get(e)}async activateProvider(e){const i=[];this.f.fire({scheme:e,join(s){i.push(s)}}),!this.h.has(e)&&await ut.settled(i)}async canHandleResource(e){return await this.activateProvider(e.scheme),this.hasProvider(e)}hasProvider(e){return this.h.has(e.scheme)}hasCapability(e,i){const s=this.h.get(e.scheme);return!!(s&&s.capabilities&i)}listCapabilities(){return Ai.map(this.h,([e,i])=>({scheme:e,capabilities:i.capabilities}))}async j(e){if(!hp(e))throw new tt(g(2026,null,this.tb(e)),8);await this.activateProvider(e.scheme);const i=this.h.get(e.scheme);if(!i){const s=new es;throw s.message=g(2027,null,e.toString()),s}return i}async m(e){const i=await this.j(e);if(yi(i)||Pt(i)||na(i))return i;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite, FileReadStream nor FileOpenReadWriteClose capability which is needed for the read operation.`)}async n(e){const i=await this.j(e);if(yi(i)||Pt(i))return i;throw new Error(`Filesystem provider for scheme '${e.scheme}' neither has FileReadWrite nor FileOpenReadWriteClose capability which is needed for the write operation.`)}async resolve(e,i){try{return await this.s(e,i)}catch(s){throw xn(s)===z.FileNotFound?new tt(g(2028,null,this.tb(e)),1):Vi(s)}}async s(e,i){const s=await this.j(e),r=this.U(s),n=i?.resolveTo,o=i?.resolveSingleChildDescendants,a=i?.resolveMetadata,l=await s.stat(e);let c;return this.t(s,e,l,void 0,!!a,(u,f)=>(c||(c=ms.forUris(()=>!r),c.set(e,!0),n&&c.fill(!0,n)),c.get(u.resource)||c.findSuperstr(u.resource.with({query:null,fragment:null}))?!0:u.isDirectory&&o?f===1:!1))}async t(e,i,s,r,n,o){const{providerExtUri:a}=this.S(e),l={resource:i,name:a.basename(i),isFile:(s.type&ft.File)!==0,isDirectory:(s.type&ft.Directory)!==0,isSymbolicLink:(s.type&ft.SymbolicLink)!==0,mtime:s.mtime,ctime:s.ctime,size:s.size,readonly:!!((s.permissions??0)&vs.Readonly)||!!(e.capabilities&2048),locked:!!((s.permissions??0)&vs.Locked),etag:uh({mtime:s.mtime,size:s.size}),children:void 0};if(l.isDirectory&&o(l,r)){try{const c=await e.readdir(i),u=await ut.settled(c.map(async([f,d])=>{try{const p=a.joinPath(i,f),m=n?await e.stat(p):{type:d};return await this.t(e,p,m,c.length,n,o)}catch(p){return this.b.trace(p),null}}));l.children=is(u)}catch(c){this.b.trace(c),l.children=[]}return l}return l}async resolveAll(e){return ut.settled(e.map(async i=>{try{return{stat:await this.s(i.resource,i.options),success:!0}}catch(s){return this.b.trace(s),{stat:void 0,success:!1}}}))}async stat(e){const i=await this.j(e),s=await i.stat(e);return this.t(i,e,s,void 0,!0,()=>!1)}async exists(e){const i=await this.j(e);try{return!!await i.stat(e)}catch{return!1}}async canCreateFile(e,i){try{await this.u(e,i)}catch(s){return s}return!0}async u(e,i){if(!i?.overwrite&&await this.exists(e))throw new tt(g(2029,null,this.tb(e)),3,i)}async createFile(e,i=V.fromString(""),s){await this.u(e,s);const r=await this.writeFile(e,i);return this.r.fire(new ys(e,0,r)),r}async writeFile(e,i,s){const r=this.rb(await this.n(e),e),{providerExtUri:n}=this.S(r);let o=s;if(nh(r)&&!o?.atomic){const a=r.enforceAtomicWriteFile?.(e);a&&(o={...s,atomic:a})}try{let{stat:a,buffer:l}=await this.z(r,e,i,o);a||await this.W(r,n.dirname(e)),l||(l=await this.w(r,i)),!yi(r)||Pt(r)&&l instanceof V||Pt(r)&&nh(r)&&o?.atomic?await this.ib(r,e,o,l):await this.eb(r,e,o,l instanceof V?_p(l):l),this.r.fire(new ys(e,4))}catch(a){throw new tt(g(2030,null,this.tb(e),Vi(a).toString()),Me(a),o)}return this.resolve(e,{resolveMetadata:!0})}async w(e,i){let s;if(Pt(e)&&!(i instanceof V))if(rn(i)){const r=await Ap(i,3);r.ended?s=V.concat(r.buffer):s=r}else s=Dp(i,r=>V.concat(r),3);else s=i;return s}async z(e,i,s,r){const n=!!r?.unlock;if(n&&!(e.capabilities&8192))throw new Error(g(2031,null,this.tb(i)));if(!!r?.atomic){if(!(e.capabilities&32768))throw new Error(g(2032,null,this.tb(i)));if(!(e.capabilities&2))throw new Error(g(2033,null,this.tb(i)));if(n)throw new Error(g(2034,null,this.tb(i)))}let a;try{a=await e.stat(i)}catch{return Object.create(null)}if((a.type&ft.Directory)!==0)throw new tt(g(2035,null,this.tb(i)),0,r);this.sb(i,a);let l;if(typeof r?.mtime=="number"&&typeof r.etag=="string"&&r.etag!==ua&&typeof a.mtime=="number"&&typeof a.size=="number"&&r.mtime<a.mtime&&r.etag!==uh({mtime:r.mtime,size:a.size})){if(l=await this.w(e,s),l instanceof V&&l.byteLength===a.size)try{const{value:c}=await this.readFile(i,{limits:{size:a.size}});if(l.equals(c))return{stat:a,buffer:l}}catch{}throw new tt(g(2036,null),3,r)}return{stat:a,buffer:l}}async readFile(e,i,s){const r=await this.m(e);return i?.atomic?this.C(r,e,i,s):this.D(r,e,i,s)}async C(e,i,s,r){return new Promise((n,o)=>{this.db.queueFor(i,async()=>{try{const a=await this.D(e,i,s,r);n(a)}catch(a){o(a)}},this.S(e).providerExtUri)})}async D(e,i,s,r){const n=await this.F(e,i,{...s,preferUnbuffered:!0},r);return{...n,value:await Ti(n.value)}}async readFileStream(e,i,s){const r=await this.m(e);return this.F(r,e,i,s)}async F(e,i,s,r){const n=new rs(r);let o=s;oa(e)&&e.enforceAtomicReadFile?.(i)&&(o={...s,atomic:!0});const a=this.L(i,o).then(c=>c,c=>{throw n.dispose(!0),c});let l;try{return typeof o?.etag=="string"&&o.etag!==ua&&await a,o?.atomic&&oa(e)||!(yi(e)||na(e))||Pt(e)&&o?.preferUnbuffered?l=this.J(e,i,o):na(e)?l=this.H(e,i,n.token,o):l=this.I(e,i,n.token,o),l.on("end",()=>n.dispose()),l.on("error",()=>n.dispose()),{...await a,value:l}}catch(c){throw l&&await vu(l),this.G(c,i,o)}}G(e,i,s){const r=g(2037,null,this.tb(i),Vi(e).toString());return e instanceof ca?new ca(r,e.stat,s):e instanceof la?new la(r,e.fileOperationResult,e.size,e.options):new tt(r,Me(e),s)}H(e,i,s,r=Object.create(null)){const n=e.readFileStream(i,r,s);return yu(n,{data:o=>o instanceof V?o:V.wrap(o),error:o=>this.G(o,i,r)},o=>V.concat(o))}I(e,i,s,r=Object.create(null)){const n=Bp();return zf(e,i,n,o=>o,{...r,bufferSize:this.a,errorTransformer:o=>this.G(o,i,r)},s),n}J(e,i,s){const r=nn(n=>V.concat(n));return(async()=>{try{let n;s?.atomic&&oa(e)?n=await e.readFile(i,{atomic:!0}):n=await e.readFile(i),typeof s?.position=="number"&&(n=n.slice(s.position)),typeof s?.length=="number"&&(n=n.slice(0,s.length)),this.M(i,n.byteLength,s),r.end(V.wrap(n))}catch(n){r.error(n),r.end()}})(),r}async L(e,i){const s=await this.resolve(e,{resolveMetadata:!0});if(s.isDirectory)throw new tt(g(2038,null,this.tb(e)),0,i);if(typeof i?.etag=="string"&&i.etag!==ua&&i.etag===s.etag)throw new ca(g(2039,null),s,i);return this.M(e,s.size,i),s}M(e,i,s){if(typeof s?.limits?.size=="number"&&i>s.limits.size)throw new la(g(2040,null,this.tb(e)),7,i,s)}async canMove(e,i,s){return this.N(e,i,"move",s)}async canCopy(e,i,s){return this.N(e,i,"copy",s)}async N(e,i,s,r){if(e.toString()!==i.toString())try{const n=s==="move"?this.rb(await this.n(e),e):await this.m(e),o=this.rb(await this.n(i),i);await this.R(n,e,o,i,s,r)}catch(n){return n}return!0}async move(e,i,s){const r=this.rb(await this.n(e),e),n=this.rb(await this.n(i),i),o=await this.O(r,e,n,i,"move",!!s),a=await this.resolve(i,{resolveMetadata:!0});return this.r.fire(new ys(e,o==="move"?2:3,a)),a}async copy(e,i,s){const r=await this.m(e),n=this.rb(await this.n(i),i),o=await this.O(r,e,n,i,"copy",!!s),a=await this.resolve(i,{resolveMetadata:!0});return this.r.fire(new ys(e,o==="copy"?3:2,a)),a}async O(e,i,s,r,n,o){if(i.toString()===r.toString())return n;const{exists:a,isSameResourceWithDifferentPathCase:l}=await this.R(e,i,s,r,n,o);if(a&&!l&&o&&await this.del(r,{recursive:!0}),await this.W(s,this.S(s).providerExtUri.dirname(r)),n==="copy"){if(e===s&&ra(e))await e.copy(i,r,{overwrite:o});else{const c=await this.resolve(i);c.isDirectory?await this.Q(e,c,s,r):await this.P(e,i,s,r)}return n}else return e===s?(await e.rename(i,r,{overwrite:o}),n):(await this.O(e,i,s,r,"copy",o),await this.del(i,{recursive:!0}),"copy")}async P(e,i,s,r){if(yi(e)&&yi(s))return this.kb(e,i,s,r);if(yi(e)&&Pt(s))return this.qb(e,i,s,r);if(Pt(e)&&yi(s))return this.ob(e,i,s,r);if(Pt(e)&&Pt(s))return this.mb(e,i,s,r)}async Q(e,i,s,r){await s.mkdir(r),Array.isArray(i.children)&&await ut.settled(i.children.map(async n=>{const o=this.S(s).providerExtUri.joinPath(r,n.name);return n.isDirectory?this.Q(e,await this.resolve(n.resource),s,o):this.P(e,n.resource,s,o)}))}async R(e,i,s,r,n,o){let a=!1;if(e===s){const{providerExtUri:c,isPathCaseSensitive:u}=this.S(e);if(u||(a=c.isEqual(i,r)),a&&n==="copy")throw new Error(g(2041,null,this.tb(i),this.tb(r)));if(!a&&c.isEqualOrParent(r,i))throw new Error(g(2042,null,this.tb(i),this.tb(r)))}const l=await this.exists(r);if(l&&!a){if(!o)throw new tt(g(2043,null,this.tb(i),this.tb(r)),4);if(e===s){const{providerExtUri:c}=this.S(e);if(c.isEqualOrParent(i,r))throw new Error(g(2044,null,this.tb(i),this.tb(r)))}}return{exists:l,isSameResourceWithDifferentPathCase:a}}S(e){const i=this.U(e);return{providerExtUri:i?ee:lp,isPathCaseSensitive:i}}U(e){return!!(e.capabilities&1024)}async createFolder(e){const i=this.rb(await this.j(e),e);await this.W(i,e);const s=await this.resolve(e,{resolveMetadata:!0});return this.r.fire(new ys(e,0,s)),s}async W(e,i){const s=[],{providerExtUri:r}=this.S(e);for(;!r.isEqual(i,r.dirname(i));)try{if(((await e.stat(i)).type&ft.Directory)===0)throw new Error(g(2045,null,this.tb(i)));break}catch(n){if(xn(n)!==z.FileNotFound)throw n;s.push(r.basename(i)),i=r.dirname(i)}for(let n=s.length-1;n>=0;n--){i=r.joinPath(i,s[n]);try{await e.mkdir(i)}catch(o){if(xn(o)!==z.FileExists)throw o}}}async canDelete(e,i){try{await this.X(e,i)}catch(s){return s}return!0}async X(e,i){const s=this.rb(await this.j(e),e),r=!!i?.useTrash;if(r&&!(s.capabilities&4096))throw new Error(g(2046,null,this.tb(e)));const n=i?.atomic;if(n&&!(s.capabilities&65536))throw new Error(g(2047,null,this.tb(e)));if(r&&n)throw new Error(g(2048,null,this.tb(e)));let o;try{o=await s.stat(e)}catch{}if(o)this.sb(e,o);else throw new tt(g(2049,null,this.tb(e)),1);if(!!!i?.recursive){const l=await this.resolve(e);if(l.isDirectory&&Array.isArray(l.children)&&l.children.length>0)throw new Error(g(2050,null,this.tb(e)))}return s}async del(e,i){const s=await this.X(e,i);let r=i;if(Wg(s)&&!r?.atomic){const l=s.enforceAtomicDelete?.(e);l&&(r={...i,atomic:l})}const n=!!r?.useTrash,o=!!r?.recursive,a=r?.atomic??!1;await s.delete(e,{recursive:o,useTrash:n,atomic:a}),this.r.fire(new ys(e,1))}async cloneFile(e,i){const s=await this.j(e),r=this.rb(await this.n(i),i);if(!(s===r&&this.S(s).providerExtUri.isEqual(e,i)))return s===r&&rh(s)?s.cloneFile(e,i):(await this.W(r,this.S(r).providerExtUri.dirname(i)),s===r&&ra(s)?this.db.queueFor(e,()=>s.copy(e,i,{overwrite:!0}),this.S(s).providerExtUri):this.db.queueFor(e,()=>this.P(s,e,r,i),this.S(s).providerExtUri))}static{this.bb=0}createWatcher(e,i){return this.watch(e,{...i,correlationId:ul.bb++})}watch(e,i={recursive:!1,excludes:[]}){const s=new ot;let r=!1,n=()=>{r=!0};s.add(Se(()=>n())),(async()=>{try{const a=await this.cb(e,i);r?St(a):n=()=>St(a)}catch(a){this.b.error(a)}})();const o=i.correlationId;if(typeof o=="number"){const a=s.add(new N);return s.add(this.Y.event(c=>{c.correlates(o)&&a.fire(c)})),{onDidChange:a.event,dispose:()=>s.dispose()}}return s}async cb(e,i){const s=await this.j(e),r=ps([this.S(s).providerExtUri.getComparisonKey(e),i]);let n=this.ab.get(r);return n||(n={count:0,disposable:s.watch(e,i)},this.ab.set(r,n)),n.count+=1,Se(()=>{n&&(n.count--,n.count===0&&(St(n.disposable),this.ab.delete(r)))})}dispose(){super.dispose();for(const[,e]of this.ab)St(e.disposable);this.ab.clear()}async eb(e,i,s,r){return this.db.queueFor(i,async()=>{const n=await e.open(i,{create:!0,unlock:s?.unlock??!1});try{rn(r)||To(r)?await this.fb(e,n,r):await this.gb(e,n,r)}catch(o){throw Vi(o)}finally{await e.close(n)}},this.S(e).providerExtUri)}async fb(e,i,s){let r=0,n;if(To(s)){if(s.buffer.length>0){const o=V.concat(s.buffer);await this.hb(e,i,o,o.byteLength,r,0),r+=o.byteLength}if(s.ended)return;n=s.stream}else n=s;return new Promise((o,a)=>{Uo(n,{onData:async l=>{n.pause();try{await this.hb(e,i,l,l.byteLength,r,0)}catch(c){return a(c)}r+=l.byteLength,setTimeout(()=>n.resume())},onError:l=>a(l),onEnd:()=>o()})})}async gb(e,i,s){let r=0,n;for(;(n=s.read())!==null;)await this.hb(e,i,n,n.byteLength,r,0),r+=n.byteLength}async hb(e,i,s,r,n,o){let a=0;for(;a<r;){const l=await e.write(i,n+a,s.buffer,o+a,r-a);a+=l}}async ib(e,i,s,r){return this.db.queueFor(i,()=>this.jb(e,i,s,r),this.S(e).providerExtUri)}async jb(e,i,s,r){let n;r instanceof V?n=r:rn(r)?n=await Ti(r):To(r)?n=await Vp(r):n=jp(r),await e.writeFile(i,n.buffer,{create:!0,overwrite:!0,unlock:s?.unlock??!1,atomic:s?.atomic??!1})}async kb(e,i,s,r){return this.db.queueFor(r,()=>this.lb(e,i,s,r),this.S(s).providerExtUri)}async lb(e,i,s,r){let n,o;try{n=await e.open(i,{create:!1}),o=await s.open(r,{create:!0,unlock:!1});const a=V.alloc(this.a);let l=0,c=0,u=0;do u=await e.read(n,l,a.buffer,c,a.byteLength-c),await this.hb(s,o,a,u,l,c),l+=u,c+=u,c===a.byteLength&&(c=0);while(u>0)}catch(a){throw Vi(a)}finally{await ut.settled([typeof n=="number"?e.close(n):Promise.resolve(),typeof o=="number"?s.close(o):Promise.resolve()])}}async mb(e,i,s,r){return this.db.queueFor(r,()=>this.nb(e,i,s,r),this.S(s).providerExtUri)}async nb(e,i,s,r){return s.writeFile(r,await e.readFile(i),{create:!0,overwrite:!0,unlock:!1,atomic:!1})}async ob(e,i,s,r){return this.db.queueFor(r,()=>this.pb(e,i,s,r),this.S(s).providerExtUri)}async pb(e,i,s,r){const n=await s.open(r,{create:!0,unlock:!1});try{const o=await e.readFile(i);await this.hb(s,n,V.wrap(o),o.byteLength,0,0)}catch(o){throw Vi(o)}finally{await s.close(n)}}async qb(e,i,s,r){const n=await Ti(this.I(e,i,pe.None));await this.ib(s,r,void 0,n)}rb(e,i){if(e.capabilities&2048)throw new tt(g(2051,null,this.tb(i)),6);return e}sb(e,i){if((i.permissions??0)&vs.Readonly)throw new tt(g(2052,null,this.tb(e)),6)}tb(e){return e.scheme===ie.file?e.fsPath:e.toString(!0)}};hl=ul=__decorate([__param(0,he)],hl);import{promises as Hi}from"fs";var yr="**",Bf="/",Wn="[/\\\\]",Hn="[^/\\\\]",O2=/\//g;function qf(t,e){switch(t){case 0:return"";case 1:return`${Hn}*?`;default:return`(?:${Wn}|${Hn}+${Wn}${e?`|${Wn}${Hn}+`:""})*?`}}function Wf(t,e){if(!t)return[];const i=[];let s=!1,r=!1,n="";for(const o of t){switch(o){case e:if(!s&&!r){i.push(n),n="";continue}break;case"{":s=!0;break;case"}":s=!1;break;case"[":r=!0;break;case"]":r=!1;break}n+=o}return n&&i.push(n),i}function Hf(t){if(!t)return"";let e="";const i=Wf(t,Bf);if(i.every(s=>s===yr))e=".*";else{let s=!1;i.forEach((r,n)=>{if(r===yr){if(s)return;e+=qf(2,n===i.length-1)}else{let o=!1,a="",l=!1,c="";for(const u of r){if(u!=="}"&&o){a+=u;continue}if(l&&(u!=="]"||!c)){let f;u==="-"?f=u:(u==="^"||u==="!")&&!c?f="^":u===Bf?f="":f=ls(u),c+=f;continue}switch(u){case"{":o=!0;continue;case"[":l=!0;continue;case"}":{const d=`(?:${Wf(a,",").map(p=>Hf(p)).join("|")})`;e+=d,o=!1,a="";break}case"]":{e+="["+c+"]",l=!1,c="";break}case"?":e+=Hn;continue;case"*":e+=qf(1);continue;default:e+=ls(u)}}n<i.length-1&&(i[n+1]!==yr||n+2<i.length)&&(e+=Wn)}s=r===yr})}return e}var N2=/^\*\*\/\*\.[\w\.-]+$/,C2=/^\*\*\/([\w\.-]+)\/?$/,F2=/^{\*\*\/\*?[\w\.-]+\/?(,\*\*\/\*?[\w\.-]+\/?)*}$/,T2=/^{\*\*\/\*?[\w\.-]+(\/(\*\*)?)?(,\*\*\/\*?[\w\.-]+(\/(\*\*)?)?)*}$/,U2=/^\*\*((\/[\w\.-]+)+)\/?$/,M2=/^([\w\.-]+(\/[\w\.-]+)*)\/?$/,Gf=new Mr(1e4),Jf=function(){return!1},Qt=function(){return null};function fl(t,e){if(!t)return Qt;let i;typeof t!="string"?i=t.pattern:i=t,i=i.trim();const s=`${i}_${!!e.trimForExclusions}`;let r=Gf.get(s);if(r)return Qf(r,t);let n;return N2.test(i)?r=j2(i.substr(4),i):(n=C2.exec(dl(i,e)))?r=_2(n[1],i):(e.trimForExclusions?T2:F2).test(i)?r=V2(i,e):(n=U2.exec(dl(i,e)))?r=Zf(n[1].substr(1),i,!0):(n=M2.exec(dl(i,e)))?r=Zf(n[1],i,!1):r=z2(i),Gf.set(s,r),Qf(r,t)}function Qf(t,e){if(typeof e=="string")return t;const i=function(s,r){return Hs(s,e.base,!at)?t(N0(s.substr(e.base.length),Ye),r):null};return i.allBasenames=t.allBasenames,i.allPaths=t.allPaths,i.basenames=t.basenames,i.patterns=t.patterns,i}function dl(t,e){return e.trimForExclusions&&t.endsWith("/**")?t.substr(0,t.length-2):t}function j2(t,e){return function(i,s){return typeof i=="string"&&i.endsWith(t)?e:null}}function _2(t,e){const i=`/${t}`,s=`\\${t}`,r=function(o,a){return typeof o!="string"?null:a?a===t?e:null:o===t||o.endsWith(i)||o.endsWith(s)?e:null},n=[t];return r.basenames=n,r.patterns=[e],r.allBasenames=n,r}function V2(t,e){const i=Xf(t.slice(1,-1).split(",").map(a=>fl(a,e)).filter(a=>a!==Qt),t),s=i.length;if(!s)return Qt;if(s===1)return i[0];const r=function(a,l){for(let c=0,u=i.length;c<u;c++)if(i[c](a,l))return t;return null},n=i.find(a=>!!a.allBasenames);n&&(r.allBasenames=n.allBasenames);const o=i.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(r.allPaths=o),r}function Zf(t,e,i){const s=Ye===se.sep,r=s?t:t.replace(O2,Ye),n=Ye+r,o=se.sep+t;let a;return i?a=function(l,c){return typeof l=="string"&&(l===r||l.endsWith(n)||!s&&(l===t||l.endsWith(o)))?e:null}:a=function(l,c){return typeof l=="string"&&(l===r||!s&&l===t)?e:null},a.allPaths=[(i?"*/":"./")+t],a}function z2(t){try{const e=new RegExp(`^${Hf(t)}$`);return function(i){return e.lastIndex=0,typeof i=="string"&&e.test(i)?t:null}}catch{return Qt}}function B2(t,e={}){if(!t)return Jf;if(typeof t=="string"||q2(t)){const i=fl(t,e);if(i===Qt)return Jf;const s=function(r,n){return!!i(r,n)};return i.allBasenames&&(s.allBasenames=i.allBasenames),i.allPaths&&(s.allPaths=i.allPaths),s}return W2(t,e)}function q2(t){const e=t;return e?typeof e.base=="string"&&typeof e.pattern=="string":!1}function W2(t,e){const i=Xf(Object.getOwnPropertyNames(t).map(a=>H2(a,t[a],e)).filter(a=>a!==Qt)),s=i.length;if(!s)return Qt;if(!i.some(a=>!!a.requiresSiblings)){if(s===1)return i[0];const a=function(u,f){let d;for(let p=0,m=i.length;p<m;p++){const w=i[p](u,f);if(typeof w=="string")return w;Lo(w)&&(d||(d=[]),d.push(w))}return d?(async()=>{for(const p of d){const m=await p;if(typeof m=="string")return m}return null})():null},l=i.find(u=>!!u.allBasenames);l&&(a.allBasenames=l.allBasenames);const c=i.reduce((u,f)=>f.allPaths?u.concat(f.allPaths):u,[]);return c.length&&(a.allPaths=c),a}const r=function(a,l,c){let u,f;for(let d=0,p=i.length;d<p;d++){const m=i[d];m.requiresSiblings&&c&&(l||(l=Nt(a)),u||(u=l.substr(0,l.length-Uc(a).length)));const w=m(a,l,u,c);if(typeof w=="string")return w;Lo(w)&&(f||(f=[]),f.push(w))}return f?(async()=>{for(const d of f){const p=await d;if(typeof p=="string")return p}return null})():null},n=i.find(a=>!!a.allBasenames);n&&(r.allBasenames=n.allBasenames);const o=i.reduce((a,l)=>l.allPaths?a.concat(l.allPaths):a,[]);return o.length&&(r.allPaths=o),r}function H2(t,e,i){if(e===!1)return Qt;const s=fl(t,i);if(s===Qt)return Qt;if(typeof e=="boolean")return s;if(e){const r=e.when;if(typeof r=="string"){const n=(o,a,l,c)=>{if(!c||!s(o,a))return null;const u=r.replace("$(basename)",()=>l),f=c(u);return Lo(f)?f.then(d=>d?t:null):f?t:null};return n.requiresSiblings=!0,n}}return s}function Xf(t,e){const i=t.filter(a=>!!a.basenames);if(i.length<2)return t;const s=i.reduce((a,l)=>{const c=l.basenames;return c?a.concat(c):a},[]);let r;if(e){r=[];for(let a=0,l=s.length;a<l;a++)r.push(e)}else r=i.reduce((a,l)=>{const c=l.patterns;return c?a.concat(c):a},[]);const n=function(a,l){if(typeof a!="string")return null;if(!l){let u;for(u=a.length;u>0;u--){const f=a.charCodeAt(u-1);if(f===47||f===92)break}l=a.substr(u)}const c=s.indexOf(l);return c!==-1?r[c]:null};n.basenames=s,n.patterns=r,n.allBasenames=s;const o=t.filter(a=>!a.basenames);return o.push(n),o}function Kf(t,e){return ts(t,e,(i,s)=>typeof i=="string"&&typeof s=="string"?i===s:typeof i!="string"&&typeof s!="string"?i.base===s.base&&i.pattern===s.pattern:!1)}function Yf(t){return typeof t.correlationId=="number"}function G2(t){return t.recursive===!0}var e1=class ld extends J{static{this.a=5}constructor(e,i,s,r){super(),this.h=e,this.j=i,this.m=s,this.n=r,this.c=this.B(new _s),this.f=void 0,this.g=0}s(){const e=new ot;this.c.value=e,this.b=this.r(e),this.b.setVerboseLogging(this.m),e.add(this.b.onDidChangeFile(i=>this.h(i))),e.add(this.b.onDidLogMessage(i=>this.j(i))),e.add(this.b.onDidError(i=>this.t(i.error,i.request)))}t(e,i){this.u(e,i)?this.g<ld.a&&this.f?(this.y(`restarting watcher after unexpected error: ${e}`),this.w(this.f)):this.y(`gave up attempting to restart watcher after unexpected error: ${e}`):this.y(e)}u(e,i){return!(!this.n.restartOnError||i||e.indexOf("No space left on device")!==-1||e.indexOf("EMFILE")!==-1)}w(e){this.g++,this.s(),this.watch(e)}async watch(e){this.f=e,await this.b?.watch(e)}async setVerboseLogging(e){this.m=e,await this.b?.setVerboseLogging(e)}y(e){this.j({type:"error",message:`[File Watcher (${this.n.type})] ${e}`})}z(e){this.j({type:"trace",message:`[File Watcher (${this.n.type})] ${e}`})}dispose(){return this.b=void 0,super.dispose()}},J2=class extends e1{constructor(t,e,i){super(t,e,i,{type:"node.js",restartOnError:!1})}},Q2=class extends e1{constructor(t,e,i){super(t,e,i,{type:"universal",restartOnError:!0})}};function t1(t){return t.map(e=>({type:e.type,resource:k.revive(e.resource),cId:e.cId}))}function Z2(t){const e=new K2;for(const i of t)e.processEvent(i);return e.coalesce()}function X2(t,e){return typeof e=="string"&&!e.startsWith(yr)&&!qs(e)?{base:t,pattern:e}:e}function i1(t,e){const i=[];for(const s of e)i.push(B2(X2(t,s)));return i}var K2=class{constructor(){this.a=new Set,this.b=new Map}c(t){return at?t.resource.fsPath:t.resource.fsPath.toLowerCase()}processEvent(t){const e=this.b.get(this.c(t));let i=!1;if(e){const s=e.type,r=t.type;e.resource.fsPath!==t.resource.fsPath&&(t.type===2||t.type===1)?i=!0:s===1&&r===2?(this.b.delete(this.c(t)),this.a.delete(e)):s===2&&r===1?e.type=0:s===1&&r===0||(e.type=r)}else i=!0;i&&(this.a.add(t),this.b.set(this.c(t),t))}coalesce(){const t=[],e=[];return Array.from(this.a).filter(i=>i.type!==2?(t.push(i),!1):!0).sort((i,s)=>i.resource.fsPath.length-s.resource.fsPath.length).filter(i=>e.some(s=>Jg(i.resource.fsPath,s,!at))?!1:(e.push(i.resource.fsPath),!0)).concat(t)}};function Y2(t,e){if(typeof e=="number")switch(t.type){case 1:return(e&4)===0;case 2:return(e&8)===0;case 0:return(e&2)===0}return!1}function e5(t){if(typeof t=="number"){const e=[];return t&4&&e.push("Added"),t&8&&e.push("Deleted"),t&2&&e.push("Updated"),e.length===0?"<all>":`[${e.join(", ")}]`}return"<none>"}var t5=class extends J{constructor(t,e){super(),this.a=t,this.b=e,this.c=this.B(new N),this.onDidChangeFile=this.c.event,this.g=this.B(new N),this.onDidWatchError=this.g.event,this.m=[],this.n=this.B(new Ci(this.h(this.m.length))),this.z=[],this.C=this.B(new Ci(this.h(this.z.length)))}watch(t,e){return e.recursive||this.b?.watcher?.forceUniversal?this.r(t,e):this.D(t,e)}h(t){return t>200?500:0}r(t,e){const i=this.s(t,e),s=ic(this.m,i);return this.t(),Se(()=>{s(),this.t()})}s(t,e){const i={path:this.M(t),excludes:e.excludes,includes:e.includes,recursive:e.recursive,filter:e.filter,correlationId:e.correlationId};if(G2(i)){const s=this.b?.watcher?.recursive?.usePolling;s===!0?i.pollingInterval=this.b?.watcher?.recursive?.pollingInterval??5e3:Array.isArray(s)&&s.includes(i.path)&&(i.pollingInterval=this.b?.watcher?.recursive?.pollingInterval??5e3)}return i}t(){this.n.trigger(()=>this.u(),this.h(this.m.length)).catch(t=>At(t))}u(){return this.j||(this.j=this.B(this.w(t=>this.c.fire(t1(t)),t=>this.I(t),this.a.getLevel()===F.Trace)),this.B(this.a.onDidChangeLogLevel(()=>{this.j?.setVerboseLogging(this.a.getLevel()===F.Trace)}))),this.j.watch(this.m)}D(t,e){const i={path:this.M(t),excludes:e.excludes,includes:e.includes,recursive:!1,filter:e.filter,correlationId:e.correlationId},s=ic(this.z,i);return this.F(),Se(()=>{s(),this.F()})}F(){this.C.trigger(()=>this.G(),this.h(this.z.length)).catch(t=>At(t))}G(){return this.y||(this.y=this.B(this.H(t=>this.c.fire(t1(t)),t=>this.I(t),this.a.getLevel()===F.Trace)),this.B(this.a.onDidChangeLogLevel(()=>{this.y?.setVerboseLogging(this.a.getLevel()===F.Trace)}))),this.y.watch(this.z)}I(t){t.type==="error"&&this.g.fire(t.message),this.J(t)}J(t){this.a[t.type](t.message)}L(t){return pi(t.fsPath)}M(t){const e=this.L(t);return V0(e)}},s1;(function(t){t[t.Promise=100]="Promise",t[t.PromiseCancel=101]="PromiseCancel",t[t.EventListen=102]="EventListen",t[t.EventDispose=103]="EventDispose"})(s1||(s1={}));function r1(t){switch(t){case 100:return"req";case 101:return"cancel";case 102:return"subscribe";case 103:return"unsubscribe"}}var n1;(function(t){t[t.Initialize=200]="Initialize",t[t.PromiseSuccess=201]="PromiseSuccess",t[t.PromiseError=202]="PromiseError",t[t.PromiseErrorObj=203]="PromiseErrorObj",t[t.EventFire=204]="EventFire"})(n1||(n1={}));function o1(t){switch(t){case 200:return"init";case 201:return"reply:";case 202:case 203:return"replyErr:";case 204:return"event:"}}var Gi;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Idle=1]="Idle"})(Gi||(Gi={}));function Is(t){let e=0;for(let i=0;;i+=7){const s=t.read(1);if(e|=(s.buffer[0]&127)<<i,!(s.buffer[0]&128))return e}}var i5=xi(0);function Ds(t,e){if(e===0){t.write(i5);return}let i=0;for(let r=e;r!==0;r=r>>>7)i++;const s=V.alloc(i);for(let r=0;e!==0;r++)s.buffer[r]=e&127,e=e>>>7,e>0&&(s.buffer[r]|=128);t.write(s)}var s5=class{constructor(t){this.b=t,this.a=0}read(t){const e=this.b.slice(this.a,this.a+t);return this.a+=e.byteLength,e}},r5=class{constructor(){this.a=[]}get buffer(){return V.concat(this.a)}write(t){this.a.push(t)}},Xe;(function(t){t[t.Undefined=0]="Undefined",t[t.String=1]="String",t[t.Buffer=2]="Buffer",t[t.VSBuffer=3]="VSBuffer",t[t.Array=4]="Array",t[t.Object=5]="Object",t[t.Int=6]="Int"})(Xe||(Xe={}));function xi(t){const e=V.alloc(1);return e.writeUInt8(t,0),e}var Ji={Undefined:xi(Xe.Undefined),String:xi(Xe.String),Buffer:xi(Xe.Buffer),VSBuffer:xi(Xe.VSBuffer),Array:xi(Xe.Array),Object:xi(Xe.Object),Uint:xi(Xe.Int)},n5=typeof Buffer<"u";function pl(t,e){if(typeof e>"u")t.write(Ji.Undefined);else if(typeof e=="string"){const i=V.fromString(e);t.write(Ji.String),Ds(t,i.byteLength),t.write(i)}else if(n5&&Buffer.isBuffer(e)){const i=V.wrap(e);t.write(Ji.Buffer),Ds(t,i.byteLength),t.write(i)}else if(e instanceof V)t.write(Ji.VSBuffer),Ds(t,e.byteLength),t.write(e);else if(Array.isArray(e)){t.write(Ji.Array),Ds(t,e.length);for(const i of e)pl(t,i)}else if(typeof e=="number"&&(e|0)===e)t.write(Ji.Uint),Ds(t,e);else{const i=V.fromString(JSON.stringify(e));t.write(Ji.Object),Ds(t,i.byteLength),t.write(i)}}function gl(t){switch(t.read(1).readUInt8(0)){case Xe.Undefined:return;case Xe.String:return t.read(Is(t)).toString();case Xe.Buffer:return t.read(Is(t)).buffer;case Xe.VSBuffer:return t.read(Is(t));case Xe.Array:{const i=Is(t),s=[];for(let r=0;r<i;r++)s.push(gl(t));return s}case Xe.Object:return JSON.parse(t.read(Is(t)).toString());case Xe.Int:return Is(t)}}var a1;(function(t){t[t.LocalSide=0]="LocalSide",t[t.OtherSide=1]="OtherSide"})(a1||(a1={}));var l1=class{constructor(t,e=null){this.l=t,this.a=!1,this.b=Gi.Uninitialized,this.d=new Set,this.f=new Map,this.g=0,this.k=new N,this.onDidInitialize=this.k.event,this.h=this.l.onMessage(i=>this.s(i)),this.j=e}getChannel(t){const e=this;return{call(i,s,r){return e.a?Promise.reject(new Te):e.m(t,i,s,r)},listen(i,s){return e.a?oe.None:e.o(t,i,s)}}}m(t,e,i,s=pe.None){const r=this.g++,o={id:r,type:100,channelName:t,name:e,arg:i};if(s.isCancellationRequested)return Promise.reject(new Te);let a,l;return new Promise((u,f)=>{if(s.isCancellationRequested)return f(new Te);const d=()=>{const w=y=>{switch(y.type){case 201:this.f.delete(r),u(y.data);break;case 202:{this.f.delete(r);const b=new Error(y.data.message);b.stack=Array.isArray(y.data.stack)?y.data.stack.join(`
`):y.data.stack,b.name=y.data.name,f(b);break}case 203:this.f.delete(r),f(y.data);break}};this.f.set(r,w),this.p(o)};let p=null;this.b===Gi.Idle?d():(p=ni(w=>this.u()),p.then(()=>{p=null,d()}));const m=()=>{p?(p.cancel(),p=null):this.p({id:r,type:101}),f(new Te)};a=s.onCancellationRequested(m),l={dispose:ec(()=>{m(),a.dispose()})},this.d.add(l)}).finally(()=>{a?.dispose(),this.d.delete(l)})}o(t,e,i){const s=this.g++,n={id:s,type:102,channelName:t,name:e,arg:i};let o=null;const a=new N({onWillAddFirstListener:()=>{const c=()=>{this.d.add(a),this.p(n)};this.b===Gi.Idle?c():(o=ni(u=>this.u()),o.then(()=>{o=null,c()}))},onDidRemoveLastListener:()=>{o?(o.cancel(),o=null):(this.d.delete(a),this.p({id:s,type:103}))}}),l=c=>a.fire(c.data);return this.f.set(s,l),a.event}p(t){switch(t.type){case 100:case 102:{const e=this.q([t.type,t.id,t.channelName,t.name],t.arg);this.j?.logOutgoing(e,t.id,0,`${r1(t.type)}: ${t.channelName}.${t.name}`,t.arg);return}case 101:case 103:{const e=this.q([t.type,t.id]);this.j?.logOutgoing(e,t.id,0,r1(t.type));return}}}q(t,e=void 0){const i=new r5;return pl(i,t),pl(i,e),this.r(i.buffer)}r(t){try{return this.l.send(t),t.byteLength}catch{return 0}}s(t){const e=new s5(t),i=gl(e),s=gl(e),r=i[0];switch(r){case 200:return this.j?.logIncoming(t.byteLength,0,0,o1(r)),this.t({type:i[0]});case 201:case 202:case 204:case 203:return this.j?.logIncoming(t.byteLength,i[1],0,o1(r),s),this.t({type:i[0],id:i[1],data:s})}}t(t){if(t.type===200){this.b=Gi.Idle,this.k.fire();return}this.f.get(t.id)?.(t)}get onDidInitializePromise(){return oe.toPromise(this.onDidInitialize)}u(){return this.b===Gi.Idle?Promise.resolve():this.onDidInitializePromise}dispose(){this.a=!0,this.h&&(this.h.dispose(),this.h=null),St(this.d.values()),this.d.clear()}};__decorate([ae],l1.prototype,"onDidInitializePromise",null);function o5(t){let e=!1;return{call(i,s,r){return e?t.call(i,s,r):Js(0).then(()=>e=!0).then(()=>t.call(i,s,r))},listen(i,s){if(e)return t.listen(i,s);const r=new s0;return Js(0).then(()=>e=!0).then(()=>r.input=t.listen(i,s)),r.event}}}var ml;(function(t){function e(n,o,a){const l=n,c=a&&a.disableMarshalling,u=new Map;for(const f in l)s(f)&&u.set(f,oe.buffer(l[f],!0,void 0,o));return new class{listen(f,d,p){const m=u.get(d);if(m)return m;const w=l[d];if(typeof w=="function"){if(r(d))return w.call(l,p);if(s(d))return u.set(d,oe.buffer(l[d],!0,void 0,o)),u.get(d)}throw new es(`Event not found: ${d}`)}call(f,d,p){const m=l[d];if(typeof m=="function"){if(!c&&Array.isArray(p))for(let y=0;y<p.length;y++)p[y]=$s(p[y]);let w=m.apply(l,p);return w instanceof Promise||(w=Promise.resolve(w)),w}throw new es(`Method not found: ${d}`)}}}t.fromService=e;function i(n,o){const a=o&&o.disableMarshalling;return new Proxy({},{get(l,c){if(typeof c=="string")return o?.properties?.has(c)?o.properties.get(c):r(c)?function(u){return n.listen(c,u)}:s(c)?n.listen(c):async function(...u){let f;o&&!Qe(o.context)?f=[o.context,...u]:f=u;const d=await n.call(c,f);return a?d:$s(d)};throw new es(`Property not found: ${String(c)}`)}})}t.toService=i;function s(n){return n[0]==="o"&&n[1]==="n"&&jc(n.charCodeAt(2))}function r(n){return/^onDynamic/.test(n)&&jc(n.charCodeAt(9))}})(ml||(ml={}));import{fork as a5}from"child_process";function l5(t){const e=t;return e&&typeof e.type=="string"&&typeof e.severity=="string"}function c5(t){const e=[];let i;try{const s=JSON.parse(t.arguments),r=s[s.length-1];r&&r.__$stack&&(s.pop(),i=r.__$stack),e.push(...s)}catch{e.push("Unable to log remote console arguments",t.arguments)}return{args:e,stack:i}}function u5(t){if(!t)return t;const e=t.indexOf(`
`);return e===-1?t:t.substring(0,e)}function h5(t,e){const{args:i,stack:s}=c5(t),r=typeof i[0]=="string"&&i.length===1;let n=u5(s);n&&(n=`(${n.trim()})`);let o=[];if(typeof i[0]=="string"?n&&r?o=[`%c[${e}] %c${i[0]} %c${n}`,As("blue"),As(""),As("grey")]:o=[`%c[${e}] %c${i[0]}`,As("blue"),As(""),...i.slice(1)]:o=[`%c[${e}]%`,As("blue"),...i],n&&!r&&o.push(n),typeof console[t.severity]!="function")throw new Error("Unknown console method");console[t.severity].apply(console,o)}function As(t){return`color: ${t}`}import{promises as c1}from"fs";var u1;(function(t){t[t.stdout=0]="stdout",t[t.stderr=1]="stderr"})(u1||(u1={}));var h1;(function(t){t[t.Success=0]="Success",t[t.Unknown=1]="Unknown",t[t.AccessDenied=2]="AccessDenied",t[t.ProcessNotFound=3]="ProcessNotFound"})(h1||(h1={}));function f5(t){t&&(delete t.DEBUG,at&&delete t.LD_PRELOAD)}function d5(t=Lt){return t.comspec||"cmd.exe"}function p5(t){let e=[],i=!1;const s=function(r){if(i){e.push(r);return}(!t.send(r,o=>{if(o&&console.error(o),i=!1,e.length>0){const a=e.slice(0);e=[],a.forEach(l=>s(l))}})||me)&&(i=!0)};return{send:s}}async function g5(t){if(await ce.exists(t)){let e;try{e=await c1.stat(t)}catch(i){i.message.startsWith("EACCES")&&(e=await c1.lstat(t))}return e?!e.isDirectory():!1}return!1}function f1(t=Lt){return(Au(t,"PATHEXT")||".COM;.EXE;.BAT;.CMD").split(";")}async function m5(t,e,i,s=Lt,r=g5){if(qs(t))return await r(t)?t:void 0;if(e===void 0&&(e=os()),Ot(t)!=="."){const l=U(e,t);return await r(l)?l:void 0}const o=Au(s,"PATH");if(i===void 0&&xe(o)&&(i=o.split(D0)),i===void 0||i.length===0){const l=U(e,t);return await r(l)?l:void 0}for(const l of i){let c;if(qs(l)?c=U(l,t):c=U(e,l,t),me){const u=f1(s).map(async f=>{const d=c+f;return await r(d)?d:void 0});for(const f of u){const d=await f;if(d)return d}}if(await r(c))return c}const a=U(e,t);return await r(a)?a:void 0}var w5=class{constructor(t,e){this.i=t,this.j=e,this.c=new Set,this.g=new Map,this.h=new N,this.onDidProcessExit=this.h.event;const i=e&&e.timeout?e.timeout:6e4;this.b=new nu(i),this.d=null,this.f=null}getChannel(t){const e=this;return{call(i,s,r){return e.k(t,i,s,r)},listen(i,s){return e.l(t,i,s)}}}k(t,e,i,s=pe.None){if(!this.b)return Promise.reject(new Error("disposed"));if(s.isCancellationRequested)return Promise.reject(Kl());this.b.cancel();const r=this.n(t),n=ni(l=>r.call(e,i,l)),o=s.onCancellationRequested(()=>n.cancel()),a=Se(()=>n.cancel());return this.c.add(a),n.finally(()=>{o.dispose(),this.c.delete(a),this.c.size===0&&this.b&&this.b.trigger(()=>this.o())}),n}l(t,e,i){if(!this.b)return oe.None;this.b.cancel();let s;const r=new N({onWillAddFirstListener:()=>{s=this.n(t).listen(e,i)(r.fire,r),this.c.add(s)},onDidRemoveLastListener:()=>{this.c.delete(s),s.dispose(),this.c.size===0&&this.b&&this.b.trigger(()=>this.o())}});return r.event}get m(){if(!this.f){const t=this.j&&this.j.args?this.j.args:[],e=Object.create(null);e.env={...ai(process.env),VSCODE_PARENT_PID:String(process.pid)},this.j&&this.j.env&&(e.env={...e.env,...this.j.env}),this.j&&this.j.freshExecArgv&&(e.execArgv=[]),this.j&&typeof this.j.debug=="number"&&(e.execArgv=["--nolazy","--inspect="+this.j.debug]),this.j&&typeof this.j.debugBrk=="number"&&(e.execArgv=["--nolazy","--inspect-brk="+this.j.debugBrk]),e.execArgv===void 0&&(e.execArgv=process.execArgv.filter(u=>!/^--inspect(-brk)?=/.test(u)).filter(u=>!u.startsWith("--vscode-"))),f5(e.env),this.d=a5(this.i,t,e);const i=new N,r=oe.fromNodeEventEmitter(this.d,"message",u=>u)(u=>{if(l5(u)){h5(u,`IPC Library: ${this.j.serverName}`);return}i.fire(V.wrap(Buffer.from(u,"base64")))}),n=this.j.useQueue?p5(this.d):this.d,o=u=>this.d&&this.d.connected&&n.send(u.buffer.toString("base64")),a=i.event,l={send:o,onMessage:a};this.f=new l1(l);const c=()=>this.o();process.once("exit",c),this.d.on("error",u=>console.warn('IPC "'+this.j.serverName+'" errored with '+u)),this.d.on("exit",(u,f)=>{process.removeListener("exit",c),r.dispose(),this.c.forEach(d=>St(d)),this.c.clear(),u!==0&&f!=="SIGTERM"&&console.warn('IPC "'+this.j.serverName+'" crashed with exit code '+u+" and signal "+f),this.b?.cancel(),this.o(),this.h.fire({code:u,signal:f})})}return this.f}n(t){let e=this.g.get(t);return e||(e=this.m.getChannel(t),this.g.set(t,e)),e}o(){this.f&&(this.d&&(this.d.kill(),this.d=null),this.f=null,this.g.clear())}dispose(){this.h.dispose(),this.b?.cancel(),this.b=void 0,this.o(),this.c.clear()}},v5=class extends Q2{constructor(t,e,i){super(t,e,i),this.s()}r(t){const e=t.add(new w5(Gs.asFileUri("bootstrap-fork").fsPath,{serverName:"File Watcher",args:["--type=fileWatcher"],env:{VSCODE_ESM_ENTRYPOINT:"vs/platform/files/node/watcher/watcherMain",VSCODE_PIPE_LOGGING:"true",VSCODE_VERBOSE_LOGGING:"true"}}));return t.add(e.onDidProcessExit(({code:i,signal:s})=>this.t(`terminated by itself with code ${i}, signal: ${s} (ETERM)`))),ml.toService(o5(e.getChannel("watcher")))}};import{watchFile as y5,unwatchFile as b5}from"fs";var E5=class extends J{constructor(){super(),this.a=this.B(new N),this.onDidChangeFile=this.a.event,this.b=this.B(new N),this.onDidLogMessage=this.b.event,this.c=this.B(new N),this.f=this.c.event,this.g=new Map,this.h=new Map,this.j=this.B(new vo),this.m=new Set,this.n=this.B(new Ci(this.y())),this.r=5007,this.s=new Oo,this.R=!1,this.B(this.f(t=>this.z({id:this.u(t),correlationId:this.t(t)?t.correlationId:void 0,path:t.path})))}t(t){return Yf(t)}u(t){return this.t(t)?t.correlationId:ps(t)}async watch(t){this.s.isSettled||this.s.complete(),this.s=new Oo;try{this.g.clear(),this.h.clear();for(const e of t)this.t(e)?this.g.set(e.correlationId,e):this.h.set(this.u(e),e);for(const[e]of this.j)!this.h.has(e)&&!this.g.has(e)&&(this.j.deleteAndDispose(e),this.m.delete(e));return await this.w(!1)}finally{this.s.complete()}}w(t){const e=[];for(const[i,s]of[...this.h,...this.g])this.j.has(i)||e.push(s);return this.n.trigger(()=>this.N(e),t?this.y():0).catch(i=>At(i))}y(){return 800}isSuspended(t){const e=this.u(t);return this.m.has(e)?"polling":this.j.has(e)}async z(t){if(this.j.has(t.id))return;const e=new ot;this.j.set(t.id,e),await this.s.p,!e.isDisposed&&(this.D(t,e),this.w(!0))}C(t){this.j.deleteAndDispose(t.id),this.m.delete(t.id),this.w(!1)}D(t,e){this.F(t,e)?(this.P(`reusing an existing recursive watcher to monitor ${t.path}`),this.m.delete(t.id)):(this.G(t,e),this.m.add(t.id))}F(t,e){const i=this.O?.subscribe(t.path,(s,r)=>{e.isDisposed||(s?this.D(t,e):r?.type===1&&this.H(t))});return i?(e.add(i),!0):!1}G(t,e){let i=!1;const s=(r,n)=>{if(e.isDisposed)return;const o=this.I(r),a=this.I(n),l=i;i=o,!o&&(a||l)&&this.H(t)};this.P(`starting fs.watchFile() on ${t.path} (correlationId: ${t.correlationId})`);try{y5(t.path,{persistent:!1,interval:this.r},s)}catch(r){this.Q(`fs.watchFile() failed with error ${r} on path ${t.path} (correlationId: ${t.correlationId})`)}e.add(Se(()=>{this.P(`stopping fs.watchFile() on ${t.path} (correlationId: ${t.correlationId})`);try{b5(t.path,s)}catch(r){this.Q(`fs.unwatchFile() failed with error ${r} on path ${t.path} (correlationId: ${t.correlationId})`)}}))}H(t){this.P(`detected ${t.path} exists again, resuming watcher (correlationId: ${t.correlationId})`);const e={resource:k.file(t.path),type:1,cId:t.correlationId};this.a.fire([e]),this.J(e,t),this.C(t)}I(t){return t.ctimeMs===0&&t.ino===0}async stop(){this.j.clearAndDisposeAll(),this.m.clear()}J(t,e){if(this.R){const i=` >> normalized ${t.type===1?"[ADDED]":t.type===2?"[DELETED]":"[CHANGED]"} ${t.resource.fsPath}`;this.L(i,e)}}L(t,e){this.R&&this.P(`${t}${typeof e.correlationId=="number"?` <${e.correlationId}> `:""}`)}M(t){return`${t.path} (excludes: ${t.excludes.length>0?t.excludes:"<none>"}, includes: ${t.includes&&t.includes.length>0?JSON.stringify(t.includes):"<all>"}, filter: ${e5(t.filter)}, correlationId: ${typeof t.correlationId=="number"?t.correlationId:"<none>"})`}async setVerboseLogging(t){this.R=t}};import{watch as x5,promises as S5}from"fs";import*as d1 from"fs";async function $5(t){try{return await ce.realpath(t)}catch{const i=P5(t);return await d1.promises.access(i,d1.constants.R_OK),i}}function P5(t){return Po(pi(t),Ye)}var k5=class ao extends J{static{this.a=100}static{this.b=75}get isReusingRecursiveWatcher(){return this.r}get failed(){return this.s}constructor(e,i,s,r,n,o){super(),this.t=e,this.u=i,this.w=s,this.y=r,this.z=n,this.C=o,this.c=this.B(new cu({maxWorkChunkSize:100,throttleDelay:200,maxBufferedWork:1e4},a=>this.w(a))),this.f=this.B(new vp(a=>this.M(a),ao.b)),this.m=new rs,this.n=new Ni(async()=>{let a=this.t.path;try{a=await $5(this.t.path),this.t.path!==a&&this.Q(`correcting a path to watch that seems to be a symbolic link (original: ${this.t.path}, real: ${a})`)}catch{}return a}),this.r=!1,this.s=!1,this.g=i1(this.t.path,this.t.excludes),this.h=this.t.includes?i1(this.t.path,this.t.includes):void 0,this.j=Yf(this.t)?this.t.filter:void 0,this.ready=this.D()}async D(){try{const e=await S5.stat(this.t.path);if(this.m.token.isCancellationRequested)return;this.B(await this.G(e.isDirectory()))}catch(e){e.code!=="ENOENT"?this.O(e):this.Q(`ignoring a path for watching who's stat info failed to resolve: ${this.t.path} (error: ${e})`),this.F()}}F(){this.s=!0,this.y?.()}async G(e){const i=new ot;return this.H(e,i)?(this.Q(`reusing an existing recursive watcher for ${this.t.path}`),this.r=!0):(this.r=!1,await this.I(e,i)),i}H(e,i){if(e)return!1;const s=k.file(this.t.path),r=this.u?.subscribe(this.t.path,async(n,o)=>{if(!i.isDisposed)if(n){const a=await this.G(e);i.isDisposed?a.dispose():i.add(a)}else o&&(typeof o.cId=="number"||typeof this.t.correlationId=="number")&&this.L({resource:s,type:o.type,cId:this.t.correlationId},!0)});return r?(i.add(r),!0):!1}async I(e,i){const s=await this.n.value;if(this.m.token.isCancellationRequested)return;if(Rt&&Hs(s,"/Volumes/",!0)){this.O(`Refusing to watch ${s} for changes using fs.watch() for possibly being a network share where watching is unreliable and unstable.`);return}const r=new rs(this.m.token);i.add(Se(()=>r.dispose(!0)));const n=new ot;i.add(n);try{const o=k.file(this.t.path),a=Nt(s),l=x5(s);n.add(Se(()=>{l.removeAllListeners(),l.close()})),this.Q(`Started watching: '${s}'`);const c=new Set;if(e)try{for(const f of await ce.readdir(s))c.add(f)}catch(f){this.O(f)}if(r.token.isCancellationRequested)return;const u=new Map;n.add(Se(()=>{for(const[,f]of u)f.dispose();u.clear()})),l.on("error",(f,d)=>{r.token.isCancellationRequested||(this.O(`Failed to watch ${s} for changes using fs.watch() (${f}, ${d})`),this.F())}),l.on("change",(f,d)=>{if(r.token.isCancellationRequested)return;this.C&&this.R(`[raw] ["${f}"] ${d}`);let p="";if(d&&(p=d.toString(),Rt&&(p=za(p))),!(!p||f!=="change"&&f!=="rename"))if(e)if(f==="rename"){u.get(p)?.dispose();const m=setTimeout(async()=>{if(u.delete(p),Qr(p,a,!at)&&!await ce.exists(s)){this.J(o);return}if(r.token.isCancellationRequested)return;const w=await this.N(U(s,p));if(r.token.isCancellationRequested)return;let y;w?c.has(p)?y=0:(y=1,c.add(p)):(c.delete(p),y=2),this.L({resource:W(o,p),type:y,cId:this.t.correlationId})},ao.a);u.set(p,Se(()=>clearTimeout(m)))}else{let m;c.has(p)?m=0:(m=1,c.add(p)),this.L({resource:W(o,p),type:m,cId:this.t.correlationId})}else if(f==="rename"||!Qr(p,a,!at)){const m=setTimeout(async()=>{const w=await ce.exists(s);r.token.isCancellationRequested||(w?(this.L({resource:o,type:0,cId:this.t.correlationId},!0),n.add(await this.G(!1))):this.J(o))},ao.a);n.clear(),n.add(Se(()=>clearTimeout(m)))}else this.L({resource:o,type:0,cId:this.t.correlationId},!0)})}catch(o){if(r.token.isCancellationRequested)return;this.O(`Failed to watch ${s} for changes using fs.watch() (${o.toString()})`),this.F()}}J(e){this.P("Watcher shutdown because watched path got deleted"),this.L({resource:e,type:2,cId:this.t.correlationId},!0),this.f.flush(),this.F()}L(e,i=!1){this.m.token.isCancellationRequested||(this.C&&this.R(`${e.type===1?"[ADDED]":e.type===2?"[DELETED]":"[CHANGED]"} ${e.resource.fsPath}`),!i&&this.g.some(s=>s(e.resource.fsPath))?this.C&&this.R(` >> ignored (excluded) ${e.resource.fsPath}`):!i&&this.h&&this.h.length>0&&!this.h.some(s=>s(e.resource.fsPath))?this.C&&this.R(` >> ignored (not included) ${e.resource.fsPath}`):this.f.work(e))}M(e){const i=Z2(e),s=[];for(const n of i){if(Y2(n,this.j)){this.C&&this.R(` >> ignored (filtered) ${n.resource.fsPath}`);continue}s.push(n)}if(s.length===0)return;if(this.C)for(const n of s)this.R(` >> normalized ${n.type===1?"[ADDED]":n.type===2?"[DELETED]":"[CHANGED]"} ${n.resource.fsPath}`);this.c.work(s)?this.c.pending>0&&this.Q(`started throttling events due to large amount of file change events at once (pending: ${this.c.pending}, most recent change: ${s[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`):this.P(`started ignoring events due to too many file change events at once (incoming: ${s.length}, most recent change: ${s[0].resource.fsPath}). Use 'files.watcherExclude' setting to exclude folders with lots of changing files (e.g. compilation output).`)}async N(e){if(at)return ce.exists(e);try{const i=Nt(e);return(await ce.readdir(Ot(e))).some(r=>r===i)}catch(i){return this.Q(i),!1}}setVerboseLogging(e){this.C=e}O(e){this.m.token.isCancellationRequested||this.z?.({type:"error",message:`[File Watcher (node.js)] ${e}`})}P(e){this.m.token.isCancellationRequested||this.z?.({type:"warn",message:`[File Watcher (node.js)] ${e}`})}Q(e){!this.m.token.isCancellationRequested&&this.C&&this.z?.({type:"trace",message:`[File Watcher (node.js)] ${e}`})}R(e){!this.m.token.isCancellationRequested&&this.C&&this.Q(`${e}${typeof this.t.correlationId=="number"?` <${this.t.correlationId}> `:""}`)}dispose(){this.m.dispose(!0),super.dispose()}},I5=class extends E5{get watchers(){return this.S.values()}constructor(t){super(),this.O=t,this.onDidError=oe.None,this.S=new Map,this.U=this.B(new _s)}async N(t){t=this.cb(t);const e=[],i=new Set(Array.from(this.watchers));for(const s of t){const r=this.S.get(this.Z(s));r&&Kf(r.request.excludes,s.excludes)&&Kf(r.request.includes,s.includes)?i.delete(r):e.push(s)}e.length&&this.P(`Request to start watching: ${e.map(s=>this.M(s)).join(",")}`),i.size&&this.P(`Request to stop watching: ${Array.from(i).map(s=>this.M(s.request)).join(",")}`),this.U.clear();for(const s of i)this.bb(s);this.Y().work(e)}Y(){return this.U.value=new cu({maxWorkChunkSize:100,throttleDelay:100,maxBufferedWork:Number.MAX_VALUE},t=>{for(const e of t)this.ab(e)}),this.U.value}Z(t){return typeof t.correlationId=="number"?t.correlationId:this.$(t.path)}$(t){return at?t:t.toLowerCase()}ab(t){const e=new k5(t,this.O,s=>this.a.fire(s),()=>this.c.fire(t),s=>this.b.fire(s),this.R),i={request:t,instance:e};this.S.set(this.Z(t),i)}async stop(){await super.stop();for(const t of this.watchers)this.bb(t)}bb(t){this.P("stopping file watcher",t),this.S.delete(this.Z(t.request)),t.instance.dispose()}cb(t){const e=new Map;for(const i of t){let s=e.get(i.correlationId);s||(s=new Map,e.set(i.correlationId,s));const r=this.$(i.path);s.has(r)&&this.P(`ignoring a request for watching who's path is already watched: ${this.M(i)}`),s.set(r,i)}return Array.from(e.values()).map(i=>Array.from(i.values())).flat()}async setVerboseLogging(t){super.setVerboseLogging(t);for(const e of this.watchers)e.instance.setVerboseLogging(t)}P(t,e){this.R&&this.b.fire({type:"trace",message:this.fb(t,e)})}Q(t){this.b.fire({type:"warn",message:this.fb(t)})}fb(t,e){return e?`[File Watcher (node.js)] ${t} (${this.M(e.request)})`:`[File Watcher (node.js)] ${t}`}},D5=class extends J2{constructor(t,e,i){super(t,e,i),this.s()}r(t){return t.add(new I5(void 0))}},A5=class Rr extends t5{static{this.N=!1}constructor(e,i){super(e,i),this.onDidChangeCapabilities=oe.None,this.R=new Je(s=>Ro.getComparisonKey(s)),this.Z=new Map,this.$=new Map,this.ab=new Map}get capabilities(){return this.O||(this.O=253982,at&&(this.O|=1024)),this.O}async stat(e){try{const{stat:i,symbolicLink:s}=await mt.stat(this.L(e));return{type:this.Q(i,s),ctime:i.birthtime.getTime(),mtime:i.mtime.getTime(),size:i.size,permissions:(i.mode&128)===0?vs.Locked:void 0}}catch(i){throw this.jb(i)}}async P(e){try{return await this.stat(e)}catch{return}}async readdir(e){try{const i=await ce.readdir(this.L(e),{withFileTypes:!0}),s=[];return await Promise.all(i.map(async r=>{try{let n;r.isSymbolicLink()?n=(await this.stat(W(e,r.name))).type:n=this.Q(r),s.push([r.name,n])}catch(n){this.a.trace(n)}})),s}catch(i){throw this.jb(i)}}Q(e,i){let s;return i?.dangling?s=ft.Unknown:e.isFile()?s=ft.File:e.isDirectory()?s=ft.Directory:s=ft.Unknown,i&&(s|=ft.SymbolicLink),s}async S(e){const i=this.L(e);this.U(`[Disk FileSystemProvider]: createResourceLock() - request to acquire resource lock (${i})`);let s;for(;s=this.R.get(e);)this.U(`[Disk FileSystemProvider]: createResourceLock() - waiting for resource lock to be released (${i})`),await s.wait();const r=new ou;return this.R.set(e,r),this.U(`[Disk FileSystemProvider]: createResourceLock() - new resource lock created (${i})`),Se(()=>{this.U(`[Disk FileSystemProvider]: createResourceLock() - resource lock dispose() (${i})`),this.R.get(e)===r&&(this.U(`[Disk FileSystemProvider]: createResourceLock() - resource lock removed from resource-lock map (${i})`),this.R.delete(e)),this.U(`[Disk FileSystemProvider]: createResourceLock() - resource lock barrier open() (${i})`),r.open()})}async readFile(e,i){let s;try{i?.atomic&&(this.U(`[Disk FileSystemProvider]: atomic read operation started (${this.L(e)})`),s=await this.S(e));const r=this.L(e);return await Hi.readFile(r)}catch(r){throw this.jb(r)}finally{s?.dispose()}}U(e){Rr.N&&this.a.trace(e)}readFileStream(e,i,s){const r=nn(n=>V.concat(n.map(o=>V.wrap(o))).buffer);return zf(this,e,r,n=>n.buffer,{...i,bufferSize:256*1024},s),r}async writeFile(e,i,s){return s?.atomic!==!1&&s?.atomic?.postfix&&await this.W(e)?this.X(e,W(cp(e),`${us(e)}${s.atomic.postfix}`),i,s):this.Y(e,i,s)}async W(e){try{const i=this.L(e),{symbolicLink:s}=await mt.stat(i);if(s)return!1}catch{}return!0}async X(e,i,s,r){const n=new ot;try{n.add(await this.S(e)),n.add(await this.S(i)),await this.Y(i,s,r,!0);try{await this.rename(i,e,{overwrite:!0})}catch(o){try{await this.delete(i,{recursive:!1,useTrash:!1,atomic:!1})}catch{}throw o}}finally{n.dispose()}}async Y(e,i,s,r){let n;try{const o=this.L(e);if(!s.create||!s.overwrite){if(await ce.exists(o)){if(!s.overwrite)throw hi(g(2056,null),z.FileExists)}else if(!s.create)throw hi(g(2057,null),z.FileNotFound)}n=await this.open(e,{create:!0,unlock:s.unlock},r),await this.write(n,0,i,0,i.byteLength)}catch(o){throw await this.kb(e,o)}finally{typeof n=="number"&&await this.close(n)}}static{this.bb=!0}static configureFlushOnWrite(e){Rr.bb=e}async open(e,i,s){const r=this.L(e);let n;ws(i)&&!s&&(n=await this.S(e));let o;try{if(ws(i)&&i.unlock)try{const{stat:a}=await mt.stat(r);a.mode&128||await Hi.chmod(r,a.mode|128)}catch(a){a.code!=="ENOENT"&&this.a.trace(a)}if(me&&ws(i))try{o=await ce.open(r,"r+"),await ce.ftruncate(o,0)}catch(a){if(a.code!=="ENOENT"&&this.a.trace(a),typeof o=="number"){try{await ce.close(o)}catch(l){this.a.trace(l)}o=void 0}}typeof o!="number"&&(o=await ce.open(r,ws(i)?"w":"r"))}catch(a){throw n?.dispose(),ws(i)?await this.kb(e,a):this.jb(a)}if(this.Z.set(o,0),ws(i)&&this.ab.set(o,e),n){const a=this.$.get(o);this.U(`[Disk FileSystemProvider]: open() - storing lock for handle ${o} (${r})`),this.$.set(o,n),a&&(this.U(`[Disk FileSystemProvider]: open() - disposing a previous lock that was still stored on same handle ${o} (${r})`),a.dispose())}return o}async close(e){const i=this.$.get(e);try{if(this.Z.delete(e),this.ab.delete(e)&&Rr.bb)try{await ce.fdatasync(e)}catch(s){Rr.configureFlushOnWrite(!1),this.a.error(s)}return await ce.close(e)}catch(s){throw this.jb(s)}finally{i&&(this.$.get(e)===i&&(this.U(`[Disk FileSystemProvider]: close() - resource lock removed from handle-lock map ${e}`),this.$.delete(e)),this.U(`[Disk FileSystemProvider]: close() - disposing lock for handle ${e}`),i.dispose())}}async read(e,i,s,r,n){const o=this.cb(e,i);let a=null;try{a=(await ce.read(e,s,r,n,o)).bytesRead}catch(l){throw this.jb(l)}finally{this.db(e,o,a)}return a}cb(e,i){return i===this.Z.get(e)?null:i}db(e,i,s){const r=this.Z.get(e);typeof r=="number"&&(typeof i=="number"||(typeof s=="number"?this.Z.set(e,r+s):this.Z.delete(e)))}async write(e,i,s,r,n){return Ep(()=>this.eb(e,i,s,r,n),100,3)}async eb(e,i,s,r,n){const o=this.cb(e,i);let a=null;try{a=(await ce.write(e,s,r,n,o)).bytesWritten}catch(l){throw await this.kb(this.ab.get(e),l)}finally{this.db(e,o,a)}return a}async mkdir(e){try{await Hi.mkdir(this.L(e))}catch(i){throw this.jb(i)}}async delete(e,i){try{const s=this.L(e);if(i.recursive){let r;i?.atomic!==!1&&i.atomic.postfix&&(r=U(Ot(s),`${Nt(s)}${i.atomic.postfix}`)),await ce.rm(s,ks.MOVE,r)}else try{await Hi.unlink(s)}catch(r){if(r.code==="EPERM"||r.code==="EISDIR"){let n=!1;try{const{stat:o,symbolicLink:a}=await mt.stat(s);n=o.isDirectory()&&!a}catch{}if(n)await Hi.rmdir(s);else throw r}else throw r}}catch(s){throw this.jb(s)}}async rename(e,i,s){const r=this.L(e),n=this.L(i);if(r!==n)try{await this.fb(e,i,"move",s.overwrite),await ce.rename(r,n)}catch(o){throw(o.code==="EINVAL"||o.code==="EBUSY"||o.code==="ENAMETOOLONG")&&(o=new Error(g(2058,null,Nt(r),Nt(Ot(n)),o.toString()))),this.jb(o)}}async copy(e,i,s){const r=this.L(e),n=this.L(i);if(r!==n)try{await this.fb(e,i,"copy",s.overwrite),await ce.copy(r,n,{preserveSymlinks:!0})}catch(o){throw(o.code==="EINVAL"||o.code==="EBUSY"||o.code==="ENAMETOOLONG")&&(o=new Error(g(2059,null,Nt(r),Nt(Ot(n)),o.toString()))),this.jb(o)}}async fb(e,i,s,r){const n=this.L(e),o=this.L(i);let a=!1;if(!!(this.capabilities&1024)||(a=Qr(n,o,!0)),a){if(s==="copy")throw hi(g(2060,null),z.FileExists);if(s==="move")return}const c=await this.P(e);if(!c)throw hi(g(2061,null),z.FileNotFound);const u=await this.P(i);if(u){if(!r)throw hi(g(2062,null),z.FileExists);(c.type&ft.File)!==0&&(u.type&ft.File)!==0||await this.delete(i,{recursive:!0,useTrash:!1,atomic:!1})}}async cloneFile(e,i){return this.gb(e,i,!1)}async gb(e,i,s){const r=this.L(e),n=this.L(i),o=!!(this.capabilities&1024);if(Qr(r,n,!o))return;const a=new ot;try{a.add(await this.S(e)),a.add(await this.S(i)),s&&await Hi.mkdir(Ot(n),{recursive:!0}),await Hi.copyFile(r,n)}catch(l){if(l.code==="ENOENT"&&!s)return this.gb(e,i,!0);throw this.jb(l)}finally{a.dispose()}}w(e,i,s){return new v5(r=>e(r),r=>i(r),s)}H(e,i,s){return new D5(r=>e(r),r=>i(r),s)}jb(e){if(e instanceof aa)return e;let i=e,s;switch(e.code){case"ENOENT":s=z.FileNotFound;break;case"EISDIR":s=z.FileIsADirectory;break;case"ENOTDIR":s=z.FileNotADirectory;break;case"EEXIST":s=z.FileExists;break;case"EPERM":case"EACCES":s=z.NoPermissions;break;case"ERR_UNC_HOST_NOT_ALLOWED":i=`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`,s=z.Unknown;break;default:s=z.Unknown}return hi(i,s)}async kb(e,i){let s=this.jb(i);if(e&&s.code===z.NoPermissions)try{const{stat:r}=await mt.stat(this.L(e));r.mode&128||(s=hi(i,z.FileWriteLocked))}catch(r){this.a.trace(r)}return s}},qe=class{constructor(t,e=[],i=!1){this.ctor=t,this.staticArguments=e,this.supportsDelayedInstantiation=i}},R5=class{constructor(t,e){this.key=t,this.data=e,this.incoming=new Map,this.outgoing=new Map}},p1=class{constructor(t){this.b=t,this.a=new Map}roots(){const t=[];for(const e of this.a.values())e.outgoing.size===0&&t.push(e);return t}insertEdge(t,e){const i=this.lookupOrInsertNode(t),s=this.lookupOrInsertNode(e);i.outgoing.set(s.key,s),s.incoming.set(i.key,i)}removeNode(t){const e=this.b(t);this.a.delete(e);for(const i of this.a.values())i.outgoing.delete(e),i.incoming.delete(e)}lookupOrInsertNode(t){const e=this.b(t);let i=this.a.get(e);return i||(i=new R5(e,t),this.a.set(e,i)),i}lookup(t){return this.a.get(this.b(t))}isEmpty(){return this.a.size===0}toString(){const t=[];for(const[e,i]of this.a)t.push(`${e}
	(-> incoming)[${[...i.incoming.keys()].join(", ")}]
	(outgoing ->)[${[...i.outgoing.keys()].join(",")}]
`);return t.join(`
`)}findCycleSlow(){for(const[t,e]of this.a){const i=new Set([t]),s=this.c(e,i);if(s)return s}}c(t,e){for(const[i,s]of t.outgoing){if(e.has(i))return[...e,i].join(" -> ");e.add(i);const r=this.c(s,e);if(r)return r;e.delete(i)}}},g1=class{constructor(...t){this.a=new Map;for(const[e,i]of t)this.set(e,i)}set(t,e){const i=this.a.get(t);return this.a.set(t,e),i}has(t){return this.a.has(t)}get(t){return this.a.get(t)}},L5=!1,m1=class extends Error{constructor(t){super("cyclic dependency between services"),this.message=t.findCycleSlow()??`UNABLE to detect cycle, dumping graph: 
${t.toString()}`}},O5=class zl{constructor(e=new g1,i=!1,s,r=L5){this.i=e,this.j=i,this.k=s,this.l=r,this.f=!1,this.g=new Set,this.h=new Set,this.t=new Set,this.i.set(tn,this),this._globalGraph=r?s?._globalGraph??new p1(n=>n):void 0}dispose(){if(!this.f){this.f=!0,St(this.h),this.h.clear();for(const e of this.g)fc(e)&&e.dispose();this.g.clear()}}m(){if(this.f)throw new Error("InstantiationService has been disposed")}createChild(e,i){this.m();const s=this,r=new class extends zl{dispose(){s.h.delete(r),super.dispose()}}(e,this.j,this,this.l);return this.h.add(r),i?.add(r),r}invokeFunction(e,...i){this.m();const s=wl.traceInvocation(this.l,e);let r=!1;try{return e({get:o=>{if(r)throw Yl("service accessor is only valid during the invocation of its target method");const a=this.s(o,s);if(!a)throw new Error(`[invokeFunction] unknown service '${o}'`);return a}},...i)}finally{r=!0,s.stop()}}createInstance(e,...i){this.m();let s,r;return e instanceof qe?(s=wl.traceCreation(this.l,e.ctor),r=this.o(e.ctor,e.staticArguments.concat(i),s)):(s=wl.traceCreation(this.l,e),r=this.o(e,i,s)),s.stop(),r}o(e,i=[],s){const r=Ft.getServiceDependencies(e).sort((a,l)=>a.index-l.index),n=[];for(const a of r){const l=this.s(a.id,s);l||this.y(`[createInstance] ${e.name} depends on UNKNOWN service ${a.id}.`,!1),n.push(l)}const o=r.length>0?r[0].index:i.length;if(i.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${i.length} static arguments`);const a=o-i.length;a>0?i=i.concat(new Array(a)):i=i.slice(0,o)}return Reflect.construct(e,i.concat(n))}q(e,i){if(this.i.get(e)instanceof qe)this.i.set(e,i);else if(this.k)this.k.q(e,i);else throw new Error("illegalState - setting UNKNOWN service instance")}r(e){const i=this.i.get(e);return!i&&this.k?this.k.r(e):i}s(e,i){this._globalGraph&&this.c&&this._globalGraph.insertEdge(this.c,String(e));const s=this.r(e);return s instanceof qe?this.u(e,s,i.branch(e,!0)):(i.branch(e,!1),s)}u(e,i,s){if(this.t.has(e))throw new Error(`illegal state - RECURSIVELY instantiating service '${e}'`);this.t.add(e);try{return this.v(e,i,s)}finally{this.t.delete(e)}}v(e,i,s){const r=new p1(l=>l.id.toString());let n=0;const o=[{id:e,desc:i,_trace:s}],a=new Set;for(;o.length;){const l=o.pop();if(!a.has(String(l.id))){if(a.add(String(l.id)),r.lookupOrInsertNode(l),n++>1e3)throw new m1(r);for(const c of Ft.getServiceDependencies(l.desc.ctor)){const u=this.r(c.id);if(u||this.y(`[createInstance] ${e} depends on ${c.id} which is NOT registered.`,!0),this._globalGraph?.insertEdge(String(l.id),String(c.id)),u instanceof qe){const f={id:c.id,desc:u,_trace:l._trace.branch(c.id,!0)};r.insertEdge(l,f),o.push(f)}}}}for(;;){const l=r.roots();if(l.length===0){if(!r.isEmpty())throw new m1(r);break}for(const{data:c}of l){if(this.r(c.id)instanceof qe){const f=this.w(c.id,c.desc.ctor,c.desc.staticArguments,c.desc.supportsDelayedInstantiation,c._trace);this.q(c.id,f)}r.removeNode(c)}}return this.r(e)}w(e,i,s=[],r,n){if(this.i.get(e)instanceof qe)return this.x(e,i,s,r,n,this.g);if(this.k)return this.k.w(e,i,s,r,n);throw new Error(`illegalState - creating UNKNOWN service instance ${i.name}`)}x(e,i,s=[],r,n,o){if(r){const a=new zl(void 0,this.j,this,this.l);a.c=String(e);const l=new Map,c=new bp(()=>{const u=a.o(i,s,n);for(const[f,d]of l){const p=u[f];if(typeof p=="function")for(const m of d)m.disposable=p.apply(u,m.listener)}return l.clear(),o.add(u),u});return new Proxy(Object.create(null),{get(u,f){if(!c.isInitialized&&typeof f=="string"&&(f.startsWith("onDid")||f.startsWith("onWill"))){let m=l.get(f);return m||(m=new pc,l.set(f,m)),(y,b,S)=>{if(c.isInitialized)return c.value[f](y,b,S);{const I={listener:[y,b,S],disposable:void 0},M=m.push(I);return Se(()=>{M(),I.disposable?.dispose()})}}}if(f in u)return u[f];const d=c.value;let p=d[f];return typeof p!="function"||(p=p.bind(d),u[f]=p),p},set(u,f,d){return c.value[f]=d,!0},getPrototypeOf(u){return i.prototype}})}else{const a=this.o(i,s,n);return o.add(a),a}}y(e,i){if(i&&console.warn(e),this.j)throw new Error(e)}},w1;(function(t){t[t.None=0]="None",t[t.Creation=1]="Creation",t[t.Invocation=2]="Invocation",t[t.Branch=3]="Branch"})(w1||(w1={}));var wl=class Zt{static{this.all=new Set}static{this.c=new class extends Zt{constructor(){super(0,null)}stop(){}branch(){return this}}}static traceInvocation(e,i){return e?new Zt(2,i.name||new Error().stack.split(`
`).slice(3,4).join(`
`)):Zt.c}static traceCreation(e,i){return e?new Zt(1,i.name):Zt.c}static{this.f=0}constructor(e,i){this.type=e,this.name=i,this.g=Date.now(),this.h=[]}branch(e,i){const s=new Zt(3,e.toString());return this.h.push([e,i,s]),s}stop(){const e=Date.now()-this.g;Zt.f+=e;let i=!1;function s(n,o){const a=[],l=new Array(n+1).join("	");for(const[c,u,f]of o.h)if(u&&f){i=!0,a.push(`${l}CREATES -> ${c}`);const d=s(n+1,f);d&&a.push(d)}else a.push(`${l}uses -> ${c}`);return a.join(`
`)}const r=[`${this.type===1?"CREATE":"CALL"} ${this.name}`,`${s(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Zt.f.toFixed(2)}ms)`];(e>2||i)&&Zt.all.add(r.join(`
`))}};function N5(t){return t.tags.find(e=>e.startsWith("lp-"))?.split("lp-")[1]}var C5=ue("languagePackService"),vl=class extends J{constructor(e){super(),this.c=e}async getAvailableLanguages(){const e=new rs;setTimeout(()=>e.cancel(),1e3);let i;try{i=await this.c.query({text:'category:"language packs"',pageSize:20},e.token)}catch{return[]}const r=i.firstPage.filter(n=>n.properties.localizedLanguages?.length&&n.tags.some(o=>o.startsWith("lp-"))).map(n=>{const o=n.properties.localizedLanguages?.[0],a=N5(n);return{...this.f(a,o,n),extensionId:n.identifier.id,galleryExtension:n}});return r.push(this.f("en","English")),r}f(e,i,s){const r=i??e;let n;if(r!==e&&(n=`(${e})`),e.toLowerCase()===qt.toLowerCase()&&(n??="",n+=g(2071,null)),s?.installCount){n??="";const o=s.installCount;let a;o>1e6?a=`${Math.floor(o/1e5)/10}M`:o>1e3?a=`${Math.floor(o/1e3)}K`:a=String(o),n+=` $(cloud-download) ${a}`}return{id:e,label:r,description:n}}};vl=__decorate([__param(0,bi)],vl);import*as F5 from"fs";import{createHash as T5}from"crypto";var yl=class extends vl{constructor(e,i,s,r){super(s),this.h=e,this.j=r,this.g=this.B(new bl(i,r)),this.h.registerParticipant({postInstall:async n=>this.m(n),postUninstall:async n=>this.n(n)})}async getBuiltInExtensionTranslationsUri(e,i){const r=(await this.g.getLanguagePacks())[i];if(!r){this.j.warn(`No language pack found for ${i}`);return}const n=r.translations[e];return n?k.file(n):void 0}async getInstalledLanguages(){const e=await this.g.getLanguagePacks(),i=Object.keys(e).map(s=>{const r=e[s];return{...this.f(s,r.label),extensionId:r.extensions[0].extensionIdentifier.id}});return i.push(this.f("en","English")),i.sort((s,r)=>s.label.localeCompare(r.label)),i}async m(e){e&&e.manifest&&e.manifest.contributes&&e.manifest.contributes.localizations&&e.manifest.contributes.localizations.length&&(this.j.info("Adding language packs from the extension",e.identifier.id),await this.update())}async n(e){const i=await this.g.getLanguagePacks();Object.keys(i).some(s=>i[s]&&i[s].extensions.some(r=>Q(r.extensionIdentifier,e.identifier)))&&(this.j.info("Removing language packs from the extension",e.identifier.id),await this.update())}async update(){const[e,i]=await Promise.all([this.g.getLanguagePacks(),this.h.getInstalled()]),s=await this.g.update(i);return!ts(Object.keys(e),Object.keys(s))}};yl=__decorate([__param(0,va),__param(1,kt),__param(2,bi),__param(3,he)],yl);var bl=class extends J{constructor(e,i){super(),this.j=i,this.c={},this.f=U(e.userDataPath,"languagepacks.json"),this.g=new Qs}getLanguagePacks(){return this.g.size||!this.h?this.s().then(()=>this.c):Promise.resolve(this.c)}update(e){return this.s(i=>{Object.keys(i).forEach(s=>delete i[s]),this.m(i,...e)}).then(()=>this.c)}m(e,...i){for(const s of i)s&&s.manifest&&s.manifest.contributes&&s.manifest.contributes.localizations&&s.manifest.contributes.localizations.length&&this.n(e,s);Object.keys(e).forEach(s=>this.r(e[s]))}n(e,i){const s=i.identifier,r=i.manifest.contributes&&i.manifest.contributes.localizations?i.manifest.contributes.localizations:[];for(const n of r)if(i.location.scheme===ie.file&&U5(n)){let o=e[n.languageId];o||(o={hash:"",extensions:[],translations:{},label:n.localizedLanguageName??n.languageName},e[n.languageId]=o);const a=o.extensions.filter(l=>Q(l.extensionIdentifier,s))[0];a?a.version=i.manifest.version:o.extensions.push({extensionIdentifier:s,version:i.manifest.version});for(const l of n.translations)o.translations[l.id]=U(i.location.fsPath,l.path)}}r(e){if(e){const i=T5("md5");for(const s of e.extensions)i.update(s.extensionIdentifier.uuid||s.extensionIdentifier.id).update(s.version);e.hash=i.digest("hex")}}s(e=()=>null){return this.g.queue(()=>{let i=null;return F5.promises.readFile(this.f,"utf8").then(void 0,s=>s.code==="ENOENT"?Promise.resolve("{}"):Promise.reject(s)).then(s=>{try{return JSON.parse(s)}catch{return{}}}).then(s=>(i=e(s),s)).then(s=>{for(const n of Object.keys(s))s[n]||delete s[n];this.c=s,this.h=!0;const r=JSON.stringify(this.c);return this.j.debug("Writing language packs",r),ce.writeFile(this.f,r)}).then(()=>i,s=>this.j.error(s))})}};bl=__decorate([__param(0,kt),__param(1,he)],bl);function U5(t){if(typeof t.languageId!="string"||!Array.isArray(t.translations)||t.translations.length===0)return!1;for(const e of t.translations)if(typeof e.id!="string"||typeof e.path!="string")return!1;return!(t.languageName&&typeof t.languageName!="string"||t.localizedLanguageName&&typeof t.localizedLanguageName!="string")}function M5(t,e){const i=[];for(const s of new Set(Ai.concat(t.keys(),e.keys())))t.get(s)!==e.get(s)&&i.push(s);return i}var El=class extends Zu{constructor(e,i,s){super(),this.j=e,this.m=i,this.n=s,this.c=this.B(new Ci(500));const r=oe.filter(i.onDidFilesChange,n=>n.affects(e));this.B(i.watch(e)),this.B(r(()=>this.c.trigger(()=>this.u())))}async h(){await this.u()}async t(){const e=new Map;try{const i=await this.m.readFile(this.j),s=JSON.parse(i.value.toString());if(!Oe(s))throw new Error("Policy file isn't a JSON object");for(const r of Object.keys(s))this.policyDefinitions[r]&&e.set(r,s[r])}catch(i){i.fileOperationResult!==1&&this.n.error("[FilePolicyService] Failed to read policies",i)}return e}async u(){const e=await this.t(),i=M5(this.f,e);this.f=e,i.length>0&&this.g.fire(i)}};El=__decorate([__param(1,Ie),__param(2,he)],El);var Gn=class extends Zu{constructor(e,i){super(),this.j=e,this.m=i,this.a=new ru,this.b=this.B(new _s)}async h(e){this.j.trace(`NativePolicyService#_updatePolicyDefinitions - Found ${Object.keys(e).length} policy definitions`);const{createWatcher:i}=await import("@vscode/policy-watcher");await this.a.queue(()=>new Promise((s,r)=>{try{this.b.value=i(this.m,e,n=>{this.s(n),s()})}catch(n){this.j.error("NativePolicyService#_updatePolicyDefinitions - Error creating watcher:",n),r(n)}}))}s(e){this.j.trace(`NativePolicyService#_onDidPolicyChange - Updated policy values: ${JSON.stringify(e)}`);for(const i in e){const s=e[i];s===void 0?this.f.delete(i):this.f.set(i,s)}this.g.fire(Object.keys(e))}};Gn=__decorate([__param(0,he)],Gn);var wt,xl=globalThis.vscode;if(typeof xl<"u"&&typeof xl.context<"u"){const t=xl.context.configuration();if(t)wt=t.product;else throw new Error("Sandbox: unable to resolve product configuration from preload script.")}else if(globalThis._VSCODE_PRODUCT_JSON&&globalThis._VSCODE_PACKAGE_JSON){if(wt=globalThis._VSCODE_PRODUCT_JSON,Lt.VSCODE_DEV&&Object.assign(wt,{nameShort:`${wt.nameShort} Dev`,nameLong:`${wt.nameLong} Dev`,dataFolderName:`${wt.dataFolderName}-dev`,serverDataFolderName:wt.serverDataFolderName?`${wt.serverDataFolderName}-dev`:void 0}),!wt.version){const t=globalThis._VSCODE_PACKAGE_JSON;Object.assign(wt,{version:t.version})}}else wt={},Object.keys(wt).length===0&&Object.assign(wt,{version:"1.95.0-dev",nameShort:"Code - OSS Dev",nameLong:"Code - OSS Dev",applicationName:"code-oss",dataFolderName:".vscode-oss",urlProtocol:"code-oss",reportIssueUrl:"https://github.com/microsoft/vscode/issues/new",licenseName:"MIT",licenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt",serverLicenseUrl:"https://github.com/microsoft/vscode/blob/main/LICENSE.txt"});var Si=wt;import{parse as v1}from"url";import{spawn as j5}from"child_process";import{homedir as _5}from"os";import{userInfo as V5}from"os";import*as y1 from"os";var b1=/^\d+$/,z5=/^Microsoft.PowerShell_.*/,B5=/^Microsoft.PowerShellPreview_.*/,E1;(function(t){t[t.x64=0]="x64",t[t.x86=1]="x86",t[t.ARM=2]="ARM"})(E1||(E1={}));var br;switch(process.arch){case"ia32":br=1;break;case"arm":case"arm64":br=2;break;default:br=0;break}var Rs;process.env.PROCESSOR_ARCHITEW6432?Rs=process.env.PROCESSOR_ARCHITEW6432==="ARM64"?2:0:process.env.PROCESSOR_ARCHITECTURE==="ARM64"?Rs=2:process.env.PROCESSOR_ARCHITECTURE==="X86"?Rs=1:Rs=0;var Er=class{constructor(t,e,i){this.exePath=t,this.displayName=e,this.a=i}async exists(){return this.a===void 0&&(this.a=await mt.existsFile(this.exePath)),this.a}};function q5({useAlternateBitness:t=!1}={}){return t?br===0?process.env["ProgramFiles(x86)"]||null:Rs===0&&process.env.ProgramW6432||null:process.env.ProgramFiles||null}async function Jn({useAlternateBitness:t=!1,findPreview:e=!1}={}){const i=q5({useAlternateBitness:t});if(!i)return null;const s=U(i,"PowerShell");if(!await mt.existsDirectory(s))return null;let r=-1,n=null;for(const l of await ce.readdir(s)){let c=-1;if(e){const f=l.indexOf("-");if(f<0)continue;const d=l.substring(0,f);if(!b1.test(d)||l.substring(f+1)!=="preview")continue;c=parseInt(d,10)}else{if(!b1.test(l))continue;c=parseInt(l,10)}if(c<=r)continue;const u=U(s,l,"pwsh.exe");await mt.existsFile(u)&&(n=u,r=c)}if(!n)return null;const o=i.includes("x86")?" (x86)":"",a=e?" Preview":"";return new Er(n,`PowerShell${a}${o}`,!0)}async function x1({findPreview:t}={}){if(!process.env.LOCALAPPDATA)return null;const e=U(process.env.LOCALAPPDATA,"Microsoft","WindowsApps");if(!await mt.existsDirectory(e))return null;const{pwshMsixDirRegex:i,pwshMsixName:s}=t?{pwshMsixDirRegex:B5,pwshMsixName:"PowerShell Preview (Store)"}:{pwshMsixDirRegex:z5,pwshMsixName:"PowerShell (Store)"};for(const r of await ce.readdir(e))if(i.test(r)){const n=U(e,r,"pwsh.exe");return new Er(n,s)}return null}function W5(){const t=U(y1.homedir(),".dotnet","tools","pwsh.exe");return new Er(t,".NET Core PowerShell Global Tool")}function H5(){const t=U(y1.homedir(),"scoop","apps"),e=U(t,"pwsh","current","pwsh.exe");return new Er(e,"PowerShell (Scoop)")}function G5(){const t=U(process.env.windir,br===1&&Rs!==1?"SysNative":"System32","WindowsPowerShell","v1.0","powershell.exe");return new Er(t,"Windows PowerShell",!0)}async function*J5(){let t=await Jn();t&&(yield t),t=await Jn({useAlternateBitness:!0}),t&&(yield t),t=await x1(),t&&(yield t),t=W5(),t&&(yield t),t=await Jn({findPreview:!0}),t&&(yield t),t=await x1({findPreview:!0}),t&&(yield t),t=await Jn({useAlternateBitness:!0,findPreview:!0}),t&&(yield t),t=await H5(),t&&(yield t),t=G5(),t&&(yield t)}async function*Q5(){for await(const t of J5())await t.exists()&&(yield t)}async function Z5(){for await(const t of Q5())return t;return null}async function X5(t,e){return t===1?me?Y5():d5(e):K5(t,e)}var Sl=null;function K5(t,e){if(at&&t===2||Rt&&t===3)return"/bin/bash";if(!Sl){let i;if(me)i="/bin/bash";else{if(i=e.SHELL,!i)try{i=V5().shell}catch{}i||(i="sh"),i==="/bin/false"&&(i="/bin/bash")}Sl=i}return Sl}var $l=null;async function Y5(){return $l||($l=(await Z5()).exePath),$l}import"assert";var Uw=bd(Ed(),1),Mw={o:g(1838,null),e:g(1839,null),t:g(1840,null)},jw={tunnel:{type:"subcommand",description:"Make the current machine accessible from vscode.dev or other machines through a secure tunnel",options:{"cli-data-dir":{type:"string",args:"dir",description:g(1841,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"},user:{type:"subcommand",options:{login:{type:"subcommand",options:{provider:{type:"string"},"access-token":{type:"string"}}}}}}},"serve-web":{type:"subcommand",description:"Run a server that displays the editor UI in browsers.",options:{"cli-data-dir":{type:"string",args:"dir",description:g(1842,null)},"disable-telemetry":{type:"boolean"},"telemetry-level":{type:"string"}}},diff:{type:"boolean",cat:"o",alias:"d",args:["file","file"],description:g(1843,null)},merge:{type:"boolean",cat:"o",alias:"m",args:["path1","path2","base","result"],description:g(1844,null)},add:{type:"boolean",cat:"o",alias:"a",args:"folder",description:g(1845,null)},remove:{type:"boolean",cat:"o",args:"folder",description:g(1846,null)},goto:{type:"boolean",cat:"o",alias:"g",args:"file:line[:character]",description:g(1847,null)},"new-window":{type:"boolean",cat:"o",alias:"n",description:g(1848,null)},"reuse-window":{type:"boolean",cat:"o",alias:"r",description:g(1849,null)},wait:{type:"boolean",cat:"o",alias:"w",description:g(1850,null)},waitMarkerFilePath:{type:"string"},locale:{type:"string",cat:"o",args:"locale",description:g(1851,null)},"user-data-dir":{type:"string",cat:"o",args:"dir",description:g(1852,null)},profile:{type:"string",cat:"o",args:"profileName",description:g(1853,null)},help:{type:"boolean",cat:"o",alias:"h",description:g(1854,null)},"extensions-dir":{type:"string",deprecates:["extensionHomePath"],cat:"e",args:"dir",description:g(1855,null)},"extensions-download-dir":{type:"string"},"builtin-extensions-dir":{type:"string"},"list-extensions":{type:"boolean",cat:"e",description:g(1856,null)},"show-versions":{type:"boolean",cat:"e",description:g(1857,null)},category:{type:"string",allowEmptyValue:!0,cat:"e",description:g(1858,null),args:"category"},"install-extension":{type:"string[]",cat:"e",args:"ext-id | path",description:g(1859,null)},"pre-release":{type:"boolean",cat:"e",description:g(1860,null)},"uninstall-extension":{type:"string[]",cat:"e",args:"ext-id",description:g(1861,null)},"update-extensions":{type:"boolean",cat:"e",description:g(1862,null)},"enable-proposed-api":{type:"string[]",allowEmptyValue:!0,cat:"e",args:"ext-id",description:g(1863,null)},"add-mcp":{type:"string[]",cat:"o",args:"json",description:g(1864,null)},version:{type:"boolean",cat:"t",alias:"v",description:g(1865,null)},verbose:{type:"boolean",cat:"t",global:!0,description:g(1866,null)},log:{type:"string[]",cat:"t",args:"level",global:!0,description:g(1867,null)},status:{type:"boolean",alias:"s",cat:"t",description:g(1868,null)},"prof-startup":{type:"boolean",cat:"t",description:g(1869,null)},"prof-append-timers":{type:"string"},"prof-duration-markers":{type:"string[]"},"prof-duration-markers-file":{type:"string"},"no-cached-data":{type:"boolean"},"prof-startup-prefix":{type:"string"},"prof-v8-extensions":{type:"boolean"},"disable-extensions":{type:"boolean",deprecates:["disableExtensions"],cat:"t",description:g(1870,null)},"disable-extension":{type:"string[]",cat:"t",args:"ext-id",description:g(1871,null)},sync:{type:"string",cat:"t",description:g(1872,null),args:["on | off"]},"inspect-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugPluginHost"],args:"port",cat:"t",description:g(1873,null)},"inspect-brk-extensions":{type:"string",allowEmptyValue:!0,deprecates:["debugBrkPluginHost"],args:"port",cat:"t",description:g(1874,null)},"disable-lcd-text":{type:"boolean",cat:"t",description:g(1875,null)},"disable-gpu":{type:"boolean",cat:"t",description:g(1876,null)},"disable-chromium-sandbox":{type:"boolean",cat:"t",description:g(1877,null)},sandbox:{type:"boolean"},"locate-shell-integration-path":{type:"string",cat:"t",args:["shell"],description:g(1878,null)},telemetry:{type:"boolean",cat:"t",description:g(1879,null)},remote:{type:"string",allowEmptyValue:!0},"folder-uri":{type:"string[]",cat:"o",args:"uri"},"file-uri":{type:"string[]",cat:"o",args:"uri"},"locate-extension":{type:"string[]"},extensionDevelopmentPath:{type:"string[]"},extensionDevelopmentKind:{type:"string[]"},extensionTestsPath:{type:"string"},extensionEnvironment:{type:"string"},debugId:{type:"string"},debugRenderer:{type:"boolean"},"inspect-ptyhost":{type:"string",allowEmptyValue:!0},"inspect-brk-ptyhost":{type:"string",allowEmptyValue:!0},"inspect-search":{type:"string",deprecates:["debugSearch"],allowEmptyValue:!0},"inspect-brk-search":{type:"string",deprecates:["debugBrkSearch"],allowEmptyValue:!0},"inspect-sharedprocess":{type:"string",allowEmptyValue:!0},"inspect-brk-sharedprocess":{type:"string",allowEmptyValue:!0},"export-default-configuration":{type:"string"},"install-source":{type:"string"},"enable-smoke-test-driver":{type:"boolean"},logExtensionHostCommunication:{type:"boolean"},"skip-release-notes":{type:"boolean"},"skip-welcome":{type:"boolean"},"disable-telemetry":{type:"boolean"},"disable-updates":{type:"boolean"},"use-inmemory-secretstorage":{type:"boolean",deprecates:["disable-keytar"]},"password-store":{type:"string"},"disable-workspace-trust":{type:"boolean"},"disable-crash-reporter":{type:"boolean"},"crash-reporter-directory":{type:"string"},"crash-reporter-id":{type:"string"},"skip-add-to-recently-opened":{type:"boolean"},"open-url":{type:"boolean"},"file-write":{type:"boolean"},"file-chmod":{type:"boolean"},"install-builtin-extension":{type:"string[]"},force:{type:"boolean"},"do-not-sync":{type:"boolean"},"do-not-include-pack-dependencies":{type:"boolean"},trace:{type:"boolean"},"trace-memory-infra":{type:"boolean"},"trace-category-filter":{type:"string"},"trace-options":{type:"string"},"preserve-env":{type:"boolean"},"force-user-env":{type:"boolean"},"force-disable-user-env":{type:"boolean"},"open-devtools":{type:"boolean"},"disable-gpu-sandbox":{type:"boolean"},logsPath:{type:"string"},"__enable-file-policy":{type:"boolean"},editSessionId:{type:"string"},continueOn:{type:"string"},"enable-coi":{type:"boolean"},"unresponsive-sample-interval":{type:"string"},"unresponsive-sample-period":{type:"string"},"enable-rdp-display-tracking":{type:"boolean"},"no-proxy-server":{type:"boolean"},"no-sandbox":{type:"boolean",alias:"sandbox"},"proxy-server":{type:"string"},"proxy-bypass-list":{type:"string"},"proxy-pac-url":{type:"string"},"js-flags":{type:"string"},inspect:{type:"string",allowEmptyValue:!0},"inspect-brk":{type:"string",allowEmptyValue:!0},nolazy:{type:"boolean"},"force-device-scale-factor":{type:"string"},"force-renderer-accessibility":{type:"boolean"},"ignore-certificate-errors":{type:"boolean"},"allow-insecure-localhost":{type:"boolean"},"log-net-log":{type:"string"},vmodule:{type:"string"},_urls:{type:"string[]"},"disable-dev-shm-usage":{type:"boolean"},"profile-temp":{type:"boolean"},"ozone-platform":{type:"string"},"enable-tracing":{type:"string"},"trace-startup-format":{type:"string"},"trace-startup-file":{type:"string"},"trace-startup-duration":{type:"string"},"xdg-portal-required-version":{type:"string"},_:{type:"string[]"}};function S1(t){return t.VSCODE_CLI==="1"}function e9(t,e,i){return Math.min(Math.max(t,e),i)}var Pl=void 0;async function t9(t,e,i,s){return i["force-disable-user-env"]?(e.trace("resolveShellEnv(): skipped (--force-disable-user-env)"),{}):S1(s)&&!i["force-user-env"]?(e.trace("resolveShellEnv(): skipped (VSCODE_CLI is set)"),{}):(S1(s)?e.trace("resolveShellEnv(): running (--force-user-env)"):e.trace("resolveShellEnv(): running"),Pl||(Pl=ut.withAsyncBody(async(r,n)=>{const o=new rs;let a=1e4;const l=t.getValue("application.shellEnvironmentResolutionTimeout");typeof l=="number"&&(a=e9(l,1,120)*1e3);const c=setTimeout(()=>{o.dispose(!0),n(new Error(g(2223,null)))},a);try{r(await i9(e,o.token))}catch(u){!Di(u)&&!o.token.isCancellationRequested?n(new Error(g(2224,null,Fi(u)))):r({})}finally{clearTimeout(c),o.dispose()}})),Pl)}async function i9(t,e){const i=process.env.ELECTRON_RUN_AS_NODE;t.trace("doResolveShellEnv#runAsNode",i);const s=process.env.ELECTRON_NO_ATTACH_CONSOLE;t.trace("doResolveShellEnv#noAttach",s);const r=dt().replace(/-/g,"").substr(0,12),n=new RegExp(r+"([\\s\\S]*?)"+r),o={...process.env,ELECTRON_RUN_AS_NODE:"1",ELECTRON_NO_ATTACH_CONSOLE:"1",VSCODE_RESOLVING_ENVIRONMENT:"1"};t.trace("doResolveShellEnv#env",o);const a=await X5(xo,o);t.trace("doResolveShellEnv#shell",a);let l=Nt(a);if(me){const d=Uc(l);f1().some(p=>gi(p,d))&&(l=l.substring(0,l.length-d.length))}let c,u;const f="";if(/^(?:pwsh|powershell)(?:-preview)?$/.test(l)){const d=await s9(a),p=await wp(d.map(m=>async()=>await ce.exists(m)?m:void 0));if(!p)return t.trace("doResolveShellEnv#noPowershellProfile after testing paths",d),{};t.trace("doResolveShellEnv#powershellProfile found in",p),c=`Write-Output '${r}'; [System.Environment]::GetEnvironmentVariables() | ConvertTo-Json -Compress; Write-Output '${r}'`,u=me?["-Command"]:["-Login","-Command"]}else l==="nu"?(c=`^'${process.execPath}' ${f} -p '"${r}" + JSON.stringify(process.env) + "${r}"'`,u=["-i","-l","-c"]):l==="xonsh"?(c=`import os, json; print("${r}", json.dumps(dict(os.environ)), "${r}")`,u=["-i","-l","-c"]):(c=`'${process.execPath}' ${f} -p '"${r}" + JSON.stringify(process.env) + "${r}"'`,l==="tcsh"||l==="csh"?u=["-ic"]:u=["-i","-l","-c"]);return new Promise((d,p)=>{if(e.isCancellationRequested)return p(new Te);t.trace("doResolveShellEnv#spawn",JSON.stringify(u),c);const m=j5(a,[...u,c],{detached:!me,stdio:["ignore","pipe","pipe"],env:o});e.onCancellationRequested(()=>(m.kill(),p(new Te))),m.on("error",b=>{t.error("doResolveShellEnv#errorChildProcess",Fi(b)),p(b)});const w=[];m.stdout.on("data",b=>w.push(b));const y=[];m.stderr.on("data",b=>y.push(b)),m.on("close",(b,S)=>{const I=Buffer.concat(w).toString("utf8");t.trace("doResolveShellEnv#raw",I);const M=Buffer.concat(y).toString("utf8");if(M.trim()&&t.trace("doResolveShellEnv#stderr",M),b||S)return p(new Error(g(2225,null,b,S)));const te=n.exec(I),we=te?te[1]:"{}";try{const D=JSON.parse(we);i?D.ELECTRON_RUN_AS_NODE=i:delete D.ELECTRON_RUN_AS_NODE,s?D.ELECTRON_NO_ATTACH_CONSOLE=s:delete D.ELECTRON_NO_ATTACH_CONSOLE,delete D.VSCODE_RESOLVING_ENVIRONMENT,delete D.XDG_RUNTIME_DIR,t.trace("doResolveShellEnv#result",D),d(D)}catch(D){t.error("doResolveShellEnv#errorCaught",Fi(D)),p(D)}})})}async function s9(t){const e=[],i=_5();if(me){let s=process.env.PSHOME;if(!s)if(qs(t))s=Ot(t);else{const r=await m5(t);if(!r)return[];s=Ot(r)}e.push(U(s,"Profile.ps1"),U(s,"Microsoft.PowerShell_profile.ps1"),U(i,"Documents","PowerShell","Profile.ps1"),U(i,"Documents","PowerShell","Microsoft.PowerShell_profile.ps1"),U(i,"Documents","WindowsPowerShell","Profile.ps1"),U(i,"Documents","WindowsPowerShell","Microsoft.PowerShell_profile.ps1"))}else Rt?e.push("/usr/local/microsoft/powershell/7/profile.ps1","/usr/local/microsoft/powershell/7/Microsoft.PowerShell_profile.ps1",U(i,".config","powershell","profile.ps1"),U(i,".config","powershell","Microsoft.PowerShell_profile.ps1")):e.push("/opt/microsoft/powershell/7/profile.ps1","/opt/microsoft/powershell/7/Microsoft.PowerShell_profile.ps1",U(i,".config","powershell","profile.ps1"),U(i,".config","powershell","Microsoft.PowerShell_profile.ps1"));return e}import{parse as $1}from"url";function r9(t,e){return t.protocol==="http:"?e.HTTP_PROXY||e.http_proxy||null:t.protocol==="https:"&&(e.HTTPS_PROXY||e.https_proxy||e.HTTP_PROXY||e.http_proxy)||null}async function n9(t,e,i={}){const s=$1(t),r=i.proxyUrl||r9(s,e);if(!r)return null;const n=$1(r);if(!/^https?:$/.test(n.protocol||""))return null;const o={host:n.hostname||"",port:(n.port?+n.port:0)||(n.protocol==="https"?443:80),auth:n.auth,rejectUnauthorized:Et(i.strictSSL)?i.strictSSL:!0};if(s.protocol==="http:"){const{default:a}=await import("http-proxy-agent");return new a.HttpProxyAgent(r,o)}else{const{default:a}=await import("https-proxy-agent");return new a.HttpsProxyAgent(r,o)}}import{createGunzip as o9}from"zlib";var kl=class extends Xg{constructor(e,i,s,r){super(r),this.m=e,this.n=i,this.r=s,this.s(),this.B(i.onDidChangeConfiguration(n=>{n.affectsConfiguration("http")&&this.s()}))}s(){this.f=this.t("http.proxy"),this.g=!!this.t("http.proxyStrictSSL"),this.h=this.t("http.proxyAuthorization")}async request(e,i){const{f:s,g:r}=this;let n;try{n=await t9(this.n,this.b,this.r.args,process.env)}catch(l){this.j||(this.j=!0,this.b.error("resolving shell environment failed",G(l)))}const o={...process.env,...n},a=e.agent?e.agent:await n9(e.url||"",o,{proxyUrl:s,strictSSL:r});return e.agent=a,e.strictSSL=r,this.h&&(e.headers={...e.headers||{},"Proxy-Authorization":this.h}),this.c(e,()=>P1(e,i))}async resolveProxy(e){}async lookupAuthorization(e){}async lookupKerberosAuthorization(e){try{const i=this.t("http.proxyKerberosServicePrincipal");return"Negotiate "+await a9(e,i,this.b,"RequestService#lookupKerberosAuthorization")}catch(i){this.b.debug("RequestService#lookupKerberosAuthorization Kerberos authentication failed",i);return}}async loadCertificates(){return(await import("@vscode/proxy-agent")).loadSystemCertificates({log:this.b})}t(e){if(this.m==="remote")return this.n.getValue(e);const i=this.n.inspect(e);return i.userLocalValue||i.defaultValue}};kl=__decorate([__param(1,oi),__param(2,kt),__param(3,he)],kl);async function a9(t,e,i,s){const r=await import("kerberos"),n=r.default||r,o=new URL(t),a=e||(process.platform==="win32"?`HTTP/${o.hostname}`:`HTTP@${o.hostname}`);return i.debug(`${s} Kerberos authentication lookup`,`proxyURL:${o}`,`spn:${a}`),(await n.initializeClient(a)).step("")}async function l9(t){return(v1(t.url).protocol==="https:"?await import("https"):await import("http")).request}async function P1(t,e){return ut.withAsyncBody(async(i,s)=>{const r=v1(t.url),n=t.getRawRequest?t.getRawRequest(t):await l9(t),o={hostname:r.hostname,port:r.port?parseInt(r.port):r.protocol==="https:"?443:80,protocol:r.protocol,path:r.path,method:t.type||"GET",headers:t.headers,agent:t.agent,rejectUnauthorized:Et(t.strictSSL)?t.strictSSL:!0};t.user&&t.password&&(o.auth=t.user+":"+t.password),t.disableCache&&(o.cache="no-store");const a=n(o,l=>{const c=lc(t.followRedirects)?t.followRedirects:3;if(l.statusCode&&l.statusCode>=300&&l.statusCode<400&&c>0&&l.headers.location)P1({...t,url:l.headers.location,followRedirects:c-1},e).then(i,s);else{let u=l;!t.isChromiumNetwork&&l.headers["content-encoding"]==="gzip"&&(u=l.pipe(o9())),i({res:l,stream:zp(u)})}});if(a.on("error",s),t.timeout)if(t.isChromiumNetwork){const l=setTimeout(()=>{a.abort(),s(new Error(`Request timeout after ${t.timeout}ms`))},t.timeout);a.on("response",()=>clearTimeout(l)),a.on("error",()=>clearTimeout(l)),a.on("abort",()=>clearTimeout(l))}else a.setTimeout(t.timeout);t.isChromiumNetwork&&a.removeHeader("Content-Length"),t.data&&typeof t.data=="string"&&a.write(t.data),a.end(),e.onCancellationRequested(()=>{a.abort(),s(new Te)})})}var k1;(function(t){t[t.IMMEDIATE=0]="IMMEDIATE",t[t.DELAYED=1]="DELAYED"})(k1||(k1={}));var c9=class extends J{constructor(t,e,i,s){super(),this.h=t,this.j=i,this.m=s,this.a=Object.create(null),this.b="",this.f=void 0,this.g=void 0,this.c=this.B(new Ci(e===0?0:100))}init(){return this.f||(this.f=this.n()),this.f}async n(){try{this.b=(await this.m.readFile(this.h)).value.toString(),this.a=JSON.parse(this.b)}catch(t){t.fileOperationResult!==1&&this.j.error(t)}}getItem(t,e){const i=this.a[t];return Qe(i)?e:i}setItem(t,e){this.setItems([{key:t,data:e}])}setItems(t){let e=!1;for(const{key:i,data:s}of t)this.a[i]!==s&&(Qe(s)?xt(this.a[i])||(this.a[i]=void 0,e=!0):(this.a[i]=s,e=!0));e&&this.r()}removeItem(t){xt(this.a[t])||(this.a[t]=void 0,this.r())}async r(){if(!this.g)return this.c.trigger(()=>this.s())}async s(){if(!this.f)return;await this.f;const t=JSON.stringify(this.a,null,4);if(t!==this.b)try{await this.m.writeFile(this.h,V.fromString(t),{atomic:{postfix:".vsctmp"}}),this.b=t}catch(e){this.j.error(e)}}async close(){return this.g||(this.g=this.c.trigger(()=>this.s(),0)),this.g}},Qn=class extends J{constructor(e,i,s,r){super(),this.a=this.B(new c9(i.stateResource,e,s,r))}async init(){await this.a.init()}getItem(e,i){return this.a.getItem(e,i)}};Qn=__decorate([__param(1,fi),__param(2,he),__param(3,Ie)],Qn);var u9=class extends Qn{setItem(t,e){this.a.setItem(t,e)}setItems(t){this.a.setItems(t)}removeItem(t){this.a.removeItem(t)}close(){return this.a.close()}},Il=class{static{this.IDLE_START_EVENT_NAME="UserIdleStart"}static{this.IDLE_STOP_EVENT_NAME="UserIdleStop"}constructor(e,i,s){this.k=i,this.l=s,this.d={},this.i=new ot,this.j=[],this.b=e.appenders,this.c=e.commonProperties??Object.create(null),this.sessionId=this.c.sessionID,this.machineId=this.c["common.machineId"],this.sqmId=this.c["common.sqmId"],this.devDeviceId=this.c["common.devDeviceId"],this.firstSessionDate=this.c["common.firstSessionDate"],this.msftInternal=this.c["common.msftInternal"],this.f=e.piiPaths||[],this.g=3,this.h=!!e.sendErrorTelemetry,this.j=[/(vscode-)?file:\/\/\/.*?\/resources\/app\//gi];for(const r of this.f)this.j.push(new RegExp(ls(r),"gi")),r.indexOf("\\")>=0&&this.j.push(new RegExp(ls(r.replace(/\\/g,"/")),"gi"));this.m(),this.i.add(this.k.onDidChangeConfiguration(r=>{(r.affectsConfiguration(In)||r.affectsConfiguration(ba)||r.affectsConfiguration(Fh))&&this.m()}))}setExperimentProperty(e,i){this.d[e]=i}m(){let e=jh(this.k);const i=this.l.enabledTelemetryLevels;if(i){this.h=this.sendErrorTelemetry?i.error:!1;const s=i.usage?3:i.error?2:0;e=Math.min(e,s)}this.g=e}get sendErrorTelemetry(){return this.h}get telemetryLevel(){return this.g}dispose(){this.i.dispose()}n(e,i,s){this.g<i||(s=un(s,this.d),s=J4(s,this.j),s=un(s,this.c),this.b.forEach(r=>r.log(e,s)))}publicLog(e,i){this.n(e,3,i)}publicLog2(e,i){this.publicLog(e,i)}publicLogError(e,i){this.h&&this.n(e,2,i)}publicLogError2(e,i){this.publicLogError(e,i)}};Il=__decorate([__param(1,oi),__param(2,gt)],Il);function h9(){const t=g(2227,null,Si.nameLong),e=Si.privacyStatementUrl?g(2229,null,"https://aka.ms/vscode-telemetry",Si.privacyStatementUrl):g(2228,null,"https://aka.ms/vscode-telemetry"),i=$t?"":g(2230,null),s=g(2231,null),r=g(2232,null),n=g(2233,null),o=g(2234,null),a=`
|       | ${s} | ${r} | ${n} |
|:------|:-------------:|:---------------:|:----------:|
| all   |       \u2713       |        \u2713        |     \u2713      |
| error |       \u2713       |        \u2713        |     -      |
| crash |       \u2713       |        -        |     -      |
| off   |       -       |        -        |     -      |
`,l=g(2235,null);return`
${t} ${e} ${i}

&nbsp;

${o}
${a}

&nbsp;

${l}
`}var f9=Tt.as(li.Configuration);f9.registerConfiguration({id:j4,order:1,type:"object",title:g(2236,null),properties:{[In]:{type:"string",enum:["all","error","crash","off"],enumDescriptions:[g(2237,null),g(2238,null),g(2239,null),g(2240,null)],markdownDescription:h9(),default:"all",restricted:!0,scope:1,tags:["usesOnlineServices","telemetry"],policy:{name:"TelemetryLevel",minimumVersion:"1.99",description:g(2241,null)}},"telemetry.feedback.enabled":{type:"boolean",default:!0,description:g(2242,null),policy:{name:"EnableFeedback",minimumVersion:"1.99"}},[ba]:{type:"boolean",markdownDescription:Si.privacyStatementUrl?g(2244,null,Si.nameLong,Si.privacyStatementUrl):g(2243,null,Si.nameLong),default:!0,restricted:!0,markdownDeprecationMessage:g(2245,null,`\`#${In}#\``),scope:1,tags:["usesOnlineServices","telemetry"]}}});import*as d9 from"https";var p9=!1,g9=class{constructor(t,e,i){this.id=t,this.dependencies=e,this.callback=i}},Qi;(function(t){t[t.Uninitialized=1]="Uninitialized",t[t.InitializedInternal=2]="InitializedInternal",t[t.InitializedExternal=3]="InitializedExternal"})(Qi||(Qi={}));var m9=class cd{static{this.INSTANCE=new cd}constructor(){this.a=typeof self=="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",this.b=typeof document=="object",this.c=[],this.d=Qi.Uninitialized}g(){if(this.d===Qi.Uninitialized){if(globalThis.define){this.d=Qi.InitializedExternal;return}}else return;this.d=Qi.InitializedInternal,globalThis.define=(e,i,s)=>{typeof e!="string"&&(s=i,i=e,e=null),(typeof i!="object"||!Array.isArray(i))&&(s=i,i=null),this.c.push(new g9(e,i,s))},globalThis.define.amd=!0,this.b?this.f=globalThis._VSCODE_WEB_PACKAGE_TTP??window.trustedTypes?.createPolicy("amdLoader",{createScriptURL(e){if(e.startsWith(window.location.origin)||e.startsWith(`${ie.vscodeFileResource}://${Xc}`))return e;throw new Error(`[trusted_script_src] Invalid script url: ${e}`)}}):this.a&&(this.f=globalThis._VSCODE_WEB_PACKAGE_TTP??globalThis.trustedTypes?.createPolicy("amdLoader",{createScriptURL(e){return e}}))}async load(e){if(this.g(),this.d===Qi.InitializedExternal)return new Promise(o=>{const a=dt();globalThis.define(a,[e],function(l){o(l)})});const i=await(this.a?this.i(e):this.b?this.h(e):this.j(e));if(!i){console.warn(`Did not receive a define call from script ${e}`);return}const s={},r=[],n=[];if(Array.isArray(i.dependencies))for(const o of i.dependencies)o==="exports"?r.push(s):n.push(o);if(n.length>0)throw new Error(`Cannot resolve dependencies for script ${e}. The dependencies are: ${n.join(", ")}`);return typeof i.callback=="function"?i.callback(...r)??s:i.callback}h(e){return new Promise((i,s)=>{const r=document.createElement("script");r.setAttribute("async","async"),r.setAttribute("type","text/javascript");const n=()=>{r.removeEventListener("load",o),r.removeEventListener("error",a)},o=l=>{n(),i(this.c.pop())},a=l=>{n(),s(l)};r.addEventListener("load",o),r.addEventListener("error",a),this.f&&(e=this.f.createScriptURL(e)),r.setAttribute("src",e),window.document.getElementsByTagName("head")[0].appendChild(r)})}async i(e){return this.f&&(e=this.f.createScriptURL(e)),await import(e),this.c.pop()}async j(e){try{const i=(await import("fs")).default,s=(await import("vm")).default,r=(await import("module")).default,n=k.parse(e).fsPath,o=i.readFileSync(n).toString(),a=r.wrap(o.replace(/^#!.*/,""));return new s.Script(a).runInThisContext().apply(),this.c.pop()}catch(i){throw i}}},Dl=new Map;async function I1(t,e,i){i===void 0&&(i=!!(globalThis._VSCODE_PRODUCT_JSON??globalThis.vscode?.context?.configuration()?.product)?.commit);const s=e?`${t}/${e}`:t;if(Dl.has(s))return Dl.get(s);let r;if(/^\w[\w\d+.-]*:\/\//.test(s))r=s;else{const l=`${p9&&i&&!$t?op:np}/${s}`;r=Gs.asBrowserUri(l).toString(!0)}const n=m9.INSTANCE.load(r);return Dl.set(s,n),n}var D1="https://mobile.events.data.microsoft.com/OneCollector/1.0",w9="https://mobile.events.data.microsoft.com/ping";async function v9(t,e,i){const s=$t?await I1("@microsoft/1ds-core-js","bundle/ms.core.min.js"):await import("@microsoft/1ds-core-js"),r=$t?await I1("@microsoft/1ds-post-js","bundle/ms.post.min.js"):await import("@microsoft/1ds-post-js"),n=new s.AppInsightsCore,o=new r.PostChannel,a={instrumentationKey:t,endpointUrl:D1,loggingLevelTelemetry:0,loggingLevelConsole:0,disableCookiesUsage:!0,disableDbgExt:!0,disableInstrumentationKeyValidation:!0,channels:[[o]]};if(i){a.extensionConfig={};const l={alwaysUseXhrOverride:!0,ignoreMc1Ms0CookieProcessing:!0,httpXHROverride:i};a.extensionConfig[o.identifier]=l}return n.initialize(a,[]),n.addTelemetryInitializer(l=>{l.ext=l.ext??{},l.ext.web=l.ext.web??{},l.ext.web.consentDetails='{"GPC_DataSharingOptIn":false}',e&&(l.ext.utc=l.ext.utc??{},l.ext.utc.flags=8462029)}),n}var y9=class{constructor(t,e,i,s,r){this.e=t,this.f=e,this.g=i,this.h=r,this.c=D1,this.d=w9,this.g||(this.g={}),typeof s=="function"?this.a=s():this.a=s,this.b=null}i(t){if(this.a){if(typeof this.a!="string"){t(this.a);return}this.b||(this.b=v9(this.a,this.e,this.h)),this.b.then(e=>{t(e)},e=>{At(e),console.error(e)})}}log(t,e){if(!this.a)return;e=un(e,this.g),e=B4(e);const i=this.f+"/"+t;try{this.i(s=>{s.pluginVersionString=e?.properties.version??"Unknown",s.track({name:i,baseData:{name:i,properties:e?.properties,measurements:e?.measurements}})})}catch{}}flush(){return this.a?new Promise(t=>{this.i(e=>{e.unload(!0,()=>{this.a=void 0,t(void 0)})})}):Promise.resolve(void 0)}};async function b9(t,e){const i=await e.request(t,pe.None),s=(await Ti(i.stream)).toString(),r=i.res.statusCode??200;return{headers:i.res.headers,statusCode:r,responseData:s}}async function E9(t){const e={method:t.type,headers:t.headers};return new Promise((s,r)=>{const n=d9.request(t.url??"",e,o=>{o.on("data",function(a){s({headers:o.headers,statusCode:o.statusCode??200,responseData:a.toString()})}),o.on("error",function(a){r(a)})});n.write(t.data,o=>{o&&r(o)}),n.end()})}async function x9(t,e,i){const s=typeof e.data=="string"?e.data:new TextDecoder().decode(e.data),r={type:"POST",headers:{...e.headers,"Content-Type":"application/json","Content-Length":Buffer.byteLength(e.data).toString()},url:e.urlString,data:s};try{const n=t?await b9(r,t):await E9(r);i(n.statusCode,n.headers,n.responseData)}catch{i(0,{})}}var S9=class extends y9{constructor(t,e,i,s,r){const n={sendPOST:(o,a)=>{x9(t,o,a)}};super(e,i,s,r,n)}};import*as Zn from"fs";async function $9(t,e){const i=Object.create(null),s=(n,o)=>{const a=JSON.parse(n);i[o]=a};if(e){const n=[],o=await ce.readdir(e);for(const l of o)try{(await Zn.promises.stat(U(e,l))).isDirectory()&&n.push(l)}catch{}const a=[];for(const l of n)(await ce.readdir(U(e,l))).filter(u=>u==="telemetry.json").length===1&&a.push(l);for(const l of a){const c=(await Zn.promises.readFile(U(e,l,"telemetry.json"))).toString();s(c,l)}}let r=(await Zn.promises.readFile(U(t,"telemetry-core.json"))).toString();return s(r,"vscode-core"),r=(await Zn.promises.readFile(U(t,"telemetry-extensions.json"))).toString(),s(r,"vscode-extensions"),JSON.stringify(i,null,4)}var P9=[],A1;(function(t){t[t.Eager=0]="Eager",t[t.Delayed=1]="Delayed"})(A1||(A1={}));function k9(t,e,i){e instanceof qe||(e=new qe(e,[],!!i)),P9.push([t,e])}var R1,Al=class{constructor(t,e,i){this.level=t,this.key=e,this.value=i,this.forward=[]}},xr=void 0,I9=class Ns{constructor(e,i=2**16){this.comparator=e,this[R1]="SkipList",this.d=0,this.f=0,this.c=Math.max(1,Math.log2(i)|0),this.e=new Al(this.c,xr,xr)}get size(){return this.f}clear(){this.e=new Al(this.c,xr,xr),this.f=0}has(e){return!!Ns.g(this,e,this.comparator)}get(e){return Ns.g(this,e,this.comparator)?.value}set(e,i){return Ns.h(this,e,i,this.comparator)&&(this.f+=1),this}delete(e){const i=Ns.k(this,e,this.comparator);return i&&(this.f-=1),i}forEach(e,i){let s=this.e.forward[0];for(;s;)e.call(i,s.value,s.key,this),s=s.forward[0]}[(R1=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}*entries(){let e=this.e.forward[0];for(;e;)yield[e.key,e.value],e=e.forward[0]}*keys(){let e=this.e.forward[0];for(;e;)yield e.key,e=e.forward[0]}*values(){let e=this.e.forward[0];for(;e;)yield e.value,e=e.forward[0]}toString(){let e="[SkipList]:",i=this.e.forward[0];for(;i;)e+=`node(${i.key}, ${i.value}, lvl:${i.level})`,i=i.forward[0];return e}static g(e,i,s){let r=e.e;for(let n=e.d-1;n>=0;n--)for(;r.forward[n]&&s(r.forward[n].key,i)<0;)r=r.forward[n];if(r=r.forward[0],r&&s(r.key,i)===0)return r}static h(e,i,s,r){const n=[];let o=e.e;for(let a=e.d-1;a>=0;a--){for(;o.forward[a]&&r(o.forward[a].key,i)<0;)o=o.forward[a];n[a]=o}if(o=o.forward[0],o&&r(o.key,i)===0)return o.value=s,!1;{const a=Ns.j(e);if(a>e.d){for(let l=e.d;l<a;l++)n[l]=e.e;e.d=a}o=new Al(a,i,s);for(let l=0;l<a;l++)o.forward[l]=n[l].forward[l],n[l].forward[l]=o;return!0}}static j(e,i=.5){let s=1;for(;Math.random()<i&&s<e.c;)s+=1;return s}static k(e,i,s){const r=[];let n=e.e;for(let o=e.d-1;o>=0;o--){for(;n.forward[o]&&s(n.forward[o].key,i)<0;)n=n.forward[o];r[o]=n}if(n=n.forward[0],!n||s(n.key,i)!==0)return!1;for(let o=0;o<e.d&&r[o].forward[o]===n;o++)r[o].forward[o]=n.forward[o];for(;e.d>0&&e.e.forward[e.d-1]===xr;)e.d-=1;return!0}},L1=class Bl{static{this._clock=0}constructor(e){this.uri=e,this.time=Bl._clock++}touch(){return this.time=Bl._clock++,this}},Sr=class{constructor(e){this.g=e,this.c=new ot,this.f=2**16;const i=new Map,s=r=>{let n=i.get(r.scheme);return n===void 0&&(n=e.hasProvider(r)&&!this.g.hasCapability(r,1024),i.set(r.scheme,n)),n};this.c.add(oe.any(e.onDidChangeFileSystemProviderRegistrations,e.onDidChangeFileSystemProviderCapabilities)(r=>{i.delete(r.scheme)})),this.extUri=new Kr(s),this.d=new I9((r,n)=>this.extUri.compare(r,n,!0),this.f)}dispose(){this.c.dispose(),this.d.clear()}asCanonicalUri(e){this.g.hasProvider(e)&&(e=up(e));const i=this.d.get(e);return i?i.touch().uri.with({fragment:e.fragment}):(this.d.set(e,new L1(e)),this.h(),e)}h(){if(this.d.size<this.f)return;const e=[...this.d.entries()].sort((s,r)=>s[1].time<r[1].time?1:s[1].time>r[1].time?-1:0);L1._clock=0,this.d.clear();const i=this.f*.5;for(let s=0;s<i;s++)this.d.set(e[s][0],e[s][1].touch())}};Sr=__decorate([__param(0,Ie)],Sr),k9(ze,Sr,1);var D9=ue("stateReadService"),A9=ue("stateService"),Xn,Ls,Kn=Xn=class extends Aa{constructor(e,i,s,r,n){super(s,r,i,n),this.a=e,this.S=s}N(){return this.a.getItem(Xn.b,[]).map(i=>({...i,location:xe(i.location)?this.u.extUri.joinPath(this.profilesHome,i.location):k.revive(i.location)}))}P(){return this.a.getItem(Xn.c,{})}R(){return this.u.extUri.joinPath(k.file(this.S.extensionsPath).with({scheme:this.profilesHome.scheme}),"extensions.json")}};Kn=Xn=__decorate([__param(0,D9),__param(1,ze),__param(2,kt),__param(3,Ie),__param(4,he)],Kn);var Rl=Ls=class extends Kn{constructor(e,i,s,r,n){super(e,i,s,r,n),this.Y=e}O(e){e.length?this.Y.setItem(Ls.b,e.map(i=>({...i,location:this.u.extUri.basename(i.location)}))):this.Y.removeItem(Ls.b)}Q(e){e.emptyWindows||e.workspaces?this.Y.setItem(Ls.c,e):this.Y.removeItem(Ls.c)}};Rl=Ls=__decorate([__param(0,A9),__param(1,ze),__param(2,kt),__param(3,Ie),__param(4,he)],Rl);var O1=class extends Rl{constructor(e,i,s,r){super(new u9(0,i,r,s),e,i,s,r)}async init(){return await this.Y.init(),super.init()}};O1=__decorate([__param(0,ze),__param(1,kt),__param(2,Ie),__param(3,he)],O1);import{networkInterfaces as R9}from"os";import{networkInterfaces as L9}from"os";var O9=new Set(["00:00:00:00:00:00","ff:ff:ff:ff:ff:ff","ac:de:48:00:11:22"]);function N9(t){const e=t.replace(/\-/g,":").toLowerCase();return!O9.has(e)}function C9(){const t=L9();for(const e in t){const i=t[e];if(i){for(const{mac:s}of i)if(N9(s))return s}}throw new Error("Unable to retrieve mac address (unexpected format)")}var Xw=new class{c(t){return this.a||(this.a=ms.forStrings(),this.a.set("00-50-56",!0),this.a.set("00-0C-29",!0),this.a.set("00-05-69",!0),this.a.set("00-03-FF",!0),this.a.set("00-1C-42",!0),this.a.set("00-16-3E",!0),this.a.set("08-00-27",!0),this.a.set("00:50:56",!0),this.a.set("00:0C:29",!0),this.a.set("00:05:69",!0),this.a.set("00:03:FF",!0),this.a.set("00:1C:42",!0),this.a.set("00:16:3E",!0),this.a.set("08:00:27",!0)),!!this.a.findSubstr(t)}value(){if(this.b===void 0){let t=0,e=0;const i=R9();for(const s in i){const r=i[s];if(r)for(const{mac:n,internal:o}of r)o||(e+=1,this.c(n.toUpperCase())&&(t+=1))}this.b=e>0?t/e:0}return this.b}},Ll;async function F9(t){return Ll||(Ll=(async()=>await T9(t)||dt())()),Ll}async function T9(t){try{const e=await import("crypto"),i=C9();return e.createHash("sha256").update(i,"utf8").digest("hex")}catch(e){t(e);return}}var U9="Software\\Microsoft\\SQMClient";async function M9(t){if(me){const e=await import("@vscode/windows-registry");try{return e.GetStringRegKey("HKEY_LOCAL_MACHINE",U9,"MachineId")||""}catch(i){return t(i),""}}return""}async function j9(t){try{return await(await import("@vscode/deviceid")).getDeviceId()}catch(e){return t(e),dt()}}async function _9(t,e){let i=t.getItem(T4);return(typeof i!="string"||Rt&&i==="6c9d2bc8f91b89624add29c0abeae7fb42bf539fa1cdb2e3e57cd668fa9bcead")&&(i=await F9(e.error.bind(e))),i}async function V9(t,e){let i=t.getItem(U4);return typeof i!="string"&&(i=await M9(e.error.bind(e))),i}async function z9(t,e){let i=t.getItem(M4);return typeof i!="string"&&(i=await j9(e.error.bind(e))),i}var Ol=class extends Ma{constructor(e,i,s,r,n){super(k.file(e.extensionsPath),i,s,r,n)}};Ol=__decorate([__param(0,kt),__param(1,Ie),__param(2,jt),__param(3,ze),__param(4,he)],Ol);var B9=class extends J{constructor(t,e=[]){super(),this.a=new Lg([t,...e]),this.B(t.onDidChangeLogLevel(i=>this.setLevel(i)))}get onDidChangeLogLevel(){return this.a.onDidChangeLogLevel}setLevel(t){this.a.setLevel(t)}getLevel(){return this.a.getLevel()}trace(t,...e){this.a.trace(t,...e)}debug(t,...e){this.a.debug(t,...e)}info(t,...e){this.a.info(t,...e)}warn(t,...e){this.a.warn(t,...e)}error(t,...e){this.a.error(t,...e)}flush(){this.a.flush()}},di;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Info=2]="Info",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.Off=6]="Off"})(di||(di={}));async function q9(t,e,i,s,r){try{const n=await import("@vscode/spdlog");n.setFlushOn(di.Trace);const o=await n.createAsyncRotatingLogger(t,e,i,s);return r?o.clearFormatters():o.setPattern("%Y-%m-%d %H:%M:%S.%e [%l] %v"),o}catch(n){console.error(n)}return null}function N1(t,e,i){switch(e){case F.Trace:t.trace(i);break;case F.Debug:t.debug(i);break;case F.Info:t.info(i);break;case F.Warning:t.warn(i);break;case F.Error:t.error(i);break;case F.Off:break;default:throw new Error(`Invalid log level ${e}`)}}function C1(t,e){switch(e){case F.Trace:t.setLevel(di.Trace);break;case F.Debug:t.setLevel(di.Debug);break;case F.Info:t.setLevel(di.Info);break;case F.Warning:t.setLevel(di.Warning);break;case F.Error:t.setLevel(di.Error);break;case F.Off:t.setLevel(di.Off);break;default:throw new Error(`Invalid log level ${e}`)}}var W9=class extends Rg{constructor(t,e,i,s,r){super(),this.n=[],this.setLevel(r),this.r=this.t(t,e,i,s),this.B(this.onDidChangeLogLevel(n=>{this.s&&C1(this.s,n)}))}async t(t,e,i,s){const r=i?6:1,n=30/r*Qg.MB,o=await q9(t,e,n,r,s);if(o){this.s=o,C1(this.s,this.getLevel());for(const{level:a,message:l}of this.n)N1(this.s,a,l);this.n=[]}}m(t,e){this.s?N1(this.s,t,e):this.getLevel()<=t&&this.n.push({level:t,message:e})}flush(){this.s?this.w():this.r.then(()=>this.w())}dispose(){this.s?this.y():this.r.then(()=>this.y()),super.dispose()}w(){this.s&&this.s.flush()}y(){this.s&&(this.s.drop(),this.s=void 0)}},H9=class extends Og{t(t,e,i){return new W9(dt(),t.fsPath,!i?.donotRotate,!!i?.donotUseFormatters,e)}},G9=class extends J{constructor(t,e,i,s,r,n){super(),this.f=t,this.g=e,this.h=i,this.j=s,this.m=r,this.n=n,this.capabilities=this.g.capabilities,this.onDidChangeCapabilities=this.g.onDidChangeCapabilities,this.a=this.B(new N),this.onDidChangeFile=this.a.event,this.b=ms.forUris(()=>!(this.capabilities&1024)),this.c=new go(o=>this.m.extUri.getComparisonKey(this.t(o))),this.r(),this.B(s.onDidChangeProfiles(()=>this.r())),this.B(this.g.onDidChangeFile(o=>this.s(o)))}r(){this.c.clear();for(const t of this.j.profiles)this.c.add(t.settingsResource),this.c.add(t.keybindingsResource),this.c.add(t.tasksResource),this.c.add(t.extensionsResource)}open(t,e){return this.g.open(this.t(t),e)}close(t){return this.g.close(t)}read(t,e,i,s,r){return this.g.read(t,e,i,s,r)}write(t,e,i,s,r){return this.g.write(t,e,i,s,r)}watch(t,e){this.b.set(t,t);const i=this.g.watch(this.t(t),e);return Se(()=>{this.b.delete(t),i.dispose()})}stat(t){return this.g.stat(this.t(t))}mkdir(t){return this.g.mkdir(this.t(t))}rename(t,e,i){return this.g.rename(this.t(t),this.t(e),i)}readFile(t,e){return this.g.readFile(this.t(t),e)}readFileStream(t,e,i){return this.g.readFileStream(this.t(t),e,i)}readdir(t){return this.g.readdir(this.t(t))}enforceAtomicReadFile(t){return this.c.has(t)}writeFile(t,e,i){return this.g.writeFile(this.t(t),e,i)}enforceAtomicWriteFile(t){return this.c.has(t)?{postfix:".vsctmp"}:!1}delete(t,e){return this.g.delete(this.t(t),e)}copy(t,e,i){if(ra(this.g))return this.g.copy(this.t(t),this.t(e),i);throw new Error("copy not supported")}cloneFile(t,e){if(rh(this.g))return this.g.cloneFile(this.t(t),this.t(e));throw new Error("clone not supported")}s(t){const e=[];for(const i of t){if(i.resource.scheme!==this.f)continue;const s=this.u(i.resource);this.b.findSubstr(s)&&e.push({resource:s,type:i.type,cId:i.cId})}e.length&&(this.n.debug("User data changed"),this.a.fire(e))}t(t){return t.with({scheme:this.f})}u(t){return t.with({scheme:this.h})}};function J9(){return process.uncHostAllowlist}function F1(t){if(process.platform!=="win32")return;const e=J9();if(e)if(typeof t=="string")e.add(t.toLowerCase());else for(const i of Q9(t))F1(i)}function Q9(t){const e=new Set;if(Array.isArray(t))for(const i of t)typeof i=="string"&&e.add(i);return Array.from(e)}function Z9(t){if(typeof t!="string")return;const e=["\\\\.\\UNC\\","\\\\?\\UNC\\","\\\\"];let i;for(const s of e){if(t.indexOf(s)!==0)continue;const n=t.indexOf("\\",s.length);if(n===-1)continue;const o=t.substring(s.length,n);if(o){i=o;break}}return i}function X9(t){return t.type==="gallery"}function K9(t){return t.type===1||t.type===0}var Y9=/^(?<version>\d+\.\d+\.\d+(-.*)?)(@(?<platform>.+))?$/,Nl=class extends J{get allowedExtensionsConfigValue(){return this.b}constructor(e,i){super(),this.f=i,this.c=this.B(new N),this.onDidChangeAllowedExtensionsConfigValue=this.c.event,this.a=e.extensionPublisherOrgs?.map(s=>s.toLowerCase())??[],this.b=this.g(),this.B(this.f.onDidChangeConfiguration(s=>{s.affectsConfiguration(kn)&&(this.b=this.g(),this.c.fire())}))}g(){const e=this.f.getValue(kn);if(!Oe(e)||Array.isArray(e))return;const i=Object.entries(e).map(([s,r])=>[s.toLowerCase(),r]);if(!(i.length===1&&i[0][0]==="*"&&i[0][1]===!0))return Object.fromEntries(i)}isAllowed(e){if(!this.b)return!0;let i,s,r,n,o,a;X9(e)?(i=e.identifier.id.toLowerCase(),s=e.version,n=e.properties.isPreReleaseVersion,o=e.publisher.toLowerCase(),a=e.publisherDisplayName.toLowerCase(),r=e.properties.targetPlatform):K9(e)?(i=e.identifier.id.toLowerCase(),s=e.manifest.version,n=e.preRelease,o=e.manifest.publisher.toLowerCase(),a=e.publisherDisplayName?.toLowerCase(),r=e.targetPlatform):(i=e.id.toLowerCase(),s=e.version??"*",r=e.targetPlatform??"universal",n=e.prerelease??!1,o=e.id.substring(0,e.id.indexOf(".")).toLowerCase(),a=e.publisherDisplayName?.toLowerCase());const l=k.parse(`command:workbench.action.openSettings?${encodeURIComponent(JSON.stringify({query:`@id:${kn}`}))}`).toString(),c=this.b[i],u=new Wi(g(1911,null,l));if(!xt(c))return Et(c)?c?!0:u:c==="stable"&&n?new Wi(g(1912,null,l)):s!=="*"&&Array.isArray(c)&&!c.some(p=>{const m=Y9.exec(p);if(m&&m.groups){const{platform:w,version:y}=m.groups;return!(y!==s||r!=="universal"&&w&&r!==w)}return!1})?new Wi(g(1913,null,s,l)):!0;const f=a&&this.a.includes(a)?a:o,d=this.b[f];return xt(d)?this.b["*"]===!0?!0:u:Et(d)?d?!0:new Wi(g(1914,null,f,l)):d==="stable"&&n?new Wi(g(1915,null,f,l)):!0}};Nl=__decorate([__param(0,gt),__param(1,oi)],Nl);var Cl=class{constructor(e,i){this.a=e,this.b=i}async addMcpDefinitions(e){const i=e.map(s=>this.f(s));await this.d(this.b,i),this.a.info(`Added MCP servers: ${i.map(s=>s.name).join(", ")}`)}async d(e,i){const s=e.getValue("mcp")||{servers:{}};s.servers??={};for(const r of i)s.servers[r.name]=r.config;await e.updateValue("mcp",s)}f(e){let i;try{i=JSON.parse(e)}catch(n){throw new Fl(`Invalid JSON '${e}': ${n}`)}if(!i.name)throw new Fl(`Missing name property in ${e}`);if(!("command"in i)&&!("url"in i))throw new Fl(`Missing command or URL property in ${e}`);const{name:s,...r}=i;return{name:s,config:r}}};Cl=__decorate([__param(1,oi)],Cl);var Fl=class extends Error{constructor(t){super(t),this.stack=t}},Tl=class extends J{constructor(e){super(),this.a=e,this.onDidChangeExtensionGalleryManifest=oe.None}isEnabled(){return!!this.a.extensionsGallery?.serviceUrl}async getExtensionGalleryManifest(){const e=this.a.extensionsGallery;if(!e?.serviceUrl)return null;const i=[{id:`${e.serviceUrl}/extensionquery`,type:"ExtensionQueryService"},{id:`${e.serviceUrl}/vscode/{publisher}/{name}/latest`,type:"ExtensionLatestVersionUriTemplate"},{id:`${e.serviceUrl}/publishers/{publisher}/extensions/{name}/{version}/stats?statType={statTypeName}`,type:"ExtensionStatisticsUriTemplate"},{id:`${e.serviceUrl}/itemName/{publisher}.{name}/version/{version}/statType/{statTypeValue}/vscodewebextension`,type:"WebExtensionStatisticsUriTemplate"}];return e.publisherUrl&&i.push({id:`${e.publisherUrl}/{publisher}`,type:"PublisherViewUriTemplate"}),e.itemUrl&&(i.push({id:`${e.itemUrl}?itemName={publisher}.{name}`,type:"ExtensionDetailsViewUriTemplate"}),i.push({id:`${e.itemUrl}?itemName={publisher}.{name}&ssr=false#review-details`,type:"ExtensionRatingViewUriTemplate"})),e.resourceUrlTemplate&&i.push({id:e.resourceUrlTemplate,type:"ExtensionResourceUriTemplate"}),{version:"",resources:i,capabilities:{extensionQuery:{filtering:[{name:"Tag",value:1},{name:"ExtensionId",value:4},{name:"Category",value:5},{name:"ExtensionName",value:7},{name:"Target",value:8},{name:"Featured",value:9},{name:"SearchText",value:10},{name:"ExcludeWithFlags",value:12}],sorting:[{name:"NoneOrRelevance",value:0},{name:"LastUpdatedDate",value:1},{name:"Title",value:2},{name:"PublisherName",value:3},{name:"InstallCount",value:4},{name:"AverageRating",value:6},{name:"PublishedDate",value:10},{name:"WeightedRating",value:12}],flags:[{name:"None",value:0},{name:"IncludeVersions",value:1},{name:"IncludeFiles",value:2},{name:"IncludeCategoryAndTags",value:4},{name:"IncludeSharedAccounts",value:8},{name:"IncludeVersionProperties",value:16},{name:"ExcludeNonValidated",value:32},{name:"IncludeInstallationTargets",value:64},{name:"IncludeAssetUri",value:128},{name:"IncludeStatistics",value:256},{name:"IncludeLatestVersionOnly",value:512},{name:"Unpublished",value:4096},{name:"IncludeNameConflictInfo",value:32768},{name:"IncludeLatestPrereleaseAndStableVersionOnly",value:65536}]},signing:{allPublicRepositorySigned:!0}}}}};Tl=__decorate([__param(0,gt)],Tl);var e7=class extends J{constructor(t){super(),this.b=t,this.c()}c(){process.once("exit",()=>this.dispose())}async run(){const[t,e]=await this.f();return t.invokeFunction(async i=>{const s=i.get(he),r=i.get(Ie),n=i.get(kt),o=i.get(jt);s.info("CLI main",this.b),this.h(s),await this.j(n,r,o,t),await Promise.all(e.map(a=>{dp(a.flush(),1e3)}))})}async f(){const t=new g1,e={_serviceBrand:void 0,...Si};t.set(gt,e);const i=new f4(this.b,e);t.set(kt,i),await Promise.all([this.g(i.appSettingsHome.with({scheme:ie.file}).fsPath),this.g(i.extensionsPath)].map(M=>M?xd.promises.mkdir(M,{recursive:!0}):void 0));const s=new H9(Fg(i),i.logsHome);t.set(Dg,s);const r=this.B(s.createLogger("cli",{name:g(168,null)})),n=[];s.getLogLevel()===F.Trace&&n.push(new ji(s.getLogLevel()));const o=this.B(new B9(r,n));t.set(he,o);const a=this.B(new hl(o));t.set(Ie,a);const l=this.B(new A5(o));a.registerProvider(ie.file,l);const c=new Sr(a);t.set(ze,c);const u=new Qn(1,i,o,a),f=new Kn(u,c,i,a,o);t.set(jt,f),a.registerProvider(ie.vscodeUserData,new G9(ie.file,l,ie.vscodeUserData,f,c,o));let d;me&&e.win32RegValueName?d=this.B(new Gn(o,e.win32RegValueName)):Rt&&e.darwinBundleIdentifier?d=this.B(new Gn(o,e.darwinBundleIdentifier)):i.policyFile?d=this.B(new El(i.policyFile,a,o)):d=new Xu,t.set(Qu,d);const p=this.B(new _g(f.defaultProfile.settingsResource,a,d,o));t.set(oi,p),await Promise.all([u.init(),p.initialize()]);let m;try{m=await _9(u,o)}catch(M){M.code!=="ENOENT"&&o.error(M)}const w=await V9(u,o),y=await z9(u,o);f.init(),t.set(ze,new Sr(a));const b=new kl("local",p,i,o);t.set(ar,b),t.set(Ku,new qe(da,void 0,!0)),t.set(Ei,new qe(Ol,void 0,!0)),t.set(Un,new qe(ll,void 0,!0)),t.set(cf,new qe(Ua,void 0,!0)),t.set(zi,new qe(Nl,void 0,!0)),t.set(D2,new qe(nl,void 0,!0)),t.set(ur,new qe(Tl)),t.set(bi,new qe(Ta,void 0,!0)),t.set(C5,new qe(yl,void 0,!1));const S=[],I=q4(e,p);if(Mh(e,i)){e.aiConfig&&e.aiConfig.ariaKey&&S.push(new S9(b,I,"monacoworkbench",null,e.aiConfig.ariaKey));const M={appenders:S,sendErrorTelemetry:!1,commonProperties:C4($d(),Sd(),process.arch,e.commit,e.version,m,w,y,I),piiPaths:W4(i)};t.set(Ht,new qe(Il,[M],!1))}else t.set(Ht,V4);return[new O5(t),S]}g(t){if(me){const e=Z9(t);e&&F1(e)}return t}h(t){Id(e=>{const i=Fi(e,!0);i&&t.error(`[uncaught exception in CLI]: ${i}`)}),process.on("uncaughtException",e=>{Dd(e)||At(e)}),process.on("unhandledRejection",e=>At(e))}async j(t,e,i,s){let r;if(t.args.profile&&(r=i.profiles.find(o=>o.name===t.args.profile),!r))throw new Error(`Profile '${t.args.profile}' not found.`);const n=(r??i.defaultProfile).extensionsResource;if(this.b["list-extensions"])return s.createInstance(qi,new ji(F.Info,!1)).listExtensions(!!this.b["show-versions"],this.b.category,n);if(this.b["install-extension"]||this.b["install-builtin-extension"]){const o={isMachineScoped:!!this.b["do-not-sync"],installPreReleaseVersion:!!this.b["pre-release"],donotIncludePackAndDependencies:!!this.b["do-not-include-pack-dependencies"],profileLocation:n};return s.createInstance(qi,new ji(F.Info,!1)).installExtensions(this.m(this.b["install-extension"]||[]),this.m(this.b["install-builtin-extension"]||[]),o,!!this.b.force)}else{if(this.b["uninstall-extension"])return s.createInstance(qi,new ji(F.Info,!1)).uninstallExtensions(this.m(this.b["uninstall-extension"]),!!this.b.force,n);if(this.b["update-extensions"])return s.createInstance(qi,new ji(F.Info,!1)).updateExtensions(n);if(this.b["locate-extension"])return s.createInstance(qi,new ji(F.Info,!1)).locateExtension(this.b["locate-extension"]);if(this.b["add-mcp"])return s.createInstance(Cl,new ji(F.Info,!1)).addMcpDefinitions(this.b["add-mcp"]);this.b.telemetry&&console.log(await $9(t.appRoot,t.extensionsPath))}}m(t){return t.map(e=>/\.vsix$/i.test(e)?k.file(qs(e)?e:U(os(),e)):e)}};async function t7(t){const e=new e7(t);try{await e.run()}finally{e.dispose()}}export{t7 as main};

//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/2901c5ac6db8a986a5666c3af51ff804d05af0d4/core/vs/code/node/cliProcessMain.js.map