typescript-language-server 3.3.3-0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +545 -0
- package/README.md +12 -6
- package/lib/cli.mjs +1 -1
- package/lib/cli.mjs.map +1 -1
- package/package.json +36 -35
package/lib/cli.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import e,{statSync as t,existsSync as n,readFileSync as r}from"node:fs";import i from"events";import o from"child_process";import s from"path";import a from"fs";import c from"process";import u,{promisify as l}from"util";import h from"os";import d from"crypto";import p from"net";import f from"url";import m from"constants";import g from"stream";import y from"assert";import*as v from"node:path";import b,{resolve as S}from"node:path";import"node:fs/promises";import w from"node:stream";import{promisify as R}from"node:util";import E from"node:child_process";import{createRequire as C}from"node:module";import{fileURLToPath as _}from"node:url";import D from"node:process";var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function x(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var P={exports:{}},O={},N={};let q=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}};N.CommanderError=q,N.InvalidArgumentError=class extends q{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:I}=N;O.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new I(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},O.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"};var A={},M={};const{humanReadableArgName:F}=O;M.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,n,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(n).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}compareOptions(e,t){const n=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||r){let i;i=n?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter((e=>!e.hidden));t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e._args.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e._args.find((e=>e.description))?e._args:[]}subcommandTerm(e){const t=e._args.map((e=>F(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){const o=`${e.padEnd(n+2)}${i}`;return t.wrap(o,r-2,n+2)}return e}function o(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(s=s.concat([t.wrap(a,r,0),""]));const c=t.visibleArguments(e).map((e=>i(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(s=s.concat(["Arguments:",o(c),""]));const u=t.visibleOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));if(u.length>0&&(s=s.concat(["Options:",o(u),""])),this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));n.length>0&&(s=s.concat(["Global Options:",o(n),""]))}const l=t.visibleCommands(e).map((e=>i(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(s=s.concat(["Commands:",o(l),""])),s.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const i=new RegExp("[\\n][ \\f\\t\\v - \ufeff]+");if(e.match(i))return e;const o=t-n;if(o<r)return e;const s=e.slice(0,n),a=e.slice(n).replace("\r\n","\n"),c=" ".repeat(n),u="\\s",l=new RegExp(`\n|.{1,${o-1}}([${u}]|$)|[^${u}]+?([${u}]|$)`,"g");return s+(a.match(l)||[]).map(((e,t)=>"\n"===e?"":(t>0?c:"")+e.trimEnd())).join("\n")}};var L={};const{InvalidArgumentError:j}=N;function $(e){let t,n;const r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}L.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=$(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new j(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},L.splitOptionFlags=$,L.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,i=void 0!==r&&r;return t.negate===(i===e)}};var H={};const W=3;H.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let r=[],i=W;return t.forEach((t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>W)return Math.max(e.length,t.length);const n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let o=1;o=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+o),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}(e,t),o=Math.max(e.length,t.length);(o-n)/o>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))})),r.sort(((e,t)=>e.localeCompare(t))),n&&(r=r.map((e=>`--${e}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""};const V=i.EventEmitter,U=o,K=s,G=a,z=c,{Argument:B,humanReadableArgName:J}=O,{CommanderError:Y}=N,{Help:X}=M,{Option:Q,splitOptionFlags:Z,DualOptions:ee}=L,{suggestSimilar:te}=H;function ne(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function re(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",i="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],i=n[4]),t&&"0"!==i?`${t}=${r}:${parseInt(i)+1}`:e}))}function ie(e){const t=[];for(let n=e;n;n=n.parent)t.push(n);return t}A.Command=class e extends V{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>z.stdout.write(e),writeErr:e=>z.stderr.write(e),getOutHelpWidth:()=>z.stdout.isTTY?z.stdout.columns:void 0,getErrHelpWidth:()=>z.stderr.isTTY?z.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}command(e,t,n){let r=t,i=n;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};const[,o,s]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return r&&(a.description(r),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!i.noHelp&&!i.hidden),a._executableFile=i.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(t){return new e(t)}createHelp(){return Object.assign(new X,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new B(e,t)}argument(e,t,n,r){const i=this.createArgument(e,t);return"function"==typeof n?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this._args.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this._args.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new Y(e,t,n)),z.exit(e)}action(e){return this._actionHandler=t=>{const n=this._args.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new Q(e,t)}addOption(e){const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");this.options.push(e);const r=(t,r,i)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const o=this.getOptionValue(n);if(null!==t&&e.parseArg)try{t=e.parseArg(t,o)}catch(e){if("commander.invalidArgument"===e.code){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}else null!==t&&e.variadic&&(t=e._concatValue(t,o));null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,i)};return this.on("option:"+t,(t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,"env")})),this}_optionEx(e,t,n,r,i){if("object"==typeof t&&t instanceof Q)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const o=this.createOption(t,n);if(o.makeOptionMandatory(!!e.mandatory),"function"==typeof r)o.default(i).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},o.default(i).argParser(r)}else o.default(r);return this.addOption(o)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return ie(this).forEach((n=>{void 0!==n.getOptionValueSource(e)&&(t=n.getOptionValueSource(e))})),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let n;switch(t=t||{},void 0===e&&(e=z.argv,z.versions&&z.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":z.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function i(e,t){const n=K.resolve(e,t);if(G.existsSync(n))return n;if(r.includes(K.extname(t)))return;const i=r.find((e=>G.existsSync(`${n}${e}`)));return i?`${n}${i}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o,s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let e;try{e=G.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}a=K.resolve(K.dirname(e),a)}if(a){let t=i(a,s);if(!t&&!e._executableFile&&this._scriptPath){const n=K.basename(this._scriptPath,K.extname(this._scriptPath));n!==this._name&&(t=i(a,`${n}-${e._name}`))}s=t||s}if(n=r.includes(K.extname(s)),"win32"!==z.platform?n?(t.unshift(s),t=re(z.execArgv).concat(t),o=U.spawn(z.argv[0],t,{stdio:"inherit"})):o=U.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=re(z.execArgv).concat(t),o=U.spawn(z.execPath,t,{stdio:"inherit"})),!o.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{z.on(e,(()=>{!1===o.killed&&null===o.exitCode&&o.kill(e)}))}))}const c=this._exitCallback;c?o.on("close",(()=>{c(new Y(z.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):o.on("close",z.exit.bind(z)),o.on("error",(t=>{if("ENOENT"===t.code){const t=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${s}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}if("EACCES"===t.code)throw new Error(`'${s}' not executable`);if(c){const e=new Y(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,c(e)}else z.exit(1)})),this.runningCommand=o}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let i;return r||this.help({error:!0}),i=this._chainOrCallSubCommandHook(i,r,"preSubcommand"),i=this._chainOrCall(i,(()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))})),i}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._helpLongFlag])}_checkNumberOfArguments(){this._args.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this._args.length>0&&this._args[this._args.length-1].variadic||this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg)try{r=e.parseArg(t,n)}catch(n){if("commander.invalidArgument"===n.code){const r=`error: command-argument value '${t}' is invalid for argument '${e.name()}'. ${n.message}`;this.error(r,{exitCode:n.exitCode,code:n.code})}throw n}return r};this._checkNumberOfArguments();const t=[];this._args.forEach(((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce(((t,r)=>e(n,r,t)),n.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return ie(this).reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&r.reverse(),r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))})),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach((e=>{r=this._chainOrCall(r,(()=>e(this,t)))})),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return ne(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),ne(this,n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&(n=this._chainOrCall(n,(()=>{this.parent.emit(i,e,t)}))),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)})),t=e.filter((e=>e.conflictsWith.length>0));t.forEach((t=>{const n=e.find((e=>t.conflictsWith.includes(e.attributeName())));n&&this._conflictingOption(t,n)}))}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){const t=[],n=[];let r=t;const i=e.slice();function o(e){return e.length>1&&"-"===e[0]}let s=null;for(;i.length;){const e=i.shift();if("--"===e){r===n&&r.push(e),r.push(...i);break}if(!s||o(e)){if(s=null,o(e)){const t=this._findOption(e);if(t){if(t.required){const e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!o(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(o(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}else this.emit(`option:${s.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return ie(this).reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,i=n.code||"commander.error";this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in z.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,z.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new ee(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find((e=>e.negate&&t===e.attributeName())),i=this.options.find((e=>!e.negate&&t===e.attributeName()));return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:i||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter((e=>e.long)).map((e=>e.long));n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=te(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this._args.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((e=>{n.push(e.name()),e.alias()&&n.push(e.alias())})),t=te(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this._args.map((e=>J(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=K.basename(e,K.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);ie(this).reverse().forEach((e=>e.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",n),ie(this).forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const n=Z(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=z.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,(e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)})),this}},function(e,t){const{Argument:n}=O,{Command:r}=A,{CommanderError:i,InvalidArgumentError:o}=N,{Help:s}=M,{Option:a}=L;(t=e.exports=new r).program=t,t.Argument=n,t.Command=r,t.CommanderError=i,t.Help=s,t.InvalidArgumentError=o,t.InvalidOptionArgumentError=o,t.Option=a}(P,P.exports);const oe=k(P.exports),{program:se,createCommand:ae,createArgument:ce,createOption:ue,CommanderError:le,InvalidArgumentError:he,InvalidOptionArgumentError:de,Command:pe,Argument:fe,Option:me,Help:ge}=oe;var ye={},ve={};function be(e){return"string"==typeof e||e instanceof String}function Se(e){return"function"==typeof e}function we(e){return Array.isArray(e)}Object.defineProperty(ve,"__esModule",{value:!0}),ve.thenable=ve.typedArray=ve.stringArray=ve.array=ve.func=ve.error=ve.number=ve.string=ve.boolean=void 0,ve.boolean=function(e){return!0===e||!1===e},ve.string=be,ve.number=function(e){return"number"==typeof e||e instanceof Number},ve.error=function(e){return e instanceof Error},ve.func=Se,ve.array=we,ve.stringArray=function(e){return we(e)&&e.every((e=>be(e)))},ve.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},ve.thenable=function(e){return e&&Se(e.then)};var Re,Ee,Ce={},_e={},De={},Te={},ke={},xe={},Pe={};function Oe(){if(Re)return Pe;function e(e){return"string"==typeof e||e instanceof String}function t(e){return Array.isArray(e)}return Re=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.stringArray=Pe.array=Pe.func=Pe.error=Pe.number=Pe.string=Pe.boolean=void 0,Pe.boolean=function(e){return!0===e||!1===e},Pe.string=e,Pe.number=function(e){return"number"==typeof e||e instanceof Number},Pe.error=function(e){return e instanceof Error},Pe.func=function(e){return"function"==typeof e},Pe.array=t,Pe.stringArray=function(n){return t(n)&&n.every((t=>e(t)))},Pe}function Ne(){return Ee||(Ee=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Message=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType=e.RequestType0=e.AbstractMessageSignature=e.ParameterStructures=e.ResponseError=e.ErrorCodes=void 0;const t=Oe();var n,r;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3}(n=e.ErrorCodes||(e.ErrorCodes={}));class i extends Error{constructor(e,r,o){super(r),this.code=t.number(e)?e:n.UnknownErrorCode,this.data=o,Object.setPrototypeOf(this,i.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}e.ResponseError=i;class o{constructor(e){this.kind=e}static is(e){return e===o.auto||e===o.byName||e===o.byPosition}toString(){return this.kind}}e.ParameterStructures=o,o.auto=new o("auto"),o.byPosition=new o("byPosition"),o.byName=new o("byName");class s{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return o.auto}}e.AbstractMessageSignature=s;e.RequestType0=class extends s{constructor(e){super(e,0)}};e.RequestType=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.RequestType1=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.RequestType2=class extends s{constructor(e){super(e,2)}};e.RequestType3=class extends s{constructor(e){super(e,3)}};e.RequestType4=class extends s{constructor(e){super(e,4)}};e.RequestType5=class extends s{constructor(e){super(e,5)}};e.RequestType6=class extends s{constructor(e){super(e,6)}};e.RequestType7=class extends s{constructor(e){super(e,7)}};e.RequestType8=class extends s{constructor(e){super(e,8)}};e.RequestType9=class extends s{constructor(e){super(e,9)}};e.NotificationType=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.NotificationType0=class extends s{constructor(e){super(e,0)}};e.NotificationType1=class extends s{constructor(e,t=o.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};e.NotificationType2=class extends s{constructor(e){super(e,2)}};e.NotificationType3=class extends s{constructor(e){super(e,3)}};e.NotificationType4=class extends s{constructor(e){super(e,4)}};e.NotificationType5=class extends s{constructor(e){super(e,5)}};e.NotificationType6=class extends s{constructor(e){super(e,6)}};e.NotificationType7=class extends s{constructor(e){super(e,7)}};e.NotificationType8=class extends s{constructor(e){super(e,8)}};e.NotificationType9=class extends s{constructor(e){super(e,9)}},(r=e.Message||(e.Message={})).isRequest=function(e){const n=e;return n&&t.string(n.method)&&(t.string(n.id)||t.number(n.id))},r.isNotification=function(e){const n=e;return n&&t.string(n.method)&&void 0===e.id},r.isResponse=function(e){const n=e;return n&&(void 0!==n.result||!!n.error)&&(t.string(n.id)||t.number(n.id)||null===n.id)}}(xe)),xe}var qe,Ie={};function Ae(){return qe||(qe=1,function(e){var t,n;Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=e.LinkedMap=e.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(n=e.Touch||(e.Touch={}));class r{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=n.None){const r=this._map.get(e);if(r)return t!==n.None&&this.touch(r,t),r.value}set(e,t,r=n.None){let i=this._map.get(e);if(i)i.value=t,r!==n.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case n.None:this.addItemLast(i);break;case n.First:this.addItemFirst(i);break;case n.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(t===n.First||t===n.Last)if(t===n.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===n.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}e.LinkedMap=r;e.LRUCache=class extends r{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=n.AsNew){return super.get(e,t)}peek(e){return super.get(e,n.None)}set(e,t){return super.set(e,t,n.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}}(Ie)),Ie}var Me,Fe={};var Le,je,$e={},He={};function We(){if(Le)return He;let e;function t(){if(void 0===e)throw new Error("No runtime abstraction layer installed");return e}return Le=1,Object.defineProperty(He,"__esModule",{value:!0}),function(t){t.install=function(t){if(void 0===t)throw new Error("No runtime abstraction layer provided");e=t}}(t||(t={})),He.default=t,He}function Ve(){return je||(je=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;const t=We();!function(e){const t={dispose(){}};e.None=function(){return t}}(e.Event||(e.Event={}));class n{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],e))}catch(e){(0,t.default)().console.error(e)}return n}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const o={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),o.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}e.Emitter=r,r._noop=function(){}}($e)),$e}var Ue,Ke={};function Ge(){return Ue||(Ue=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;const t=We(),n=Oe(),r=Ve();var i;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:r.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:r.Event.None}),e.is=function(t){const r=t;return r&&(r===e.None||r===e.Cancelled||n.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}}(i=e.CancellationToken||(e.CancellationToken={}));const o=Object.freeze((function(e,n){const r=(0,t.default)().timer.setTimeout(e.bind(n),0);return{dispose(){r.dispose()}}}));class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?o:(this._emitter||(this._emitter=new r.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}e.CancellationTokenSource=class{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=i.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=i.None}}}(Ke)),Ke}var ze,Be={};var Je,Ye,Xe={},Qe={};function Ze(){if(Je)return Qe;Je=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.Semaphore=void 0;const e=We();return Qe.Semaphore=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&(0,e.default)().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}},Qe}var et,tt={};var nt,rt={};var it,ot,st={};function at(){return it||(it=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;const t=We(),n=Oe(),r=Ne(),i=Ae(),o=Ve(),s=Ge();var a,c,u,l,h,d,p,f,m,g,y,v,b,S,w,R,E,C;!function(e){e.type=new r.NotificationType("$/cancelRequest")}(a||(a={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(c=e.ProgressToken||(e.ProgressToken={})),function(e){e.type=new r.NotificationType("$/progress")}(u||(u={}));e.ProgressType=class{constructor(){}},function(e){e.is=function(e){return n.func(e)}}(l||(l={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(h=e.Trace||(e.Trace={})),(d=e.TraceValues||(e.TraceValues={})).Off="off",d.Messages="messages",d.Compact="compact",d.Verbose="verbose",function(e){e.fromString=function(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(h=e.Trace||(e.Trace={})),function(e){e.Text="text",e.JSON="json"}(e.TraceFormat||(e.TraceFormat={})),function(e){e.fromString=function(t){return n.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(p=e.TraceFormat||(e.TraceFormat={})),function(e){e.type=new r.NotificationType("$/setTrace")}(f=e.SetTraceNotification||(e.SetTraceNotification={})),function(e){e.type=new r.NotificationType("$/logTrace")}(m=e.LogTraceNotification||(e.LogTraceNotification={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(g=e.ConnectionErrors||(e.ConnectionErrors={}));class _ extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,_.prototype)}}e.ConnectionError=_,function(e){e.is=function(e){const t=e;return t&&n.func(t.cancelUndispatched)}}(y=e.ConnectionStrategy||(e.ConnectionStrategy={})),function(e){e.is=function(e){const t=e;return t&&(void 0===t.kind||"id"===t.kind)&&n.func(t.createCancellationTokenSource)&&(void 0===t.dispose||n.func(t.dispose))}}(v=e.IdCancellationReceiverStrategy||(e.IdCancellationReceiverStrategy={})),function(e){e.is=function(e){const t=e;return t&&"request"===t.kind&&n.func(t.createCancellationTokenSource)&&(void 0===t.dispose||n.func(t.dispose))}}(b=e.RequestCancellationReceiverStrategy||(e.RequestCancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new s.CancellationTokenSource}),e.is=function(e){return v.is(e)||b.is(e)}}(S=e.CancellationReceiverStrategy||(e.CancellationReceiverStrategy={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(a.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}}(w=e.CancellationSenderStrategy||(e.CancellationSenderStrategy={})),function(e){e.Message=Object.freeze({receiver:S.Message,sender:w.Message}),e.is=function(e){const t=e;return t&&S.is(t.receiver)&&w.is(t.sender)}}(R=e.CancellationStrategy||(e.CancellationStrategy={})),function(e){e.is=function(e){const t=e;return t&&n.func(t.handleMessage)}}(E=e.MessageStrategy||(e.MessageStrategy={})),(e.ConnectionOptions||(e.ConnectionOptions={})).is=function(e){const t=e;return t&&(R.is(t.cancellationStrategy)||y.is(t.connectionStrategy)||E.is(t.messageStrategy))},function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(C||(C={})),e.createMessageConnection=function(d,y,b,S){const w=void 0!==b?b:e.NullLogger;let D=0,T=0,k=0;const x="2.0";let P;const O=new Map;let N;const q=new Map,I=new Map;let A,M,F=new i.LinkedMap,L=new Map,j=new Set,$=new Map,H=h.Off,W=p.Text,V=C.New;const U=new o.Emitter,K=new o.Emitter,G=new o.Emitter,z=new o.Emitter,B=new o.Emitter,J=S&&S.cancellationStrategy?S.cancellationStrategy:R.Message;function Y(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function X(e,t){var n;r.Message.isRequest(t)?e.set(Y(t.id),t):r.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++k).toString():"res-"+n.toString(),t):e.set("not-"+(++T).toString(),t)}function Q(e){}function Z(){return V===C.Listening}function ee(){return V===C.Closed}function te(){return V===C.Disposed}function ne(){V!==C.New&&V!==C.Listening||(V=C.Closed,K.fire(void 0))}function re(){A||0===F.size||(A=(0,t.default)().timer.setImmediate((()=>{A=void 0,function(){if(0===F.size)return;const e=F.shift();try{const t=S?.messageStrategy;E.is(t)?t.handleMessage(e,ie):ie(e)}finally{re()}}()})))}function ie(e){r.Message.isRequest(e)?function(e){if(te())return;function t(t,n,i){const o={jsonrpc:x,id:e.id};t instanceof r.ResponseError?o.error=t.toJson():o.result=void 0===t?null:t,ae(o,n,i),y.write(o).catch((()=>w.error("Sending response failed.")))}function i(t,n,r){const i={jsonrpc:x,id:e.id,error:t.toJson()};ae(i,n,r),y.write(i).catch((()=>w.error("Sending response failed.")))}function o(t,n,r){void 0===t&&(t=null);const i={jsonrpc:x,id:e.id,result:t};ae(i,n,r),y.write(i).catch((()=>w.error("Sending response failed.")))}!function(e){if(H===h.Off||!M)return;if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||!e.params||(t=`Params: ${se(e.params)}\n\n`),M.log(`Received request '${e.method} - (${e.id})'.`,t)}else ue("receive-request",e)}(e);const s=O.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||P){const s=e.id??String(Date.now()),l=v.is(J.receiver)?J.receiver.createCancellationTokenSource(s):J.receiver.createCancellationTokenSource(e);null!==e.id&&j.has(e.id)&&l.cancel(),null!==e.id&&$.set(s,l);try{let h;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but received none.`),e.method,u);h=c(l.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byName)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);h=c(...e.params,l.token)}else{if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byPosition)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);h=c(e.params,l.token)}else P&&(h=P(e.method,e.params,l.token));const d=h;h?d.then?d.then((n=>{$.delete(s),t(n,e.method,u)}),(t=>{$.delete(s),t instanceof r.ResponseError?i(t,e.method,u):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):($.delete(s),t(h,e.method,u)):($.delete(s),o(h,e.method,u))}catch(o){$.delete(s),o instanceof r.ResponseError?t(o,e.method,u):o&&n.string(o.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${o.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):r.Message.isNotification(e)?function(e){if(te())return;let t,n;if(e.method===a.type.method){const t=e.params.id;return j.delete(t),void ce(e)}{const r=q.get(e.method);r&&(n=r.handler,t=r.type)}if(n||N)try{if(ce(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==r.ParameterStructures.byName&&w.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const i=e.params;e.method===u.type.method&&2===i.length&&c.is(i[0])?n({token:i[0],value:i[1]}):(void 0!==t&&(t.parameterStructures===r.ParameterStructures.byName&&w.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&w.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else void 0!==t&&t.parameterStructures===r.ParameterStructures.byPosition&&w.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else N&&N(e.method,e.params)}catch(t){t.message?w.error(`Notification handler '${e.method}' failed with message: ${t.message}`):w.error(`Notification handler '${e.method}' failed unexpectedly.`)}else G.fire(e)}(e):r.Message.isResponse(e)?function(e){if(te())return;if(null===e.id)e.error?w.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):w.error("Received response message without id. No further error information provided.");else{const t=e.id,n=L.get(t);if(function(e,t){if(H===h.Off||!M)return;if(W===p.Text){let n;if(H!==h.Verbose&&H!==h.Compact||(e.error&&e.error.data?n=`Error data: ${se(e.error.data)}\n\n`:e.result?n=`Result: ${se(e.result)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";M.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else M.log(`Received response ${e.id} without active response promise.`,n)}else ue("receive-response",e)}(e,n),void 0!==n){L.delete(t);try{if(e.error){const t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?w.error(`Response handler '${n.method}' failed with message: ${e.message}`):w.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void w.error("Received empty message.");w.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(n.string(t.id)||n.number(t.id)){const e=t.id,n=L.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}d.onClose(ne),d.onError((function(e){U.fire([e,void 0,void 0])})),y.onClose(ne),y.onError((function(e){U.fire(e)}));const oe=e=>{try{if(r.Message.isNotification(e)&&e.method===a.type.method){const t=e.params.id,n=Y(t),i=F.get(n);if(r.Message.isRequest(i)){const r=S?.connectionStrategy,o=r&&r.cancelUndispatched?r.cancelUndispatched(i,Q):void 0;if(o&&(void 0!==o.error||void 0!==o.result))return F.delete(n),$.delete(t),o.id=i.id,ae(o,e.method,Date.now()),void y.write(o).catch((()=>w.error("Sending response for canceled message failed.")))}const o=$.get(t);if(void 0!==o)return o.cancel(),void ce(e);j.add(t)}X(F,e)}finally{re()}};function se(e){if(null!=e)switch(H){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function ae(e,t,n){if(H!==h.Off&&M)if(W===p.Text){let r;H!==h.Verbose&&H!==h.Compact||(e.error&&e.error.data?r=`Error data: ${se(e.error.data)}\n\n`:e.result?r=`Result: ${se(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),M.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else ue("send-response",e)}function ce(e){if(H!==h.Off&&M&&e.method!==m.type.method)if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||(t=e.params?`Params: ${se(e.params)}\n\n`:"No parameters provided.\n\n"),M.log(`Received notification '${e.method}'.`,t)}else ue("receive-notification",e)}function ue(e,t){if(!M||H===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};M.log(n)}function le(){if(ee())throw new _(g.Closed,"Connection is closed.");if(te())throw new _(g.Disposed,"Connection is disposed.")}function he(e){return void 0===e?null:e}function de(e){return null===e?void 0:e}function pe(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function fe(e,t){switch(e){case r.ParameterStructures.auto:return pe(t)?de(t):[he(t)];case r.ParameterStructures.byName:if(!pe(t))throw new Error("Received parameters by name but param is not an object literal.");return de(t);case r.ParameterStructures.byPosition:return[he(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function me(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=fe(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(he(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const ge={sendNotification:(e,...t)=>{let i,o;if(le(),n.string(e)){i=e;const n=t[0];let s=0,a=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(s=1,a=n);let c=t.length;const u=c-s;switch(u){case 0:o=void 0;break;case 1:o=fe(a,t[s]);break;default:if(a===r.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);o=t.slice(s,c).map((e=>he(e)))}}else{const n=t;i=e.method,o=me(e,n)}const s={jsonrpc:x,method:i,params:o};return function(e){if(H!==h.Off&&M)if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||(t=e.params?`Params: ${se(e.params)}\n\n`:"No parameters provided.\n\n"),M.log(`Sending notification '${e.method}'.`,t)}else ue("send-notification",e)}(s),y.write(s).catch((e=>{throw w.error("Sending notification failed."),e}))},onNotification:(e,t)=>{let r;return le(),n.func(e)?N=e:t&&(n.string(e)?(r=e,q.set(e,{type:void 0,handler:t})):(r=e.method,q.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==r?q.delete(r):N=void 0}}},onProgress:(e,t,n)=>{if(I.has(t))throw new Error(`Progress handler for token ${t} already registered`);return I.set(t,n),{dispose:()=>{I.delete(t)}}},sendProgress:(e,t,n)=>ge.sendNotification(u.type,{token:t,value:n}),onUnhandledProgress:z.event,sendRequest:(e,...t)=>{let i,o,a;if(le(),function(){if(!Z())throw new Error("Call listen() first.")}(),n.string(e)){i=e;const n=t[0],c=t[t.length-1];let u=0,l=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(u=1,l=n);let h=t.length;s.CancellationToken.is(c)&&(h-=1,a=c);const d=h-u;switch(d){case 0:o=void 0;break;case 1:o=fe(l,t[u]);break;default:if(l===r.ParameterStructures.byName)throw new Error(`Received ${d} parameters for 'by Name' request parameter structure.`);o=t.slice(u,h).map((e=>he(e)))}}else{const n=t;i=e.method,o=me(e,n);const r=e.numberOfParams;a=s.CancellationToken.is(n[r])?n[r]:void 0}const c=D++;let u;a&&(u=a.onCancellationRequested((()=>{const e=J.sender.sendCancellation(ge,c);return void 0===e?(w.log(`Received no promise from cancellation strategy when cancelling id ${c}`),Promise.resolve()):e.catch((()=>{w.log(`Sending cancellation messages for id ${c} failed`)}))})));const l={jsonrpc:x,id:c,method:i,params:o};return function(e){if(H!==h.Off&&M)if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||!e.params||(t=`Params: ${se(e.params)}\n\n`),M.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ue("send-request",e)}(l),"function"==typeof J.sender.enableCancellation&&J.sender.enableCancellation(l),new Promise((async(e,t)=>{const n={method:i,timerStart:Date.now(),resolve:t=>{e(t),J.sender.cleanup(c),u?.dispose()},reject:e=>{t(e),J.sender.cleanup(c),u?.dispose()}};try{await y.write(l),L.set(c,n)}catch(e){throw w.error("Sending request failed."),n.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),e}}))},onRequest:(e,t)=>{le();let r=null;return l.is(e)?(r=void 0,P=e):n.string(e)?(r=null,void 0!==t&&(r=e,O.set(e,{handler:t,type:void 0}))):void 0!==t&&(r=e.method,O.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==r&&(void 0!==r?O.delete(r):P=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(e,t,r)=>{let i=!1,o=p.Text;void 0!==r&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,o=r.traceFormat||p.Text)),H=e,W=o,M=H===h.Off?void 0:t,!i||ee()||te()||await ge.sendNotification(f.type,{value:h.toString(e)})},onError:U.event,onClose:K.event,onUnhandledNotification:G.event,onDispose:B.event,end:()=>{y.end()},dispose:()=>{if(te())return;V=C.Disposed,B.fire(void 0);const e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const t of L.values())t.reject(e);L=new Map,$=new Map,j=new Set,F=new i.LinkedMap,n.func(y.dispose)&&y.dispose(),n.func(d.dispose)&&d.dispose()},listen:()=>{le(),function(){if(Z())throw new _(g.AlreadyListening,"Connection is already listening")}(),V=C.Listening,d.listen(oe)},inspect:()=>{(0,t.default)().console.log("inspect")}};return ge.onNotification(m.type,(e=>{if(H===h.Off||!M)return;const t=H===h.Verbose||H===h.Compact;M.log(e.message,t?e.verbose:void 0)})),ge.onNotification(u.type,(e=>{const t=I.get(e.token);t?t(e.value):z.fire(e)})),ge}}(st)),st}function ct(){return ot||(ot=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;const t=Ne();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});const n=Ae();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=function(){return Me||(Me=1,e=Fe,Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0,(e.Disposable||(e.Disposable={})).create=function(e){return{dispose:e}}),Fe;var e}();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ve();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const o=Ge();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return o.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return o.CancellationToken}});const s=function(){if(ze)return Be;ze=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.SharedArrayReceiverStrategy=Be.SharedArraySenderStrategy=void 0;const e=Ge();var t;!function(e){e.Continue=0,e.Cancelled=1}(t||(t={})),Be.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(e){if(null===e.id)return;const n=new SharedArrayBuffer(4);new Int32Array(n,0,1)[0]=t.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(void 0===r)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,t.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};class n{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===t.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class r{constructor(e){this.token=new n(e)}cancel(){}dispose(){}}return Be.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(t){const n=t.$cancellationData;return void 0===n?new e.CancellationTokenSource:new r(n)}},Be}();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return s.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const a=(Ye||(Ye=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;const t=We(),n=Oe(),r=Ve(),i=Ze();var o;(e.MessageReader||(e.MessageReader={})).is=function(e){let t=e;return t&&n.func(t.listen)&&n.func(t.dispose)&&n.func(t.onError)&&n.func(t.onClose)&&n.func(t.onPartialMessage)};class s{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter,this.partialMessageEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${n.string(e.message)?e.message:"unknown"}`)}}e.AbstractMessageReader=s,function(e){e.fromOptions=function(e){let n,r;const i=new Map;let o;const s=new Map;if(void 0===e||"string"==typeof e)n=e??"utf-8";else{if(n=e.charset??"utf-8",void 0!==e.contentDecoder&&(r=e.contentDecoder,i.set(r.name,r)),void 0!==e.contentDecoders)for(const t of e.contentDecoders)i.set(t.name,t);if(void 0!==e.contentTypeDecoder&&(o=e.contentTypeDecoder,s.set(o.name,o)),void 0!==e.contentTypeDecoders)for(const t of e.contentTypeDecoders)s.set(t.name,t)}return void 0===o&&(o=(0,t.default)().applicationJson.decoder,s.set(o.name,o)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:o,contentTypeDecoders:s}}}(o||(o={})),e.ReadableStreamMessageReader=class extends s{constructor(e,n){super(),this.readable=e,this.options=o.fromOptions(n),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new i.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders(!0);if(!e)return;const t=e.get("content-length");if(!t)return void this.fireError(new Error("Header must provide a Content-Length property."));const n=parseInt(t);if(isNaN(n))return void this.fireError(new Error("Content-Length value must be a number."));this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock((async()=>{const t=void 0!==this.options.contentDecoder?await this.options.contentDecoder.decode(e):e,n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)})).catch((e=>{this.fireError(e)}))}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,t.default)().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}}(Xe)),Xe);Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=(et||(et=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;const t=We(),n=Oe(),r=Ze(),i=Ve();var o;(e.MessageWriter||(e.MessageWriter={})).is=function(e){let t=e;return t&&n.func(t.dispose)&&n.func(t.onClose)&&n.func(t.onError)&&n.func(t.write)};class s{constructor(){this.errorEmitter=new i.Emitter,this.closeEmitter=new i.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${n.string(e.message)?e.message:"unknown"}`)}}e.AbstractMessageWriter=s,function(e){e.fromOptions=function(e){return void 0===e||"string"==typeof e?{charset:e??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:e.charset??"utf-8",contentEncoder:e.contentEncoder,contentTypeEncoder:e.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}}(o||(o={})),e.WriteableStreamMessageWriter=class extends s{constructor(e,t){super(),this.writable=e,this.options=o.fromOptions(t),this.errorCount=0,this.writeSemaphore=new r.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}}}(tt)),tt);Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const u=(nt||(nt=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.AbstractMessageBuffer=void 0,rt.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(0===this._chunks.length)return;let t=0,n=0,r=0,i=0;e:for(;n<this._chunks.length;){const e=this._chunks[n];for(r=0;r<e.length;){switch(e[r]){case 13:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case 10:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}i+=e.byteLength,n++}if(4!==t)return;const o=this._read(i+r),s=new Map,a=this.toString(o,"ascii").split("\r\n");if(a.length<2)return s;for(let t=0;t<a.length-2;t++){const n=a[t],r=n.indexOf(":");if(-1===r)throw new Error("Message header must separate key and value using :");const i=n.substr(0,r),o=n.substr(r+1).trim();s.set(e?i.toLowerCase():i,o)}return s}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}),rt);Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const l=at();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return l.MessageStrategy}});const h=We();e.RAL=h.default}(ke)),ke}Object.defineProperty(Te,"__esModule",{value:!0});const ut=u,lt=ct();class ht extends lt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return ht.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new ut.TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}}ht.emptyBuffer=Buffer.allocUnsafe(0);class dt{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),lt.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),lt.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),lt.Disposable.create((()=>this.stream.off("end",e)))}onData(e){return this.stream.on("data",e),lt.Disposable.create((()=>this.stream.off("data",e)))}}class pt{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),lt.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),lt.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),lt.Disposable.create((()=>this.stream.off("end",e)))}write(e,t){return new Promise(((n,r)=>{const i=e=>{null==e?n():r(e)};"string"==typeof e?this.stream.write(e,t,i):this.stream.write(e,i)}))}end(){this.stream.end()}}const ft=Object.freeze({messageBuffer:Object.freeze({create:e=>new ht(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(e){return Promise.reject(e)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new ut.TextDecoder(t.charset).decode(e)))}catch(e){return Promise.reject(e)}}})}),stream:Object.freeze({asReadableStream:e=>new dt(e),asWritableStream:e=>new pt(e)}),console:console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function mt(){return ft}!function(e){e.install=function(){lt.RAL.install(ft)}}(mt||(mt={})),Te.default=mt,function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.createServerSocketTransport=e.createClientSocketTransport=e.createServerPipeTransport=e.createClientPipeTransport=e.generateRandomPipeName=e.StreamMessageWriter=e.StreamMessageReader=e.SocketMessageWriter=e.SocketMessageReader=e.PortMessageWriter=e.PortMessageReader=e.IPCMessageWriter=e.IPCMessageReader=void 0;const r=Te;r.default.install();const i=s,o=h,a=d,c=p,u=ct();n(ct(),e);class l extends u.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){return this.process.on("message",e),u.Disposable.create((()=>this.process.off("message",e)))}}e.IPCMessageReader=l;class f extends u.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;const t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){try{return"function"==typeof this.process.send&&this.process.send(e,void 0,void 0,(t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0})),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}e.IPCMessageWriter=f;class m extends u.AbstractMessageReader{constructor(e){super(),this.onData=new u.Emitter,e.on("close",(()=>this.fireClose)),e.on("error",(e=>this.fireError(e))),e.on("message",(e=>{this.onData.fire(e)}))}listen(e){return this.onData.event(e)}}e.PortMessageReader=m;class g extends u.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",(()=>this.fireClose())),e.on("error",(e=>this.fireError(e)))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}e.PortMessageWriter=g;class y extends u.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,r.default)().stream.asReadableStream(e),t)}}e.SocketMessageReader=y;class v extends u.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}}e.SocketMessageWriter=v;class b extends u.ReadableStreamMessageReader{constructor(e,t){super((0,r.default)().stream.asReadableStream(e),t)}}e.StreamMessageReader=b;class S extends u.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t)}}e.StreamMessageWriter=S;const w=process.env.XDG_RUNTIME_DIR,R=new Map([["linux",107],["darwin",103]]);e.generateRandomPipeName=function(){const e=(0,a.randomBytes)(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=w?i.join(w,`vscode-ipc-${e}.sock`):i.join(o.tmpdir(),`vscode-${e}.sock`);const n=R.get(process.platform);return void 0!==n&&t.length>n&&(0,r.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t},e.createClientPipeTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{let s=(0,c.createServer)((e=>{s.close(),n([new y(e,t),new v(e,t)])}));s.on("error",o),s.listen(e,(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerPipeTransport=function(e,t="utf-8"){const n=(0,c.createConnection)(e);return[new y(n,t),new v(n,t)]},e.createClientSocketTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{const s=(0,c.createServer)((e=>{s.close(),n([new y(e,t),new v(e,t)])}));s.on("error",o),s.listen(e,"127.0.0.1",(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerSocketTransport=function(e,t="utf-8"){const n=(0,c.createConnection)(e,"127.0.0.1");return[new y(n,t),new v(n,t)]},e.createMessageConnection=function(e,t,n,r){n||(n=u.NullLogger);const i=function(e){const t=e;return void 0!==t.read&&void 0!==t.addListener}(e)?new b(e):e,o=function(e){const t=e;return void 0!==t.write&&void 0!==t.addListener}(t)?new S(t):t;return u.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,u.createMessageConnection)(i,o,n,r)}}(De);var gt,yt,vt,bt,St,wt,Rt,Et,Ct,_t,Dt,Tt,kt,xt,Pt,Ot,Nt,qt,It,At,Mt,Ft,Lt,jt,$t,Ht,Wt,Vt,Ut=De,Kt={};!function(e){e.is=function(e){return"string"==typeof e}}(gt||(gt={})),(yt||(yt={})).is=function(e){return"string"==typeof e},function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(vt||(vt={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(bt||(bt={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=bt.MAX_VALUE),t===Number.MAX_VALUE&&(t=bt.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&Hn.uinteger(t.line)&&Hn.uinteger(t.character)}}(St||(St={})),function(e){e.create=function(e,t,n,r){if(Hn.uinteger(e)&&Hn.uinteger(t)&&Hn.uinteger(n)&&Hn.uinteger(r))return{start:St.create(e,t),end:St.create(n,r)};if(St.is(e)&&St.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&St.is(t.start)&&St.is(t.end)}}(wt||(wt={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&wt.is(t.range)&&(Hn.string(t.uri)||Hn.undefined(t.uri))}}(Rt||(Rt={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&wt.is(t.targetRange)&&Hn.string(t.targetUri)&&wt.is(t.targetSelectionRange)&&(wt.is(t.originSelectionRange)||Hn.undefined(t.originSelectionRange))}}(Et||(Et={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&Hn.numberRange(t.red,0,1)&&Hn.numberRange(t.green,0,1)&&Hn.numberRange(t.blue,0,1)&&Hn.numberRange(t.alpha,0,1)}}(Ct||(Ct={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&wt.is(t.range)&&Ct.is(t.color)}}(_t||(_t={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&Hn.string(t.label)&&(Hn.undefined(t.textEdit)||At.is(t))&&(Hn.undefined(t.additionalTextEdits)||Hn.typedArray(t.additionalTextEdits,At.is))}}(Dt||(Dt={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(Tt||(Tt={})),function(e){e.create=function(e,t,n,r,i,o){var s={startLine:e,endLine:t};return Hn.defined(n)&&(s.startCharacter=n),Hn.defined(r)&&(s.endCharacter=r),Hn.defined(i)&&(s.kind=i),Hn.defined(o)&&(s.collapsedText=o),s},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&Hn.uinteger(t.startLine)&&Hn.uinteger(t.startLine)&&(Hn.undefined(t.startCharacter)||Hn.uinteger(t.startCharacter))&&(Hn.undefined(t.endCharacter)||Hn.uinteger(t.endCharacter))&&(Hn.undefined(t.kind)||Hn.string(t.kind))}}(kt||(kt={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Hn.defined(t)&&Rt.is(t.location)&&Hn.string(t.message)}}(xt||(xt={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(Pt||(Pt={})),function(e){e.Unnecessary=1,e.Deprecated=2}(Ot||(Ot={})),function(e){e.is=function(e){var t=e;return Hn.objectLiteral(t)&&Hn.string(t.href)}}(Nt||(Nt={})),function(e){e.create=function(e,t,n,r,i,o){var s={range:e,message:t};return Hn.defined(n)&&(s.severity=n),Hn.defined(r)&&(s.code=r),Hn.defined(i)&&(s.source=i),Hn.defined(o)&&(s.relatedInformation=o),s},e.is=function(e){var t,n=e;return Hn.defined(n)&&wt.is(n.range)&&Hn.string(n.message)&&(Hn.number(n.severity)||Hn.undefined(n.severity))&&(Hn.integer(n.code)||Hn.string(n.code)||Hn.undefined(n.code))&&(Hn.undefined(n.codeDescription)||Hn.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Hn.string(n.source)||Hn.undefined(n.source))&&(Hn.undefined(n.relatedInformation)||Hn.typedArray(n.relatedInformation,xt.is))}}(qt||(qt={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return Hn.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){var t=e;return Hn.defined(t)&&Hn.string(t.title)&&Hn.string(t.command)}}(It||(It={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&Hn.string(t.newText)&&wt.is(t.range)}}(At||(At={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&Hn.string(t.label)&&(Hn.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Hn.string(t.description)||void 0===t.description)}}(Mt||(Mt={})),function(e){e.is=function(e){var t=e;return Hn.string(t)}}(Ft||(Ft={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return At.is(t)&&(Mt.is(t.annotationId)||Ft.is(t.annotationId))}}(Lt||(Lt={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return Hn.defined(t)&&Bt.is(t.textDocument)&&Array.isArray(t.edits)}}(jt||(jt={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&Hn.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Hn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Hn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Ft.is(t.annotationId))}}($t||($t={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&Hn.string(t.oldUri)&&Hn.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Hn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Hn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||Ft.is(t.annotationId))}}(Ht||(Ht={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&Hn.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Hn.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Hn.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||Ft.is(t.annotationId))}}(Wt||(Wt={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Hn.string(e.kind)?$t.is(e)||Ht.is(e)||Wt.is(e):jt.is(e)})))}}(Vt||(Vt={}));var Gt,zt,Bt,Jt,Yt,Xt,Qt,Zt,en,tn,nn,rn,on,sn,an,cn,un,ln,hn,dn,pn,fn,mn,gn,yn,vn,bn,Sn,wn,Rn,En,Cn,_n,Dn,Tn,kn,xn,Pn,On,Nn,qn,In,An,Mn,Fn=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=At.insert(e,t):Ft.is(n)?(i=n,r=Lt.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Lt.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=At.replace(e,t):Ft.is(n)?(i=n,r=Lt.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=Lt.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=At.del(e):Ft.is(t)?(r=t,n=Lt.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=Lt.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),Ln=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(Ft.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),jn=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ln(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(jt.is(e)){var n=new Fn(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Fn(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(Bt.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new Fn(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new Fn(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new Ln,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Mt.is(t)||Ft.is(t)?r=t:n=t,void 0===r?i=$t.create(e,n):(o=Ft.is(r)?r:this._changeAnnotations.manage(r),i=$t.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,s;if(Mt.is(n)||Ft.is(n)?i=n:r=n,void 0===i?o=Ht.create(e,t,r):(s=Ft.is(i)?i:this._changeAnnotations.manage(i),o=Ht.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(o),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(Mt.is(t)||Ft.is(t)?r=t:n=t,void 0===r?i=Wt.create(e,n):(o=Ft.is(r)?r:this._changeAnnotations.manage(r),i=Wt.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e}();!function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return Hn.defined(t)&&Hn.string(t.uri)}}(Gt||(Gt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Hn.defined(t)&&Hn.string(t.uri)&&Hn.integer(t.version)}}(zt||(zt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Hn.defined(t)&&Hn.string(t.uri)&&(null===t.version||Hn.integer(t.version))}}(Bt||(Bt={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return Hn.defined(t)&&Hn.string(t.uri)&&Hn.string(t.languageId)&&Hn.integer(t.version)&&Hn.string(t.text)}}(Jt||(Jt={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(Yt||(Yt={})),function(e){e.is=function(e){var t=e;return Hn.objectLiteral(e)&&Yt.is(t.kind)&&Hn.string(t.value)}}(Xt||(Xt={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(Qt||(Qt={})),function(e){e.PlainText=1,e.Snippet=2}(Zt||(Zt={})),function(e){e.Deprecated=1}(en||(en={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Hn.string(t.newText)&&wt.is(t.insert)&&wt.is(t.replace)}}(tn||(tn={})),function(e){e.asIs=1,e.adjustIndentation=2}(nn||(nn={})),function(e){e.is=function(e){var t=e;return t&&(Hn.string(t.detail)||void 0===t.detail)&&(Hn.string(t.description)||void 0===t.description)}}(rn||(rn={})),function(e){e.create=function(e){return{label:e}}}(on||(on={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(sn||(sn={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Hn.string(t)||Hn.objectLiteral(t)&&Hn.string(t.language)&&Hn.string(t.value)}}(an||(an={})),function(e){e.is=function(e){var t=e;return!!t&&Hn.objectLiteral(t)&&(Xt.is(t.contents)||an.is(t.contents)||Hn.typedArray(t.contents,an.is))&&(void 0===e.range||wt.is(e.range))}}(cn||(cn={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(un||(un={})),function(e){e.create=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return Hn.defined(t)&&(i.documentation=t),Hn.defined(n)?i.parameters=n:i.parameters=[],i}}(ln||(ln={})),function(e){e.Text=1,e.Read=2,e.Write=3}(hn||(hn={})),function(e){e.create=function(e,t){var n={range:e};return Hn.number(t)&&(n.kind=t),n}}(dn||(dn={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(pn||(pn={})),function(e){e.Deprecated=1}(fn||(fn={})),function(e){e.create=function(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}}(mn||(mn={})),function(e){e.create=function(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}}(gn||(gn={})),function(e){e.create=function(e,t,n,r,i,o){var s={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(s.children=o),s},e.is=function(e){var t=e;return t&&Hn.string(t.name)&&Hn.number(t.kind)&&wt.is(t.range)&&wt.is(t.selectionRange)&&(void 0===t.detail||Hn.string(t.detail))&&(void 0===t.deprecated||Hn.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(yn||(yn={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(vn||(vn={})),function(e){e.Invoked=1,e.Automatic=2}(bn||(bn={})),function(e){e.create=function(e,t,n){var r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r},e.is=function(e){var t=e;return Hn.defined(t)&&Hn.typedArray(t.diagnostics,qt.is)&&(void 0===t.only||Hn.typedArray(t.only,Hn.string))&&(void 0===t.triggerKind||t.triggerKind===bn.Invoked||t.triggerKind===bn.Automatic)}}(Sn||(Sn={})),function(e){e.create=function(e,t,n){var r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):It.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return t&&Hn.string(t.title)&&(void 0===t.diagnostics||Hn.typedArray(t.diagnostics,qt.is))&&(void 0===t.kind||Hn.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||It.is(t.command))&&(void 0===t.isPreferred||Hn.boolean(t.isPreferred))&&(void 0===t.edit||Vt.is(t.edit))}}(wn||(wn={})),function(e){e.create=function(e,t){var n={range:e};return Hn.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return Hn.defined(t)&&wt.is(t.range)&&(Hn.undefined(t.command)||It.is(t.command))}}(Rn||(Rn={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return Hn.defined(t)&&Hn.uinteger(t.tabSize)&&Hn.boolean(t.insertSpaces)}}(En||(En={})),function(e){e.create=function(e,t,n){return{range:e,target:t,data:n}},e.is=function(e){var t=e;return Hn.defined(t)&&wt.is(t.range)&&(Hn.undefined(t.target)||Hn.string(t.target))}}(Cn||(Cn={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return Hn.objectLiteral(n)&&wt.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(_n||(_n={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(Dn||(Dn={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(Tn||(Tn={})),function(e){e.is=function(e){var t=e;return Hn.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(kn||(kn={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return null!=t&&wt.is(t.range)&&Hn.string(t.text)}}(xn||(xn={})),function(e){e.create=function(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}},e.is=function(e){var t=e;return null!=t&&wt.is(t.range)&&Hn.boolean(t.caseSensitiveLookup)&&(Hn.string(t.variableName)||void 0===t.variableName)}}(Pn||(Pn={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return null!=t&&wt.is(t.range)&&(Hn.string(t.expression)||void 0===t.expression)}}(On||(On={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return Hn.defined(t)&&wt.is(e.stoppedLocation)}}(Nn||(Nn={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(qn||(qn={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&(void 0===t.tooltip||Hn.string(t.tooltip)||Xt.is(t.tooltip))&&(void 0===t.location||Rt.is(t.location))&&(void 0===t.command||It.is(t.command))}}(In||(In={})),function(e){e.create=function(e,t,n){var r={position:e,label:t};return void 0!==n&&(r.kind=n),r},e.is=function(e){var t=e;return Hn.objectLiteral(t)&&St.is(t.position)&&(Hn.string(t.label)||Hn.typedArray(t.label,In.is))&&(void 0===t.kind||qn.is(t.kind))&&void 0===t.textEdits||Hn.typedArray(t.textEdits,At.is)&&(void 0===t.tooltip||Hn.string(t.tooltip)||Xt.is(t.tooltip))&&(void 0===t.paddingLeft||Hn.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Hn.boolean(t.paddingRight))}}(An||(An={})),function(e){e.is=function(e){var t=e;return Hn.objectLiteral(t)&&yt.is(t.uri)&&Hn.string(t.name)}}(Mn||(Mn={}));var $n;!function(e){function t(e,n){if(e.length<=1)return e;var r=e.length/2|0,i=e.slice(0,r),o=e.slice(r);t(i,n),t(o,n);for(var s=0,a=0,c=0;s<i.length&&a<o.length;){var u=n(i[s],o[a]);e[c++]=u<=0?i[s++]:o[a++]}for(;s<i.length;)e[c++]=i[s++];for(;a<o.length;)e[c++]=o[a++];return e}e.create=function(e,t,n,r){return new Wn(e,t,n,r)},e.is=function(e){var t=e;return!!(Hn.defined(t)&&Hn.string(t.uri)&&(Hn.undefined(t.languageId)||Hn.string(t.languageId))&&Hn.uinteger(t.lineCount)&&Hn.func(t.getText)&&Hn.func(t.positionAt)&&Hn.func(t.offsetAt))},e.applyEdits=function(e,n){for(var r=e.getText(),i=t(n,(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=r.length,s=i.length-1;s>=0;s--){var a=i[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=o))throw new Error("Overlapping edit");r=r.substring(0,c)+a.newText+r.substring(u,r.length),o=c}return r}}($n||($n={}));var Hn,Wn=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return St.create(0,e);for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return St.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;e.defined=function(e){return void 0!==e},e.undefined=function(e){return void 0===e},e.boolean=function(e){return!0===e||!1===e},e.string=function(e){return"[object String]"===t.call(e)},e.number=function(e){return"[object Number]"===t.call(e)},e.numberRange=function(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r},e.integer=function(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647},e.uinteger=function(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647},e.func=function(e){return"[object Function]"===t.call(e)},e.objectLiteral=function(e){return null!==e&&"object"==typeof e},e.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)}}(Hn||(Hn={}));const Vn=x(Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Lt},get ChangeAnnotation(){return Mt},get ChangeAnnotationIdentifier(){return Ft},get CodeAction(){return wn},get CodeActionContext(){return Sn},get CodeActionKind(){return vn},get CodeActionTriggerKind(){return bn},get CodeDescription(){return Nt},get CodeLens(){return Rn},get Color(){return Ct},get ColorInformation(){return _t},get ColorPresentation(){return Dt},get Command(){return It},get CompletionItem(){return on},get CompletionItemKind(){return Qt},get CompletionItemLabelDetails(){return rn},get CompletionItemTag(){return en},get CompletionList(){return sn},get CreateFile(){return $t},get DeleteFile(){return Wt},get Diagnostic(){return qt},get DiagnosticRelatedInformation(){return xt},get DiagnosticSeverity(){return Pt},get DiagnosticTag(){return Ot},get DocumentHighlight(){return dn},get DocumentHighlightKind(){return hn},get DocumentLink(){return Cn},get DocumentSymbol(){return yn},get DocumentUri(){return gt},EOL:["\n","\r\n","\r"],get FoldingRange(){return kt},get FoldingRangeKind(){return Tt},get FormattingOptions(){return En},get Hover(){return cn},get InlayHint(){return An},get InlayHintKind(){return qn},get InlayHintLabelPart(){return In},get InlineValueContext(){return Nn},get InlineValueEvaluatableExpression(){return On},get InlineValueText(){return xn},get InlineValueVariableLookup(){return Pn},get InsertReplaceEdit(){return tn},get InsertTextFormat(){return Zt},get InsertTextMode(){return nn},get Location(){return Rt},get LocationLink(){return Et},get MarkedString(){return an},get MarkupContent(){return Xt},get MarkupKind(){return Yt},get OptionalVersionedTextDocumentIdentifier(){return Bt},get ParameterInformation(){return un},get Position(){return St},get Range(){return wt},get RenameFile(){return Ht},get SelectionRange(){return _n},get SemanticTokenModifiers(){return Tn},get SemanticTokenTypes(){return Dn},get SemanticTokens(){return kn},get SignatureInformation(){return ln},get SymbolInformation(){return mn},get SymbolKind(){return pn},get SymbolTag(){return fn},get TextDocument(){return $n},get TextDocumentEdit(){return jt},get TextDocumentIdentifier(){return Gt},get TextDocumentItem(){return Jt},get TextEdit(){return At},get URI(){return yt},get VersionedTextDocumentIdentifier(){return zt},WorkspaceChange:jn,get WorkspaceEdit(){return Vt},get WorkspaceFolder(){return Mn},get WorkspaceSymbol(){return gn},get integer(){return vt},get uinteger(){return bt}},Symbol.toStringTag,{value:"Module"})));var Un={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;const t=De;var n;(n=e.MessageDirection||(e.MessageDirection={})).clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both";e.RegistrationType=class{constructor(e){this.method=e}};e.ProtocolRequestType0=class extends t.RequestType0{constructor(e){super(e)}};e.ProtocolRequestType=class extends t.RequestType{constructor(e){super(e,t.ParameterStructures.byName)}};e.ProtocolNotificationType0=class extends t.NotificationType0{constructor(e){super(e)}};e.ProtocolNotificationType=class extends t.NotificationType{constructor(e){super(e,t.ParameterStructures.byName)}}}(Un);var Kn={},Gn={};function zn(e){return"string"==typeof e||e instanceof String}function Bn(e){return Array.isArray(e)}Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.objectLiteral=Gn.typedArray=Gn.stringArray=Gn.array=Gn.func=Gn.error=Gn.number=Gn.string=Gn.boolean=void 0,Gn.boolean=function(e){return!0===e||!1===e},Gn.string=zn,Gn.number=function(e){return"number"==typeof e||e instanceof Number},Gn.error=function(e){return e instanceof Error},Gn.func=function(e){return"function"==typeof e},Gn.array=Bn,Gn.stringArray=function(e){return Bn(e)&&e.every((e=>zn(e)))},Gn.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},Gn.objectLiteral=function(e){return null!==e&&"object"==typeof e};var Jn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;const t=Un;var n;(n=e.ImplementationRequest||(e.ImplementationRequest={})).method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Jn);var Yn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;const t=Un;var n;(n=e.TypeDefinitionRequest||(e.TypeDefinitionRequest={})).method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Yn);var Xn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;const t=Un;var n,r;(n=e.WorkspaceFoldersRequest||(e.WorkspaceFoldersRequest={})).method="workspace/workspaceFolders",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType0(n.method),(r=e.DidChangeWorkspaceFoldersNotification||(e.DidChangeWorkspaceFoldersNotification={})).method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(Xn);var Qn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;const t=Un;var n;(n=e.ConfigurationRequest||(e.ConfigurationRequest={})).method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(Qn);var Zn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;const t=Un;var n,r;(n=e.DocumentColorRequest||(e.DocumentColorRequest={})).method="textDocument/documentColor",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.ColorPresentationRequest||(e.ColorPresentationRequest={})).method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(Zn);var er={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRequest=void 0;const t=Un;var n;(n=e.FoldingRangeRequest||(e.FoldingRangeRequest={})).method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(er);var tr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;const t=Un;var n;(n=e.DeclarationRequest||(e.DeclarationRequest={})).method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(tr);var nr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;const t=Un;var n;(n=e.SelectionRangeRequest||(e.SelectionRangeRequest={})).method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(nr);var rr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;const t=De,n=Un;var r,i,o;(r=e.WorkDoneProgress||(e.WorkDoneProgress={})).type=new t.ProgressType,r.is=function(e){return e===r.type},(i=e.WorkDoneProgressCreateRequest||(e.WorkDoneProgressCreateRequest={})).method="window/workDoneProgress/create",i.messageDirection=n.MessageDirection.serverToClient,i.type=new n.ProtocolRequestType(i.method),(o=e.WorkDoneProgressCancelNotification||(e.WorkDoneProgressCancelNotification={})).method="window/workDoneProgress/cancel",o.messageDirection=n.MessageDirection.clientToServer,o.type=new n.ProtocolNotificationType(o.method)}(rr);var ir={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;const t=Un;var n,r,i;(n=e.CallHierarchyPrepareRequest||(e.CallHierarchyPrepareRequest={})).method="textDocument/prepareCallHierarchy",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.CallHierarchyIncomingCallsRequest||(e.CallHierarchyIncomingCallsRequest={})).method="callHierarchy/incomingCalls",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.CallHierarchyOutgoingCallsRequest||(e.CallHierarchyOutgoingCallsRequest={})).method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(ir);var or={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;const t=Un;var n,r,i,o,s;(e.TokenFormat||(e.TokenFormat={})).Relative="relative",function(e){e.method="textDocument/semanticTokens",e.type=new t.RegistrationType(e.method)}(n=e.SemanticTokensRegistrationType||(e.SemanticTokensRegistrationType={})),(r=e.SemanticTokensRequest||(e.SemanticTokensRequest={})).method="textDocument/semanticTokens/full",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),r.registrationMethod=n.method,(i=e.SemanticTokensDeltaRequest||(e.SemanticTokensDeltaRequest={})).method="textDocument/semanticTokens/full/delta",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method),i.registrationMethod=n.method,(o=e.SemanticTokensRangeRequest||(e.SemanticTokensRangeRequest={})).method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method,(s=e.SemanticTokensRefreshRequest||(e.SemanticTokensRefreshRequest={})).method="workspace/semanticTokens/refresh",s.messageDirection=t.MessageDirection.serverToClient,s.type=new t.ProtocolRequestType0(s.method)}(or);var sr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;const t=Un;var n;(n=e.ShowDocumentRequest||(e.ShowDocumentRequest={})).method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(sr);var ar={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;const t=Un;var n;(n=e.LinkedEditingRangeRequest||(e.LinkedEditingRangeRequest={})).method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(ar);var cr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.DidRenameFilesNotification=e.WillRenameFilesRequest=e.DidCreateFilesNotification=e.WillCreateFilesRequest=e.FileOperationPatternKind=void 0;const t=Un;var n,r,i,o,s,a,c;(n=e.FileOperationPatternKind||(e.FileOperationPatternKind={})).file="file",n.folder="folder",(r=e.WillCreateFilesRequest||(e.WillCreateFilesRequest={})).method="workspace/willCreateFiles",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.DidCreateFilesNotification||(e.DidCreateFilesNotification={})).method="workspace/didCreateFiles",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolNotificationType(i.method),(o=e.WillRenameFilesRequest||(e.WillRenameFilesRequest={})).method="workspace/willRenameFiles",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),(s=e.DidRenameFilesNotification||(e.DidRenameFilesNotification={})).method="workspace/didRenameFiles",s.messageDirection=t.MessageDirection.clientToServer,s.type=new t.ProtocolNotificationType(s.method),(a=e.DidDeleteFilesNotification||(e.DidDeleteFilesNotification={})).method="workspace/didDeleteFiles",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolNotificationType(a.method),(c=e.WillDeleteFilesRequest||(e.WillDeleteFilesRequest={})).method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(cr);var ur={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;const t=Un;var n,r,i;(n=e.UniquenessLevel||(e.UniquenessLevel={})).document="document",n.project="project",n.group="group",n.scheme="scheme",n.global="global",(r=e.MonikerKind||(e.MonikerKind={})).$import="import",r.$export="export",r.local="local",(i=e.MonikerRequest||(e.MonikerRequest={})).method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(ur);var lr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;const t=Un;var n,r,i;(n=e.TypeHierarchyPrepareRequest||(e.TypeHierarchyPrepareRequest={})).method="textDocument/prepareTypeHierarchy",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.TypeHierarchySupertypesRequest||(e.TypeHierarchySupertypesRequest={})).method="typeHierarchy/supertypes",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.TypeHierarchySubtypesRequest||(e.TypeHierarchySubtypesRequest={})).method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(lr);var hr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;const t=Un;var n,r;(n=e.InlineValueRequest||(e.InlineValueRequest={})).method="textDocument/inlineValue",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.InlineValueRefreshRequest||(e.InlineValueRefreshRequest={})).method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(hr);var dr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;const t=Un;var n,r,i;(n=e.InlayHintRequest||(e.InlayHintRequest={})).method="textDocument/inlayHint",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method),(r=e.InlayHintResolveRequest||(e.InlayHintResolveRequest={})).method="inlayHint/resolve",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method),(i=e.InlayHintRefreshRequest||(e.InlayHintRefreshRequest={})).method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)}(dr);var pr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;const t=De,n=Gn,r=Un;var i,o,s,a;(e.DiagnosticServerCancellationData||(e.DiagnosticServerCancellationData={})).is=function(e){const t=e;return t&&n.boolean(t.retriggerRequest)},(i=e.DocumentDiagnosticReportKind||(e.DocumentDiagnosticReportKind={})).Full="full",i.Unchanged="unchanged",(o=e.DocumentDiagnosticRequest||(e.DocumentDiagnosticRequest={})).method="textDocument/diagnostic",o.messageDirection=r.MessageDirection.clientToServer,o.type=new r.ProtocolRequestType(o.method),o.partialResult=new t.ProgressType,(s=e.WorkspaceDiagnosticRequest||(e.WorkspaceDiagnosticRequest={})).method="workspace/diagnostic",s.messageDirection=r.MessageDirection.clientToServer,s.type=new r.ProtocolRequestType(s.method),s.partialResult=new t.ProgressType,(a=e.DiagnosticRefreshRequest||(e.DiagnosticRefreshRequest={})).method="workspace/diagnostic/refresh",a.messageDirection=r.MessageDirection.serverToClient,a.type=new r.ProtocolRequestType0(a.method)}(pr);var fr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=void 0;const t=Vn,n=Gn,r=Un;var i,o,s,a,c,u,l,h,d,p;!function(e){e.Markup=1,e.Code=2,e.is=function(e){return 1===e||2===e}}(i=e.NotebookCellKind||(e.NotebookCellKind={})),function(e){e.create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},e.is=function(e){const r=e;return n.objectLiteral(r)&&t.uinteger.is(r.executionOrder)&&(void 0===r.success||n.boolean(r.success))},e.equals=function(e,t){return e===t||null!=e&&null!=t&&(e.executionOrder===t.executionOrder&&e.success===t.success)}}(o=e.ExecutionSummary||(e.ExecutionSummary={})),function(e){function r(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;const i=Array.isArray(e),o=Array.isArray(t);if(i!==o)return!1;if(i&&o){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!r(e[n],t[n]))return!1}if(n.objectLiteral(e)&&n.objectLiteral(t)){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;if(n.sort(),i.sort(),!r(n,i))return!1;for(let i=0;i<n.length;i++){const o=n[i];if(!r(e[o],t[o]))return!1}}return!0}e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){const r=e;return n.objectLiteral(r)&&i.is(r.kind)&&t.DocumentUri.is(r.document)&&(void 0===r.metadata||n.objectLiteral(r.metadata))},e.diff=function(e,t){const n=new Set;return e.document!==t.document&&n.add("document"),e.kind!==t.kind&&n.add("kind"),e.executionSummary!==t.executionSummary&&n.add("executionSummary"),void 0===e.metadata&&void 0===t.metadata||r(e.metadata,t.metadata)||n.add("metadata"),void 0===e.executionSummary&&void 0===t.executionSummary||o.equals(e.executionSummary,t.executionSummary)||n.add("executionSummary"),n}}(s=e.NotebookCell||(e.NotebookCell={})),(a=e.NotebookDocument||(e.NotebookDocument={})).create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},a.is=function(e){const r=e;return n.objectLiteral(r)&&n.string(r.uri)&&t.integer.is(r.version)&&n.typedArray(r.cells,s.is)},function(e){e.method="notebookDocument/sync",e.messageDirection=r.MessageDirection.clientToServer,e.type=new r.RegistrationType(e.method)}(c=e.NotebookDocumentSyncRegistrationType||(e.NotebookDocumentSyncRegistrationType={})),(u=e.DidOpenNotebookDocumentNotification||(e.DidOpenNotebookDocumentNotification={})).method="notebookDocument/didOpen",u.messageDirection=r.MessageDirection.clientToServer,u.type=new r.ProtocolNotificationType(u.method),u.registrationMethod=c.method,(l=e.NotebookCellArrayChange||(e.NotebookCellArrayChange={})).is=function(e){const r=e;return n.objectLiteral(r)&&t.uinteger.is(r.start)&&t.uinteger.is(r.deleteCount)&&(void 0===r.cells||n.typedArray(r.cells,s.is))},l.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r},(h=e.DidChangeNotebookDocumentNotification||(e.DidChangeNotebookDocumentNotification={})).method="notebookDocument/didChange",h.messageDirection=r.MessageDirection.clientToServer,h.type=new r.ProtocolNotificationType(h.method),h.registrationMethod=c.method,(d=e.DidSaveNotebookDocumentNotification||(e.DidSaveNotebookDocumentNotification={})).method="notebookDocument/didSave",d.messageDirection=r.MessageDirection.clientToServer,d.type=new r.ProtocolNotificationType(d.method),d.registrationMethod=c.method,(p=e.DidCloseNotebookDocumentNotification||(e.DidCloseNotebookDocumentNotification={})).method="notebookDocument/didClose",p.messageDirection=r.MessageDirection.clientToServer,p.type=new r.ProtocolNotificationType(p.method),p.registrationMethod=c.method}(fr),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=void 0;const t=Un,n=Vn,r=Gn,i=Jn;Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const o=Yn;Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return o.TypeDefinitionRequest}});const s=Xn;Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const a=Qn;Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=Zn;Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=er;Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}});const l=tr;Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const h=nr;Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const d=rr;Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const p=ir;Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const f=or;Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return f.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return f.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return f.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return f.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return f.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return f.SemanticTokensRegistrationType}});const m=sr;Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return m.ShowDocumentRequest}});const g=ar;Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return g.LinkedEditingRangeRequest}});const y=cr;Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const v=ur;Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}});const b=lr;Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const S=hr;Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return S.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return S.InlineValueRefreshRequest}});const w=dr;Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const R=pr;Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return R.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return R.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return R.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return R.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return R.DiagnosticRefreshRequest}});const E=fr;var C,_,D,T,k,x,P,O,N,q,I,A,M,F,L,j,$,H,W,V,U,K,G,z,B,J,Y,X,Q,Z,ee,te,ne,re,ie,oe,se,ae,ce,ue,le,he,de,pe,fe,me,ge,ye,ve,be,Se,we,Re,Ee,Ce,_e,De,Te,ke;Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return E.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return E.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return E.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return E.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return E.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return E.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return E.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return E.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return E.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return E.DidCloseNotebookDocumentNotification}}),function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(C=e.TextDocumentFilter||(e.TextDocumentFilter={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}}(_=e.NotebookDocumentFilter||(e.NotebookDocumentFilter={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||_.is(t.notebook))&&(void 0===t.language||r.string(t.language))}}(D=e.NotebookCellTextDocumentFilter||(e.NotebookCellTextDocumentFilter={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!C.is(t)&&!D.is(t))return!1;return!0}}(T=e.DocumentSelector||(e.DocumentSelector={})),(k=e.RegistrationRequest||(e.RegistrationRequest={})).method="client/registerCapability",k.messageDirection=t.MessageDirection.serverToClient,k.type=new t.ProtocolRequestType(k.method),(x=e.UnregistrationRequest||(e.UnregistrationRequest={})).method="client/unregisterCapability",x.messageDirection=t.MessageDirection.serverToClient,x.type=new t.ProtocolRequestType(x.method),(P=e.ResourceOperationKind||(e.ResourceOperationKind={})).Create="create",P.Rename="rename",P.Delete="delete",(O=e.FailureHandlingKind||(e.FailureHandlingKind={})).Abort="abort",O.Transactional="transactional",O.TextOnlyTransactional="textOnlyTransactional",O.Undo="undo",(N=e.PositionEncodingKind||(e.PositionEncodingKind={})).UTF8="utf-8",N.UTF16="utf-16",N.UTF32="utf-32",(e.StaticRegistrationOptions||(e.StaticRegistrationOptions={})).hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0},(e.TextDocumentRegistrationOptions||(e.TextDocumentRegistrationOptions={})).is=function(e){const t=e;return t&&(null===t.documentSelector||T.is(t.documentSelector))},(q=e.WorkDoneProgressOptions||(e.WorkDoneProgressOptions={})).is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},q.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)},(I=e.InitializeRequest||(e.InitializeRequest={})).method="initialize",I.messageDirection=t.MessageDirection.clientToServer,I.type=new t.ProtocolRequestType(I.method),(e.InitializeErrorCodes||(e.InitializeErrorCodes={})).unknownProtocolVersion=1,(A=e.InitializedNotification||(e.InitializedNotification={})).method="initialized",A.messageDirection=t.MessageDirection.clientToServer,A.type=new t.ProtocolNotificationType(A.method),(M=e.ShutdownRequest||(e.ShutdownRequest={})).method="shutdown",M.messageDirection=t.MessageDirection.clientToServer,M.type=new t.ProtocolRequestType0(M.method),(F=e.ExitNotification||(e.ExitNotification={})).method="exit",F.messageDirection=t.MessageDirection.clientToServer,F.type=new t.ProtocolNotificationType0(F.method),(L=e.DidChangeConfigurationNotification||(e.DidChangeConfigurationNotification={})).method="workspace/didChangeConfiguration",L.messageDirection=t.MessageDirection.clientToServer,L.type=new t.ProtocolNotificationType(L.method),(j=e.MessageType||(e.MessageType={})).Error=1,j.Warning=2,j.Info=3,j.Log=4,($=e.ShowMessageNotification||(e.ShowMessageNotification={})).method="window/showMessage",$.messageDirection=t.MessageDirection.serverToClient,$.type=new t.ProtocolNotificationType($.method),(H=e.ShowMessageRequest||(e.ShowMessageRequest={})).method="window/showMessageRequest",H.messageDirection=t.MessageDirection.serverToClient,H.type=new t.ProtocolRequestType(H.method),(W=e.LogMessageNotification||(e.LogMessageNotification={})).method="window/logMessage",W.messageDirection=t.MessageDirection.serverToClient,W.type=new t.ProtocolNotificationType(W.method),(V=e.TelemetryEventNotification||(e.TelemetryEventNotification={})).method="telemetry/event",V.messageDirection=t.MessageDirection.serverToClient,V.type=new t.ProtocolNotificationType(V.method),(U=e.TextDocumentSyncKind||(e.TextDocumentSyncKind={})).None=0,U.Full=1,U.Incremental=2,(K=e.DidOpenTextDocumentNotification||(e.DidOpenTextDocumentNotification={})).method="textDocument/didOpen",K.messageDirection=t.MessageDirection.clientToServer,K.type=new t.ProtocolNotificationType(K.method),(G=e.TextDocumentContentChangeEvent||(e.TextDocumentContentChangeEvent={})).isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},G.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},(z=e.DidChangeTextDocumentNotification||(e.DidChangeTextDocumentNotification={})).method="textDocument/didChange",z.messageDirection=t.MessageDirection.clientToServer,z.type=new t.ProtocolNotificationType(z.method),(B=e.DidCloseTextDocumentNotification||(e.DidCloseTextDocumentNotification={})).method="textDocument/didClose",B.messageDirection=t.MessageDirection.clientToServer,B.type=new t.ProtocolNotificationType(B.method),(J=e.DidSaveTextDocumentNotification||(e.DidSaveTextDocumentNotification={})).method="textDocument/didSave",J.messageDirection=t.MessageDirection.clientToServer,J.type=new t.ProtocolNotificationType(J.method),(Y=e.TextDocumentSaveReason||(e.TextDocumentSaveReason={})).Manual=1,Y.AfterDelay=2,Y.FocusOut=3,(X=e.WillSaveTextDocumentNotification||(e.WillSaveTextDocumentNotification={})).method="textDocument/willSave",X.messageDirection=t.MessageDirection.clientToServer,X.type=new t.ProtocolNotificationType(X.method),(Q=e.WillSaveTextDocumentWaitUntilRequest||(e.WillSaveTextDocumentWaitUntilRequest={})).method="textDocument/willSaveWaitUntil",Q.messageDirection=t.MessageDirection.clientToServer,Q.type=new t.ProtocolRequestType(Q.method),(Z=e.DidChangeWatchedFilesNotification||(e.DidChangeWatchedFilesNotification={})).method="workspace/didChangeWatchedFiles",Z.messageDirection=t.MessageDirection.clientToServer,Z.type=new t.ProtocolNotificationType(Z.method),(ee=e.FileChangeType||(e.FileChangeType={})).Created=1,ee.Changed=2,ee.Deleted=3,(e.RelativePattern||(e.RelativePattern={})).is=function(e){const t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)},(te=e.WatchKind||(e.WatchKind={})).Create=1,te.Change=2,te.Delete=4,(ne=e.PublishDiagnosticsNotification||(e.PublishDiagnosticsNotification={})).method="textDocument/publishDiagnostics",ne.messageDirection=t.MessageDirection.serverToClient,ne.type=new t.ProtocolNotificationType(ne.method),(re=e.CompletionTriggerKind||(e.CompletionTriggerKind={})).Invoked=1,re.TriggerCharacter=2,re.TriggerForIncompleteCompletions=3,(ie=e.CompletionRequest||(e.CompletionRequest={})).method="textDocument/completion",ie.messageDirection=t.MessageDirection.clientToServer,ie.type=new t.ProtocolRequestType(ie.method),(oe=e.CompletionResolveRequest||(e.CompletionResolveRequest={})).method="completionItem/resolve",oe.messageDirection=t.MessageDirection.clientToServer,oe.type=new t.ProtocolRequestType(oe.method),(se=e.HoverRequest||(e.HoverRequest={})).method="textDocument/hover",se.messageDirection=t.MessageDirection.clientToServer,se.type=new t.ProtocolRequestType(se.method),(ae=e.SignatureHelpTriggerKind||(e.SignatureHelpTriggerKind={})).Invoked=1,ae.TriggerCharacter=2,ae.ContentChange=3,(ce=e.SignatureHelpRequest||(e.SignatureHelpRequest={})).method="textDocument/signatureHelp",ce.messageDirection=t.MessageDirection.clientToServer,ce.type=new t.ProtocolRequestType(ce.method),(ue=e.DefinitionRequest||(e.DefinitionRequest={})).method="textDocument/definition",ue.messageDirection=t.MessageDirection.clientToServer,ue.type=new t.ProtocolRequestType(ue.method),(le=e.ReferencesRequest||(e.ReferencesRequest={})).method="textDocument/references",le.messageDirection=t.MessageDirection.clientToServer,le.type=new t.ProtocolRequestType(le.method),(he=e.DocumentHighlightRequest||(e.DocumentHighlightRequest={})).method="textDocument/documentHighlight",he.messageDirection=t.MessageDirection.clientToServer,he.type=new t.ProtocolRequestType(he.method),(de=e.DocumentSymbolRequest||(e.DocumentSymbolRequest={})).method="textDocument/documentSymbol",de.messageDirection=t.MessageDirection.clientToServer,de.type=new t.ProtocolRequestType(de.method),(pe=e.CodeActionRequest||(e.CodeActionRequest={})).method="textDocument/codeAction",pe.messageDirection=t.MessageDirection.clientToServer,pe.type=new t.ProtocolRequestType(pe.method),(fe=e.CodeActionResolveRequest||(e.CodeActionResolveRequest={})).method="codeAction/resolve",fe.messageDirection=t.MessageDirection.clientToServer,fe.type=new t.ProtocolRequestType(fe.method),(me=e.WorkspaceSymbolRequest||(e.WorkspaceSymbolRequest={})).method="workspace/symbol",me.messageDirection=t.MessageDirection.clientToServer,me.type=new t.ProtocolRequestType(me.method),(ge=e.WorkspaceSymbolResolveRequest||(e.WorkspaceSymbolResolveRequest={})).method="workspaceSymbol/resolve",ge.messageDirection=t.MessageDirection.clientToServer,ge.type=new t.ProtocolRequestType(ge.method),(ye=e.CodeLensRequest||(e.CodeLensRequest={})).method="textDocument/codeLens",ye.messageDirection=t.MessageDirection.clientToServer,ye.type=new t.ProtocolRequestType(ye.method),(ve=e.CodeLensResolveRequest||(e.CodeLensResolveRequest={})).method="codeLens/resolve",ve.messageDirection=t.MessageDirection.clientToServer,ve.type=new t.ProtocolRequestType(ve.method),(be=e.CodeLensRefreshRequest||(e.CodeLensRefreshRequest={})).method="workspace/codeLens/refresh",be.messageDirection=t.MessageDirection.serverToClient,be.type=new t.ProtocolRequestType0(be.method),(Se=e.DocumentLinkRequest||(e.DocumentLinkRequest={})).method="textDocument/documentLink",Se.messageDirection=t.MessageDirection.clientToServer,Se.type=new t.ProtocolRequestType(Se.method),(we=e.DocumentLinkResolveRequest||(e.DocumentLinkResolveRequest={})).method="documentLink/resolve",we.messageDirection=t.MessageDirection.clientToServer,we.type=new t.ProtocolRequestType(we.method),(Re=e.DocumentFormattingRequest||(e.DocumentFormattingRequest={})).method="textDocument/formatting",Re.messageDirection=t.MessageDirection.clientToServer,Re.type=new t.ProtocolRequestType(Re.method),(Ee=e.DocumentRangeFormattingRequest||(e.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.method),(Ce=e.DocumentOnTypeFormattingRequest||(e.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",Ce.messageDirection=t.MessageDirection.clientToServer,Ce.type=new t.ProtocolRequestType(Ce.method),(e.PrepareSupportDefaultBehavior||(e.PrepareSupportDefaultBehavior={})).Identifier=1,(_e=e.RenameRequest||(e.RenameRequest={})).method="textDocument/rename",_e.messageDirection=t.MessageDirection.clientToServer,_e.type=new t.ProtocolRequestType(_e.method),(De=e.PrepareRenameRequest||(e.PrepareRenameRequest={})).method="textDocument/prepareRename",De.messageDirection=t.MessageDirection.clientToServer,De.type=new t.ProtocolRequestType(De.method),(Te=e.ExecuteCommandRequest||(e.ExecuteCommandRequest={})).method="workspace/executeCommand",Te.messageDirection=t.MessageDirection.clientToServer,Te.type=new t.ProtocolRequestType(Te.method),(ke=e.ApplyWorkspaceEditRequest||(e.ApplyWorkspaceEditRequest={})).method="workspace/applyEdit",ke.messageDirection=t.MessageDirection.serverToClient,ke.type=new t.ProtocolRequestType("workspace/applyEdit")}(Kn);var mr={};Object.defineProperty(mr,"__esModule",{value:!0}),mr.createProtocolConnection=void 0;const gr=De;mr.createProtocolConnection=function(e,t,n,r){return gr.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,gr.createMessageConnection)(e,t,n,r)},function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(De,e),n(Vn,e),n(Un,e),n(Kn,e);var r,i=mr;Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}}),(r=e.LSPErrorCodes||(e.LSPErrorCodes={})).lspReservedErrorRangeStart=-32899,r.RequestFailed=-32803,r.ServerCancelled=-32802,r.ContentModified=-32801,r.RequestCancelled=-32800,r.lspReservedErrorRangeEnd=-32800}(Kt),function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;const r=Ut;n(Ut,e),n(Kt,e),e.createProtocolConnection=function(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}}(_e);const yr=k(_e);var vr={};Object.defineProperty(vr,"__esModule",{value:!0}),vr.generateUuid=vr.parse=vr.isUUID=vr.v4=vr.empty=void 0;class br{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class Sr extends br{constructor(){super([Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),"-",Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),"-","4",Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),"-",Sr._oneOf(Sr._timeHighBits),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),"-",Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex(),Sr._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return Sr._oneOf(Sr._chars)}}function wr(){return new Sr}Sr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],Sr._timeHighBits=["8","9","a","b"],vr.empty=new br("00000000-0000-0000-0000-000000000000"),vr.v4=wr;const Rr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Er(e){return Rr.test(e)}vr.isUUID=Er,vr.parse=function(e){if(!Er(e))throw new Error("invalid uuid");return new br(e)},vr.generateUuid=function(){return wr().asHex()};var Cr={};Object.defineProperty(Cr,"__esModule",{value:!0}),Cr.attachPartialResult=Cr.ProgressFeature=Or=Cr.attachWorkDone=void 0;const _r=_e,Dr=vr;class Tr{constructor(e,t){this._connection=e,this._token=t,Tr.Instances.set(this._token,this)}begin(e,t,n,r){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:r};this._connection.sendProgress(_r.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};"number"==typeof e?(n.percentage=e,void 0!==t&&(n.message=t)):n.message=e,this._connection.sendProgress(_r.WorkDoneProgress.type,this._token,n)}done(){Tr.Instances.delete(this._token),this._connection.sendProgress(_r.WorkDoneProgress.type,this._token,{kind:"end"})}}Tr.Instances=new Map;class kr extends Tr{constructor(e,t){super(e,t),this._source=new _r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class xr{constructor(){}begin(){}report(){}done(){}}class Pr extends xr{constructor(){super(),this._source=new _r.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var Or=Cr.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new xr;const n=t.workDoneToken;return delete t.workDoneToken,new Tr(e,n)};var Nr;Cr.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),!0===e?.window?.workDoneProgress&&(this._progressSupported=!0,this.connection.onNotification(_r.WorkDoneProgressCancelNotification.type,(e=>{let t=Tr.Instances.get(e.token);(t instanceof kr||t instanceof Pr)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new xr:new Tr(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Dr.generateUuid)();return this.connection.sendRequest(_r.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new kr(this.connection,e)))}return Promise.resolve(new Pr)}},function(e){e.type=new _r.ProgressType}(Nr||(Nr={}));class qr{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Nr.type,this._token,e)}}Cr.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new qr(e,n)};var Ir={};Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.ConfigurationFeature=void 0;const Ar=_e,Mr=ve;Ir.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?Mr.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Ar.ConfigurationRequest.type,t).then((t=>Array.isArray(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}};var Fr={};Object.defineProperty(Fr,"__esModule",{value:!0}),Fr.WorkspaceFoldersFeature=void 0;const Lr=_e;Fr.WorkspaceFoldersFeature=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Lr.Emitter,this.connection.onNotification(Lr.DidChangeWorkspaceFoldersNotification.type,(e=>{this._onDidChangeWorkspaceFolders.fire(e.event)})))}fillServerCapabilities(e){super.fillServerCapabilities(e);const t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=!0===t||"string"==typeof t}getWorkspaceFolders(){return this.connection.sendRequest(Lr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._notificationIsAutoRegistered||this._unregistration||(this._unregistration=this.connection.client.register(Lr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};var jr={};Object.defineProperty(jr,"__esModule",{value:!0}),jr.CallHierarchyFeature=void 0;const $r=_e;jr.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest($r.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onIncomingCalls:e=>{const t=$r.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=$r.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Hr={};Object.defineProperty(Hr,"__esModule",{value:!0}),Hr.SemanticTokensBuilder=Hr.SemanticTokensDiff=Hr.SemanticTokensFeature=void 0;const Wr=_e;Hr.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Wr.SemanticTokensRefreshRequest.type),on:e=>{const t=Wr.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=Wr.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=Wr.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class Vr{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){const e=this.originalSequence.length,t=this.modifiedSequence.length;let n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,i=t-1;for(;r>=n&&i>=n&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r<n||i<n)&&(r++,i++);const o=r-n+1,s=this.modifiedSequence.slice(n,i+1);return 1===s.length&&s[0]===this.originalSequence[r]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:s}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}}Hr.SemanticTokensDiff=Vr;Hr.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,i){let o=e,s=t;this._dataLen>0&&(o-=this._prevLine,0===o&&(s-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return void 0!==this._prevData}buildEdits(){return void 0!==this._prevData?{resultId:this.id,edits:new Vr(this._prevData,this._data).computeDiff()}:this.build()}};var Ur={};Object.defineProperty(Ur,"__esModule",{value:!0}),Ur.ShowDocumentFeature=void 0;const Kr=_e;Ur.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(Kr.ShowDocumentRequest.type,e)}};var Gr={};Object.defineProperty(Gr,"__esModule",{value:!0}),Gr.FileOperationsFeature=void 0;const zr=_e;Gr.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){return this.connection.onNotification(zr.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(zr.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return this.connection.onNotification(zr.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(zr.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(zr.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(zr.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}};var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.LinkedEditingRangeFeature=void 0;const Jr=_e;Br.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){return this.connection.onRequest(Jr.LinkedEditingRangeRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))}};var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.TypeHierarchyFeature=void 0;const Xr=_e;Yr.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Xr.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=Xr.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=Xr.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0}),Qr.InlineValueFeature=void 0;const Zr=_e;Qr.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(Zr.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(Zr.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}};var ei={};Object.defineProperty(ei,"__esModule",{value:!0}),ei.InlayHintFeature=void 0;const ti=_e;ei.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ti.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ti.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(ti.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}};var ni={};Object.defineProperty(ni,"__esModule",{value:!0}),ni.DiagnosticFeature=void 0;const ri=_e;ni.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(ri.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ri.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ri.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(ri.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ri.WorkspaceDiagnosticRequest.partialResult,t))))}}};var ii={},oi={};Object.defineProperty(oi,"__esModule",{value:!0}),oi.TextDocuments=void 0;const si=_e;oi.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new si.Emitter,this._onDidOpen=new si.Emitter,this._onDidClose=new si.Emitter,this._onDidSave=new si.Emitter,this._onWillSave=new si.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=si.TextDocumentSyncKind.Incremental;const t=[];return t.push(e.onDidOpenTextDocument((e=>{const t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);const r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)}))),t.push(e.onDidChangeTextDocument((e=>{const t=e.textDocument,n=e.contentChanges;if(0===n.length)return;const{version:r}=t;if(null==r)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);let i=this._syncedDocuments.get(t.uri);void 0!==i&&(i=this._configuration.update(i,n,r),this._syncedDocuments.set(t.uri,i),this._onDidChangeContent.fire(Object.freeze({document:i})))}))),t.push(e.onDidCloseTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))}))),t.push(e.onWillSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))}))),t.push(e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return void 0!==n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]}))),t.push(e.onDidSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onDidSave.fire(Object.freeze({document:t}))}))),si.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}},Object.defineProperty(ii,"__esModule",{value:!0}),ii.NotebookDocuments=ii.NotebookSyncFeature=void 0;const ai=_e,ci=oi;ii.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(ai.DidOpenNotebookDocumentNotification.type,(t=>{e(t)})),onDidChangeNotebookDocument:e=>this.connection.onNotification(ai.DidChangeNotebookDocumentNotification.type,(t=>{e(t)})),onDidSaveNotebookDocument:e=>this.connection.onNotification(ai.DidSaveNotebookDocumentNotification.type,(t=>{e(t)})),onDidCloseNotebookDocument:e=>this.connection.onNotification(ai.DidCloseNotebookDocumentNotification.type,(t=>{e(t)}))}}};class ui{onDidOpenTextDocument(e){return this.openHandler=e,ai.Disposable.create((()=>{this.openHandler=void 0}))}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,ai.Disposable.create((()=>{this.changeHandler=e}))}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,ai.Disposable.create((()=>{this.closeHandler=void 0}))}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return ui.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return ui.NULL_DISPOSE}onDidSaveTextDocument(){return ui.NULL_DISPOSE}}ui.NULL_DISPOSE=Object.freeze({dispose:()=>{}});ii.NotebookDocuments=class{constructor(e){e instanceof ci.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ci.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new ai.Emitter,this._onDidChange=new ai.Emitter,this._onDidSave=new ai.Emitter,this._onDidClose=new ai.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){const t="string"==typeof e?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const t=new ui,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument((e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(const n of e.cellTextDocuments)t.openTextDocument({textDocument:n});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)}))),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0===n)return;n.version=e.notebookDocument.version;const r=n.metadata;let i=!1;const o=e.change;void 0!==o.metadata&&(i=!0,n.metadata=o.metadata);const s=[],a=[],c=[],u=[];if(void 0!==o.cells){const e=o.cells;if(void 0!==e.structure){const r=e.structure.array;if(n.cells.splice(r.start,r.deleteCount,...void 0!==r.cells?r.cells:[]),void 0!==e.structure.didOpen)for(const n of e.structure.didOpen)t.openTextDocument({textDocument:n}),s.push(n.uri);if(e.structure.didClose)for(const n of e.structure.didClose)t.closeTextDocument({textDocument:n}),a.push(n.uri)}if(void 0!==e.data){const t=new Map(e.data.map((e=>[e.document,e])));for(let e=0;e<=n.cells.length;e++){const r=t.get(n.cells[e].document);if(void 0!==r){const i=n.cells.splice(e,1,r);if(c.push({old:i[0],new:r}),t.delete(r.document),0===t.size)break}}}if(void 0!==e.textContent)for(const n of e.textContent)t.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),u.push(n.document.uri)}this.updateCellMap(n);const l={notebookDocument:n};i&&(l.metadata={old:r,new:n.metadata});const h=[];for(const e of s)h.push(this.getNotebookCell(e));const d=[];for(const e of a)d.push(this.getNotebookCell(e));const p=[];for(const e of u)p.push(this.getNotebookCell(e));(h.length>0||d.length>0||c.length>0||p.length>0)&&(l.cells={added:h,removed:d,changed:{data:c,textContent:p}}),void 0===l.metadata&&void 0===l.cells||this._onDidChange.fire(l)}))),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument((e=>{const t=this.notebookDocuments.get(e.notebookDocument.uri);void 0!==t&&this._onDidSave.fire(t)}))),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0!==n){this._onDidClose.fire(n);for(const n of e.cellTextDocuments)t.closeTextDocument({textDocument:n});this.notebookDocuments.delete(e.notebookDocument.uri);for(const e of n.cells)this.notebookCellMap.delete(e.document)}}))),ai.Disposable.create((()=>{n.forEach((e=>e.dispose()))}))}updateCellMap(e){for(const t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};var li={};Object.defineProperty(li,"__esModule",{value:!0}),li.MonikerFeature=void 0;const hi=_e;li.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=hi.MonikerRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.combineFeatures=e.combineNotebooksFeatures=e.combineLanguagesFeatures=e.combineWorkspaceFeatures=e.combineWindowFeatures=e.combineClientFeatures=e.combineTracerFeatures=e.combineTelemetryFeatures=e.combineConsoleFeatures=e._NotebooksImpl=e._LanguagesImpl=e.BulkUnregistration=e.BulkRegistration=e.ErrorMessageTracker=void 0;const t=_e,n=ve,r=vr,i=Cr,o=Ir,s=Fr,a=jr,c=Hr,u=Ur,l=Gr,h=Br,d=Yr,p=Qr,f=ei,m=ni,g=ii,y=li;function v(e){if(null!==e)return e}e.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach((t=>{e.window.showErrorMessage(t)}))}};class b{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(t.MessageType.Error,e)}warn(e){this.send(t.MessageType.Warning,e)}info(e){this.send(t.MessageType.Info,e)}log(e){this.send(t.MessageType.Log,e)}send(e,n){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:e,message:n}).catch((()=>{(0,t.RAL)().console.error("Sending log message failed")}))}}const S=(0,u.ShowDocumentFeature)((0,i.ProgressFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...n){let r={type:t.MessageType.Error,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}showWarningMessage(e,...n){let r={type:t.MessageType.Warning,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}showInformationMessage(e,...n){let r={type:t.MessageType.Info,message:e,actions:n};return this.connection.sendRequest(t.ShowMessageRequest.type,r).then(v)}}));(e.BulkRegistration||(e.BulkRegistration={})).create=function(){return new w};class w{constructor(){this._registrations=[],this._registered=new Set}add(e,t){const i=n.string(e)?e:e.method;if(this._registered.has(i))throw new Error(`${i} is already added to this registration`);const o=r.generateUuid();this._registrations.push({id:o,method:i,registerOptions:t||{}}),this._registered.add(i)}asRegistrationParams(){return{registrations:this._registrations}}}(e.BulkUnregistration||(e.BulkUnregistration={})).create=function(){return new R(void 0,[])};class R{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach((e=>{this._unregistrations.set(e.method,e)}))}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let n={unregisterations:e};this._connection.sendRequest(t.UnregistrationRequest.type,n).catch((()=>{this._connection.console.info("Bulk unregistration failed.")}))}disposeSingle(e){const r=n.string(e)?e:e.method,i=this._unregistrations.get(r);if(!i)return!1;let o={unregisterations:[i]};return this._connection.sendRequest(t.UnregistrationRequest.type,o).then((()=>{this._unregistrations.delete(r)}),(e=>{this._connection.console.info(`Un-registering request handler for ${i.id} failed.`)})),!0}}class E{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof w?this.registerMany(e):e instanceof R?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,i,o){const s=n.string(i)?i:i.method,a=r.generateUuid();let c={registrations:[{id:a,method:s,registerOptions:o||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,c).then((t=>(e.add({id:a,method:s}),e)),(e=>(this.connection.console.info(`Registering request handler for ${s} failed.`),Promise.reject(e))))}registerSingle2(e,i){const o=n.string(e)?e:e.method,s=r.generateUuid();let a={registrations:[{id:s,method:o,registerOptions:i||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,a).then((e=>t.Disposable.create((()=>{this.unregisterSingle(s,o).catch((()=>{this.connection.console.info(`Un-registering capability with id ${s} failed.`)}))}))),(e=>(this.connection.console.info(`Registering request handler for ${o} failed.`),Promise.reject(e))))}unregisterSingle(e,n){let r={unregisterations:[{id:e,method:n}]};return this.connection.sendRequest(t.UnregistrationRequest.type,r).catch((()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)}))}registerMany(e){let n=e.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,n).then((()=>new R(this._connection,n.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const C=(0,l.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,o.ConfigurationFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){let n=(r=e)&&r.edit?e:{edit:e};var r;return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,n)}})));class _{constructor(){this._trace=t.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,n){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:e,verbose:this._trace===t.Trace.Verbose?n:void 0}).catch((()=>{}))}}class D{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(t.TelemetryEventNotification.type,e).catch((()=>{this.connection.console.log("Sending TelemetryEventNotification failed")}))}}class T{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}}e._LanguagesImpl=T;const k=(0,y.MonikerFeature)((0,m.DiagnosticFeature)((0,f.InlayHintFeature)((0,p.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,h.LinkedEditingRangeFeature)((0,c.SemanticTokensFeature)((0,a.CallHierarchyFeature)(T))))))));class x{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,i.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,i.attachPartialResult)(this.connection,t)}}e._NotebooksImpl=x;const P=(0,g.NotebookSyncFeature)(x);function O(e,t){return function(n){return t(e(n))}}function N(e,t){return function(n){return t(e(n))}}function q(e,t){return function(n){return t(e(n))}}function I(e,t){return function(n){return t(e(n))}}function A(e,t){return function(n){return t(e(n))}}function M(e,t){return function(n){return t(e(n))}}function F(e,t){return function(n){return t(e(n))}}function L(e,t){return function(n){return t(e(n))}}e.combineConsoleFeatures=O,e.combineTelemetryFeatures=N,e.combineTracerFeatures=q,e.combineClientFeatures=I,e.combineWindowFeatures=A,e.combineWorkspaceFeatures=M,e.combineLanguagesFeatures=F,e.combineNotebooksFeatures=L,e.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:"features",console:n(e.console,t.console,O),tracer:n(e.tracer,t.tracer,q),telemetry:n(e.telemetry,t.telemetry,N),client:n(e.client,t.client,I),window:n(e.window,t.window,A),workspace:n(e.workspace,t.workspace,M),languages:n(e.languages,t.languages,F),notebooks:n(e.notebooks,t.notebooks,L)}},e.createConnection=function(e,r,o){const s=o&&o.console?new(o.console(b)):new b,a=e(s);s.rawAttach(a);const c=o&&o.tracer?new(o.tracer(_)):new _,u=o&&o.telemetry?new(o.telemetry(D)):new D,l=o&&o.client?new(o.client(E)):new E,h=o&&o.window?new(o.window(S)):new S,d=o&&o.workspace?new(o.workspace(C)):new C,p=o&&o.languages?new(o.languages(k)):new k,f=o&&o.notebooks?new(o.notebooks(P)):new P,m=[s,c,u,l,h,d,p,f];let g,y,v,w={listen:()=>a.listen(),sendRequest:(e,...t)=>a.sendRequest(n.string(e)?e:e.method,...t),onRequest:(e,t)=>a.onRequest(e,t),sendNotification:(e,t)=>{const r=n.string(e)?e:e.method;return 1===arguments.length?a.sendNotification(r):a.sendNotification(r,t)},onNotification:(e,t)=>a.onNotification(e,t),onProgress:a.onProgress,sendProgress:a.sendProgress,onInitialize:e=>(y=e,{dispose:()=>{y=void 0}}),onInitialized:e=>a.onNotification(t.InitializedNotification.type,e),onShutdown:e=>(g=e,{dispose:()=>{g=void 0}}),onExit:e=>(v=e,{dispose:()=>{v=void 0}}),get console(){return s},get telemetry(){return u},get tracer(){return c},get client(){return l},get window(){return h},get workspace(){return d},get languages(){return p},get notebooks(){return f},onDidChangeConfiguration:e=>a.onNotification(t.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>a.onNotification(t.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>a.onNotification(t.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>a.onNotification(t.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>a.onNotification(t.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>a.onNotification(t.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>a.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>a.onNotification(t.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>a.sendNotification(t.PublishDiagnosticsNotification.type,e),onHover:e=>a.onRequest(t.HoverRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onCompletion:e=>a.onRequest(t.CompletionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCompletionResolve:e=>a.onRequest(t.CompletionResolveRequest.type,e),onSignatureHelp:e=>a.onRequest(t.SignatureHelpRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDeclaration:e=>a.onRequest(t.DeclarationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDefinition:e=>a.onRequest(t.DefinitionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onTypeDefinition:e=>a.onRequest(t.TypeDefinitionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onImplementation:e=>a.onRequest(t.ImplementationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onReferences:e=>a.onRequest(t.ReferencesRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentHighlight:e=>a.onRequest(t.DocumentHighlightRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentSymbol:e=>a.onRequest(t.DocumentSymbolRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onWorkspaceSymbol:e=>a.onRequest(t.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onWorkspaceSymbolResolve:e=>a.onRequest(t.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>a.onRequest(t.CodeActionRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCodeActionResolve:e=>a.onRequest(t.CodeActionResolveRequest.type,((t,n)=>e(t,n))),onCodeLens:e=>a.onRequest(t.CodeLensRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onCodeLensResolve:e=>a.onRequest(t.CodeLensResolveRequest.type,((t,n)=>e(t,n))),onDocumentFormatting:e=>a.onRequest(t.DocumentFormattingRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDocumentRangeFormatting:e=>a.onRequest(t.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onDocumentOnTypeFormatting:e=>a.onRequest(t.DocumentOnTypeFormattingRequest.type,((t,n)=>e(t,n))),onRenameRequest:e=>a.onRequest(t.RenameRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),onPrepareRename:e=>a.onRequest(t.PrepareRenameRequest.type,((t,n)=>e(t,n))),onDocumentLinks:e=>a.onRequest(t.DocumentLinkRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onDocumentLinkResolve:e=>a.onRequest(t.DocumentLinkResolveRequest.type,((t,n)=>e(t,n))),onDocumentColor:e=>a.onRequest(t.DocumentColorRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onColorPresentation:e=>a.onRequest(t.ColorPresentationRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onFoldingRanges:e=>a.onRequest(t.FoldingRangeRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onSelectionRanges:e=>a.onRequest(t.SelectionRangeRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),(0,i.attachPartialResult)(a,t)))),onExecuteCommand:e=>a.onRequest(t.ExecuteCommandRequest.type,((t,n)=>e(t,n,(0,i.attachWorkDone)(a,t),void 0))),dispose:()=>a.dispose()};for(let e of m)e.attach(w);return a.onRequest(t.InitializeRequest.type,(e=>{r.initialize(e),n.string(e.trace)&&(c.trace=t.Trace.fromString(e.trace));for(let t of m)t.initialize(e.capabilities);if(y){let r=y(e,(new t.CancellationTokenSource).token,(0,i.attachWorkDone)(a,e),void 0);return(o=r,o instanceof Promise?o:n.thenable(o)?new Promise(((e,t)=>{o.then((t=>e(t)),(e=>t(e)))})):Promise.resolve(o)).then((e=>{if(e instanceof t.ResponseError)return e;let r=e;r||(r={capabilities:{}});let i=r.capabilities;i||(i={},r.capabilities=i),void 0===i.textDocumentSync||null===i.textDocumentSync?i.textDocumentSync=n.number(w.__textDocumentSync)?w.__textDocumentSync:t.TextDocumentSyncKind.None:n.number(i.textDocumentSync)||n.number(i.textDocumentSync.change)||(i.textDocumentSync.change=n.number(w.__textDocumentSync)?w.__textDocumentSync:t.TextDocumentSyncKind.None);for(let e of m)e.fillServerCapabilities(i);return r}))}{let e={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let t of m)t.fillServerCapabilities(e.capabilities);return e}var o})),a.onRequest(t.ShutdownRequest.type,(()=>(r.shutdownReceived=!0,g?g((new t.CancellationTokenSource).token):void 0))),a.onNotification(t.ExitNotification.type,(()=>{try{v&&v()}finally{r.shutdownReceived?r.exit(0):r.exit(1)}})),a.onNotification(t.SetTraceNotification.type,(e=>{c.trace=t.Trace.fromString(e.value)})),w}}(Ce);var di={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.resolveModulePath=e.FileSystem=e.resolveGlobalYarnPath=e.resolveGlobalNodePath=e.resolve=e.uriToFilePath=void 0;const t=f,n=s,r=a,i=o;function c(){return"win32"===process.platform}function u(e,t,o,s){const a="NODE_PATH",c=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise(((u,l)=>{let h=process.env,d=Object.create(null);Object.keys(h).forEach((e=>d[e]=h[e])),t&&r.existsSync(t)&&(d[a]?d[a]=t+n.delimiter+d[a]:d[a]=t,s&&s(`NODE_PATH value is: ${d[a]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let t=(0,i.fork)("",[],{cwd:o,env:d,execArgv:["-e",c]});if(void 0===t.pid)return void l(new Error(`Starting process to resolve node module ${e} failed`));t.on("error",(e=>{l(e)})),t.on("message",(n=>{"r"===n.c&&(t.send({c:"e"}),n.s?u(n.r):l(new Error(`Failed to resolve module: ${e}`)))}));let n={c:"rs",a:e};t.send(n)}catch(e){l(e)}}))}function l(e){let t="npm";const r=Object.create(null);Object.keys(process.env).forEach((e=>r[e]=process.env[e])),r.NO_UPDATE_NOTIFIER="true";const o={encoding:"utf8",env:r};c()&&(t="npm.cmd",o.shell=!0);let s=()=>{};try{process.on("SIGPIPE",s);let r=(0,i.spawnSync)(t,["config","get","prefix"],o).stdout;if(!r)return void(e&&e("'npm config get prefix' didn't return a value."));let a=r.trim();return e&&e(`'npm config get prefix' value is: ${a}`),a.length>0?c()?n.join(a,"node_modules"):n.join(a,"lib","node_modules"):void 0}catch(e){return}finally{process.removeListener("SIGPIPE",s)}}var h;e.uriToFilePath=function(e){let r=t.parse(e);if("file:"!==r.protocol||!r.path)return;let i=r.path.split("/");for(var o=0,s=i.length;o<s;o++)i[o]=decodeURIComponent(i[o]);if("win32"===process.platform&&i.length>1){let e=i[0],t=i[1];0===e.length&&t.length>1&&":"===t[1]&&i.shift()}return n.normalize(i.join("/"))},e.resolve=u,e.resolveGlobalNodePath=l,e.resolveGlobalYarnPath=function(e){let t="yarn",r={encoding:"utf8"};c()&&(t="yarn.cmd",r.shell=!0);let o=()=>{};try{process.on("SIGPIPE",o);let s=(0,i.spawnSync)(t,["global","dir","--json"],r),a=s.stdout;if(!a)return void(e&&(e("'yarn global dir' didn't return a value."),s.stderr&&e(s.stderr)));let c=a.trim().split(/\r?\n/);for(let e of c)try{let t=JSON.parse(e);if("log"===t.type)return n.join(t.data,"node_modules")}catch(e){}return}catch(e){return}finally{process.removeListener("SIGPIPE",o)}},function(e){let t;function i(){return void 0!==t||(t="win32"!==process.platform&&(!r.existsSync(__filename.toUpperCase())||!r.existsSync(__filename.toLowerCase()))),t}e.isCaseSensitive=i,e.isParent=function(e,t){return i()?0===n.normalize(t).indexOf(n.normalize(e)):0===n.normalize(t).toLowerCase().indexOf(n.normalize(e).toLowerCase())}}(h=e.FileSystem||(e.FileSystem={})),e.resolveModulePath=function(e,t,r,i){return r?(n.isAbsolute(r)||(r=n.join(e,r)),u(t,r,r,i).then((e=>h.isParent(r,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>u(t,l(i),e,i)))):u(t,l(i),e,i)}}(di);var pi=_e,fi={};!function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProposedFeatures=e.NotebookDocuments=e.TextDocuments=e.SemanticTokensBuilder=void 0;const r=Hr;Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}}),n(_e,e);const i=oi;Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return i.TextDocuments}});const o=ii;Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(Ce,e),(e.ProposedFeatures||(e.ProposedFeatures={})).all={__brand:"features"}}(fi),function(e){var t=T&&T.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=T&&T.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.Files=void 0;const r=ve,i=Ce,o=di,s=pi;var a;n(pi,e),n(fi,e),(a=e.Files||(e.Files={})).uriToFilePath=o.uriToFilePath,a.resolveGlobalNodePath=o.resolveGlobalNodePath,a.resolveGlobalYarnPath=o.resolveGlobalYarnPath,a.resolve=o.resolve,a.resolveModulePath=o.resolveModulePath;let c,u=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(c=setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(u?0:1)}}),3e3))}catch(e){}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length)return void t(process.argv[n+1]);{let n=r.split("=");n[0]===e&&t(n[1])}}}();const l={initialize:e=>{const t=e.processId;r.number(t)&&void 0===c&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(u?0:1)}}),3e3)},get shutdownReceived(){return u},set shutdownReceived(e){u=e},exit:e=>{process.exit(e)}};e.createConnection=function(e,t,n,o){let a,c,h,d;return void 0!==e&&"features"===e.__brand&&(a=e,e=t,t=n,n=o),s.ConnectionStrategy.is(e)||s.ConnectionOptions.is(e)?d=e:(c=e,h=t,d=n),function(e,t,n,o){if(!e&&!t&&process.argv.length>2){let n,r,i=process.argv.slice(2);for(let o=0;o<i.length;o++){let c=i[o];if("--node-ipc"===c){e=new s.IPCMessageReader(process),t=new s.IPCMessageWriter(process);break}if("--stdio"===c){e=process.stdin,t=process.stdout;break}if("--socket"===c){n=parseInt(i[o+1]);break}if("--pipe"===c){r=i[o+1];break}var a=c.split("=");if("--socket"===a[0]){n=parseInt(a[1]);break}if("--pipe"===a[0]){r=a[1];break}}if(n){let r=(0,s.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,s.createServerPipeTransport)(r);e=n[0],t=n[1]}}var c="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+c);if(!t)throw new Error("Connection output stream is not set. "+c);if(r.func(e.read)&&r.func(e.on)){let t=e;t.on("end",(()=>{process.exit(u?0:1)})),t.on("close",(()=>{process.exit(u?0:1)}))}const h=r=>(0,s.createProtocolConnection)(e,t,r,n);return(0,i.createConnection)(h,l,o)}(c,h,d,a)}}(ye);const mi=k(ye);const gi=k(ye);var yi={},vi={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},bi=m,Si=process.cwd,wi=null,Ri=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return wi||(wi=Si.call(process)),wi};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Ei=process.chdir;process.chdir=function(e){wi=null,Ei.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ei)}var Ci=function(e){bi.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,bi.O_WRONLY|bi.O_SYMLINK,n,(function(t,i){t?r&&r(t):e.fchmod(i,n,(function(t){e.close(i,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,i=e.openSync(t,bi.O_WRONLY|bi.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(i,n),o=!1}finally{if(o)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return r}}(e);e.lutimes||function(e){bi.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,r,i){e.open(t,bi.O_SYMLINK,(function(t,o){t?i&&i(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){i&&i(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var i,o=e.openSync(t,bi.O_SYMLINK),s=!0;try{i=e.futimesSync(o,n,r),s=!1}finally{if(s)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return i}):(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=i(e.chown),e.fchown=i(e.fchown),e.lchown=i(e.lchown),e.chmod=n(e.chmod),e.fchmod=n(e.fchmod),e.lchmod=n(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=a(e.statSync),e.fstatSync=a(e.fstatSync),e.lstatSync=a(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.lchown||(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Ri&&(e.rename=(t=e.rename,function(n,r,i){var o=Date.now(),s=0;t(n,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}));var t;function n(t){return t?function(n,r,i){return t.call(e,n,r,(function(e){c(e)&&(e=null),i&&i.apply(this,arguments)}))}:t}function r(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!c(e))throw e}}:t}function i(t){return t?function(n,r,i,o){return t.call(e,n,r,i,(function(e){c(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function o(t){return t?function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!c(e))throw e}}:t}function s(t){return t?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function a(t){return t?function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296),i}:t}function c(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read=function(t){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,h,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,t.call(e,n,r,i,o,s,c);a.apply(this,arguments)}}return t.call(e,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync=(u=e.readSync,function(t,n,r,i,o){for(var s=0;;)try{return u.call(e,t,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var u};var _i=g.Stream,Di=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);_i.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){i._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);_i.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),o=0,s=i.length;o<s;o++){var a=i[o];this[a]=r[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var Ti=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:ki(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},ki=Object.getPrototypeOf||function(e){return e.__proto__};var xi,Pi,Oi=a,Ni=Ci,qi=Di,Ii=Ti,Ai=u;function Mi(e,t){Object.defineProperty(e,xi,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(xi=Symbol.for("graceful-fs.queue"),Pi=Symbol.for("graceful-fs.previous")):(xi="___graceful-fs.queue",Pi="___graceful-fs.previous");var Fi=function(){};if(Ai.debuglog?Fi=Ai.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Fi=function(){var e=Ai.format.apply(Ai,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Oi[xi]){var Li=T[xi]||[];Mi(Oi,Li),Oi.close=function(e){function t(t,n){return e.call(Oi,t,(function(e){e||Vi(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Pi,{value:e}),t}(Oi.close),Oi.closeSync=function(e){function t(t){e.apply(Oi,arguments),Vi()}return Object.defineProperty(t,Pi,{value:e}),t}(Oi.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Fi(Oi[xi]),y.equal(Oi[xi].length,0)}))}T[xi]||Mi(T,Oi[xi]);var ji,$i=Hi(Ii(Oi));function Hi(e){Ni(e),e.gracefulify=Hi,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):Wi([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):Wi([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,i){"function"==typeof n&&(i=n,n=null);return function e(t,n,i,o,s){return r(t,n,i,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):Wi([e,[t,n,i,o],r,s||Date.now(),Date.now()])}))}(e,t,n,i)});var i=e.copyFile;i&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,s){return i(t,n,r,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):Wi([e,[t,n,r,o],i,s||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;if(e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);return function e(t,n,r,i){return o(t,n,(function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof r&&r.call(this,o,s)):Wi([e,[t,n,r],o,i||Date.now(),Date.now()])}))}(e,t,n)},"v0.8"===process.version.substr(0,4)){var s=qi(e);h=s.ReadStream,d=s.WriteStream}var a=e.ReadStream;a&&(h.prototype=Object.create(a.prototype),h.prototype.open=function(){var e=this;f(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var c=e.WriteStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;f(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var u=h;Object.defineProperty(e,"FileReadStream",{get:function(){return u},set:function(e){u=e},enumerable:!0,configurable:!0});var l=d;function h(e,t){return this instanceof h?(a.apply(this,arguments),this):h.apply(Object.create(h.prototype),arguments)}function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var p=e.open;function f(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return p(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):Wi([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=f,e}function Wi(e){Fi("ENQUEUE",e[0].name,e[1]),Oi[xi].push(e),Ui()}function Vi(){for(var e=Date.now(),t=0;t<Oi[xi].length;++t)Oi[xi][t].length>2&&(Oi[xi][t][3]=e,Oi[xi][t][4]=e);Ui()}function Ui(){if(clearTimeout(ji),ji=void 0,0!==Oi[xi].length){var e=Oi[xi].shift(),t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(void 0===i)Fi("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Fi("TIMEOUT",t.name,n);var s=n.pop();"function"==typeof s&&s.call(null,r)}else{var a=Date.now()-o,c=Math.max(o-i,1);a>=Math.min(1.2*c,100)?(Fi("RETRY",t.name,n),t.apply(null,n.concat([i]))):Oi[xi].push(e)}void 0===ji&&(ji=setTimeout(Ui,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Oi.__patched&&($i=Hi(Oi),Oi.__patched=!0),function(e){const t=vi.fromCallback,n=$i,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,i,o,s){return"function"==typeof s?n.read(e,t,r,i,o,s):new Promise(((s,a)=>{n.read(e,t,r,i,o,((e,t,n)=>{if(e)return a(e);s({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((i,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffer:n})}))}))},e.readv=function(e,t,...r){return"function"==typeof r[r.length-1]?n.readv(e,t,...r):new Promise(((i,o)=>{n.readv(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesRead:t,buffers:n})}))}))},e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((i,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffers:n})}))}))},"function"==typeof n.realpath.native?e.realpath.native=t(n.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(yi);var Ki={},Gi={};const zi=s;Gi.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(zi.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const Bi=yi,{checkPath:Ji}=Gi,Yi=e=>"number"==typeof e?e:{mode:511,...e}.mode;Ki.makeDir=async(e,t)=>(Ji(e),Bi.mkdir(e,{mode:Yi(t),recursive:!0})),Ki.makeDirSync=(e,t)=>(Ji(e),Bi.mkdirSync(e,{mode:Yi(t),recursive:!0}));const Xi=vi.fromPromise,{makeDir:Qi,makeDirSync:Zi}=Ki,eo=Xi(Qi);var to={mkdirs:eo,mkdirsSync:Zi,mkdirp:eo,mkdirpSync:Zi,ensureDir:eo,ensureDirSync:Zi};const no=vi.fromPromise,ro=yi;var io={pathExists:no((function(e){return ro.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:ro.existsSync};const oo=$i;var so=function(e,t,n,r){oo.open(e,"r+",((e,i)=>{if(e)return r(e);oo.futimes(i,t,n,(e=>{oo.close(i,(t=>{r&&r(e||t)}))}))}))},ao=function(e,t,n){const r=oo.openSync(e,"r+");return oo.futimesSync(r,t,n),oo.closeSync(r)};const co=yi,uo=s,lo=u;function ho(e,t,n){const r=n.dereference?e=>co.stat(e,{bigint:!0}):e=>co.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function po(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function fo(e,t){const n=uo.resolve(e).split(uo.sep).filter((e=>e)),r=uo.resolve(t).split(uo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function mo(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var go={checkPaths:function(e,t,n,r,i){lo.callbackify(ho)(e,t,r,((r,o)=>{if(r)return i(r);const{srcStat:s,destStat:a}=o;if(a){if(po(s,a)){const r=uo.basename(e),o=uo.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?i(null,{srcStat:s,destStat:a,isChangingCase:!0}):i(new Error("Source and destination must not be the same."))}if(s.isDirectory()&&!a.isDirectory())return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!s.isDirectory()&&a.isDirectory())return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return s.isDirectory()&&fo(e,t)?i(new Error(mo(e,t,n))):i(null,{srcStat:s,destStat:a})}))},checkPathsSync:function(e,t,n,r){const{srcStat:i,destStat:o}=function(e,t,n){let r;const i=n.dereference?e=>co.statSync(e,{bigint:!0}):e=>co.lstatSync(e,{bigint:!0}),o=i(e);try{r=i(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(po(i,o)){const r=uo.basename(e),s=uo.basename(t);if("move"===n&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&fo(e,t))throw new Error(mo(e,t,n));return{srcStat:i,destStat:o}},checkParentPaths:function e(t,n,r,i,o){const s=uo.resolve(uo.dirname(t)),a=uo.resolve(uo.dirname(r));if(a===s||a===uo.parse(a).root)return o();co.stat(a,{bigint:!0},((s,c)=>s?"ENOENT"===s.code?o():o(s):po(n,c)?o(new Error(mo(t,r,i))):e(t,n,a,i,o)))},checkParentPathsSync:function e(t,n,r,i){const o=uo.resolve(uo.dirname(t)),s=uo.resolve(uo.dirname(r));if(s===o||s===uo.parse(s).root)return;let a;try{a=co.statSync(s,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(po(n,a))throw new Error(mo(t,r,i));return e(t,n,s,i)},isSrcSubdir:fo,areIdentical:po};const yo=$i,vo=s,bo=to.mkdirs,So=io.pathExists,wo=so,Ro=go;function Eo(e,t,n,r){if(!n.filter)return r(null,!0);Promise.resolve(n.filter(e,t)).then((e=>r(null,e)),(e=>r(e)))}function Co(e,t,n,r,i){(r.dereference?yo.stat:yo.lstat)(t,((o,s)=>o?i(o):s.isDirectory()?function(e,t,n,r,i,o){return t?ko(n,r,i,o):function(e,t,n,r,i){yo.mkdir(n,(o=>{if(o)return i(o);ko(t,n,r,(t=>t?i(t):To(n,e,i)))}))}(e.mode,n,r,i,o)}(s,e,t,n,r,i):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?function(e,t,n,r,i,o){return t?function(e,t,n,r,i){if(!r.overwrite)return r.errorOnExist?i(new Error(`'${n}' already exists`)):i();yo.unlink(n,(o=>o?i(o):_o(e,t,n,r,i)))}(e,n,r,i,o):_o(e,n,r,i,o)}(s,e,t,n,r,i):s.isSymbolicLink()?function(e,t,n,r,i){yo.readlink(t,((t,o)=>t?i(t):(r.dereference&&(o=vo.resolve(process.cwd(),o)),e?void yo.readlink(n,((e,t)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?yo.symlink(o,n,i):i(e):(r.dereference&&(t=vo.resolve(process.cwd(),t)),Ro.isSrcSubdir(o,t)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${t}'.`)):Ro.isSrcSubdir(t,o)?i(new Error(`Cannot overwrite '${t}' with '${o}'.`)):function(e,t,n){yo.unlink(t,(r=>r?n(r):yo.symlink(e,t,n)))}(o,n,i)))):yo.symlink(o,n,i))))}(e,t,n,r,i):s.isSocket()?i(new Error(`Cannot copy a socket file: ${t}`)):s.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${t}`)):i(new Error(`Unknown file: ${t}`))))}function _o(e,t,n,r,i){yo.copyFile(t,n,(o=>o?i(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return To(e,128|t,n)}(n,e,(i=>i?r(i):Do(e,t,n,r)));return Do(e,t,n,r)}(e.mode,t,n,i):To(n,e.mode,i)))}function Do(e,t,n,r){!function(e,t,n){yo.stat(e,((e,r)=>e?n(e):wo(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):To(n,e,r)))}function To(e,t,n){return yo.chmod(e,t,n)}function ko(e,t,n,r){yo.readdir(e,((i,o)=>i?r(i):xo(o,e,t,n,r)))}function xo(e,t,n,r,i){const o=e.pop();return o?function(e,t,n,r,i,o){const s=vo.join(n,t),a=vo.join(r,t);Eo(s,a,i,((t,c)=>t?o(t):c?void Ro.checkPaths(s,a,"copy",i,((t,c)=>{if(t)return o(t);const{destStat:u}=c;Co(u,s,a,i,(t=>t?o(t):xo(e,n,r,i,o)))})):xo(e,n,r,i,o)))}(e,o,t,n,r,i):i()}var Po=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),Ro.checkPaths(e,t,"copy",n,((i,o)=>{if(i)return r(i);const{srcStat:s,destStat:a}=o;Ro.checkParentPaths(e,s,t,"copy",(i=>{if(i)return r(i);Eo(e,t,n,((i,o)=>i?r(i):o?void function(e,t,n,r,i){const o=vo.dirname(n);So(o,((s,a)=>s?i(s):a?Co(e,t,n,r,i):void bo(o,(o=>o?i(o):Co(e,t,n,r,i)))))}(a,e,t,n,r):r()))}))}))};const Oo=$i,No=s,qo=to.mkdirsSync,Io=ao,Ao=go;function Mo(e,t,n,r){const i=(r.dereference?Oo.statSync:Oo.lstatSync)(t);if(i.isDirectory())return function(e,t,n,r,i){return t?jo(n,r,i):function(e,t,n,r){return Oo.mkdirSync(n),jo(t,n,r),Lo(n,e)}(e.mode,n,r,i)}(i,e,t,n,r);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return function(e,t,n,r,i){return t?function(e,t,n,r){if(r.overwrite)return Oo.unlinkSync(n),Fo(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,i):Fo(e,n,r,i)}(i,e,t,n,r);if(i.isSymbolicLink())return function(e,t,n,r){let i=Oo.readlinkSync(t);r.dereference&&(i=No.resolve(process.cwd(),i));if(e){let e;try{e=Oo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Oo.symlinkSync(i,n);throw e}if(r.dereference&&(e=No.resolve(process.cwd(),e)),Ao.isSrcSubdir(i,e))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${e}'.`);if(Ao.isSrcSubdir(e,i))throw new Error(`Cannot overwrite '${e}' with '${i}'.`);return function(e,t){return Oo.unlinkSync(t),Oo.symlinkSync(e,t)}(i,n)}return Oo.symlinkSync(i,n)}(e,t,n,r);if(i.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(i.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function Fo(e,t,n,r){return Oo.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){Lo(e,128|t)}(n,e);(function(e,t){const n=Oo.statSync(e);Io(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),Lo(n,e.mode)}function Lo(e,t){return Oo.chmodSync(e,t)}function jo(e,t,n){Oo.readdirSync(e).forEach((r=>function(e,t,n,r){const i=No.join(t,e),o=No.join(n,e);if(r.filter&&!r.filter(i,o))return;const{destStat:s}=Ao.checkPathsSync(i,o,"copy",r);return Mo(s,i,o,r)}(r,e,t,n)))}var $o=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:i}=Ao.checkPathsSync(e,t,"copy",n);if(Ao.checkParentPathsSync(e,r,t,"copy"),n.filter&&!n.filter(e,t))return;const o=No.dirname(t);return Oo.existsSync(o)||qo(o),Mo(i,e,t,n)};var Ho={copy:(0,vi.fromCallback)(Po),copySync:$o};const Wo=$i;var Vo={remove:(0,vi.fromCallback)((function(e,t){Wo.rm(e,{recursive:!0,force:!0},t)})),removeSync:function(e){Wo.rmSync(e,{recursive:!0,force:!0})}};const Uo=vi.fromPromise,Ko=yi,Go=s,zo=to,Bo=Vo,Jo=Uo((async function(e){let t;try{t=await Ko.readdir(e)}catch{return zo.mkdirs(e)}return Promise.all(t.map((t=>Bo.remove(Go.join(e,t)))))}));function Yo(e){let t;try{t=Ko.readdirSync(e)}catch{return zo.mkdirsSync(e)}t.forEach((t=>{t=Go.join(e,t),Bo.removeSync(t)}))}var Xo={emptyDirSync:Yo,emptydirSync:Yo,emptyDir:Jo,emptydir:Jo};const Qo=vi.fromCallback,Zo=s,es=$i,ts=to;var ns={createFile:Qo((function(e,t){function n(){es.writeFile(e,"",(e=>{if(e)return t(e);t()}))}es.stat(e,((r,i)=>{if(!r&&i.isFile())return t();const o=Zo.dirname(e);es.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?ts.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():es.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=es.statSync(e)}catch{}if(t&&t.isFile())return;const n=Zo.dirname(e);try{es.statSync(n).isDirectory()||es.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;ts.mkdirsSync(n)}es.writeFileSync(e,"")}};const rs=vi.fromCallback,is=s,os=$i,ss=to,as=io.pathExists,{areIdentical:cs}=go;var us={createLink:rs((function(e,t,n){function r(e,t){os.link(e,t,(e=>{if(e)return n(e);n(null)}))}os.lstat(t,((i,o)=>{os.lstat(e,((i,s)=>{if(i)return i.message=i.message.replace("lstat","ensureLink"),n(i);if(o&&cs(s,o))return n(null);const a=is.dirname(t);as(a,((i,o)=>i?n(i):o?r(e,t):void ss.mkdirs(a,(i=>{if(i)return n(i);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=os.lstatSync(t)}catch{}try{const t=os.lstatSync(e);if(n&&cs(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=is.dirname(t);return os.existsSync(r)||ss.mkdirsSync(r),os.linkSync(e,t)}};const ls=s,hs=$i,ds=io.pathExists;var ps={symlinkPaths:function(e,t,n){if(ls.isAbsolute(e))return hs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=ls.dirname(t),i=ls.join(r,e);return ds(i,((t,o)=>t?n(t):o?n(null,{toCwd:i,toDst:e}):hs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:ls.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(ls.isAbsolute(e)){if(n=hs.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=ls.dirname(t),i=ls.join(r,e);if(n=hs.existsSync(i),n)return{toCwd:i,toDst:e};if(n=hs.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:ls.relative(r,e)}}}};const fs=$i;var ms={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);fs.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=fs.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const gs=vi.fromCallback,ys=s,vs=yi,bs=to.mkdirs,Ss=to.mkdirsSync,ws=ps.symlinkPaths,Rs=ps.symlinkPathsSync,Es=ms.symlinkType,Cs=ms.symlinkTypeSync,_s=io.pathExists,{areIdentical:Ds}=go;function Ts(e,t,n,r){ws(e,t,((i,o)=>{if(i)return r(i);e=o.toDst,Es(o.toCwd,n,((n,i)=>{if(n)return r(n);const o=ys.dirname(t);_s(o,((n,s)=>n?r(n):s?vs.symlink(e,t,i,r):void bs(o,(n=>{if(n)return r(n);vs.symlink(e,t,i,r)}))))}))}))}var ks={createSymlink:gs((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,vs.lstat(t,((i,o)=>{!i&&o.isSymbolicLink()?Promise.all([vs.stat(e),vs.stat(t)]).then((([i,o])=>{if(Ds(i,o))return r(null);Ts(e,t,n,r)})):Ts(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=vs.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=vs.statSync(e),r=vs.statSync(t);if(Ds(n,r))return}const i=Rs(e,t);e=i.toDst,n=Cs(i.toCwd,n);const o=ys.dirname(t);return vs.existsSync(o)||Ss(o),vs.symlinkSync(e,t,n)}};const{createFile:xs,createFileSync:Ps}=ns,{createLink:Os,createLinkSync:Ns}=us,{createSymlink:qs,createSymlinkSync:Is}=ks;var As,Ms,Fs,Ls,js,$s,Hs,Ws,Vs={createFile:xs,createFileSync:Ps,ensureFile:xs,ensureFileSync:Ps,createLink:Os,createLinkSync:Ns,ensureLink:Os,ensureLinkSync:Ns,createSymlink:qs,createSymlinkSync:Is,ensureSymlink:qs,ensureSymlinkSync:Is};function Us(){if(Ms)return As;Ms=1;var e=m,t=process.cwd,n=null,r=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return n||(n=t.call(process)),n};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var i=process.chdir;process.chdir=function(e){n=null,i.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,i)}return As=function(t){e.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(t){t.lchmod=function(n,r,i){t.open(n,e.O_WRONLY|e.O_SYMLINK,r,(function(e,n){e?i&&i(e):t.fchmod(n,r,(function(e){t.close(n,(function(t){i&&i(e||t)}))}))}))},t.lchmodSync=function(n,r){var i,o=t.openSync(n,e.O_WRONLY|e.O_SYMLINK,r),s=!0;try{i=t.fchmodSync(o,r),s=!1}finally{if(s)try{t.closeSync(o)}catch(e){}else t.closeSync(o)}return i}}(t);t.lutimes||function(t){e.hasOwnProperty("O_SYMLINK")?(t.lutimes=function(n,r,i,o){t.open(n,e.O_SYMLINK,(function(e,n){e?o&&o(e):t.futimes(n,r,i,(function(e){t.close(n,(function(t){o&&o(e||t)}))}))}))},t.lutimesSync=function(n,r,i){var o,s=t.openSync(n,e.O_SYMLINK),a=!0;try{o=t.futimesSync(s,r,i),a=!1}finally{if(a)try{t.closeSync(s)}catch(e){}else t.closeSync(s)}return o}):(t.lutimes=function(e,t,n,r){r&&process.nextTick(r)},t.lutimesSync=function(){})}(t);t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=i(t.chmod),t.fchmod=i(t.fchmod),t.lchmod=i(t.lchmod),t.chownSync=a(t.chownSync),t.fchownSync=a(t.fchownSync),t.lchownSync=a(t.lchownSync),t.chmodSync=o(t.chmodSync),t.fchmodSync=o(t.fchmodSync),t.lchmodSync=o(t.lchmodSync),t.stat=c(t.stat),t.fstat=c(t.fstat),t.lstat=c(t.lstat),t.statSync=u(t.statSync),t.fstatSync=u(t.fstatSync),t.lstatSync=u(t.lstatSync),t.lchmod||(t.lchmod=function(e,t,n){n&&process.nextTick(n)},t.lchmodSync=function(){});t.lchown||(t.lchown=function(e,t,n,r){r&&process.nextTick(r)},t.lchownSync=function(){});"win32"===r&&(t.rename=(n=t.rename,function(e,r,i){var o=Date.now(),s=0;n(e,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){t.stat(r,(function(t,o){t&&"ENOENT"===t.code?n(e,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}));var n;function i(e){return e?function(n,r,i){return e.call(t,n,r,(function(e){l(e)&&(e=null),i&&i.apply(this,arguments)}))}:e}function o(e){return e?function(n,r){try{return e.call(t,n,r)}catch(e){if(!l(e))throw e}}:e}function s(e){return e?function(n,r,i,o){return e.call(t,n,r,i,(function(e){l(e)&&(e=null),o&&o.apply(this,arguments)}))}:e}function a(e){return e?function(n,r,i){try{return e.call(t,n,r,i)}catch(e){if(!l(e))throw e}}:e}function c(e){return e?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?e.call(t,n,r,o):e.call(t,n,o)}:e}function u(e){return e?function(n,r){var i=r?e.call(t,n,r):e.call(t,n);return i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296),i}:e}function l(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}t.read=function(e){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,h,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,e.call(t,n,r,i,o,s,c);a.apply(this,arguments)}}return e.call(t,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,e),n}(t.read),t.readSync=(h=t.readSync,function(e,n,r,i,o){for(var s=0;;)try{return h.call(t,e,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var h},As}var Ks={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:i}={}){const o=n?t:"";return JSON.stringify(e,r,i).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let Gs;try{Gs=function(){if(Ws)return Hs;Ws=1;var e,t,n=a,r=Us(),i=function(){if(Ls)return Fs;Ls=1;var e=g.Stream;return Fs=function(t){return{ReadStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this);var o=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,i=i||{};for(var s=Object.keys(i),a=0,c=s.length;a<c;a++){var u=s[a];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}null===this.fd?t.open(this.path,this.flags,this.mode,(function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})):process.nextTick((function(){o._read()}))},WriteStream:function n(r,i){if(!(this instanceof n))return new n(r,i);e.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var o=Object.keys(i),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=i[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}},Fs}(),o=function(){if($s)return js;$s=1,js=function(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Object)var n={__proto__:e(t)};else n=Object.create(null);return Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))})),n};var e=Object.getPrototypeOf||function(e){return e.__proto__};return js}(),s=u;function c(t,n){Object.defineProperty(t,e,{get:function(){return n}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(e=Symbol.for("graceful-fs.queue"),t=Symbol.for("graceful-fs.previous")):(e="___graceful-fs.queue",t="___graceful-fs.previous");var l,h=function(){};if(s.debuglog?h=s.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(h=function(){var e=s.format.apply(s,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!n[e]){var d=T[e]||[];c(n,d),n.close=function(e){function r(t,r){return e.call(n,t,(function(e){e||m(),"function"==typeof r&&r.apply(this,arguments)}))}return Object.defineProperty(r,t,{value:e}),r}(n.close),n.closeSync=function(e){function r(t){e.apply(n,arguments),m()}return Object.defineProperty(r,t,{value:e}),r}(n.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){h(n[e]),y.equal(n[e].length,0)}))}function p(e){r(e),e.gracefulify=p,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){return"function"==typeof n&&(r=n,n=null),function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):f([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){return"function"==typeof r&&(i=r,r=null),function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):f([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var o=e.appendFile;o&&(e.appendFile=function(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,s){return o(t,n,r,(function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],o,s||Date.now(),Date.now()])}))}(e,t,n,r)});var s=e.copyFile;s&&(e.copyFile=function(e,t,n,r){return"function"==typeof n&&(r=n,n=0),function e(t,n,r,i,o){return s(t,n,r,(function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)});var a=e.readdir;if(e.readdir=function(e,t,n){return"function"==typeof t&&(n=t,t=null),function e(t,n,r,i){return a(t,n,(function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof r&&r.call(this,o,s)):f([e,[t,n,r],o,i||Date.now(),Date.now()])}))}(e,t,n)},"v0.8"===process.version.substr(0,4)){var c=i(e);m=c.ReadStream,g=c.WriteStream}var u=e.ReadStream;u&&(m.prototype=Object.create(u.prototype),m.prototype.open=function(){var e=this;v(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var l=e.WriteStream;l&&(g.prototype=Object.create(l.prototype),g.prototype.open=function(){var e=this;v(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return m},set:function(e){m=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return g},set:function(e){g=e},enumerable:!0,configurable:!0});var h=m;Object.defineProperty(e,"FileReadStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0});var d=g;function m(e,t){return this instanceof m?(u.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function g(e,t){return this instanceof g?(l.apply(this,arguments),this):g.apply(Object.create(g.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0});var y=e.open;function v(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return y(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):f([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=v,e}function f(t){h("ENQUEUE",t[0].name,t[1]),n[e].push(t),v()}function m(){for(var t=Date.now(),r=0;r<n[e].length;++r)n[e][r].length>2&&(n[e][r][3]=t,n[e][r][4]=t);v()}function v(){if(clearTimeout(l),l=void 0,0!==n[e].length){var t=n[e].shift(),r=t[0],i=t[1],o=t[2],s=t[3],a=t[4];if(void 0===s)h("RETRY",r.name,i),r.apply(null,i);else if(Date.now()-s>=6e4){h("TIMEOUT",r.name,i);var c=i.pop();"function"==typeof c&&c.call(null,o)}else{var u=Date.now()-a,d=Math.max(a-s,1);u>=Math.min(1.2*d,100)?(h("RETRY",r.name,i),r.apply(null,i.concat([s]))):n[e].push(t)}void 0===l&&(l=setTimeout(v,0))}}return T[e]||c(T,n[e]),Hs=p(o(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(Hs=p(n),n.__patched=!0),Hs}()}catch(e){Gs=a}const zs=vi,{stringify:Bs,stripBom:Js}=Ks;const Ys=zs.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Gs,r=!("throws"in t)||t.throws;let i,o=await zs.fromCallback(n.readFile)(e,t);o=Js(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return i}));const Xs=zs.fromPromise((async function(e,t,n={}){const r=n.fs||Gs,i=Bs(t,n);await zs.fromCallback(r.writeFile)(e,i,n)}));const Qs={readFile:Ys,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||Gs,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=Js(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:Xs,writeFileSync:function(e,t,n={}){const r=n.fs||Gs,i=Bs(t,n);return r.writeFileSync(e,i,n)}};var Zs={readJson:Qs.readFile,readJsonSync:Qs.readFileSync,writeJson:Qs.writeFile,writeJsonSync:Qs.writeFileSync};const ea=vi.fromCallback,ta=$i,na=s,ra=to,ia=io.pathExists;var oa={outputFile:ea((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const i=na.dirname(e);ia(i,((o,s)=>o?r(o):s?ta.writeFile(e,t,n,r):void ra.mkdirs(i,(i=>{if(i)return r(i);ta.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=na.dirname(e);if(ta.existsSync(n))return ta.writeFileSync(e,...t);ra.mkdirsSync(n),ta.writeFileSync(e,...t)}};const{stringify:sa}=Ks,{outputFile:aa}=oa;var ca=async function(e,t,n={}){const r=sa(t,n);await aa(e,r,n)};const{stringify:ua}=Ks,{outputFileSync:la}=oa;var ha=function(e,t,n){const r=ua(t,n);la(e,r,n)};const da=vi.fromPromise,pa=Zs;pa.outputJson=da(ca),pa.outputJsonSync=ha,pa.outputJSON=pa.outputJson,pa.outputJSONSync=pa.outputJsonSync,pa.writeJSON=pa.writeJson,pa.writeJSONSync=pa.writeJsonSync,pa.readJSON=pa.readJson,pa.readJSONSync=pa.readJsonSync;var fa=pa;const ma=$i,ga=s,ya=Ho.copy,va=Vo.remove,ba=to.mkdirp,Sa=io.pathExists,wa=go;function Ra(e,t,n,r,i){return r?Ea(e,t,n,i):n?va(t,(r=>r?i(r):Ea(e,t,n,i))):void Sa(t,((r,o)=>r?i(r):o?i(new Error("dest already exists.")):Ea(e,t,n,i)))}function Ea(e,t,n,r){ma.rename(e,t,(i=>i?"EXDEV"!==i.code?r(i):function(e,t,n,r){const i={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};ya(e,t,i,(t=>t?r(t):va(e,r)))}(e,t,n,r):r()))}var Ca=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const i=(n=n||{}).overwrite||n.clobber||!1;wa.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:s,isChangingCase:a=!1}=o;wa.checkParentPaths(e,s,t,"move",(n=>n?r(n):function(e){const t=ga.dirname(e);return ga.parse(t).root===t}(t)?Ra(e,t,i,a,r):void ba(ga.dirname(t),(n=>n?r(n):Ra(e,t,i,a,r)))))}))};const _a=$i,Da=s,Ta=Ho.copySync,ka=Vo.removeSync,xa=to.mkdirpSync,Pa=go;function Oa(e,t,n){try{_a.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return Ta(e,t,r),ka(e)}(e,t,n)}}var Na=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:i,isChangingCase:o=!1}=Pa.checkPathsSync(e,t,"move",n);return Pa.checkParentPathsSync(e,i,t,"move"),function(e){const t=Da.dirname(e);return Da.parse(t).root===t}(t)||xa(Da.dirname(t)),function(e,t,n,r){if(r)return Oa(e,t,n);if(n)return ka(t),Oa(e,t,n);if(_a.existsSync(t))throw new Error("dest already exists.");return Oa(e,t,n)}(e,t,r,o)};var qa={move:(0,vi.fromCallback)(Ca),moveSync:Na};const Ia=k({...yi,...Ho,...Xo,...Vs,...fa,...to,...qa,...oa,...io,...Vo});var Aa;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Log=3]="Log"}(Aa||(Aa={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"log":return e.Log;case"info":return e.Info;case"warning":return e.Warning;default:return e.Error}},e.toString=function(t){switch(t){case e.Error:return"error";case e.Warning:return"warning";case e.Info:return"info";case e.Log:return"log"}}}(Aa||(Aa={}));class Ma{constructor(e,t){this.client=e,this.level=t}sendMessage(e,t,n){if(this.level>=e||n?.overrideLevel){const n=t.map((e=>"object"==typeof e?JSON.stringify(e,null,2):e)).join(" ");this.client.logMessage({type:e,message:n})}}logLevelToLspMessageType(e){switch(e){case Aa.Log:return mi.MessageType.Log;case Aa.Info:return mi.MessageType.Info;case Aa.Warning:return mi.MessageType.Warning;case Aa.Error:return mi.MessageType.Error}}error(...e){this.sendMessage(mi.MessageType.Error,e)}warn(...e){this.sendMessage(mi.MessageType.Warning,e)}info(...e){this.sendMessage(mi.MessageType.Info,e)}log(...e){this.sendMessage(mi.MessageType.Log,e)}logIgnoringVerbosity(e,...t){this.sendMessage(this.logLevelToLspMessageType(e),t,{overrideLevel:!0})}trace(e,t,n){this.logIgnoringVerbosity(Aa.Log,`[${e} - ${ja()}] ${t}`),n&&this.logIgnoringVerbosity(Aa.Log,Ha(n))}}class Fa{constructor(e,t){this.logDirectory=e,this.level=t,console.error("Resolved logDirectory",s.resolve(this.logDirectory)),Ia.pathExistsSync(this.logDirectory)||Ia.mkdirSync(this.logDirectory),this.logFile=Ia.createWriteStream(s.join(this.logDirectory,"debug.log"),{flags:"w"})}sendMessage(e,t,n){if(this.level>=e||n?.overrideLevel){const[e,n,...r]=this.toStrings(...t);this.logFile.write(`${e} ${n}`),void 0!==r&&this.logFile.write(`\n${r.join("\n")}`),this.logFile.write("\n\n")}}toStrings(...e){return e.map((e=>{const t="string"==typeof e?e:JSON.stringify(e,null,2);return t&&t.length>1e3?`<trimmed> ${t.slice(0,1e3)}...`:t}))}error(...e){this.sendMessage(mi.MessageType.Error,e)}warn(...e){this.sendMessage(mi.MessageType.Warning,e)}info(...e){this.sendMessage(mi.MessageType.Info,e)}log(...e){this.sendMessage(mi.MessageType.Log,e)}logIgnoringVerbosity(e,...t){this.sendMessage(this.logLevelToLspMessageType(e),t,{overrideLevel:!0})}trace(e,t,n){this.logIgnoringVerbosity(Aa.Log,`[${e} - ${ja()}] ${t}`),n&&this.logIgnoringVerbosity(Aa.Log,Ha(n))}logLevelToLspMessageType(e){switch(e){case Aa.Log:return mi.MessageType.Log;case Aa.Info:return mi.MessageType.Info;case Aa.Warning:return mi.MessageType.Warning;case Aa.Error:return mi.MessageType.Error}}}class La{constructor(e,t){this.logger=e,this.prefix=t}error(...e){this.logger.error(this.prefix,...e)}warn(...e){this.logger.warn(this.prefix,...e)}info(...e){this.logger.info(this.prefix,...e)}log(...e){this.logger.log(this.prefix,...e)}logIgnoringVerbosity(e,...t){this.logger.logIgnoringVerbosity(e,this.prefix,...t)}trace(e,t,n){this.logIgnoringVerbosity(Aa.Log,`[${e} - ${ja()}] ${t}`,n?Ha(n):void 0)}}function ja(){const e=new Date;return`${$a(`${e.getUTCHours()}`,2,"0")}:${$a(`${e.getMinutes()}`,2,"0")}:${$a(`${e.getUTCSeconds()}`,2,"0")}.${e.getMilliseconds()}`}function $a(e,t,n=" "){return n.repeat(Math.max(0,t-e.length))+e}function Ha(e){return e instanceof Error?e.stack||e.message:!1===e.success&&e.message?e.message:e.toString()}const Wa=(e,t,n={})=>{if(!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let r,i,o=[];return function(...s){return new Promise((a=>{const c=n.before&&!i;clearTimeout(i),i=setTimeout((()=>{i=null;const t=n.before?r:e.apply(this,s);for(a of o)a(t);o=[]}),t),c?(r=e.apply(this,s),a(r)):o.push(a)}))}};Wa.promise=e=>{let t;return async function(...n){if(t)return t;try{return t=e.apply(this,n),await t}finally{t=void 0}}};var Va={exports:{}};var Ua={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var Ka="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r}=Ua,i=Ka,o=(t=e.exports={}).re=[],s=t.safeRe=[],a=t.src=[],c=t.t={};let u=0;const l="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",n],[l,r]],d=(e,t,n)=>{const r=(e=>{for(const[t,n]of h)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),l=u++;i(e,l,t),c[e]=l,a[l]=t,o[l]=new RegExp(t,n?"g":void 0),s[l]=new RegExp(r,n?"g":void 0)};d("NUMERICIDENTIFIER","0|[1-9]\\d*"),d("NUMERICIDENTIFIERLOOSE","\\d+"),d("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${l}*`),d("MAINVERSION",`(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})\\.(${a[c.NUMERICIDENTIFIER]})`),d("MAINVERSIONLOOSE",`(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})\\.(${a[c.NUMERICIDENTIFIERLOOSE]})`),d("PRERELEASEIDENTIFIER",`(?:${a[c.NUMERICIDENTIFIER]}|${a[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASEIDENTIFIERLOOSE",`(?:${a[c.NUMERICIDENTIFIERLOOSE]}|${a[c.NONNUMERICIDENTIFIER]})`),d("PRERELEASE",`(?:-(${a[c.PRERELEASEIDENTIFIER]}(?:\\.${a[c.PRERELEASEIDENTIFIER]})*))`),d("PRERELEASELOOSE",`(?:-?(${a[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${a[c.PRERELEASEIDENTIFIERLOOSE]})*))`),d("BUILDIDENTIFIER",`${l}+`),d("BUILD",`(?:\\+(${a[c.BUILDIDENTIFIER]}(?:\\.${a[c.BUILDIDENTIFIER]})*))`),d("FULLPLAIN",`v?${a[c.MAINVERSION]}${a[c.PRERELEASE]}?${a[c.BUILD]}?`),d("FULL",`^${a[c.FULLPLAIN]}$`),d("LOOSEPLAIN",`[v=\\s]*${a[c.MAINVERSIONLOOSE]}${a[c.PRERELEASELOOSE]}?${a[c.BUILD]}?`),d("LOOSE",`^${a[c.LOOSEPLAIN]}$`),d("GTLT","((?:<|>)?=?)"),d("XRANGEIDENTIFIERLOOSE",`${a[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),d("XRANGEIDENTIFIER",`${a[c.NUMERICIDENTIFIER]}|x|X|\\*`),d("XRANGEPLAIN",`[v=\\s]*(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:\\.(${a[c.XRANGEIDENTIFIER]})(?:${a[c.PRERELEASE]})?${a[c.BUILD]}?)?)?`),d("XRANGEPLAINLOOSE",`[v=\\s]*(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${a[c.XRANGEIDENTIFIERLOOSE]})(?:${a[c.PRERELEASELOOSE]})?${a[c.BUILD]}?)?)?`),d("XRANGE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAIN]}$`),d("XRANGELOOSE",`^${a[c.GTLT]}\\s*${a[c.XRANGEPLAINLOOSE]}$`),d("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),d("COERCERTL",a[c.COERCE],!0),d("LONETILDE","(?:~>?)"),d("TILDETRIM",`(\\s*)${a[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",d("TILDE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAIN]}$`),d("TILDELOOSE",`^${a[c.LONETILDE]}${a[c.XRANGEPLAINLOOSE]}$`),d("LONECARET","(?:\\^)"),d("CARETTRIM",`(\\s*)${a[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",d("CARET",`^${a[c.LONECARET]}${a[c.XRANGEPLAIN]}$`),d("CARETLOOSE",`^${a[c.LONECARET]}${a[c.XRANGEPLAINLOOSE]}$`),d("COMPARATORLOOSE",`^${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]})$|^$`),d("COMPARATOR",`^${a[c.GTLT]}\\s*(${a[c.FULLPLAIN]})$|^$`),d("COMPARATORTRIM",`(\\s*)${a[c.GTLT]}\\s*(${a[c.LOOSEPLAIN]}|${a[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",d("HYPHENRANGE",`^\\s*(${a[c.XRANGEPLAIN]})\\s+-\\s+(${a[c.XRANGEPLAIN]})\\s*$`),d("HYPHENRANGELOOSE",`^\\s*(${a[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${a[c.XRANGEPLAINLOOSE]})\\s*$`),d("STAR","(<|>)?=?\\s*\\*"),d("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),d("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Va,Va.exports);var Ga=Va.exports;const za=Object.freeze({loose:!0}),Ba=Object.freeze({});var Ja=e=>e?"object"!=typeof e?za:e:Ba;const Ya=/^[0-9]+$/,Xa=(e,t)=>{const n=Ya.test(e),r=Ya.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var Qa={compareIdentifiers:Xa,rcompareIdentifiers:(e,t)=>Xa(t,e)};const Za=Ka,{MAX_LENGTH:ec,MAX_SAFE_INTEGER:tc}=Ua,{safeRe:nc,t:rc}=Ga,ic=Ja,{compareIdentifiers:oc}=Qa;var sc=class e{constructor(t,n){if(n=ic(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>ec)throw new TypeError(`version is longer than ${ec} characters`);Za("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?nc[rc.LOOSE]:nc[rc.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>tc||this.major<0)throw new TypeError("Invalid major version");if(this.minor>tc||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>tc||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<tc)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Za("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),oc(this.major,t.major)||oc(this.minor,t.minor)||oc(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],r=t.prerelease[n];if(Za("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return oc(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],r=t.build[n];if(Za("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return oc(e,r)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===oc(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const ac=sc;var cc=(e,t,n=!1)=>{if(e instanceof ac)return e;try{return new ac(e,t)}catch(e){if(!n)return null;throw e}};const uc=cc;var lc=(e,t)=>{const n=uc(e,t);return n?n.version:null};const hc=cc;var dc=(e,t)=>{const n=hc(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const pc=sc;var fc=(e,t,n,r,i)=>{"string"==typeof n&&(i=r,r=n,n=void 0);try{return new pc(e instanceof pc?e.version:e,n).inc(t,r,i).version}catch(e){return null}};const mc=cc;var gc=(e,t)=>{const n=mc(e,null,!0),r=mc(t,null,!0),i=n.compare(r);if(0===i)return null;const o=i>0,s=o?n:r,a=o?r:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c)return a.patch||a.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"};const yc=sc;var vc=(e,t)=>new yc(e,t).major;const bc=sc;var Sc=(e,t)=>new bc(e,t).minor;const wc=sc;var Rc=(e,t)=>new wc(e,t).patch;const Ec=cc;var Cc=(e,t)=>{const n=Ec(e,t);return n&&n.prerelease.length?n.prerelease:null};const _c=sc;var Dc=(e,t,n)=>new _c(e,n).compare(new _c(t,n));const Tc=Dc;var kc=(e,t,n)=>Tc(t,e,n);const xc=Dc;var Pc=(e,t)=>xc(e,t,!0);const Oc=sc;var Nc=(e,t,n)=>{const r=new Oc(e,n),i=new Oc(t,n);return r.compare(i)||r.compareBuild(i)};const qc=Nc;var Ic=(e,t)=>e.sort(((e,n)=>qc(e,n,t)));const Ac=Nc;var Mc=(e,t)=>e.sort(((e,n)=>Ac(n,e,t)));const Fc=Dc;var Lc=(e,t,n)=>Fc(e,t,n)>0;const jc=Dc;var $c=(e,t,n)=>jc(e,t,n)<0;const Hc=Dc;var Wc=(e,t,n)=>0===Hc(e,t,n);const Vc=Dc;var Uc=(e,t,n)=>0!==Vc(e,t,n);const Kc=Dc;var Gc=(e,t,n)=>Kc(e,t,n)>=0;const zc=Dc;var Bc=(e,t,n)=>zc(e,t,n)<=0;const Jc=Wc,Yc=Uc,Xc=Lc,Qc=Gc,Zc=$c,eu=Bc;var tu=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Jc(e,n,r);case"!=":return Yc(e,n,r);case">":return Xc(e,n,r);case">=":return Qc(e,n,r);case"<":return Zc(e,n,r);case"<=":return eu(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const nu=sc,ru=cc,{safeRe:iu,t:ou}=Ga;var su,au,cu,uu,lu,hu,du,pu,fu,mu,gu=(e,t)=>{if(e instanceof nu)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=iu[ou.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),iu[ou.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;iu[ou.COERCERTL].lastIndex=-1}else n=e.match(iu[ou.COERCE]);return null===n?null:ru(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function yu(){if(uu)return cu;function e(t){var n=this;if(n instanceof e||(n=new e),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){n.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)n.push(arguments[r]);return n}function t(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function n(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function r(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}uu=1,cu=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},e.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},e.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},e.prototype.map=function(t,n){n=n||this;for(var r=new e,i=this.head;null!==i;)r.push(t.call(n,i.value,this)),i=i.next;return r},e.prototype.mapReverse=function(t,n){n=n||this;for(var r=new e,i=this.tail;null!==i;)r.push(t.call(n,i.value,this)),i=i.prev;return r},e.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},e.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},e.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<n;i++,o=o.next)r.push(o.value);return r},e.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=this.length,o=this.tail;null!==o&&i>n;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},e.prototype.splice=function(e,n,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;var s=[];for(i=0;o&&i<n;i++)s.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(i=0;i<r.length;i++)o=t(this,o,r[i]);return s},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{(au?su:(au=1,su=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return cu}function vu(){if(pu)return du;pu=1;class e{constructor(t,n){if(n=r(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!f(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,m=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,T(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],u),o("comparator trim",e),e=e.replace(a[c.TILDETRIM],l),o("tilde trim",e),e=e.replace(a[c.CARETTRIM],h),o("caret trim",e);let g=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>D(e,this.options)));s&&(g=g.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",g);const v=new Map,b=g.map((e=>new i(e,this.options)));for(const e of b){if(f(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const S=[...v.values()];return n.set(t,S),S}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(k(this.set[t],e,this.options))return!0;return!1}}du=e;const t=function(){if(hu)return lu;hu=1;const e=yu(),t=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),i=Symbol("allowStale"),o=Symbol("maxAge"),s=Symbol("dispose"),a=Symbol("noDisposeOnSet"),c=Symbol("lruList"),u=Symbol("cache"),l=Symbol("updateAgeOnGet"),h=()=>1,d=(e,t,n)=>{const r=e[u].get(t);if(r){const t=r.value;if(p(e,t)){if(m(e,r),!e[i])return}else n&&(e[l]&&(r.value.now=Date.now()),e[c].unshiftNode(r));return t.value}},p=(e,t)=>{if(!t||!t.maxAge&&!e[o])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[o]&&n>e[o]},f=e=>{if(e[n]>e[t])for(let r=e[c].tail;e[n]>e[t]&&null!==r;){const t=r.prev;m(e,r),r=t}},m=(e,t)=>{if(t){const r=t.value;e[s]&&e[s](r.key,r.value),e[n]-=r.length,e[u].delete(r.key),e[c].removeNode(t)}};class g{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const y=(e,t,n,r)=>{let o=n.value;p(e,o)&&(m(e,n),e[i]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};return lu=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const n=e.length||h;if(this[r]="function"!=typeof n?h:n,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[o]=e.maxAge||0,this[s]=e.dispose,this[a]=e.noDisposeOnSet||!1,this[l]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,f(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[o]=e,f(this)}get maxAge(){return this[o]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[r]&&(this[r]=e,this[n]=0,this[c].forEach((e=>{e.length=this[r](e.value,e.key),this[n]+=e.length}))),f(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[c].length}rforEach(e,t){t=t||this;for(let n=this[c].tail;null!==n;){const r=n.prev;y(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[c].head;null!==n;){const r=n.next;y(this,e,n,t),n=r}}keys(){return this[c].toArray().map((e=>e.key))}values(){return this[c].toArray().map((e=>e.value))}reset(){this[s]&&this[c]&&this[c].length&&this[c].forEach((e=>this[s](e.key,e.value))),this[u]=new Map,this[c]=new e,this[n]=0}dump(){return this[c].map((e=>!p(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[c]}set(e,i,l){if((l=l||this[o])&&"number"!=typeof l)throw new TypeError("maxAge must be a number");const h=l?Date.now():0,d=this[r](i,e);if(this[u].has(e)){if(d>this[t])return m(this,this[u].get(e)),!1;const r=this[u].get(e).value;return this[s]&&(this[a]||this[s](e,r.value)),r.now=h,r.maxAge=l,r.value=i,this[n]+=d-r.length,r.length=d,this.get(e),f(this),!0}const p=new g(e,i,d,h,l);return p.length>this[t]?(this[s]&&this[s](e,i),!1):(this[n]+=p.length,this[c].unshift(p),this[u].set(e,this[c].head),f(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!p(this,t)}get(e){return d(this,e,!0)}peek(e){return d(this,e,!1)}pop(){const e=this[c].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[u].forEach(((e,t)=>d(this,t,!1)))}},lu}(),n=new t({max:1e3}),r=Ja,i=bu(),o=Ka,s=sc,{safeRe:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=Ga,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:p}=Ua,f=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},y=(e,t)=>(o("comp",e,t),e=w(e,t),o("caret",e),e=b(e,t),o("tildes",e),e=E(e,t),o("xrange",e),e=_(e,t),o("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},w=(e,t)=>e.trim().split(/\s+/).map((e=>R(e,t))).join(" "),R=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),v(n)?c="":v(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},E=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>C(e,t))).join(" ")),C=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const u=v(i),l=u||v(s),h=l||v(a),d=h;return"="===r&&d&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(l&&(s=0),a=0,">"===r?(r=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:h&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},_=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),D=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),T=e=>(t,n,r,i,o,s,a,c,u,l,h,d,p)=>`${n=v(r)?"":v(i)?`>=${r}.0.0${e?"-0":""}`:v(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=v(u)?"":v(l)?`<${+u+1}.0.0-0`:v(h)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${h}-${d}`:e?`<${u}.${l}.${+h+1}-0`:`<=${c}`}`.trim(),k=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return du}function bu(){if(mu)return fu;mu=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}fu=t;const n=Ja,{safeRe:r,t:i}=Ga,o=tu,s=Ka,a=sc,c=vu();return fu}const Su=vu();var wu=(e,t,n)=>{try{t=new Su(t,n)}catch(e){return!1}return t.test(e)};const Ru=vu();var Eu=(e,t)=>new Ru(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Cu=sc,_u=vu();var Du=(e,t,n)=>{let r=null,i=null,o=null;try{o=new _u(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new Cu(r,n)))})),r};const Tu=sc,ku=vu();var xu=(e,t,n)=>{let r=null,i=null,o=null;try{o=new ku(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&1!==i.compare(e)||(r=e,i=new Tu(r,n)))})),r};const Pu=sc,Ou=vu(),Nu=Lc;var qu=(e,t)=>{e=new Ou(e,t);let n=new Pu("0.0.0");if(e.test(n))return n;if(n=new Pu("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new Pu(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Nu(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!Nu(n,i)||(n=i)}return n&&e.test(n)?n:null};const Iu=vu();var Au=(e,t)=>{try{return new Iu(e,t).range||"*"}catch(e){return null}};const Mu=sc,Fu=bu(),{ANY:Lu}=Fu,ju=vu(),$u=wu,Hu=Lc,Wu=$c,Vu=Bc,Uu=Gc;var Ku=(e,t,n,r)=>{let i,o,s,a,c;switch(e=new Mu(e,r),t=new ju(t,r),n){case">":i=Hu,o=Vu,s=Wu,a=">",c=">=";break;case"<":i=Wu,o=Uu,s=Hu,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if($u(e,t,r))return!1;for(let n=0;n<t.set.length;++n){const u=t.set[n];let l=null,h=null;if(u.forEach((e=>{e.semver===Lu&&(e=new Fu(">=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,r)?l=e:s(e.semver,h.semver,r)&&(h=e)})),l.operator===a||l.operator===c)return!1;if((!h.operator||h.operator===a)&&o(e,h.semver))return!1;if(h.operator===c&&s(e,h.semver))return!1}return!0};const Gu=Ku;var zu=(e,t,n)=>Gu(e,t,">",n);const Bu=Ku;var Ju=(e,t,n)=>Bu(e,t,"<",n);const Yu=vu();var Xu=(e,t,n)=>(e=new Yu(e,n),t=new Yu(t,n),e.intersects(t,n));const Qu=wu,Zu=Dc;const el=vu(),tl=bu(),{ANY:nl}=tl,rl=wu,il=Dc,ol=[new tl(">=0.0.0-0")],sl=[new tl(">=0.0.0")],al=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===nl){if(1===t.length&&t[0].semver===nl)return!0;e=n.includePrerelease?ol:sl}if(1===t.length&&t[0].semver===nl){if(n.includePrerelease)return!0;t=sl}const r=new Set;let i,o,s,a,c,u,l;for(const t of e)">"===t.operator||">="===t.operator?i=cl(i,t,n):"<"===t.operator||"<="===t.operator?o=ul(o,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&o){if(s=il(i.semver,o.semver,n),s>0)return null;if(0===s&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of r){if(i&&!rl(e,String(i),n))return null;if(o&&!rl(e,String(o),n))return null;for(const r of t)if(!rl(e,String(r),n))return!1;return!0}let h=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,d=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;h&&1===h.prerelease.length&&"<"===o.operator&&0===h.prerelease[0]&&(h=!1);for(const e of t){if(l=l||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),">"===e.operator||">="===e.operator){if(a=cl(i,e,n),a===e&&a!==i)return!1}else if(">="===i.operator&&!rl(i.semver,String(e),n))return!1;if(o)if(h&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===h.major&&e.semver.minor===h.minor&&e.semver.patch===h.patch&&(h=!1),"<"===e.operator||"<="===e.operator){if(c=ul(o,e,n),c===e&&c!==o)return!1}else if("<="===o.operator&&!rl(o.semver,String(e),n))return!1;if(!e.operator&&(o||i)&&0!==s)return!1}return!(i&&u&&!o&&0!==s)&&(!(o&&l&&!i&&0!==s)&&(!d&&!h))},cl=(e,t,n)=>{if(!e)return t;const r=il(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},ul=(e,t,n)=>{if(!e)return t;const r=il(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var ll=(e,t,n={})=>{if(e===t)return!0;e=new el(e,n),t=new el(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=al(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const hl=Ga,dl=Ua,pl=sc,fl=Qa,ml=(e,t,n)=>{const r=[];let i=null,o=null;const s=e.sort(((e,t)=>Zu(e,t,n)));for(const e of s){Qu(e,t,n)?(o=e,i||(i=e)):(o&&r.push([i,o]),o=null,i=null)}i&&r.push([i,null]);const a=[];for(const[e,t]of r)e===t?a.push(e):t||e!==s[0]?t?e===s[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return c.length<u.length?c:t};const gl=k({parse:cc,valid:lc,clean:dc,inc:fc,diff:gc,major:vc,minor:Sc,patch:Rc,prerelease:Cc,compare:Dc,rcompare:kc,compareLoose:Pc,compareBuild:Nc,sort:Ic,rsort:Mc,gt:Lc,lt:$c,eq:Wc,neq:Uc,gte:Gc,lte:Bc,cmp:tu,coerce:gu,Comparator:bu(),Range:vu(),satisfies:wu,toComparators:Eu,maxSatisfying:Du,minSatisfying:xu,minVersion:qu,validRange:Au,outside:Ku,gtr:zu,ltr:Ju,intersects:Xu,simplifyRange:ml,subset:ll,SemVer:pl,re:hl.re,src:hl.src,tokens:hl.t,SEMVER_SPEC_VERSION:dl.SEMVER_SPEC_VERSION,RELEASE_TYPES:dl.RELEASE_TYPES,compareIdentifiers:fl.compareIdentifiers,rcompareIdentifiers:fl.rcompareIdentifiers});class yl{static fromSimpleString(e){return new yl(e,e,e)}static fromVersionString(e){let t=gl.valid(e);if(!t)return new yl("invalid version","1.0.0","1.0.0");const n=e.indexOf("-");return n>=0&&(t=t.substr(0,n)),new yl(e,t,e)}constructor(e,t,n){this.displayName=e,this.version=t,this.fullVersionString=n}eq(e){return gl.eq(this.version,e.version)}gte(e){return gl.gte(this.version,e.version)}lt(e){return!this.gte(e)}}var vl,bl,Sl,wl,Rl,El,Cl,_l,Dl,Tl,kl,xl;yl.defaultVersion=yl.fromSimpleString("1.0.0"),yl.v240=yl.fromSimpleString("2.4.0"),yl.v250=yl.fromSimpleString("2.5.0"),yl.v260=yl.fromSimpleString("2.6.0"),yl.v270=yl.fromSimpleString("2.7.0"),yl.v280=yl.fromSimpleString("2.8.0"),yl.v290=yl.fromSimpleString("2.9.0"),yl.v291=yl.fromSimpleString("2.9.1"),yl.v300=yl.fromSimpleString("3.0.0"),yl.v310=yl.fromSimpleString("3.1.0"),yl.v314=yl.fromSimpleString("3.1.4"),yl.v320=yl.fromSimpleString("3.2.0"),yl.v333=yl.fromSimpleString("3.3.3"),yl.v340=yl.fromSimpleString("3.4.0"),yl.v345=yl.fromSimpleString("3.4.5"),yl.v350=yl.fromSimpleString("3.5.0"),yl.v380=yl.fromSimpleString("3.8.0"),yl.v381=yl.fromSimpleString("3.8.1"),yl.v390=yl.fromSimpleString("3.9.0"),yl.v400=yl.fromSimpleString("4.0.0"),yl.v401=yl.fromSimpleString("4.0.1"),yl.v420=yl.fromSimpleString("4.2.0"),yl.v430=yl.fromSimpleString("4.3.0"),yl.v440=yl.fromSimpleString("4.4.0"),yl.v460=yl.fromSimpleString("4.6.0"),yl.v470=yl.fromSimpleString("4.7.0"),yl.v480=yl.fromSimpleString("4.8.0"),yl.v490=yl.fromSimpleString("4.9.0"),yl.v510=yl.fromSimpleString("5.1.0"),function(e){e.type=new yr.RequestType("_typescript.rename")}(vl||(vl={})),function(e){e.JsxClosingTag="jsxClosingTag",e.LinkedEditingRange="linkedEditingRange",e.Brace="brace",e.BraceCompletion="braceCompletion",e.GetSpanOfEnclosingComment="getSpanOfEnclosingComment",e.Change="change",e.Close="close",e.Completions="completions",e.CompletionEntryDetails="completionEntryDetails",e.CompletionInfo="completionInfo",e.CompletionDetails="completionEntryDetails",e.CompileOnSaveAffectedFileList="compileOnSaveAffectedFileList",e.CompileOnSaveEmitFile="compileOnSaveEmitFile",e.Configure="configure",e.Definition="definition",e.DefinitionAndBoundSpan="definitionAndBoundSpan",e.EncodedSemanticClassificationsFull="encodedSemanticClassifications-full",e.Implementation="implementation",e.Exit="exit",e.FileReferences="fileReferences",e.Format="format",e.Formatonkey="formatonkey",e.Geterr="geterr",e.GeterrForProject="geterrForProject",e.SemanticDiagnosticsSync="semanticDiagnosticsSync",e.SyntacticDiagnosticsSync="syntacticDiagnosticsSync",e.SuggestionDiagnosticsSync="suggestionDiagnosticsSync",e.NavBar="navbar",e.Navto="navto",e.NavTree="navtree",e.NavTreeFull="navtree-full",e.Occurrences="occurrences",e.DocumentHighlights="documentHighlights",e.Open="open",e.Quickinfo="quickinfo",e.References="references",e.Reload="reload",e.Rename="rename",e.Saveto="saveto",e.SignatureHelp="signatureHelp",e.FindSourceDefinition="findSourceDefinition",e.Status="status",e.TypeDefinition="typeDefinition",e.ProjectInfo="projectInfo",e.ReloadProjects="reloadProjects",e.Unknown="unknown",e.OpenExternalProject="openExternalProject",e.OpenExternalProjects="openExternalProjects",e.CloseExternalProject="closeExternalProject",e.UpdateOpen="updateOpen",e.GetOutliningSpans="getOutliningSpans",e.TodoComments="todoComments",e.Indentation="indentation",e.DocCommentTemplate="docCommentTemplate",e.CompilerOptionsForInferredProjects="compilerOptionsForInferredProjects",e.GetCodeFixes="getCodeFixes",e.GetCombinedCodeFix="getCombinedCodeFix",e.ApplyCodeActionCommand="applyCodeActionCommand",e.GetSupportedCodeFixes="getSupportedCodeFixes",e.GetApplicableRefactors="getApplicableRefactors",e.GetEditsForRefactor="getEditsForRefactor",e.OrganizeImports="organizeImports",e.GetEditsForFileRename="getEditsForFileRename",e.ConfigurePlugin="configurePlugin",e.SelectionRange="selectionRange",e.ToggleLineComment="toggleLineComment",e.ToggleMultilineComment="toggleMultilineComment",e.CommentSelection="commentSelection",e.UncommentSelection="uncommentSelection",e.PrepareCallHierarchy="prepareCallHierarchy",e.ProvideCallHierarchyIncomingCalls="provideCallHierarchyIncomingCalls",e.ProvideCallHierarchyOutgoingCalls="provideCallHierarchyOutgoingCalls",e.ProvideInlayHints="provideInlayHints"}(bl||(bl={})),function(e){e.none="none",e.definition="definition",e.reference="reference",e.writtenReference="writtenReference"}(Sl||(Sl={})),function(e){e.None="None",e.Preserve="Preserve",e.ReactNative="ReactNative",e.React="React"}(wl||(wl={})),function(e){e.None="None",e.CommonJS="CommonJS",e.AMD="AMD",e.UMD="UMD",e.System="System",e.ES6="ES6",e.ES2015="ES2015",e.ESNext="ESNext"}(Rl||(Rl={})),function(e){e.Classic="Classic",e.Node="Node"}(El||(El={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove"}(Cl||(Cl={})),function(e){e.unknown="",e.warning="warning",e.keyword="keyword",e.scriptElement="script",e.moduleElement="module",e.classElement="class",e.localClassElement="local class",e.interfaceElement="interface",e.typeElement="type",e.enumElement="enum",e.enumMemberElement="enum member",e.variableElement="var",e.localVariableElement="local var",e.functionElement="function",e.localFunctionElement="local function",e.memberFunctionElement="method",e.memberGetAccessorElement="getter",e.memberSetAccessorElement="setter",e.memberVariableElement="property",e.memberAccessorVariableElement="accessor",e.constructorImplementationElement="constructor",e.callSignatureElement="call",e.indexSignatureElement="index",e.constructSignatureElement="construct",e.parameterElement="parameter",e.typeParameterElement="type parameter",e.primitiveType="primitive type",e.label="label",e.alias="alias",e.constElement="const",e.letElement="let",e.directory="directory",e.externalModuleName="external module name",e.jsxAttribute="JSX attribute",e.string="string",e.link="link",e.linkName="link name",e.linkText="link text"}(_l||(_l={})),function(e){e.none="",e.publicMemberModifier="public",e.privateMemberModifier="private",e.protectedMemberModifier="protected",e.exportedModifier="export",e.ambientModifier="declare",e.staticModifier="static",e.abstractModifier="abstract",e.optionalModifier="optional",e.deprecatedModifier="deprecated",e.dtsModifier=".d.ts",e.tsModifier=".ts",e.tsxModifier=".tsx",e.jsModifier=".js",e.jsxModifier=".jsx",e.jsonModifier=".json",e.dmtsModifier=".d.mts",e.mtsModifier=".mts",e.mjsModifier=".mjs",e.dctsModifier=".d.cts",e.ctsModifier=".cts",e.cjsModifier=".cjs"}(Dl||(Dl={})),function(e){e.ES3="ES3",e.ES5="ES5",e.ES6="ES6",e.ES2015="ES2015",e.ES2016="ES2016",e.ES2017="ES2017",e.ES2018="ES2018",e.ES2019="ES2019",e.ES2020="ES2020",e.ES2021="ES2021",e.ES2022="ES2022",e.ESNext="ESNext"}(Tl||(Tl={})),function(e){e[e.aliasName=0]="aliasName",e[e.className=1]="className",e[e.enumName=2]="enumName",e[e.fieldName=3]="fieldName",e[e.interfaceName=4]="interfaceName",e[e.keyword=5]="keyword",e[e.lineBreak=6]="lineBreak",e[e.numericLiteral=7]="numericLiteral",e[e.stringLiteral=8]="stringLiteral",e[e.localName=9]="localName",e[e.methodName=10]="methodName",e[e.moduleName=11]="moduleName",e[e.operator=12]="operator",e[e.parameterName=13]="parameterName",e[e.propertyName=14]="propertyName",e[e.punctuation=15]="punctuation",e[e.space=16]="space",e[e.text=17]="text",e[e.typeParameterName=18]="typeParameterName",e[e.enumMemberName=19]="enumMemberName",e[e.functionName=20]="functionName",e[e.regularExpressionLiteral=21]="regularExpressionLiteral",e[e.link=22]="link",e[e.linkName=23]="linkName",e[e.linkText=24]="linkText"}(kl||(kl={})),function(e){e.All="All",e.SortAndCombine="SortAndCombine",e.RemoveUnused="RemoveUnused"}(xl||(xl={}));class Pl{}Pl.optional="optional",Pl.deprecated="deprecated",Pl.dtsFile=".d.ts",Pl.tsFile=".ts",Pl.tsxFile=".tsx",Pl.jsFile=".js",Pl.jsxFile=".jsx",Pl.jsonFile=".json",Pl.fileExtensionKindModifiers=[Pl.dtsFile,Pl.tsFile,Pl.tsxFile,Pl.jsFile,Pl.jsxFile,Pl.jsonFile];const Ol={aliasName:0,className:1,enumName:2,fieldName:3,interfaceName:4,keyword:5,lineBreak:6,numericLiteral:7,stringLiteral:8,localName:9,methodName:10,moduleName:11,operator:12,parameterName:13,propertyName:14,punctuation:15,space:16,text:17,typeParameterName:18,enumMemberName:19,functionName:20,regularExpressionLiteral:21,link:22,linkName:23,linkText:24};function Nl(e){return Ol[e]}var ql,Il,Al;!function(e){e.Syntax="syntax",e.Semantic="semantic"}(ql||(ql={})),function(e){e.Cancelled=class{constructor(e){this.reason=e,this.type="cancelled"}},e.NoContent={type:"noContent"},e.NoServer={type:"noServer"}}(Il||(Il={})),function(e){e[e.Syntax=0]="Syntax",e[e.EnhancedSyntax=1]="EnhancedSyntax",e[e.Semantic=2]="Semantic"}(Al||(Al={}));class Ml{constructor(...e){this.capabilities=new Set(e)}has(e){return this.capabilities.has(e)}}class Fl extends Error{static create(e,t,n){const r=Fl.parseErrorText(n);return new Fl(e,t,n,r?.message,r?.stack)}constructor(e,t,n,r,i){super(`<${e}> TypeScript Server Error (${t.versionString})\n${r}\n${i}`),this.serverId=e,this.version=t,this.response=n,this.serverMessage=r,this.serverStack=i}get serverErrorText(){return this.response.message}get serverCommand(){return this.response.command}static parseErrorText(e){const t=e.message;if(t){const e="Error processing request. ";if(t.startsWith(e)){const n=t.substr(e.length),r=n.indexOf("\n");if(r>=0){const e=n.substring(r+1);return{message:n.substring(0,r),stack:e}}}}}}const Ll=l(d.randomBytes),jl="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),$l="0123456789".split(""),Hl="CDEHKMPRTUWXY012458".split(""),Wl="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),Vl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Ul=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),Kl=(e,t)=>({length:n,type:r,characters:i})=>{if(!(n>=0&&Number.isFinite(n)))throw new TypeError("Expected a `length` to be a non-negative finite number");if(void 0!==r&&void 0!==i)throw new TypeError("Expected either `type` or `characters`");if(void 0!==i&&"string"!=typeof i)throw new TypeError("Expected `characters` to be string");if(!Ul.has(r))throw new TypeError(`Unknown type: ${r}`);if(void 0===r&&void 0===i&&(r="hex"),"hex"===r||void 0===r&&void 0===i)return t(Math.ceil(.5*n),"hex",n);if("base64"===r)return t(Math.ceil(.75*n),"base64",n);if("url-safe"===r)return e(n,jl);if("numeric"===r)return e(n,$l);if("distinguishable"===r)return e(n,Hl);if("ascii-printable"===r)return e(n,Wl);if("alphanumeric"===r)return e(n,Vl);if(0===i.length)throw new TypeError("Expected `characters` string length to be greater than or equal to 1");if(i.length>65536)throw new TypeError("Expected `characters` string length to be less or equal to 65536");return e(n,i.split(""))},Gl=Kl(((e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=d.randomBytes(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),((e,t,n)=>d.randomBytes(e).toString(t).slice(0,n)));Gl.async=Kl((async(e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=await Ll(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),(async(e,t,n)=>(await Ll(e)).toString(t).slice(0,n)));const zl=a,Bl=h,Jl=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");T[Jl]||Object.defineProperty(T,Jl,{value:zl.realpathSync(Bl.tmpdir())});const Yl=k(T[Jl]);R(w.pipeline);const Xl=(e="")=>b.join(Yl,e+Gl({length:32}));function Ql({name:t,extension:n}={}){if(t){if(null!=n)throw new Error("The `name` and `extension` options are mutually exclusive");return b.join(function({prefix:t=""}={}){const n=Xl(t);return e.mkdirSync(n),n}(),t)}return Xl()+(null==n?"":"."+n.replace(/^\./,""))}class Zl{constructor(e,t){this._serverId=e,this._tracer=t,this.cancellationPipeName=Ql({name:"tscancellation"})}tryCancelOngoingRequest(t){if(!this.cancellationPipeName)return!1;this._tracer.logTrace(this._serverId,`TypeScript Server: trying to cancel ongoing request with sequence number ${t}`);try{e.writeFileSync(this.cancellationPipeName+String(t),"")}catch{}return!0}}const eh=new class{create(e,t){return new Zl(e,t)}};var th,nh,rh;!function(e){e[e.Normal=1]="Normal",e[e.LowPriority=2]="LowPriority",e[e.Fence=3]="Fence"}(th||(th={}));class ih{constructor(){this.queue=[],this.sequenceNumber=0}get length(){return this.queue.length}enqueue(e){if(e.queueingType===th.Normal){let t=this.queue.length-1;for(;t>=0&&this.queue[t].queueingType===th.LowPriority;)--t;this.queue.splice(t+1,0,e)}else this.queue.push(e)}dequeue(){return this.queue.shift()}tryDeletePendingRequest(e){for(let t=0;t<this.queue.length;t++)if(this.queue[t].request.seq===e)return this.queue.splice(t,1),!0;return!1}createRequest(e,t){return{seq:this.sequenceNumber++,type:"request",command:e,arguments:t}}}class oh{constructor(){this._callbacks=new Map,this._asyncCallbacks=new Map}destroy(e){const t=new Il.Cancelled(e);for(const e of this._callbacks.values())e.onSuccess(t);this._callbacks.clear();for(const e of this._asyncCallbacks.values())e.onSuccess(t);this._asyncCallbacks.clear()}add(e,t,n){n?this._asyncCallbacks.set(e,t):this._callbacks.set(e,t)}fetch(e){const t=this._callbacks.get(e)||this._asyncCallbacks.get(e);return this.delete(e),t}delete(e){this._callbacks.delete(e)||this._asyncCallbacks.delete(e)}}!function(e){e[e.Semantic=0]="Semantic",e[e.Syntax=1]="Syntax"}(nh||(nh={}));class sh{constructor(e,t,n,r,i,o,s){this._serverId=e,this._serverSource=t,this._process=n,this._tsServerLogFile=r,this._requestCanceller=i,this._version=o,this._tracer=s,this._requestQueue=new ih,this._callbacks=new oh,this._pendingResponses=new Set,this._eventHandlers=new Set,this._exitHandlers=new Set,this._errorHandlers=new Set,this._stdErrHandlers=new Set,this._process.onData((e=>{this.dispatchMessage(e)})),this._process.onStdErr((e=>{this._stdErrHandlers.forEach((t=>t(e)))})),this._process.onExit(((e,t)=>{this._exitHandlers.forEach((n=>n({code:e,signal:t}))),this._callbacks.destroy("server exited")})),this._process.onError((e=>{this._errorHandlers.forEach((t=>t(e))),this._callbacks.destroy("server errored")}))}onEvent(e){this._eventHandlers.add(e)}onExit(e){this._exitHandlers.add(e)}onStdErr(e){this._stdErrHandlers.add(e)}onError(e){this._errorHandlers.add(e)}get tsServerLogFile(){return this._tsServerLogFile}write(e){this._process.write(e)}dispose(){this._callbacks.destroy("server disposed"),this._pendingResponses.clear(),this._eventHandlers.clear(),this._exitHandlers.clear(),this._errorHandlers.clear()}kill(){this.dispose(),this._process.kill()}dispatchMessage(e){try{switch(e.type){case"response":this._serverSource?this.dispatchResponse({...e}):this.dispatchResponse(e);break;case"event":{const t=e;if("requestCompleted"===t.event){const e=t.body.request_seq,n=this._callbacks.fetch(e);n&&(this._tracer.traceRequestCompleted(this._serverId,"requestCompleted",e,n),n.onSuccess(void 0))}else this._tracer.traceEvent(this._serverId,t),this._eventHandlers.forEach((e=>e(t)));break}default:throw new Error(`Unknown message type ${e.type} received`)}}finally{this.sendNextRequests()}}tryCancelRequest(e,t){try{return this._requestQueue.tryDeletePendingRequest(e)?(this.logTrace(`Canceled request with sequence number ${e}`),!0):!!this._requestCanceller.tryCancelOngoingRequest(e)||(this.logTrace(`Tried to cancel request with sequence number ${e}. But request got already delivered.`),!1)}finally{const n=this.fetchCallback(e);n?.onSuccess(new Il.Cancelled(`Cancelled request ${e} - ${t}`))}}dispatchResponse(e){const t=this.fetchCallback(e.request_seq);t&&(this._tracer.traceResponse(this._serverId,e,t),e.success?t.onSuccess(e):"No content available."===e.message?t.onSuccess(Il.NoContent):t.onError(Fl.create(this._serverId,this._version,e)))}executeImpl(e,t,n){const r=this._requestQueue.createRequest(e,t),i={request:r,expectsResponse:n.expectsResult,isAsync:n.isAsync,queueingType:sh.getQueueingType(e,n.lowPriority)};let o;return n.expectsResult&&(o=new Promise(((t,i)=>{this._callbacks.add(r.seq,{onSuccess:t,onError:i,queuingStartTime:Date.now(),isAsync:n.isAsync},n.isAsync),n.token&&n.token.onCancellationRequested((()=>{this.tryCancelRequest(r.seq,e)}))}))),this._requestQueue.enqueue(i),this.sendNextRequests(),[o]}sendNextRequests(){for(;0===this._pendingResponses.size&&this._requestQueue.length>0;){const e=this._requestQueue.dequeue();e&&this.sendRequest(e)}}sendRequest(e){const t=e.request;this._tracer.traceRequest(this._serverId,t,e.expectsResponse,this._requestQueue.length),e.expectsResponse&&!e.isAsync&&this._pendingResponses.add(e.request.seq);try{this.write(t)}catch(e){const n=this.fetchCallback(t.seq);n?.onError(e)}}fetchCallback(e){const t=this._callbacks.fetch(e);if(t)return this._pendingResponses.delete(e),t}logTrace(e){this._tracer.logTrace(this._serverId,e)}static getQueueingType(e,t){return sh.fenceCommands.has(e)?th.Fence:t?th.LowPriority:th.Normal}}sh.fenceCommands=new Set(["change","close","open","updateOpen"]);class ah{constructor(e,t){this.servers=e,this.delegate=t}execute(e,t,n){if(ah.sharedCommands.has(e)&&void 0===n.executionTarget){const r=this.servers.map((()=>rh.Unresolved));let i;if(n.token){const e=new ye.CancellationTokenSource;n.token.onCancellationRequested((()=>{r.some((e=>e===rh.Resolved))||e.cancel()})),i=e.token}const o=[];for(let s=0;s<this.servers.length;++s){const a=this.servers[s].server.executeImpl(e,t,{...n,token:i})[0];o.push(a),a&&a.then((t=>{r[s]=rh.Resolved;const n=r.find((e=>2===e.type));return n&&this.delegate.onFatalError(e,n.err),t}),(t=>{throw r[s]=new rh.Errored(t),r.some((e=>e===rh.Resolved))&&this.delegate.onFatalError(e,t),t}))}return o}for(const{canRun:r,server:i}of this.servers)if(!r||r(e,n))return i.executeImpl(e,t,n);throw new Error(`Could not find server for command: '${e}'`)}}ah.sharedCommands=new Set([bl.Change,bl.Close,bl.Open,bl.UpdateOpen,bl.Configure]);class ch{constructor(e,t,n){this._projectLoading=!0,this._eventHandlers=new Set,this._exitHandlers=new Set,this._errorHandlers=new Set,this.syntaxServer=e.syntax,this.semanticServer=e.semantic,this.router=new ah([{server:this.syntaxServer,canRun:(e,t)=>{switch(t.executionTarget){case nh.Semantic:return!1;case nh.Syntax:return!0}return!!ch.syntaxAlwaysCommands.has(e)||!ch.semanticCommands.has(e)&&!!(n&&this.projectLoading&&ch.syntaxAllowedCommands.has(e))}},{server:this.semanticServer,canRun:void 0}],t),this.syntaxServer.onEvent((e=>{this._eventHandlers.forEach((t=>t(e)))})),this.semanticServer.onEvent((e=>{switch(e.event){case"projectLoadingStart":this._projectLoading=!0;break;case"projectLoadingFinish":case"semanticDiag":case"syntaxDiag":case"suggestionDiag":case"configFileDiag":this._projectLoading=!1}this._eventHandlers.forEach((t=>t(e)))})),this.semanticServer.onExit((e=>{this._exitHandlers.forEach((t=>t(e))),this.syntaxServer.kill()})),this.semanticServer.onError((e=>this._errorHandlers.forEach((t=>t(e)))))}get projectLoading(){return this._projectLoading}dispose(){this._eventHandlers.clear(),this._exitHandlers.clear(),this._errorHandlers.clear()}onEvent(e){this._eventHandlers.add(e)}onExit(e){this._exitHandlers.add(e)}onError(e){this._errorHandlers.add(e)}onStdErr(e){}get tsServerLogFile(){return this.semanticServer.tsServerLogFile}kill(){this.dispose(),this.syntaxServer.kill(),this.semanticServer.kill()}executeImpl(e,t,n){return this.router.execute(e,t,n)}}ch.syntaxAlwaysCommands=new Set([bl.NavTree,bl.GetOutliningSpans,bl.JsxClosingTag,bl.SelectionRange,bl.Format,bl.Formatonkey,bl.DocCommentTemplate]),ch.semanticCommands=new Set([bl.Geterr,bl.GeterrForProject,bl.ProjectInfo,bl.ConfigurePlugin]),ch.syntaxAllowedCommands=new Set([bl.CompletionEntryDetails,bl.CompletionInfo,bl.Definition,bl.DefinitionAndBoundSpan,bl.DocumentHighlights,bl.Implementation,bl.Navto,bl.Quickinfo,bl.References,bl.Rename,bl.SignatureHelp]),function(e){e.Unresolved={type:0},e.Resolved={type:1};e.Errored=class{constructor(e){this.err=e,this.type=2}}}(rh||(rh={}));class uh{fork(e,t,n,r){const i=e.tsServerPath,o=e.version?.gte(yl.v490),s=[...t];o&&s.push("--useNodeIpc");const a=E.fork(i,s,{silent:!0,cwd:void 0,env:lh(process.env,i),execArgv:hh(n,r),stdio:o?["pipe","pipe","pipe","ipc"]:void 0});return o?new ph(a):new fh(a)}}function lh(e,t){const n=Object.assign({},e);return n.NODE_PATH=b.join(t,"..","..",".."),n.PATH=n.PATH||process.env.PATH,n}function hh(e,t){const n=[],r=function(e){if("syntax"===e)return;const t=dh()||process.env.TSS_DEBUG;if(t){const e=parseInt(t);if(!isNaN(e))return e}return}(e);if(r){const e=dh()?"--inspect-brk":"--inspect";n.push(`${e}=${r}`)}return t.maxTsServerMemory&&n.push(`--max-old-space-size=${t.maxTsServerMemory}`),n}function dh(){return process.env.TSS_DEBUG_BRK}class ph{constructor(e){this._process=e}write(e){this._process.send(e)}onData(e){this._process.on("message",e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e)}kill(){this._process.kill()}}class fh{constructor(e){this._process=e,this._reader=new mh(this._process.stdout)}get reader(){return this._reader}write(e){this._process.stdin.write(`${JSON.stringify(e)}\r\n`,"utf8")}onData(e){this.reader.onData(e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e),this.reader.onError(e)}kill(){this._process.kill(),this.reader.dispose(),this._reader=null}}class mh{constructor(e){this.buffer=new wh,this.nextMessageLength=-1,this._onError=e=>{},this._onData=e=>{},this.isDisposed=!1,e.on("data",(e=>this.onLengthData(e)))}dispose(){this.isDisposed=!0,this._onError=e=>{},this._onData=e=>{}}onError(e){this._onError=e}onData(e){this._onData=e}onLengthData(e){if(!this.isDisposed)try{for(this.buffer.append(e);;){if(-1===this.nextMessageLength&&(this.nextMessageLength=this.buffer.tryReadContentLength(),-1===this.nextMessageLength))return;const e=this.buffer.tryReadContent(this.nextMessageLength);if(null===e)return;this.nextMessageLength=-1;const t=JSON.parse(e);this._onData(t)}}catch(e){this._onError(e)}}}const gh=8192,yh=Buffer.byteLength("Content-Length: ","utf8"),vh=Buffer.from(" ","utf8")[0],bh=Buffer.from("\r","utf8")[0],Sh=Buffer.from("\n","utf8")[0];class wh{constructor(){this.index=0,this.buffer=Buffer.allocUnsafe(gh)}append(e){let t=null;if(t=Buffer.isBuffer(e)?e:Buffer.from(e,"utf8"),this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{const e=(Math.ceil((this.index+t.length)/gh)+1)*gh;0===this.index?(this.buffer=Buffer.allocUnsafe(e),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],e)}this.index+=t.length}tryReadContentLength(){let e=-1,t=0;for(;t<this.index&&(this.buffer[t]===vh||this.buffer[t]===bh||this.buffer[t]===Sh);)t++;if(this.index<t+yh)return e;t+=yh;const n=t;for(;t<this.index&&this.buffer[t]!==bh;)t++;if(t+3>=this.index||this.buffer[t+1]!==Sh||this.buffer[t+2]!==bh||this.buffer[t+3]!==Sh)return e;const r=this.buffer.toString("utf8",n,t);return e=parseInt(r),this.buffer=this.buffer.slice(t+4),this.index=this.index-(t+4),e}tryReadContent(e){if(this.index<e)return null;const t=this.buffer.toString("utf8",0,e);let n=e;for(;n<this.index&&(this.buffer[n]===bh||this.buffer[n]===Sh);)n++;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}}var Rh,Eh,Ch,_h;function Dh(e){switch(e){case"never":return 0;case"auto":return 2}return 2}!function(e){e[e.Off=0]="Off",e[e.Normal=1]="Normal",e[e.Terse=2]="Terse",e[e.RequestTime=3]="RequestTime",e[e.Verbose=4]="Verbose"}(Rh||(Rh={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"normal":return e.Normal;case"terse":return e.Terse;case"requestTime":return e.RequestTime;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Normal:return"normal";case e.Terse:return"terse";case e.Verbose:return"verbose";case e.Off:default:return"off"}}}(Rh||(Rh={}));class Th{constructor(e,t,n,r){this._apiVersion=e,this._logDirectoryProvider=t,this._logger=n,this._tracer=r}spawn(e,t,n,r){let i;const o=this.getCompositeServerType(e,t,n);switch(o){case 1:case 2:{const t=2===o;i=new ch({syntax:this.spawnTsServer("syntax",e,n),semantic:this.spawnTsServer("semantic",e,n)},r,t);break}case 0:i=this.spawnTsServer("main",e,n);break;case 3:i=this.spawnTsServer("syntax",e,n)}return i}getCompositeServerType(e,t,n){if(!t.has(Al.Semantic))return 3;switch(n.useSyntaxServer){case 1:return 3;case 0:return 0;case 2:return e.version?.gte(yl.v340)?e.version?.gte(yl.v400)?2:1:0}}spawnTsServer(e,t,n){const r=new uh,i=eh.create(e,this._tracer),{args:o,tsServerLogFile:s}=this.getTsServerArgs(e,n,this._apiVersion,i.cancellationPipeName);this.isLoggingEnabled(n)&&(s?this._logger.logIgnoringVerbosity(Aa.Info,`<${e}> Log file: ${s}`):this._logger.logIgnoringVerbosity(Aa.Error,`<${e}> Could not create log directory`));const a=r.fork(t,o,e,n);return this._logger.log("Starting tsserver"),new sh(e,this.kindToServerType(e),a,s,i,t,this._tracer)}kindToServerType(e){return"syntax"===e?ql.Syntax:ql.Semantic}getTsServerArgs(e,t,n,r){const i=[];let o;"syntax"===e&&(n.gte(yl.v401)?i.push("--serverMode","partialSemantic"):i.push("--syntaxOnly")),n.gte(yl.v250)?i.push("--useInferredProjectPerProjectRoot"):i.push("--useSingleInferredProject");const{disableAutomaticTypingAcquisition:s,globalPlugins:a,locale:c,npmLocation:u,pluginProbeLocations:l}=t;if((s||"syntax"===e||"diagnostics"===e)&&i.push("--disableAutomaticTypingAcquisition"),r&&i.push("--cancellationPipeName",`${r}*`),this.isLoggingEnabled(t)){const e=this._logDirectoryProvider.getNewLogDirectory();e&&(o=b.join(e,"tsserver.log"),i.push("--logVerbosity",Rh.toString(t.logVerbosity)),i.push("--logFile",o))}return a?.length&&i.push("--globalPlugins",a.join(",")),l?.length&&i.push("--pluginProbeLocations",l.join(",")),u&&(this._logger.info(`using npm from ${u}`),i.push("--npmLocation",`"${u}"`)),i.push("--locale",c||"en"),i.push("--validateDefaultNpmLocation"),{args:i,tsServerLogFile:o,tsServerTraceDirectory:undefined}}isLoggingEnabled(e){return e.logVerbosity!==Rh.Off}}!function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(Eh||(Eh={})),function(e){e.fromString=function(t){switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose}}}(Eh||(Eh={}));class kh{constructor(e,t){this.logger=e,this.trace=t}traceRequest(e,t,n,r){if(this.trace===Eh.Off)return;let i;this.trace===Eh.Verbose&&t.arguments&&(i=`Arguments: ${JSON.stringify(t.arguments,null,4)}`),this.logTrace(e,`Sending request: ${t.command} (${t.seq}). Response expected: ${n?"yes":"no"}. Current queue length: ${r}`,i)}traceResponse(e,t,n){if(this.trace===Eh.Off)return;let r;this.trace===Eh.Verbose&&t.body&&(r=`Result: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Response received: ${t.command} (${t.request_seq}). Request took ${Date.now()-n.queuingStartTime} ms. Success: ${t.success}${t.success?"":`. Message: ${t.message}`}`,r)}traceRequestCompleted(e,t,n,r){this.trace!==Eh.Off&&this.logTrace(e,`Async response received: ${t} (${n}). Request took ${Date.now()-r.queuingStartTime} ms.`)}traceEvent(e,t){if(this.trace===Eh.Off)return;let n;this.trace===Eh.Verbose&&t.body&&(n=`Data: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Event received: ${t.event} (${t.seq}).`,n)}logTrace(e,t,n){this.trace!==Eh.Off&&this.logger.trace("Trace",`<${e}> ${t}`,n)}}!function(e){e.None={type:0};e.Running=class{constructor(e,t,n,r){this.server=e,this.apiVersion=t,this.tsserverVersion=n,this.languageServiceEnabled=r,this.type=1}updateTsserverVersion(e){this.tsserverVersion=e}updateLanguageServiceEnabled(e){this.languageServiceEnabled=e}};e.Errored=class{constructor(e,t){this.error=e,this.tsServerLogFile=t,this.type=2}}}(Ch||(Ch={}));class xh{constructor(e){this.lspClient=e}reset(){if(this._task){const e=this._task;this._task=void 0,e.then((e=>e.done()))}}startedLoadingProject(e){this.reset(),this._loadingProjectName=e,this._task=this.lspClient.createProgressReporter(),this._task.then((e=>e.begin("Initializing JS/TS language features…")))}finishedLoadingProject(e){this._loadingProjectName===e&&this.reset()}}class Ph{constructor(e){this.options=e,this.serverState=Ch.None,this.apiVersion=e.typescriptVersion.version||yl.defaultVersion,this.typescriptVersionSource=e.typescriptVersion.source,this.logger=new La(e.logger,"[tsclient]"),this.tsserverLogger=new La(e.logger,"[tsserver]"),this.loadingIndicator=new xh(e.lspClient),this.tracer=new kh(this.tsserverLogger,e.trace)}get capabilities(){return 1===this.options.useSyntaxServer?new Ml(Al.Syntax,Al.EnhancedSyntax):this.apiVersion.gte(yl.v400)?new Ml(Al.Syntax,Al.EnhancedSyntax,Al.Semantic):new Ml(Al.Syntax,Al.Semantic)}hasCapabilityForResource(e,t){if(!this.capabilities.has(t))return!1;switch(t){case Al.Semantic:return["file","untitled"].includes(e.scheme);case Al.Syntax:case Al.EnhancedSyntax:return!0}}start(){const e=new Th(this.apiVersion,this.options.logDirectoryProvider,this.logger,this.tracer).spawn(this.options.typescriptVersion,this.capabilities,this.options,{onFatalError:(e,t)=>this.fatalError(e,t)});return this.serverState=new Ch.Running(e,this.apiVersion,void 0,!0),e.onExit((e=>{this.serverState=Ch.None,this.shutdown(),this.tsserverLogger.error(`Exited. Code: ${e.code}. Signal: ${e.signal}`),this.options.onExit&&this.options.onExit(e.code,e.signal)})),e.onStdErr((e=>{e&&this.logger.error(e)})),e.onError((t=>{this.serverState=new Ch.Errored(t,e.tsServerLogFile),t&&this.tsserverLogger.error("Exited with error. Error message is: {0}",t.message||t.name),this.serviceExited()})),e.onEvent((e=>this.dispatchEvent(e))),this.apiVersion.gte(yl.v300)&&this.capabilities.has(Al.Semantic)&&this.loadingIndicator.startedLoadingProject(""),!0}serviceExited(){1===this.serverState.type&&this.serverState.server.kill(),this.loadingIndicator.reset()}dispatchEvent(e){switch(e.event){case"syntaxDiag":case"semanticDiag":case"suggestionDiag":this.loadingIndicator.reset(),this.options.onEvent?.(e);break;case"projectsUpdatedInBackground":this.loadingIndicator.reset();break;case"projectLoadingStart":this.loadingIndicator.startedLoadingProject(e.body.projectName);break;case"projectLoadingFinish":this.loadingIndicator.finishedLoadingProject(e.body.projectName)}}shutdown(){this.loadingIndicator&&this.loadingIndicator.reset(),1===this.serverState.type&&this.serverState.server.kill(),this.serverState=Ch.None}notify(e,t){this.executeWithoutWaitingForResponse(e,t)}requestGeterr(e,t){return this.executeAsync(bl.Geterr,e,t)}async request(e,t,n,r){try{return await this.execute(e,t,n,r)}catch(e){throw new ye.ResponseError(1,e.message)}}execute(e,t,n,r){let i;return i||(i=this.executeImpl(e,t,{isAsync:!1,token:n,expectsResult:!0,...r})),r?.nonRecoverable&&i[0].catch((t=>this.fatalError(e,t))),e===bl.UpdateOpen&&Promise.all(i).then((()=>{this.loadingIndicator.reset()})),i[0]}executeWithoutWaitingForResponse(e,t){this.executeImpl(e,t,{isAsync:!1,token:void 0,expectsResult:!1})}executeAsync(e,t,n){return this.executeImpl(e,t,{isAsync:!0,token:n,expectsResult:!0})[0]}executeImpl(e,t,n){const r=this.serverState;return 1===r.type?r.server.executeImpl(e,t,n):[Promise.resolve(Il.NoServer)]}fatalError(e,t){if(this.tsserverLogger.error(`A non-recoverable error occurred while executing command: ${e}`),t instanceof Fl&&t.serverErrorText&&this.tsserverLogger.error(t.serverErrorText),1===this.serverState.type){this.logger.info("Killing TS Server");const e=this.serverState.server.tsServerLogFile;this.serverState.server.kill(),t instanceof Fl&&(this.serverState=new Ch.Errored(t,e))}}}(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,u=s<c?s:c,l=-1,h=0;h<=u;++h){if(h===u){if(c>u){if(47===n.charCodeAt(a+h))return n.slice(a+h+1);if(0===h)return n.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?l=h:0===h&&(l=0));break}var d=e.charCodeAt(i+h);if(d!==n.charCodeAt(a+h))break;47===d&&(l=h)}var p="";for(h=i+l+1;h<=o;++h)h!==o&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(a+l):(a+=l,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=c))}return i===o?o=c:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(o=!1,i=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,h=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===i?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===h||1===h&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&o?e.slice(1,c):e.slice(a,c)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{var e;if(n.r(r),n.d(r,{URI:()=>f,Utils:()=>_}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){var t=navigator.userAgent;e=t.indexOf("Windows")>=0}var i,o,s=(i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},i(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=/^\w[\w\d+.-]*$/,c=/^\//,u=/^\/\//;function l(e,t){if(!e.scheme&&t)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'.concat(e.authority,'", path: "').concat(e.path,'", query: "').concat(e.query,'", fragment: "').concat(e.fragment,'"}'));if(e.scheme&&!a.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!c.test(e.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(u.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}var h="",d="/",p=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,f=function(){function t(e,t,n,r,i,o){void 0===o&&(o=!1),"object"==typeof e?(this.scheme=e.scheme||h,this.authority=e.authority||h,this.path=e.path||h,this.query=e.query||h,this.fragment=e.fragment||h):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||h,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==d&&(t=d+t):t=d}return t}(this.scheme,n||h),this.query=r||h,this.fragment=i||h,l(this,o))}return t.isUri=function(e){return e instanceof t||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString},Object.defineProperty(t.prototype,"fsPath",{get:function(){return S(this,!1)},enumerable:!1,configurable:!0}),t.prototype.with=function(e){if(!e)return this;var t=e.scheme,n=e.authority,r=e.path,i=e.query,o=e.fragment;return void 0===t?t=this.scheme:null===t&&(t=h),void 0===n?n=this.authority:null===n&&(n=h),void 0===r?r=this.path:null===r&&(r=h),void 0===i?i=this.query:null===i&&(i=h),void 0===o?o=this.fragment:null===o&&(o=h),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new g(t,n,r,i,o)},t.parse=function(e,t){void 0===t&&(t=!1);var n=p.exec(e);return n?new g(n[2]||h,C(n[4]||h),C(n[5]||h),C(n[7]||h),C(n[9]||h),t):new g(h,h,h,h,h)},t.file=function(t){var n=h;if(e&&(t=t.replace(/\\/g,d)),t[0]===d&&t[1]===d){var r=t.indexOf(d,2);-1===r?(n=t.substring(2),t=d):(n=t.substring(2,r),t=t.substring(r)||d)}return new g("file",n,t,h,h)},t.from=function(e){var t=new g(e.scheme,e.authority,e.path,e.query,e.fragment);return l(t,!0),t},t.prototype.toString=function(e){return void 0===e&&(e=!1),w(this,e)},t.prototype.toJSON=function(){return this},t.revive=function(e){if(e){if(e instanceof t)return e;var n=new g(e);return n._formatted=e.external,n._fsPath=e._sep===m?e.fsPath:null,n}return e},t}(),m=e?1:void 0,g=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return s(t,e),Object.defineProperty(t.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=S(this,!1)),this._fsPath},enumerable:!1,configurable:!0}),t.prototype.toString=function(e){return void 0===e&&(e=!1),e?w(this,!0):(this._formatted||(this._formatted=w(this,!1)),this._formatted)},t.prototype.toJSON=function(){var e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=m),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e},t}(f),y=((o={})[58]="%3A",o[47]="%2F",o[63]="%3F",o[35]="%23",o[91]="%5B",o[93]="%5D",o[64]="%40",o[33]="%21",o[36]="%24",o[38]="%26",o[39]="%27",o[40]="%28",o[41]="%29",o[42]="%2A",o[43]="%2B",o[44]="%2C",o[59]="%3B",o[61]="%3D",o[32]="%20",o);function v(e,t,n){for(var r=void 0,i=-1,o=0;o<e.length;o++){var s=e.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==r&&(r+=e.charAt(o));else{void 0===r&&(r=e.substr(0,o));var a=y[s];void 0!==a?(-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),r+=a):-1===i&&(i=o)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function b(e){for(var t=void 0,n=0;n<e.length;n++){var r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=y[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function S(t,n){var r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?"//".concat(t.authority).concat(t.path):47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function w(e,t){var n=t?b:v,r="",i=e.scheme,o=e.authority,s=e.path,a=e.query,c=e.fragment;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=d,r+=d),o){var u=o.indexOf("@");if(-1!==u){var l=o.substr(0,u);o=o.substr(u+1),-1===(u=l.lastIndexOf(":"))?r+=n(l,!1,!1):(r+=n(l.substr(0,u),!1,!1),r+=":",r+=n(l.substr(u+1),!1,!0)),r+="@"}-1===(u=(o=o.toLowerCase()).lastIndexOf(":"))?r+=n(o,!1,!0):(r+=n(o.substr(0,u),!1,!0),r+=o.substr(u))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2))(h=s.charCodeAt(1))>=65&&h<=90&&(s="/".concat(String.fromCharCode(h+32),":").concat(s.substr(3)));else if(s.length>=2&&58===s.charCodeAt(1)){var h;(h=s.charCodeAt(0))>=65&&h<=90&&(s="".concat(String.fromCharCode(h+32),":").concat(s.substr(2)))}r+=n(s,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),c&&(r+="#",r+=t?c:v(c,!1,!1)),r}function R(e){try{return decodeURIComponent(e)}catch(t){return e.length>3?e.substr(0,3)+R(e.substr(3)):e}}var E=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function C(e){return e.match(E)?e.replace(E,(function(e){return R(e)})):e}var _,D=n(470),T=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},k=D.posix||D,x="/";!function(e){e.joinPath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e.with({path:k.join.apply(k,T([e.path],t,!1))})},e.resolvePath=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=e.path,i=!1;r[0]!==x&&(r=x+r,i=!0);var o=k.resolve.apply(k,T([r],t,!1));return i&&o[0]===x&&!e.authority&&(o=o.substring(1)),e.with({path:o})},e.dirname=function(e){if(0===e.path.length||e.path===x)return e;var t=k.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return k.basename(e.path)},e.extname=function(e){return k.extname(e.path)}}(_||(_={}))})(),_h=r})();const{URI:Oh,Utils:Nh}=_h;var qh,Ih,Ah;!function(e){e.fromTextSpan=t=>e.fromLocations(t.start,t.end),e.toTextSpan=e=>({start:Ih.toLocation(e.start),end:Ih.toLocation(e.end)}),e.fromLocations=(e,t)=>_e.Range.create(Math.max(0,e.line-1),Math.max(e.offset-1,0),Math.max(0,t.line-1),Math.max(0,t.offset-1)),e.toFileRangeRequestArgs=(e,t)=>({file:e,startLine:t.start.line+1,startOffset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.toFormattingRequestArgs=(e,t)=>({file:e,line:t.start.line+1,offset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.intersection=function(e,t){const n=Ih.Max(t.start,e.start),r=Ih.Min(t.end,e.end);if(!Ih.isAfter(n,r))return _e.Range.create(n,r)},e.union=function(e,t){const n=Ih.Min(t.start,e.start),r=Ih.Max(t.end,e.end);return _e.Range.create(n,r)}}(qh||(qh={})),function(e){function t(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<t.character}function n(e,t){return!r(e,t)}function r(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<=t.character}e.fromLocation=e=>({line:Math.max(e.line-1,0),character:Math.max(e.offset-1,0)}),e.toLocation=e=>({line:e.line+1,offset:e.character+1}),e.toFileLocationRequestArgs=(e,t)=>({file:e,line:t.line+1,offset:t.character+1}),e.Min=function(...e){if(!e.length)return;let n=e.pop();for(const r of e)t(r,n)&&(n=r);return n},e.isBefore=t,e.Max=function(...e){if(!e.length)return;let t=e.pop();for(const r of e)n(r,t)&&(t=r);return t},e.isAfter=n,e.isBeforeOrEqual=r}(Ih||(Ih={})),function(e){e.fromTextSpan=(e,t)=>_e.Location.create(e,qh.fromTextSpan(t))}(Ah||(Ah={}));const Mh=/\\/g;function Fh(e){if(e.startsWith("zipfile:"))return e;const t=Oh.parse(e);return"file"===t.scheme?$h(t.fsPath):void 0}function Lh(e,t){if(e.startsWith("zipfile:"))return e;const n=Oh.file(e),r=jh(n.fsPath),i=t?.get(r);return i?i.uri:n.toString()}function jh(e){return $h(Oh.file(e).fsPath)}function $h(e){return e.replace(Mh,"/")}function Hh(e,t){const n=jh(Oh.file(e).fsPath),r=t?.get(n);return r?r.version:null}function Wh(e,t){return{uri:Lh(e.file,t),range:{start:Ih.fromLocation(e.start),end:Ih.fromLocation(e.end)}}}const Vh={"enum member":ye.SymbolKind.Constant,"JSX attribute":ye.SymbolKind.Property,"local class":ye.SymbolKind.Class,"local function":ye.SymbolKind.Function,"local var":ye.SymbolKind.Variable,"type parameter":ye.SymbolKind.Variable,alias:ye.SymbolKind.Variable,class:ye.SymbolKind.Class,const:ye.SymbolKind.Constant,constructor:ye.SymbolKind.Constructor,enum:ye.SymbolKind.Enum,field:ye.SymbolKind.Field,file:ye.SymbolKind.File,function:ye.SymbolKind.Function,getter:ye.SymbolKind.Method,interface:ye.SymbolKind.Interface,let:ye.SymbolKind.Variable,method:ye.SymbolKind.Method,module:ye.SymbolKind.Module,parameter:ye.SymbolKind.Variable,property:ye.SymbolKind.Property,setter:ye.SymbolKind.Method,var:ye.SymbolKind.Variable};function Uh(e){return Vh[e]||ye.SymbolKind.Variable}function Kh(e){switch(e){case"error":default:return ye.DiagnosticSeverity.Error;case"warning":return ye.DiagnosticSeverity.Warning;case"suggestion":return ye.DiagnosticSeverity.Hint}}function Gh(e,t,n){const r={range:{start:Ih.fromLocation(e.start),end:Ih.fromLocation(e.end)},message:e.text,severity:Kh(e.category),code:e.code,source:e.source||"typescript",relatedInformation:zh(e.relatedInformation,t)};return n.diagnosticsTagSupport&&(r.tags=function(e){const t=[];e.reportsUnnecessary&&t.push(ye.DiagnosticTag.Unnecessary);e.reportsDeprecated&&t.push(ye.DiagnosticTag.Deprecated);return t}(e)),r}function zh(e,t){if(!e)return;const n=[];for(const r of e){const e=r.span;e&&n.push(ye.DiagnosticRelatedInformation.create(Wh(e,t),r.message))}return n}function Bh(e){return ye.SelectionRange.create(qh.fromTextSpan(e.textSpan),e.parent?Bh(e.parent):void 0)}function Jh(e){return{range:{start:Ih.fromLocation(e.start),end:Ih.fromLocation(e.end)},newText:e.newText}}function Yh(e,t){return{textDocument:{uri:Lh(e.fileName,t),version:Hh(e.fileName,t)},edits:e.textChanges.map((e=>Jh(e)))}}function Xh(e){return e.highlightSpans.map((e=>({kind:Qh(e.kind),range:{start:Ih.fromLocation(e.start),end:Ih.fromLocation(e.end)}})))}function Qh(e){switch(e){case Sl.definition:return ye.DocumentHighlightKind.Write;case Sl.reference:case Sl.writtenReference:return ye.DocumentHighlightKind.Read;default:return ye.DocumentHighlightKind.Text}}class Zh{constructor(e,t,n,r){this.uri=e,this.publishDiagnostics=t,this.documents=n,this.features=r,this.diagnosticsPerKind=new Map,this.firePublishDiagnostics=Wa((()=>{const e=this.getDiagnostics();this.publishDiagnostics({uri:this.uri,diagnostics:e})}),50)}update(e,t){this.diagnosticsPerKind.set(e,t),this.firePublishDiagnostics()}getDiagnostics(){const e=[];for(const t of this.diagnosticsPerKind.values())for(const n of t)e.push(Gh(n,this.documents,this.features));return e}}class ed{constructor(e,t,n,r,i){this.publishDiagnostics=e,this.documents=t,this.features=n,this.logger=r,this.tspClient=i,this.diagnostics=new Map,this.ignoredDiagnosticCodes=new Set}updateDiagnostics(e,t,n){if(0!==e&&!this.tspClient.hasCapabilityForResource(this.documents.toResource(t),Al.Semantic))return;this.ignoredDiagnosticCodes.size&&(n=n.filter((e=>!this.isDiagnosticIgnored(e))));const r=Lh(t,this.documents),i=this.diagnostics.get(r)||new Zh(r,this.publishDiagnostics,this.documents,this.features);i.update(e,n),this.diagnostics.set(r,i)}updateIgnoredDiagnosticCodes(e){this.ignoredDiagnosticCodes=new Set(e)}getDiagnosticsForFile(e){const t=Lh(e,this.documents);return this.diagnostics.get(t)?.getDiagnostics()||[]}isDiagnosticIgnored(e){return void 0!==e.code&&this.ignoredDiagnosticCodes.has(e.code)}}var td,nd=function(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},rd=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(t,n){for(var r=0,i=t;r<i.length;r++){var o=i[r];if(e.isIncremental(o)){var s=sd(o.range),a=this.offsetAt(s.start),c=this.offsetAt(s.end);this._content=this._content.substring(0,a)+o.text+this._content.substring(c,this._content.length);var u=Math.max(s.start.line,0),l=Math.max(s.end.line,0),h=this._lineOffsets,d=od(o.text,!1,a);if(l-u===d.length)for(var p=0,f=d.length;p<f;p++)h[p+u+1]=d[p];else d.length<1e4?h.splice.apply(h,nd([u+1,l-u],d,!1)):this._lineOffsets=h=h.slice(0,u+1).concat(d,h.slice(l+1));var m=o.text.length-(c-a);if(0!==m)for(p=u+1+d.length,f=h.length;p<f;p++)h[p]=h[p]+m}else{if(!e.isFull(o))throw new Error("Unknown change event received");this._content=o.text,this._lineOffsets=void 0}}this._version=n},e.prototype.getLineOffsets=function(){return void 0===this._lineOffsets&&(this._lineOffsets=od(this._content,!0)),this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return{line:o,character:e-t[o]}},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e.isIncremental=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},e.isFull=function(e){var t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength},e}();function id(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);id(r,t),id(i,t);for(var o=0,s=0,a=0;o<r.length&&s<i.length;){var c=t(r[o],i[s]);e[a++]=c<=0?r[o++]:i[s++]}for(;o<r.length;)e[a++]=r[o++];for(;s<i.length;)e[a++]=i[s++];return e}function od(e,t,n){void 0===n&&(n=0);for(var r=t?[n]:[],i=0;i<e.length;i++){var o=e.charCodeAt(i);13!==o&&10!==o||(13===o&&i+1<e.length&&10===e.charCodeAt(i+1)&&i++,r.push(n+i+1))}return r}function sd(e){var t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function ad(e){var t=sd(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new rd(e,t,n,r)},e.update=function(e,t,n){if(e instanceof rd)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){for(var n=e.getText(),r=id(t.map(ad),(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),i=0,o=[],s=0,a=r;s<a.length;s++){var c=a[s],u=e.offsetAt(c.range.start);if(u<i)throw new Error("Overlapping edit");u>i&&o.push(n.substring(i,u)),c.newText.length&&o.push(c.newText),i=e.offsetAt(c.range.end)}return o.push(n.substr(i)),o.join("")}}(td||(td={}));class cd{constructor(e){const{uri:t,languageId:n,version:r,text:i}=e;this.document=td.create(t,n,r,i)}get uri(){return this.document.uri}get languageId(){return this.document.languageId}get version(){return this.document.version}getText(e){return this.document.getText(e)}positionAt(e){return this.document.positionAt(e)}offsetAt(e){return this.document.offsetAt(e)}get lineCount(){return this.document.lineCount}getLine(e){const t=this.getLineRange(e);return this.getText(t)}getLineRange(e){const t=this.getLineStart(e),n=this.getLineEnd(e);return ye.Range.create(t,n)}getLineEnd(e){const t=e+1,n=this.getLineOffset(t);return this.positionAt(t<this.document.lineCount?n-1:n)}getLineOffset(e){const t=this.getLineStart(e);return this.offsetAt(t)}getLineStart(e){return ye.Position.create(e,0)}getFullRange(){return ye.Range.create(ye.Position.create(0,0),this.getLineEnd(Math.max(this.lineCount-1,0)))}applyEdit(e,t){const n=this.getText();let r=t.text;if(ye.TextDocumentContentChangeEvent.isIncremental(t)){const e=this.offsetAt(t.range.start),i=this.offsetAt(t.range.end);r=n.substr(0,e)+t.text+n.substr(i)}this.document=td.create(this.uri,this.languageId,e,r)}}class ud{constructor(){this._files=[],this.documents=new Map}get files(){return this._files}get(e){const t=this.documents.get(e);if(t)return this.files[0]!==e&&(this._files.splice(this._files.indexOf(e),1),this._files.unshift(e)),t}open(e,t){return!this.documents.has(e)&&(this.documents.set(e,new cd(t)),this._files.unshift(e),!0)}close(e){const t=this.documents.get(e);if(t)return this.documents.delete(e),this._files.splice(this._files.indexOf(e),1),t}toResource(e){const t=this.documents.get(e);return t?Oh.parse(t.uri):Oh.file(e)}}class ld{static async execute(e,t,n,r,i,o,s){if(r.apiVersion.lt(ld.minVersion))return void i.showErrorMessage("Go to Source Definition failed. Requires TypeScript 4.7+.");if(!t||"number"!=typeof t.character||"number"!=typeof t.line)return void i.showErrorMessage("Go to Source Definition failed. Invalid position.");let a;if(!e||"string"!=typeof e||!(a=Fh(e)))return void i.showErrorMessage("Go to Source Definition failed. No resource provided.");if(!n.get(a))return void i.showErrorMessage("Go to Source Definition failed. File not opened in the editor.");const c=Ih.toFileLocationRequestArgs(a,t);return await i.withProgress({message:"Finding source definitions…",reporter:o},(async()=>{const e=await r.request(bl.FindSourceDefinition,c,s);if("response"===e.type&&e.body)return e.body.map((e=>Wh(e,n)));i.showErrorMessage("No source definitions found.")}))}}ld.id="_typescript.goToSourceDefinition",ld.minVersion=yl.v470;const hd={APPLY_WORKSPACE_EDIT:"_typescript.applyWorkspaceEdit",APPLY_CODE_ACTION:"_typescript.applyCodeAction",APPLY_REFACTORING:"_typescript.applyRefactoring",CONFIGURE_PLUGIN:"_typescript.configurePlugin",ORGANIZE_IMPORTS:"_typescript.organizeImports",APPLY_RENAME_FILE:"_typescript.applyRenameFile",APPLY_COMPLETION_CODE_ACTION:"_typescript.applyCompletionCodeAction",SELECT_REFACTORING:"_typescript.selectRefactoring",SOURCE_DEFINITION:ld.id},dd=new ye.NotificationType("$/typescriptVersion");class pd{constructor(e=""){this.value=e}appendText(e,t=0){var n;return this.value+=(n=e,n.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}toMarkupContent(){return{kind:"markdown",value:this.value}}}function fd(e){return function(e){return e.replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi,((e,t,n,r)=>"linkcode"===t?`[\`${r?r.trim():n}\`](${n})`:`[${r?r.trim():n}](${n})`))}(e)}function md(e,t){switch(e.name){case"augments":case"extends":case"param":case"template":{const n=yd(e.text,t).split(/^(\S+)\s*-?\s*/);if(3===n?.length){const t=n[1],r=n[2],i=`*@${e.name}* \`${t}\``;return r?i+(r.match(/\r\n|\n/g)?" \n"+fd(r):` — ${fd(r)}`):i}}}const n=`*@${e.name}*`,r=function(e,t){if(!e.text)return;function n(e){return/^\s*[~`]{3}/m.test(e)?e:"```\n"+e+"\n```"}const r=yd(e.text,t);switch(e.name){case"example":{const e=r.match(/<caption>(.*?)<\/caption>\s*(\r\n|\n)/);return e&&0===e.index?e[1]+"\n"+n(r.substring(e[0].length)):n(r)}case"author":{const e=r.match(/(.+)\s<([-.\w]+@[-.\w]+)>/);return null===e?r:`${e[1]} ${e[2]}`}case"default":return n(r)}return fd(r)}(e,t);return r?n+(r.match(/\r\n|\n/g)?" \n"+r:` — ${r}`):n}function gd(e,t){return fd(yd(e,t))}function yd(e,t){if(!e)return"";if("string"==typeof e)return e;const n=[];let r;for(const i of e)switch(i.kind){case"link":if(r){if(r.target){const e=t.toResource(r.target.file).with({fragment:`L${r.target.start.line},${r.target.start.offset}`}),i=r.text?r.text:Sd(r.name??"");n.push(`[${r.linkcode?"`"+i+"`":i}](${e.toString()})`)}else{const e=r.text??r.name;if(e)if(/^https?:/.test(e)){const t=e.split(" ");if(1===t.length)n.push(t[0]);else if(t.length>1){const e=Sd(t.slice(1).join(" "));n.push(`[${r.linkcode?"`"+e+"`":e}](${t[0]})`)}}else n.push(Sd(e))}r=void 0}else r={linkcode:"{@linkcode "===i.text};break;case"linkName":r&&(r.name=i.text,r.target=i.target);break;case"linkText":r&&(r.text=i.text);break;default:n.push(i.text)}return fd(n.join(""))}function vd(e,t,n){const r=new pd;return bd(r,e,t,n),r.value?r.toMarkupContent():void 0}function bd(e,t,n,r){if(t&&e.appendMarkdown(gd(t,r)),n){const t=function(e,t){return e.map((e=>md(e,t))).join(" \n\n")}(n,r);t&&e.appendMarkdown("\n\n"+t)}return e}function Sd(e){return e.replace(/`/g,"\\$&")}class wd{static isSnippetString(e){return e instanceof wd||!!e&&"string"==typeof e.value}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=wd._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if("function"==typeof e){const t=new wd;t._tabstop=this._tabstop,e(t),this._tabstop=t._tabstop,e=t.value}else e=wd._escape(e);return this.value+="${",this.value+=t,this.value+=":",this.value+=e,this.value+="}",this}appendVariable(e,t){if("function"==typeof t){const e=new wd;e._tabstop=this._tabstop,t(e),this._tabstop=e._tabstop,t=e.value}else"string"==typeof t&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}}function Rd(e,t,n,r,i,o,s,a){const c={label:e.name,kind:Cd(e.kind),sortText:e.sortText,preselect:e.isRecommended,data:{file:t,line:n.line+1,offset:n.character+1,entryNames:[e.source||e.data?{name:e.name,source:e.source,data:e.data}:e.name]}};s.completionCommitCharactersSupport&&(c.commitCharacters=function(e){const t=[];switch(e){case _l.memberGetAccessorElement:case _l.memberSetAccessorElement:case _l.constructSignatureElement:case _l.callSignatureElement:case _l.indexSignatureElement:case _l.enumElement:case _l.interfaceElement:t.push(".");break;case _l.moduleElement:case _l.alias:case _l.constElement:case _l.letElement:case _l.variableElement:case _l.localVariableElement:case _l.memberVariableElement:case _l.classElement:case _l.functionElement:case _l.memberFunctionElement:t.push(".",","),t.push("(")}return 0===t.length?void 0:t}(e.kind)),s.completionLabelDetails&&(c.labelDetails=e.labelDetails),e.source&&e.hasAction&&(c.sortText=`${e.sortText}`);const{isSnippet:u,replacementSpan:l,sourceDisplay:h}=e;if(u&&!s.completionSnippets)return null;s.completionSnippets&&(u||Dd(c.kind,o))&&(c.insertTextFormat=ye.InsertTextFormat.Snippet),h&&(c.detail=gd(h,i));const{line:d,optionalReplacementRange:p,isMemberCompletion:f,dotAccessorContext:m}=a;let g=function(e,t,n,r,i){if(e)return{replace:Ed(qh.fromTextSpan(e),r)};if(i.completionInsertReplaceSupport&&t){const e=Ed(t,r);return{insert:ye.Range.create(e.start,n),replace:e}}}(l,p,n,r,s),{insertText:y}=e;if(s.completionDisableFilterText||(c.filterText=function(e,t,n,r){if(e.name.startsWith("#")){const i=t?n.charAt(t.start.character):void 0;return r?r.startsWith("this.#")?"#"===i?r:r.replace(/&this\.#/,""):i:"#"===i?void 0:e.name.replace(/^#/,"")}if(r?.startsWith("this."))return;if(r?.startsWith("["))return r.replace(/^\[['"](.+)[['"]\]$/,".$1");return r}(e,p,d,y)),f&&m&&!e.isSnippet){const e=m.text+(y||c.label);s.completionDisableFilterText||(c.filterText=e),g||(g=s.completionInsertReplaceSupport&&p?{insert:m.range,replace:qh.union(m.range,p)}:{replace:m.range},y=e)}if(e.kindModifiers){const t=new Set(e.kindModifiers.split(/,|\s+/g));if(t.has(Pl.optional)&&(y||(y=c.label),c.filterText||(c.filterText=c.label),c.label+="?"),t.has(Pl.deprecated)&&(c.tags=[ye.CompletionItemTag.Deprecated]),e.kind===_l.scriptElement)for(const n of Pl.fileExtensionKindModifiers)if(t.has(n)){e.name.toLowerCase().endsWith(n)?c.detail=e.name:c.detail=e.name+n;break}}return g?c.textEdit=g.insert?ye.InsertReplaceEdit.create(y||c.label,g.insert,g.replace):ye.TextEdit.replace(g.replace,y||c.label):c.insertText=y,c}function Ed(e,t){return e.start.line!==e.end.line?ye.Range.create(e.start,t.getLineEnd(e.start.line)):e}function Cd(e){switch(e){case _l.primitiveType:case _l.keyword:return ye.CompletionItemKind.Keyword;case _l.constElement:return ye.CompletionItemKind.Constant;case _l.letElement:case _l.variableElement:case _l.localVariableElement:case _l.alias:return ye.CompletionItemKind.Variable;case _l.memberVariableElement:case _l.memberGetAccessorElement:case _l.memberSetAccessorElement:return ye.CompletionItemKind.Field;case _l.functionElement:return ye.CompletionItemKind.Function;case _l.memberFunctionElement:case _l.constructSignatureElement:case _l.callSignatureElement:case _l.indexSignatureElement:return ye.CompletionItemKind.Method;case _l.enumElement:return ye.CompletionItemKind.Enum;case _l.moduleElement:case _l.externalModuleName:return ye.CompletionItemKind.Module;case _l.classElement:case _l.typeElement:return ye.CompletionItemKind.Class;case _l.interfaceElement:return ye.CompletionItemKind.Interface;case _l.warning:case _l.scriptElement:return ye.CompletionItemKind.File;case _l.directory:return ye.CompletionItemKind.Folder;case _l.string:return ye.CompletionItemKind.Constant}return ye.CompletionItemKind.Property}async function _d(e,t,n,r,i,o,s){e.detail=function({displayParts:e,sourceDisplay:t,source:n},r){const i=[],o=t||n;o&&i.push(`Auto import from '${gd(o,r)}'`);const s=gd(e,r);s&&i.push(s);return i.join("\n")}(t,i);const{documentation:a,tags:c}=t;e.documentation=vd(a,c,i);const u=jh(e.data.file);if(t.codeActions?.length&&(e.additionalTextEdits=function(e,t){const n=[];for(const r of e)if(r.changes)for(const e of r.changes)if(e.fileName===t)for(const t of e.textChanges)n.push(Jh(t));return n.length?n:void 0}(t.codeActions,u),e.command=function(e,t){let n=!1;for(const r of e){if(r.commands){n=!0;break}if(r.changes)for(const e of r.changes)if(e.fileName!==t){n=!0;break}}if(n)return{title:"",command:hd.APPLY_COMPLETION_CODE_ACTION,arguments:[t,e.map((e=>({commands:e.commands,description:e.description,changes:e.changes.filter((e=>e.fileName!==t))})))]}}(t.codeActions,e.data.file)),n&&s.completionSnippets&&Dd(e.kind,o)){const{line:i,offset:o}=e.data,s=Ih.fromLocation({line:i,offset:o}),a=await async function(e,t,n,r){try{const r=Ih.toFileLocationRequestArgs(e,t),i=await n.request(bl.Quickinfo,r);if("response"===i.type&&i.body)switch(i.body.kind){case"var":case"let":case"const":case"alias":return!1}}catch{}const i=r.getLine(t.line).slice(t.character);return null===i.match(/^[a-z_$0-9]*\s*\(/gi)}(u,s,r,n);a&&function(e,t){const{displayParts:n}=t,r=function(e){const t=[];let n=!1,r=!1,i=0,o=0;e:for(let s=0;s<e.length;++s){const a=e[s];switch(Nl(a.kind)){case kl.methodName:case kl.functionName:case kl.text:case kl.propertyName:0===i&&0===o&&(n=!0);break;case kl.parameterName:if(1===i&&0===o&&n){const n=e[s+1],i=n&&"?"===n.text,o="this"===a.text;i||o||t.push(a),r=r||i}break;case kl.punctuation:if("("===a.text)++i;else if(")"===a.text){if(--i,i<=0&&n)break e}else{if("..."===a.text&&1===i){r=!0;break e}"{"===a.text?++o:"}"===a.text&&--o}}}return{hasOptionalParameters:r,parts:t}}(n),i=new wd;i.appendText(`${e.insertText||e.textEdit?.newText||e.label}(`),function(e,t,n){for(let r=0;r<t.length;++r){const i=t[r];e.appendPlaceholder(i.text),r!==t.length-1&&e.appendText(n)}}(i,r.parts,", "),r.hasOptionalParameters&&i.appendTabstop();i.appendText(")"),i.appendTabstop(0),e.insertText=i.value,e.insertTextFormat=ye.InsertTextFormat.Snippet,e.textEdit&&(e.textEdit.newText=i.value)}(e,t)}return e}function Dd(e,t){return!0===t.completeFunctionCalls&&(e===ye.CompletionItemKind.Function||e===ye.CompletionItemKind.Method)}function Td(e){switch(e){case"@":case"#":case" ":case".":case'"':case"'":case"`":case"/":case"<":return e;default:return}}function kd(e,t,n){const r=e.items.map((e=>function(e,t){const n=e.parameters.map((e=>function(e,t){const{displayParts:n,documentation:r}=e;return{label:gd(n,t),documentation:vd(r,void 0,t)}}(e,t))),r={label:gd(e.prefixDisplayParts,t),documentation:vd(e.documentation,e.tags.filter((e=>"param"!==e.name)),t),parameters:n};return r.label+=n.map((e=>e.label)).join(gd(e.separatorDisplayParts,t)),r.label+=gd(e.suffixDisplayParts,t),r}(e,n)));return{activeSignature:xd(e,r,t),activeParameter:Pd(e),signatures:r}}function xd(e,t,n){if(void 0!==n?.activeSignatureHelp?.activeSignature){const e=n.activeSignatureHelp.signatures[n.activeSignatureHelp.activeSignature];if(e&&n.isRetrigger){const n=t.findIndex((t=>t.label===e.label));if(-1!==n)return n}}return e.selectedItemIndex}function Pd(e){const t=e.items[e.selectedItemIndex];return t?.isVariadic?Math.min(e.argumentIndex,t.parameters.length-1):e.argumentIndex}function Od(e){switch(e.triggerKind){case ye.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case ye.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case ye.SignatureHelpTriggerKind.Invoked:default:return{kind:"invoked"}}}function Nd(e,t){return ye.CodeAction.create(e.description,ye.Command.create(e.description,hd.SELECT_REFACTORING,e,t),ye.CodeActionKind.Refactor)}function qd(e,t,n){const r=ye.CodeAction.create(e.description,function(e){if(e.name.startsWith("function_"))return`${ye.CodeActionKind.RefactorExtract}.function`;if(e.name.startsWith("constant_"))return`${ye.CodeActionKind.RefactorExtract}.constant`;if(e.name.startsWith("Move"))return`${ye.CodeActionKind.Refactor}.move`;return ye.CodeActionKind.Refactor}(t));return e.notApplicableReason?r.disabled={reason:e.notApplicableReason}:r.command=ye.Command.create(e.description,hd.APPLY_REFACTORING,{...n,refactor:t.name,action:e.name}),r}class Id{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+Id.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Id(this.value+Id.sep+e)}}Id.sep=".",Id.Empty=new Id(ye.CodeActionKind.Empty),Id.QuickFix=new Id(ye.CodeActionKind.QuickFix),Id.Refactor=new Id(ye.CodeActionKind.Refactor),Id.Source=new Id(ye.CodeActionKind.Source),Id.SourceAddMissingImportsTs=Id.Source.append("addMissingImports").append("ts"),Id.SourceFixAll=new Id(ye.CodeActionKind.SourceFixAll),Id.SourceFixAllTs=Id.SourceFixAll.append("ts"),Id.SourceOrganizeImports=new Id(ye.CodeActionKind.SourceOrganizeImports),Id.SourceOrganizeImportsTs=Id.SourceOrganizeImports.append("ts"),Id.SourceRemoveUnusedImportsTs=Id.Source.append("removeUnusedImports").append("ts"),Id.SourceRemoveUnusedTs=Id.Source.append("removeUnused").append("ts"),Id.SourceSortImportsTs=Id.Source.append("sortImports").append("ts");const Ad=[{title:"Organize Imports",kind:Id.SourceOrganizeImportsTs,mode:xl.All},{minVersion:yl.v430,title:"Sort Imports",kind:Id.SourceSortImportsTs,mode:xl.SortAndCombine},{minVersion:yl.v490,title:"Remove Unused Imports",kind:Id.SourceRemoveUnusedImportsTs,mode:xl.RemoveUnused}];function Md(e,t,n){return t&&0!==t.body.length?[ye.CodeAction.create(e.title,{documentChanges:t.body.map((e=>Yh(e,n)))},e.kind.value)]:[]}function Fd(e,t){return Ld(e,t,{start:qh.fromTextSpan(e.spans[0]).start,end:qh.fromTextSpan(e.spans[e.spans.length-1]).end})}function Ld(e,t,n){let r=$d(e);for(const i of e.spans){const o=qh.fromTextSpan(i);if(!qh.intersection(n,o))continue;const s=[];if(e.childItems)for(const t of e.childItems)if(t.spans.some((e=>!!qh.intersection(o,qh.fromTextSpan(e))))){const e=Ld(t,s,o);r=r||e}let a=o;if(e.nameSpan){const t=qh.fromTextSpan(e.nameSpan);qh.intersection(o,t)&&(a=t)}r&&t.push({name:e.text,detail:"",kind:Uh(e.kind),range:o,selectionRange:a,children:s})}return r}function jd(e,t,n,r){let i=$d(t);const o=t.text;for(const s of t.spans){const a=qh.fromTextSpan(s),c=[];if(t.childItems)for(const n of t.childItems)if(n.spans.some((e=>!!qh.intersection(a,qh.fromTextSpan(e))))){const t=jd(e,n,c,o);i=i||t}i&&(n.push({name:o,kind:Uh(t.kind),location:{uri:e,range:a},containerName:r}),n.push(...c))}return i}function $d(e){return e.kind!==_l.alias&&!(!e.text||"<function>"===e.text||"<class>"===e.text)}function Hd(e,t,n){const r=function(e){return e.kind===_l.scriptElement||e.kind===_l.moduleElement&&1===e.selectionSpan.start.line&&1===e.selectionSpan.start.offset}(e),i=r?b.basename(e.file):e.name,o=r?n?b.relative(n,b.dirname(e.file)):b.dirname(e.file):e.containerName??"",s={kind:Wd(e.kind),name:i,detail:o,uri:Lh(e.file,t),range:qh.fromTextSpan(e.span),selectionRange:qh.fromTextSpan(e.selectionSpan)},a=e.kindModifiers?function(e){return new Set(e.split(/,|\s+/g))}(e.kindModifiers):void 0;return a?.has(Dl.deprecatedModifier)&&(s.tags=[ye.SymbolTag.Deprecated]),s}function Wd(e){switch(e){case _l.moduleElement:return ye.SymbolKind.Module;case _l.classElement:return ye.SymbolKind.Class;case _l.enumElement:return ye.SymbolKind.Enum;case _l.enumMemberElement:return ye.SymbolKind.EnumMember;case _l.interfaceElement:return ye.SymbolKind.Interface;case _l.indexSignatureElement:case _l.callSignatureElement:case _l.memberFunctionElement:return ye.SymbolKind.Method;case _l.memberVariableElement:case _l.memberGetAccessorElement:case _l.memberSetAccessorElement:return ye.SymbolKind.Property;case _l.variableElement:case _l.letElement:case _l.constElement:case _l.localVariableElement:case _l.alias:return ye.SymbolKind.Variable;case _l.functionElement:case _l.localFunctionElement:return ye.SymbolKind.Function;case _l.constructSignatureElement:case _l.constructorImplementationElement:return ye.SymbolKind.Constructor;case _l.typeParameterElement:return ye.SymbolKind.TypeParameter;case _l.string:return ye.SymbolKind.String;default:return ye.SymbolKind.Variable}}const Vd=new Set([6196,6133]),Ud=new Set([7027]),Kd=new Set([2420]),Gd=new Set([2552,2304]),zd=new Set([1308]);async function Bd(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...qh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(bl.GetCodeFixes,e);if("response"!==c.type||!c.body?.length)continue;const u=c.body?.find((e=>e.fixName===a));if(!u)continue;if(!u.fixId)return o.push(...u.changes.map((e=>Yh(e,r)))),o;const l={scope:{type:"file",args:{file:n}},fixId:u.fixId},h=await t.request(bl.GetCombinedCodeFix,l);return"response"===h.type&&h.body?(o.push(...h.body.changes.map((e=>Yh(e,r)))),o):o}return o}class Jd{}class Yd extends Jd{constructor(){super(...arguments),this.title="Fix all"}async build(e,t,n,r){const i=[];return i.push(...await async function(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...qh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(bl.GetCodeFixes,e);if("response"!==c.type)continue;const u=c.body?.find((e=>e.fixName===a));if(u){o.push(...u.changes.map((e=>Yh(e,r))));break}}return o}([{codes:Kd,fixName:"fixClassIncorrectlyImplementsInterface"},{codes:zd,fixName:"fixAwaitInSyncFunction"}],e,t,n,r)),i.push(...await Bd([{codes:Ud,fixName:"fixUnreachableCode"}],e,t,n,r)),i.length?ye.CodeAction.create(this.title,{documentChanges:i},Yd.kind.value):null}}Yd.kind=Id.SourceFixAllTs;class Xd extends Jd{constructor(){super(...arguments),this.title="Remove all unused code"}async build(e,t,n,r){const i=await Bd([{codes:Vd,fixName:"unusedIdentifier"}],e,t,n,r);return i.length?ye.CodeAction.create(this.title,{documentChanges:i},Xd.kind.value):null}}Xd.kind=Id.SourceRemoveUnusedTs;class Qd extends Jd{constructor(){super(...arguments),this.title="Add all missing imports"}async build(e,t,n,r){const i=await Bd([{codes:Gd,fixName:"import"}],e,t,n,r);return i.length?ye.CodeAction.create(this.title,{documentChanges:i},Qd.kind.value):null}}Qd.kind=Id.SourceAddMissingImportsTs;class Zd{static get kinds(){return Zd.kindProviders.map((e=>e.kind))}constructor(e){this.client=e}async provideCodeActions(e,t,n,r){const i=[];for(const o of Zd.kindProviders)e.some((e=>e.contains(o.kind)))&&i.push((new o).build(this.client,t,r,n));return(await Promise.all(i)).flatMap((e=>e||[]))}}Zd.kindProviders=[Yd,Xd,Qd];class ep{static async provideInlayHints(e,t,n,r,i,o,s){if(r.apiVersion.lt(ep.minVersion))return i.showErrorMessage("Inlay Hints request failed. Requires TypeScript 4.4+."),[];const a=Fh(e);if(!a)return i.showErrorMessage("Inlay Hints request failed. No resource provided."),[];const c=n.get(a);if(!c)return i.showErrorMessage("Inlay Hints request failed. File not opened in the editor."),[];if(!function(e,t){const n=e.getPreferences(t);return"literals"===n.includeInlayParameterNameHints||"all"===n.includeInlayParameterNameHints||n.includeInlayEnumMemberValueHints||n.includeInlayFunctionLikeReturnTypeHints||n.includeInlayFunctionParameterTypeHints||n.includeInlayPropertyDeclarationTypeHints||n.includeInlayVariableTypeHints}(o,a))return[];await o.configureGloballyFromDocument(a);const u=c.offsetAt(t.start),l=c.offsetAt(t.end)-u,h=await r.request(bl.ProvideInlayHints,{file:a,start:u,length:l},s);return"response"===h.type&&h.success&&h.body?h.body.map((e=>{const t=ye.InlayHint.create(Ih.fromLocation(e.position),e.text,function(e){switch(e){case"Parameter":return ye.InlayHintKind.Parameter;case"Type":return ye.InlayHintKind.Type;default:return}}(e.kind));return e.whitespaceBefore&&(t.paddingLeft=!0),e.whitespaceAfter&&(t.paddingRight=!0),t})):[]}}var tp,np,rp,ip,op,sp;function ap(e,t){const n=[];let r=0,i=0;for(let o=0;o<t.length;o+=3){const s=t[o],a=t[o+1],c=t[o+2],u=c&tp.modifierMask,l=(c>>tp.typeOffset)-1,{line:h,character:d}=e.positionAt(s),p=h-r,f=r===h?d-i:d;n.push(p,f,a,l,u),i=d,r=h}return n}ep.minVersion=yl.v440,function(e){e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask"}(tp||(tp={}));class cp{constructor(e){this.rootPath=e}getNewLogDirectory(){const t=this.logDirectory();if(t)try{return e.mkdtempSync(b.join(t,"tsserver-log-"))}catch(e){return}}logDirectory(){if(this.rootPath)try{return e.existsSync(this.rootPath)||e.mkdirSync(this.rootPath),this.rootPath}catch{return}}}sp="win32"===process.platform||T.TESTING_WINDOWS?function(){if(rp)return np;rp=1,np=n,n.sync=function(n,r){return t(e.statSync(n),n,r)};var e=a;function t(e,t,n){return!(!e.isSymbolicLink()&&!e.isFile())&&function(e,t){var n=void 0!==t.pathExt?t.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var r=0;r<n.length;r++){var i=n[r].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}(t,n)}function n(n,r,i){e.stat(n,(function(e,o){i(e,!e&&t(o,n,r))}))}return np}():function(){if(op)return ip;op=1,ip=t,t.sync=function(t,r){return n(e.statSync(t),r)};var e=a;function t(t,r,i){e.stat(t,(function(e,t){i(e,!e&&n(t,r))}))}function n(e,t){return e.isFile()&&function(e,t){var n=e.mode,r=e.uid,i=e.gid,o=void 0!==t.uid?t.uid:process.getuid&&process.getuid(),s=void 0!==t.gid?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8);return n&parseInt("001",8)||n&c&&i===s||n&a&&r===o||n&(a|c)&&0===o}(e,t)}return ip}();var up=lp;function lp(e,t,n){if("function"==typeof t&&(n=t,t={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,r){lp(e,t||{},(function(e,t){e?r(e):n(t)}))}))}sp(e,t||{},(function(e,r){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)}))}lp.sync=function(e,t){try{return sp.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}};const hp=up,{join:dp,delimiter:pp,sep:fp,posix:mp}=s,gp="win32"===process.platform,yp=new RegExp(`[${mp.sep}${fp===mp.sep?"":fp}]`.replace(/(\\)/g,"\\$1")),vp=new RegExp(`^\\.${yp.source}`),bp=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Sp=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=pp})=>{const i=e.match(yp)?[""]:[...gp?[process.cwd()]:[],...(t||"").split(r)];if(gp){const t=n||[".EXE",".CMD",".BAT",".COM"].join(r),o=t.split(r).reduce(((e,t)=>(e.push(t),e.push(t.toLowerCase()),e)),[]);return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t}}return{pathEnv:i,pathExt:[""]}},wp=(e,t)=>{const n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&vp.test(t)?t.slice(0,2):"")+dp(n,t)},Rp=async(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=Sp(e,t),o=[];for(const s of n){const n=wp(s,e);for(const e of r){const r=n+e;if(await hp(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw bp(e)};var Ep=Rp;Rp.sync=(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=Sp(e,t),o=[];for(const s of n){const n=wp(s,e);for(const e of r){const r=n+e;if(hp.sync(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw bp(e)};const Cp=k(Ep),_p={directory:"isDirectory",file:"isFile"};const Dp=(e,t)=>t[_p[e]](),Tp=e=>e instanceof URL?_(e):e;function kp(t,{cwd:n=D.cwd(),type:r="file",allowSymlinks:i=!0}={}){!function(e){if(!Object.hasOwnProperty.call(_p,e))throw new Error(`Invalid type specified: ${e}`)}(r),n=Tp(n);const o=i?e.statSync:e.lstatSync;for(const e of t)try{const t=o(b.resolve(n,e));if(Dp(r,t))return e}catch{}}const xp=e=>e instanceof URL?_(e):e,Pp=Symbol("findUpStop");function Op(e,t={}){const n=function(e,t={}){let n=b.resolve(xp(t.cwd)||"");const{root:r}=b.parse(n),i=t.stopAt||r,o=t.limit||Number.POSITIVE_INFINITY,s=[e].flat(),a=t=>{if("function"!=typeof e)return kp(s,t);const n=e(t.cwd);return"string"==typeof n?kp([n],t):n},c=[];for(;;){const e=a({...t,cwd:n});if(e===Pp)break;if(e&&c.push(b.resolve(n,e)),n===i||c.length>=o)break;n=b.dirname(n)}return c}(e,{...t,limit:1});return n[0]}function Np(e,r){if(t(e).isDirectory()){const t=r.map((t=>S(e,t))).find(n);if(t)return t}const i=S(e,"..");if(i!==e)return Np(i,r)}class qp{constructor(e,t,n){this.source=e,this.path=t,this.logger=n,this._api=null}get tsServerPath(){return this.path}get isValid(){return null!==this.version}get version(){return this._api||(this._api=this.getTypeScriptVersion(this.tsServerPath)),this._api}get versionString(){const e=this.version;return e?e.displayName:null}getTypeScriptVersion(t){if(this.logger.log(`Resolving TypeScript version from path "${t}"...`),!e.existsSync(t))return this.logger.log("Server path does not exist on disk"),null;const n=t.split(b.sep);if(n.length<=2)return this.logger.log("Server path is invalid (has less than two path components)."),null;const r=n.slice(0,-2).join(b.sep);let i=b.join(r,"package.json");if(e.existsSync(i)||"built"===b.basename(r)&&(i=b.join(r,"..","package.json")),!e.existsSync(i))return this.logger.log(`Failed to find package.json at path "${i}"`),null;this.logger.log(`Reading version from package.json at "${i}"`);const o=e.readFileSync(i).toString();let s=null;try{s=JSON.parse(o)}catch(e){return this.logger.log("Failed parsing contents of package.json."),null}return s?.version?(this.logger.log(`Resolved TypeScript version to "${s.version}"`),yl.fromVersionString(s.version)):(this.logger.log("Failed reading version number from package.json."),null)}}const Ip=["node_modules/typescript/lib",".vscode/pnpify/typescript/lib",".yarn/sdks/typescript/lib"];class Ap{constructor(e,t){this.userTsserverPath=e,this.logger=t}getUserSettingVersion(){if(!this.userTsserverPath)return null;this.logger.log(`Resolving user-provided tsserver path "${this.userTsserverPath}"...`);let t=this.userTsserverPath;if(!b.isAbsolute(t)){const e=Cp.sync(t,{nothrow:!0});e&&(t=e),this.logger.log(`Non-absolute tsserver path resolved to "${e?t:"<failed>"}"`)}let n=e.lstatSync(t,{throwIfNoEntry:!1});if(n?.isSymbolicLink()&&(t=e.realpathSync(t),this.logger.log(`Symbolic link tsserver path resolved to "${t}"`)),n=e.lstatSync(t,{throwIfNoEntry:!1}),n?.isFile()){if("tsserver.js"===b.basename(t))return this.logger.log(`Resolved tsserver location: ${t}`),new qp("user-setting",t,this.logger);t=b.dirname(t),this.logger.log(`Resolved directory path from a file path: ${t}`)}try{const e=function({cwd:e}={}){return Op("package.json",{cwd:e})}({cwd:t});this.logger.log(`Resolved package.json location: "${e}"`),e&&(t=b.join(b.dirname(e),"lib","tsserver.js"),this.logger.log(`Resolved tsserver location: "${t}"`))}catch{}return new qp("user-setting",t,this.logger)}getWorkspaceVersion(e){for(const t of e){const e=Np(t,Ip);if(e){const t=b.join(e,"tsserver.js"),n=new qp("workspace",t,this.logger);if(n.isValid)return n}}return null}bundledVersion(){const e=C(import.meta.url);try{const t=e.resolve("typescript"),n=b.join(b.dirname(t),"tsserver.js");return new qp("bundled",n,this.logger)}catch(e){return null}}}const Mp=Object.freeze({module:Rl.ESNext,moduleResolution:El.Node,target:Tl.ES2020,jsx:wl.React});function Fp(e){const t={...Mp};return e.checkJs&&(t.checkJs=!0),e.experimentalDecorators&&(t.experimentalDecorators=!0),e.strictNullChecks&&(t.strictNullChecks=!0),e.strictFunctionTypes&&(t.strictFunctionTypes=!0),e.module&&(t.module=e.module),e.target&&(t.target=e.target),t.sourceMap=!0,t}var Lp=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===jp}(e)}(e)};var jp="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function $p(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Kp((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Hp(e,t,n){return e.concat(t).map((function(e){return $p(e,n)}))}function Wp(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function Vp(e,t){try{return t in e}catch(e){return!1}}function Up(e,t,n){var r={};return n.isMergeableObject(e)&&Wp(e).forEach((function(t){r[t]=$p(e[t],n)})),Wp(t).forEach((function(i){(function(e,t){return Vp(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Vp(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Kp;var n=t.customMerge(e);return"function"==typeof n?n:Kp}(i,n)(e[i],t[i],n):r[i]=$p(t[i],n))})),r}function Kp(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Hp,n.isMergeableObject=n.isMergeableObject||Lp,n.cloneUnlessOtherwiseSpecified=$p;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Up(e,t,n):$p(t,n)}Kp.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Kp(e,n,t)}),{})};const Gp=k(Kp),zp={allowIncompleteCompletions:!0,allowRenameOfImportPath:!0,allowTextChangesInNewFiles:!0,autoImportFileExcludePatterns:[],disableLineTextInReferences:!0,disableSuggestions:!1,displayPartsForJSDoc:!0,generateReturnInDocTemplate:!0,importModuleSpecifierEnding:"auto",importModuleSpecifierPreference:"shortest",includeAutomaticOptionalChainCompletions:!0,includeCompletionsForImportStatements:!0,includeCompletionsForModuleExports:!0,includeCompletionsWithClassMemberSnippets:!0,includeCompletionsWithInsertText:!0,includeCompletionsWithObjectLiteralMethodSnippets:!0,includeCompletionsWithSnippetText:!0,includeInlayEnumMemberValueHints:!1,includeInlayFunctionLikeReturnTypeHints:!1,includeInlayFunctionParameterTypeHints:!1,includeInlayParameterNameHints:"none",includeInlayParameterNameHintsWhenArgumentMatchesName:!1,includeInlayPropertyDeclarationTypeHints:!1,includeInlayVariableTypeHints:!1,includeInlayVariableTypeHintsWhenTypeMatchesName:!1,includePackageJsonAutoImports:"auto",jsxAttributeCompletionStyle:"auto",lazyConfiguredProjectsFromExternalProject:!1,organizeImportsAccentCollation:!0,organizeImportsCaseFirst:!1,organizeImportsCollation:"ordinal",organizeImportsCollationLocale:"en",organizeImportsIgnoreCase:"auto",organizeImportsNumericCollation:!1,providePrefixAndSuffixTextForRename:!0,provideRefactorNotApplicableReason:!0,quotePreference:"auto",useLabelDetailsInCompletionEntries:!0},Bp={implicitProjectConfiguration:{checkJs:!1,experimentalDecorators:!1,module:Rl.ESNext,strictFunctionTypes:!0,strictNullChecks:!0,target:Tl.ES2020}};class Jp{constructor(e){this.documents=e,this.tsPreferences=Gp({},zp),this.workspaceConfiguration=Gp({},Bp),this.tspClient=null}mergeTsPreferences(e){this.tsPreferences=Gp(this.tsPreferences,e)}setWorkspaceConfiguration(e){this.workspaceConfiguration=Gp(Bp,e)}setAndConfigureTspClient(e,t,n){this.tspClient=t;const r={...n?{hostInfo:n}:{},formatOptions:{newLineCharacter:"\n"},preferences:{...this.tsPreferences,autoImportFileExcludePatterns:this.getAutoImportFileExcludePatternsPreference(e)}};t.request(bl.Configure,r)}async configureGloballyFromDocument(e,t){const n={formatOptions:this.getFormattingOptions(e,t),preferences:this.getPreferences(e)};await(this.tspClient?.request(bl.Configure,n))}getPreferences(e){if(this.tspClient?.apiVersion.lt(yl.v290))return{};const t=this.getWorkspacePreferencesForFile(e),n=Object.assign({},this.tsPreferences,t?.inlayHints||{});return{...n,quotePreference:this.getQuoteStylePreference(n)}}getFormattingOptions(e,t){const n=this.getWorkspacePreferencesForFile(e),r={...n?.format,...t};return void 0===r.convertTabsToSpaces&&(r.convertTabsToSpaces=t?.insertSpaces),void 0===r.indentSize&&(r.indentSize=t?.tabSize),r}getQuoteStylePreference(e){switch(e.quotePreference){case"single":return"single";case"double":return"double";default:return this.tspClient?.apiVersion.gte(yl.v333)?"auto":void 0}}getWorkspacePreferencesForFile(e){const t=this.documents.get(e),n=t?.languageId.startsWith("typescript")?"typescript":"javascript";return this.workspaceConfiguration[n]||{}}getAutoImportFileExcludePatternsPreference(e){if(e&&0!==this.tsPreferences.autoImportFileExcludePatterns.length)return this.tsPreferences.autoImportFileExcludePatterns.map((t=>{const n=t.replace(/\\/g,"/"),r=/^\.\.?($|\/)/.test(n);return b.posix.isAbsolute(t)?t:t.startsWith("*")?`/${n}`:r?b.posix.join(e,t):`/**/${n}`}))}}class Yp{constructor(e){this.options=e,this._tspClient=null,this.hasShutDown=!1,this.initializeParams=null,this.typeScriptAutoFixProvider=null,this.features={},this.documents=new ud,this.pendingDebouncedRequest=!1,this.doRequestDiagnosticsDebounced=Wa((()=>this.doRequestDiagnostics()),200),this.configurationManager=new Jp(this.documents),this.logger=new La(e.logger,"[lspserver]")}closeAll(){for(const e of[...this.documents.files])this.closeDocument(e)}shutdown(){this._tspClient&&(this._tspClient.shutdown(),this._tspClient=null,this.hasShutDown=!0)}get tspClient(){if(!this._tspClient)throw new Error('TS client not created. Did you forget to send the "initialize" request?');return this._tspClient}async initialize(e){if(this.logger.log("initialize",e),this._tspClient)throw new Error('The "initialize" request has already called before.');this.initializeParams=e;const t=this.initializeParams.capabilities;this.workspaceRoot=this.initializeParams.rootUri?Fh(this.initializeParams.rootUri):this.initializeParams.rootPath||void 0;const n=this.initializeParams.initializationOptions||{},{disableAutomaticTypingAcquisition:r,hostInfo:i,maxTsServerMemory:o,npmLocation:s,locale:a,tsserver:c}=n,{plugins:u}={plugins:n.plugins||[]},l=[],h=[];for(const e of u)l.push(e.name),h.push(e.location);const d=this.findTypescriptVersion(c?.path);if(!d)throw Error('Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting.');this.options.lspClient.logMessage({type:ye.MessageType.Info,message:`Using Typescript version (${d.source}) ${d.versionString} from path "${d.tsServerPath}"`}),this.configurationManager.mergeTsPreferences(n.preferences||{}),this.features.completionDisableFilterText=n.completionDisableFilterText??!1;const{textDocument:p}=t;if(p){const{codeAction:e,completion:t,definition:n,publishDiagnostics:r}=p;if(e&&(this.features.codeActionDisabledSupport=e.disabledSupport),t){const{completionItem:e}=t;if(e){const{commitCharactersSupport:t,insertReplaceSupport:n,labelDetailsSupport:r,snippetSupport:i}=e;this.features.completionCommitCharactersSupport=t,this.features.completionInsertReplaceSupport=n,this.features.completionSnippets=i,this.features.completionLabelDetails=this.configurationManager.tsPreferences.useLabelDetailsInCompletionEntries&&r&&d.version?.gte(yl.v470)}}n&&(this.features.definitionLinkSupport=n.linkSupport&&d.version?.gte(yl.v270)),r&&(this.features.diagnosticsTagSupport=Boolean(r.tagSupport))}this.configurationManager.mergeTsPreferences({useLabelDetailsInCompletionEntries:this.features.completionLabelDetails});const f=c?.logVerbosity&&Rh.fromString(c?.logVerbosity);this._tspClient=new Ph({lspClient:this.options.lspClient,trace:Eh.fromString(c?.trace||"off"),typescriptVersion:d,logDirectoryProvider:new cp(this.getLogDirectoryPath(n)),logVerbosity:f??this.options.tsserverLogVerbosity,disableAutomaticTypingAcquisition:r,maxTsServerMemory:o,npmLocation:s,locale:a,globalPlugins:l,pluginProbeLocations:h,logger:this.options.logger,onEvent:this.onTsEvent.bind(this),onExit:(e,t)=>{if(this.shutdown(),e)throw new Error(`tsserver process has exited (exit code: ${e}, signal: ${t}). Stopping the server.`)},useSyntaxServer:Dh(n.tsserver?.useSyntaxServer)}),this.diagnosticQueue=new ed((e=>this.options.lspClient.publishDiagnostics(e)),this.documents,this.features,this.logger,this._tspClient);if(!this.tspClient.start())throw new Error("tsserver process has failed to start.");process.on("exit",(()=>{this.shutdown()})),process.on("SIGINT",(()=>{process.exit()})),this.typeScriptAutoFixProvider=new Zd(this.tspClient),this.configurationManager.setAndConfigureTspClient(this.workspaceRoot,this._tspClient,i),this.setCompilerOptionsForInferredProjects();const m=p?.rename?.prepareSupport&&this.tspClient.apiVersion.gte(yl.v310),g={capabilities:{textDocumentSync:ye.TextDocumentSyncKind.Incremental,completionProvider:{triggerCharacters:[".",'"',"'","/","@","<"],resolveProvider:!0},codeActionProvider:!t.textDocument?.codeAction?.codeActionLiteralSupport||{codeActionKinds:[...Zd.kinds.map((e=>e.value)),Id.SourceOrganizeImportsTs.value,Id.SourceRemoveUnusedImportsTs.value,Id.SourceSortImportsTs.value,Id.QuickFix.value,Id.Refactor.value]},definitionProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,documentHighlightProvider:!0,documentSymbolProvider:!0,executeCommandProvider:{commands:[hd.APPLY_WORKSPACE_EDIT,hd.APPLY_CODE_ACTION,hd.APPLY_REFACTORING,hd.CONFIGURE_PLUGIN,hd.ORGANIZE_IMPORTS,hd.APPLY_RENAME_FILE,hd.SOURCE_DEFINITION]},hoverProvider:!0,inlayHintProvider:!0,linkedEditingRangeProvider:!1,renameProvider:!m||{prepareProvider:!0},referencesProvider:!0,selectionRangeProvider:!0,signatureHelpProvider:{triggerCharacters:["(",",","<"],retriggerCharacters:[")"]},workspaceSymbolProvider:!0,implementationProvider:!0,typeDefinitionProvider:!0,foldingRangeProvider:!0,semanticTokensProvider:{documentSelector:null,legend:{tokenTypes:["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"],tokenModifiers:["declaration","static","async","readonly","defaultLibrary","local"]},full:!0,range:!0},workspace:{fileOperations:{willRename:{filters:[{scheme:"file",pattern:{glob:"**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}",matches:"file"}}]}}}}};return p?.callHierarchy&&d.version?.gte(yl.v380)&&(g.capabilities.callHierarchyProvider=!0),p?.linkedEditingRange&&d.version?.gte(yl.v510)&&(g.capabilities.linkedEditingRangeProvider=!0),this.logger.log("onInitialize result",g),g}initialized(e){const{apiVersion:t,typescriptVersionSource:n}=this.tspClient;this.options.lspClient.sendNotification(dd,{version:t.displayName,source:n})}findTypescriptVersion(e){const t=new Ap(e||this.options.tsserverPath,this.logger),n=t.getUserSettingVersion();if(n){if(n.isValid)return n;this.logger.logIgnoringVerbosity(Aa.Warning,`Typescript specified through user setting ignored due to invalid path "${n.path}"`)}if(this.workspaceRoot){const e=t.getWorkspaceVersion([this.workspaceRoot]);if(e)return e}const r=t.bundledVersion();return r?.isValid?r:null}getLogDirectoryPath(e){return e.tsserver?.logDirectory?e.tsserver.logDirectory:this.workspaceRoot?v.join(this.workspaceRoot,".log"):void 0}setCompilerOptionsForInferredProjects(){const e={options:{...Fp(this.configurationManager.workspaceConfiguration.implicitProjectConfiguration),allowJs:!0,allowNonTsExtensions:!0,allowSyntheticDefaultImports:!0,resolveJsonModule:!0}};this.tspClient.executeWithoutWaitingForResponse(bl.CompilerOptionsForInferredProjects,e)}didChangeConfiguration(e){this.configurationManager.setWorkspaceConfiguration(e.settings||{}),this.setCompilerOptionsForInferredProjects();const t=this.configurationManager.workspaceConfiguration.diagnostics?.ignoredCodes||[];this.diagnosticQueue?.updateIgnoredDiagnosticCodes(t),this.cancelDiagnostics(),this.requestDiagnostics()}interuptDiagnostics(e){if(!this.diagnosticsTokenSource)return e();this.cancelDiagnostics();const t=e();return this.requestDiagnostics(),t}async requestDiagnostics(){this.pendingDebouncedRequest=!0,await this.doRequestDiagnosticsDebounced()}async doRequestDiagnostics(){if(this.cancelDiagnostics(),this.hasShutDown)return;const e=new ye.CancellationTokenSource;this.diagnosticsTokenSource=e;const{files:t}=this.documents;try{return await this.tspClient.requestGeterr({delay:0,files:t},this.diagnosticsTokenSource.token)}finally{this.diagnosticsTokenSource===e&&(this.diagnosticsTokenSource=void 0,this.pendingDebouncedRequest=!1)}}cancelDiagnostics(){this.diagnosticsTokenSource&&(this.diagnosticsTokenSource.cancel(),this.diagnosticsTokenSource=void 0)}didOpenTextDocument(e){const t=Fh(e.textDocument.uri);this.logger.log("onDidOpenTextDocument",e,t),t&&(this.documents.open(t,e.textDocument)?(this.tspClient.notify(bl.Open,{file:t,fileContent:e.textDocument.text,scriptKindName:this.getScriptKindName(e.textDocument.languageId),projectRootPath:this.workspaceRoot}),this.cancelDiagnostics(),this.requestDiagnostics()):(this.logger.log(`Cannot open already opened doc '${e.textDocument.uri}'.`),this.didChangeTextDocument({textDocument:e.textDocument,contentChanges:[{text:e.textDocument.text}]})))}getScriptKindName(e){switch(e){case"typescript":return"TS";case"typescriptreact":return"TSX";case"javascript":return"JS";case"javascriptreact":return"JSX"}}didCloseTextDocument(e){const t=Fh(e.textDocument.uri);this.logger.log("onDidCloseTextDocument",e,t),t&&this.closeDocument(t)}closeDocument(e){const t=this.documents.close(e);t&&(this.tspClient.notify(bl.Close,{file:e}),this.options.lspClient.publishDiagnostics({uri:t.uri,diagnostics:[]}))}didChangeTextDocument(e){const{textDocument:t}=e,n=Fh(t.uri);if(this.logger.log("onDidChangeTextDocument",e,n),!n)return;const r=this.documents.get(n);if(!r)throw this.logger.error(`Received change on non-opened document ${t.uri}`),new Error(`Received change on non-opened document ${t.uri}`);if(null===t.version)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);for(const i of e.contentChanges){let e=0,o=0,s=0,a=0;if(ye.TextDocumentContentChangeEvent.isIncremental(i))e=i.range.start.line+1,o=i.range.start.character+1,s=i.range.end.line+1,a=i.range.end.character+1;else{e=1,o=1;const t=r.positionAt(r.getText().length);s=t.line+1,a=t.character+1}this.tspClient.notify(bl.Change,{file:n,line:e,offset:o,endLine:s,endOffset:a,insertString:i.text}),r.applyEdit(t.version,i)}this.cancelDiagnostics(),this.requestDiagnostics()}didSaveTextDocument(e){}async definition(e,t){return this.getDefinition({type:this.features.definitionLinkSupport?bl.DefinitionAndBoundSpan:bl.Definition,params:e},t)}async implementation(e,t){return this.getSymbolLocations({type:bl.Implementation,params:e},t)}async typeDefinition(e,t){return this.getSymbolLocations({type:bl.TypeDefinition,params:e},t)}async getDefinition({type:e,params:t},n){const r=Fh(t.textDocument.uri);if(this.logger.log(e,t,r),r){if(e===bl.DefinitionAndBoundSpan){const i=Ih.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);if("response"!==o.type||!o.body)return;const s=o.body.textSpan?qh.fromTextSpan(o.body.textSpan):void 0;return o.body.definitions.map((e=>{const t=Wh(e,this.documents),n=e.contextStart&&e.contextEnd?qh.fromLocations(e.contextStart,e.contextEnd):t.range;return{originSelectionRange:s,targetRange:n,targetUri:t.uri,targetSelectionRange:t.range}}))}return this.getSymbolLocations({type:bl.Definition,params:t})}}async getSymbolLocations({type:e,params:t},n){const r=Fh(t.textDocument.uri);if(this.logger.log(e,t,r),!r)return[];const i=Ih.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);return"response"===o.type&&o.body?o.body.map((e=>Wh(e,this.documents))):void 0}async documentSymbol(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("symbol",e,n),!n)return[];const r=await this.tspClient.request(bl.NavTree,{file:n},t);if("response"!==r.type||!r.body?.childItems)return[];if(this.supportHierarchicalDocumentSymbol){const e=[];for(const t of r.body.childItems)Fd(t,e);return e}const i=[];for(const t of r.body.childItems)jd(e.textDocument.uri,t,i);return i}get supportHierarchicalDocumentSymbol(){const e=this.initializeParams?.capabilities.textDocument,t=e?.documentSymbol;return!!t&&!!t.hierarchicalDocumentSymbolSupport}async completion(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("completion",e,n),!n)return ye.CompletionList.create([]);const r=this.documents.get(n);if(!r)throw new Error(`The document should be opened for completion, file: ${n}`);const i=this.configurationManager.workspaceConfiguration.completions||{},o=await this.interuptDiagnostics((()=>this.tspClient.request(bl.CompletionInfo,{file:n,line:e.position.line+1,offset:e.position.character+1,triggerCharacter:Td(e.context?.triggerCharacter),triggerKind:e.context?.triggerKind},t)));if("response"!==o.type||!o.body)return ye.CompletionList.create();const{entries:s,isIncomplete:a,optionalReplacementSpan:c,isMemberCompletion:u}=o.body,l=r.getLine(e.position.line);let h;if(u){const t=l.slice(0,e.position.character).match(/\??\.\s*$/)||void 0;if(t){const n=ye.Position.create(e.position.line,e.position.character-t[0].length),i=ye.Range.create(n,e.position);h={range:i,text:r.getText(i)}}}const d={isMemberCompletion:u,dotAccessorContext:h,line:l,optionalReplacementRange:c?qh.fromTextSpan(c):void 0},p=[];for(const t of s||[]){if("warning"===t.kind)continue;const o=Rd(t,n,e.position,r,this.documents,i,this.features,d);o&&p.push(o)}return ye.CompletionList.create(p,a)}async completionResolve(e,t){this.logger.log("completion/resolve",e);const n=e.data?.file?this.documents.get(e.data.file):void 0;await this.configurationManager.configureGloballyFromDocument(e.data.file);const r=await this.interuptDiagnostics((()=>this.tspClient.request(bl.CompletionDetails,e.data,t)));return"response"===r.type&&r.body?.length?_d(e,r.body[0],n,this.tspClient,this.documents,this.configurationManager.workspaceConfiguration.completions||{},this.features):e}async hover(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("hover",e,n),!n)return{contents:[]};const r=await this.interuptDiagnostics((()=>this.getQuickInfo(n,e.position,t)));if(!r?.body)return{contents:[]};const i=new pd,{displayString:o,documentation:s,tags:a}=r.body;return o&&i.appendCodeblock("typescript",o),bd(i,s,a,this.documents),{contents:i.toMarkupContent(),range:qh.fromTextSpan(r.body)}}async getQuickInfo(e,t,n){const r=await this.tspClient.request(bl.Quickinfo,{file:e,line:t.line+1,offset:t.character+1},n);if("response"===r.type)return r}async prepareRename(e,t){const n=Fh(e.textDocument.uri);if(!n)return null;const r=await this.tspClient.request(bl.Rename,Ih.toFileLocationRequestArgs(n,e.position),t);if("response"!==r.type||!r.body?.info)return null;const i=r.body.info;if(!i.canRename)throw new Error(i.localizedErrorMessage);return qh.fromTextSpan(i.triggerSpan)}async rename(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("onRename",e,n),!n)return null;const r=await this.interuptDiagnostics((async()=>(await this.configurationManager.configureGloballyFromDocument(n),await this.tspClient.request(bl.Rename,Ih.toFileLocationRequestArgs(n,e.position),t))));if("response"!==r.type||!r.body?.info.canRename||!r.body?.locs.length)return null;const i={};return r.body.locs.forEach((t=>{const n=Lh(t.file,this.documents),r=i[n]||(i[n]=[]);t.locs.forEach((t=>{r.push({newText:`${t.prefixText||""}${e.newName}${t.suffixText||""}`,range:{start:Ih.fromLocation(t.start),end:Ih.fromLocation(t.end)}})}))})),{changes:i}}async references(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("onReferences",e,n),!n)return[];const r=await this.tspClient.request(bl.References,{file:n,line:e.position.line+1,offset:e.position.character+1},t);return"response"===r.type&&r.body?r.body.refs.filter((t=>e.context.includeDeclaration||!t.isDefinition)).map((e=>Wh(e,this.documents))):[]}async documentFormatting(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("documentFormatting",e,n),!n)return[];const r=e.options;await this.configurationManager.configureGloballyFromDocument(n,r);const i=this.documents.get(n);if(!i)throw new Error(`The document should be opened for formatting', file: ${n}`);const o=await this.tspClient.request(bl.Format,{...qh.toFormattingRequestArgs(n,i.getFullRange()),options:r},t);return"response"===o.type&&o.body?o.body.map((e=>Jh(e))):[]}async documentRangeFormatting(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("documentRangeFormatting",e,n),!n)return[];const r=e.options;await this.configurationManager.configureGloballyFromDocument(n,r);const i=await this.tspClient.request(bl.Format,{...qh.toFormattingRequestArgs(n,e.range),options:r},t);return"response"===i.type&&i.body?i.body.map((e=>Jh(e))):[]}async selectionRanges(e,t){const n=Fh(e.textDocument.uri);if(!n)return null;const r=await this.tspClient.request(bl.SelectionRange,{file:n,locations:e.positions.map(Ih.toLocation)},t);return"response"===r.type&&r.body?r.body.map(Bh):null}async signatureHelp(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("signatureHelp",e,n),!n)return;const r=await this.interuptDiagnostics((()=>this.getSignatureHelp(n,e,t)));return r?.body?kd(r.body,e.context,this.documents):void 0}async getSignatureHelp(e,t,n){const{position:r,context:i}=t,o=await this.tspClient.request(bl.SignatureHelp,{file:e,line:r.line+1,offset:r.character+1,triggerReason:i?Od(i):void 0},n);if("response"===o.type)return o}async codeAction(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("codeAction",e,n),!n)return[];await this.configurationManager.configureGloballyFromDocument(n);const r=qh.toFileRangeRequestArgs(n,e.range),i=[],o=e.context.only?.map((e=>new Id(e)));var s,a;o&&!o.some((e=>e.contains(Id.QuickFix)))||i.push(...(s=await this.getCodeFixes(r,e.context,t),a=this.documents,s?.body?s.body.map((e=>ye.CodeAction.create(e.description,{title:e.description,command:hd.APPLY_WORKSPACE_EDIT,arguments:[{documentChanges:e.changes.map((e=>Yh(e,a)))}]},ye.CodeActionKind.QuickFix))):[])),o&&!o.some((e=>e.contains(Id.Refactor)))||i.push(...function(e,t,n){if(!e?.body)return[];const r=[];for(const i of e.body)if(!1===i.inlineable)r.push(Nd(i,t));else{const e=n.codeActionDisabledSupport?i.actions:i.actions.filter((e=>!e.notApplicableReason));for(const n of e)r.push(qd(n,i,t))}return r}(await this.getRefactors(r,e.context,t),r,this.features));for(const n of o||[])for(const o of Ad){if(!n.contains(o.kind)||o.minVersion&&this.tspClient.apiVersion.lt(o.minVersion))continue;let s=o.mode===xl.SortAndCombine,a=o.mode;if(o.kind.equals(Id.SourceOrganizeImportsTs)){const t=e.context.diagnostics.some((e=>(e.severity??0)<=2));s=t,a=xl.SortAndCombine}const c=await this.interuptDiagnostics((()=>this.tspClient.request(bl.OrganizeImports,{scope:{type:"file",args:r},skipDestructiveCodeActions:s,mode:a},t)));"response"===c.type&&c.body&&i.push(...Md(o,c,this.documents))}if(o&&!this.pendingDebouncedRequest){const e=this.diagnosticQueue?.getDiagnosticsForFile(n)||[];e.length&&i.push(...await this.typeScriptAutoFixProvider.provideCodeActions(o,n,e,this.documents))}return this.logger.log(`codeAction returned with ${i.length} actions`),i}async getCodeFixes(e,t,n){const r=t.diagnostics.map((e=>Number(e.code))),i={...e,errorCodes:r},o=await this.tspClient.request(bl.GetCodeFixes,i,n);return"response"===o.type?o:void 0}async getRefactors(e,t,n){const r={...e,triggerReason:t.triggerKind===ye.CodeActionTriggerKind.Invoked?"invoked":void 0,kind:1===t.only?.length?t.only[0]:void 0},i=await this.tspClient.request(bl.GetApplicableRefactors,r,n);return"response"===i.type?i:void 0}async executeCommand(e,t,n){if(this.logger.log("executeCommand",e),e.command===hd.APPLY_WORKSPACE_EDIT&&e.arguments){const t=e.arguments[0];await this.options.lspClient.applyWorkspaceEdit({edit:t})}else if(e.command===hd.APPLY_CODE_ACTION&&e.arguments){const n=e.arguments[0];if(!await this.applyFileCodeEdits(n.changes))return;if(n.commands?.length)for(const e of n.commands)await this.tspClient.request(bl.ApplyCodeActionCommand,{command:e},t)}else if(e.command===hd.APPLY_REFACTORING&&e.arguments){const n=e.arguments[0],r=await this.tspClient.request(bl.GetEditsForRefactor,n,t);if("response"!==r.type||!r.body)return;const{body:i}=r;if(!i?.edits.length)return;for(const e of i.edits)await Ia.ensureFile(e.fileName);if(!await this.applyFileCodeEdits(i.edits))return;const o=i.renameLocation;o&&await this.options.lspClient.rename({textDocument:{uri:Lh(n.file,this.documents)},position:Ih.fromLocation(o)})}else if(e.command===hd.CONFIGURE_PLUGIN&&e.arguments){const[t,n]=e.arguments;this.tspClient.apiVersion.gte(yl.v314)&&this.tspClient.executeWithoutWaitingForResponse(bl.ConfigurePlugin,{configuration:n,pluginName:t})}else if(e.command===hd.ORGANIZE_IMPORTS&&e.arguments){const n=e.arguments[0],r=e.arguments[1]||{};await this.configurationManager.configureGloballyFromDocument(n);const i=await this.tspClient.request(bl.OrganizeImports,{scope:{type:"file",args:{file:n}},skipDestructiveCodeActions:r.skipDestructiveCodeActions},t);if("response"!==i.type||!i.body)return;const{body:o}=i;await this.applyFileCodeEdits(o)}else if(e.command===hd.APPLY_RENAME_FILE&&e.arguments){const{sourceUri:n,targetUri:r}=e.arguments[0];this.applyRenameFile(n,r,t)}else if(e.command===hd.APPLY_COMPLETION_CODE_ACTION&&e.arguments){const[n,r]=e.arguments;for(const e of r){if(await this.applyFileCodeEdits(e.changes),e.commands?.length)for(const n of e.commands)await this.tspClient.request(bl.ApplyCodeActionCommand,{command:n},t);break}}else{if(e.command===hd.SOURCE_DEFINITION){const[r,i]=e.arguments||[],o=await this.options.lspClient.createProgressReporter(t,n);return ld.execute(r,i,this.documents,this.tspClient,this.options.lspClient,o,t)}this.logger.error(`Unknown command ${e.command}.`)}}async applyFileCodeEdits(e){if(!e.length)return!1;const t={};for(const n of e)t[Lh(n.fileName,this.documents)]=n.textChanges.map(Jh);const{applied:n}=await this.options.lspClient.applyWorkspaceEdit({edit:{changes:t}});return n}async willRenameFiles(e,t){const n={};for(const r of e.files){const e=await this.getEditsForFileRename(r.oldUri,r.newUri,t);for(const t of e){const e=Lh(t.fileName,this.documents);(n[e]||(n[e]=[])).push(...t.textChanges.map(Jh))}}return{changes:n}}async applyRenameFile(e,t,n){const r=await this.getEditsForFileRename(e,t,n);this.applyFileCodeEdits(r)}async getEditsForFileRename(e,t,n){const r=Fh(t),i=Fh(e);if(!r||!i)return[];const o=await this.tspClient.request(bl.GetEditsForFileRename,{oldFilePath:i,newFilePath:r},n);return"response"===o.type&&o.body?o.body:[]}async documentHighlight(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("documentHighlight",e,n),!n)return[];const r=await this.tspClient.request(bl.DocumentHighlights,{file:n,line:e.position.line+1,offset:e.position.character+1,filesToSearch:[n]},t);if("response"!==r.type||!r.body)return[];const i=[];for(const e of r.body)if(jh(e.file)===n){const t=Xh(e);i.push(...t)}return i}lastFileOrDummy(){return this.documents.files[0]||this.workspaceRoot}async workspaceSymbol(e,t){const n=await this.tspClient.request(bl.Navto,{file:this.lastFileOrDummy(),searchValue:e.query},t);return"response"===n.type&&n.body?n.body.map((e=>({location:{uri:Lh(e.file,this.documents),range:{start:Ih.fromLocation(e.start),end:Ih.fromLocation(e.end)}},kind:Uh(e.kind),name:e.name}))):[]}async foldingRanges(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("foldingRanges",e,n),!n)return;const r=this.documents.get(n);if(!r)throw new Error(`The document should be opened for foldingRanges', file: ${n}`);const i=await this.tspClient.request(bl.GetOutliningSpans,{file:n},t);if("response"!==i.type||!i.body)return;const o=[];for(const e of i.body){const t=this.asFoldingRange(e,r);t&&o.push(t)}return o}asFoldingRange(e,t){const n=qh.fromTextSpan(e.textSpan),r=this.asFoldingRangeKind(e);if("comment"===e.kind){if(t.getLine(n.start.line).match(/\/\/\s*#endregion/gi))return}return{startLine:n.start.line,endLine:n.end.character>0&&"}"===t.getText(ye.Range.create(ye.Position.create(n.end.line,n.end.character-1),n.end))?Math.max(n.end.line-1,n.start.line):n.end.line,kind:r}}asFoldingRangeKind(e){switch(e.kind){case"comment":return ye.FoldingRangeKind.Comment;case"region":return ye.FoldingRangeKind.Region;case"imports":return ye.FoldingRangeKind.Imports;default:return}}async onTsEvent(e){if("semanticDiag"===e.event||"syntaxDiag"===e.event||"suggestionDiag"===e.event){const t=e;if(t.body?.diagnostics){const{file:n,diagnostics:r}=t.body;this.diagnosticQueue?.updateDiagnostics(function(e){switch(e.event){case"syntaxDiag":return 0;case"semanticDiag":return 1;case"suggestionDiag":return 2}throw new Error("Unknown dignostics kind")}(e),n,r)}}}async prepareCallHierarchy(e,t){const n=Fh(e.textDocument.uri);if(!n)return null;const r=Ih.toFileLocationRequestArgs(n,e.position),i=await this.tspClient.request(bl.PrepareCallHierarchy,r,t);if("response"!==i.type||!i.body)return null;return(Array.isArray(i.body)?i.body:[i.body]).map((e=>Hd(e,this.documents,this.workspaceRoot)))}async callHierarchyIncomingCalls(e,t){const n=Fh(e.item.uri);if(!n)return null;const r=Ih.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(bl.ProvideCallHierarchyIncomingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{from:Hd(e.from,t,n),fromRanges:e.fromSpans.map(qh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async callHierarchyOutgoingCalls(e,t){const n=Fh(e.item.uri);if(!n)return null;const r=Ih.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(bl.ProvideCallHierarchyOutgoingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{to:Hd(e.to,t,n),fromRanges:e.fromSpans.map(qh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async inlayHints(e,t){return await ep.provideInlayHints(e.textDocument.uri,e.range,this.documents,this.tspClient,this.options.lspClient,this.configurationManager,t)}async linkedEditingRange(e,t){const n=Fh(e.textDocument.uri);if(!n)return null;const r=Ih.toFileLocationRequestArgs(n,e.position),i=await this.tspClient.request(bl.LinkedEditingRange,r,t);return"response"===i.type&&i.body?{ranges:i.body.ranges.map(qh.fromTextSpan),wordPattern:i.body.wordPattern}:null}async semanticTokensFull(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("semanticTokensFull",e,n),!n)return{data:[]};const r=this.documents.get(n);if(!r)return{data:[]};const i=r.offsetAt({line:0,character:0}),o=r.offsetAt({line:r.lineCount,character:0});return this.getSemanticTokens(r,n,i,o,t)}async semanticTokensRange(e,t){const n=Fh(e.textDocument.uri);if(this.logger.log("semanticTokensRange",e,n),!n)return{data:[]};const r=this.documents.get(n);if(!r)return{data:[]};const i=r.offsetAt(e.range.start),o=r.offsetAt(e.range.end);return this.getSemanticTokens(r,n,i,o,t)}async getSemanticTokens(e,t,n,r,i){const o=await this.tspClient.request(bl.EncodedSemanticClassificationsFull,{file:t,start:n,length:r-n,format:"2020"},i);return"response"===o.type&&o.body?.spans?{data:ap(e,o.body.spans)}:{data:[]}}}const Xp=Or(void 0,void 0);class Qp{constructor(e){this.connection=e}async createProgressReporter(e,t){let n;return n=t&&t.constructor!==Xp.constructor?t:t||await this.connection.window.createWorkDoneProgress(),n}async withProgress(e,t){const{message:n,reporter:r}=e;return r.begin(n),t(r).then((e=>(r.done(),e)))}publishDiagnostics(e){this.connection.sendDiagnostics(e)}showErrorMessage(e){this.connection.sendNotification(ye.ShowMessageNotification.type,{type:ye.MessageType.Error,message:e})}logMessage(e){this.connection.sendNotification(ye.LogMessageNotification.type,e)}async applyWorkspaceEdit(e){return this.connection.workspace.applyEdit(e)}async rename(e){return this.connection.sendRequest(vl.type,e)}async sendNotification(e,t){await this.connection.sendNotification(e,t)}}const Zp=mi.MessageType.Info,{version:ef}=JSON.parse(r(new URL("../package.json",import.meta.url),{encoding:"utf8"})),tf=new pe("typescript-language-server").version(ef).requiredOption("--stdio","use stdio").option("--log-level <logLevel>","A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `2`.").option("--tsserver-log-verbosity <tsserverLogVerbosity>","[deprecated] Specify a tsserver log verbosity (terse, normal, verbose). Defaults to `normal`. example: --tsserver-log-verbosity verbose").option("--tsserver-path <path>","[deprecated] Specify path to tsserver.js or the lib directory. example: --tsserver-path=/Users/me/typescript/lib/tsserver.js").option("--log-directory <path>","Directory for LSP logs").parse(process.argv).opts();let nf=Zp;tf.logLevel&&(nf=parseInt(tf.logLevel,10),nf&&(nf<1||nf>4)&&(console.error(`Invalid '--log-level ${nf}'. Falling back to 'info' level.`),nf=Zp)),function(e){const t=gi.createConnection(gi.ProposedFeatures.all),n=new Qp(t),r=e.logDirectory?new Fa(e.logDirectory,e.showMessageLevel):new Ma(n,e.showMessageLevel),i=new Yp({logger:r,lspClient:n,tsserverPath:e.cmdLineTsserverPath,tsserverLogVerbosity:e.cmdLineTsserverLogVerbosity});return t.onInitialize(i.initialize.bind(i)),t.onInitialized(i.initialized.bind(i)),t.onDidChangeConfiguration(i.didChangeConfiguration.bind(i)),t.onDidOpenTextDocument(i.didOpenTextDocument.bind(i)),t.onDidSaveTextDocument(i.didSaveTextDocument.bind(i)),t.onDidCloseTextDocument(i.didCloseTextDocument.bind(i)),t.onDidChangeTextDocument(i.didChangeTextDocument.bind(i)),t.onCodeAction(i.codeAction.bind(i)),t.onCompletion(i.completion.bind(i)),t.onCompletionResolve(i.completionResolve.bind(i)),t.onDefinition(i.definition.bind(i)),t.onImplementation(i.implementation.bind(i)),t.onTypeDefinition(i.typeDefinition.bind(i)),t.onDocumentFormatting(i.documentFormatting.bind(i)),t.onDocumentRangeFormatting(i.documentRangeFormatting.bind(i)),t.onDocumentHighlight(i.documentHighlight.bind(i)),t.onDocumentSymbol(i.documentSymbol.bind(i)),t.onExecuteCommand(i.executeCommand.bind(i)),t.onHover(i.hover.bind(i)),t.onReferences(i.references.bind(i)),t.onRenameRequest(i.rename.bind(i)),t.onPrepareRename(i.prepareRename.bind(i)),t.onSelectionRanges(i.selectionRanges.bind(i)),t.onSignatureHelp(i.signatureHelp.bind(i)),t.onWorkspaceSymbol(i.workspaceSymbol.bind(i)),t.onFoldingRanges(i.foldingRanges.bind(i)),t.languages.onLinkedEditingRange(i.linkedEditingRange.bind(i)),t.languages.callHierarchy.onPrepare(i.prepareCallHierarchy.bind(i)),t.languages.callHierarchy.onIncomingCalls(i.callHierarchyIncomingCalls.bind(i)),t.languages.callHierarchy.onOutgoingCalls(i.callHierarchyOutgoingCalls.bind(i)),t.languages.inlayHint.on(i.inlayHints.bind(i)),t.languages.semanticTokens.on(i.semanticTokensFull.bind(i)),t.languages.semanticTokens.onRange(i.semanticTokensRange.bind(i)),t.workspace.onWillRenameFiles(i.willRenameFiles.bind(i)),t}({cmdLineTsserverPath:tf.tsserverPath,cmdLineTsserverLogVerbosity:Rh.fromString(tf.tsserverLogVerbosity),logDirectory:tf.logDirectory,showMessageLevel:nf}).listen();
|
|
2
|
+
import e,{promises as t,statSync as n,existsSync as r,readFileSync as i}from"node:fs";import o from"events";import s from"child_process";import a from"path";import c from"fs";import u from"process";import l,{promisify as h}from"node:util";import d,{promisify as p}from"util";import f from"os";import m from"crypto";import g from"net";import y from"url";import*as v from"node:path";import b,{resolve as S}from"node:path";import w from"constants";import R from"stream";import C from"assert";import"node:fs/promises";import E from"node:stream";import _ from"node:os";import D from"node:child_process";import{createRequire as T}from"node:module";import x from"fs/promises";import{fileURLToPath as k}from"node:url";import P from"node:process";var O="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function N(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var A={exports:{}},I={},q={};let M=class extends Error{constructor(e,t,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}};q.CommanderError=M,q.InvalidArgumentError=class extends M{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:F}=q;I.Argument=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e}this._name.length>3&&"..."===this._name.slice(-3)&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new F(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}},I.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"};var L={},j={};const{humanReadableArgName:$}=I;j.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){const t=e.commands.filter((e=>!e._hidden));if(e._hasImplicitHelpCommand()){const[,n,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),i=e.createCommand(n).helpOption(!1);i.description(e._helpCommandDescription),r&&i.arguments(r),t.push(i)}return this.sortSubcommands&&t.sort(((e,t)=>e.name().localeCompare(t.name()))),t}compareOptions(e,t){const n=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return n(e).localeCompare(n(t))}visibleOptions(e){const t=e.options.filter((e=>!e.hidden)),n=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(n||r){let i;i=n?r?e.createOption(e._helpFlags,e._helpDescription):e.createOption(e._helpShortFlag,e._helpDescription):e.createOption(e._helpLongFlag,e._helpDescription),t.push(i)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];const t=[];for(let n=e.parent;n;n=n.parent){const e=n.options.filter((e=>!e.hidden));t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach((t=>{t.description=t.description||e._argsDescription[t.name()]||""})),e.registeredArguments.find((e=>e.description))?e.registeredArguments:[]}subcommandTerm(e){const t=e.registeredArguments.map((e=>$(e))).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce(((e,n)=>Math.max(e,t.subcommandTerm(n).length)),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce(((e,n)=>Math.max(e,t.optionTerm(n).length)),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce(((e,n)=>Math.max(e,t.argumentTerm(n).length)),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let n="";for(let t=e.parent;t;t=t.parent)n=t.name()+" "+n;return n+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue){(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`)}return void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){const t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map((e=>JSON.stringify(e))).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){const n=`(${t.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,t){const n=t.padWidth(e,t),r=t.helpWidth||80;function i(e,i){if(i){const o=`${e.padEnd(n+2)}${i}`;return t.wrap(o,r-2,n+2)}return e}function o(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let s=[`Usage: ${t.commandUsage(e)}`,""];const a=t.commandDescription(e);a.length>0&&(s=s.concat([t.wrap(a,r,0),""]));const c=t.visibleArguments(e).map((e=>i(t.argumentTerm(e),t.argumentDescription(e))));c.length>0&&(s=s.concat(["Arguments:",o(c),""]));const u=t.visibleOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));if(u.length>0&&(s=s.concat(["Options:",o(u),""])),this.showGlobalOptions){const n=t.visibleGlobalOptions(e).map((e=>i(t.optionTerm(e),t.optionDescription(e))));n.length>0&&(s=s.concat(["Global Options:",o(n),""]))}const l=t.visibleCommands(e).map((e=>i(t.subcommandTerm(e),t.subcommandDescription(e))));return l.length>0&&(s=s.concat(["Commands:",o(l),""])),s.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,n,r=40){const i=new RegExp("[\\n][ \\f\\t\\v - \ufeff]+");if(e.match(i))return e;const o=t-n;if(o<r)return e;const s=e.slice(0,n),a=e.slice(n).replace("\r\n","\n"),c=" ".repeat(n),u="\\s",l=new RegExp(`\n|.{1,${o-1}}([${u}]|$)|[^${u}]+?([${u}]|$)`,"g");return s+(a.match(l)||[]).map(((e,t)=>"\n"===e?"":(t>0?c:"")+e.trimEnd())).join("\n")}};var H={};const{InvalidArgumentError:W}=q;function V(e){let t,n;const r=e.split(/[ |,]+/);return r.length>1&&!/^[[<]/.test(r[1])&&(t=r.shift()),n=r.shift(),!t&&/^-[^-]$/.test(n)&&(t=n,n=void 0),{shortFlag:t,longFlag:n}}H.Option=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;const n=V(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new W(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce(((e,t)=>e+t[0].toUpperCase()+t.slice(1)))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},H.splitOptionFlags=V,H.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach((e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)})),this.negativeOptions.forEach(((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)}))}valueFromOption(e,t){const n=t.attributeName();if(!this.dualOptions.has(n))return!0;const r=this.negativeOptions.get(n).presetArg,i=void 0!==r&&r;return t.negate===(i===e)}};var U={};const K=3;U.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));const n=e.startsWith("--");n&&(e=e.slice(2),t=t.map((e=>e.slice(2))));let r=[],i=K;return t.forEach((t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>K)return Math.max(e.length,t.length);const n=[];for(let t=0;t<=e.length;t++)n[t]=[t];for(let e=0;e<=t.length;e++)n[0][e]=e;for(let r=1;r<=t.length;r++)for(let i=1;i<=e.length;i++){let o=1;o=e[i-1]===t[r-1]?0:1,n[i][r]=Math.min(n[i-1][r]+1,n[i][r-1]+1,n[i-1][r-1]+o),i>1&&r>1&&e[i-1]===t[r-2]&&e[i-2]===t[r-1]&&(n[i][r]=Math.min(n[i][r],n[i-2][r-2]+1))}return n[e.length][t.length]}(e,t),o=Math.max(e.length,t.length);(o-n)/o>.4&&(n<i?(i=n,r=[t]):n===i&&r.push(t))})),r.sort(((e,t)=>e.localeCompare(t))),n&&(r=r.map((e=>`--${e}`))),r.length>1?`\n(Did you mean one of ${r.join(", ")}?)`:1===r.length?`\n(Did you mean ${r[0]}?)`:""};const G=o.EventEmitter,z=s,B=a,J=c,X=u,{Argument:Y,humanReadableArgName:Q}=I,{CommanderError:Z}=q,{Help:ee}=j,{Option:te,splitOptionFlags:ne,DualOptions:re}=H,{suggestSimilar:ie}=U;function oe(e,t){e._hasHelpOption&&t.find((t=>t===e._helpLongFlag||t===e._helpShortFlag))&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function se(e){return e.map((e=>{if(!e.startsWith("--inspect"))return e;let t,n,r="127.0.0.1",i="9229";return null!==(n=e.match(/^(--inspect(-brk)?)$/))?t=n[1]:null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:r=n[3]):null!==(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=n[1],r=n[3],i=n[4]),t&&"0"!==i?`${t}=${r}:${parseInt(i)+1}`:e}))}L.Command=class e extends G{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:e=>X.stdout.write(e),writeErr:e=>X.stderr.write(e),getOutHelpWidth:()=>X.stdout.isTTY?X.stdout.columns:void 0,getErrHelpWidth:()=>X.stderr.isTTY?X.stderr.columns:void 0,outputError:(e,t)=>t(e)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){const e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,n){let r=t,i=n;"object"==typeof r&&null!==r&&(i=r,r=null),i=i||{};const[,o,s]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return r&&(a.description(r),a._executableHandler=!0),i.isDefault&&(this._defaultCommandName=a._name),a._hidden=!(!i.noHelp&&!i.hidden),a._executableFile=i.executableFile||null,s&&a.arguments(s),this.commands.push(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(t){return new e(t)}createHelp(){return Object.assign(new ee,this.configureHelp())}configureHelp(e){return void 0===e?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return void 0===e?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return"string"!=typeof e&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error("Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()");return(t=t||{}).isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,t){return new Y(e,t)}argument(e,t,n,r){const i=this.createArgument(e,t);return"function"==typeof n?i.default(r).argParser(n):i.default(n),this.addArgument(i),this}arguments(e){return e.trim().split(/ +/).forEach((e=>{this.argument(e)})),this}addArgument(e){const t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&void 0!==e.defaultValue&&void 0===e.parseArg)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}addHelpCommand(e,t){return!1===e?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,"string"==typeof e&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=t||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return void 0===this._addImplicitHelpCommand?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,t){const n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.\nExpecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(t):this._lifeCycleHooks[e]=[t],this}exitOverride(e){return this._exitCallback=e||(e=>{if("commander.executeSubCommandAsync"!==e.code)throw e}),this}_exit(e,t,n){this._exitCallback&&this._exitCallback(new Z(e,t,n)),X.exit(e)}action(e){return this._actionHandler=t=>{const n=this.registeredArguments.length,r=t.slice(0,n);return this._storeOptionsAsProperties?r[n]=this:r[n]=this.opts(),r.push(this),e.apply(this,r)},this}createOption(e,t){return new te(e,t)}_callParseArg(e,t,n,r){try{return e.parseArg(t,n)}catch(e){if("commander.invalidArgument"===e.code){const t=`${r} ${e.message}`;this.error(t,{exitCode:e.exitCode,code:e.code})}throw e}}addOption(e){const t=e.name(),n=e.attributeName();if(e.negate){const t=e.long.replace(/^--no-/,"--");this._findOption(t)||this.setOptionValueWithSource(n,void 0===e.defaultValue||e.defaultValue,"default")}else void 0!==e.defaultValue&&this.setOptionValueWithSource(n,e.defaultValue,"default");this.options.push(e);const r=(t,r,i)=>{null==t&&void 0!==e.presetArg&&(t=e.presetArg);const o=this.getOptionValue(n);null!==t&&e.parseArg?t=this._callParseArg(e,t,o,r):null!==t&&e.variadic&&(t=e._concatValue(t,o)),null==t&&(t=!e.negate&&(!(!e.isBoolean()&&!e.optional)||"")),this.setOptionValueWithSource(n,t,i)};return this.on("option:"+t,(t=>{const n=`error: option '${e.flags}' argument '${t}' is invalid.`;r(t,n,"cli")})),e.envVar&&this.on("optionEnv:"+t,(t=>{const n=`error: option '${e.flags}' value '${t}' from env '${e.envVar}' is invalid.`;r(t,n,"env")})),this}_optionEx(e,t,n,r,i){if("object"==typeof t&&t instanceof te)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const o=this.createOption(t,n);if(o.makeOptionMandatory(!!e.mandatory),"function"==typeof r)o.default(i).argParser(r);else if(r instanceof RegExp){const e=r;r=(t,n)=>{const r=e.exec(t);return r?r[0]:n},o.default(i).argParser(r)}else o.default(r);return this.addOption(o)}option(e,t,n,r){return this._optionEx({},e,t,n,r)}requiredOption(e,t,n,r){return this._optionEx({mandatory:!0},e,t,n,r)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,t){return this.setOptionValueWithSource(e,t,void 0)}setOptionValueWithSource(e,t,n){return this._storeOptionsAsProperties?this[e]=t:this._optionValues[e]=t,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let t;return this._getCommandAndAncestors().forEach((n=>{void 0!==n.getOptionValueSource(e)&&(t=n.getOptionValueSource(e))})),t}_prepareUserArgs(e,t){if(void 0!==e&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");let n;switch(t=t||{},void 0===e&&(e=X.argv,X.versions&&X.versions.electron&&(t.from="electron")),this.rawArgs=e.slice(),t.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":X.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${t.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(e,t){const n=this._prepareUserArgs(e,t);return this._parseCommand([],n),this}async parseAsync(e,t){const n=this._prepareUserArgs(e,t);return await this._parseCommand([],n),this}_executeSubCommand(e,t){t=t.slice();let n=!1;const r=[".js",".ts",".tsx",".mjs",".cjs"];function i(e,t){const n=B.resolve(e,t);if(J.existsSync(n))return n;if(r.includes(B.extname(t)))return;const i=r.find((e=>J.existsSync(`${n}${e}`)));return i?`${n}${i}`:void 0}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o,s=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let e;try{e=J.realpathSync(this._scriptPath)}catch(t){e=this._scriptPath}a=B.resolve(B.dirname(e),a)}if(a){let t=i(a,s);if(!t&&!e._executableFile&&this._scriptPath){const n=B.basename(this._scriptPath,B.extname(this._scriptPath));n!==this._name&&(t=i(a,`${n}-${e._name}`))}s=t||s}if(n=r.includes(B.extname(s)),"win32"!==X.platform?n?(t.unshift(s),t=se(X.execArgv).concat(t),o=z.spawn(X.argv[0],t,{stdio:"inherit"})):o=z.spawn(s,t,{stdio:"inherit"}):(t.unshift(s),t=se(X.execArgv).concat(t),o=z.spawn(X.execPath,t,{stdio:"inherit"})),!o.killed){["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach((e=>{X.on(e,(()=>{!1===o.killed&&null===o.exitCode&&o.kill(e)}))}))}const c=this._exitCallback;c?o.on("close",(()=>{c(new Z(X.exitCode||0,"commander.executeSubCommandAsync","(close)"))})):o.on("close",X.exit.bind(X)),o.on("error",(t=>{if("ENOENT"===t.code){const t=a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",n=`'${s}' does not exist\n - if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${t}`;throw new Error(n)}if("EACCES"===t.code)throw new Error(`'${s}' not executable`);if(c){const e=new Z(1,"commander.executeSubCommandAsync","(error)");e.nestedError=t,c(e)}else X.exit(1)})),this.runningCommand=o}_dispatchSubcommand(e,t,n){const r=this._findCommand(e);let i;return r||this.help({error:!0}),i=this._chainOrCallSubCommandHook(i,r,"preSubcommand"),i=this._chainOrCall(i,(()=>{if(!r._executableHandler)return r._parseCommand(t,n);this._executeSubCommand(r,t.concat(n))})),i}_dispatchHelpCommand(e){e||this.help();const t=this._findCommand(e);return t&&!t._executableHandler&&t.help(),this._dispatchSubcommand(e,[],[this._helpLongFlag||this._helpShortFlag])}_checkNumberOfArguments(){this.registeredArguments.forEach(((e,t)=>{e.required&&null==this.args[t]&&this.missingArgument(e.name())})),this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic||this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const e=(e,t,n)=>{let r=t;if(null!==t&&e.parseArg){const i=`error: command-argument value '${t}' is invalid for argument '${e.name()}'.`;r=this._callParseArg(e,t,n,i)}return r};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach(((n,r)=>{let i=n.defaultValue;n.variadic?r<this.args.length?(i=this.args.slice(r),n.parseArg&&(i=i.reduce(((t,r)=>e(n,r,t)),n.defaultValue))):void 0===i&&(i=[]):r<this.args.length&&(i=this.args[r],n.parseArg&&(i=e(n,i,n.defaultValue))),t[r]=i})),this.processedArgs=t}_chainOrCall(e,t){return e&&e.then&&"function"==typeof e.then?e.then((()=>t())):t()}_chainOrCallHooks(e,t){let n=e;const r=[];return this._getCommandAndAncestors().reverse().filter((e=>void 0!==e._lifeCycleHooks[t])).forEach((e=>{e._lifeCycleHooks[t].forEach((t=>{r.push({hookedCommand:e,callback:t})}))})),"postAction"===t&&r.reverse(),r.forEach((e=>{n=this._chainOrCall(n,(()=>e.callback(e.hookedCommand,this)))})),n}_chainOrCallSubCommandHook(e,t,n){let r=e;return void 0!==this._lifeCycleHooks[n]&&this._lifeCycleHooks[n].forEach((e=>{r=this._chainOrCall(r,(()=>e(this,t)))})),r}_parseCommand(e,t){const n=this.parseOptions(t);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),t=n.unknown,this.args=e.concat(t),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),t);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return oe(this,t),this._dispatchSubcommand(this._defaultCommandName,e,t);!this.commands.length||0!==this.args.length||this._actionHandler||this._defaultCommandName||this.help({error:!0}),oe(this,n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const r=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){let n;return r(),this._processArguments(),n=this._chainOrCallHooks(n,"preAction"),n=this._chainOrCall(n,(()=>this._actionHandler(this.processedArgs))),this.parent&&(n=this._chainOrCall(n,(()=>{this.parent.emit(i,e,t)}))),n=this._chainOrCallHooks(n,"postAction"),n}if(this.parent&&this.parent.listenerCount(i))r(),this._processArguments(),this.parent.emit(i,e,t);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,t);this.listenerCount("command:*")?this.emit("command:*",e,t):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find((t=>t._name===e||t._aliases.includes(e)))}_findOption(e){return this.options.find((t=>t.is(e)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((e=>{e.options.forEach((t=>{t.mandatory&&void 0===e.getOptionValue(t.attributeName())&&e.missingMandatoryOptionValue(t)}))}))}_checkForConflictingLocalOptions(){const e=this.options.filter((e=>{const t=e.attributeName();return void 0!==this.getOptionValue(t)&&"default"!==this.getOptionValueSource(t)})),t=e.filter((e=>e.conflictsWith.length>0));t.forEach((t=>{const n=e.find((e=>t.conflictsWith.includes(e.attributeName())));n&&this._conflictingOption(t,n)}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((e=>{e._checkForConflictingLocalOptions()}))}parseOptions(e){const t=[],n=[];let r=t;const i=e.slice();function o(e){return e.length>1&&"-"===e[0]}let s=null;for(;i.length;){const e=i.shift();if("--"===e){r===n&&r.push(e),r.push(...i);break}if(!s||o(e)){if(s=null,o(e)){const t=this._findOption(e);if(t){if(t.required){const e=i.shift();void 0===e&&this.optionMissingArgument(t),this.emit(`option:${t.name()}`,e)}else if(t.optional){let e=null;i.length>0&&!o(i[0])&&(e=i.shift()),this.emit(`option:${t.name()}`,e)}else this.emit(`option:${t.name()}`);s=t.variadic?t:null;continue}}if(e.length>2&&"-"===e[0]&&"-"!==e[1]){const t=this._findOption(`-${e[1]}`);if(t){t.required||t.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${t.name()}`,e.slice(2)):(this.emit(`option:${t.name()}`),i.unshift(`-${e.slice(2)}`));continue}}if(/^--[^=]+=/.test(e)){const t=e.indexOf("="),n=this._findOption(e.slice(0,t));if(n&&(n.required||n.optional)){this.emit(`option:${n.name()}`,e.slice(t+1));continue}}if(o(e)&&(r=n),(this._enablePositionalOptions||this._passThroughOptions)&&0===t.length&&0===n.length){if(this._findCommand(e)){t.push(e),i.length>0&&n.push(...i);break}if(e===this._helpCommandName&&this._hasImplicitHelpCommand()){t.push(e),i.length>0&&t.push(...i);break}if(this._defaultCommandName){n.push(e),i.length>0&&n.push(...i);break}}if(this._passThroughOptions){r.push(e),i.length>0&&r.push(...i);break}r.push(e)}else this.emit(`option:${s.name()}`,e)}return{operands:t,unknown:n}}opts(){if(this._storeOptionsAsProperties){const e={},t=this.options.length;for(let n=0;n<t;n++){const t=this.options[n].attributeName();e[t]=t===this._versionOptionName?this._version:this[t]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((e,t)=>Object.assign(e,t.opts())),{})}error(e,t){this._outputConfiguration.outputError(`${e}\n`,this._outputConfiguration.writeErr),"string"==typeof this._showHelpAfterError?this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`):this._showHelpAfterError&&(this._outputConfiguration.writeErr("\n"),this.outputHelp({error:!0}));const n=t||{},r=n.exitCode||1,i=n.code||"commander.error";this._exit(r,i,e)}_parseOptionsEnv(){this.options.forEach((e=>{if(e.envVar&&e.envVar in X.env){const t=e.attributeName();(void 0===this.getOptionValue(t)||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,X.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}}))}_parseOptionsImplied(){const e=new re(this.options),t=e=>void 0!==this.getOptionValue(e)&&!["default","implied"].includes(this.getOptionValueSource(e));this.options.filter((n=>void 0!==n.implied&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n))).forEach((e=>{Object.keys(e.implied).filter((e=>!t(e))).forEach((t=>{this.setOptionValueWithSource(t,e.implied[t],"implied")}))}))}missingArgument(e){const t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){const t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){const t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){const n=e=>{const t=e.attributeName(),n=this.getOptionValue(t),r=this.options.find((e=>e.negate&&t===e.attributeName())),i=this.options.find((e=>!e.negate&&t===e.attributeName()));return r&&(void 0===r.presetArg&&!1===n||void 0!==r.presetArg&&n===r.presetArg)?r:i||e},r=e=>{const t=n(e),r=t.attributeName();return"env"===this.getOptionValueSource(r)?`environment variable '${t.envVar}'`:`option '${t.flags}'`},i=`error: ${r(e)} cannot be used with ${r(t)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{const e=r.createHelp().visibleOptions(r).filter((e=>e.long)).map((e=>e.long));n=n.concat(e),r=r.parent}while(r&&!r._enablePositionalOptions);t=ie(e,n)}const n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;const t=this.registeredArguments.length,n=1===t?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${n} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){const e=this.args[0];let t="";if(this._showSuggestionAfterError){const n=[];this.createHelp().visibleCommands(this).forEach((e=>{n.push(e.name()),e.alias()&&n.push(e.alias())})),t=ie(e,n)}const n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(void 0===e)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";const r=this.createOption(t,n);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),(()=>{this._outputConfiguration.writeOut(`${e}\n`),this._exit(0,"commander.version",e)})),this}description(e,t){return void 0===e&&void 0===t?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return void 0===e?this._summary:(this._summary=e,this)}alias(e){if(void 0===e)return this._aliases[0];let t=this;if(0!==this.commands.length&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");return t._aliases.push(e),this}aliases(e){return void 0===e?this._aliases:(e.forEach((e=>this.alias(e))),this)}usage(e){if(void 0===e){if(this._usage)return this._usage;const e=this.registeredArguments.map((e=>Q(e)));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?e:[]).join(" ")}return this._usage=e,this}name(e){return void 0===e?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=B.basename(e,B.extname(e)),this}executableDir(e){return void 0===e?this._executableDir:(this._executableDir=e,this)}helpInformation(e){const t=this.createHelp();return void 0===t.helpWidth&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){const t={error:!!(e=e||{}).error};let n;return n=t.error?e=>this._outputConfiguration.writeErr(e):e=>this._outputConfiguration.writeOut(e),t.write=e.write||n,t.command=this,t}outputHelp(e){let t;"function"==typeof e&&(t=e,e=void 0);const n=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach((e=>e.emit("beforeAllHelp",n))),this.emit("beforeHelp",n);let r=this.helpInformation(n);if(t&&(r=t(r),"string"!=typeof r&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(r),this._helpLongFlag&&this.emit(this._helpLongFlag),this.emit("afterHelp",n),this._getCommandAndAncestors().forEach((e=>e.emit("afterAllHelp",n)))}helpOption(e,t){if("boolean"==typeof e)return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=t||this._helpDescription;const n=ne(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(e){this.outputHelp(e);let t=X.exitCode||0;0===t&&e&&"function"!=typeof e&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){const n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${n.join("', '")}'`);const r=`${e}Help`;return this.on(r,(e=>{let n;n="function"==typeof t?t({error:e.error,command:e.command}):t,n&&e.write(`${n}\n`)})),this}},function(e,t){const{Argument:n}=I,{Command:r}=L,{CommanderError:i,InvalidArgumentError:o}=q,{Help:s}=j,{Option:a}=H;(t=e.exports=new r).program=t,t.Command=r,t.Option=a,t.Argument=n,t.Help=s,t.CommanderError=i,t.InvalidArgumentError=o,t.InvalidOptionArgumentError=o}(A,A.exports);const ae=N(A.exports),{program:ce,createCommand:ue,createArgument:le,createOption:he,CommanderError:de,InvalidArgumentError:pe,InvalidOptionArgumentError:fe,Command:me,Argument:ge,Option:ye,Help:ve}=ae;var be={},Se={};function we(e){return"string"==typeof e||e instanceof String}function Re(e){return"function"==typeof e}function Ce(e){return Array.isArray(e)}Object.defineProperty(Se,"__esModule",{value:!0}),Se.thenable=Se.typedArray=Se.stringArray=Se.array=Se.func=Se.error=Se.number=Se.string=Se.boolean=void 0,Se.boolean=function(e){return!0===e||!1===e},Se.string=we,Se.number=function(e){return"number"==typeof e||e instanceof Number},Se.error=function(e){return e instanceof Error},Se.func=Re,Se.array=Ce,Se.stringArray=function(e){return Ce(e)&&e.every((e=>we(e)))},Se.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},Se.thenable=function(e){return e&&Re(e.then)};var Ee,_e,De={},Te={},xe={},ke={},Pe={},Oe={},Ne={};function Ae(){if(Ee)return Ne;function e(e){return"string"==typeof e||e instanceof String}function t(e){return Array.isArray(e)}return Ee=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.stringArray=Ne.array=Ne.func=Ne.error=Ne.number=Ne.string=Ne.boolean=void 0,Ne.boolean=function(e){return!0===e||!1===e},Ne.string=e,Ne.number=function(e){return"number"==typeof e||e instanceof Number},Ne.error=function(e){return e instanceof Error},Ne.func=function(e){return"function"==typeof e},Ne.array=t,Ne.stringArray=function(n){return t(n)&&n.every((t=>e(t)))},Ne}function Ie(){if(_e)return Oe;_e=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.Message=Oe.NotificationType9=Oe.NotificationType8=Oe.NotificationType7=Oe.NotificationType6=Oe.NotificationType5=Oe.NotificationType4=Oe.NotificationType3=Oe.NotificationType2=Oe.NotificationType1=Oe.NotificationType0=Oe.NotificationType=Oe.RequestType9=Oe.RequestType8=Oe.RequestType7=Oe.RequestType6=Oe.RequestType5=Oe.RequestType4=Oe.RequestType3=Oe.RequestType2=Oe.RequestType1=Oe.RequestType=Oe.RequestType0=Oe.AbstractMessageSignature=Oe.ParameterStructures=Oe.ResponseError=Oe.ErrorCodes=void 0;const e=Ae();var t,n;!function(e){e.ParseError=-32700,e.InvalidRequest=-32600,e.MethodNotFound=-32601,e.InvalidParams=-32602,e.InternalError=-32603,e.jsonrpcReservedErrorRangeStart=-32099,e.serverErrorStart=-32099,e.MessageWriteError=-32099,e.MessageReadError=-32098,e.PendingResponseRejected=-32097,e.ConnectionInactive=-32096,e.ServerNotInitialized=-32002,e.UnknownErrorCode=-32001,e.jsonrpcReservedErrorRangeEnd=-32e3,e.serverErrorEnd=-32e3}(t||(Oe.ErrorCodes=t={}));class r extends Error{constructor(n,i,o){super(i),this.code=e.number(n)?n:t.UnknownErrorCode,this.data=o,Object.setPrototypeOf(this,r.prototype)}toJson(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}}Oe.ResponseError=r;class i{constructor(e){this.kind=e}static is(e){return e===i.auto||e===i.byName||e===i.byPosition}toString(){return this.kind}}Oe.ParameterStructures=i,i.auto=new i("auto"),i.byPosition=new i("byPosition"),i.byName=new i("byName");class o{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return i.auto}}Oe.AbstractMessageSignature=o;Oe.RequestType0=class extends o{constructor(e){super(e,0)}};Oe.RequestType=class extends o{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Oe.RequestType1=class extends o{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Oe.RequestType2=class extends o{constructor(e){super(e,2)}};Oe.RequestType3=class extends o{constructor(e){super(e,3)}};Oe.RequestType4=class extends o{constructor(e){super(e,4)}};Oe.RequestType5=class extends o{constructor(e){super(e,5)}};Oe.RequestType6=class extends o{constructor(e){super(e,6)}};Oe.RequestType7=class extends o{constructor(e){super(e,7)}};Oe.RequestType8=class extends o{constructor(e){super(e,8)}};Oe.RequestType9=class extends o{constructor(e){super(e,9)}};Oe.NotificationType=class extends o{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Oe.NotificationType0=class extends o{constructor(e){super(e,0)}};Oe.NotificationType1=class extends o{constructor(e,t=i.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};Oe.NotificationType2=class extends o{constructor(e){super(e,2)}};Oe.NotificationType3=class extends o{constructor(e){super(e,3)}};Oe.NotificationType4=class extends o{constructor(e){super(e,4)}};Oe.NotificationType5=class extends o{constructor(e){super(e,5)}};Oe.NotificationType6=class extends o{constructor(e){super(e,6)}};Oe.NotificationType7=class extends o{constructor(e){super(e,7)}};Oe.NotificationType8=class extends o{constructor(e){super(e,8)}};return Oe.NotificationType9=class extends o{constructor(e){super(e,9)}},function(t){t.isRequest=function(t){const n=t;return n&&e.string(n.method)&&(e.string(n.id)||e.number(n.id))},t.isNotification=function(t){const n=t;return n&&e.string(n.method)&&void 0===t.id},t.isResponse=function(t){const n=t;return n&&(void 0!==n.result||!!n.error)&&(e.string(n.id)||e.number(n.id)||null===n.id)}}(n||(Oe.Message=n={})),Oe}var qe,Me={};function Fe(){if(qe)return Me;var e,t;qe=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.LRUCache=Me.LinkedMap=Me.Touch=void 0,function(e){e.None=0,e.First=1,e.AsOld=e.First,e.Last=2,e.AsNew=e.Last}(t||(Me.Touch=t={}));class n{constructor(){this[e]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,n=t.None){const r=this._map.get(e);if(r)return n!==t.None&&this.touch(r,n),r.value}set(e,n,r=t.None){let i=this._map.get(e);if(i)i.value=n,r!==t.None&&this.touch(i,r);else{switch(i={key:e,value:n,next:void 0,previous:void 0},r){case t.None:this.addItemLast(i);break;case t.First:this.addItemFirst(i);break;case t.Last:default:this.addItemLast(i)}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){const t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){const n=this._state;let r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.key,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:t.value,done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this._state;let t=this._head;const n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){const e={value:[t.key,t.value],done:!1};return t=t.next,e}return{value:void 0,done:!0}}};return n}[(e=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();let t=this._head,n=this.size;for(;t&&n>e;)this._map.delete(t.key),t=t.next,n--;this._head=t,this._size=n,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(this._head||this._tail){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{const t=e.next,n=e.previous;if(!t||!n)throw new Error("Invalid list");t.previous=n,n.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,n){if(!this._head||!this._tail)throw new Error("Invalid list");if(n===t.First||n===t.Last)if(n===t.First){if(e===this._head)return;const t=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(t.previous=n,n.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(n===t.Last){if(e===this._tail)return;const t=e.next,n=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=n,n.next=t),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}toJSON(){const e=[];return this.forEach(((t,n)=>{e.push([n,t])})),e}fromJSON(e){this.clear();for(const[t,n]of e)this.set(t,n)}}Me.LinkedMap=n;return Me.LRUCache=class extends n{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,n=t.AsNew){return super.get(e,n)}peek(e){return super.get(e,t.None)}set(e,n){return super.set(e,n,t.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}},Me}var Le,je={};var $e,He,We={},Ve={};function Ue(){if($e)return Ve;let e;function t(){if(void 0===e)throw new Error("No runtime abstraction layer installed");return e}return $e=1,Object.defineProperty(Ve,"__esModule",{value:!0}),function(t){t.install=function(t){if(void 0===t)throw new Error("No runtime abstraction layer provided");e=t}}(t||(t={})),Ve.default=t,Ve}function Ke(){if(He)return We;He=1,Object.defineProperty(We,"__esModule",{value:!0}),We.Emitter=We.Event=void 0;const e=Ue();var t;!function(e){const t={dispose(){}};e.None=function(){return t}}(t||(We.Event=t={}));class n{add(e,t=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let n=!1;for(let r=0,i=this._callbacks.length;r<i;r++)if(this._callbacks[r]===e){if(this._contexts[r]===t)return this._callbacks.splice(r,1),void this._contexts.splice(r,1);n=!0}if(n)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...t){if(!this._callbacks)return[];const n=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{n.push(r[o].apply(i[o],t))}catch(t){(0,e.default)().console.error(t)}return n}isEmpty(){return!this._callbacks||0===this._callbacks.length}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);const o={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),o.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(i)&&i.push(o),o}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return We.Emitter=r,r._noop=function(){},We}var Ge,ze={};function Be(){if(Ge)return ze;Ge=1,Object.defineProperty(ze,"__esModule",{value:!0}),ze.CancellationTokenSource=ze.CancellationToken=void 0;const e=Ue(),t=Ae(),n=Ke();var r;!function(e){e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None}),e.is=function(n){const r=n;return r&&(r===e.None||r===e.Cancelled||t.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}}(r||(ze.CancellationToken=r={}));const i=Object.freeze((function(t,n){const r=(0,e.default)().timer.setTimeout(t.bind(n),0);return{dispose(){r.dispose()}}}));class o{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}return ze.CancellationTokenSource=class{get token(){return this._token||(this._token=new o),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof o&&this._token.dispose():this._token=r.None}},ze}var Je,Xe={};var Ye,Qe,Ze={},et={};function tt(){if(Ye)return et;Ye=1,Object.defineProperty(et,"__esModule",{value:!0}),et.Semaphore=void 0;const e=Ue();return et.Semaphore=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise(((t,n)=>{this._waiting.push({thunk:e,resolve:t,reject:n}),this.runNext()}))}get active(){return this._active}runNext(){0!==this._waiting.length&&this._active!==this._capacity&&(0,e.default)().timer.setImmediate((()=>this.doRunNext()))}doRunNext(){if(0===this._waiting.length||this._active===this._capacity)return;const e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const t=e.thunk();t instanceof Promise?t.then((t=>{this._active--,e.resolve(t),this.runNext()}),(t=>{this._active--,e.reject(t),this.runNext()})):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}},et}var nt,rt={};var it,ot={};var st,at,ct={};function ut(){return st||(st=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.ConnectionOptions=e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.RequestCancellationReceiverStrategy=e.IdCancellationReceiverStrategy=e.ConnectionStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=e.NullLogger=e.ProgressType=e.ProgressToken=void 0;const t=Ue(),n=Ae(),r=Ie(),i=Fe(),o=Ke(),s=Be();var a,c,u,l,h,d,p,f,m,g,y,v,b,S,w,R,C,E,_;!function(e){e.type=new r.NotificationType("$/cancelRequest")}(a||(a={})),function(e){e.is=function(e){return"string"==typeof e||"number"==typeof e}}(c||(e.ProgressToken=c={})),function(e){e.type=new r.NotificationType("$/progress")}(u||(u={}));e.ProgressType=class{constructor(){}},function(e){e.is=function(e){return n.func(e)}}(l||(l={})),e.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}}),function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Compact=2]="Compact",e[e.Verbose=3]="Verbose"}(h||(e.Trace=h={})),function(e){e.Off="off",e.Messages="messages",e.Compact="compact",e.Verbose="verbose"}(d||(e.TraceValues=d={})),function(e){e.fromString=function(t){if(!n.string(t))return e.Off;switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"compact":return e.Compact;case"verbose":return e.Verbose}},e.toString=function(t){switch(t){case e.Off:return"off";case e.Messages:return"messages";case e.Compact:return"compact";case e.Verbose:return"verbose";default:return"off"}}}(h||(e.Trace=h={})),function(e){e.Text="text",e.JSON="json"}(p||(e.TraceFormat=p={})),function(e){e.fromString=function(t){return n.string(t)&&"json"===(t=t.toLowerCase())?e.JSON:e.Text}}(p||(e.TraceFormat=p={})),function(e){e.type=new r.NotificationType("$/setTrace")}(f||(e.SetTraceNotification=f={})),function(e){e.type=new r.NotificationType("$/logTrace")}(m||(e.LogTraceNotification=m={})),function(e){e[e.Closed=1]="Closed",e[e.Disposed=2]="Disposed",e[e.AlreadyListening=3]="AlreadyListening"}(g||(e.ConnectionErrors=g={}));class D extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,D.prototype)}}e.ConnectionError=D,function(e){e.is=function(e){const t=e;return t&&n.func(t.cancelUndispatched)}}(y||(e.ConnectionStrategy=y={})),function(e){e.is=function(e){const t=e;return t&&(void 0===t.kind||"id"===t.kind)&&n.func(t.createCancellationTokenSource)&&(void 0===t.dispose||n.func(t.dispose))}}(v||(e.IdCancellationReceiverStrategy=v={})),function(e){e.is=function(e){const t=e;return t&&"request"===t.kind&&n.func(t.createCancellationTokenSource)&&(void 0===t.dispose||n.func(t.dispose))}}(b||(e.RequestCancellationReceiverStrategy=b={})),function(e){e.Message=Object.freeze({createCancellationTokenSource:e=>new s.CancellationTokenSource}),e.is=function(e){return v.is(e)||b.is(e)}}(S||(e.CancellationReceiverStrategy=S={})),function(e){e.Message=Object.freeze({sendCancellation:(e,t)=>e.sendNotification(a.type,{id:t}),cleanup(e){}}),e.is=function(e){const t=e;return t&&n.func(t.sendCancellation)&&n.func(t.cleanup)}}(w||(e.CancellationSenderStrategy=w={})),function(e){e.Message=Object.freeze({receiver:S.Message,sender:w.Message}),e.is=function(e){const t=e;return t&&S.is(t.receiver)&&w.is(t.sender)}}(R||(e.CancellationStrategy=R={})),function(e){e.is=function(e){const t=e;return t&&n.func(t.handleMessage)}}(C||(e.MessageStrategy=C={})),function(e){e.is=function(e){const t=e;return t&&(R.is(t.cancellationStrategy)||y.is(t.connectionStrategy)||C.is(t.messageStrategy))}}(E||(e.ConnectionOptions=E={})),function(e){e[e.New=1]="New",e[e.Listening=2]="Listening",e[e.Closed=3]="Closed",e[e.Disposed=4]="Disposed"}(_||(_={})),e.createMessageConnection=function(d,y,b,S){const w=void 0!==b?b:e.NullLogger;let E=0,T=0,x=0;const k="2.0";let P;const O=new Map;let N;const A=new Map,I=new Map;let q,M,F=new i.LinkedMap,L=new Map,j=new Set,$=new Map,H=h.Off,W=p.Text,V=_.New;const U=new o.Emitter,K=new o.Emitter,G=new o.Emitter,z=new o.Emitter,B=new o.Emitter,J=S&&S.cancellationStrategy?S.cancellationStrategy:R.Message;function X(e){if(null===e)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+e.toString()}function Y(e,t){var n;r.Message.isRequest(t)?e.set(X(t.id),t):r.Message.isResponse(t)?e.set(null===(n=t.id)?"res-unknown-"+(++x).toString():"res-"+n.toString(),t):e.set("not-"+(++T).toString(),t)}function Q(e){}function Z(){return V===_.Listening}function ee(){return V===_.Closed}function te(){return V===_.Disposed}function ne(){V!==_.New&&V!==_.Listening||(V=_.Closed,K.fire(void 0))}function re(){q||0===F.size||(q=(0,t.default)().timer.setImmediate((()=>{q=void 0,function(){if(0===F.size)return;const e=F.shift();try{const t=S?.messageStrategy;C.is(t)?t.handleMessage(e,ie):ie(e)}finally{re()}}()})))}function ie(e){r.Message.isRequest(e)?function(e){if(te())return;function t(t,n,i){const o={jsonrpc:k,id:e.id};t instanceof r.ResponseError?o.error=t.toJson():o.result=void 0===t?null:t,ae(o,n,i),y.write(o).catch((()=>w.error("Sending response failed.")))}function i(t,n,r){const i={jsonrpc:k,id:e.id,error:t.toJson()};ae(i,n,r),y.write(i).catch((()=>w.error("Sending response failed.")))}function o(t,n,r){void 0===t&&(t=null);const i={jsonrpc:k,id:e.id,result:t};ae(i,n,r),y.write(i).catch((()=>w.error("Sending response failed.")))}!function(e){if(H===h.Off||!M)return;if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||!e.params||(t=`Params: ${se(e.params)}\n\n`),M.log(`Received request '${e.method} - (${e.id})'.`,t)}else ue("receive-request",e)}(e);const s=O.get(e.method);let a,c;s&&(a=s.type,c=s.handler);const u=Date.now();if(c||P){const s=e.id??String(Date.now()),l=v.is(J.receiver)?J.receiver.createCancellationTokenSource(s):J.receiver.createCancellationTokenSource(e);null!==e.id&&j.has(e.id)&&l.cancel(),null!==e.id&&$.set(s,l);try{let h;if(c)if(void 0===e.params){if(void 0!==a&&0!==a.numberOfParams)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines ${a.numberOfParams} params but received none.`),e.method,u);h=c(l.token)}else if(Array.isArray(e.params)){if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byName)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by name but received parameters by position`),e.method,u);h=c(...e.params,l.token)}else{if(void 0!==a&&a.parameterStructures===r.ParameterStructures.byPosition)return void i(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${e.method} defines parameters by position but received parameters by name`),e.method,u);h=c(e.params,l.token)}else P&&(h=P(e.method,e.params,l.token));const d=h;h?d.then?d.then((n=>{$.delete(s),t(n,e.method,u)}),(t=>{$.delete(s),t instanceof r.ResponseError?i(t,e.method,u):t&&n.string(t.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${t.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)})):($.delete(s),t(h,e.method,u)):($.delete(s),o(h,e.method,u))}catch(o){$.delete(s),o instanceof r.ResponseError?t(o,e.method,u):o&&n.string(o.message)?i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed with message: ${o.message}`),e.method,u):i(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${e.method} failed unexpectedly without providing any details.`),e.method,u)}}else i(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${e.method}`),e.method,u)}(e):r.Message.isNotification(e)?function(e){if(te())return;let t,n;if(e.method===a.type.method){const t=e.params.id;return j.delete(t),void ce(e)}{const r=A.get(e.method);r&&(n=r.handler,t=r.type)}if(n||N)try{if(ce(e),n)if(void 0===e.params)void 0!==t&&0!==t.numberOfParams&&t.parameterStructures!==r.ParameterStructures.byName&&w.error(`Notification ${e.method} defines ${t.numberOfParams} params but received none.`),n();else if(Array.isArray(e.params)){const i=e.params;e.method===u.type.method&&2===i.length&&c.is(i[0])?n({token:i[0],value:i[1]}):(void 0!==t&&(t.parameterStructures===r.ParameterStructures.byName&&w.error(`Notification ${e.method} defines parameters by name but received parameters by position`),t.numberOfParams!==e.params.length&&w.error(`Notification ${e.method} defines ${t.numberOfParams} params but received ${i.length} arguments`)),n(...i))}else void 0!==t&&t.parameterStructures===r.ParameterStructures.byPosition&&w.error(`Notification ${e.method} defines parameters by position but received parameters by name`),n(e.params);else N&&N(e.method,e.params)}catch(t){t.message?w.error(`Notification handler '${e.method}' failed with message: ${t.message}`):w.error(`Notification handler '${e.method}' failed unexpectedly.`)}else G.fire(e)}(e):r.Message.isResponse(e)?function(e){if(te())return;if(null===e.id)e.error?w.error(`Received response message without id: Error is: \n${JSON.stringify(e.error,void 0,4)}`):w.error("Received response message without id. No further error information provided.");else{const t=e.id,n=L.get(t);if(function(e,t){if(H===h.Off||!M)return;if(W===p.Text){let n;if(H!==h.Verbose&&H!==h.Compact||(e.error&&e.error.data?n=`Error data: ${se(e.error.data)}\n\n`:e.result?n=`Result: ${se(e.result)}\n\n`:void 0===e.error&&(n="No result returned.\n\n")),t){const r=e.error?` Request failed: ${e.error.message} (${e.error.code}).`:"";M.log(`Received response '${t.method} - (${e.id})' in ${Date.now()-t.timerStart}ms.${r}`,n)}else M.log(`Received response ${e.id} without active response promise.`,n)}else ue("receive-response",e)}(e,n),void 0!==n){L.delete(t);try{if(e.error){const t=e.error;n.reject(new r.ResponseError(t.code,t.message,t.data))}else{if(void 0===e.result)throw new Error("Should never happen.");n.resolve(e.result)}}catch(e){e.message?w.error(`Response handler '${n.method}' failed with message: ${e.message}`):w.error(`Response handler '${n.method}' failed unexpectedly.`)}}}}(e):function(e){if(!e)return void w.error("Received empty message.");w.error(`Received message which is neither a response nor a notification message:\n${JSON.stringify(e,null,4)}`);const t=e;if(n.string(t.id)||n.number(t.id)){const e=t.id,n=L.get(e);n&&n.reject(new Error("The received response has neither a result nor an error property."))}}(e)}d.onClose(ne),d.onError((function(e){U.fire([e,void 0,void 0])})),y.onClose(ne),y.onError((function(e){U.fire(e)}));const oe=e=>{try{if(r.Message.isNotification(e)&&e.method===a.type.method){const t=e.params.id,n=X(t),i=F.get(n);if(r.Message.isRequest(i)){const r=S?.connectionStrategy,o=r&&r.cancelUndispatched?r.cancelUndispatched(i,Q):void 0;if(o&&(void 0!==o.error||void 0!==o.result))return F.delete(n),$.delete(t),o.id=i.id,ae(o,e.method,Date.now()),void y.write(o).catch((()=>w.error("Sending response for canceled message failed.")))}const o=$.get(t);if(void 0!==o)return o.cancel(),void ce(e);j.add(t)}Y(F,e)}finally{re()}};function se(e){if(null!=e)switch(H){case h.Verbose:return JSON.stringify(e,null,4);case h.Compact:return JSON.stringify(e);default:return}}function ae(e,t,n){if(H!==h.Off&&M)if(W===p.Text){let r;H!==h.Verbose&&H!==h.Compact||(e.error&&e.error.data?r=`Error data: ${se(e.error.data)}\n\n`:e.result?r=`Result: ${se(e.result)}\n\n`:void 0===e.error&&(r="No result returned.\n\n")),M.log(`Sending response '${t} - (${e.id})'. Processing request took ${Date.now()-n}ms`,r)}else ue("send-response",e)}function ce(e){if(H!==h.Off&&M&&e.method!==m.type.method)if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||(t=e.params?`Params: ${se(e.params)}\n\n`:"No parameters provided.\n\n"),M.log(`Received notification '${e.method}'.`,t)}else ue("receive-notification",e)}function ue(e,t){if(!M||H===h.Off)return;const n={isLSPMessage:!0,type:e,message:t,timestamp:Date.now()};M.log(n)}function le(){if(ee())throw new D(g.Closed,"Connection is closed.");if(te())throw new D(g.Disposed,"Connection is disposed.")}function he(e){return void 0===e?null:e}function de(e){return null===e?void 0:e}function pe(e){return null!=e&&!Array.isArray(e)&&"object"==typeof e}function fe(e,t){switch(e){case r.ParameterStructures.auto:return pe(t)?de(t):[he(t)];case r.ParameterStructures.byName:if(!pe(t))throw new Error("Received parameters by name but param is not an object literal.");return de(t);case r.ParameterStructures.byPosition:return[he(t)];default:throw new Error(`Unknown parameter structure ${e.toString()}`)}}function me(e,t){let n;const r=e.numberOfParams;switch(r){case 0:n=void 0;break;case 1:n=fe(e.parameterStructures,t[0]);break;default:n=[];for(let e=0;e<t.length&&e<r;e++)n.push(he(t[e]));if(t.length<r)for(let e=t.length;e<r;e++)n.push(null)}return n}const ge={sendNotification:(e,...t)=>{let i,o;if(le(),n.string(e)){i=e;const n=t[0];let s=0,a=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(s=1,a=n);let c=t.length;const u=c-s;switch(u){case 0:o=void 0;break;case 1:o=fe(a,t[s]);break;default:if(a===r.ParameterStructures.byName)throw new Error(`Received ${u} parameters for 'by Name' notification parameter structure.`);o=t.slice(s,c).map((e=>he(e)))}}else{const n=t;i=e.method,o=me(e,n)}const s={jsonrpc:k,method:i,params:o};return function(e){if(H!==h.Off&&M)if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||(t=e.params?`Params: ${se(e.params)}\n\n`:"No parameters provided.\n\n"),M.log(`Sending notification '${e.method}'.`,t)}else ue("send-notification",e)}(s),y.write(s).catch((e=>{throw w.error("Sending notification failed."),e}))},onNotification:(e,t)=>{let r;return le(),n.func(e)?N=e:t&&(n.string(e)?(r=e,A.set(e,{type:void 0,handler:t})):(r=e.method,A.set(e.method,{type:e,handler:t}))),{dispose:()=>{void 0!==r?A.delete(r):N=void 0}}},onProgress:(e,t,n)=>{if(I.has(t))throw new Error(`Progress handler for token ${t} already registered`);return I.set(t,n),{dispose:()=>{I.delete(t)}}},sendProgress:(e,t,n)=>ge.sendNotification(u.type,{token:t,value:n}),onUnhandledProgress:z.event,sendRequest:(e,...t)=>{let i,o,a;if(le(),function(){if(!Z())throw new Error("Call listen() first.")}(),n.string(e)){i=e;const n=t[0],c=t[t.length-1];let u=0,l=r.ParameterStructures.auto;r.ParameterStructures.is(n)&&(u=1,l=n);let h=t.length;s.CancellationToken.is(c)&&(h-=1,a=c);const d=h-u;switch(d){case 0:o=void 0;break;case 1:o=fe(l,t[u]);break;default:if(l===r.ParameterStructures.byName)throw new Error(`Received ${d} parameters for 'by Name' request parameter structure.`);o=t.slice(u,h).map((e=>he(e)))}}else{const n=t;i=e.method,o=me(e,n);const r=e.numberOfParams;a=s.CancellationToken.is(n[r])?n[r]:void 0}const c=E++;let u;a&&(u=a.onCancellationRequested((()=>{const e=J.sender.sendCancellation(ge,c);return void 0===e?(w.log(`Received no promise from cancellation strategy when cancelling id ${c}`),Promise.resolve()):e.catch((()=>{w.log(`Sending cancellation messages for id ${c} failed`)}))})));const l={jsonrpc:k,id:c,method:i,params:o};return function(e){if(H!==h.Off&&M)if(W===p.Text){let t;H!==h.Verbose&&H!==h.Compact||!e.params||(t=`Params: ${se(e.params)}\n\n`),M.log(`Sending request '${e.method} - (${e.id})'.`,t)}else ue("send-request",e)}(l),"function"==typeof J.sender.enableCancellation&&J.sender.enableCancellation(l),new Promise((async(e,t)=>{const n={method:i,timerStart:Date.now(),resolve:t=>{e(t),J.sender.cleanup(c),u?.dispose()},reject:e=>{t(e),J.sender.cleanup(c),u?.dispose()}};try{await y.write(l),L.set(c,n)}catch(e){throw w.error("Sending request failed."),n.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,e.message?e.message:"Unknown reason")),e}}))},onRequest:(e,t)=>{le();let r=null;return l.is(e)?(r=void 0,P=e):n.string(e)?(r=null,void 0!==t&&(r=e,O.set(e,{handler:t,type:void 0}))):void 0!==t&&(r=e.method,O.set(e.method,{type:e,handler:t})),{dispose:()=>{null!==r&&(void 0!==r?O.delete(r):P=void 0)}}},hasPendingResponse:()=>L.size>0,trace:async(e,t,r)=>{let i=!1,o=p.Text;void 0!==r&&(n.boolean(r)?i=r:(i=r.sendNotification||!1,o=r.traceFormat||p.Text)),H=e,W=o,M=H===h.Off?void 0:t,!i||ee()||te()||await ge.sendNotification(f.type,{value:h.toString(e)})},onError:U.event,onClose:K.event,onUnhandledNotification:G.event,onDispose:B.event,end:()=>{y.end()},dispose:()=>{if(te())return;V=_.Disposed,B.fire(void 0);const e=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const t of L.values())t.reject(e);L=new Map,$=new Map,j=new Set,F=new i.LinkedMap,n.func(y.dispose)&&y.dispose(),n.func(d.dispose)&&d.dispose()},listen:()=>{le(),function(){if(Z())throw new D(g.AlreadyListening,"Connection is already listening")}(),V=_.Listening,d.listen(oe)},inspect:()=>{(0,t.default)().console.log("inspect")}};return ge.onNotification(m.type,(e=>{if(H===h.Off||!M)return;const t=H===h.Verbose||H===h.Compact;M.log(e.message,t?e.verbose:void 0)})),ge.onNotification(u.type,(e=>{const t=I.get(e.token);t?t(e.value):z.fire(e)})),ge}}(ct)),ct}function lt(){return at||(at=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProgressType=e.ProgressToken=e.createMessageConnection=e.NullLogger=e.ConnectionOptions=e.ConnectionStrategy=e.AbstractMessageBuffer=e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=e.SharedArrayReceiverStrategy=e.SharedArraySenderStrategy=e.CancellationToken=e.CancellationTokenSource=e.Emitter=e.Event=e.Disposable=e.LRUCache=e.Touch=e.LinkedMap=e.ParameterStructures=e.NotificationType9=e.NotificationType8=e.NotificationType7=e.NotificationType6=e.NotificationType5=e.NotificationType4=e.NotificationType3=e.NotificationType2=e.NotificationType1=e.NotificationType0=e.NotificationType=e.ErrorCodes=e.ResponseError=e.RequestType9=e.RequestType8=e.RequestType7=e.RequestType6=e.RequestType5=e.RequestType4=e.RequestType3=e.RequestType2=e.RequestType1=e.RequestType0=e.RequestType=e.Message=e.RAL=void 0,e.MessageStrategy=e.CancellationStrategy=e.CancellationSenderStrategy=e.CancellationReceiverStrategy=e.ConnectionError=e.ConnectionErrors=e.LogTraceNotification=e.SetTraceNotification=e.TraceFormat=e.TraceValues=e.Trace=void 0;const t=Ie();Object.defineProperty(e,"Message",{enumerable:!0,get:function(){return t.Message}}),Object.defineProperty(e,"RequestType",{enumerable:!0,get:function(){return t.RequestType}}),Object.defineProperty(e,"RequestType0",{enumerable:!0,get:function(){return t.RequestType0}}),Object.defineProperty(e,"RequestType1",{enumerable:!0,get:function(){return t.RequestType1}}),Object.defineProperty(e,"RequestType2",{enumerable:!0,get:function(){return t.RequestType2}}),Object.defineProperty(e,"RequestType3",{enumerable:!0,get:function(){return t.RequestType3}}),Object.defineProperty(e,"RequestType4",{enumerable:!0,get:function(){return t.RequestType4}}),Object.defineProperty(e,"RequestType5",{enumerable:!0,get:function(){return t.RequestType5}}),Object.defineProperty(e,"RequestType6",{enumerable:!0,get:function(){return t.RequestType6}}),Object.defineProperty(e,"RequestType7",{enumerable:!0,get:function(){return t.RequestType7}}),Object.defineProperty(e,"RequestType8",{enumerable:!0,get:function(){return t.RequestType8}}),Object.defineProperty(e,"RequestType9",{enumerable:!0,get:function(){return t.RequestType9}}),Object.defineProperty(e,"ResponseError",{enumerable:!0,get:function(){return t.ResponseError}}),Object.defineProperty(e,"ErrorCodes",{enumerable:!0,get:function(){return t.ErrorCodes}}),Object.defineProperty(e,"NotificationType",{enumerable:!0,get:function(){return t.NotificationType}}),Object.defineProperty(e,"NotificationType0",{enumerable:!0,get:function(){return t.NotificationType0}}),Object.defineProperty(e,"NotificationType1",{enumerable:!0,get:function(){return t.NotificationType1}}),Object.defineProperty(e,"NotificationType2",{enumerable:!0,get:function(){return t.NotificationType2}}),Object.defineProperty(e,"NotificationType3",{enumerable:!0,get:function(){return t.NotificationType3}}),Object.defineProperty(e,"NotificationType4",{enumerable:!0,get:function(){return t.NotificationType4}}),Object.defineProperty(e,"NotificationType5",{enumerable:!0,get:function(){return t.NotificationType5}}),Object.defineProperty(e,"NotificationType6",{enumerable:!0,get:function(){return t.NotificationType6}}),Object.defineProperty(e,"NotificationType7",{enumerable:!0,get:function(){return t.NotificationType7}}),Object.defineProperty(e,"NotificationType8",{enumerable:!0,get:function(){return t.NotificationType8}}),Object.defineProperty(e,"NotificationType9",{enumerable:!0,get:function(){return t.NotificationType9}}),Object.defineProperty(e,"ParameterStructures",{enumerable:!0,get:function(){return t.ParameterStructures}});const n=Fe();Object.defineProperty(e,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(e,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(e,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=(Le||(Le=1,Object.defineProperty(je,"__esModule",{value:!0}),je.Disposable=void 0,function(e){e.create=function(e){return{dispose:e}}}(i||(je.Disposable=i={}))),je);var i;Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const o=Ke();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return o.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return o.Emitter}});const s=Be();Object.defineProperty(e,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(e,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=function(){if(Je)return Xe;Je=1,Object.defineProperty(Xe,"__esModule",{value:!0}),Xe.SharedArrayReceiverStrategy=Xe.SharedArraySenderStrategy=void 0;const e=Be();var t;!function(e){e.Continue=0,e.Cancelled=1}(t||(t={})),Xe.SharedArraySenderStrategy=class{constructor(){this.buffers=new Map}enableCancellation(e){if(null===e.id)return;const n=new SharedArrayBuffer(4);new Int32Array(n,0,1)[0]=t.Continue,this.buffers.set(e.id,n),e.$cancellationData=n}async sendCancellation(e,n){const r=this.buffers.get(n);if(void 0===r)return;const i=new Int32Array(r,0,1);Atomics.store(i,0,t.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};class n{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===t.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class r{constructor(e){this.token=new n(e)}cancel(){}dispose(){}}return Xe.SharedArrayReceiverStrategy=class{constructor(){this.kind="request"}createCancellationTokenSource(t){const n=t.$cancellationData;return void 0===n?new e.CancellationTokenSource:new r(n)}},Xe}();Object.defineProperty(e,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const c=function(){if(Qe)return Ze;Qe=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.ReadableStreamMessageReader=Ze.AbstractMessageReader=Ze.MessageReader=void 0;const e=Ue(),t=Ae(),n=Ke(),r=tt();var i,o;!function(e){e.is=function(e){let n=e;return n&&t.func(n.listen)&&t.func(n.dispose)&&t.func(n.onError)&&t.func(n.onClose)&&t.func(n.onPartialMessage)}}(i||(Ze.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${t.string(e.message)?e.message:"unknown"}`)}}return Ze.AbstractMessageReader=s,function(t){t.fromOptions=function(t){let n,r;const i=new Map;let o;const s=new Map;if(void 0===t||"string"==typeof t)n=t??"utf-8";else{if(n=t.charset??"utf-8",void 0!==t.contentDecoder&&(r=t.contentDecoder,i.set(r.name,r)),void 0!==t.contentDecoders)for(const e of t.contentDecoders)i.set(e.name,e);if(void 0!==t.contentTypeDecoder&&(o=t.contentTypeDecoder,s.set(o.name,o)),void 0!==t.contentTypeDecoders)for(const e of t.contentTypeDecoders)s.set(e.name,e)}return void 0===o&&(o=(0,e.default)().applicationJson.decoder,s.set(o.name,o)),{charset:n,contentDecoder:r,contentDecoders:i,contentTypeDecoder:o,contentTypeDecoders:s}}}(o||(o={})),Ze.ReadableStreamMessageReader=class extends s{constructor(t,n){super(),this.readable=t,this.options=o.fromOptions(n),this.buffer=(0,e.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;const t=this.readable.onData((e=>{this.onData(e)}));return this.readable.onError((e=>this.fireError(e))),this.readable.onClose((()=>this.fireClose())),t}onData(e){try{for(this.buffer.append(e);;){if(-1===this.nextMessageLength){const e=this.buffer.tryReadHeaders(!0);if(!e)return;const t=e.get("content-length");if(!t)return void this.fireError(new Error(`Header must provide a Content-Length property.\n${JSON.stringify(Object.fromEntries(e))}`));const n=parseInt(t);if(isNaN(n))return void this.fireError(new Error(`Content-Length value must be a number. Got ${t}`));this.nextMessageLength=n}const e=this.buffer.tryReadBody(this.nextMessageLength);if(void 0===e)return void this.setPartialMessageTimer();this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock((async()=>{const t=void 0!==this.options.contentDecoder?await this.options.contentDecoder.decode(e):e,n=await this.options.contentTypeDecoder.decode(t,this.options);this.callback(n)})).catch((e=>{this.fireError(e)}))}}catch(e){this.fireError(e)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),this._partialMessageTimeout<=0||(this.partialMessageTimer=(0,e.default)().timer.setTimeout(((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())}),this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}},Ze}();Object.defineProperty(e,"MessageReader",{enumerable:!0,get:function(){return c.MessageReader}}),Object.defineProperty(e,"AbstractMessageReader",{enumerable:!0,get:function(){return c.AbstractMessageReader}}),Object.defineProperty(e,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return c.ReadableStreamMessageReader}});const u=function(){if(nt)return rt;nt=1,Object.defineProperty(rt,"__esModule",{value:!0}),rt.WriteableStreamMessageWriter=rt.AbstractMessageWriter=rt.MessageWriter=void 0;const e=Ue(),t=Ae(),n=tt(),r=Ke();var i,o;!function(e){e.is=function(e){let n=e;return n&&t.func(n.dispose)&&t.func(n.onClose)&&t.func(n.onError)&&t.func(n.write)}}(i||(rt.MessageWriter=i={}));class s{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,n){this.errorEmitter.fire([this.asError(e),t,n])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${t.string(e.message)?e.message:"unknown"}`)}}return rt.AbstractMessageWriter=s,function(t){t.fromOptions=function(t){return void 0===t||"string"==typeof t?{charset:t??"utf-8",contentTypeEncoder:(0,e.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,e.default)().applicationJson.encoder}}}(o||(o={})),rt.WriteableStreamMessageWriter=class extends s{constructor(e,t){super(),this.writable=e,this.options=o.fromOptions(t),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError((e=>this.fireError(e))),this.writable.onClose((()=>this.fireClose()))}async write(e){return this.writeSemaphore.lock((async()=>this.options.contentTypeEncoder.encode(e,this.options).then((e=>void 0!==this.options.contentEncoder?this.options.contentEncoder.encode(e):e)).then((t=>{const n=[];return n.push("Content-Length: ",t.byteLength.toString(),"\r\n"),n.push("\r\n"),this.doWrite(e,n,t)}),(e=>{throw this.fireError(e),e}))))}async doWrite(e,t,n){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(n)}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}},rt}();Object.defineProperty(e,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(e,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(e,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const l=(it||(it=1,Object.defineProperty(ot,"__esModule",{value:!0}),ot.AbstractMessageBuffer=void 0,ot.AbstractMessageBuffer=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){const t="string"==typeof e?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(0===this._chunks.length)return;let t=0,n=0,r=0,i=0;e:for(;n<this._chunks.length;){const e=this._chunks[n];for(r=0;r<e.length;){switch(e[r]){case 13:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case 10:switch(t){case 1:t=2;break;case 3:t=4,r++;break e;default:t=0}break;default:t=0}r++}i+=e.byteLength,n++}if(4!==t)return;const o=this._read(i+r),s=new Map,a=this.toString(o,"ascii").split("\r\n");if(a.length<2)return s;for(let t=0;t<a.length-2;t++){const n=a[t],r=n.indexOf(":");if(-1===r)throw new Error(`Message header must separate key and value using ':'\n${n}`);const i=n.substr(0,r),o=n.substr(r+1).trim();s.set(e?i.toLowerCase():i,o)}return s}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(0===e)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){const t=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(t)}if(this._chunks[0].byteLength>e){const t=this._chunks[0],n=this.asNative(t,e);return this._chunks[0]=t.slice(e),this._totalLength-=e,n}const t=this.allocNative(e);let n=0;for(;e>0;){const r=this._chunks[0];if(r.byteLength>e){const i=r.slice(0,e);t.set(i,n),n+=e,this._chunks[0]=r.slice(e),this._totalLength-=e,e-=e}else t.set(r,n),n+=r.byteLength,this._chunks.shift(),this._totalLength-=r.byteLength,e-=r.byteLength}return t}}),ot);Object.defineProperty(e,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const h=ut();Object.defineProperty(e,"ConnectionStrategy",{enumerable:!0,get:function(){return h.ConnectionStrategy}}),Object.defineProperty(e,"ConnectionOptions",{enumerable:!0,get:function(){return h.ConnectionOptions}}),Object.defineProperty(e,"NullLogger",{enumerable:!0,get:function(){return h.NullLogger}}),Object.defineProperty(e,"createMessageConnection",{enumerable:!0,get:function(){return h.createMessageConnection}}),Object.defineProperty(e,"ProgressToken",{enumerable:!0,get:function(){return h.ProgressToken}}),Object.defineProperty(e,"ProgressType",{enumerable:!0,get:function(){return h.ProgressType}}),Object.defineProperty(e,"Trace",{enumerable:!0,get:function(){return h.Trace}}),Object.defineProperty(e,"TraceValues",{enumerable:!0,get:function(){return h.TraceValues}}),Object.defineProperty(e,"TraceFormat",{enumerable:!0,get:function(){return h.TraceFormat}}),Object.defineProperty(e,"SetTraceNotification",{enumerable:!0,get:function(){return h.SetTraceNotification}}),Object.defineProperty(e,"LogTraceNotification",{enumerable:!0,get:function(){return h.LogTraceNotification}}),Object.defineProperty(e,"ConnectionErrors",{enumerable:!0,get:function(){return h.ConnectionErrors}}),Object.defineProperty(e,"ConnectionError",{enumerable:!0,get:function(){return h.ConnectionError}}),Object.defineProperty(e,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return h.CancellationReceiverStrategy}}),Object.defineProperty(e,"CancellationSenderStrategy",{enumerable:!0,get:function(){return h.CancellationSenderStrategy}}),Object.defineProperty(e,"CancellationStrategy",{enumerable:!0,get:function(){return h.CancellationStrategy}}),Object.defineProperty(e,"MessageStrategy",{enumerable:!0,get:function(){return h.MessageStrategy}});const d=Ue();e.RAL=d.default}(Pe)),Pe}Object.defineProperty(ke,"__esModule",{value:!0});const ht=d,dt=lt();class pt extends dt.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return pt.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new ht.TextDecoder(t).decode(e)}asNative(e,t){return void 0===t?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}}pt.emptyBuffer=Buffer.allocUnsafe(0);class ft{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),dt.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),dt.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),dt.Disposable.create((()=>this.stream.off("end",e)))}onData(e){return this.stream.on("data",e),dt.Disposable.create((()=>this.stream.off("data",e)))}}class mt{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),dt.Disposable.create((()=>this.stream.off("close",e)))}onError(e){return this.stream.on("error",e),dt.Disposable.create((()=>this.stream.off("error",e)))}onEnd(e){return this.stream.on("end",e),dt.Disposable.create((()=>this.stream.off("end",e)))}write(e,t){return new Promise(((n,r)=>{const i=e=>{null==e?n():r(e)};"string"==typeof e?this.stream.write(e,t,i):this.stream.write(e,i)}))}end(){this.stream.end()}}const gt=Object.freeze({messageBuffer:Object.freeze({create:e=>new pt(e)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(e,t)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(e,void 0,0),t.charset))}catch(e){return Promise.reject(e)}}}),decoder:Object.freeze({name:"application/json",decode:(e,t)=>{try{return e instanceof Buffer?Promise.resolve(JSON.parse(e.toString(t.charset))):Promise.resolve(JSON.parse(new ht.TextDecoder(t.charset).decode(e)))}catch(e){return Promise.reject(e)}}})}),stream:Object.freeze({asReadableStream:e=>new ft(e),asWritableStream:e=>new mt(e)}),console:console,timer:Object.freeze({setTimeout(e,t,...n){const r=setTimeout(e,t,...n);return{dispose:()=>clearTimeout(r)}},setImmediate(e,...t){const n=setImmediate(e,...t);return{dispose:()=>clearImmediate(n)}},setInterval(e,t,...n){const r=setInterval(e,t,...n);return{dispose:()=>clearInterval(r)}}})});function yt(){return gt}!function(e){e.install=function(){dt.RAL.install(gt)}}(yt||(yt={})),ke.default=yt,function(e){var t=O&&O.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=O&&O.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createMessageConnection=e.createServerSocketTransport=e.createClientSocketTransport=e.createServerPipeTransport=e.createClientPipeTransport=e.generateRandomPipeName=e.StreamMessageWriter=e.StreamMessageReader=e.SocketMessageWriter=e.SocketMessageReader=e.PortMessageWriter=e.PortMessageReader=e.IPCMessageWriter=e.IPCMessageReader=void 0;const r=ke;r.default.install();const i=a,o=f,s=m,c=g,u=lt();n(lt(),e);class l extends u.AbstractMessageReader{constructor(e){super(),this.process=e;let t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose()))}listen(e){return this.process.on("message",e),u.Disposable.create((()=>this.process.off("message",e)))}}e.IPCMessageReader=l;class h extends u.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;const t=this.process;t.on("error",(e=>this.fireError(e))),t.on("close",(()=>this.fireClose))}write(e){try{return"function"==typeof this.process.send&&this.process.send(e,void 0,void 0,(t=>{t?(this.errorCount++,this.handleError(t,e)):this.errorCount=0})),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}e.IPCMessageWriter=h;class d extends u.AbstractMessageReader{constructor(e){super(),this.onData=new u.Emitter,e.on("close",(()=>this.fireClose)),e.on("error",(e=>this.fireError(e))),e.on("message",(e=>{this.onData.fire(e)}))}listen(e){return this.onData.event(e)}}e.PortMessageReader=d;class p extends u.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",(()=>this.fireClose())),e.on("error",(e=>this.fireError(e)))}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(t){return this.handleError(t,e),Promise.reject(t)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){}}e.PortMessageWriter=p;class y extends u.ReadableStreamMessageReader{constructor(e,t="utf-8"){super((0,r.default)().stream.asReadableStream(e),t)}}e.SocketMessageReader=y;class v extends u.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t),this.socket=e}dispose(){super.dispose(),this.socket.destroy()}}e.SocketMessageWriter=v;class b extends u.ReadableStreamMessageReader{constructor(e,t){super((0,r.default)().stream.asReadableStream(e),t)}}e.StreamMessageReader=b;class S extends u.WriteableStreamMessageWriter{constructor(e,t){super((0,r.default)().stream.asWritableStream(e),t)}}e.StreamMessageWriter=S;const w=process.env.XDG_RUNTIME_DIR,R=new Map([["linux",107],["darwin",103]]);e.generateRandomPipeName=function(){const e=(0,s.randomBytes)(21).toString("hex");if("win32"===process.platform)return`\\\\.\\pipe\\vscode-jsonrpc-${e}-sock`;let t;t=w?i.join(w,`vscode-ipc-${e}.sock`):i.join(o.tmpdir(),`vscode-${e}.sock`);const n=R.get(process.platform);return void 0!==n&&t.length>n&&(0,r.default)().console.warn(`WARNING: IPC handle "${t}" is longer than ${n} characters.`),t},e.createClientPipeTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{let s=(0,c.createServer)((e=>{s.close(),n([new y(e,t),new v(e,t)])}));s.on("error",o),s.listen(e,(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerPipeTransport=function(e,t="utf-8"){const n=(0,c.createConnection)(e);return[new y(n,t),new v(n,t)]},e.createClientSocketTransport=function(e,t="utf-8"){let n;const r=new Promise(((e,t)=>{n=e}));return new Promise(((i,o)=>{const s=(0,c.createServer)((e=>{s.close(),n([new y(e,t),new v(e,t)])}));s.on("error",o),s.listen(e,"127.0.0.1",(()=>{s.removeListener("error",o),i({onConnected:()=>r})}))}))},e.createServerSocketTransport=function(e,t="utf-8"){const n=(0,c.createConnection)(e,"127.0.0.1");return[new y(n,t),new v(n,t)]},e.createMessageConnection=function(e,t,n,r){n||(n=u.NullLogger);const i=function(e){const t=e;return void 0!==t.read&&void 0!==t.addListener}(e)?new b(e):e,o=function(e){const t=e;return void 0!==t.write&&void 0!==t.addListener}(t)?new S(t):t;return u.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,u.createMessageConnection)(i,o,n,r)}}(xe);var vt=xe,bt={};var St,wt,Rt={exports:{}};St=Rt,wt=function(e,t){var n,r,i,o,s,a,c,u,l,h,d,p,f,m,g,y,v,b,S,w,R,C,E,_,D,T,x,k;Object.defineProperty(t,"__esModule",{value:!0}),t.TextDocument=t.EOL=t.WorkspaceFolder=t.InlineCompletionContext=t.SelectedCompletionInfo=t.InlineCompletionTriggerKind=t.InlineCompletionList=t.InlineCompletionItem=t.StringValue=t.InlayHint=t.InlayHintLabelPart=t.InlayHintKind=t.InlineValueContext=t.InlineValueEvaluatableExpression=t.InlineValueVariableLookup=t.InlineValueText=t.SemanticTokens=t.SemanticTokenModifiers=t.SemanticTokenTypes=t.SelectionRange=t.DocumentLink=t.FormattingOptions=t.CodeLens=t.CodeAction=t.CodeActionContext=t.CodeActionTriggerKind=t.CodeActionKind=t.DocumentSymbol=t.WorkspaceSymbol=t.SymbolInformation=t.SymbolTag=t.SymbolKind=t.DocumentHighlight=t.DocumentHighlightKind=t.SignatureInformation=t.ParameterInformation=t.Hover=t.MarkedString=t.CompletionList=t.CompletionItem=t.CompletionItemLabelDetails=t.InsertTextMode=t.InsertReplaceEdit=t.CompletionItemTag=t.InsertTextFormat=t.CompletionItemKind=t.MarkupContent=t.MarkupKind=t.TextDocumentItem=t.OptionalVersionedTextDocumentIdentifier=t.VersionedTextDocumentIdentifier=t.TextDocumentIdentifier=t.WorkspaceChange=t.WorkspaceEdit=t.DeleteFile=t.RenameFile=t.CreateFile=t.TextDocumentEdit=t.AnnotatedTextEdit=t.ChangeAnnotationIdentifier=t.ChangeAnnotation=t.TextEdit=t.Command=t.Diagnostic=t.CodeDescription=t.DiagnosticTag=t.DiagnosticSeverity=t.DiagnosticRelatedInformation=t.FoldingRange=t.FoldingRangeKind=t.ColorPresentation=t.ColorInformation=t.Color=t.LocationLink=t.Location=t.Range=t.Position=t.uinteger=t.integer=t.URI=t.DocumentUri=void 0,function(e){function t(e){return"string"==typeof e}e.is=t}(n||(t.DocumentUri=n={})),function(e){function t(e){return"string"==typeof e}e.is=t}(r||(t.URI=r={})),function(e){function t(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=t}(i||(t.integer=i={})),function(e){function t(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=t}(o||(t.uinteger=o={})),function(e){function t(e,t){return e===Number.MAX_VALUE&&(e=o.MAX_VALUE),t===Number.MAX_VALUE&&(t=o.MAX_VALUE),{line:e,character:t}}function n(e){var t=e;return Pe.objectLiteral(t)&&Pe.uinteger(t.line)&&Pe.uinteger(t.character)}e.create=t,e.is=n}(s||(t.Position=s={})),function(e){function t(e,t,n,r){if(Pe.uinteger(e)&&Pe.uinteger(t)&&Pe.uinteger(n)&&Pe.uinteger(r))return{start:s.create(e,t),end:s.create(n,r)};if(s.is(e)&&s.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))}function n(e){var t=e;return Pe.objectLiteral(t)&&s.is(t.start)&&s.is(t.end)}e.create=t,e.is=n}(a||(t.Range=a={})),function(e){function t(e,t){return{uri:e,range:t}}function n(e){var t=e;return Pe.objectLiteral(t)&&a.is(t.range)&&(Pe.string(t.uri)||Pe.undefined(t.uri))}e.create=t,e.is=n}(c||(t.Location=c={})),function(e){function t(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}}function n(e){var t=e;return Pe.objectLiteral(t)&&a.is(t.targetRange)&&Pe.string(t.targetUri)&&a.is(t.targetSelectionRange)&&(a.is(t.originSelectionRange)||Pe.undefined(t.originSelectionRange))}e.create=t,e.is=n}(u||(t.LocationLink=u={})),function(e){function t(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}}function n(e){var t=e;return Pe.objectLiteral(t)&&Pe.numberRange(t.red,0,1)&&Pe.numberRange(t.green,0,1)&&Pe.numberRange(t.blue,0,1)&&Pe.numberRange(t.alpha,0,1)}e.create=t,e.is=n}(l||(t.Color=l={})),function(e){function t(e,t){return{range:e,color:t}}function n(e){var t=e;return Pe.objectLiteral(t)&&a.is(t.range)&&l.is(t.color)}e.create=t,e.is=n}(h||(t.ColorInformation=h={})),function(e){function t(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}}function n(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.label)&&(Pe.undefined(t.textEdit)||w.is(t))&&(Pe.undefined(t.additionalTextEdits)||Pe.typedArray(t.additionalTextEdits,w.is))}e.create=t,e.is=n}(d||(t.ColorPresentation=d={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(p||(t.FoldingRangeKind=p={})),function(e){function t(e,t,n,r,i,o){var s={startLine:e,endLine:t};return Pe.defined(n)&&(s.startCharacter=n),Pe.defined(r)&&(s.endCharacter=r),Pe.defined(i)&&(s.kind=i),Pe.defined(o)&&(s.collapsedText=o),s}function n(e){var t=e;return Pe.objectLiteral(t)&&Pe.uinteger(t.startLine)&&Pe.uinteger(t.startLine)&&(Pe.undefined(t.startCharacter)||Pe.uinteger(t.startCharacter))&&(Pe.undefined(t.endCharacter)||Pe.uinteger(t.endCharacter))&&(Pe.undefined(t.kind)||Pe.string(t.kind))}e.create=t,e.is=n}(f||(t.FoldingRange=f={})),function(e){function t(e,t){return{location:e,message:t}}function n(e){var t=e;return Pe.defined(t)&&c.is(t.location)&&Pe.string(t.message)}e.create=t,e.is=n}(m||(t.DiagnosticRelatedInformation=m={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(g||(t.DiagnosticSeverity=g={})),function(e){e.Unnecessary=1,e.Deprecated=2}(y||(t.DiagnosticTag=y={})),function(e){function t(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.href)}e.is=t}(v||(t.CodeDescription=v={})),function(e){function t(e,t,n,r,i,o){var s={range:e,message:t};return Pe.defined(n)&&(s.severity=n),Pe.defined(r)&&(s.code=r),Pe.defined(i)&&(s.source=i),Pe.defined(o)&&(s.relatedInformation=o),s}function n(e){var t,n=e;return Pe.defined(n)&&a.is(n.range)&&Pe.string(n.message)&&(Pe.number(n.severity)||Pe.undefined(n.severity))&&(Pe.integer(n.code)||Pe.string(n.code)||Pe.undefined(n.code))&&(Pe.undefined(n.codeDescription)||Pe.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Pe.string(n.source)||Pe.undefined(n.source))&&(Pe.undefined(n.relatedInformation)||Pe.typedArray(n.relatedInformation,m.is))}e.create=t,e.is=n}(b||(t.Diagnostic=b={})),function(e){function t(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={title:e,command:t};return Pe.defined(n)&&n.length>0&&(i.arguments=n),i}function n(e){var t=e;return Pe.defined(t)&&Pe.string(t.title)&&Pe.string(t.command)}e.create=t,e.is=n}(S||(t.Command=S={})),function(e){function t(e,t){return{range:e,newText:t}}function n(e,t){return{range:{start:e,end:e},newText:t}}function r(e){return{range:e,newText:""}}function i(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.newText)&&a.is(t.range)}e.replace=t,e.insert=n,e.del=r,e.is=i}(w||(t.TextEdit=w={})),function(e){function t(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r}function n(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.label)&&(Pe.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Pe.string(t.description)||void 0===t.description)}e.create=t,e.is=n}(R||(t.ChangeAnnotation=R={})),function(e){function t(e){var t=e;return Pe.string(t)}e.is=t}(C||(t.ChangeAnnotationIdentifier=C={})),function(e){function t(e,t,n){return{range:e,newText:t,annotationId:n}}function n(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}}function r(e,t){return{range:e,newText:"",annotationId:t}}function i(e){var t=e;return w.is(t)&&(R.is(t.annotationId)||C.is(t.annotationId))}e.replace=t,e.insert=n,e.del=r,e.is=i}(E||(t.AnnotatedTextEdit=E={})),function(e){function t(e,t){return{textDocument:e,edits:t}}function n(e){var t=e;return Pe.defined(t)&&N.is(t.textDocument)&&Array.isArray(t.edits)}e.create=t,e.is=n}(_||(t.TextDocumentEdit=_={})),function(e){function t(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"create"===t.kind&&Pe.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Pe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Pe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||C.is(t.annotationId))}e.create=t,e.is=n}(D||(t.CreateFile=D={})),function(e){function t(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i}function n(e){var t=e;return t&&"rename"===t.kind&&Pe.string(t.oldUri)&&Pe.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Pe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Pe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||C.is(t.annotationId))}e.create=t,e.is=n}(T||(t.RenameFile=T={})),function(e){function t(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r}function n(e){var t=e;return t&&"delete"===t.kind&&Pe.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Pe.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Pe.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||C.is(t.annotationId))}e.create=t,e.is=n}(x||(t.DeleteFile=x={})),function(e){function t(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Pe.string(e.kind)?D.is(e)||T.is(e)||x.is(e):_.is(e)})))}e.is=t}(k||(t.WorkspaceEdit=k={}));var P,O,N,A,I,q,M,F,L,j,$,H,W,V,U,K,G,z,B,J,X,Y,Q,Z,ee,te,ne,re,ie,oe,se,ae,ce,ue,le,he,de,pe,fe,me,ge,ye,ve,be,Se,we,Re,Ce,Ee,_e,De,Te=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=w.insert(e,t):C.is(n)?(i=n,r=E.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=E.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=w.replace(e,t):C.is(n)?(i=n,r=E.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=E.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=w.del(e):C.is(t)?(r=t,n=E.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=E.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),xe=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(C.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}(),ke=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new xe(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(_.is(e)){var n=new Te(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Te(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}return Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(N.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new Te(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new Te(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new xe,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(R.is(t)||C.is(t)?r=t:n=t,void 0===r?i=D.create(e,n):(o=C.is(r)?r:this._changeAnnotations.manage(r),i=D.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,s;if(R.is(n)||C.is(n)?i=n:r=n,void 0===i?o=T.create(e,t,r):(s=C.is(i)?i:this._changeAnnotations.manage(i),o=T.create(e,t,r,s)),this._workspaceEdit.documentChanges.push(o),void 0!==s)return s},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(R.is(t)||C.is(t)?r=t:n=t,void 0===r?i=x.create(e,n):(o=C.is(r)?r:this._changeAnnotations.manage(r),i=x.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e}();t.WorkspaceChange=ke,function(e){function t(e){return{uri:e}}function n(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)}e.create=t,e.is=n}(P||(t.TextDocumentIdentifier=P={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&Pe.integer(t.version)}e.create=t,e.is=n}(O||(t.VersionedTextDocumentIdentifier=O={})),function(e){function t(e,t){return{uri:e,version:t}}function n(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&(null===t.version||Pe.integer(t.version))}e.create=t,e.is=n}(N||(t.OptionalVersionedTextDocumentIdentifier=N={})),function(e){function t(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}}function n(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&Pe.string(t.languageId)&&Pe.integer(t.version)&&Pe.string(t.text)}e.create=t,e.is=n}(A||(t.TextDocumentItem=A={})),function(e){function t(t){var n=t;return n===e.PlainText||n===e.Markdown}e.PlainText="plaintext",e.Markdown="markdown",e.is=t}(I||(t.MarkupKind=I={})),function(e){function t(e){var t=e;return Pe.objectLiteral(e)&&I.is(t.kind)&&Pe.string(t.value)}e.is=t}(q||(t.MarkupContent=q={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(M||(t.CompletionItemKind=M={})),function(e){e.PlainText=1,e.Snippet=2}(F||(t.InsertTextFormat=F={})),function(e){e.Deprecated=1}(L||(t.CompletionItemTag=L={})),function(e){function t(e,t,n){return{newText:e,insert:t,replace:n}}function n(e){var t=e;return t&&Pe.string(t.newText)&&a.is(t.insert)&&a.is(t.replace)}e.create=t,e.is=n}(j||(t.InsertReplaceEdit=j={})),function(e){e.asIs=1,e.adjustIndentation=2}($||(t.InsertTextMode=$={})),function(e){function t(e){var t=e;return t&&(Pe.string(t.detail)||void 0===t.detail)&&(Pe.string(t.description)||void 0===t.description)}e.is=t}(H||(t.CompletionItemLabelDetails=H={})),function(e){function t(e){return{label:e}}e.create=t}(W||(t.CompletionItem=W={})),function(e){function t(e,t){return{items:e||[],isIncomplete:!!t}}e.create=t}(V||(t.CompletionList=V={})),function(e){function t(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}function n(e){var t=e;return Pe.string(t)||Pe.objectLiteral(t)&&Pe.string(t.language)&&Pe.string(t.value)}e.fromPlainText=t,e.is=n}(U||(t.MarkedString=U={})),function(e){function t(e){var t=e;return!!t&&Pe.objectLiteral(t)&&(q.is(t.contents)||U.is(t.contents)||Pe.typedArray(t.contents,U.is))&&(void 0===e.range||a.is(e.range))}e.is=t}(K||(t.Hover=K={})),function(e){function t(e,t){return t?{label:e,documentation:t}:{label:e}}e.create=t}(G||(t.ParameterInformation=G={})),function(e){function t(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i={label:e};return Pe.defined(t)&&(i.documentation=t),Pe.defined(n)?i.parameters=n:i.parameters=[],i}e.create=t}(z||(t.SignatureInformation=z={})),function(e){e.Text=1,e.Read=2,e.Write=3}(B||(t.DocumentHighlightKind=B={})),function(e){function t(e,t){var n={range:e};return Pe.number(t)&&(n.kind=t),n}e.create=t}(J||(t.DocumentHighlight=J={})),function(e){e.File=1,e.Module=2,e.Namespace=3,e.Package=4,e.Class=5,e.Method=6,e.Property=7,e.Field=8,e.Constructor=9,e.Enum=10,e.Interface=11,e.Function=12,e.Variable=13,e.Constant=14,e.String=15,e.Number=16,e.Boolean=17,e.Array=18,e.Object=19,e.Key=20,e.Null=21,e.EnumMember=22,e.Struct=23,e.Event=24,e.Operator=25,e.TypeParameter=26}(X||(t.SymbolKind=X={})),function(e){e.Deprecated=1}(Y||(t.SymbolTag=Y={})),function(e){function t(e,t,n,r,i){var o={name:e,kind:t,location:{uri:r,range:n}};return i&&(o.containerName=i),o}e.create=t}(Q||(t.SymbolInformation=Q={})),function(e){function t(e,t,n,r){return void 0!==r?{name:e,kind:t,location:{uri:n,range:r}}:{name:e,kind:t,location:{uri:n}}}e.create=t}(Z||(t.WorkspaceSymbol=Z={})),function(e){function t(e,t,n,r,i,o){var s={name:e,detail:t,kind:n,range:r,selectionRange:i};return void 0!==o&&(s.children=o),s}function n(e){var t=e;return t&&Pe.string(t.name)&&Pe.number(t.kind)&&a.is(t.range)&&a.is(t.selectionRange)&&(void 0===t.detail||Pe.string(t.detail))&&(void 0===t.deprecated||Pe.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}e.create=t,e.is=n}(ee||(t.DocumentSymbol=ee={})),function(e){e.Empty="",e.QuickFix="quickfix",e.Refactor="refactor",e.RefactorExtract="refactor.extract",e.RefactorInline="refactor.inline",e.RefactorRewrite="refactor.rewrite",e.Source="source",e.SourceOrganizeImports="source.organizeImports",e.SourceFixAll="source.fixAll"}(te||(t.CodeActionKind=te={})),function(e){e.Invoked=1,e.Automatic=2}(ne||(t.CodeActionTriggerKind=ne={})),function(e){function t(e,t,n){var r={diagnostics:e};return null!=t&&(r.only=t),null!=n&&(r.triggerKind=n),r}function n(e){var t=e;return Pe.defined(t)&&Pe.typedArray(t.diagnostics,b.is)&&(void 0===t.only||Pe.typedArray(t.only,Pe.string))&&(void 0===t.triggerKind||t.triggerKind===ne.Invoked||t.triggerKind===ne.Automatic)}e.create=t,e.is=n}(re||(t.CodeActionContext=re={})),function(e){function t(e,t,n){var r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):S.is(t)?r.command=t:r.edit=t,i&&void 0!==n&&(r.kind=n),r}function n(e){var t=e;return t&&Pe.string(t.title)&&(void 0===t.diagnostics||Pe.typedArray(t.diagnostics,b.is))&&(void 0===t.kind||Pe.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||S.is(t.command))&&(void 0===t.isPreferred||Pe.boolean(t.isPreferred))&&(void 0===t.edit||k.is(t.edit))}e.create=t,e.is=n}(ie||(t.CodeAction=ie={})),function(e){function t(e,t){var n={range:e};return Pe.defined(t)&&(n.data=t),n}function n(e){var t=e;return Pe.defined(t)&&a.is(t.range)&&(Pe.undefined(t.command)||S.is(t.command))}e.create=t,e.is=n}(oe||(t.CodeLens=oe={})),function(e){function t(e,t){return{tabSize:e,insertSpaces:t}}function n(e){var t=e;return Pe.defined(t)&&Pe.uinteger(t.tabSize)&&Pe.boolean(t.insertSpaces)}e.create=t,e.is=n}(se||(t.FormattingOptions=se={})),function(e){function t(e,t,n){return{range:e,target:t,data:n}}function n(e){var t=e;return Pe.defined(t)&&a.is(t.range)&&(Pe.undefined(t.target)||Pe.string(t.target))}e.create=t,e.is=n}(ae||(t.DocumentLink=ae={})),function(e){function t(e,t){return{range:e,parent:t}}function n(t){var n=t;return Pe.objectLiteral(n)&&a.is(n.range)&&(void 0===n.parent||e.is(n.parent))}e.create=t,e.is=n}(ce||(t.SelectionRange=ce={})),function(e){e.namespace="namespace",e.type="type",e.class="class",e.enum="enum",e.interface="interface",e.struct="struct",e.typeParameter="typeParameter",e.parameter="parameter",e.variable="variable",e.property="property",e.enumMember="enumMember",e.event="event",e.function="function",e.method="method",e.macro="macro",e.keyword="keyword",e.modifier="modifier",e.comment="comment",e.string="string",e.number="number",e.regexp="regexp",e.operator="operator",e.decorator="decorator"}(ue||(t.SemanticTokenTypes=ue={})),function(e){e.declaration="declaration",e.definition="definition",e.readonly="readonly",e.static="static",e.deprecated="deprecated",e.abstract="abstract",e.async="async",e.modification="modification",e.documentation="documentation",e.defaultLibrary="defaultLibrary"}(le||(t.SemanticTokenModifiers=le={})),function(e){function t(e){var t=e;return Pe.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}e.is=t}(he||(t.SemanticTokens=he={})),function(e){function t(e,t){return{range:e,text:t}}function n(e){var t=e;return null!=t&&a.is(t.range)&&Pe.string(t.text)}e.create=t,e.is=n}(de||(t.InlineValueText=de={})),function(e){function t(e,t,n){return{range:e,variableName:t,caseSensitiveLookup:n}}function n(e){var t=e;return null!=t&&a.is(t.range)&&Pe.boolean(t.caseSensitiveLookup)&&(Pe.string(t.variableName)||void 0===t.variableName)}e.create=t,e.is=n}(pe||(t.InlineValueVariableLookup=pe={})),function(e){function t(e,t){return{range:e,expression:t}}function n(e){var t=e;return null!=t&&a.is(t.range)&&(Pe.string(t.expression)||void 0===t.expression)}e.create=t,e.is=n}(fe||(t.InlineValueEvaluatableExpression=fe={})),function(e){function t(e,t){return{frameId:e,stoppedLocation:t}}function n(e){var t=e;return Pe.defined(t)&&a.is(e.stoppedLocation)}e.create=t,e.is=n}(me||(t.InlineValueContext=me={})),function(e){function t(e){return 1===e||2===e}e.Type=1,e.Parameter=2,e.is=t}(ge||(t.InlayHintKind=ge={})),function(e){function t(e){return{value:e}}function n(e){var t=e;return Pe.objectLiteral(t)&&(void 0===t.tooltip||Pe.string(t.tooltip)||q.is(t.tooltip))&&(void 0===t.location||c.is(t.location))&&(void 0===t.command||S.is(t.command))}e.create=t,e.is=n}(ye||(t.InlayHintLabelPart=ye={})),function(e){function t(e,t,n){var r={position:e,label:t};return void 0!==n&&(r.kind=n),r}function n(e){var t=e;return Pe.objectLiteral(t)&&s.is(t.position)&&(Pe.string(t.label)||Pe.typedArray(t.label,ye.is))&&(void 0===t.kind||ge.is(t.kind))&&void 0===t.textEdits||Pe.typedArray(t.textEdits,w.is)&&(void 0===t.tooltip||Pe.string(t.tooltip)||q.is(t.tooltip))&&(void 0===t.paddingLeft||Pe.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Pe.boolean(t.paddingRight))}e.create=t,e.is=n}(ve||(t.InlayHint=ve={})),function(e){function t(e){return{kind:"snippet",value:e}}e.createSnippet=t}(be||(t.StringValue=be={})),function(e){function t(e,t,n,r){return{insertText:e,filterText:t,range:n,command:r}}e.create=t}(Se||(t.InlineCompletionItem=Se={})),function(e){function t(e){return{items:e}}e.create=t}(we||(t.InlineCompletionList=we={})),function(e){e.Invoked=0,e.Automatic=1}(Re||(t.InlineCompletionTriggerKind=Re={})),function(e){function t(e,t){return{range:e,text:t}}e.create=t}(Ce||(t.SelectedCompletionInfo=Ce={})),function(e){function t(e,t){return{triggerKind:e,selectedCompletionInfo:t}}e.create=t}(Ee||(t.InlineCompletionContext=Ee={})),function(e){function t(e){var t=e;return Pe.objectLiteral(t)&&r.is(t.uri)&&Pe.string(t.name)}e.is=t}(_e||(t.WorkspaceFolder=_e={})),t.EOL=["\n","\r\n","\r"],function(e){function t(e,t,n,r){return new Oe(e,t,n,r)}function n(e){var t=e;return!!(Pe.defined(t)&&Pe.string(t.uri)&&(Pe.undefined(t.languageId)||Pe.string(t.languageId))&&Pe.uinteger(t.lineCount)&&Pe.func(t.getText)&&Pe.func(t.positionAt)&&Pe.func(t.offsetAt))}function r(e,t){for(var n=e.getText(),r=i(t,(function(e,t){var n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),o=n.length,s=r.length-1;s>=0;s--){var a=r[s],c=e.offsetAt(a.range.start),u=e.offsetAt(a.range.end);if(!(u<=o))throw new Error("Overlapping edit");n=n.substring(0,c)+a.newText+n.substring(u,n.length),o=c}return n}function i(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),o=e.slice(n);i(r,t),i(o,t);for(var s=0,a=0,c=0;s<r.length&&a<o.length;){var u=t(r[s],o[a]);e[c++]=u<=0?r[s++]:o[a++]}for(;s<r.length;)e[c++]=r[s++];for(;a<o.length;)e[c++]=o[a++];return e}e.create=t,e.is=n,e.applyEdits=r}(De||(t.TextDocument=De={}));var Pe,Oe=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r<t.length;r++){n&&(e.push(r),n=!1);var i=t.charAt(r);n="\r"===i||"\n"===i,"\r"===i&&r+1<t.length&&"\n"===t.charAt(r+1)&&r++}n&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return s.create(0,e);for(;n<r;){var i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}var o=n-1;return s.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)},Object.defineProperty(e.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),e}();!function(e){var t=Object.prototype.toString;function n(e){return void 0!==e}function r(e){return void 0===e}function i(e){return!0===e||!1===e}function o(e){return"[object String]"===t.call(e)}function s(e){return"[object Number]"===t.call(e)}function a(e,n,r){return"[object Number]"===t.call(e)&&n<=e&&e<=r}function c(e){return"[object Number]"===t.call(e)&&-2147483648<=e&&e<=2147483647}function u(e){return"[object Number]"===t.call(e)&&0<=e&&e<=2147483647}function l(e){return"[object Function]"===t.call(e)}function h(e){return null!==e&&"object"==typeof e}function d(e,t){return Array.isArray(e)&&e.every(t)}e.defined=n,e.undefined=r,e.boolean=i,e.string=o,e.number=s,e.numberRange=a,e.integer=c,e.uinteger=u,e.func=l,e.objectLiteral=h,e.typedArray=d}(Pe||(Pe={}))}(0,Rt.exports),void 0!==wt&&(St.exports=wt);var Ct=Rt.exports,Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.ProtocolNotificationType=Et.ProtocolNotificationType0=Et.ProtocolRequestType=Et.ProtocolRequestType0=Et.RegistrationType=Et.MessageDirection=void 0;const _t=xe;var Dt;!function(e){e.clientToServer="clientToServer",e.serverToClient="serverToClient",e.both="both"}(Dt||(Et.MessageDirection=Dt={}));Et.RegistrationType=class{constructor(e){this.method=e}};Et.ProtocolRequestType0=class extends _t.RequestType0{constructor(e){super(e)}};Et.ProtocolRequestType=class extends _t.RequestType{constructor(e){super(e,_t.ParameterStructures.byName)}};Et.ProtocolNotificationType0=class extends _t.NotificationType0{constructor(e){super(e)}};Et.ProtocolNotificationType=class extends _t.NotificationType{constructor(e){super(e,_t.ParameterStructures.byName)}};var Tt={},xt={};function kt(e){return"string"==typeof e||e instanceof String}function Pt(e){return Array.isArray(e)}Object.defineProperty(xt,"__esModule",{value:!0}),xt.objectLiteral=xt.typedArray=xt.stringArray=xt.array=xt.func=xt.error=xt.number=xt.string=xt.boolean=void 0,xt.boolean=function(e){return!0===e||!1===e},xt.string=kt,xt.number=function(e){return"number"==typeof e||e instanceof Number},xt.error=function(e){return e instanceof Error},xt.func=function(e){return"function"==typeof e},xt.array=Pt,xt.stringArray=function(e){return Pt(e)&&e.every((e=>kt(e)))},xt.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},xt.objectLiteral=function(e){return null!==e&&"object"==typeof e};var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.ImplementationRequest=void 0;const Nt=Et;var At;!function(e){e.method="textDocument/implementation",e.messageDirection=Nt.MessageDirection.clientToServer,e.type=new Nt.ProtocolRequestType(e.method)}(At||(Ot.ImplementationRequest=At={}));var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.TypeDefinitionRequest=void 0;const qt=Et;var Mt;!function(e){e.method="textDocument/typeDefinition",e.messageDirection=qt.MessageDirection.clientToServer,e.type=new qt.ProtocolRequestType(e.method)}(Mt||(It.TypeDefinitionRequest=Mt={}));var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.DidChangeWorkspaceFoldersNotification=Ft.WorkspaceFoldersRequest=void 0;const Lt=Et;var jt,$t;!function(e){e.method="workspace/workspaceFolders",e.messageDirection=Lt.MessageDirection.serverToClient,e.type=new Lt.ProtocolRequestType0(e.method)}(jt||(Ft.WorkspaceFoldersRequest=jt={})),function(e){e.method="workspace/didChangeWorkspaceFolders",e.messageDirection=Lt.MessageDirection.clientToServer,e.type=new Lt.ProtocolNotificationType(e.method)}($t||(Ft.DidChangeWorkspaceFoldersNotification=$t={}));var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.ConfigurationRequest=void 0;const Wt=Et;var Vt;!function(e){e.method="workspace/configuration",e.messageDirection=Wt.MessageDirection.serverToClient,e.type=new Wt.ProtocolRequestType(e.method)}(Vt||(Ht.ConfigurationRequest=Vt={}));var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.ColorPresentationRequest=Ut.DocumentColorRequest=void 0;const Kt=Et;var Gt,zt;!function(e){e.method="textDocument/documentColor",e.messageDirection=Kt.MessageDirection.clientToServer,e.type=new Kt.ProtocolRequestType(e.method)}(Gt||(Ut.DocumentColorRequest=Gt={})),function(e){e.method="textDocument/colorPresentation",e.messageDirection=Kt.MessageDirection.clientToServer,e.type=new Kt.ProtocolRequestType(e.method)}(zt||(Ut.ColorPresentationRequest=zt={}));var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.FoldingRangeRefreshRequest=Bt.FoldingRangeRequest=void 0;const Jt=Et;var Xt,Yt;!function(e){e.method="textDocument/foldingRange",e.messageDirection=Jt.MessageDirection.clientToServer,e.type=new Jt.ProtocolRequestType(e.method)}(Xt||(Bt.FoldingRangeRequest=Xt={})),function(e){e.method="workspace/foldingRange/refresh",e.messageDirection=Jt.MessageDirection.serverToClient,e.type=new Jt.ProtocolRequestType0(e.method)}(Yt||(Bt.FoldingRangeRefreshRequest=Yt={}));var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.DeclarationRequest=void 0;const Zt=Et;var en;!function(e){e.method="textDocument/declaration",e.messageDirection=Zt.MessageDirection.clientToServer,e.type=new Zt.ProtocolRequestType(e.method)}(en||(Qt.DeclarationRequest=en={}));var tn={};Object.defineProperty(tn,"__esModule",{value:!0}),tn.SelectionRangeRequest=void 0;const nn=Et;var rn;!function(e){e.method="textDocument/selectionRange",e.messageDirection=nn.MessageDirection.clientToServer,e.type=new nn.ProtocolRequestType(e.method)}(rn||(tn.SelectionRangeRequest=rn={}));var on={};Object.defineProperty(on,"__esModule",{value:!0}),on.WorkDoneProgressCancelNotification=on.WorkDoneProgressCreateRequest=on.WorkDoneProgress=void 0;const sn=xe,an=Et;var cn,un,ln;!function(e){e.type=new sn.ProgressType,e.is=function(t){return t===e.type}}(cn||(on.WorkDoneProgress=cn={})),function(e){e.method="window/workDoneProgress/create",e.messageDirection=an.MessageDirection.serverToClient,e.type=new an.ProtocolRequestType(e.method)}(un||(on.WorkDoneProgressCreateRequest=un={})),function(e){e.method="window/workDoneProgress/cancel",e.messageDirection=an.MessageDirection.clientToServer,e.type=new an.ProtocolNotificationType(e.method)}(ln||(on.WorkDoneProgressCancelNotification=ln={}));var hn={};Object.defineProperty(hn,"__esModule",{value:!0}),hn.CallHierarchyOutgoingCallsRequest=hn.CallHierarchyIncomingCallsRequest=hn.CallHierarchyPrepareRequest=void 0;const dn=Et;var pn,fn,mn;!function(e){e.method="textDocument/prepareCallHierarchy",e.messageDirection=dn.MessageDirection.clientToServer,e.type=new dn.ProtocolRequestType(e.method)}(pn||(hn.CallHierarchyPrepareRequest=pn={})),function(e){e.method="callHierarchy/incomingCalls",e.messageDirection=dn.MessageDirection.clientToServer,e.type=new dn.ProtocolRequestType(e.method)}(fn||(hn.CallHierarchyIncomingCallsRequest=fn={})),function(e){e.method="callHierarchy/outgoingCalls",e.messageDirection=dn.MessageDirection.clientToServer,e.type=new dn.ProtocolRequestType(e.method)}(mn||(hn.CallHierarchyOutgoingCallsRequest=mn={}));var gn={};Object.defineProperty(gn,"__esModule",{value:!0}),gn.SemanticTokensRefreshRequest=gn.SemanticTokensRangeRequest=gn.SemanticTokensDeltaRequest=gn.SemanticTokensRequest=gn.SemanticTokensRegistrationType=gn.TokenFormat=void 0;const yn=Et;var vn,bn,Sn,wn,Rn,Cn;!function(e){e.Relative="relative"}(vn||(gn.TokenFormat=vn={})),function(e){e.method="textDocument/semanticTokens",e.type=new yn.RegistrationType(e.method)}(bn||(gn.SemanticTokensRegistrationType=bn={})),function(e){e.method="textDocument/semanticTokens/full",e.messageDirection=yn.MessageDirection.clientToServer,e.type=new yn.ProtocolRequestType(e.method),e.registrationMethod=bn.method}(Sn||(gn.SemanticTokensRequest=Sn={})),function(e){e.method="textDocument/semanticTokens/full/delta",e.messageDirection=yn.MessageDirection.clientToServer,e.type=new yn.ProtocolRequestType(e.method),e.registrationMethod=bn.method}(wn||(gn.SemanticTokensDeltaRequest=wn={})),function(e){e.method="textDocument/semanticTokens/range",e.messageDirection=yn.MessageDirection.clientToServer,e.type=new yn.ProtocolRequestType(e.method),e.registrationMethod=bn.method}(Rn||(gn.SemanticTokensRangeRequest=Rn={})),function(e){e.method="workspace/semanticTokens/refresh",e.messageDirection=yn.MessageDirection.serverToClient,e.type=new yn.ProtocolRequestType0(e.method)}(Cn||(gn.SemanticTokensRefreshRequest=Cn={}));var En={};Object.defineProperty(En,"__esModule",{value:!0}),En.ShowDocumentRequest=void 0;const _n=Et;var Dn;!function(e){e.method="window/showDocument",e.messageDirection=_n.MessageDirection.serverToClient,e.type=new _n.ProtocolRequestType(e.method)}(Dn||(En.ShowDocumentRequest=Dn={}));var Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.LinkedEditingRangeRequest=void 0;const xn=Et;var kn;!function(e){e.method="textDocument/linkedEditingRange",e.messageDirection=xn.MessageDirection.clientToServer,e.type=new xn.ProtocolRequestType(e.method)}(kn||(Tn.LinkedEditingRangeRequest=kn={}));var Pn={};Object.defineProperty(Pn,"__esModule",{value:!0}),Pn.WillDeleteFilesRequest=Pn.DidDeleteFilesNotification=Pn.DidRenameFilesNotification=Pn.WillRenameFilesRequest=Pn.DidCreateFilesNotification=Pn.WillCreateFilesRequest=Pn.FileOperationPatternKind=void 0;const On=Et;var Nn,An,In,qn,Mn,Fn,Ln;!function(e){e.file="file",e.folder="folder"}(Nn||(Pn.FileOperationPatternKind=Nn={})),function(e){e.method="workspace/willCreateFiles",e.messageDirection=On.MessageDirection.clientToServer,e.type=new On.ProtocolRequestType(e.method)}(An||(Pn.WillCreateFilesRequest=An={})),function(e){e.method="workspace/didCreateFiles",e.messageDirection=On.MessageDirection.clientToServer,e.type=new On.ProtocolNotificationType(e.method)}(In||(Pn.DidCreateFilesNotification=In={})),function(e){e.method="workspace/willRenameFiles",e.messageDirection=On.MessageDirection.clientToServer,e.type=new On.ProtocolRequestType(e.method)}(qn||(Pn.WillRenameFilesRequest=qn={})),function(e){e.method="workspace/didRenameFiles",e.messageDirection=On.MessageDirection.clientToServer,e.type=new On.ProtocolNotificationType(e.method)}(Mn||(Pn.DidRenameFilesNotification=Mn={})),function(e){e.method="workspace/didDeleteFiles",e.messageDirection=On.MessageDirection.clientToServer,e.type=new On.ProtocolNotificationType(e.method)}(Fn||(Pn.DidDeleteFilesNotification=Fn={})),function(e){e.method="workspace/willDeleteFiles",e.messageDirection=On.MessageDirection.clientToServer,e.type=new On.ProtocolRequestType(e.method)}(Ln||(Pn.WillDeleteFilesRequest=Ln={}));var jn={};Object.defineProperty(jn,"__esModule",{value:!0}),jn.MonikerRequest=jn.MonikerKind=jn.UniquenessLevel=void 0;const $n=Et;var Hn,Wn,Vn;!function(e){e.document="document",e.project="project",e.group="group",e.scheme="scheme",e.global="global"}(Hn||(jn.UniquenessLevel=Hn={})),function(e){e.$import="import",e.$export="export",e.local="local"}(Wn||(jn.MonikerKind=Wn={})),function(e){e.method="textDocument/moniker",e.messageDirection=$n.MessageDirection.clientToServer,e.type=new $n.ProtocolRequestType(e.method)}(Vn||(jn.MonikerRequest=Vn={}));var Un={};Object.defineProperty(Un,"__esModule",{value:!0}),Un.TypeHierarchySubtypesRequest=Un.TypeHierarchySupertypesRequest=Un.TypeHierarchyPrepareRequest=void 0;const Kn=Et;var Gn,zn,Bn;!function(e){e.method="textDocument/prepareTypeHierarchy",e.messageDirection=Kn.MessageDirection.clientToServer,e.type=new Kn.ProtocolRequestType(e.method)}(Gn||(Un.TypeHierarchyPrepareRequest=Gn={})),function(e){e.method="typeHierarchy/supertypes",e.messageDirection=Kn.MessageDirection.clientToServer,e.type=new Kn.ProtocolRequestType(e.method)}(zn||(Un.TypeHierarchySupertypesRequest=zn={})),function(e){e.method="typeHierarchy/subtypes",e.messageDirection=Kn.MessageDirection.clientToServer,e.type=new Kn.ProtocolRequestType(e.method)}(Bn||(Un.TypeHierarchySubtypesRequest=Bn={}));var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0}),Jn.InlineValueRefreshRequest=Jn.InlineValueRequest=void 0;const Xn=Et;var Yn,Qn;!function(e){e.method="textDocument/inlineValue",e.messageDirection=Xn.MessageDirection.clientToServer,e.type=new Xn.ProtocolRequestType(e.method)}(Yn||(Jn.InlineValueRequest=Yn={})),function(e){e.method="workspace/inlineValue/refresh",e.messageDirection=Xn.MessageDirection.serverToClient,e.type=new Xn.ProtocolRequestType0(e.method)}(Qn||(Jn.InlineValueRefreshRequest=Qn={}));var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0}),Zn.InlayHintRefreshRequest=Zn.InlayHintResolveRequest=Zn.InlayHintRequest=void 0;const er=Et;var tr,nr,rr;!function(e){e.method="textDocument/inlayHint",e.messageDirection=er.MessageDirection.clientToServer,e.type=new er.ProtocolRequestType(e.method)}(tr||(Zn.InlayHintRequest=tr={})),function(e){e.method="inlayHint/resolve",e.messageDirection=er.MessageDirection.clientToServer,e.type=new er.ProtocolRequestType(e.method)}(nr||(Zn.InlayHintResolveRequest=nr={})),function(e){e.method="workspace/inlayHint/refresh",e.messageDirection=er.MessageDirection.serverToClient,e.type=new er.ProtocolRequestType0(e.method)}(rr||(Zn.InlayHintRefreshRequest=rr={}));var ir={};Object.defineProperty(ir,"__esModule",{value:!0}),ir.DiagnosticRefreshRequest=ir.WorkspaceDiagnosticRequest=ir.DocumentDiagnosticRequest=ir.DocumentDiagnosticReportKind=ir.DiagnosticServerCancellationData=void 0;const or=xe,sr=xt,ar=Et;var cr,ur,lr,hr,dr;!function(e){e.is=function(e){const t=e;return t&&sr.boolean(t.retriggerRequest)}}(cr||(ir.DiagnosticServerCancellationData=cr={})),function(e){e.Full="full",e.Unchanged="unchanged"}(ur||(ir.DocumentDiagnosticReportKind=ur={})),function(e){e.method="textDocument/diagnostic",e.messageDirection=ar.MessageDirection.clientToServer,e.type=new ar.ProtocolRequestType(e.method),e.partialResult=new or.ProgressType}(lr||(ir.DocumentDiagnosticRequest=lr={})),function(e){e.method="workspace/diagnostic",e.messageDirection=ar.MessageDirection.clientToServer,e.type=new ar.ProtocolRequestType(e.method),e.partialResult=new or.ProgressType}(hr||(ir.WorkspaceDiagnosticRequest=hr={})),function(e){e.method="workspace/diagnostic/refresh",e.messageDirection=ar.MessageDirection.serverToClient,e.type=new ar.ProtocolRequestType0(e.method)}(dr||(ir.DiagnosticRefreshRequest=dr={}));var pr={};Object.defineProperty(pr,"__esModule",{value:!0}),pr.DidCloseNotebookDocumentNotification=pr.DidSaveNotebookDocumentNotification=pr.DidChangeNotebookDocumentNotification=pr.NotebookCellArrayChange=pr.DidOpenNotebookDocumentNotification=pr.NotebookDocumentSyncRegistrationType=pr.NotebookDocument=pr.NotebookCell=pr.ExecutionSummary=pr.NotebookCellKind=void 0;const fr=Ct,mr=xt,gr=Et;var yr,vr,br,Sr,wr,Rr,Cr,Er,_r,Dr;!function(e){e.Markup=1,e.Code=2,e.is=function(e){return 1===e||2===e}}(yr||(pr.NotebookCellKind=yr={})),function(e){e.create=function(e,t){const n={executionOrder:e};return!0!==t&&!1!==t||(n.success=t),n},e.is=function(e){const t=e;return mr.objectLiteral(t)&&fr.uinteger.is(t.executionOrder)&&(void 0===t.success||mr.boolean(t.success))},e.equals=function(e,t){return e===t||null!=e&&null!=t&&(e.executionOrder===t.executionOrder&&e.success===t.success)}}(vr||(pr.ExecutionSummary=vr={})),function(e){function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(typeof e!=typeof n)return!1;if("object"!=typeof e)return!1;const r=Array.isArray(e),i=Array.isArray(n);if(r!==i)return!1;if(r&&i){if(e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1}if(mr.objectLiteral(e)&&mr.objectLiteral(n)){const r=Object.keys(e),i=Object.keys(n);if(r.length!==i.length)return!1;if(r.sort(),i.sort(),!t(r,i))return!1;for(let i=0;i<r.length;i++){const o=r[i];if(!t(e[o],n[o]))return!1}}return!0}e.create=function(e,t){return{kind:e,document:t}},e.is=function(e){const t=e;return mr.objectLiteral(t)&&yr.is(t.kind)&&fr.DocumentUri.is(t.document)&&(void 0===t.metadata||mr.objectLiteral(t.metadata))},e.diff=function(e,n){const r=new Set;return e.document!==n.document&&r.add("document"),e.kind!==n.kind&&r.add("kind"),e.executionSummary!==n.executionSummary&&r.add("executionSummary"),void 0===e.metadata&&void 0===n.metadata||t(e.metadata,n.metadata)||r.add("metadata"),void 0===e.executionSummary&&void 0===n.executionSummary||vr.equals(e.executionSummary,n.executionSummary)||r.add("executionSummary"),r}}(br||(pr.NotebookCell=br={})),function(e){e.create=function(e,t,n,r){return{uri:e,notebookType:t,version:n,cells:r}},e.is=function(e){const t=e;return mr.objectLiteral(t)&&mr.string(t.uri)&&fr.integer.is(t.version)&&mr.typedArray(t.cells,br.is)}}(Sr||(pr.NotebookDocument=Sr={})),function(e){e.method="notebookDocument/sync",e.messageDirection=gr.MessageDirection.clientToServer,e.type=new gr.RegistrationType(e.method)}(wr||(pr.NotebookDocumentSyncRegistrationType=wr={})),function(e){e.method="notebookDocument/didOpen",e.messageDirection=gr.MessageDirection.clientToServer,e.type=new gr.ProtocolNotificationType(e.method),e.registrationMethod=wr.method}(Rr||(pr.DidOpenNotebookDocumentNotification=Rr={})),function(e){e.is=function(e){const t=e;return mr.objectLiteral(t)&&fr.uinteger.is(t.start)&&fr.uinteger.is(t.deleteCount)&&(void 0===t.cells||mr.typedArray(t.cells,br.is))},e.create=function(e,t,n){const r={start:e,deleteCount:t};return void 0!==n&&(r.cells=n),r}}(Cr||(pr.NotebookCellArrayChange=Cr={})),function(e){e.method="notebookDocument/didChange",e.messageDirection=gr.MessageDirection.clientToServer,e.type=new gr.ProtocolNotificationType(e.method),e.registrationMethod=wr.method}(Er||(pr.DidChangeNotebookDocumentNotification=Er={})),function(e){e.method="notebookDocument/didSave",e.messageDirection=gr.MessageDirection.clientToServer,e.type=new gr.ProtocolNotificationType(e.method),e.registrationMethod=wr.method}(_r||(pr.DidSaveNotebookDocumentNotification=_r={})),function(e){e.method="notebookDocument/didClose",e.messageDirection=gr.MessageDirection.clientToServer,e.type=new gr.ProtocolNotificationType(e.method),e.registrationMethod=wr.method}(Dr||(pr.DidCloseNotebookDocumentNotification=Dr={}));var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.InlineCompletionRequest=void 0;const xr=Et;var kr;!function(e){e.method="textDocument/inlineCompletion",e.messageDirection=xr.MessageDirection.clientToServer,e.type=new xr.ProtocolRequestType(e.method)}(kr||(Tr.InlineCompletionRequest=kr={})),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkspaceSymbolRequest=e.CodeActionResolveRequest=e.CodeActionRequest=e.DocumentSymbolRequest=e.DocumentHighlightRequest=e.ReferencesRequest=e.DefinitionRequest=e.SignatureHelpRequest=e.SignatureHelpTriggerKind=e.HoverRequest=e.CompletionResolveRequest=e.CompletionRequest=e.CompletionTriggerKind=e.PublishDiagnosticsNotification=e.WatchKind=e.RelativePattern=e.FileChangeType=e.DidChangeWatchedFilesNotification=e.WillSaveTextDocumentWaitUntilRequest=e.WillSaveTextDocumentNotification=e.TextDocumentSaveReason=e.DidSaveTextDocumentNotification=e.DidCloseTextDocumentNotification=e.DidChangeTextDocumentNotification=e.TextDocumentContentChangeEvent=e.DidOpenTextDocumentNotification=e.TextDocumentSyncKind=e.TelemetryEventNotification=e.LogMessageNotification=e.ShowMessageRequest=e.ShowMessageNotification=e.MessageType=e.DidChangeConfigurationNotification=e.ExitNotification=e.ShutdownRequest=e.InitializedNotification=e.InitializeErrorCodes=e.InitializeRequest=e.WorkDoneProgressOptions=e.TextDocumentRegistrationOptions=e.StaticRegistrationOptions=e.PositionEncodingKind=e.FailureHandlingKind=e.ResourceOperationKind=e.UnregistrationRequest=e.RegistrationRequest=e.DocumentSelector=e.NotebookCellTextDocumentFilter=e.NotebookDocumentFilter=e.TextDocumentFilter=void 0,e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=e.WillDeleteFilesRequest=e.DidDeleteFilesNotification=e.WillRenameFilesRequest=e.DidRenameFilesNotification=e.WillCreateFilesRequest=e.DidCreateFilesNotification=e.FileOperationPatternKind=e.LinkedEditingRangeRequest=e.ShowDocumentRequest=e.SemanticTokensRegistrationType=e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.TokenFormat=e.CallHierarchyPrepareRequest=e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=e.SelectionRangeRequest=e.DeclarationRequest=e.FoldingRangeRefreshRequest=e.FoldingRangeRequest=e.ColorPresentationRequest=e.DocumentColorRequest=e.ConfigurationRequest=e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=e.TypeDefinitionRequest=e.ImplementationRequest=e.ApplyWorkspaceEditRequest=e.ExecuteCommandRequest=e.PrepareRenameRequest=e.RenameRequest=e.PrepareSupportDefaultBehavior=e.DocumentOnTypeFormattingRequest=e.DocumentRangesFormattingRequest=e.DocumentRangeFormattingRequest=e.DocumentFormattingRequest=e.DocumentLinkResolveRequest=e.DocumentLinkRequest=e.CodeLensRefreshRequest=e.CodeLensResolveRequest=e.CodeLensRequest=e.WorkspaceSymbolResolveRequest=void 0,e.InlineCompletionRequest=e.DidCloseNotebookDocumentNotification=e.DidSaveNotebookDocumentNotification=e.DidChangeNotebookDocumentNotification=e.NotebookCellArrayChange=e.DidOpenNotebookDocumentNotification=e.NotebookDocumentSyncRegistrationType=e.NotebookDocument=e.NotebookCell=e.ExecutionSummary=e.NotebookCellKind=e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=e.InlineValueRefreshRequest=e.InlineValueRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchySubtypesRequest=e.TypeHierarchyPrepareRequest=void 0;const t=Et,n=Ct,r=xt,i=Ot;Object.defineProperty(e,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const o=It;Object.defineProperty(e,"TypeDefinitionRequest",{enumerable:!0,get:function(){return o.TypeDefinitionRequest}});const s=Ft;Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const a=Ht;Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=Ut;Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=Bt;Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(e,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const l=Qt;Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const h=tn;Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const d=on;Object.defineProperty(e,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(e,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(e,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const p=hn;Object.defineProperty(e,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(e,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(e,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const f=gn;Object.defineProperty(e,"TokenFormat",{enumerable:!0,get:function(){return f.TokenFormat}}),Object.defineProperty(e,"SemanticTokensRequest",{enumerable:!0,get:function(){return f.SemanticTokensRequest}}),Object.defineProperty(e,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return f.SemanticTokensDeltaRequest}}),Object.defineProperty(e,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return f.SemanticTokensRangeRequest}}),Object.defineProperty(e,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return f.SemanticTokensRefreshRequest}}),Object.defineProperty(e,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return f.SemanticTokensRegistrationType}});const m=En;Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return m.ShowDocumentRequest}});const g=Tn;Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return g.LinkedEditingRangeRequest}});const y=Pn;Object.defineProperty(e,"FileOperationPatternKind",{enumerable:!0,get:function(){return y.FileOperationPatternKind}}),Object.defineProperty(e,"DidCreateFilesNotification",{enumerable:!0,get:function(){return y.DidCreateFilesNotification}}),Object.defineProperty(e,"WillCreateFilesRequest",{enumerable:!0,get:function(){return y.WillCreateFilesRequest}}),Object.defineProperty(e,"DidRenameFilesNotification",{enumerable:!0,get:function(){return y.DidRenameFilesNotification}}),Object.defineProperty(e,"WillRenameFilesRequest",{enumerable:!0,get:function(){return y.WillRenameFilesRequest}}),Object.defineProperty(e,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return y.DidDeleteFilesNotification}}),Object.defineProperty(e,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return y.WillDeleteFilesRequest}});const v=jn;Object.defineProperty(e,"UniquenessLevel",{enumerable:!0,get:function(){return v.UniquenessLevel}}),Object.defineProperty(e,"MonikerKind",{enumerable:!0,get:function(){return v.MonikerKind}}),Object.defineProperty(e,"MonikerRequest",{enumerable:!0,get:function(){return v.MonikerRequest}});const b=Un;Object.defineProperty(e,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return b.TypeHierarchyPrepareRequest}}),Object.defineProperty(e,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySubtypesRequest}}),Object.defineProperty(e,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return b.TypeHierarchySupertypesRequest}});const S=Jn;Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return S.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return S.InlineValueRefreshRequest}});const w=Zn;Object.defineProperty(e,"InlayHintRequest",{enumerable:!0,get:function(){return w.InlayHintRequest}}),Object.defineProperty(e,"InlayHintResolveRequest",{enumerable:!0,get:function(){return w.InlayHintResolveRequest}}),Object.defineProperty(e,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return w.InlayHintRefreshRequest}});const R=ir;Object.defineProperty(e,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return R.DiagnosticServerCancellationData}}),Object.defineProperty(e,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return R.DocumentDiagnosticReportKind}}),Object.defineProperty(e,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return R.DocumentDiagnosticRequest}}),Object.defineProperty(e,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return R.WorkspaceDiagnosticRequest}}),Object.defineProperty(e,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return R.DiagnosticRefreshRequest}});const C=pr;Object.defineProperty(e,"NotebookCellKind",{enumerable:!0,get:function(){return C.NotebookCellKind}}),Object.defineProperty(e,"ExecutionSummary",{enumerable:!0,get:function(){return C.ExecutionSummary}}),Object.defineProperty(e,"NotebookCell",{enumerable:!0,get:function(){return C.NotebookCell}}),Object.defineProperty(e,"NotebookDocument",{enumerable:!0,get:function(){return C.NotebookDocument}}),Object.defineProperty(e,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return C.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(e,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidOpenNotebookDocumentNotification}}),Object.defineProperty(e,"NotebookCellArrayChange",{enumerable:!0,get:function(){return C.NotebookCellArrayChange}}),Object.defineProperty(e,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidChangeNotebookDocumentNotification}}),Object.defineProperty(e,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidSaveNotebookDocumentNotification}}),Object.defineProperty(e,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return C.DidCloseNotebookDocumentNotification}});const E=Tr;var _,D,T,x,k,P,O,N,A,I,q,M,F,L,j,$,H,W,V,U,K,G,z,B,J,X,Y,Q,Z,ee,te,ne,re,ie,oe,se,ae,ce,ue,le,he,de,pe,fe,me,ge,ye,ve,be,Se,we,Re,Ce,Ee,_e,De,Te,xe,ke,Pe,Oe,Ne,Ae,Ie,qe;Object.defineProperty(e,"InlineCompletionRequest",{enumerable:!0,get:function(){return E.InlineCompletionRequest}}),function(e){e.is=function(e){const t=e;return r.string(t)||r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(_||(e.TextDocumentFilter=_={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebookType)||r.string(t.scheme)||r.string(t.pattern))}}(D||(e.NotebookDocumentFilter=D={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(r.string(t.notebook)||D.is(t.notebook))&&(void 0===t.language||r.string(t.language))}}(T||(e.NotebookCellTextDocumentFilter=T={})),function(e){e.is=function(e){if(!Array.isArray(e))return!1;for(let t of e)if(!r.string(t)&&!_.is(t)&&!T.is(t))return!1;return!0}}(x||(e.DocumentSelector=x={})),function(e){e.method="client/registerCapability",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)}(k||(e.RegistrationRequest=k={})),function(e){e.method="client/unregisterCapability",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)}(P||(e.UnregistrationRequest=P={})),function(e){e.Create="create",e.Rename="rename",e.Delete="delete"}(O||(e.ResourceOperationKind=O={})),function(e){e.Abort="abort",e.Transactional="transactional",e.TextOnlyTransactional="textOnlyTransactional",e.Undo="undo"}(N||(e.FailureHandlingKind=N={})),function(e){e.UTF8="utf-8",e.UTF16="utf-16",e.UTF32="utf-32"}(A||(e.PositionEncodingKind=A={})),function(e){e.hasId=function(e){const t=e;return t&&r.string(t.id)&&t.id.length>0}}(I||(e.StaticRegistrationOptions=I={})),function(e){e.is=function(e){const t=e;return t&&(null===t.documentSelector||x.is(t.documentSelector))}}(q||(e.TextDocumentRegistrationOptions=q={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(void 0===t.workDoneProgress||r.boolean(t.workDoneProgress))},e.hasWorkDoneProgress=function(e){const t=e;return t&&r.boolean(t.workDoneProgress)}}(M||(e.WorkDoneProgressOptions=M={})),function(e){e.method="initialize",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(F||(e.InitializeRequest=F={})),function(e){e.unknownProtocolVersion=1}(L||(e.InitializeErrorCodes=L={})),function(e){e.method="initialized",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(j||(e.InitializedNotification=j={})),function(e){e.method="shutdown",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType0(e.method)}($||(e.ShutdownRequest=$={})),function(e){e.method="exit",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType0(e.method)}(H||(e.ExitNotification=H={})),function(e){e.method="workspace/didChangeConfiguration",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(W||(e.DidChangeConfigurationNotification=W={})),function(e){e.Error=1,e.Warning=2,e.Info=3,e.Log=4,e.Debug=5}(V||(e.MessageType=V={})),function(e){e.method="window/showMessage",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)}(U||(e.ShowMessageNotification=U={})),function(e){e.method="window/showMessageRequest",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType(e.method)}(K||(e.ShowMessageRequest=K={})),function(e){e.method="window/logMessage",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)}(G||(e.LogMessageNotification=G={})),function(e){e.method="telemetry/event",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)}(z||(e.TelemetryEventNotification=z={})),function(e){e.None=0,e.Full=1,e.Incremental=2}(B||(e.TextDocumentSyncKind=B={})),function(e){e.method="textDocument/didOpen",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(J||(e.DidOpenTextDocumentNotification=J={})),function(e){e.isIncremental=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)},e.isFull=function(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}(X||(e.TextDocumentContentChangeEvent=X={})),function(e){e.method="textDocument/didChange",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(Y||(e.DidChangeTextDocumentNotification=Y={})),function(e){e.method="textDocument/didClose",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(Q||(e.DidCloseTextDocumentNotification=Q={})),function(e){e.method="textDocument/didSave",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(Z||(e.DidSaveTextDocumentNotification=Z={})),function(e){e.Manual=1,e.AfterDelay=2,e.FocusOut=3}(ee||(e.TextDocumentSaveReason=ee={})),function(e){e.method="textDocument/willSave",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(te||(e.WillSaveTextDocumentNotification=te={})),function(e){e.method="textDocument/willSaveWaitUntil",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(ne||(e.WillSaveTextDocumentWaitUntilRequest=ne={})),function(e){e.method="workspace/didChangeWatchedFiles",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolNotificationType(e.method)}(re||(e.DidChangeWatchedFilesNotification=re={})),function(e){e.Created=1,e.Changed=2,e.Deleted=3}(ie||(e.FileChangeType=ie={})),function(e){e.is=function(e){const t=e;return r.objectLiteral(t)&&(n.URI.is(t.baseUri)||n.WorkspaceFolder.is(t.baseUri))&&r.string(t.pattern)}}(oe||(e.RelativePattern=oe={})),function(e){e.Create=1,e.Change=2,e.Delete=4}(se||(e.WatchKind=se={})),function(e){e.method="textDocument/publishDiagnostics",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolNotificationType(e.method)}(ae||(e.PublishDiagnosticsNotification=ae={})),function(e){e.Invoked=1,e.TriggerCharacter=2,e.TriggerForIncompleteCompletions=3}(ce||(e.CompletionTriggerKind=ce={})),function(e){e.method="textDocument/completion",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(ue||(e.CompletionRequest=ue={})),function(e){e.method="completionItem/resolve",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(le||(e.CompletionResolveRequest=le={})),function(e){e.method="textDocument/hover",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(he||(e.HoverRequest=he={})),function(e){e.Invoked=1,e.TriggerCharacter=2,e.ContentChange=3}(de||(e.SignatureHelpTriggerKind=de={})),function(e){e.method="textDocument/signatureHelp",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(pe||(e.SignatureHelpRequest=pe={})),function(e){e.method="textDocument/definition",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(fe||(e.DefinitionRequest=fe={})),function(e){e.method="textDocument/references",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(me||(e.ReferencesRequest=me={})),function(e){e.method="textDocument/documentHighlight",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(ge||(e.DocumentHighlightRequest=ge={})),function(e){e.method="textDocument/documentSymbol",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(ye||(e.DocumentSymbolRequest=ye={})),function(e){e.method="textDocument/codeAction",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(ve||(e.CodeActionRequest=ve={})),function(e){e.method="codeAction/resolve",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(be||(e.CodeActionResolveRequest=be={})),function(e){e.method="workspace/symbol",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Se||(e.WorkspaceSymbolRequest=Se={})),function(e){e.method="workspaceSymbol/resolve",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(we||(e.WorkspaceSymbolResolveRequest=we={})),function(e){e.method="textDocument/codeLens",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Re||(e.CodeLensRequest=Re={})),function(e){e.method="codeLens/resolve",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Ce||(e.CodeLensResolveRequest=Ce={})),function(e){e.method="workspace/codeLens/refresh",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType0(e.method)}(Ee||(e.CodeLensRefreshRequest=Ee={})),function(e){e.method="textDocument/documentLink",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(_e||(e.DocumentLinkRequest=_e={})),function(e){e.method="documentLink/resolve",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(De||(e.DocumentLinkResolveRequest=De={})),function(e){e.method="textDocument/formatting",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Te||(e.DocumentFormattingRequest=Te={})),function(e){e.method="textDocument/rangeFormatting",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(xe||(e.DocumentRangeFormattingRequest=xe={})),function(e){e.method="textDocument/rangesFormatting",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(ke||(e.DocumentRangesFormattingRequest=ke={})),function(e){e.method="textDocument/onTypeFormatting",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Pe||(e.DocumentOnTypeFormattingRequest=Pe={})),function(e){e.Identifier=1}(Oe||(e.PrepareSupportDefaultBehavior=Oe={})),function(e){e.method="textDocument/rename",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Ne||(e.RenameRequest=Ne={})),function(e){e.method="textDocument/prepareRename",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Ae||(e.PrepareRenameRequest=Ae={})),function(e){e.method="workspace/executeCommand",e.messageDirection=t.MessageDirection.clientToServer,e.type=new t.ProtocolRequestType(e.method)}(Ie||(e.ExecuteCommandRequest=Ie={})),function(e){e.method="workspace/applyEdit",e.messageDirection=t.MessageDirection.serverToClient,e.type=new t.ProtocolRequestType("workspace/applyEdit")}(qe||(e.ApplyWorkspaceEditRequest=qe={}))}(Tt);var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.createProtocolConnection=void 0;const Or=xe;Pr.createProtocolConnection=function(e,t,n,r){return Or.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,Or.createMessageConnection)(e,t,n,r)},function(e){var t=O&&O.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=O&&O.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.LSPErrorCodes=e.createProtocolConnection=void 0,n(xe,e),n(Ct,e),n(Et,e),n(Tt,e);var r,i=Pr;Object.defineProperty(e,"createProtocolConnection",{enumerable:!0,get:function(){return i.createProtocolConnection}}),function(e){e.lspReservedErrorRangeStart=-32899,e.RequestFailed=-32803,e.ServerCancelled=-32802,e.ContentModified=-32801,e.RequestCancelled=-32800,e.lspReservedErrorRangeEnd=-32800}(r||(e.LSPErrorCodes=r={}))}(bt),function(e){var t=O&&O.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=O&&O.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createProtocolConnection=void 0;const r=vt;n(vt,e),n(bt,e),e.createProtocolConnection=function(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}}(Te);var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.generateUuid=Nr.parse=Nr.isUUID=Nr.v4=Nr.empty=void 0;class Ar{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class Ir extends Ar{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return Ir._oneOf(Ir._chars)}constructor(){super([Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),"-",Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),"-","4",Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),"-",Ir._oneOf(Ir._timeHighBits),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),"-",Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex(),Ir._randomHex()].join(""))}}function qr(){return new Ir}Ir._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],Ir._timeHighBits=["8","9","a","b"],Nr.empty=new Ar("00000000-0000-0000-0000-000000000000"),Nr.v4=qr;const Mr=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Fr(e){return Mr.test(e)}Nr.isUUID=Fr,Nr.parse=function(e){if(!Fr(e))throw new Error("invalid uuid");return new Ar(e)},Nr.generateUuid=function(){return qr().asHex()};var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.attachPartialResult=Lr.ProgressFeature=Kr=Lr.attachWorkDone=void 0;const jr=Te,$r=Nr;class Hr{constructor(e,t){this._connection=e,this._token=t,Hr.Instances.set(this._token,this)}begin(e,t,n,r){let i={kind:"begin",title:e,percentage:t,message:n,cancellable:r};this._connection.sendProgress(jr.WorkDoneProgress.type,this._token,i)}report(e,t){let n={kind:"report"};"number"==typeof e?(n.percentage=e,void 0!==t&&(n.message=t)):n.message=e,this._connection.sendProgress(jr.WorkDoneProgress.type,this._token,n)}done(){Hr.Instances.delete(this._token),this._connection.sendProgress(jr.WorkDoneProgress.type,this._token,{kind:"end"})}}Hr.Instances=new Map;class Wr extends Hr{constructor(e,t){super(e,t),this._source=new jr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class Vr{constructor(){}begin(){}report(){}done(){}}class Ur extends Vr{constructor(){super(),this._source=new jr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var Kr=Lr.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new Vr;const n=t.workDoneToken;return delete t.workDoneToken,new Hr(e,n)};var Gr;Lr.ProgressFeature=e=>class extends e{constructor(){super(),this._progressSupported=!1}initialize(e){super.initialize(e),!0===e?.window?.workDoneProgress&&(this._progressSupported=!0,this.connection.onNotification(jr.WorkDoneProgressCancelNotification.type,(e=>{let t=Hr.Instances.get(e.token);(t instanceof Wr||t instanceof Ur)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new Vr:new Hr(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,$r.generateUuid)();return this.connection.sendRequest(jr.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new Wr(this.connection,e)))}return Promise.resolve(new Ur)}},function(e){e.type=new jr.ProgressType}(Gr||(Gr={}));class zr{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(Gr.type,this._token,e)}}Lr.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new zr(e,n)};var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.ConfigurationFeature=void 0;const Jr=Te,Xr=Se;Br.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?Xr.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let t={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(Jr.ConfigurationRequest.type,t).then((t=>Array.isArray(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}};var Yr={};Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.WorkspaceFoldersFeature=void 0;const Qr=Te;Yr.WorkspaceFoldersFeature=e=>class extends e{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(e){super.initialize(e);let t=e.workspace;t&&t.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Qr.Emitter,this.connection.onNotification(Qr.DidChangeWorkspaceFoldersNotification.type,(e=>{this._onDidChangeWorkspaceFolders.fire(e.event)})))}fillServerCapabilities(e){super.fillServerCapabilities(e);const t=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=!0===t||"string"==typeof t}getWorkspaceFolders(){return this.connection.sendRequest(Qr.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return this._notificationIsAutoRegistered||this._unregistration||(this._unregistration=this.connection.client.register(Qr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.CallHierarchyFeature=void 0;const ei=Te;Zr.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(ei.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onIncomingCalls:e=>{const t=ei.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=ei.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var ti={};Object.defineProperty(ti,"__esModule",{value:!0}),ti.SemanticTokensBuilder=ti.SemanticTokensDiff=ti.SemanticTokensFeature=void 0;const ni=Te;ti.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(ni.SemanticTokensRefreshRequest.type),on:e=>{const t=ni.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=ni.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=ni.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class ri{constructor(e,t){this.originalSequence=e,this.modifiedSequence=t}computeDiff(){const e=this.originalSequence.length,t=this.modifiedSequence.length;let n=0;for(;n<t&&n<e&&this.originalSequence[n]===this.modifiedSequence[n];)n++;if(n<t&&n<e){let r=e-1,i=t-1;for(;r>=n&&i>=n&&this.originalSequence[r]===this.modifiedSequence[i];)r--,i--;(r<n||i<n)&&(r++,i++);const o=r-n+1,s=this.modifiedSequence.slice(n,i+1);return 1===s.length&&s[0]===this.originalSequence[r]?[{start:n,deleteCount:o-1}]:[{start:n,deleteCount:o,data:s}]}return n<t?[{start:n,deleteCount:0,data:this.modifiedSequence.slice(n)}]:n<e?[{start:n,deleteCount:e-n}]:[]}}ti.SemanticTokensDiff=ri;ti.SemanticTokensBuilder=class{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(e,t,n,r,i){let o=e,s=t;this._dataLen>0&&(o-=this._prevLine,0===o&&(s-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=s,this._data[this._dataLen++]=n,this._data[this._dataLen++]=r,this._data[this._dataLen++]=i,this._prevLine=e,this._prevChar=t}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return void 0!==this._prevData}buildEdits(){return void 0!==this._prevData?{resultId:this.id,edits:new ri(this._prevData,this._data).computeDiff()}:this.build()}};var ii={};Object.defineProperty(ii,"__esModule",{value:!0}),ii.ShowDocumentFeature=void 0;const oi=Te;ii.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(oi.ShowDocumentRequest.type,e)}};var si={};Object.defineProperty(si,"__esModule",{value:!0}),si.FileOperationsFeature=void 0;const ai=Te;si.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){return this.connection.onNotification(ai.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(ai.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return this.connection.onNotification(ai.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(ai.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(ai.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(ai.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}};var ci={};Object.defineProperty(ci,"__esModule",{value:!0}),ci.LinkedEditingRangeFeature=void 0;const ui=Te;ci.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){return this.connection.onRequest(ui.LinkedEditingRangeRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0)))}};var li={};Object.defineProperty(li,"__esModule",{value:!0}),li.TypeHierarchyFeature=void 0;const hi=Te;li.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(hi.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=hi.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=hi.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var di={};Object.defineProperty(di,"__esModule",{value:!0}),di.InlineValueFeature=void 0;const pi=Te;di.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(pi.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(pi.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}};var fi={};Object.defineProperty(fi,"__esModule",{value:!0}),fi.FoldingRangeFeature=void 0;const mi=Te;fi.FoldingRangeFeature=e=>class extends e{get foldingRange(){return{refresh:()=>this.connection.sendRequest(mi.FoldingRangeRefreshRequest.type),on:e=>{const t=mi.FoldingRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var gi={};Object.defineProperty(gi,"__esModule",{value:!0}),gi.InlayHintFeature=void 0;const yi=Te;gi.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(yi.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(yi.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(yi.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}};var vi={};Object.defineProperty(vi,"__esModule",{value:!0}),vi.DiagnosticFeature=void 0;const bi=Te;vi.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(bi.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(bi.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(bi.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(bi.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(bi.WorkspaceDiagnosticRequest.partialResult,t))))}}};var Si={},wi={};Object.defineProperty(wi,"__esModule",{value:!0}),wi.TextDocuments=void 0;const Ri=Te;wi.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new Ri.Emitter,this._onDidOpen=new Ri.Emitter,this._onDidClose=new Ri.Emitter,this._onDidSave=new Ri.Emitter,this._onWillSave=new Ri.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=Ri.TextDocumentSyncKind.Incremental;const t=[];return t.push(e.onDidOpenTextDocument((e=>{const t=e.textDocument,n=this._configuration.create(t.uri,t.languageId,t.version,t.text);this._syncedDocuments.set(t.uri,n);const r=Object.freeze({document:n});this._onDidOpen.fire(r),this._onDidChangeContent.fire(r)}))),t.push(e.onDidChangeTextDocument((e=>{const t=e.textDocument,n=e.contentChanges;if(0===n.length)return;const{version:r}=t;if(null==r)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);let i=this._syncedDocuments.get(t.uri);void 0!==i&&(i=this._configuration.update(i,n,r),this._syncedDocuments.set(t.uri,i),this._onDidChangeContent.fire(Object.freeze({document:i})))}))),t.push(e.onDidCloseTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&(this._syncedDocuments.delete(e.textDocument.uri),this._onDidClose.fire(Object.freeze({document:t})))}))),t.push(e.onWillSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onWillSave.fire(Object.freeze({document:t,reason:e.reason}))}))),t.push(e.onWillSaveTextDocumentWaitUntil(((e,t)=>{let n=this._syncedDocuments.get(e.textDocument.uri);return void 0!==n&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:n,reason:e.reason}),t):[]}))),t.push(e.onDidSaveTextDocument((e=>{let t=this._syncedDocuments.get(e.textDocument.uri);void 0!==t&&this._onDidSave.fire(Object.freeze({document:t}))}))),Ri.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}},Object.defineProperty(Si,"__esModule",{value:!0}),Si.NotebookDocuments=Si.NotebookSyncFeature=void 0;const Ci=Te,Ei=wi;Si.NotebookSyncFeature=e=>class extends e{get synchronization(){return{onDidOpenNotebookDocument:e=>this.connection.onNotification(Ci.DidOpenNotebookDocumentNotification.type,(t=>{e(t)})),onDidChangeNotebookDocument:e=>this.connection.onNotification(Ci.DidChangeNotebookDocumentNotification.type,(t=>{e(t)})),onDidSaveNotebookDocument:e=>this.connection.onNotification(Ci.DidSaveNotebookDocumentNotification.type,(t=>{e(t)})),onDidCloseNotebookDocument:e=>this.connection.onNotification(Ci.DidCloseNotebookDocumentNotification.type,(t=>{e(t)}))}}};class _i{onDidOpenTextDocument(e){return this.openHandler=e,Ci.Disposable.create((()=>{this.openHandler=void 0}))}openTextDocument(e){this.openHandler&&this.openHandler(e)}onDidChangeTextDocument(e){return this.changeHandler=e,Ci.Disposable.create((()=>{this.changeHandler=e}))}changeTextDocument(e){this.changeHandler&&this.changeHandler(e)}onDidCloseTextDocument(e){return this.closeHandler=e,Ci.Disposable.create((()=>{this.closeHandler=void 0}))}closeTextDocument(e){this.closeHandler&&this.closeHandler(e)}onWillSaveTextDocument(){return _i.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return _i.NULL_DISPOSE}onDidSaveTextDocument(){return _i.NULL_DISPOSE}}_i.NULL_DISPOSE=Object.freeze({dispose:()=>{}});Si.NotebookDocuments=class{constructor(e){e instanceof Ei.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new Ei.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Ci.Emitter,this._onDidChange=new Ci.Emitter,this._onDidSave=new Ci.Emitter,this._onDidClose=new Ci.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){const t=this.notebookCellMap.get(e);return t&&t[0]}findNotebookDocumentForCell(e){const t="string"==typeof e?e:e.document,n=this.notebookCellMap.get(t);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){const t=new _i,n=[];return n.push(this.cellTextDocuments.listen(t)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument((e=>{this.notebookDocuments.set(e.notebookDocument.uri,e.notebookDocument);for(const n of e.cellTextDocuments)t.openTextDocument({textDocument:n});this.updateCellMap(e.notebookDocument),this._onDidOpen.fire(e.notebookDocument)}))),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0===n)return;n.version=e.notebookDocument.version;const r=n.metadata;let i=!1;const o=e.change;void 0!==o.metadata&&(i=!0,n.metadata=o.metadata);const s=[],a=[],c=[],u=[];if(void 0!==o.cells){const e=o.cells;if(void 0!==e.structure){const r=e.structure.array;if(n.cells.splice(r.start,r.deleteCount,...void 0!==r.cells?r.cells:[]),void 0!==e.structure.didOpen)for(const n of e.structure.didOpen)t.openTextDocument({textDocument:n}),s.push(n.uri);if(e.structure.didClose)for(const n of e.structure.didClose)t.closeTextDocument({textDocument:n}),a.push(n.uri)}if(void 0!==e.data){const t=new Map(e.data.map((e=>[e.document,e])));for(let e=0;e<=n.cells.length;e++){const r=t.get(n.cells[e].document);if(void 0!==r){const i=n.cells.splice(e,1,r);if(c.push({old:i[0],new:r}),t.delete(r.document),0===t.size)break}}}if(void 0!==e.textContent)for(const n of e.textContent)t.changeTextDocument({textDocument:n.document,contentChanges:n.changes}),u.push(n.document.uri)}this.updateCellMap(n);const l={notebookDocument:n};i&&(l.metadata={old:r,new:n.metadata});const h=[];for(const e of s)h.push(this.getNotebookCell(e));const d=[];for(const e of a)d.push(this.getNotebookCell(e));const p=[];for(const e of u)p.push(this.getNotebookCell(e));(h.length>0||d.length>0||c.length>0||p.length>0)&&(l.cells={added:h,removed:d,changed:{data:c,textContent:p}}),void 0===l.metadata&&void 0===l.cells||this._onDidChange.fire(l)}))),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument((e=>{const t=this.notebookDocuments.get(e.notebookDocument.uri);void 0!==t&&this._onDidSave.fire(t)}))),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument((e=>{const n=this.notebookDocuments.get(e.notebookDocument.uri);if(void 0!==n){this._onDidClose.fire(n);for(const n of e.cellTextDocuments)t.closeTextDocument({textDocument:n});this.notebookDocuments.delete(e.notebookDocument.uri);for(const e of n.cells)this.notebookCellMap.delete(e.document)}}))),Ci.Disposable.create((()=>{n.forEach((e=>e.dispose()))}))}updateCellMap(e){for(const t of e.cells)this.notebookCellMap.set(t.document,[t,e])}};var Di={};Object.defineProperty(Di,"__esModule",{value:!0}),Di.MonikerFeature=void 0;const Ti=Te;Di.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=Ti.MonikerRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}},Object.defineProperty(De,"__esModule",{value:!0}),De.createConnection=De.combineFeatures=De.combineNotebooksFeatures=De.combineLanguagesFeatures=De.combineWorkspaceFeatures=De.combineWindowFeatures=De.combineClientFeatures=De.combineTracerFeatures=De.combineTelemetryFeatures=De.combineConsoleFeatures=De._NotebooksImpl=De._LanguagesImpl=De.BulkUnregistration=De.BulkRegistration=De.ErrorMessageTracker=void 0;const xi=Te,ki=Se,Pi=Nr,Oi=Lr,Ni=Br,Ai=Yr,Ii=Zr,qi=ti,Mi=ii,Fi=si,Li=ci,ji=li,$i=di,Hi=fi,Wi=gi,Vi=vi,Ui=Si,Ki=Di;function Gi(e){if(null!==e)return e}De.ErrorMessageTracker=class{constructor(){this._messages=Object.create(null)}add(e){let t=this._messages[e];t||(t=0),t++,this._messages[e]=t}sendErrors(e){Object.keys(this._messages).forEach((t=>{e.window.showErrorMessage(t)}))}};class zi{constructor(){}rawAttach(e){this._rawConnection=e}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(xi.MessageType.Error,e)}warn(e){this.send(xi.MessageType.Warning,e)}info(e){this.send(xi.MessageType.Info,e)}log(e){this.send(xi.MessageType.Log,e)}debug(e){this.send(xi.MessageType.Debug,e)}send(e,t){this._rawConnection&&this._rawConnection.sendNotification(xi.LogMessageNotification.type,{type:e,message:t}).catch((()=>{(0,xi.RAL)().console.error("Sending log message failed")}))}}const Bi=(0,Mi.ShowDocumentFeature)((0,Oi.ProgressFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...t){let n={type:xi.MessageType.Error,message:e,actions:t};return this.connection.sendRequest(xi.ShowMessageRequest.type,n).then(Gi)}showWarningMessage(e,...t){let n={type:xi.MessageType.Warning,message:e,actions:t};return this.connection.sendRequest(xi.ShowMessageRequest.type,n).then(Gi)}showInformationMessage(e,...t){let n={type:xi.MessageType.Info,message:e,actions:t};return this.connection.sendRequest(xi.ShowMessageRequest.type,n).then(Gi)}}));var Ji,Xi;!function(e){e.create=function(){return new Yi}}(Ji||(De.BulkRegistration=Ji={}));class Yi{constructor(){this._registrations=[],this._registered=new Set}add(e,t){const n=ki.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);const r=Pi.generateUuid();this._registrations.push({id:r,method:n,registerOptions:t||{}}),this._registered.add(n)}asRegistrationParams(){return{registrations:this._registrations}}}!function(e){e.create=function(){return new Qi(void 0,[])}}(Xi||(De.BulkUnregistration=Xi={}));class Qi{constructor(e,t){this._connection=e,this._unregistrations=new Map,t.forEach((e=>{this._unregistrations.set(e.method,e)}))}get isAttached(){return!!this._connection}attach(e){this._connection=e}add(e){this._unregistrations.set(e.method,e)}dispose(){let e=[];for(let t of this._unregistrations.values())e.push(t);let t={unregisterations:e};this._connection.sendRequest(xi.UnregistrationRequest.type,t).catch((()=>{this._connection.console.info("Bulk unregistration failed.")}))}disposeSingle(e){const t=ki.string(e)?e:e.method,n=this._unregistrations.get(t);if(!n)return!1;let r={unregisterations:[n]};return this._connection.sendRequest(xi.UnregistrationRequest.type,r).then((()=>{this._unregistrations.delete(t)}),(e=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`)})),!0}}class Zi{attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,t,n){return e instanceof Yi?this.registerMany(e):e instanceof Qi?this.registerSingle1(e,t,n):this.registerSingle2(e,t)}registerSingle1(e,t,n){const r=ki.string(t)?t:t.method,i=Pi.generateUuid();let o={registrations:[{id:i,method:r,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(xi.RegistrationRequest.type,o).then((t=>(e.add({id:i,method:r}),e)),(e=>(this.connection.console.info(`Registering request handler for ${r} failed.`),Promise.reject(e))))}registerSingle2(e,t){const n=ki.string(e)?e:e.method,r=Pi.generateUuid();let i={registrations:[{id:r,method:n,registerOptions:t||{}}]};return this.connection.sendRequest(xi.RegistrationRequest.type,i).then((e=>xi.Disposable.create((()=>{this.unregisterSingle(r,n).catch((()=>{this.connection.console.info(`Un-registering capability with id ${r} failed.`)}))}))),(e=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(e))))}unregisterSingle(e,t){let n={unregisterations:[{id:e,method:t}]};return this.connection.sendRequest(xi.UnregistrationRequest.type,n).catch((()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`)}))}registerMany(e){let t=e.asRegistrationParams();return this.connection.sendRequest(xi.RegistrationRequest.type,t).then((()=>new Qi(this._connection,t.registrations.map((e=>({id:e.id,method:e.method}))))),(e=>(this.connection.console.info("Bulk registration failed."),Promise.reject(e))))}}const eo=(0,Fi.FileOperationsFeature)((0,Ai.WorkspaceFoldersFeature)((0,Ni.ConfigurationFeature)(class{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){let t=(n=e)&&n.edit?e:{edit:e};var n;return this.connection.sendRequest(xi.ApplyWorkspaceEditRequest.type,t)}})));class to{constructor(){this._trace=xi.Trace.Off}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e}log(e,t){this._trace!==xi.Trace.Off&&this.connection.sendNotification(xi.LogTraceNotification.type,{message:e,verbose:this._trace===xi.Trace.Verbose?t:void 0}).catch((()=>{}))}}class no{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(xi.TelemetryEventNotification.type,e).catch((()=>{this.connection.console.log("Sending TelemetryEventNotification failed")}))}}class ro{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Oi.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Oi.attachPartialResult)(this.connection,t)}}De._LanguagesImpl=ro;const io=(0,Hi.FoldingRangeFeature)((0,Ki.MonikerFeature)((0,Vi.DiagnosticFeature)((0,Wi.InlayHintFeature)((0,$i.InlineValueFeature)((0,ji.TypeHierarchyFeature)((0,Li.LinkedEditingRangeFeature)((0,qi.SemanticTokensFeature)((0,Ii.CallHierarchyFeature)(ro)))))))));class oo{constructor(){}attach(e){this._connection=e}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return(0,Oi.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,t){return(0,Oi.attachPartialResult)(this.connection,t)}}De._NotebooksImpl=oo;const so=(0,Ui.NotebookSyncFeature)(oo);function ao(e,t){return function(n){return t(e(n))}}function co(e,t){return function(n){return t(e(n))}}function uo(e,t){return function(n){return t(e(n))}}function lo(e,t){return function(n){return t(e(n))}}function ho(e,t){return function(n){return t(e(n))}}function po(e,t){return function(n){return t(e(n))}}function fo(e,t){return function(n){return t(e(n))}}function mo(e,t){return function(n){return t(e(n))}}De.combineConsoleFeatures=ao,De.combineTelemetryFeatures=co,De.combineTracerFeatures=uo,De.combineClientFeatures=lo,De.combineWindowFeatures=ho,De.combineWorkspaceFeatures=po,De.combineLanguagesFeatures=fo,De.combineNotebooksFeatures=mo,De.combineFeatures=function(e,t){function n(e,t,n){return e&&t?n(e,t):e||t}return{__brand:"features",console:n(e.console,t.console,ao),tracer:n(e.tracer,t.tracer,uo),telemetry:n(e.telemetry,t.telemetry,co),client:n(e.client,t.client,lo),window:n(e.window,t.window,ho),workspace:n(e.workspace,t.workspace,po),languages:n(e.languages,t.languages,fo),notebooks:n(e.notebooks,t.notebooks,mo)}},De.createConnection=function(e,t,n){const r=n&&n.console?new(n.console(zi)):new zi,i=e(r);r.rawAttach(i);const o=n&&n.tracer?new(n.tracer(to)):new to,s=n&&n.telemetry?new(n.telemetry(no)):new no,a=n&&n.client?new(n.client(Zi)):new Zi,c=n&&n.window?new(n.window(Bi)):new Bi,u=n&&n.workspace?new(n.workspace(eo)):new eo,l=n&&n.languages?new(n.languages(io)):new io,h=n&&n.notebooks?new(n.notebooks(so)):new so,d=[r,o,s,a,c,u,l,h];let p,f,m,g={listen:()=>i.listen(),sendRequest:(e,...t)=>i.sendRequest(ki.string(e)?e:e.method,...t),onRequest:(e,t)=>i.onRequest(e,t),sendNotification:(e,t)=>{const n=ki.string(e)?e:e.method;return i.sendNotification(n,t)},onNotification:(e,t)=>i.onNotification(e,t),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:e=>(f=e,{dispose:()=>{f=void 0}}),onInitialized:e=>i.onNotification(xi.InitializedNotification.type,e),onShutdown:e=>(p=e,{dispose:()=>{p=void 0}}),onExit:e=>(m=e,{dispose:()=>{m=void 0}}),get console(){return r},get telemetry(){return s},get tracer(){return o},get client(){return a},get window(){return c},get workspace(){return u},get languages(){return l},get notebooks(){return h},onDidChangeConfiguration:e=>i.onNotification(xi.DidChangeConfigurationNotification.type,e),onDidChangeWatchedFiles:e=>i.onNotification(xi.DidChangeWatchedFilesNotification.type,e),__textDocumentSync:void 0,onDidOpenTextDocument:e=>i.onNotification(xi.DidOpenTextDocumentNotification.type,e),onDidChangeTextDocument:e=>i.onNotification(xi.DidChangeTextDocumentNotification.type,e),onDidCloseTextDocument:e=>i.onNotification(xi.DidCloseTextDocumentNotification.type,e),onWillSaveTextDocument:e=>i.onNotification(xi.WillSaveTextDocumentNotification.type,e),onWillSaveTextDocumentWaitUntil:e=>i.onRequest(xi.WillSaveTextDocumentWaitUntilRequest.type,e),onDidSaveTextDocument:e=>i.onNotification(xi.DidSaveTextDocumentNotification.type,e),sendDiagnostics:e=>i.sendNotification(xi.PublishDiagnosticsNotification.type,e),onHover:e=>i.onRequest(xi.HoverRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),void 0))),onCompletion:e=>i.onRequest(xi.CompletionRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onCompletionResolve:e=>i.onRequest(xi.CompletionResolveRequest.type,e),onSignatureHelp:e=>i.onRequest(xi.SignatureHelpRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),void 0))),onDeclaration:e=>i.onRequest(xi.DeclarationRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onDefinition:e=>i.onRequest(xi.DefinitionRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onTypeDefinition:e=>i.onRequest(xi.TypeDefinitionRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onImplementation:e=>i.onRequest(xi.ImplementationRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onReferences:e=>i.onRequest(xi.ReferencesRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onDocumentHighlight:e=>i.onRequest(xi.DocumentHighlightRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onDocumentSymbol:e=>i.onRequest(xi.DocumentSymbolRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onWorkspaceSymbol:e=>i.onRequest(xi.WorkspaceSymbolRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onWorkspaceSymbolResolve:e=>i.onRequest(xi.WorkspaceSymbolResolveRequest.type,e),onCodeAction:e=>i.onRequest(xi.CodeActionRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onCodeActionResolve:e=>i.onRequest(xi.CodeActionResolveRequest.type,((t,n)=>e(t,n))),onCodeLens:e=>i.onRequest(xi.CodeLensRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onCodeLensResolve:e=>i.onRequest(xi.CodeLensResolveRequest.type,((t,n)=>e(t,n))),onDocumentFormatting:e=>i.onRequest(xi.DocumentFormattingRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),void 0))),onDocumentRangeFormatting:e=>i.onRequest(xi.DocumentRangeFormattingRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),void 0))),onDocumentOnTypeFormatting:e=>i.onRequest(xi.DocumentOnTypeFormattingRequest.type,((t,n)=>e(t,n))),onRenameRequest:e=>i.onRequest(xi.RenameRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),void 0))),onPrepareRename:e=>i.onRequest(xi.PrepareRenameRequest.type,((t,n)=>e(t,n))),onDocumentLinks:e=>i.onRequest(xi.DocumentLinkRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onDocumentLinkResolve:e=>i.onRequest(xi.DocumentLinkResolveRequest.type,((t,n)=>e(t,n))),onDocumentColor:e=>i.onRequest(xi.DocumentColorRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onColorPresentation:e=>i.onRequest(xi.ColorPresentationRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onFoldingRanges:e=>i.onRequest(xi.FoldingRangeRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onSelectionRanges:e=>i.onRequest(xi.SelectionRangeRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),(0,Oi.attachPartialResult)(i,t)))),onExecuteCommand:e=>i.onRequest(xi.ExecuteCommandRequest.type,((t,n)=>e(t,n,(0,Oi.attachWorkDone)(i,t),void 0))),dispose:()=>i.dispose()};for(let e of d)e.attach(g);return i.onRequest(xi.InitializeRequest.type,(e=>{t.initialize(e),ki.string(e.trace)&&(o.trace=xi.Trace.fromString(e.trace));for(let t of d)t.initialize(e.capabilities);if(f){let t=f(e,(new xi.CancellationTokenSource).token,(0,Oi.attachWorkDone)(i,e),void 0);return(n=t,n instanceof Promise?n:ki.thenable(n)?new Promise(((e,t)=>{n.then((t=>e(t)),(e=>t(e)))})):Promise.resolve(n)).then((e=>{if(e instanceof xi.ResponseError)return e;let t=e;t||(t={capabilities:{}});let n=t.capabilities;n||(n={},t.capabilities=n),void 0===n.textDocumentSync||null===n.textDocumentSync?n.textDocumentSync=ki.number(g.__textDocumentSync)?g.__textDocumentSync:xi.TextDocumentSyncKind.None:ki.number(n.textDocumentSync)||ki.number(n.textDocumentSync.change)||(n.textDocumentSync.change=ki.number(g.__textDocumentSync)?g.__textDocumentSync:xi.TextDocumentSyncKind.None);for(let e of d)e.fillServerCapabilities(n);return t}))}{let e={capabilities:{textDocumentSync:xi.TextDocumentSyncKind.None}};for(let t of d)t.fillServerCapabilities(e.capabilities);return e}var n})),i.onRequest(xi.ShutdownRequest.type,(()=>(t.shutdownReceived=!0,p?p((new xi.CancellationTokenSource).token):void 0))),i.onNotification(xi.ExitNotification.type,(()=>{try{m&&m()}finally{t.shutdownReceived?t.exit(0):t.exit(1)}})),i.onNotification(xi.SetTraceNotification.type,(e=>{o.trace=xi.Trace.fromString(e.value)})),g};var go={};Object.defineProperty(go,"__esModule",{value:!0}),go.resolveModulePath=go.FileSystem=go.resolveGlobalYarnPath=go.resolveGlobalNodePath=go.resolve=go.uriToFilePath=void 0;const yo=y,vo=a,bo=c,So=s;function wo(){return"win32"===process.platform}function Ro(e,t,n,r){const i="NODE_PATH",o=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise(((s,a)=>{let c=process.env,u=Object.create(null);Object.keys(c).forEach((e=>u[e]=c[e])),t&&bo.existsSync(t)&&(u[i]?u[i]=t+vo.delimiter+u[i]:u[i]=t,r&&r(`NODE_PATH value is: ${u[i]}`)),u.ELECTRON_RUN_AS_NODE="1";try{let t=(0,So.fork)("",[],{cwd:n,env:u,execArgv:["-e",o]});if(void 0===t.pid)return void a(new Error(`Starting process to resolve node module ${e} failed`));t.on("error",(e=>{a(e)})),t.on("message",(n=>{"r"===n.c&&(t.send({c:"e"}),n.s?s(n.r):a(new Error(`Failed to resolve module: ${e}`)))}));let r={c:"rs",a:e};t.send(r)}catch(e){a(e)}}))}function Co(e){let t="npm";const n=Object.create(null);Object.keys(process.env).forEach((e=>n[e]=process.env[e])),n.NO_UPDATE_NOTIFIER="true";const r={encoding:"utf8",env:n};wo()&&(t="npm.cmd",r.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let n=(0,So.spawnSync)(t,["config","get","prefix"],r).stdout;if(!n)return void(e&&e("'npm config get prefix' didn't return a value."));let o=n.trim();return e&&e(`'npm config get prefix' value is: ${o}`),o.length>0?wo()?vo.join(o,"node_modules"):vo.join(o,"lib","node_modules"):void 0}catch(e){return}finally{process.removeListener("SIGPIPE",i)}}var Eo;go.uriToFilePath=function(e){let t=yo.parse(e);if("file:"!==t.protocol||!t.path)return;let n=t.path.split("/");for(var r=0,i=n.length;r<i;r++)n[r]=decodeURIComponent(n[r]);if("win32"===process.platform&&n.length>1){let e=n[0],t=n[1];0===e.length&&t.length>1&&":"===t[1]&&n.shift()}return vo.normalize(n.join("/"))},go.resolve=Ro,go.resolveGlobalNodePath=Co,go.resolveGlobalYarnPath=function(e){let t="yarn",n={encoding:"utf8"};wo()&&(t="yarn.cmd",n.shell=!0);let r=()=>{};try{process.on("SIGPIPE",r);let i=(0,So.spawnSync)(t,["global","dir","--json"],n),o=i.stdout;if(!o)return void(e&&(e("'yarn global dir' didn't return a value."),i.stderr&&e(i.stderr)));let s=o.trim().split(/\r?\n/);for(let e of s)try{let t=JSON.parse(e);if("log"===t.type)return vo.join(t.data,"node_modules")}catch(e){}return}catch(e){return}finally{process.removeListener("SIGPIPE",r)}},function(e){let t;function n(){return void 0!==t||(t="win32"!==process.platform&&(!bo.existsSync(__filename.toUpperCase())||!bo.existsSync(__filename.toLowerCase()))),t}e.isCaseSensitive=n,e.isParent=function(e,t){return n()?0===vo.normalize(t).indexOf(vo.normalize(e)):0===vo.normalize(t).toLowerCase().indexOf(vo.normalize(e).toLowerCase())}}(Eo||(go.FileSystem=Eo={})),go.resolveModulePath=function(e,t,n,r){return n?(vo.isAbsolute(n)||(n=vo.join(e,n)),Ro(t,n,n,r).then((e=>Eo.isParent(n,e)?e:Promise.reject(new Error(`Failed to load ${t} from node path location.`)))).then(void 0,(n=>Ro(t,Co(r),e,r)))):Ro(t,Co(r),e,r)};var _o=Te,Do={},To={};Object.defineProperty(To,"__esModule",{value:!0}),To.InlineCompletionFeature=void 0;const xo=Te;To.InlineCompletionFeature=e=>class extends e{get inlineCompletion(){return{on:e=>this.connection.onRequest(xo.InlineCompletionRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}},function(e){var t=O&&O.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=O&&O.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.ProposedFeatures=e.NotebookDocuments=e.TextDocuments=e.SemanticTokensBuilder=void 0;const r=ti;Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=To;n(Te,e);const o=wi;Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return o.TextDocuments}});const s=Si;var a;Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return s.NotebookDocuments}}),n(De,e),function(e){e.all={__brand:"features",languages:i.InlineCompletionFeature}}(a||(e.ProposedFeatures=a={}))}(Do),function(e){var t=O&&O.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=O&&O.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.createConnection=e.Files=void 0;const r=l,i=Se,o=De,s=go,a=_o;var c;n(_o,e),n(Do,e),function(e){e.uriToFilePath=s.uriToFilePath,e.resolveGlobalNodePath=s.resolveGlobalNodePath,e.resolveGlobalYarnPath=s.resolveGlobalYarnPath,e.resolve=s.resolve,e.resolveModulePath=s.resolveModulePath}(c||(e.Files=c={}));let u,h=!1;!function(){const e="--clientProcessId";function t(e){try{let t=parseInt(e);isNaN(t)||(u=setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(h?0:1)}}),3e3))}catch(e){}}for(let n=2;n<process.argv.length;n++){let r=process.argv[n];if(r===e&&n+1<process.argv.length)return void t(process.argv[n+1]);{let n=r.split("=");n[0]===e&&t(n[1])}}}();const d={initialize:e=>{const t=e.processId;i.number(t)&&void 0===u&&setInterval((()=>{try{process.kill(t,0)}catch(e){process.exit(h?0:1)}}),3e3)},get shutdownReceived(){return h},set shutdownReceived(e){h=e},exit:e=>{process.exit(e)}};e.createConnection=function(e,t,n,s){let c,u,l,p;return void 0!==e&&"features"===e.__brand&&(c=e,e=t,t=n,n=s),a.ConnectionStrategy.is(e)||a.ConnectionOptions.is(e)?p=e:(u=e,l=t,p=n),function(e,t,n,s){let c=!1;if(!e&&!t&&process.argv.length>2){let n,r,i=process.argv.slice(2);for(let o=0;o<i.length;o++){let s=i[o];if("--node-ipc"===s){e=new a.IPCMessageReader(process),t=new a.IPCMessageWriter(process);break}if("--stdio"===s){c=!0,e=process.stdin,t=process.stdout;break}if("--socket"===s){n=parseInt(i[o+1]);break}if("--pipe"===s){r=i[o+1];break}var u=s.split("=");if("--socket"===u[0]){n=parseInt(u[1]);break}if("--pipe"===u[0]){r=u[1];break}}if(n){let r=(0,a.createServerSocketTransport)(n);e=r[0],t=r[1]}else if(r){let n=(0,a.createServerPipeTransport)(r);e=n[0],t=n[1]}}var l="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!e)throw new Error("Connection input stream is not set. "+l);if(!t)throw new Error("Connection output stream is not set. "+l);if(i.func(e.read)&&i.func(e.on)){let t=e;t.on("end",(()=>{process.exit(h?0:1)})),t.on("close",(()=>{process.exit(h?0:1)}))}const p=i=>{const o=(0,a.createProtocolConnection)(e,t,i,n);return c&&function(e){function t(e){return e.map((e=>"string"==typeof e?e:(0,r.inspect)(e))).join(" ")}const n=new Map;console.assert=function(n,...r){if(!n)if(0===r.length)e.error("Assertion failed");else{const[n,...i]=r;e.error(`Assertion failed: ${n} ${t(i)}`)}},console.count=function(t="default"){const r=String(t);let i=n.get(r)??0;i+=1,n.set(r,i),e.log(`${r}: ${r}`)},console.countReset=function(e){void 0===e?n.clear():n.delete(String(e))},console.debug=function(...n){e.log(t(n))},console.dir=function(t,n){e.log((0,r.inspect)(t,n))},console.log=function(...n){e.log(t(n))},console.error=function(...n){e.error(t(n))},console.trace=function(...n){const r=(new Error).stack.replace(/(.+\n){2}/,"");let i="Trace";0!==n.length&&(i+=`: ${t(n)}`),e.log(`${i}\n${r}`)},console.warn=function(...n){e.warn(t(n))}}(i),o};return(0,o.createConnection)(p,d,s)}(u,l,p,c)}}(be);const ko=N(be);const Po=N(be);var Oo;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Log=3]="Log"}(Oo||(Oo={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"log":return e.Log;case"info":return e.Info;case"warning":return e.Warning;default:return e.Error}},e.toString=function(t){switch(t){case e.Error:return"error";case e.Warning:return"warning";case e.Info:return"info";case e.Log:return"log"}}}(Oo||(Oo={}));class No{constructor(e,t){this.client=e,this.level=t}sendMessage(e,t,n){if(this.level>=e||n?.overrideLevel){const n=t.map((e=>"object"==typeof e?JSON.stringify(e,null,2):e)).join(" ");this.client.logMessage({type:e,message:n})}}logLevelToLspMessageType(e){switch(e){case Oo.Log:return ko.MessageType.Log;case Oo.Info:return ko.MessageType.Info;case Oo.Warning:return ko.MessageType.Warning;case Oo.Error:return ko.MessageType.Error}}error(...e){this.sendMessage(ko.MessageType.Error,e)}warn(...e){this.sendMessage(ko.MessageType.Warning,e)}info(...e){this.sendMessage(ko.MessageType.Info,e)}log(...e){this.sendMessage(ko.MessageType.Log,e)}logIgnoringVerbosity(e,...t){this.sendMessage(this.logLevelToLspMessageType(e),t,{overrideLevel:!0})}trace(e,t,n){this.logIgnoringVerbosity(Oo.Log,`[${e} - ${Io()}] ${t}`),n&&this.logIgnoringVerbosity(Oo.Log,Mo(n))}}class Ao{constructor(e,t){this.logger=e,this.prefix=t}error(...e){this.logger.error(this.prefix,...e)}warn(...e){this.logger.warn(this.prefix,...e)}info(...e){this.logger.info(this.prefix,...e)}log(...e){this.logger.log(this.prefix,...e)}logIgnoringVerbosity(e,...t){this.logger.logIgnoringVerbosity(e,this.prefix,...t)}trace(e,t,n){this.logIgnoringVerbosity(Oo.Log,this.prefix,`[${e} - ${Io()}] ${t}`),n&&this.logIgnoringVerbosity(Oo.Log,this.prefix,Mo(n))}}function Io(){const e=new Date;return`${qo(`${e.getUTCHours()}`,2,"0")}:${qo(`${e.getMinutes()}`,2,"0")}:${qo(`${e.getUTCSeconds()}`,2,"0")}.${e.getMilliseconds()}`}function qo(e,t,n=" "){return n.repeat(Math.max(0,t-e.length))+e}function Mo(e){return e instanceof Error?e.stack||e.message:!1===e.success&&e.message?e.message:e.toString()}var Fo={},Lo={fromCallback:function(e){return Object.defineProperty((function(...t){if("function"!=typeof t[t.length-1])return new Promise(((n,r)=>{e.call(this,...t,((e,t)=>null!=e?r(e):n(t)))}));e.apply(this,t)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(...t){const n=t[t.length-1];if("function"!=typeof n)return e.apply(this,t);e.apply(this,t.slice(0,-1)).then((e=>n(null,e)),n)}),"name",{value:e.name})}},jo=w,$o=process.cwd,Ho=null,Wo=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ho||(Ho=$o.call(process)),Ho};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Vo=process.chdir;process.chdir=function(e){Ho=null,Vo.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Vo)}var Uo=function(e){jo.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,jo.O_WRONLY|jo.O_SYMLINK,n,(function(t,i){t?r&&r(t):e.fchmod(i,n,(function(t){e.close(i,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,i=e.openSync(t,jo.O_WRONLY|jo.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(i,n),o=!1}finally{if(o)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return r}}(e);e.lutimes||function(e){jo.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,i){e.open(t,jo.O_SYMLINK,(function(t,o){t?i&&i(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){i&&i(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var i,o=e.openSync(t,jo.O_SYMLINK),s=!0;try{i=e.futimesSync(o,n,r),s=!1}finally{if(s)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return i}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=i(e.chownSync),e.fchownSync=i(e.fchownSync),e.lchownSync=i(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=s(e.statSync),e.fstatSync=s(e.fstatSync),e.lstatSync=s(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Wo&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,i){var o=Date.now(),s=0;t(n,r,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,a):i(c)}))}),s),void(s<100&&(s+=10));i&&i(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,i){return t.call(e,n,r,(function(e){a(e)&&(e=null),i&&i.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!a(e))throw e}}:t}function r(t){return t?function(n,r,i,o){return t.call(e,n,r,i,(function(e){a(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function i(t){return t?function(n,r,i){try{return t.call(e,n,r,i)}catch(e){if(!a(e))throw e}}:t}function o(t){return t?function(n,r,i){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),i&&i.apply(this,arguments)}return"function"==typeof r&&(i=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function s(t){return t?function(n,r){var i=r?t.call(e,n,r):t.call(e,n);return i&&(i.uid<0&&(i.uid+=4294967296),i.gid<0&&(i.gid+=4294967296)),i}:t}function a(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,i,o,s,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,h,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,t.call(e,n,r,i,o,s,c);a.apply(this,arguments)}}return t.call(e,n,r,i,o,s,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,i,o){for(var s=0;;)try{return c.call(e,t,n,r,i,o)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}});var c};var Ko=R.Stream,Go=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Ko.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),s=0,a=o.length;s<a;s++){var c=o[s];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){i._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return i.emit("error",e),void(i.readable=!1);i.fd=t,i.emit("open",t),i._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Ko.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),o=0,s=i.length;o<s;o++){var a=i[o];this[a]=r[a]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var zo=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:Bo(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Bo=Object.getPrototypeOf||function(e){return e.__proto__};var Jo,Xo,Yo=c,Qo=Uo,Zo=Go,es=zo,ts=d;function ns(e,t){Object.defineProperty(e,Jo,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Jo=Symbol.for("graceful-fs.queue"),Xo=Symbol.for("graceful-fs.previous")):(Jo="___graceful-fs.queue",Xo="___graceful-fs.previous");var rs=function(){};if(ts.debuglog?rs=ts.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(rs=function(){var e=ts.format.apply(ts,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Yo[Jo]){var is=O[Jo]||[];ns(Yo,is),Yo.close=function(e){function t(t,n){return e.call(Yo,t,(function(e){e||us(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Xo,{value:e}),t}(Yo.close),Yo.closeSync=function(e){function t(t){e.apply(Yo,arguments),us()}return Object.defineProperty(t,Xo,{value:e}),t}(Yo.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){rs(Yo[Jo]),C.equal(Yo[Jo].length,0)}))}O[Jo]||ns(O,Yo[Jo]);var os,ss=as(es(Yo));function as(e){Qo(e),e.gracefulify=as,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,i,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof i&&i.apply(this,arguments):cs([e,[n,r,i],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,i){"function"==typeof r&&(i=r,r=null);return function e(t,r,i,o,s){return n(t,r,i,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):cs([e,[t,r,i,o],n,s||Date.now(),Date.now()])}))}(e,t,r,i)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,i){"function"==typeof n&&(i=n,n=null);return function e(t,n,i,o,s){return r(t,n,i,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):cs([e,[t,n,i,o],r,s||Date.now(),Date.now()])}))}(e,t,n,i)});var i=e.copyFile;i&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,s){return i(t,n,r,(function(i){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof o&&o.apply(this,arguments):cs([e,[t,n,r,o],i,s||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=s.test(process.version)?function(e,t,n,r){return o(e,i(e,t,n,r))}:function(e,t,n,r){return o(e,t,i(e,t,n,r))};return r(e,t,n);function i(e,t,n,i){return function(o,s){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(s&&s.sort&&s.sort(),"function"==typeof n&&n.call(this,o,s)):cs([r,[e,t,n],o,i||Date.now(),Date.now()])}}};var s=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var a=Zo(e);d=a.ReadStream,p=a.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;m(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var u=e.WriteStream;u&&(p.prototype=Object.create(u.prototype),p.prototype.open=function(){var e=this;m(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return p},set:function(e){p=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var h=p;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function p(e,t){return this instanceof p?(u.apply(this,arguments),this):p.apply(Object.create(p.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(e){h=e},enumerable:!0,configurable:!0});var f=e.open;function m(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,i,o){return f(t,n,r,(function(s,a){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?"function"==typeof i&&i.apply(this,arguments):cs([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=m,e}function cs(e){rs("ENQUEUE",e[0].name,e[1]),Yo[Jo].push(e),ls()}function us(){for(var e=Date.now(),t=0;t<Yo[Jo].length;++t)Yo[Jo][t].length>2&&(Yo[Jo][t][3]=e,Yo[Jo][t][4]=e);ls()}function ls(){if(clearTimeout(os),os=void 0,0!==Yo[Jo].length){var e=Yo[Jo].shift(),t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(void 0===i)rs("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){rs("TIMEOUT",t.name,n);var s=n.pop();"function"==typeof s&&s.call(null,r)}else{var a=Date.now()-o,c=Math.max(o-i,1);a>=Math.min(1.2*c,100)?(rs("RETRY",t.name,n),t.apply(null,n.concat([i]))):Yo[Jo].push(e)}void 0===os&&(os=setTimeout(ls,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Yo.__patched&&(ss=as(Yo),Yo.__patched=!0),function(e){const t=Lo.fromCallback,n=ss,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.assign(e,n),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,i,o,s){return"function"==typeof s?n.read(e,t,r,i,o,s):new Promise(((s,a)=>{n.read(e,t,r,i,o,((e,t,n)=>{if(e)return a(e);s({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((i,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffer:n})}))}))},e.readv=function(e,t,...r){return"function"==typeof r[r.length-1]?n.readv(e,t,...r):new Promise(((i,o)=>{n.readv(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesRead:t,buffers:n})}))}))},e.writev=function(e,t,...r){return"function"==typeof r[r.length-1]?n.writev(e,t,...r):new Promise(((i,o)=>{n.writev(e,t,...r,((e,t,n)=>{if(e)return o(e);i({bytesWritten:t,buffers:n})}))}))},"function"==typeof n.realpath.native?e.realpath.native=t(n.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}(Fo);var hs={},ds={};const ps=a;ds.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(ps.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const fs=Fo,{checkPath:ms}=ds,gs=e=>"number"==typeof e?e:{mode:511,...e}.mode;hs.makeDir=async(e,t)=>(ms(e),fs.mkdir(e,{mode:gs(t),recursive:!0})),hs.makeDirSync=(e,t)=>(ms(e),fs.mkdirSync(e,{mode:gs(t),recursive:!0}));const ys=Lo.fromPromise,{makeDir:vs,makeDirSync:bs}=hs,Ss=ys(vs);var ws={mkdirs:Ss,mkdirsSync:bs,mkdirp:Ss,mkdirpSync:bs,ensureDir:Ss,ensureDirSync:bs};const Rs=Lo.fromPromise,Cs=Fo;var Es={pathExists:Rs((function(e){return Cs.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:Cs.existsSync};const _s=ss;var Ds=function(e,t,n,r){_s.open(e,"r+",((e,i)=>{if(e)return r(e);_s.futimes(i,t,n,(e=>{_s.close(i,(t=>{r&&r(e||t)}))}))}))},Ts=function(e,t,n){const r=_s.openSync(e,"r+");return _s.futimesSync(r,t,n),_s.closeSync(r)};const xs=Fo,ks=a,Ps=d;function Os(e,t,n){const r=n.dereference?e=>xs.stat(e,{bigint:!0}):e=>xs.lstat(e,{bigint:!0});return Promise.all([r(e),r(t).catch((e=>{if("ENOENT"===e.code)return null;throw e}))]).then((([e,t])=>({srcStat:e,destStat:t})))}function Ns(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function As(e,t){const n=ks.resolve(e).split(ks.sep).filter((e=>e)),r=ks.resolve(t).split(ks.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Is(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var qs={checkPaths:function(e,t,n,r,i){Ps.callbackify(Os)(e,t,r,((r,o)=>{if(r)return i(r);const{srcStat:s,destStat:a}=o;if(a){if(Ns(s,a)){const r=ks.basename(e),o=ks.basename(t);return"move"===n&&r!==o&&r.toLowerCase()===o.toLowerCase()?i(null,{srcStat:s,destStat:a,isChangingCase:!0}):i(new Error("Source and destination must not be the same."))}if(s.isDirectory()&&!a.isDirectory())return i(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`));if(!s.isDirectory()&&a.isDirectory())return i(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}return s.isDirectory()&&As(e,t)?i(new Error(Is(e,t,n))):i(null,{srcStat:s,destStat:a})}))},checkPathsSync:function(e,t,n,r){const{srcStat:i,destStat:o}=function(e,t,n){let r;const i=n.dereference?e=>xs.statSync(e,{bigint:!0}):e=>xs.lstatSync(e,{bigint:!0}),o=i(e);try{r=i(t)}catch(e){if("ENOENT"===e.code)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:r}}(e,t,r);if(o){if(Ns(i,o)){const r=ks.basename(e),s=ks.basename(t);if("move"===n&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:i,destStat:o,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!o.isDirectory())throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!i.isDirectory()&&o.isDirectory())throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(i.isDirectory()&&As(e,t))throw new Error(Is(e,t,n));return{srcStat:i,destStat:o}},checkParentPaths:function e(t,n,r,i,o){const s=ks.resolve(ks.dirname(t)),a=ks.resolve(ks.dirname(r));if(a===s||a===ks.parse(a).root)return o();xs.stat(a,{bigint:!0},((s,c)=>s?"ENOENT"===s.code?o():o(s):Ns(n,c)?o(new Error(Is(t,r,i))):e(t,n,a,i,o)))},checkParentPathsSync:function e(t,n,r,i){const o=ks.resolve(ks.dirname(t)),s=ks.resolve(ks.dirname(r));if(s===o||s===ks.parse(s).root)return;let a;try{a=xs.statSync(s,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(Ns(n,a))throw new Error(Is(t,r,i));return e(t,n,s,i)},isSrcSubdir:As,areIdentical:Ns};const Ms=ss,Fs=a,Ls=ws.mkdirs,js=Es.pathExists,$s=Ds,Hs=qs;function Ws(e,t,n,r){if(!n.filter)return r(null,!0);Promise.resolve(n.filter(e,t)).then((e=>r(null,e)),(e=>r(e)))}function Vs(e,t,n,r,i){(r.dereference?Ms.stat:Ms.lstat)(t,((o,s)=>o?i(o):s.isDirectory()?function(e,t,n,r,i,o){return t?zs(n,r,i,o):function(e,t,n,r,i){Ms.mkdir(n,(o=>{if(o)return i(o);zs(t,n,r,(t=>t?i(t):Gs(n,e,i)))}))}(e.mode,n,r,i,o)}(s,e,t,n,r,i):s.isFile()||s.isCharacterDevice()||s.isBlockDevice()?function(e,t,n,r,i,o){return t?function(e,t,n,r,i){if(!r.overwrite)return r.errorOnExist?i(new Error(`'${n}' already exists`)):i();Ms.unlink(n,(o=>o?i(o):Us(e,t,n,r,i)))}(e,n,r,i,o):Us(e,n,r,i,o)}(s,e,t,n,r,i):s.isSymbolicLink()?function(e,t,n,r,i){Ms.readlink(t,((t,o)=>t?i(t):(r.dereference&&(o=Fs.resolve(process.cwd(),o)),e?void Ms.readlink(n,((e,t)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?Ms.symlink(o,n,i):i(e):(r.dereference&&(t=Fs.resolve(process.cwd(),t)),Hs.isSrcSubdir(o,t)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${t}'.`)):Hs.isSrcSubdir(t,o)?i(new Error(`Cannot overwrite '${t}' with '${o}'.`)):function(e,t,n){Ms.unlink(t,(r=>r?n(r):Ms.symlink(e,t,n)))}(o,n,i)))):Ms.symlink(o,n,i))))}(e,t,n,r,i):s.isSocket()?i(new Error(`Cannot copy a socket file: ${t}`)):s.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${t}`)):i(new Error(`Unknown file: ${t}`))))}function Us(e,t,n,r,i){Ms.copyFile(t,n,(o=>o?i(o):r.preserveTimestamps?function(e,t,n,r){if(function(e){return 0==(128&e)}(e))return function(e,t,n){return Gs(e,128|t,n)}(n,e,(i=>i?r(i):Ks(e,t,n,r)));return Ks(e,t,n,r)}(e.mode,t,n,i):Gs(n,e.mode,i)))}function Ks(e,t,n,r){!function(e,t,n){Ms.stat(e,((e,r)=>e?n(e):$s(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):Gs(n,e,r)))}function Gs(e,t,n){return Ms.chmod(e,t,n)}function zs(e,t,n,r){Ms.readdir(e,((i,o)=>i?r(i):Bs(o,e,t,n,r)))}function Bs(e,t,n,r,i){const o=e.pop();return o?function(e,t,n,r,i,o){const s=Fs.join(n,t),a=Fs.join(r,t);Ws(s,a,i,((t,c)=>t?o(t):c?void Hs.checkPaths(s,a,"copy",i,((t,c)=>{if(t)return o(t);const{destStat:u}=c;Vs(u,s,a,i,(t=>t?o(t):Bs(e,n,r,i,o)))})):Bs(e,n,r,i,o)))}(e,o,t,n,r,i):i()}var Js=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001"),Hs.checkPaths(e,t,"copy",n,((i,o)=>{if(i)return r(i);const{srcStat:s,destStat:a}=o;Hs.checkParentPaths(e,s,t,"copy",(i=>{if(i)return r(i);Ws(e,t,n,((i,o)=>i?r(i):o?void function(e,t,n,r,i){const o=Fs.dirname(n);js(o,((s,a)=>s?i(s):a?Vs(e,t,n,r,i):void Ls(o,(o=>o?i(o):Vs(e,t,n,r,i)))))}(a,e,t,n,r):r()))}))}))};const Xs=ss,Ys=a,Qs=ws.mkdirsSync,Zs=Ts,ea=qs;function ta(e,t,n,r){const i=(r.dereference?Xs.statSync:Xs.lstatSync)(t);if(i.isDirectory())return function(e,t,n,r,i){return t?ia(n,r,i):function(e,t,n,r){return Xs.mkdirSync(n),ia(t,n,r),ra(n,e)}(e.mode,n,r,i)}(i,e,t,n,r);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return function(e,t,n,r,i){return t?function(e,t,n,r){if(r.overwrite)return Xs.unlinkSync(n),na(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,i):na(e,n,r,i)}(i,e,t,n,r);if(i.isSymbolicLink())return function(e,t,n,r){let i=Xs.readlinkSync(t);r.dereference&&(i=Ys.resolve(process.cwd(),i));if(e){let e;try{e=Xs.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Xs.symlinkSync(i,n);throw e}if(r.dereference&&(e=Ys.resolve(process.cwd(),e)),ea.isSrcSubdir(i,e))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${e}'.`);if(ea.isSrcSubdir(e,i))throw new Error(`Cannot overwrite '${e}' with '${i}'.`);return function(e,t){return Xs.unlinkSync(t),Xs.symlinkSync(e,t)}(i,n)}return Xs.symlinkSync(i,n)}(e,t,n,r);if(i.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);if(i.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function na(e,t,n,r){return Xs.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){ra(e,128|t)}(n,e);(function(e,t){const n=Xs.statSync(e);Zs(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),ra(n,e.mode)}function ra(e,t){return Xs.chmodSync(e,t)}function ia(e,t,n){Xs.readdirSync(e).forEach((r=>function(e,t,n,r){const i=Ys.join(t,e),o=Ys.join(n,e);if(r.filter&&!r.filter(i,o))return;const{destStat:s}=ea.checkPathsSync(i,o,"copy",r);return ta(s,i,o,r)}(r,e,t,n)))}var oa=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002");const{srcStat:r,destStat:i}=ea.checkPathsSync(e,t,"copy",n);if(ea.checkParentPathsSync(e,r,t,"copy"),n.filter&&!n.filter(e,t))return;const o=Ys.dirname(t);return Xs.existsSync(o)||Qs(o),ta(i,e,t,n)};var sa={copy:(0,Lo.fromCallback)(Js),copySync:oa};const aa=ss;var ca={remove:(0,Lo.fromCallback)((function(e,t){aa.rm(e,{recursive:!0,force:!0},t)})),removeSync:function(e){aa.rmSync(e,{recursive:!0,force:!0})}};const ua=Lo.fromPromise,la=Fo,ha=a,da=ws,pa=ca,fa=ua((async function(e){let t;try{t=await la.readdir(e)}catch{return da.mkdirs(e)}return Promise.all(t.map((t=>pa.remove(ha.join(e,t)))))}));function ma(e){let t;try{t=la.readdirSync(e)}catch{return da.mkdirsSync(e)}t.forEach((t=>{t=ha.join(e,t),pa.removeSync(t)}))}var ga={emptyDirSync:ma,emptydirSync:ma,emptyDir:fa,emptydir:fa};const ya=Lo.fromCallback,va=a,ba=ss,Sa=ws;var wa={createFile:ya((function(e,t){function n(){ba.writeFile(e,"",(e=>{if(e)return t(e);t()}))}ba.stat(e,((r,i)=>{if(!r&&i.isFile())return t();const o=va.dirname(e);ba.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?Sa.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():ba.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=ba.statSync(e)}catch{}if(t&&t.isFile())return;const n=va.dirname(e);try{ba.statSync(n).isDirectory()||ba.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;Sa.mkdirsSync(n)}ba.writeFileSync(e,"")}};const Ra=Lo.fromCallback,Ca=a,Ea=ss,_a=ws,Da=Es.pathExists,{areIdentical:Ta}=qs;var xa={createLink:Ra((function(e,t,n){function r(e,t){Ea.link(e,t,(e=>{if(e)return n(e);n(null)}))}Ea.lstat(t,((i,o)=>{Ea.lstat(e,((i,s)=>{if(i)return i.message=i.message.replace("lstat","ensureLink"),n(i);if(o&&Ta(s,o))return n(null);const a=Ca.dirname(t);Da(a,((i,o)=>i?n(i):o?r(e,t):void _a.mkdirs(a,(i=>{if(i)return n(i);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=Ea.lstatSync(t)}catch{}try{const t=Ea.lstatSync(e);if(n&&Ta(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=Ca.dirname(t);return Ea.existsSync(r)||_a.mkdirsSync(r),Ea.linkSync(e,t)}};const ka=a,Pa=ss,Oa=Es.pathExists;var Na={symlinkPaths:function(e,t,n){if(ka.isAbsolute(e))return Pa.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=ka.dirname(t),i=ka.join(r,e);return Oa(i,((t,o)=>t?n(t):o?n(null,{toCwd:i,toDst:e}):Pa.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:ka.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(ka.isAbsolute(e)){if(n=Pa.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=ka.dirname(t),i=ka.join(r,e);if(n=Pa.existsSync(i),n)return{toCwd:i,toDst:e};if(n=Pa.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:ka.relative(r,e)}}}};const Aa=ss;var Ia={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Aa.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Aa.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const qa=Lo.fromCallback,Ma=a,Fa=Fo,La=ws.mkdirs,ja=ws.mkdirsSync,$a=Na.symlinkPaths,Ha=Na.symlinkPathsSync,Wa=Ia.symlinkType,Va=Ia.symlinkTypeSync,Ua=Es.pathExists,{areIdentical:Ka}=qs;function Ga(e,t,n,r){$a(e,t,((i,o)=>{if(i)return r(i);e=o.toDst,Wa(o.toCwd,n,((n,i)=>{if(n)return r(n);const o=Ma.dirname(t);Ua(o,((n,s)=>n?r(n):s?Fa.symlink(e,t,i,r):void La(o,(n=>{if(n)return r(n);Fa.symlink(e,t,i,r)}))))}))}))}var za={createSymlink:qa((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Fa.lstat(t,((i,o)=>{!i&&o.isSymbolicLink()?Promise.all([Fa.stat(e),Fa.stat(t)]).then((([i,o])=>{if(Ka(i,o))return r(null);Ga(e,t,n,r)})):Ga(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Fa.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Fa.statSync(e),r=Fa.statSync(t);if(Ka(n,r))return}const i=Ha(e,t);e=i.toDst,n=Va(i.toCwd,n);const o=Ma.dirname(t);return Fa.existsSync(o)||ja(o),Fa.symlinkSync(e,t,n)}};const{createFile:Ba,createFileSync:Ja}=wa,{createLink:Xa,createLinkSync:Ya}=xa,{createSymlink:Qa,createSymlinkSync:Za}=za;var ec={createFile:Ba,createFileSync:Ja,ensureFile:Ba,ensureFileSync:Ja,createLink:Xa,createLinkSync:Ya,ensureLink:Xa,ensureLinkSync:Ya,createSymlink:Qa,createSymlinkSync:Za,ensureSymlink:Qa,ensureSymlinkSync:Za};var tc={stringify:function(e,{EOL:t="\n",finalEOL:n=!0,replacer:r=null,spaces:i}={}){const o=n?t:"";return JSON.stringify(e,r,i).replace(/\n/g,t)+o},stripBom:function(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}};let nc;try{nc=ss}catch(e){nc=c}const rc=Lo,{stringify:ic,stripBom:oc}=tc;const sc=rc.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||nc,r=!("throws"in t)||t.throws;let i,o=await rc.fromCallback(n.readFile)(e,t);o=oc(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}return i}));const ac=rc.fromPromise((async function(e,t,n={}){const r=n.fs||nc,i=ic(t,n);await rc.fromCallback(r.writeFile)(e,i,n)}));const cc={readFile:sc,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||nc,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=oc(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:ac,writeFileSync:function(e,t,n={}){const r=n.fs||nc,i=ic(t,n);return r.writeFileSync(e,i,n)}};var uc={readJson:cc.readFile,readJsonSync:cc.readFileSync,writeJson:cc.writeFile,writeJsonSync:cc.writeFileSync};const lc=Lo.fromCallback,hc=ss,dc=a,pc=ws,fc=Es.pathExists;var mc={outputFile:lc((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const i=dc.dirname(e);fc(i,((o,s)=>o?r(o):s?hc.writeFile(e,t,n,r):void pc.mkdirs(i,(i=>{if(i)return r(i);hc.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=dc.dirname(e);if(hc.existsSync(n))return hc.writeFileSync(e,...t);pc.mkdirsSync(n),hc.writeFileSync(e,...t)}};const{stringify:gc}=tc,{outputFile:yc}=mc;var vc=async function(e,t,n={}){const r=gc(t,n);await yc(e,r,n)};const{stringify:bc}=tc,{outputFileSync:Sc}=mc;var wc=function(e,t,n){const r=bc(t,n);Sc(e,r,n)};const Rc=Lo.fromPromise,Cc=uc;Cc.outputJson=Rc(vc),Cc.outputJsonSync=wc,Cc.outputJSON=Cc.outputJson,Cc.outputJSONSync=Cc.outputJsonSync,Cc.writeJSON=Cc.writeJson,Cc.writeJSONSync=Cc.writeJsonSync,Cc.readJSON=Cc.readJson,Cc.readJSONSync=Cc.readJsonSync;var Ec=Cc;const _c=ss,Dc=a,Tc=sa.copy,xc=ca.remove,kc=ws.mkdirp,Pc=Es.pathExists,Oc=qs;function Nc(e,t,n,r,i){return r?Ac(e,t,n,i):n?xc(t,(r=>r?i(r):Ac(e,t,n,i))):void Pc(t,((r,o)=>r?i(r):o?i(new Error("dest already exists.")):Ac(e,t,n,i)))}function Ac(e,t,n,r){_c.rename(e,t,(i=>i?"EXDEV"!==i.code?r(i):function(e,t,n,r){const i={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};Tc(e,t,i,(t=>t?r(t):xc(e,r)))}(e,t,n,r):r()))}var Ic=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const i=(n=n||{}).overwrite||n.clobber||!1;Oc.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:s,isChangingCase:a=!1}=o;Oc.checkParentPaths(e,s,t,"move",(n=>n?r(n):function(e){const t=Dc.dirname(e);return Dc.parse(t).root===t}(t)?Nc(e,t,i,a,r):void kc(Dc.dirname(t),(n=>n?r(n):Nc(e,t,i,a,r)))))}))};const qc=ss,Mc=a,Fc=sa.copySync,Lc=ca.removeSync,jc=ws.mkdirpSync,$c=qs;function Hc(e,t,n){try{qc.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};return Fc(e,t,r),Lc(e)}(e,t,n)}}var Wc=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:i,isChangingCase:o=!1}=$c.checkPathsSync(e,t,"move",n);return $c.checkParentPathsSync(e,i,t,"move"),function(e){const t=Mc.dirname(e);return Mc.parse(t).root===t}(t)||jc(Mc.dirname(t)),function(e,t,n,r){if(r)return Hc(e,t,n);if(n)return Lc(t),Hc(e,t,n);if(qc.existsSync(t))throw new Error("dest already exists.");return Hc(e,t,n)}(e,t,r,o)};var Vc={move:(0,Lo.fromCallback)(Ic),moveSync:Wc};const Uc=N({...Fo,...sa,...ga,...ec,...Ec,...ws,...Vc,...mc,...Es,...ca}),Kc=(e,t,n={})=>{if(!Number.isFinite(t))throw new TypeError("Expected `wait` to be a finite number");let r,i,o=[];return function(...s){return new Promise((a=>{const c=n.before&&!i;clearTimeout(i),i=setTimeout((()=>{i=null;const t=n.before?r:e.apply(this,s);for(a of o)a(t);o=[]}),t),c?(r=e.apply(this,s),a(r)):o.push(a)}))}};Kc.promise=e=>{let t;return async function(...n){if(t)return t;try{return t=e.apply(this,n),await t}finally{t=void 0}}};var Gc={exports:{}};var zc={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};var Bc="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=zc,o=Bc,s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],u=t.t={};let l=0;const h="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[h,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=l++;o(e,i,t),u[e]=i,c[i]=t,s[i]=new RegExp(t,n?"g":void 0),a[i]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),p("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${h}+`),p("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),p("FULL",`^${c[u.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),p("LOOSE",`^${c[u.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),p("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",c[u.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Gc,Gc.exports);var Jc=Gc.exports;const Xc=Object.freeze({loose:!0}),Yc=Object.freeze({});var Qc=e=>e?"object"!=typeof e?Xc:e:Yc;const Zc=/^[0-9]+$/,eu=(e,t)=>{const n=Zc.test(e),r=Zc.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1};var tu={compareIdentifiers:eu,rcompareIdentifiers:(e,t)=>eu(t,e)};const nu=Bc,{MAX_LENGTH:ru,MAX_SAFE_INTEGER:iu}=zc,{safeRe:ou,t:su}=Jc,au=Qc,{compareIdentifiers:cu}=tu;var uu=class e{constructor(t,n){if(n=au(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>ru)throw new TypeError(`version is longer than ${ru} characters`);nu("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?ou[su.LOOSE]:ou[su.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>iu||this.major<0)throw new TypeError("Invalid major version");if(this.minor>iu||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>iu||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<iu)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(nu("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if("string"==typeof t&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),cu(this.major,t.major)||cu(this.minor,t.minor)||cu(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const e=this.prerelease[n],r=t.prerelease[n];if(nu("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return cu(e,r)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{const e=this.build[n],r=t.build[n];if(nu("prerelease compare",n,e,r),void 0===e&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===e)return-1;if(e!==r)return cu(e,r)}while(++n)}inc(e,t,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===cu(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const lu=uu;var hu=(e,t,n=!1)=>{if(e instanceof lu)return e;try{return new lu(e,t)}catch(e){if(!n)return null;throw e}};const du=hu;var pu=(e,t)=>{const n=du(e,t);return n?n.version:null};const fu=hu;var mu=(e,t)=>{const n=fu(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const gu=uu;var yu=(e,t,n,r,i)=>{"string"==typeof n&&(i=r,r=n,n=void 0);try{return new gu(e instanceof gu?e.version:e,n).inc(t,r,i).version}catch(e){return null}};const vu=hu;var bu=(e,t)=>{const n=vu(e,null,!0),r=vu(t,null,!0),i=n.compare(r);if(0===i)return null;const o=i>0,s=o?n:r,a=o?r:n,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c)return a.patch||a.minor?s.patch?"patch":s.minor?"minor":"major":"major";const u=c?"pre":"";return n.major!==r.major?u+"major":n.minor!==r.minor?u+"minor":n.patch!==r.patch?u+"patch":"prerelease"};const Su=uu;var wu=(e,t)=>new Su(e,t).major;const Ru=uu;var Cu=(e,t)=>new Ru(e,t).minor;const Eu=uu;var _u=(e,t)=>new Eu(e,t).patch;const Du=hu;var Tu=(e,t)=>{const n=Du(e,t);return n&&n.prerelease.length?n.prerelease:null};const xu=uu;var ku=(e,t,n)=>new xu(e,n).compare(new xu(t,n));const Pu=ku;var Ou=(e,t,n)=>Pu(t,e,n);const Nu=ku;var Au=(e,t)=>Nu(e,t,!0);const Iu=uu;var qu=(e,t,n)=>{const r=new Iu(e,n),i=new Iu(t,n);return r.compare(i)||r.compareBuild(i)};const Mu=qu;var Fu=(e,t)=>e.sort(((e,n)=>Mu(e,n,t)));const Lu=qu;var ju=(e,t)=>e.sort(((e,n)=>Lu(n,e,t)));const $u=ku;var Hu=(e,t,n)=>$u(e,t,n)>0;const Wu=ku;var Vu=(e,t,n)=>Wu(e,t,n)<0;const Uu=ku;var Ku=(e,t,n)=>0===Uu(e,t,n);const Gu=ku;var zu=(e,t,n)=>0!==Gu(e,t,n);const Bu=ku;var Ju=(e,t,n)=>Bu(e,t,n)>=0;const Xu=ku;var Yu=(e,t,n)=>Xu(e,t,n)<=0;const Qu=Ku,Zu=zu,el=Hu,tl=Ju,nl=Vu,rl=Yu;var il=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return Qu(e,n,r);case"!=":return Zu(e,n,r);case">":return el(e,n,r);case">=":return tl(e,n,r);case"<":return nl(e,n,r);case"<=":return rl(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const ol=uu,sl=hu,{safeRe:al,t:cl}=Jc;var ul,ll,hl,dl,pl,fl,ml,gl,yl,vl,bl=(e,t)=>{if(e instanceof ol)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=al[cl.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),al[cl.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;al[cl.COERCERTL].lastIndex=-1}else n=e.match(al[cl.COERCE]);return null===n?null:sl(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Sl(){if(dl)return hl;function e(t){var n=this;if(n instanceof e||(n=new e),n.tail=null,n.head=null,n.length=0,t&&"function"==typeof t.forEach)t.forEach((function(e){n.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)n.push(arguments[r]);return n}function t(e,t,n){var r=t===e.head?new i(n,null,t,e):new i(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function n(e,t){e.tail=new i(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function r(e,t){e.head=new i(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function i(e,t,n,r){if(!(this instanceof i))return new i(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}dl=1,hl=e,e.Node=i,e.create=e,e.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},e.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},e.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)n(this,arguments[e]);return this.length},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)r(this,arguments[e]);return this.length},e.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},e.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},e.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},e.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},e.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},e.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},e.prototype.map=function(t,n){n=n||this;for(var r=new e,i=this.head;null!==i;)r.push(t.call(n,i.value,this)),i=i.next;return r},e.prototype.mapReverse=function(t,n){n=n||this;for(var r=new e,i=this.tail;null!==i;)r.push(t.call(n,i.value,this)),i=i.prev;return r},e.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},e.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},e.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},e.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},e.prototype.slice=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=0,o=this.head;null!==o&&i<t;i++)o=o.next;for(;null!==o&&i<n;i++,o=o.next)r.push(o.value);return r},e.prototype.sliceReverse=function(t,n){(n=n||this.length)<0&&(n+=this.length),(t=t||0)<0&&(t+=this.length);var r=new e;if(n<t||n<0)return r;t<0&&(t=0),n>this.length&&(n=this.length);for(var i=this.length,o=this.tail;null!==o&&i>n;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},e.prototype.splice=function(e,n,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;var s=[];for(i=0;o&&i<n;i++)s.push(o.value),o=this.removeNode(o);null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev);for(i=0;i<r.length;i++)o=t(this,o,r[i]);return s},e.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{(ll?ul:(ll=1,ul=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return hl}function wl(){if(gl)return ml;gl=1;class e{constructor(t,n){if(n=r(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof i)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!f(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&d)|(this.options.loose&&p))+":"+e,r=n.get(t);if(r)return r;const s=this.options.loose,m=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(m,T(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],u),o("comparator trim",e),e=e.replace(a[c.TILDETRIM],l),o("tilde trim",e),e=e.replace(a[c.CARETTRIM],h),o("caret trim",e);let g=e.split(" ").map((e=>y(e,this.options))).join(" ").split(/\s+/).map((e=>D(e,this.options)));s&&(g=g.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",g);const v=new Map,b=g.map((e=>new i(e,this.options)));for(const e of b){if(f(e))return[e];v.set(e.value,e)}v.size>1&&v.has("")&&v.delete("");const S=[...v.values()];return n.set(t,S),S}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new s(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(x(this.set[t],e,this.options))return!0;return!1}}ml=e;const t=function(){if(fl)return pl;fl=1;const e=Sl(),t=Symbol("max"),n=Symbol("length"),r=Symbol("lengthCalculator"),i=Symbol("allowStale"),o=Symbol("maxAge"),s=Symbol("dispose"),a=Symbol("noDisposeOnSet"),c=Symbol("lruList"),u=Symbol("cache"),l=Symbol("updateAgeOnGet"),h=()=>1,d=(e,t,n)=>{const r=e[u].get(t);if(r){const t=r.value;if(p(e,t)){if(m(e,r),!e[i])return}else n&&(e[l]&&(r.value.now=Date.now()),e[c].unshiftNode(r));return t.value}},p=(e,t)=>{if(!t||!t.maxAge&&!e[o])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[o]&&n>e[o]},f=e=>{if(e[n]>e[t])for(let r=e[c].tail;e[n]>e[t]&&null!==r;){const t=r.prev;m(e,r),r=t}},m=(e,t)=>{if(t){const r=t.value;e[s]&&e[s](r.key,r.value),e[n]-=r.length,e[u].delete(r.key),e[c].removeNode(t)}};class g{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const y=(e,t,n,r)=>{let o=n.value;p(e,o)&&(m(e,n),e[i]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};return pl=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[t]=e.max||1/0;const n=e.length||h;if(this[r]="function"!=typeof n?h:n,this[i]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[o]=e.maxAge||0,this[s]=e.dispose,this[a]=e.noDisposeOnSet||!1,this[l]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[t]=e||1/0,f(this)}get max(){return this[t]}set allowStale(e){this[i]=!!e}get allowStale(){return this[i]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[o]=e,f(this)}get maxAge(){return this[o]}set lengthCalculator(e){"function"!=typeof e&&(e=h),e!==this[r]&&(this[r]=e,this[n]=0,this[c].forEach((e=>{e.length=this[r](e.value,e.key),this[n]+=e.length}))),f(this)}get lengthCalculator(){return this[r]}get length(){return this[n]}get itemCount(){return this[c].length}rforEach(e,t){t=t||this;for(let n=this[c].tail;null!==n;){const r=n.prev;y(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[c].head;null!==n;){const r=n.next;y(this,e,n,t),n=r}}keys(){return this[c].toArray().map((e=>e.key))}values(){return this[c].toArray().map((e=>e.value))}reset(){this[s]&&this[c]&&this[c].length&&this[c].forEach((e=>this[s](e.key,e.value))),this[u]=new Map,this[c]=new e,this[n]=0}dump(){return this[c].map((e=>!p(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[c]}set(e,i,l){if((l=l||this[o])&&"number"!=typeof l)throw new TypeError("maxAge must be a number");const h=l?Date.now():0,d=this[r](i,e);if(this[u].has(e)){if(d>this[t])return m(this,this[u].get(e)),!1;const r=this[u].get(e).value;return this[s]&&(this[a]||this[s](e,r.value)),r.now=h,r.maxAge=l,r.value=i,this[n]+=d-r.length,r.length=d,this.get(e),f(this),!0}const p=new g(e,i,d,h,l);return p.length>this[t]?(this[s]&&this[s](e,i),!1):(this[n]+=p.length,this[c].unshift(p),this[u].set(e,this[c].head),f(this),!0)}has(e){if(!this[u].has(e))return!1;const t=this[u].get(e).value;return!p(this,t)}get(e){return d(this,e,!0)}peek(e){return d(this,e,!1)}pop(){const e=this[c].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[u].forEach(((e,t)=>d(this,t,!1)))}},pl}(),n=new t({max:1e3}),r=Qc,i=Rl(),o=Bc,s=uu,{safeRe:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=Jc,{FLAG_INCLUDE_PRERELEASE:d,FLAG_LOOSE:p}=zc,f=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},y=(e,t)=>(o("comp",e,t),e=w(e,t),o("caret",e),e=b(e,t),o("tildes",e),e=C(e,t),o("xrange",e),e=_(e,t),o("stars",e),e),v=e=>!e||"x"===e.toLowerCase()||"*"===e,b=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{const n=t.loose?a[c.TILDELOOSE]:a[c.TILDE];return e.replace(n,((t,n,r,i,s)=>{let a;return o("tilde",e,t,n,r,i,s),v(n)?a="":v(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:v(i)?a=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:s?(o("replaceTilde pr",s),a=`>=${n}.${r}.${i}-${s} <${n}.${+r+1}.0-0`):a=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,o("tilde return",a),a}))},w=(e,t)=>e.trim().split(/\s+/).map((e=>R(e,t))).join(" "),R=(e,t)=>{o("caret",e,t);const n=t.loose?a[c.CARETLOOSE]:a[c.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,s,a)=>{let c;return o("caret",e,t,n,i,s,a),v(n)?c="":v(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:v(s)?c="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:a?(o("replaceCaret pr",a),c="0"===n?"0"===i?`>=${n}.${i}.${s}-${a} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}-${a} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s}-${a} <${+n+1}.0.0-0`):(o("no pr"),c="0"===n?"0"===i?`>=${n}.${i}.${s}${r} <${n}.${i}.${+s+1}-0`:`>=${n}.${i}.${s}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${s} <${+n+1}.0.0-0`),o("caret return",c),c}))},C=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>E(e,t))).join(" ")),E=(e,t)=>{e=e.trim();const n=t.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return e.replace(n,((n,r,i,s,a,c)=>{o("xRange",e,n,r,i,s,a,c);const u=v(i),l=u||v(s),h=l||v(a),d=h;return"="===r&&d&&(r=""),c=t.includePrerelease?"-0":"",u?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(l&&(s=0),a=0,">"===r?(r=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===r&&(r="<",l?i=+i+1:s=+s+1),"<"===r&&(c="-0"),n=`${r+i}.${s}.${a}${c}`):l?n=`>=${i}.0.0${c} <${+i+1}.0.0-0`:h&&(n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`),o("xRange return",n),n}))},_=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),D=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),T=e=>(t,n,r,i,o,s,a,c,u,l,h,d,p)=>`${n=v(r)?"":v(i)?`>=${r}.0.0${e?"-0":""}`:v(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=v(u)?"":v(l)?`<${+u+1}.0.0-0`:v(h)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${h}-${d}`:e?`<${u}.${l}.${+h+1}-0`:`<=${c}`}`.trim(),x=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(o(e[n].semver),e[n].semver!==i.ANY&&e[n].semver.prerelease.length>0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return ml}function Rl(){if(vl)return yl;vl=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,i){if(i=n(i),r instanceof t){if(r.loose===!!i.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),s("comparator",r,i),this.options=i,this.loose=!!i.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,s("comp",this)}parse(t){const n=this.options.loose?r[i.COMPARATORLOOSE]:r[i.COMPARATOR],o=t.match(n);if(!o)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==o[1]?o[1]:"","="===this.operator&&(this.operator=""),o[2]?this.semver=new a(o[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(s("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new a(t,this.options)}catch(e){return!1}return o(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,r).test(this.value):""===e.operator?""===e.value||new c(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(o(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(o(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}yl=t;const n=Qc,{safeRe:r,t:i}=Jc,o=il,s=Bc,a=uu,c=wl();return yl}const Cl=wl();var El=(e,t,n)=>{try{t=new Cl(t,n)}catch(e){return!1}return t.test(e)};const _l=wl();var Dl=(e,t)=>new _l(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const Tl=uu,xl=wl();var kl=(e,t,n)=>{let r=null,i=null,o=null;try{o=new xl(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new Tl(r,n)))})),r};const Pl=uu,Ol=wl();var Nl=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Ol(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&1!==i.compare(e)||(r=e,i=new Pl(r,n)))})),r};const Al=uu,Il=wl(),ql=Hu;var Ml=(e,t)=>{e=new Il(e,t);let n=new Al("0.0.0");if(e.test(n))return n;if(n=new Al("0.0.0-0"),e.test(n))return n;n=null;for(let t=0;t<e.set.length;++t){const r=e.set[t];let i=null;r.forEach((e=>{const t=new Al(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!ql(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!ql(n,i)||(n=i)}return n&&e.test(n)?n:null};const Fl=wl();var Ll=(e,t)=>{try{return new Fl(e,t).range||"*"}catch(e){return null}};const jl=uu,$l=Rl(),{ANY:Hl}=$l,Wl=wl(),Vl=El,Ul=Hu,Kl=Vu,Gl=Yu,zl=Ju;var Bl=(e,t,n,r)=>{let i,o,s,a,c;switch(e=new jl(e,r),t=new Wl(t,r),n){case">":i=Ul,o=Gl,s=Kl,a=">",c=">=";break;case"<":i=Kl,o=zl,s=Ul,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Vl(e,t,r))return!1;for(let n=0;n<t.set.length;++n){const u=t.set[n];let l=null,h=null;if(u.forEach((e=>{e.semver===Hl&&(e=new $l(">=0.0.0")),l=l||e,h=h||e,i(e.semver,l.semver,r)?l=e:s(e.semver,h.semver,r)&&(h=e)})),l.operator===a||l.operator===c)return!1;if((!h.operator||h.operator===a)&&o(e,h.semver))return!1;if(h.operator===c&&s(e,h.semver))return!1}return!0};const Jl=Bl;var Xl=(e,t,n)=>Jl(e,t,">",n);const Yl=Bl;var Ql=(e,t,n)=>Yl(e,t,"<",n);const Zl=wl();var eh=(e,t,n)=>(e=new Zl(e,n),t=new Zl(t,n),e.intersects(t,n));const th=El,nh=ku;const rh=wl(),ih=Rl(),{ANY:oh}=ih,sh=El,ah=ku,ch=[new ih(">=0.0.0-0")],uh=[new ih(">=0.0.0")],lh=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===oh){if(1===t.length&&t[0].semver===oh)return!0;e=n.includePrerelease?ch:uh}if(1===t.length&&t[0].semver===oh){if(n.includePrerelease)return!0;t=uh}const r=new Set;let i,o,s,a,c,u,l;for(const t of e)">"===t.operator||">="===t.operator?i=hh(i,t,n):"<"===t.operator||"<="===t.operator?o=dh(o,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&o){if(s=ah(i.semver,o.semver,n),s>0)return null;if(0===s&&(">="!==i.operator||"<="!==o.operator))return null}for(const e of r){if(i&&!sh(e,String(i),n))return null;if(o&&!sh(e,String(o),n))return null;for(const r of t)if(!sh(e,String(r),n))return!1;return!0}let h=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver,d=!(!i||n.includePrerelease||!i.semver.prerelease.length)&&i.semver;h&&1===h.prerelease.length&&"<"===o.operator&&0===h.prerelease[0]&&(h=!1);for(const e of t){if(l=l||">"===e.operator||">="===e.operator,u=u||"<"===e.operator||"<="===e.operator,i)if(d&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===d.major&&e.semver.minor===d.minor&&e.semver.patch===d.patch&&(d=!1),">"===e.operator||">="===e.operator){if(a=hh(i,e,n),a===e&&a!==i)return!1}else if(">="===i.operator&&!sh(i.semver,String(e),n))return!1;if(o)if(h&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===h.major&&e.semver.minor===h.minor&&e.semver.patch===h.patch&&(h=!1),"<"===e.operator||"<="===e.operator){if(c=dh(o,e,n),c===e&&c!==o)return!1}else if("<="===o.operator&&!sh(o.semver,String(e),n))return!1;if(!e.operator&&(o||i)&&0!==s)return!1}return!(i&&u&&!o&&0!==s)&&(!(o&&l&&!i&&0!==s)&&(!d&&!h))},hh=(e,t,n)=>{if(!e)return t;const r=ah(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},dh=(e,t,n)=>{if(!e)return t;const r=ah(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var ph=(e,t,n={})=>{if(e===t)return!0;e=new rh(e,n),t=new rh(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=lh(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const fh=Jc,mh=zc,gh=uu,yh=tu,vh=(e,t,n)=>{const r=[];let i=null,o=null;const s=e.sort(((e,t)=>nh(e,t,n)));for(const e of s){th(e,t,n)?(o=e,i||(i=e)):(o&&r.push([i,o]),o=null,i=null)}i&&r.push([i,null]);const a=[];for(const[e,t]of r)e===t?a.push(e):t||e!==s[0]?t?e===s[0]?a.push(`<=${t}`):a.push(`${e} - ${t}`):a.push(`>=${e}`):a.push("*");const c=a.join(" || "),u="string"==typeof t.raw?t.raw:String(t);return c.length<u.length?c:t};const bh=N({parse:hu,valid:pu,clean:mu,inc:yu,diff:bu,major:wu,minor:Cu,patch:_u,prerelease:Tu,compare:ku,rcompare:Ou,compareLoose:Au,compareBuild:qu,sort:Fu,rsort:ju,gt:Hu,lt:Vu,eq:Ku,neq:zu,gte:Ju,lte:Yu,cmp:il,coerce:bl,Comparator:Rl(),Range:wl(),satisfies:El,toComparators:Dl,maxSatisfying:kl,minSatisfying:Nl,minVersion:Ml,validRange:Ll,outside:Bl,gtr:Xl,ltr:Ql,intersects:eh,simplifyRange:vh,subset:ph,SemVer:gh,re:fh.re,src:fh.src,tokens:fh.t,SEMVER_SPEC_VERSION:mh.SEMVER_SPEC_VERSION,RELEASE_TYPES:mh.RELEASE_TYPES,compareIdentifiers:yh.compareIdentifiers,rcompareIdentifiers:yh.rcompareIdentifiers});class Sh{static fromSimpleString(e){return new Sh(e,e,e)}static fromVersionString(e){let t=bh.valid(e);if(!t)return new Sh("invalid version","1.0.0","1.0.0");const n=e.indexOf("-");return n>=0&&(t=t.substr(0,n)),new Sh(e,t,e)}constructor(e,t,n){this.displayName=e,this.version=t,this.fullVersionString=n}eq(e){return bh.eq(this.version,e.version)}gte(e){return bh.gte(this.version,e.version)}lt(e){return!this.gte(e)}}var wh,Rh,Ch,Eh,_h,Dh,Th,xh,kh,Ph,Oh,Nh;Sh.defaultVersion=Sh.fromSimpleString("1.0.0"),Sh.v240=Sh.fromSimpleString("2.4.0"),Sh.v250=Sh.fromSimpleString("2.5.0"),Sh.v260=Sh.fromSimpleString("2.6.0"),Sh.v270=Sh.fromSimpleString("2.7.0"),Sh.v280=Sh.fromSimpleString("2.8.0"),Sh.v290=Sh.fromSimpleString("2.9.0"),Sh.v291=Sh.fromSimpleString("2.9.1"),Sh.v300=Sh.fromSimpleString("3.0.0"),Sh.v310=Sh.fromSimpleString("3.1.0"),Sh.v314=Sh.fromSimpleString("3.1.4"),Sh.v320=Sh.fromSimpleString("3.2.0"),Sh.v333=Sh.fromSimpleString("3.3.3"),Sh.v340=Sh.fromSimpleString("3.4.0"),Sh.v345=Sh.fromSimpleString("3.4.5"),Sh.v350=Sh.fromSimpleString("3.5.0"),Sh.v380=Sh.fromSimpleString("3.8.0"),Sh.v381=Sh.fromSimpleString("3.8.1"),Sh.v390=Sh.fromSimpleString("3.9.0"),Sh.v400=Sh.fromSimpleString("4.0.0"),Sh.v401=Sh.fromSimpleString("4.0.1"),Sh.v420=Sh.fromSimpleString("4.2.0"),Sh.v430=Sh.fromSimpleString("4.3.0"),Sh.v440=Sh.fromSimpleString("4.4.0"),Sh.v460=Sh.fromSimpleString("4.6.0"),Sh.v470=Sh.fromSimpleString("4.7.0"),Sh.v480=Sh.fromSimpleString("4.8.0"),Sh.v490=Sh.fromSimpleString("4.9.0"),Sh.v510=Sh.fromSimpleString("5.1.0"),function(e){e.type=new Te.RequestType("_typescript.rename")}(wh||(wh={})),function(e){e.JsxClosingTag="jsxClosingTag",e.LinkedEditingRange="linkedEditingRange",e.Brace="brace",e.BraceCompletion="braceCompletion",e.GetSpanOfEnclosingComment="getSpanOfEnclosingComment",e.Change="change",e.Close="close",e.Completions="completions",e.CompletionInfo="completionInfo",e.CompletionDetails="completionEntryDetails",e.CompileOnSaveAffectedFileList="compileOnSaveAffectedFileList",e.CompileOnSaveEmitFile="compileOnSaveEmitFile",e.Configure="configure",e.Definition="definition",e.DefinitionAndBoundSpan="definitionAndBoundSpan",e.EncodedSemanticClassificationsFull="encodedSemanticClassifications-full",e.Implementation="implementation",e.Exit="exit",e.FileReferences="fileReferences",e.Format="format",e.Formatonkey="formatonkey",e.Geterr="geterr",e.GeterrForProject="geterrForProject",e.SemanticDiagnosticsSync="semanticDiagnosticsSync",e.SyntacticDiagnosticsSync="syntacticDiagnosticsSync",e.SuggestionDiagnosticsSync="suggestionDiagnosticsSync",e.NavBar="navbar",e.Navto="navto",e.NavTree="navtree",e.NavTreeFull="navtree-full",e.Occurrences="occurrences",e.DocumentHighlights="documentHighlights",e.Open="open",e.Quickinfo="quickinfo",e.References="references",e.Reload="reload",e.Rename="rename",e.Saveto="saveto",e.SignatureHelp="signatureHelp",e.FindSourceDefinition="findSourceDefinition",e.Status="status",e.TypeDefinition="typeDefinition",e.ProjectInfo="projectInfo",e.ReloadProjects="reloadProjects",e.Unknown="unknown",e.OpenExternalProject="openExternalProject",e.OpenExternalProjects="openExternalProjects",e.CloseExternalProject="closeExternalProject",e.UpdateOpen="updateOpen",e.GetOutliningSpans="getOutliningSpans",e.TodoComments="todoComments",e.Indentation="indentation",e.DocCommentTemplate="docCommentTemplate",e.CompilerOptionsForInferredProjects="compilerOptionsForInferredProjects",e.GetCodeFixes="getCodeFixes",e.GetCombinedCodeFix="getCombinedCodeFix",e.ApplyCodeActionCommand="applyCodeActionCommand",e.GetSupportedCodeFixes="getSupportedCodeFixes",e.GetApplicableRefactors="getApplicableRefactors",e.GetEditsForRefactor="getEditsForRefactor",e.OrganizeImports="organizeImports",e.GetEditsForFileRename="getEditsForFileRename",e.ConfigurePlugin="configurePlugin",e.SelectionRange="selectionRange",e.ToggleLineComment="toggleLineComment",e.ToggleMultilineComment="toggleMultilineComment",e.CommentSelection="commentSelection",e.UncommentSelection="uncommentSelection",e.PrepareCallHierarchy="prepareCallHierarchy",e.ProvideCallHierarchyIncomingCalls="provideCallHierarchyIncomingCalls",e.ProvideCallHierarchyOutgoingCalls="provideCallHierarchyOutgoingCalls",e.ProvideInlayHints="provideInlayHints"}(Rh||(Rh={})),function(e){e.none="none",e.definition="definition",e.reference="reference",e.writtenReference="writtenReference"}(Ch||(Ch={})),function(e){e.None="None",e.Preserve="Preserve",e.ReactNative="ReactNative",e.React="React"}(Eh||(Eh={})),function(e){e.None="None",e.CommonJS="CommonJS",e.AMD="AMD",e.UMD="UMD",e.System="System",e.ES6="ES6",e.ES2015="ES2015",e.ESNext="ESNext"}(_h||(_h={})),function(e){e.Classic="Classic",e.Node="Node"}(Dh||(Dh={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove"}(Th||(Th={})),function(e){e.unknown="",e.warning="warning",e.keyword="keyword",e.scriptElement="script",e.moduleElement="module",e.classElement="class",e.localClassElement="local class",e.interfaceElement="interface",e.typeElement="type",e.enumElement="enum",e.enumMemberElement="enum member",e.variableElement="var",e.localVariableElement="local var",e.variableUsingElement="using",e.variableAwaitUsingElement="await using",e.functionElement="function",e.localFunctionElement="local function",e.memberFunctionElement="method",e.memberGetAccessorElement="getter",e.memberSetAccessorElement="setter",e.memberVariableElement="property",e.memberAccessorVariableElement="accessor",e.constructorImplementationElement="constructor",e.callSignatureElement="call",e.indexSignatureElement="index",e.constructSignatureElement="construct",e.parameterElement="parameter",e.typeParameterElement="type parameter",e.primitiveType="primitive type",e.label="label",e.alias="alias",e.constElement="const",e.letElement="let",e.directory="directory",e.externalModuleName="external module name",e.jsxAttribute="JSX attribute",e.string="string",e.link="link",e.linkName="link name",e.linkText="link text"}(xh||(xh={})),function(e){e.none="",e.publicMemberModifier="public",e.privateMemberModifier="private",e.protectedMemberModifier="protected",e.exportedModifier="export",e.ambientModifier="declare",e.staticModifier="static",e.abstractModifier="abstract",e.optionalModifier="optional",e.deprecatedModifier="deprecated",e.dtsModifier=".d.ts",e.tsModifier=".ts",e.tsxModifier=".tsx",e.jsModifier=".js",e.jsxModifier=".jsx",e.jsonModifier=".json",e.dmtsModifier=".d.mts",e.mtsModifier=".mts",e.mjsModifier=".mjs",e.dctsModifier=".d.cts",e.ctsModifier=".cts",e.cjsModifier=".cjs"}(kh||(kh={})),function(e){e.ES3="ES3",e.ES5="ES5",e.ES6="ES6",e.ES2015="ES2015",e.ES2016="ES2016",e.ES2017="ES2017",e.ES2018="ES2018",e.ES2019="ES2019",e.ES2020="ES2020",e.ES2021="ES2021",e.ES2022="ES2022",e.ESNext="ESNext"}(Ph||(Ph={})),function(e){e[e.aliasName=0]="aliasName",e[e.className=1]="className",e[e.enumName=2]="enumName",e[e.fieldName=3]="fieldName",e[e.interfaceName=4]="interfaceName",e[e.keyword=5]="keyword",e[e.lineBreak=6]="lineBreak",e[e.numericLiteral=7]="numericLiteral",e[e.stringLiteral=8]="stringLiteral",e[e.localName=9]="localName",e[e.methodName=10]="methodName",e[e.moduleName=11]="moduleName",e[e.operator=12]="operator",e[e.parameterName=13]="parameterName",e[e.propertyName=14]="propertyName",e[e.punctuation=15]="punctuation",e[e.space=16]="space",e[e.text=17]="text",e[e.typeParameterName=18]="typeParameterName",e[e.enumMemberName=19]="enumMemberName",e[e.functionName=20]="functionName",e[e.regularExpressionLiteral=21]="regularExpressionLiteral",e[e.link=22]="link",e[e.linkName=23]="linkName",e[e.linkText=24]="linkText"}(Oh||(Oh={})),function(e){e.All="All",e.SortAndCombine="SortAndCombine",e.RemoveUnused="RemoveUnused"}(Nh||(Nh={}));class Ah{}Ah.optional="optional",Ah.deprecated="deprecated",Ah.dtsFile=".d.ts",Ah.tsFile=".ts",Ah.tsxFile=".tsx",Ah.jsFile=".js",Ah.jsxFile=".jsx",Ah.jsonFile=".json",Ah.fileExtensionKindModifiers=[Ah.dtsFile,Ah.tsFile,Ah.tsxFile,Ah.jsFile,Ah.jsxFile,Ah.jsonFile];const Ih={aliasName:0,className:1,enumName:2,fieldName:3,interfaceName:4,keyword:5,lineBreak:6,numericLiteral:7,stringLiteral:8,localName:9,methodName:10,moduleName:11,operator:12,parameterName:13,propertyName:14,punctuation:15,space:16,text:17,typeParameterName:18,enumMemberName:19,functionName:20,regularExpressionLiteral:21,link:22,linkName:23,linkText:24};function qh(e){return Ih[e]}var Mh,Fh,Lh;!function(e){e.Syntax="syntax",e.Semantic="semantic"}(Mh||(Mh={})),function(e){e.Cancelled=class{constructor(e){this.reason=e,this.type="cancelled"}},e.NoContent={type:"noContent"},e.NoServer={type:"noServer"}}(Fh||(Fh={})),function(e){e[e.Syntax=0]="Syntax",e[e.EnhancedSyntax=1]="EnhancedSyntax",e[e.Semantic=2]="Semantic"}(Lh||(Lh={}));class jh{constructor(...e){this.capabilities=new Set(e)}has(e){return this.capabilities.has(e)}}class $h extends Error{static create(e,t,n){const r=$h.parseErrorText(n);return new $h(e,t,n,r?.message,r?.stack)}constructor(e,t,n,r,i){super(`<${e}> TypeScript Server Error (${t.versionString})\n${r}\n${i}`),this.serverId=e,this.version=t,this.response=n,this.serverMessage=r,this.serverStack=i}get serverErrorText(){return this.response.message}get serverCommand(){return this.response.command}static parseErrorText(e){const t=e.message;if(t){const e="Error processing request. ";if(t.startsWith(e)){const n=t.substr(e.length),r=n.indexOf("\n");if(r>=0){const e=n.substring(r+1);return{message:n.substring(0,r),stack:e}}}}}}const Hh=p(m.randomBytes),Wh="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),Vh="0123456789".split(""),Uh="CDEHKMPRTUWXY012458".split(""),Kh="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),Gh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),zh=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),Bh=(e,t)=>({length:n,type:r,characters:i})=>{if(!(n>=0&&Number.isFinite(n)))throw new TypeError("Expected a `length` to be a non-negative finite number");if(void 0!==r&&void 0!==i)throw new TypeError("Expected either `type` or `characters`");if(void 0!==i&&"string"!=typeof i)throw new TypeError("Expected `characters` to be string");if(!zh.has(r))throw new TypeError(`Unknown type: ${r}`);if(void 0===r&&void 0===i&&(r="hex"),"hex"===r||void 0===r&&void 0===i)return t(Math.ceil(.5*n),"hex",n);if("base64"===r)return t(Math.ceil(.75*n),"base64",n);if("url-safe"===r)return e(n,Wh);if("numeric"===r)return e(n,Vh);if("distinguishable"===r)return e(n,Uh);if("ascii-printable"===r)return e(n,Kh);if("alphanumeric"===r)return e(n,Gh);if(0===i.length)throw new TypeError("Expected `characters` string length to be greater than or equal to 1");if(i.length>65536)throw new TypeError("Expected `characters` string length to be less or equal to 65536");return e(n,i.split(""))},Jh=Bh(((e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=m.randomBytes(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),((e,t,n)=>m.randomBytes(e).toString(t).slice(0,n)));Jh.async=Bh((async(e,t)=>{const n=t.length,r=Math.floor(65536/n)*n-1,i=2*Math.ceil(1.1*e);let o="",s=0;for(;s<e;){const a=await Hh(i);let c=0;for(;c<i&&s<e;){const e=a.readUInt16LE(c);c+=2,e>r||(o+=t[e%n],s++)}}return o}),(async(e,t,n)=>(await Hh(e)).toString(t).slice(0,n)));const Xh=await t.realpath(_.tmpdir());h(E.pipeline);const Yh=(e="")=>b.join(Xh,e+Jh({length:32}));function Qh({name:t,extension:n}={}){if(t){if(null!=n)throw new Error("The `name` and `extension` options are mutually exclusive");return b.join(function({prefix:t=""}={}){const n=Yh(t);return e.mkdirSync(n),n}(),t)}return Yh()+(null==n?"":"."+n.replace(/^\./,""))}class Zh{constructor(e,t){this._serverId=e,this._tracer=t,this.cancellationPipeName=Qh({name:"tscancellation"})}tryCancelOngoingRequest(t){if(!this.cancellationPipeName)return!1;this._tracer.logTrace(this._serverId,`TypeScript Server: trying to cancel ongoing request with sequence number ${t}`);try{e.writeFileSync(this.cancellationPipeName+String(t),"")}catch{}return!0}}const ed=new class{create(e,t){return new Zh(e,t)}};var td,nd,rd;!function(e){e[e.Normal=1]="Normal",e[e.LowPriority=2]="LowPriority",e[e.Fence=3]="Fence"}(td||(td={}));class id{constructor(){this.queue=[],this.sequenceNumber=0}get length(){return this.queue.length}enqueue(e){if(e.queueingType===td.Normal){let t=this.queue.length-1;for(;t>=0&&this.queue[t].queueingType===td.LowPriority;)--t;this.queue.splice(t+1,0,e)}else this.queue.push(e)}dequeue(){return this.queue.shift()}tryDeletePendingRequest(e){for(let t=0;t<this.queue.length;t++)if(this.queue[t].request.seq===e)return this.queue.splice(t,1),!0;return!1}createRequest(e,t){return{seq:this.sequenceNumber++,type:"request",command:e,arguments:t}}}class od{constructor(){this._callbacks=new Map,this._asyncCallbacks=new Map}destroy(e){const t=new Fh.Cancelled(e);for(const e of this._callbacks.values())e.onSuccess(t);this._callbacks.clear();for(const e of this._asyncCallbacks.values())e.onSuccess(t);this._asyncCallbacks.clear()}add(e,t,n){n?this._asyncCallbacks.set(e,t):this._callbacks.set(e,t)}fetch(e){const t=this._callbacks.get(e)||this._asyncCallbacks.get(e);return this.delete(e),t}delete(e){this._callbacks.delete(e)||this._asyncCallbacks.delete(e)}}!function(e){e[e.Semantic=0]="Semantic",e[e.Syntax=1]="Syntax"}(nd||(nd={}));class sd{constructor(e,t,n,r,i,o,s){this._serverId=e,this._serverSource=t,this._process=n,this._tsServerLogFile=r,this._requestCanceller=i,this._version=o,this._tracer=s,this._requestQueue=new id,this._callbacks=new od,this._pendingResponses=new Set,this._eventHandlers=new Set,this._exitHandlers=new Set,this._errorHandlers=new Set,this._stdErrHandlers=new Set,this._process.onData((e=>{this.dispatchMessage(e)})),this._process.onStdErr((e=>{this._stdErrHandlers.forEach((t=>t(e)))})),this._process.onExit(((e,t)=>{this._exitHandlers.forEach((n=>n({code:e,signal:t}))),this._callbacks.destroy("server exited")})),this._process.onError((e=>{this._errorHandlers.forEach((t=>t(e))),this._callbacks.destroy("server errored")}))}onEvent(e){this._eventHandlers.add(e)}onExit(e){this._exitHandlers.add(e)}onStdErr(e){this._stdErrHandlers.add(e)}onError(e){this._errorHandlers.add(e)}get tsServerLogFile(){return this._tsServerLogFile}write(e){this._process.write(e)}dispose(){this._callbacks.destroy("server disposed"),this._pendingResponses.clear(),this._eventHandlers.clear(),this._exitHandlers.clear(),this._errorHandlers.clear()}kill(){this.dispose(),this._process.kill()}dispatchMessage(e){try{switch(e.type){case"response":this._serverSource?this.dispatchResponse({...e}):this.dispatchResponse(e);break;case"event":{const t=e;if("requestCompleted"===t.event){const e=t.body.request_seq,n=this._callbacks.fetch(e);n&&(this._tracer.traceRequestCompleted(this._serverId,"requestCompleted",e,n),n.onSuccess(void 0))}else this._tracer.traceEvent(this._serverId,t),this._eventHandlers.forEach((e=>e(t)));break}default:throw new Error(`Unknown message type ${e.type} received`)}}finally{this.sendNextRequests()}}tryCancelRequest(e,t){try{return this._requestQueue.tryDeletePendingRequest(e)?(this.logTrace(`Canceled request with sequence number ${e}`),!0):!!this._requestCanceller.tryCancelOngoingRequest(e)||(this.logTrace(`Tried to cancel request with sequence number ${e}. But request got already delivered.`),!1)}finally{const n=this.fetchCallback(e);n?.onSuccess(new Fh.Cancelled(`Cancelled request ${e} - ${t}`))}}dispatchResponse(e){const t=this.fetchCallback(e.request_seq);t&&(this._tracer.traceResponse(this._serverId,e,t),e.success?t.onSuccess(e):"No content available."===e.message?t.onSuccess(Fh.NoContent):t.onError($h.create(this._serverId,this._version,e)))}executeImpl(e,t,n){const r=this._requestQueue.createRequest(e,t),i={request:r,expectsResponse:n.expectsResult,isAsync:n.isAsync,queueingType:sd.getQueueingType(e,n.lowPriority)};let o;return n.expectsResult&&(o=new Promise(((t,i)=>{this._callbacks.add(r.seq,{onSuccess:t,onError:i,queuingStartTime:Date.now(),isAsync:n.isAsync},n.isAsync),n.token&&n.token.onCancellationRequested((()=>{this.tryCancelRequest(r.seq,e)}))}))),this._requestQueue.enqueue(i),this.sendNextRequests(),[o]}sendNextRequests(){for(;0===this._pendingResponses.size&&this._requestQueue.length>0;){const e=this._requestQueue.dequeue();e&&this.sendRequest(e)}}sendRequest(e){const t=e.request;this._tracer.traceRequest(this._serverId,t,e.expectsResponse,this._requestQueue.length),e.expectsResponse&&!e.isAsync&&this._pendingResponses.add(e.request.seq);try{this.write(t)}catch(e){const n=this.fetchCallback(t.seq);n?.onError(e)}}fetchCallback(e){const t=this._callbacks.fetch(e);if(t)return this._pendingResponses.delete(e),t}logTrace(e){this._tracer.logTrace(this._serverId,e)}static getQueueingType(e,t){return sd.fenceCommands.has(e)?td.Fence:t?td.LowPriority:td.Normal}}sd.fenceCommands=new Set(["change","close","open","updateOpen"]);class ad{constructor(e,t){this.servers=e,this.delegate=t}execute(e,t,n){if(ad.sharedCommands.has(e)&&void 0===n.executionTarget){const r=this.servers.map((()=>rd.Unresolved));let i;if(n.token){const e=new be.CancellationTokenSource;n.token.onCancellationRequested((()=>{r.some((e=>e===rd.Resolved))||e.cancel()})),i=e.token}const o=[];for(let s=0;s<this.servers.length;++s){const a=this.servers[s].server.executeImpl(e,t,{...n,token:i})[0];o.push(a),a&&a.then((t=>{r[s]=rd.Resolved;const n=r.find((e=>2===e.type));return n&&this.delegate.onFatalError(e,n.err),t}),(t=>{throw r[s]=new rd.Errored(t),r.some((e=>e===rd.Resolved))&&this.delegate.onFatalError(e,t),t}))}return o}for(const{canRun:r,server:i}of this.servers)if(!r||r(e,n))return i.executeImpl(e,t,n);throw new Error(`Could not find server for command: '${e}'`)}}ad.sharedCommands=new Set([Rh.Change,Rh.Close,Rh.Open,Rh.UpdateOpen,Rh.Configure]);class cd{constructor(e,t,n){this._projectLoading=!0,this._eventHandlers=new Set,this._exitHandlers=new Set,this._errorHandlers=new Set,this.syntaxServer=e.syntax,this.semanticServer=e.semantic,this.router=new ad([{server:this.syntaxServer,canRun:(e,t)=>{switch(t.executionTarget){case nd.Semantic:return!1;case nd.Syntax:return!0}return!!cd.syntaxAlwaysCommands.has(e)||!cd.semanticCommands.has(e)&&!!(n&&this.projectLoading&&cd.syntaxAllowedCommands.has(e))}},{server:this.semanticServer,canRun:void 0}],t),this.syntaxServer.onEvent((e=>{this._eventHandlers.forEach((t=>t(e)))})),this.semanticServer.onEvent((e=>{switch(e.event){case"projectLoadingStart":this._projectLoading=!0;break;case"projectLoadingFinish":case"semanticDiag":case"syntaxDiag":case"suggestionDiag":case"configFileDiag":this._projectLoading=!1}this._eventHandlers.forEach((t=>t(e)))})),this.semanticServer.onExit((e=>{this._exitHandlers.forEach((t=>t(e))),this.syntaxServer.kill()})),this.semanticServer.onError((e=>this._errorHandlers.forEach((t=>t(e)))))}get projectLoading(){return this._projectLoading}dispose(){this._eventHandlers.clear(),this._exitHandlers.clear(),this._errorHandlers.clear()}onEvent(e){this._eventHandlers.add(e)}onExit(e){this._exitHandlers.add(e)}onError(e){this._errorHandlers.add(e)}onStdErr(e){}get tsServerLogFile(){return this.semanticServer.tsServerLogFile}kill(){this.dispose(),this.syntaxServer.kill(),this.semanticServer.kill()}executeImpl(e,t,n){return this.router.execute(e,t,n)}}cd.syntaxAlwaysCommands=new Set([Rh.NavTree,Rh.GetOutliningSpans,Rh.JsxClosingTag,Rh.SelectionRange,Rh.Format,Rh.Formatonkey,Rh.DocCommentTemplate]),cd.semanticCommands=new Set([Rh.Geterr,Rh.GeterrForProject,Rh.ProjectInfo,Rh.ConfigurePlugin]),cd.syntaxAllowedCommands=new Set([Rh.CompletionDetails,Rh.CompletionInfo,Rh.Definition,Rh.DefinitionAndBoundSpan,Rh.DocumentHighlights,Rh.Implementation,Rh.Navto,Rh.Quickinfo,Rh.References,Rh.Rename,Rh.SignatureHelp]),function(e){e.Unresolved={type:0},e.Resolved={type:1};e.Errored=class{constructor(e){this.err=e,this.type=2}}}(rd||(rd={}));class ud{fork(e,t,n,r){const i=e.tsServerPath,o=e.version?.gte(Sh.v490),s=[...t];o&&s.push("--useNodeIpc");const a=D.fork(i,s,{silent:!0,cwd:void 0,env:ld(process.env,i),execArgv:hd(n,r),stdio:o?["pipe","pipe","pipe","ipc"]:void 0});return o?new pd(a):new fd(a)}}function ld(e,t){const n=Object.assign({},e);return n.NODE_PATH=b.join(t,"..","..",".."),n.PATH=n.PATH||process.env.PATH,n}function hd(e,t){const n=[],r=function(e){if("syntax"===e)return;const t=dd()||process.env.TSS_DEBUG;if(t){const e=parseInt(t);if(!isNaN(e))return e}return}(e);if(r){const e=dd()?"--inspect-brk":"--inspect";n.push(`${e}=${r}`)}return t.maxTsServerMemory&&n.push(`--max-old-space-size=${t.maxTsServerMemory}`),n}function dd(){return process.env.TSS_DEBUG_BRK}class pd{constructor(e){this._process=e}write(e){this._process.send(e)}onData(e){this._process.on("message",e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e)}kill(){this._process.kill()}}class fd{constructor(e){this._process=e,this._reader=new md(this._process.stdout)}get reader(){return this._reader}write(e){this._process.stdin.write(`${JSON.stringify(e)}\r\n`,"utf8")}onData(e){this.reader.onData(e)}onExit(e){this._process.on("exit",e)}onStdErr(e){this._process.stderr.on("data",(t=>e(t.toString())))}onError(e){this._process.on("error",e),this.reader.onError(e)}kill(){this._process.kill(),this.reader.dispose(),this._reader=null}}class md{constructor(e){this.buffer=new wd,this.nextMessageLength=-1,this._onError=e=>{},this._onData=e=>{},this.isDisposed=!1,e.on("data",(e=>this.onLengthData(e)))}dispose(){this.isDisposed=!0,this._onError=e=>{},this._onData=e=>{}}onError(e){this._onError=e}onData(e){this._onData=e}onLengthData(e){if(!this.isDisposed)try{for(this.buffer.append(e);;){if(-1===this.nextMessageLength&&(this.nextMessageLength=this.buffer.tryReadContentLength(),-1===this.nextMessageLength))return;const e=this.buffer.tryReadContent(this.nextMessageLength);if(null===e)return;this.nextMessageLength=-1;const t=JSON.parse(e);this._onData(t)}}catch(e){this._onError(e)}}}const gd=8192,yd=Buffer.byteLength("Content-Length: ","utf8"),vd=Buffer.from(" ","utf8")[0],bd=Buffer.from("\r","utf8")[0],Sd=Buffer.from("\n","utf8")[0];class wd{constructor(){this.index=0,this.buffer=Buffer.allocUnsafe(gd)}append(e){let t=null;if(t=Buffer.isBuffer(e)?e:Buffer.from(e,"utf8"),this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{const e=(Math.ceil((this.index+t.length)/gd)+1)*gd;0===this.index?(this.buffer=Buffer.allocUnsafe(e),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],e)}this.index+=t.length}tryReadContentLength(){let e=-1,t=0;for(;t<this.index&&(this.buffer[t]===vd||this.buffer[t]===bd||this.buffer[t]===Sd);)t++;if(this.index<t+yd)return e;t+=yd;const n=t;for(;t<this.index&&this.buffer[t]!==bd;)t++;if(t+3>=this.index||this.buffer[t+1]!==Sd||this.buffer[t+2]!==bd||this.buffer[t+3]!==Sd)return e;const r=this.buffer.toString("utf8",n,t);return e=parseInt(r),this.buffer=this.buffer.slice(t+4),this.index=this.index-(t+4),e}tryReadContent(e){if(this.index<e)return null;const t=this.buffer.toString("utf8",0,e);let n=e;for(;n<this.index&&(this.buffer[n]===bd||this.buffer[n]===Sd);)n++;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}}var Rd,Cd,Ed,_d;function Dd(e){switch(e){case"never":return 0;case"auto":return 2}return 2}!function(e){e[e.Off=0]="Off",e[e.Normal=1]="Normal",e[e.Terse=2]="Terse",e[e.RequestTime=3]="RequestTime",e[e.Verbose=4]="Verbose"}(Rd||(Rd={})),function(e){e.fromString=function(t){switch(t?.toLowerCase()){case"normal":return e.Normal;case"terse":return e.Terse;case"requestTime":return e.RequestTime;case"verbose":return e.Verbose;default:return e.Off}},e.toString=function(t){switch(t){case e.Normal:return"normal";case e.Terse:return"terse";case e.Verbose:return"verbose";case e.Off:default:return"off"}}}(Rd||(Rd={}));class Td{constructor(e,t,n,r){this._apiVersion=e,this._logDirectoryProvider=t,this._logger=n,this._tracer=r}spawn(e,t,n,r){let i;const o=this.getCompositeServerType(e,t,n);switch(o){case 1:case 2:{const t=2===o;i=new cd({syntax:this.spawnTsServer("syntax",e,n),semantic:this.spawnTsServer("semantic",e,n)},r,t);break}case 0:i=this.spawnTsServer("main",e,n);break;case 3:i=this.spawnTsServer("syntax",e,n)}return i}getCompositeServerType(e,t,n){if(!t.has(Lh.Semantic))return 3;switch(n.useSyntaxServer){case 1:return 3;case 0:return 0;case 2:return e.version?.gte(Sh.v340)?e.version?.gte(Sh.v400)?2:1:0}}spawnTsServer(e,t,n){const r=new ud,i=ed.create(e,this._tracer),{args:o,tsServerLogFile:s}=this.getTsServerArgs(e,n,this._apiVersion,i.cancellationPipeName);this.isLoggingEnabled(n)&&(s?this._logger.logIgnoringVerbosity(Oo.Info,`<${e}> Log file: ${s}`):this._logger.logIgnoringVerbosity(Oo.Error,`<${e}> Could not create log directory`));const a=r.fork(t,o,e,n);return this._logger.log("Starting tsserver"),new sd(e,this.kindToServerType(e),a,s,i,t,this._tracer)}kindToServerType(e){return"syntax"===e?Mh.Syntax:Mh.Semantic}getTsServerArgs(e,t,n,r){const i=[];let o;"syntax"===e&&(n.gte(Sh.v401)?i.push("--serverMode","partialSemantic"):i.push("--syntaxOnly")),n.gte(Sh.v250)?i.push("--useInferredProjectPerProjectRoot"):i.push("--useSingleInferredProject");const{disableAutomaticTypingAcquisition:s,globalPlugins:a,locale:c,npmLocation:u,pluginProbeLocations:l}=t;if((s||"syntax"===e||"diagnostics"===e)&&i.push("--disableAutomaticTypingAcquisition"),r&&i.push("--cancellationPipeName",`${r}*`),this.isLoggingEnabled(t)){const e=this._logDirectoryProvider.getNewLogDirectory();e&&(o=b.join(e,"tsserver.log"),i.push("--logVerbosity",Rd.toString(t.logVerbosity)),i.push("--logFile",o))}return a?.length&&i.push("--globalPlugins",a.join(",")),l?.length&&i.push("--pluginProbeLocations",l.join(",")),u&&(this._logger.info(`using npm from ${u}`),i.push("--npmLocation",`"${u}"`)),i.push("--locale",c||"en"),i.push("--validateDefaultNpmLocation"),{args:i,tsServerLogFile:o,tsServerTraceDirectory:undefined}}isLoggingEnabled(e){return e.logVerbosity!==Rd.Off}}!function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(Cd||(Cd={})),function(e){e.fromString=function(t){switch(t=t.toLowerCase()){case"off":default:return e.Off;case"messages":return e.Messages;case"verbose":return e.Verbose}}}(Cd||(Cd={}));class xd{constructor(e,t){this.logger=e,this.trace=t}traceRequest(e,t,n,r){if(this.trace===Cd.Off)return;let i;this.trace===Cd.Verbose&&t.arguments&&(i=`Arguments: ${JSON.stringify(t.arguments,null,4)}`),this.logTrace(e,`Sending request: ${t.command} (${t.seq}). Response expected: ${n?"yes":"no"}. Current queue length: ${r}`,i)}traceResponse(e,t,n){if(this.trace===Cd.Off)return;let r;this.trace===Cd.Verbose&&t.body&&(r=`Result: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Response received: ${t.command} (${t.request_seq}). Request took ${Date.now()-n.queuingStartTime} ms. Success: ${t.success} ${t.success?"":`. Message: ${t.message}`}`,r)}traceRequestCompleted(e,t,n,r){this.trace!==Cd.Off&&this.logTrace(e,`Async response received: ${t} (${n}). Request took ${Date.now()-r.queuingStartTime} ms.`)}traceEvent(e,t){if(this.trace===Cd.Off)return;let n;this.trace===Cd.Verbose&&t.body&&(n=`Data: ${JSON.stringify(t.body,null,4)}`),this.logTrace(e,`Event received: ${t.event} (${t.seq}).`,n)}logTrace(e,t,n){this.trace!==Cd.Off&&this.logger.trace("Trace",`<${e}> ${t}`,n)}}!function(e){e.None={type:0};e.Running=class{constructor(e,t,n,r){this.server=e,this.apiVersion=t,this.tsserverVersion=n,this.languageServiceEnabled=r,this.type=1}updateTsserverVersion(e){this.tsserverVersion=e}updateLanguageServiceEnabled(e){this.languageServiceEnabled=e}};e.Errored=class{constructor(e,t){this.error=e,this.tsServerLogFile=t,this.type=2}}}(Ed||(Ed={}));class kd{constructor(e){this.lspClient=e}reset(){if(this._task){const e=this._task;this._task=void 0,e.then((e=>e.done()))}}startedLoadingProject(e){this.reset(),this._loadingProjectName=e,this._task=this.lspClient.createProgressReporter(),this._task.then((e=>e.begin("Initializing JS/TS language features…")))}finishedLoadingProject(e){this._loadingProjectName===e&&this.reset()}}class Pd{constructor(e){this.options=e,this.serverState=Ed.None,this.apiVersion=e.typescriptVersion.version||Sh.defaultVersion,this.typescriptVersionSource=e.typescriptVersion.source,this.logger=new Ao(e.logger,"[tsclient]"),this.tsserverLogger=new Ao(e.logger,"[tsserver]"),this.loadingIndicator=new kd(e.lspClient),this.tracer=new xd(this.tsserverLogger,e.trace)}get capabilities(){return 1===this.options.useSyntaxServer?new jh(Lh.Syntax,Lh.EnhancedSyntax):this.apiVersion.gte(Sh.v400)?new jh(Lh.Syntax,Lh.EnhancedSyntax,Lh.Semantic):new jh(Lh.Syntax,Lh.Semantic)}hasCapabilityForResource(e,t){if(!this.capabilities.has(t))return!1;switch(t){case Lh.Semantic:return["file","untitled"].includes(e.scheme);case Lh.Syntax:case Lh.EnhancedSyntax:return!0}}start(){const e=new Td(this.apiVersion,this.options.logDirectoryProvider,this.logger,this.tracer).spawn(this.options.typescriptVersion,this.capabilities,this.options,{onFatalError:(e,t)=>this.fatalError(e,t)});return this.serverState=new Ed.Running(e,this.apiVersion,void 0,!0),e.onExit((e=>{this.serverState=Ed.None,this.shutdown(),this.tsserverLogger.error(`Exited. Code: ${e.code}. Signal: ${e.signal}`),this.options.onExit&&this.options.onExit(e.code,e.signal)})),e.onStdErr((e=>{e&&this.logger.error(e)})),e.onError((t=>{this.serverState=new Ed.Errored(t,e.tsServerLogFile),t&&this.tsserverLogger.error("Exited with error. Error message is: {0}",t.message||t.name),this.serviceExited()})),e.onEvent((e=>this.dispatchEvent(e))),this.apiVersion.gte(Sh.v300)&&this.capabilities.has(Lh.Semantic)&&this.loadingIndicator.startedLoadingProject(""),!0}serviceExited(){1===this.serverState.type&&this.serverState.server.kill(),this.loadingIndicator.reset()}dispatchEvent(e){switch(e.event){case"syntaxDiag":case"semanticDiag":case"suggestionDiag":this.loadingIndicator.reset(),this.options.onEvent?.(e);break;case"projectsUpdatedInBackground":this.loadingIndicator.reset();break;case"projectLoadingStart":this.loadingIndicator.startedLoadingProject(e.body.projectName);break;case"projectLoadingFinish":this.loadingIndicator.finishedLoadingProject(e.body.projectName)}}shutdown(){this.loadingIndicator&&this.loadingIndicator.reset(),1===this.serverState.type&&this.serverState.server.kill(),this.serverState=Ed.None}notify(e,t){this.executeWithoutWaitingForResponse(e,t)}requestGeterr(e,t){return this.executeAsync(Rh.Geterr,e,t)}async request(e,t,n,r){try{return await this.execute(e,t,n,r)}catch(e){throw new be.ResponseError(1,e.message)}}execute(e,t,n,r){let i;return i||(i=this.executeImpl(e,t,{isAsync:!1,token:n,expectsResult:!0,...r})),r?.nonRecoverable&&i[0].catch((t=>this.fatalError(e,t))),e===Rh.UpdateOpen&&Promise.all(i).then((()=>{this.loadingIndicator.reset()})),i[0]}executeWithoutWaitingForResponse(e,t){this.executeImpl(e,t,{isAsync:!1,token:void 0,expectsResult:!1})}executeAsync(e,t,n){return this.executeImpl(e,t,{isAsync:!0,token:n,expectsResult:!0})[0]}executeImpl(e,t,n){const r=this.serverState;return 1===r.type?r.server.executeImpl(e,t,n):[Promise.resolve(Fh.NoServer)]}fatalError(e,t){if(this.tsserverLogger.error(`A non-recoverable error occurred while executing command: ${e}`),t instanceof $h&&t.serverErrorText&&this.tsserverLogger.error(t.serverErrorText),1===this.serverState.type){this.logger.info("Killing TS Server");const e=this.serverState.server.tsServerLogFile;this.serverState.server.kill(),t instanceof $h&&(this.serverState=new Ed.Errored(t,e))}}}(()=>{var e={470:e=>{function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(o===a-1||1===s);else if(o!==a-1&&2===s){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var c=r.lastIndexOf("/");if(c!==r.length-1){-1===c?(r="",i=0):i=(r=r.slice(0,c)).length-1-r.lastIndexOf("/"),o=a,s=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,s=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===n&&-1!==s?++s:s=-1}return r}var r={resolve:function(){for(var e,r="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var s;o>=0?s=arguments[o]:(void 0===e&&(e=process.cwd()),s=e),t(s),0!==s.length&&(r=s+"/"+r,i=47===s.charCodeAt(0))}return r=n(r,!i),i?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<n.length&&47===n.charCodeAt(a);++a);for(var c=n.length-a,u=s<c?s:c,l=-1,h=0;h<=u;++h){if(h===u){if(c>u){if(47===n.charCodeAt(a+h))return n.slice(a+h+1);if(0===h)return n.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?l=h:0===h&&(l=0));break}var d=e.charCodeAt(i+h);if(d!==n.charCodeAt(a+h))break;47===d&&(l=h)}var p="";for(h=i+l+1;h<=o;++h)h!==o&&47!==e.charCodeAt(h)||(0===p.length?p+="..":p+="/..");return p.length>0?p+n.slice(a+l):(a+=l,47===n.charCodeAt(a)&&++a,n.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(n=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,s=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var a=n.length-1,c=-1;for(r=e.length-1;r>=0;--r){var u=e.charCodeAt(r);if(47===u){if(!s){i=r+1;break}}else-1===c&&(s=!1,c=r+1),a>=0&&(u===n.charCodeAt(a)?-1==--a&&(o=r):(a=-1,o=c))}return i===o?o=c:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!s){i=r+1;break}}else-1===o&&(s=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(o=!1,i=a+1),46===c?-1===n?n=a:1!==s&&(s=1):-1!==n&&(s=-1);else if(!o){r=a+1;break}}return-1===n||-1===i||0===s||1===s&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,h=0;l>=r;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===i?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===h||1===h&&s===c-1&&s===a+1?-1!==c&&(n.base=n.name=0===a&&o?e.slice(1,c):e.slice(a,c)):(0===a&&o?(n.name=e.slice(1,s),n.base=e.slice(1,c)):(n.name=e.slice(a,s),n.base=e.slice(a,c)),n.ext=e.slice(s,c)),a>0?n.dir=e.slice(0,a-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{let e;if(n.r(r),n.d(r,{URI:()=>l,Utils:()=>E}),"object"==typeof process)e="win32"===process.platform;else if("object"==typeof navigator){let t=navigator.userAgent;e=t.indexOf("Windows")>=0}const t=/^\w[\w\d+.-]*$/,i=/^\//,o=/^\/\//;function s(e,n){if(!e.scheme&&n)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!t.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!i.test(e.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(o.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}const a="",c="/",u=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class l{static isUri(e){return e instanceof l||!!e&&"string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString}scheme;authority;path;query;fragment;constructor(e,t,n,r,i,o=!1){"object"==typeof e?(this.scheme=e.scheme||a,this.authority=e.authority||a,this.path=e.path||a,this.query=e.query||a,this.fragment=e.fragment||a):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||a,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==c&&(t=c+t):t=c}return t}(this.scheme,n||a),this.query=r||a,this.fragment=i||a,s(this,o))}get fsPath(){return g(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:n,path:r,query:i,fragment:o}=e;return void 0===t?t=this.scheme:null===t&&(t=a),void 0===n?n=this.authority:null===n&&(n=a),void 0===r?r=this.path:null===r&&(r=a),void 0===i?i=this.query:null===i&&(i=a),void 0===o?o=this.fragment:null===o&&(o=a),t===this.scheme&&n===this.authority&&r===this.path&&i===this.query&&o===this.fragment?this:new d(t,n,r,i,o)}static parse(e,t=!1){const n=u.exec(e);return n?new d(n[2]||a,S(n[4]||a),S(n[5]||a),S(n[7]||a),S(n[9]||a),t):new d(a,a,a,a,a)}static file(t){let n=a;if(e&&(t=t.replace(/\\/g,c)),t[0]===c&&t[1]===c){const e=t.indexOf(c,2);-1===e?(n=t.substring(2),t=c):(n=t.substring(2,e),t=t.substring(e)||c)}return new d("file",n,t,a,a)}static from(e){const t=new d(e.scheme,e.authority,e.path,e.query,e.fragment);return s(t,!0),t}toString(e=!1){return y(this,e)}toJSON(){return this}static revive(e){if(e){if(e instanceof l)return e;{const t=new d(e);return t._formatted=e.external,t._fsPath=e._sep===h?e.fsPath:null,t}}return e}}const h=e?1:void 0;class d extends l{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=g(this,!1)),this._fsPath}toString(e=!1){return e?y(this,!0):(this._formatted||(this._formatted=y(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=h),this._formatted&&(e.external=this._formatted),this.path&&(e.path=this.path),this.scheme&&(e.scheme=this.scheme),this.authority&&(e.authority=this.authority),this.query&&(e.query=this.query),this.fragment&&(e.fragment=this.fragment),e}}const p={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 f(e,t,n){let r,i=-1;for(let o=0;o<e.length;o++){const s=e.charCodeAt(o);if(s>=97&&s<=122||s>=65&&s<=90||s>=48&&s<=57||45===s||46===s||95===s||126===s||t&&47===s||n&&91===s||n&&93===s||n&&58===s)-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),void 0!==r&&(r+=e.charAt(o));else{void 0===r&&(r=e.substr(0,o));const t=p[s];void 0!==t?(-1!==i&&(r+=encodeURIComponent(e.substring(i,o)),i=-1),r+=t):-1===i&&(i=o)}}return-1!==i&&(r+=encodeURIComponent(e.substring(i))),void 0!==r?r:e}function m(e){let t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);35===r||63===r?(void 0===t&&(t=e.substr(0,n)),t+=p[r]):void 0!==t&&(t+=e[n])}return void 0!==t?t:e}function g(t,n){let r;return r=t.authority&&t.path.length>1&&"file"===t.scheme?`//${t.authority}${t.path}`:47===t.path.charCodeAt(0)&&(t.path.charCodeAt(1)>=65&&t.path.charCodeAt(1)<=90||t.path.charCodeAt(1)>=97&&t.path.charCodeAt(1)<=122)&&58===t.path.charCodeAt(2)?n?t.path.substr(1):t.path[1].toLowerCase()+t.path.substr(2):t.path,e&&(r=r.replace(/\//g,"\\")),r}function y(e,t){const n=t?m:f;let r="",{scheme:i,authority:o,path:s,query:a,fragment:u}=e;if(i&&(r+=i,r+=":"),(o||"file"===i)&&(r+=c,r+=c),o){let e=o.indexOf("@");if(-1!==e){const t=o.substr(0,e);o=o.substr(e+1),e=t.lastIndexOf(":"),-1===e?r+=n(t,!1,!1):(r+=n(t.substr(0,e),!1,!1),r+=":",r+=n(t.substr(e+1),!1,!0)),r+="@"}o=o.toLowerCase(),e=o.lastIndexOf(":"),-1===e?r+=n(o,!1,!0):(r+=n(o.substr(0,e),!1,!0),r+=o.substr(e))}if(s){if(s.length>=3&&47===s.charCodeAt(0)&&58===s.charCodeAt(2)){const e=s.charCodeAt(1);e>=65&&e<=90&&(s=`/${String.fromCharCode(e+32)}:${s.substr(3)}`)}else if(s.length>=2&&58===s.charCodeAt(1)){const e=s.charCodeAt(0);e>=65&&e<=90&&(s=`${String.fromCharCode(e+32)}:${s.substr(2)}`)}r+=n(s,!0,!1)}return a&&(r+="?",r+=n(a,!1,!1)),u&&(r+="#",r+=t?u:f(u,!1,!1)),r}function v(e){try{return decodeURIComponent(e)}catch{return e.length>3?e.substr(0,3)+v(e.substr(3)):e}}const b=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function S(e){return e.match(b)?e.replace(b,(e=>v(e))):e}var w=n(470);const R=w.posix||w,C="/";var E;!function(e){e.joinPath=function(e,...t){return e.with({path:R.join(e.path,...t)})},e.resolvePath=function(e,...t){let n=e.path,r=!1;n[0]!==C&&(n=C+n,r=!0);let i=R.resolve(n,...t);return r&&i[0]===C&&!e.authority&&(i=i.substring(1)),e.with({path:i})},e.dirname=function(e){if(0===e.path.length||e.path===C)return e;let t=R.dirname(e.path);return 1===t.length&&46===t.charCodeAt(0)&&(t=""),e.with({path:t})},e.basename=function(e){return R.basename(e.path)},e.extname=function(e){return R.extname(e.path)}}(E||(E={}))})(),_d=r})();const{URI:Od,Utils:Nd}=_d;var Ad,Id,qd;!function(e){e.fromTextSpan=t=>e.fromLocations(t.start,t.end),e.toTextSpan=e=>({start:Id.toLocation(e.start),end:Id.toLocation(e.end)}),e.fromLocations=(e,t)=>Te.Range.create(Math.max(0,e.line-1),Math.max(e.offset-1,0),Math.max(0,t.line-1),Math.max(0,t.offset-1)),e.toFileRangeRequestArgs=(e,t)=>({file:e,startLine:t.start.line+1,startOffset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.toFormattingRequestArgs=(e,t)=>({file:e,line:t.start.line+1,offset:t.start.character+1,endLine:t.end.line+1,endOffset:t.end.character+1}),e.intersection=function(e,t){const n=Id.Max(t.start,e.start),r=Id.Min(t.end,e.end);if(!Id.isAfter(n,r))return Te.Range.create(n,r)},e.union=function(e,t){const n=Id.Min(t.start,e.start),r=Id.Max(t.end,e.end);return Te.Range.create(n,r)}}(Ad||(Ad={})),function(e){function t(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<t.character}function n(e,t){return!r(e,t)}function r(e,t){return e.line<t.line||!(t.line<e.line)&&e.character<=t.character}e.fromLocation=e=>({line:Math.max(e.line-1,0),character:Math.max(e.offset-1,0)}),e.toLocation=e=>({line:e.line+1,offset:e.character+1}),e.toFileLocationRequestArgs=(e,t)=>({file:e,line:t.line+1,offset:t.character+1}),e.Min=function(...e){if(!e.length)return;let n=e.pop();for(const r of e)t(r,n)&&(n=r);return n},e.isBefore=t,e.Max=function(...e){if(!e.length)return;let t=e.pop();for(const r of e)n(r,t)&&(t=r);return t},e.isAfter=n,e.isBeforeOrEqual=r}(Id||(Id={})),function(e){e.fromTextSpan=(e,t)=>Te.Location.create(e,Ad.fromTextSpan(t))}(qd||(qd={}));const Md=/\\/g;function Fd(e){if(e.startsWith("zipfile:"))return e;const t=Od.parse(e);return"file"===t.scheme?$d(t.fsPath):void 0}function Ld(e,t){if(e.startsWith("zipfile:"))return e;const n=Od.file(e),r=jd(n.fsPath),i=t?.get(r);return i?i.uri:n.toString()}function jd(e){return $d(Od.file(e).fsPath)}function $d(e){return e.replace(Md,"/")}function Hd(e,t){const n=jd(Od.file(e).fsPath),r=t?.get(n);return r?r.version:null}function Wd(e,t){return{uri:Ld(e.file,t),range:{start:Id.fromLocation(e.start),end:Id.fromLocation(e.end)}}}const Vd={"enum member":be.SymbolKind.Constant,"JSX attribute":be.SymbolKind.Property,"local class":be.SymbolKind.Class,"local function":be.SymbolKind.Function,"local var":be.SymbolKind.Variable,"type parameter":be.SymbolKind.Variable,alias:be.SymbolKind.Variable,class:be.SymbolKind.Class,const:be.SymbolKind.Constant,constructor:be.SymbolKind.Constructor,enum:be.SymbolKind.Enum,field:be.SymbolKind.Field,file:be.SymbolKind.File,function:be.SymbolKind.Function,getter:be.SymbolKind.Method,interface:be.SymbolKind.Interface,let:be.SymbolKind.Variable,method:be.SymbolKind.Method,module:be.SymbolKind.Module,parameter:be.SymbolKind.Variable,property:be.SymbolKind.Property,setter:be.SymbolKind.Method,var:be.SymbolKind.Variable};function Ud(e){return Vd[e]||be.SymbolKind.Variable}function Kd(e){switch(e){case"error":default:return be.DiagnosticSeverity.Error;case"warning":return be.DiagnosticSeverity.Warning;case"suggestion":return be.DiagnosticSeverity.Hint}}function Gd(e,t,n){const r={range:{start:Id.fromLocation(e.start),end:Id.fromLocation(e.end)},message:e.text,severity:Kd(e.category),code:e.code,source:e.source||"typescript",relatedInformation:zd(e.relatedInformation,t)};return n.diagnosticsTagSupport&&(r.tags=function(e){const t=[];e.reportsUnnecessary&&t.push(be.DiagnosticTag.Unnecessary);e.reportsDeprecated&&t.push(be.DiagnosticTag.Deprecated);return t}(e)),r}function zd(e,t){if(!e)return;const n=[];for(const r of e){const e=r.span;e&&n.push(be.DiagnosticRelatedInformation.create(Wd(e,t),r.message))}return n}function Bd(e){return be.SelectionRange.create(Ad.fromTextSpan(e.textSpan),e.parent?Bd(e.parent):void 0)}function Jd(e){return{range:{start:Id.fromLocation(e.start),end:Id.fromLocation(e.end)},newText:e.newText}}function Xd(e,t){return{textDocument:{uri:Ld(e.fileName,t),version:Hd(e.fileName,t)},edits:e.textChanges.map((e=>Jd(e)))}}function Yd(e){return e.highlightSpans.map((e=>({kind:Qd(e.kind),range:{start:Id.fromLocation(e.start),end:Id.fromLocation(e.end)}})))}function Qd(e){switch(e){case Ch.definition:return be.DocumentHighlightKind.Write;case Ch.reference:case Ch.writtenReference:return be.DocumentHighlightKind.Read;default:return be.DocumentHighlightKind.Text}}class Zd{constructor(e,t,n,r){this.uri=e,this.publishDiagnostics=t,this.documents=n,this.features=r,this.diagnosticsPerKind=new Map,this.firePublishDiagnostics=Kc((()=>{const e=this.getDiagnostics();this.publishDiagnostics({uri:this.uri,diagnostics:e})}),50)}update(e,t){this.diagnosticsPerKind.set(e,t),this.firePublishDiagnostics()}getDiagnostics(){const e=[];for(const t of this.diagnosticsPerKind.values())for(const n of t)e.push(Gd(n,this.documents,this.features));return e}}class ep{constructor(e,t,n,r,i){this.publishDiagnostics=e,this.documents=t,this.features=n,this.logger=r,this.tspClient=i,this.diagnostics=new Map,this.ignoredDiagnosticCodes=new Set}updateDiagnostics(e,t,n){if(0!==e&&!this.tspClient.hasCapabilityForResource(this.documents.toResource(t),Lh.Semantic))return;this.ignoredDiagnosticCodes.size&&(n=n.filter((e=>!this.isDiagnosticIgnored(e))));const r=Ld(t,this.documents),i=this.diagnostics.get(r)||new Zd(r,this.publishDiagnostics,this.documents,this.features);i.update(e,n),this.diagnostics.set(r,i)}updateIgnoredDiagnosticCodes(e){this.ignoredDiagnosticCodes=new Set(e)}getDiagnosticsForFile(e){const t=Ld(e,this.documents);return this.diagnostics.get(t)?.getDiagnostics()||[]}isDiagnosticIgnored(e){return void 0!==e.code&&this.ignoredDiagnosticCodes.has(e.code)}}class tp{constructor(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content}update(e,t){for(let t of e)if(tp.isIncremental(t)){const e=op(t.range),n=this.offsetAt(e.start),r=this.offsetAt(e.end);this._content=this._content.substring(0,n)+t.text+this._content.substring(r,this._content.length);const i=Math.max(e.start.line,0),o=Math.max(e.end.line,0);let s=this._lineOffsets;const a=ip(t.text,!1,n);if(o-i===a.length)for(let e=0,t=a.length;e<t;e++)s[e+i+1]=a[e];else a.length<1e4?s.splice(i+1,o-i,...a):this._lineOffsets=s=s.slice(0,i+1).concat(a,s.slice(o+1));const c=t.text.length-(r-n);if(0!==c)for(let e=i+1+a.length,t=s.length;e<t;e++)s[e]=s[e]+c}else{if(!tp.isFull(t))throw new Error("Unknown change event received");this._content=t.text,this._lineOffsets=void 0}this._version=t}getLineOffsets(){return void 0===this._lineOffsets&&(this._lineOffsets=ip(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return{line:0,character:e};for(;n<r;){let i=Math.floor((n+r)/2);t[i]>e?r=i:n=i+1}let i=n-1;return{line:i,character:e-t[i]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let n=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(n+e.character,r),n)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0!==t.range&&(void 0===t.rangeLength||"number"==typeof t.rangeLength)}static isFull(e){let t=e;return null!=t&&"string"==typeof t.text&&void 0===t.range&&void 0===t.rangeLength}}var np;function rp(e,t){if(e.length<=1)return e;const n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);rp(r,t),rp(i,t);let o=0,s=0,a=0;for(;o<r.length&&s<i.length;){let n=t(r[o],i[s]);e[a++]=n<=0?r[o++]:i[s++]}for(;o<r.length;)e[a++]=r[o++];for(;s<i.length;)e[a++]=i[s++];return e}function ip(e,t,n=0){const r=t?[n]:[];for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);13!==i&&10!==i||(13===i&&t+1<e.length&&10===e.charCodeAt(t+1)&&t++,r.push(n+t+1))}return r}function op(e){const t=e.start,n=e.end;return t.line>n.line||t.line===n.line&&t.character>n.character?{start:n,end:t}:e}function sp(e){const t=op(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new tp(e,t,n,r)},e.update=function(e,t,n){if(e instanceof tp)return e.update(t,n),e;throw new Error("TextDocument.update: document must be created by TextDocument.create")},e.applyEdits=function(e,t){let n=e.getText(),r=rp(t.map(sp),((e,t)=>{let n=e.range.start.line-t.range.start.line;return 0===n?e.range.start.character-t.range.start.character:n})),i=0;const o=[];for(const t of r){let r=e.offsetAt(t.range.start);if(r<i)throw new Error("Overlapping edit");r>i&&o.push(n.substring(i,r)),t.newText.length&&o.push(t.newText),i=e.offsetAt(t.range.end)}return o.push(n.substr(i)),o.join("")}}(np||(np={}));class ap{constructor(e){const{uri:t,languageId:n,version:r,text:i}=e;this.document=np.create(t,n,r,i)}get uri(){return this.document.uri}get languageId(){return this.document.languageId}get version(){return this.document.version}getText(e){return this.document.getText(e)}positionAt(e){return this.document.positionAt(e)}offsetAt(e){return this.document.offsetAt(e)}get lineCount(){return this.document.lineCount}getLine(e){const t=this.getLineRange(e);return this.getText(t)}getLineRange(e){const t=this.getLineStart(e),n=this.getLineEnd(e);return be.Range.create(t,n)}getLineEnd(e){const t=e+1,n=this.getLineOffset(t);return this.positionAt(t<this.document.lineCount?n-1:n)}getLineOffset(e){const t=this.getLineStart(e);return this.offsetAt(t)}getLineStart(e){return be.Position.create(e,0)}getFullRange(){return be.Range.create(be.Position.create(0,0),this.getLineEnd(Math.max(this.lineCount-1,0)))}applyEdit(e,t){const n=this.getText();let r=t.text;if(be.TextDocumentContentChangeEvent.isIncremental(t)){const e=this.offsetAt(t.range.start),i=this.offsetAt(t.range.end);r=n.substr(0,e)+t.text+n.substr(i)}this.document=np.create(this.uri,this.languageId,e,r)}}class cp{constructor(){this._files=[],this.documents=new Map}get files(){return this._files}get(e){const t=this.documents.get(e);if(t)return this.files[0]!==e&&(this._files.splice(this._files.indexOf(e),1),this._files.unshift(e)),t}open(e,t){return!this.documents.has(e)&&(this.documents.set(e,new ap(t)),this._files.unshift(e),!0)}close(e){const t=this.documents.get(e);if(t)return this.documents.delete(e),this._files.splice(this._files.indexOf(e),1),t}toResource(e){const t=this.documents.get(e);return t?Od.parse(t.uri):Od.file(e)}}class up{static async execute(e,t,n,r,i,o,s){if(r.apiVersion.lt(up.minVersion))return void i.showErrorMessage("Go to Source Definition failed. Requires TypeScript 4.7+.");if(!t||"number"!=typeof t.character||"number"!=typeof t.line)return void i.showErrorMessage("Go to Source Definition failed. Invalid position.");let a;if(!e||"string"!=typeof e||!(a=Fd(e)))return void i.showErrorMessage("Go to Source Definition failed. No resource provided.");if(!n.get(a))return void i.showErrorMessage("Go to Source Definition failed. File not opened in the editor.");const c=Id.toFileLocationRequestArgs(a,t);return await i.withProgress({message:"Finding source definitions…",reporter:o},(async()=>{const e=await r.request(Rh.FindSourceDefinition,c,s);if("response"===e.type&&e.body)return e.body.map((e=>Wd(e,n)));i.showErrorMessage("No source definitions found.")}))}}up.id="_typescript.goToSourceDefinition",up.minVersion=Sh.v470;const lp={APPLY_WORKSPACE_EDIT:"_typescript.applyWorkspaceEdit",APPLY_CODE_ACTION:"_typescript.applyCodeAction",APPLY_REFACTORING:"_typescript.applyRefactoring",CONFIGURE_PLUGIN:"_typescript.configurePlugin",ORGANIZE_IMPORTS:"_typescript.organizeImports",APPLY_RENAME_FILE:"_typescript.applyRenameFile",APPLY_COMPLETION_CODE_ACTION:"_typescript.applyCompletionCodeAction",SELECT_REFACTORING:"_typescript.selectRefactoring",SOURCE_DEFINITION:up.id},hp=new be.NotificationType("$/typescriptVersion");class dp{constructor(e=""){this.value=e}appendText(e,t=0){var n;return this.value+=(n=e,n.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",this}toMarkupContent(){return{kind:"markdown",value:this.value}}}function pp(e){return function(e){return e.replace(/\{@(link|linkplain|linkcode) (https?:\/\/[^ |}]+?)(?:[| ]([^{}\n]+?))?\}/gi,((e,t,n,r)=>"linkcode"===t?`[\`${r?r.trim():n}\`](${n})`:`[${r?r.trim():n}](${n})`))}(e)}function fp(e,t){switch(e.name){case"augments":case"extends":case"param":case"template":{const n=gp(e.text,t).split(/^(\S+)\s*-?\s*/);if(3===n?.length){const t=n[1],r=n[2],i=`*@${e.name}* \`${t}\``;return r?i+(r.match(/\r\n|\n/g)?" \n"+pp(r):` — ${pp(r)}`):i}}}const n=`*@${e.name}*`,r=function(e,t){if(!e.text)return;function n(e){return/^\s*[~`]{3}/m.test(e)?e:"```\n"+e+"\n```"}const r=gp(e.text,t);switch(e.name){case"example":{const e=r.match(/<caption>(.*?)<\/caption>\s*(\r\n|\n)/);return e&&0===e.index?e[1]+"\n"+n(r.substring(e[0].length)):n(r)}case"author":{const e=r.match(/(.+)\s<([-.\w]+@[-.\w]+)>/);return null===e?r:`${e[1]} ${e[2]}`}case"default":return n(r)}return pp(r)}(e,t);return r?n+(r.match(/\r\n|\n/g)?" \n"+r:` — ${r}`):n}function mp(e,t){return pp(gp(e,t))}function gp(e,t){if(!e)return"";if("string"==typeof e)return e;const n=[];let r;for(const i of e)switch(i.kind){case"link":if(r){if(r.target){const e=t.toResource(r.target.file).with({fragment:`L${r.target.start.line},${r.target.start.offset}`}),i=r.text?r.text:bp(r.name??"");n.push(`[${r.linkcode?"`"+i+"`":i}](${e.toString()})`)}else{const e=r.text??r.name;if(e)if(/^https?:/.test(e)){const t=e.split(" ");if(1===t.length)n.push(t[0]);else if(t.length>1){const e=bp(t.slice(1).join(" "));n.push(`[${r.linkcode?"`"+e+"`":e}](${t[0]})`)}}else n.push(bp(e))}r=void 0}else r={linkcode:"{@linkcode "===i.text};break;case"linkName":r&&(r.name=i.text,r.target=i.target);break;case"linkText":r&&(r.text=i.text);break;default:n.push(i.text)}return pp(n.join(""))}function yp(e,t,n){const r=new dp;return vp(r,e,t,n),r.value?r.toMarkupContent():void 0}function vp(e,t,n,r){if(t&&e.appendMarkdown(mp(t,r)),n){const t=function(e,t){return e.map((e=>fp(e,t))).join(" \n\n")}(n,r);t&&e.appendMarkdown("\n\n"+t)}return e}function bp(e){return e.replace(/`/g,"\\$&")}class Sp{static isSnippetString(e){return e instanceof Sp||!!e&&"string"==typeof e.value}static _escape(e){return e.replace(/\$|}|\\/g,"\\$&")}constructor(e){this._tabstop=1,this.value=e||""}appendText(e){return this.value+=Sp._escape(e),this}appendTabstop(e=this._tabstop++){return this.value+="$",this.value+=e,this}appendPlaceholder(e,t=this._tabstop++){if("function"==typeof e){const t=new Sp;t._tabstop=this._tabstop,e(t),this._tabstop=t._tabstop,e=t.value}else e=Sp._escape(e);return this.value+="${",this.value+=t,this.value+=":",this.value+=e,this.value+="}",this}appendVariable(e,t){if("function"==typeof t){const e=new Sp;e._tabstop=this._tabstop,t(e),this._tabstop=e._tabstop,t=e.value}else"string"==typeof t&&(t=t.replace(/\$|}/g,"\\$&"));return this.value+="${",this.value+=e,t&&(this.value+=":",this.value+=t),this.value+="}",this}}class wp{constructor(){this.store=new Map,this.lastCacheId=0}reset(){this.lastCacheId=0,this.store.clear()}add(e){const t=++this.lastCacheId;return this.store.set(t,e),t}get(e){return this.store.get(e)}}function Rp(e,t,n,r,i,o,s,a,c){const u=t.add({file:n,line:r.line+1,offset:r.character+1,entryNames:[e.source||e.data?{name:e.name,source:e.source,data:e.data}:e.name]}),l={label:e.name,kind:Ep(e.kind),sortText:e.sortText,preselect:e.isRecommended,data:{cacheId:u}};a.completionCommitCharactersSupport&&(l.commitCharacters=function(e){const t=[];switch(e){case xh.memberGetAccessorElement:case xh.memberSetAccessorElement:case xh.constructSignatureElement:case xh.callSignatureElement:case xh.indexSignatureElement:case xh.enumElement:case xh.interfaceElement:t.push(".");break;case xh.moduleElement:case xh.alias:case xh.constElement:case xh.letElement:case xh.variableElement:case xh.localVariableElement:case xh.memberVariableElement:case xh.classElement:case xh.functionElement:case xh.memberFunctionElement:t.push(".",","),t.push("(")}return 0===t.length?void 0:t}(e.kind)),a.completionLabelDetails&&(l.labelDetails=e.labelDetails),e.source&&e.hasAction&&(l.sortText=`${e.sortText}`);const{isSnippet:h,replacementSpan:d,sourceDisplay:p}=e;if(h&&!a.completionSnippets)return null;a.completionSnippets&&(h||Dp(l.kind,s))&&(l.insertTextFormat=be.InsertTextFormat.Snippet),p&&(l.detail=mp(p,o));const{line:f,optionalReplacementRange:m,isMemberCompletion:g,dotAccessorContext:y}=c;let v=function(e,t,n,r,i){if(e)return{replace:Cp(Ad.fromTextSpan(e),r)};if(i.completionInsertReplaceSupport&&t){const e=Cp(t,r);return{insert:be.Range.create(e.start,n),replace:e}}}(d,m,r,i,a),{insertText:b}=e;if(a.completionDisableFilterText||(l.filterText=function(e,t,n,r){if(e.name.startsWith("#")){const i=t?n.charAt(t.start.character):void 0;return r?r.startsWith("this.#")?"#"===i?r:r.replace(/&this\.#/,""):i:"#"===i?void 0:e.name.replace(/^#/,"")}if(r?.startsWith("this."))return;if(r?.startsWith("["))return r.replace(/^\[['"](.+)[['"]\]$/,".$1");return r}(e,m,f,b)),g&&y&&!e.isSnippet){const e=y.text+(b||l.label);a.completionDisableFilterText||(l.filterText=e),v||(v=a.completionInsertReplaceSupport&&m?{insert:y.range,replace:Ad.union(y.range,m)}:{replace:y.range},b=e)}if(e.kindModifiers){const t=new Set(e.kindModifiers.split(/,|\s+/g));if(t.has(Ah.optional)&&(b||(b=l.label),l.filterText||(l.filterText=l.label),l.label+="?"),t.has(Ah.deprecated)&&(l.tags=[be.CompletionItemTag.Deprecated]),e.kind===xh.scriptElement)for(const n of Ah.fileExtensionKindModifiers)if(t.has(n)){e.name.toLowerCase().endsWith(n)?l.detail=e.name:l.detail=e.name+n;break}}return v?l.textEdit=v.insert?be.InsertReplaceEdit.create(b||l.label,v.insert,v.replace):be.TextEdit.replace(v.replace,b||l.label):l.insertText=b,l}function Cp(e,t){return e.start.line!==e.end.line?be.Range.create(e.start,t.getLineEnd(e.start.line)):e}function Ep(e){switch(e){case xh.primitiveType:case xh.keyword:return be.CompletionItemKind.Keyword;case xh.constElement:case xh.letElement:case xh.variableElement:case xh.localVariableElement:case xh.alias:case xh.parameterElement:return be.CompletionItemKind.Variable;case xh.memberVariableElement:case xh.memberGetAccessorElement:case xh.memberSetAccessorElement:return be.CompletionItemKind.Field;case xh.functionElement:case xh.localFunctionElement:return be.CompletionItemKind.Function;case xh.memberFunctionElement:case xh.constructSignatureElement:case xh.callSignatureElement:case xh.indexSignatureElement:return be.CompletionItemKind.Method;case xh.enumElement:return be.CompletionItemKind.Enum;case xh.enumMemberElement:return be.CompletionItemKind.EnumMember;case xh.moduleElement:case xh.externalModuleName:return be.CompletionItemKind.Module;case xh.classElement:case xh.typeElement:return be.CompletionItemKind.Class;case xh.interfaceElement:return be.CompletionItemKind.Interface;case xh.warning:return be.CompletionItemKind.Text;case xh.scriptElement:return be.CompletionItemKind.File;case xh.directory:return be.CompletionItemKind.Folder;case xh.string:return be.CompletionItemKind.Constant}return be.CompletionItemKind.Property}async function _p(e,t,n,r,i,o,s){e.detail=function({displayParts:e,sourceDisplay:t,source:n},r){const i=[],o=t||n;o&&i.push(`Auto import from '${mp(o,r)}'`);const s=mp(e,r);s&&i.push(s);return i.join("\n")}(t,i);const{documentation:a,tags:c}=t;e.documentation=yp(a,c,i);const u=jd(e.data.file);if(t.codeActions?.length&&(e.additionalTextEdits=function(e,t){const n=[];for(const r of e)if(r.changes)for(const e of r.changes)if(e.fileName===t)for(const t of e.textChanges)n.push(Jd(t));return n.length?n:void 0}(t.codeActions,u),e.command=function(e,t){let n=!1;for(const r of e){if(r.commands){n=!0;break}if(r.changes)for(const e of r.changes)if(e.fileName!==t){n=!0;break}}if(n)return{title:"",command:lp.APPLY_COMPLETION_CODE_ACTION,arguments:[t,e.map((e=>({commands:e.commands,description:e.description,changes:e.changes.filter((e=>e.fileName!==t))})))]}}(t.codeActions,e.data.file)),n&&s.completionSnippets&&Dp(e.kind,o)){const{line:i,offset:o}=e.data,s=Id.fromLocation({line:i,offset:o}),a=await async function(e,t,n,r){try{const r=Id.toFileLocationRequestArgs(e,t),i=await n.request(Rh.Quickinfo,r);if("response"===i.type&&i.body)switch(i.body.kind){case"var":case"let":case"const":case"alias":return!1}}catch{}const i=r.getLine(t.line).slice(t.character);return null===i.match(/^[a-z_$0-9]*\s*\(/gi)}(u,s,r,n);a&&function(e,t){const{displayParts:n}=t,r=function(e){const t=[];let n=!1,r=!1,i=0,o=0;e:for(let s=0;s<e.length;++s){const a=e[s];switch(qh(a.kind)){case Oh.methodName:case Oh.functionName:case Oh.text:case Oh.propertyName:0===i&&0===o&&(n=!0);break;case Oh.parameterName:if(1===i&&0===o&&n){const n=e[s+1],i=n&&"?"===n.text,o="this"===a.text;i||o||t.push(a),r=r||i}break;case Oh.punctuation:if("("===a.text)++i;else if(")"===a.text){if(--i,i<=0&&n)break e}else{if("..."===a.text&&1===i){r=!0;break e}"{"===a.text?++o:"}"===a.text&&--o}}}return{hasOptionalParameters:r,parts:t}}(n),i=new Sp;i.appendText(`${e.insertText||e.textEdit?.newText||e.label}(`),function(e,t,n){for(let r=0;r<t.length;++r){const i=t[r];e.appendPlaceholder(i.text),r!==t.length-1&&e.appendText(n)}}(i,r.parts,", "),r.hasOptionalParameters&&i.appendTabstop();i.appendText(")"),i.appendTabstop(0),e.insertText=i.value,e.insertTextFormat=be.InsertTextFormat.Snippet,e.textEdit&&(e.textEdit.newText=i.value)}(e,t)}return e}function Dp(e,t){return!0===t.completeFunctionCalls&&(e===be.CompletionItemKind.Function||e===be.CompletionItemKind.Method)}function Tp(e){switch(e){case"@":case"#":case" ":case".":case'"':case"'":case"`":case"/":case"<":return e;default:return}}function xp(e,t,n){const r=e.items.map((e=>function(e,t){const n=e.parameters.map((e=>function(e,t){const{displayParts:n,documentation:r}=e;return{label:mp(n,t),documentation:yp(r,void 0,t)}}(e,t))),r={label:mp(e.prefixDisplayParts,t),documentation:yp(e.documentation,e.tags.filter((e=>"param"!==e.name)),t),parameters:n};return r.label+=n.map((e=>e.label)).join(mp(e.separatorDisplayParts,t)),r.label+=mp(e.suffixDisplayParts,t),r}(e,n)));return{activeSignature:kp(e,r,t),activeParameter:Pp(e),signatures:r}}function kp(e,t,n){if(void 0!==n?.activeSignatureHelp?.activeSignature){const e=n.activeSignatureHelp.signatures[n.activeSignatureHelp.activeSignature];if(e&&n.isRetrigger){const n=t.findIndex((t=>t.label===e.label));if(-1!==n)return n}}return e.selectedItemIndex}function Pp(e){const t=e.items[e.selectedItemIndex];return t?.isVariadic?Math.min(e.argumentIndex,t.parameters.length-1):e.argumentIndex}function Op(e){switch(e.triggerKind){case be.SignatureHelpTriggerKind.TriggerCharacter:return e.triggerCharacter?e.isRetrigger?{kind:"retrigger",triggerCharacter:e.triggerCharacter}:{kind:"characterTyped",triggerCharacter:e.triggerCharacter}:{kind:"invoked"};case be.SignatureHelpTriggerKind.ContentChange:return e.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case be.SignatureHelpTriggerKind.Invoked:default:return{kind:"invoked"}}}function Np(e,t){return be.CodeAction.create(e.description,be.Command.create(e.description,lp.SELECT_REFACTORING,e,t),be.CodeActionKind.Refactor)}function Ap(e,t,n){const r=be.CodeAction.create(e.description,function(e){if(e.name.startsWith("function_"))return`${be.CodeActionKind.RefactorExtract}.function`;if(e.name.startsWith("constant_"))return`${be.CodeActionKind.RefactorExtract}.constant`;if(e.name.startsWith("Move"))return`${be.CodeActionKind.Refactor}.move`;return be.CodeActionKind.Refactor}(t));return e.notApplicableReason?r.disabled={reason:e.notApplicableReason}:r.command=be.Command.create(e.description,lp.APPLY_REFACTORING,{...n,refactor:t.name,action:e.name}),r}class Ip{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||""===this.value||e.value.startsWith(this.value+Ip.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Ip(this.value+Ip.sep+e)}}Ip.sep=".",Ip.Empty=new Ip(be.CodeActionKind.Empty),Ip.QuickFix=new Ip(be.CodeActionKind.QuickFix),Ip.Refactor=new Ip(be.CodeActionKind.Refactor),Ip.Source=new Ip(be.CodeActionKind.Source),Ip.SourceAddMissingImportsTs=Ip.Source.append("addMissingImports").append("ts"),Ip.SourceFixAll=new Ip(be.CodeActionKind.SourceFixAll),Ip.SourceFixAllTs=Ip.SourceFixAll.append("ts"),Ip.SourceOrganizeImports=new Ip(be.CodeActionKind.SourceOrganizeImports),Ip.SourceOrganizeImportsTs=Ip.SourceOrganizeImports.append("ts"),Ip.SourceRemoveUnusedImportsTs=Ip.Source.append("removeUnusedImports").append("ts"),Ip.SourceRemoveUnusedTs=Ip.Source.append("removeUnused").append("ts"),Ip.SourceSortImportsTs=Ip.Source.append("sortImports").append("ts");const qp=[{title:"Organize Imports",kind:Ip.SourceOrganizeImportsTs,mode:Nh.All},{minVersion:Sh.v430,title:"Sort Imports",kind:Ip.SourceSortImportsTs,mode:Nh.SortAndCombine},{minVersion:Sh.v490,title:"Remove Unused Imports",kind:Ip.SourceRemoveUnusedImportsTs,mode:Nh.RemoveUnused}];function Mp(e,t,n){return t&&0!==t.body.length?[be.CodeAction.create(e.title,{documentChanges:t.body.map((e=>Xd(e,n)))},e.kind.value)]:[]}function Fp(e,t){return Lp(e,t,{start:Ad.fromTextSpan(e.spans[0]).start,end:Ad.fromTextSpan(e.spans[e.spans.length-1]).end})}function Lp(e,t,n){let r=$p(e);for(const i of e.spans){const o=Ad.fromTextSpan(i);if(!Ad.intersection(n,o))continue;const s=[];if(e.childItems)for(const t of e.childItems)if(t.spans.some((e=>!!Ad.intersection(o,Ad.fromTextSpan(e))))){const e=Lp(t,s,o);r=r||e}let a=o;if(e.nameSpan){const t=Ad.fromTextSpan(e.nameSpan);Ad.intersection(o,t)&&(a=t)}r&&t.push({name:e.text,detail:"",kind:Ud(e.kind),range:o,selectionRange:a,children:s})}return r}function jp(e,t,n,r){let i=$p(t);const o=t.text;for(const s of t.spans){const a=Ad.fromTextSpan(s),c=[];if(t.childItems)for(const n of t.childItems)if(n.spans.some((e=>!!Ad.intersection(a,Ad.fromTextSpan(e))))){const t=jp(e,n,c,o);i=i||t}i&&(n.push({name:o,kind:Ud(t.kind),location:{uri:e,range:a},containerName:r}),n.push(...c))}return i}function $p(e){return e.kind!==xh.alias&&!(!e.text||"<function>"===e.text||"<class>"===e.text)}function Hp(e,t,n){const r=function(e){return e.kind===xh.scriptElement||e.kind===xh.moduleElement&&1===e.selectionSpan.start.line&&1===e.selectionSpan.start.offset}(e),i=r?b.basename(e.file):e.name,o=r?n?b.relative(n,b.dirname(e.file)):b.dirname(e.file):e.containerName??"",s={kind:Wp(e.kind),name:i,detail:o,uri:Ld(e.file,t),range:Ad.fromTextSpan(e.span),selectionRange:Ad.fromTextSpan(e.selectionSpan)},a=e.kindModifiers?function(e){return new Set(e.split(/,|\s+/g))}(e.kindModifiers):void 0;return a?.has(kh.deprecatedModifier)&&(s.tags=[be.SymbolTag.Deprecated]),s}function Wp(e){switch(e){case xh.moduleElement:return be.SymbolKind.Module;case xh.classElement:return be.SymbolKind.Class;case xh.enumElement:return be.SymbolKind.Enum;case xh.enumMemberElement:return be.SymbolKind.EnumMember;case xh.interfaceElement:return be.SymbolKind.Interface;case xh.indexSignatureElement:case xh.callSignatureElement:case xh.memberFunctionElement:return be.SymbolKind.Method;case xh.memberVariableElement:case xh.memberGetAccessorElement:case xh.memberSetAccessorElement:return be.SymbolKind.Property;case xh.variableElement:case xh.letElement:case xh.constElement:case xh.localVariableElement:case xh.alias:return be.SymbolKind.Variable;case xh.functionElement:case xh.localFunctionElement:return be.SymbolKind.Function;case xh.constructSignatureElement:case xh.constructorImplementationElement:return be.SymbolKind.Constructor;case xh.typeParameterElement:return be.SymbolKind.TypeParameter;case xh.string:return be.SymbolKind.String;default:return be.SymbolKind.Variable}}const Vp=new Set([6196,6133]),Up=new Set([7027]),Kp=new Set([2420]),Gp=new Set([2552,2304]),zp=new Set([1308]);async function Bp(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...Ad.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(Rh.GetCodeFixes,e);if("response"!==c.type||!c.body?.length)continue;const u=c.body?.find((e=>e.fixName===a));if(!u)continue;if(!u.fixId)return o.push(...u.changes.map((e=>Xd(e,r)))),o;const l={scope:{type:"file",args:{file:n}},fixId:u.fixId},h=await t.request(Rh.GetCombinedCodeFix,l);return"response"===h.type&&h.body?(o.push(...h.body.changes.map((e=>Xd(e,r)))),o):o}return o}class Jp{}class Xp extends Jp{constructor(){super(...arguments),this.title="Fix all"}async build(e,t,n,r){const i=[];return i.push(...await async function(e,t,n,r,i){const o=[];for(const s of i)for(const{codes:i,fixName:a}of e){if(!i.has(s.code))continue;const e={...Ad.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(Rh.GetCodeFixes,e);if("response"!==c.type)continue;const u=c.body?.find((e=>e.fixName===a));if(u){o.push(...u.changes.map((e=>Xd(e,r))));break}}return o}([{codes:Kp,fixName:"fixClassIncorrectlyImplementsInterface"},{codes:zp,fixName:"fixAwaitInSyncFunction"}],e,t,n,r)),i.push(...await Bp([{codes:Up,fixName:"fixUnreachableCode"}],e,t,n,r)),i.length?be.CodeAction.create(this.title,{documentChanges:i},Xp.kind.value):null}}Xp.kind=Ip.SourceFixAllTs;class Yp extends Jp{constructor(){super(...arguments),this.title="Remove all unused code"}async build(e,t,n,r){const i=await Bp([{codes:Vp,fixName:"unusedIdentifier"}],e,t,n,r);return i.length?be.CodeAction.create(this.title,{documentChanges:i},Yp.kind.value):null}}Yp.kind=Ip.SourceRemoveUnusedTs;class Qp extends Jp{constructor(){super(...arguments),this.title="Add all missing imports"}async build(e,t,n,r){const i=await Bp([{codes:Gp,fixName:"import"}],e,t,n,r);return i.length?be.CodeAction.create(this.title,{documentChanges:i},Qp.kind.value):null}}Qp.kind=Ip.SourceAddMissingImportsTs;class Zp{static get kinds(){return Zp.kindProviders.map((e=>e.kind))}constructor(e){this.client=e}async provideCodeActions(e,t,n,r){const i=[];for(const o of Zp.kindProviders)e.some((e=>e.contains(o.kind)))&&i.push((new o).build(this.client,t,r,n));return(await Promise.all(i)).flatMap((e=>e||[]))}}Zp.kindProviders=[Xp,Yp,Qp];class ef{static async provideInlayHints(e,t,n,r,i,o,s){if(r.apiVersion.lt(ef.minVersion))return i.showErrorMessage("Inlay Hints request failed. Requires TypeScript 4.4+."),[];const a=Fd(e);if(!a)return i.showErrorMessage("Inlay Hints request failed. No resource provided."),[];const c=n.get(a);if(!c)return i.showErrorMessage("Inlay Hints request failed. File not opened in the editor."),[];if(!function(e,t){const n=e.getPreferences(t);return"literals"===n.includeInlayParameterNameHints||"all"===n.includeInlayParameterNameHints||n.includeInlayEnumMemberValueHints||n.includeInlayFunctionLikeReturnTypeHints||n.includeInlayFunctionParameterTypeHints||n.includeInlayPropertyDeclarationTypeHints||n.includeInlayVariableTypeHints}(o,a))return[];await o.configureGloballyFromDocument(a);const u=c.offsetAt(t.start),l=c.offsetAt(t.end)-u,h=await r.request(Rh.ProvideInlayHints,{file:a,start:u,length:l},s);return"response"===h.type&&h.success&&h.body?h.body.map((e=>{const t=be.InlayHint.create(Id.fromLocation(e.position),ef.convertInlayHintText(e,n),function(e){switch(e){case"Parameter":return be.InlayHintKind.Parameter;case"Type":return be.InlayHintKind.Type;default:return}}(e.kind));return e.whitespaceBefore&&(t.paddingLeft=!0),e.whitespaceAfter&&(t.paddingRight=!0),t})):[]}static convertInlayHintText(e,t){return e.displayParts?e.displayParts.map((e=>{const n=be.InlayHintLabelPart.create(e.text);return e.span&&(n.location=qd.fromTextSpan(t.toResource(e.span.file).toString(),e.span)),n})):e.text}}var tf;function nf(e,t){const n=[];let r=0,i=0;for(let o=0;o<t.length;o+=3){const s=t[o],a=t[o+1],c=t[o+2],u=c&tf.modifierMask,l=(c>>tf.typeOffset)-1,{line:h,character:d}=e.positionAt(s),p=h-r,f=r===h?d-i:d;n.push(p,f,a,l,u),i=d,r=h}return n}ef.minVersion=Sh.v440,function(e){e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask"}(tf||(tf={}));class rf{constructor(e){this.rootPath=e}getNewLogDirectory(){const t=this.logDirectory();if(t)try{return e.mkdtempSync(b.join(t,"tsserver-log-"))}catch(e){return}}logDirectory(){if(this.rootPath)try{return e.existsSync(this.rootPath)||e.mkdirSync(this.rootPath),this.rootPath}catch{return}}}var of={},sf={};Object.defineProperty(sf,"__esModule",{value:!0}),sf.sync=sf.isexe=void 0;const af=c,cf=x;sf.isexe=async(e,t={})=>{const{ignoreErrors:n=!1}=t;try{return uf(await(0,cf.stat)(e),t)}catch(e){const t=e;if(n||"EACCES"===t.code)return!1;throw t}};sf.sync=(e,t={})=>{const{ignoreErrors:n=!1}=t;try{return uf((0,af.statSync)(e),t)}catch(e){const t=e;if(n||"EACCES"===t.code)return!1;throw t}};const uf=(e,t)=>e.isFile()&&lf(e,t),lf=(e,t)=>{const n=t.uid??process.getuid?.(),r=t.groups??process.getgroups?.()??[],i=t.gid??process.getgid?.()??r[0];if(void 0===n||void 0===i)throw new Error("cannot get uid or gid");const o=new Set([i,...r]),s=e.mode,a=e.uid,c=e.gid,u=parseInt("100",8),l=parseInt("010",8),h=u|l;return!!(s&parseInt("001",8)||s&l&&o.has(c)||s&u&&a===n||s&h&&0===n)};var hf={};Object.defineProperty(hf,"__esModule",{value:!0}),hf.sync=hf.isexe=void 0;const df=c,pf=x;hf.isexe=async(e,t={})=>{const{ignoreErrors:n=!1}=t;try{return ff(await(0,pf.stat)(e),e,t)}catch(e){const t=e;if(n||"EACCES"===t.code)return!1;throw t}};hf.sync=(e,t={})=>{const{ignoreErrors:n=!1}=t;try{return ff((0,df.statSync)(e),e,t)}catch(e){const t=e;if(n||"EACCES"===t.code)return!1;throw t}};const ff=(e,t,n)=>e.isFile()&&((e,t)=>{const{pathExt:n=process.env.PATHEXT||""}=t,r=n.split(";");if(-1!==r.indexOf(""))return!0;for(let t=0;t<r.length;t++){const n=r[t].toLowerCase(),i=e.substring(e.length-n.length).toLowerCase();if(n&&i===n)return!0}return!1})(t,n);var mf={};Object.defineProperty(mf,"__esModule",{value:!0}),function(e){var t=O&&O.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=O&&O.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=O&&O.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r},i=O&&O.__exportStar||function(e,n){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(n,r)||t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.sync=e.isexe=e.posix=e.win32=void 0;const o=r(sf);e.posix=o;const s=r(hf);e.win32=s,i(mf,e);const a="win32"===(process.env._ISEXE_TEST_PLATFORM_||process.platform)?s:o;e.isexe=a.isexe,e.sync=a.sync}(of);const{isexe:gf,sync:yf}=of,{join:vf,delimiter:bf,sep:Sf,posix:wf}=a,Rf="win32"===process.platform,Cf=new RegExp(`[${wf.sep}${Sf===wf.sep?"":Sf}]`.replace(/(\\)/g,"\\$1")),Ef=new RegExp(`^\\.${Cf.source}`),_f=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Df=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=bf})=>{const i=e.match(Cf)?[""]:[...Rf?[process.cwd()]:[],...(t||"").split(r)];if(Rf){const t=n||[".EXE",".CMD",".BAT",".COM"].join(r),o=t.split(r).flatMap((e=>[e,e.toLowerCase()]));return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t}}return{pathEnv:i,pathExt:[""]}},Tf=(e,t)=>{const n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&Ef.test(t)?t.slice(0,2):"")+vf(n,t)},xf=async(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=Df(e,t),o=[];for(const s of n){const n=Tf(s,e);for(const e of r){const r=n+e;if(await gf(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw _f(e)};var kf=xf;xf.sync=(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=Df(e,t),o=[];for(const s of n){const n=Tf(s,e);for(const e of r){const r=n+e;if(yf(r,{pathExt:i,ignoreErrors:!0})){if(!t.all)return r;o.push(r)}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw _f(e)};const Pf=N(kf),Of={directory:"isDirectory",file:"isFile"};const Nf=(e,t)=>t[Of[e]](),Af=e=>e instanceof URL?k(e):e;function If(t,{cwd:n=P.cwd(),type:r="file",allowSymlinks:i=!0}={}){!function(e){if(!Object.hasOwnProperty.call(Of,e))throw new Error(`Invalid type specified: ${e}`)}(r),n=Af(n);const o=i?e.statSync:e.lstatSync;for(const e of t)try{const t=o(b.resolve(n,e),{throwIfNoEntry:!1});if(!t)continue;if(Nf(r,t))return e}catch{}}const qf=e=>e instanceof URL?k(e):e,Mf=Symbol("findUpStop");function Ff(e,t={}){const n=function(e,t={}){let n=b.resolve(qf(t.cwd)||"");const{root:r}=b.parse(n),i=t.stopAt||r,o=t.limit||Number.POSITIVE_INFINITY,s=[e].flat(),a=t=>{if("function"!=typeof e)return If(s,t);const n=e(t.cwd);return"string"==typeof n?If([n],t):n},c=[];for(;;){const e=a({...t,cwd:n});if(e===Mf)break;if(e&&c.push(b.resolve(n,e)),n===i||c.length>=o)break;n=b.dirname(n)}return c}(e,{...t,limit:1});return n[0]}function Lf(e,t){if(n(e).isDirectory()){const n=t.map((t=>S(e,t))).find(r);if(n)return n}const i=S(e,"..");if(i!==e)return Lf(i,t)}class jf{constructor(e,t,n){this.source=e,this.path=t,this.logger=n,this._api=null}get tsServerPath(){return this.path}get isValid(){return null!==this.version}get version(){return this._api||(this._api=this.getTypeScriptVersion(this.tsServerPath)),this._api}get versionString(){const e=this.version;return e?e.displayName:null}getTypeScriptVersion(t){if(this.logger.log(`Resolving TypeScript version from path "${t}"...`),!e.existsSync(t))return this.logger.log("Server path does not exist on disk"),null;const n=t.split(b.sep);if(n.length<=2)return this.logger.log("Server path is invalid (has less than two path components)."),null;const r=n.slice(0,-2).join(b.sep);let i=b.join(r,"package.json");if(e.existsSync(i)||"built"===b.basename(r)&&(i=b.join(r,"..","package.json")),!e.existsSync(i))return this.logger.log(`Failed to find package.json at path "${i}"`),null;this.logger.log(`Reading version from package.json at "${i}"`);const o=e.readFileSync(i).toString();let s=null;try{s=JSON.parse(o)}catch(e){return this.logger.log("Failed parsing contents of package.json."),null}return s?.version?(this.logger.log(`Resolved TypeScript version to "${s.version}"`),Sh.fromVersionString(s.version)):(this.logger.log("Failed reading version number from package.json."),null)}}const $f=["node_modules/typescript/lib",".vscode/pnpify/typescript/lib",".yarn/sdks/typescript/lib"];class Hf{constructor(e,t){this.userTsserverPath=e,this.logger=t}getUserSettingVersion(){if(!this.userTsserverPath)return null;this.logger.log(`Resolving user-provided tsserver path "${this.userTsserverPath}"...`);let t=this.userTsserverPath;if(!b.isAbsolute(t)){const e=Pf.sync(t,{nothrow:!0});e&&(t=e),this.logger.log(`Non-absolute tsserver path resolved to "${e?t:"<failed>"}"`)}let n=e.lstatSync(t,{throwIfNoEntry:!1});if(n?.isSymbolicLink()&&(t=e.realpathSync(t),this.logger.log(`Symbolic link tsserver path resolved to "${t}"`)),n=e.lstatSync(t,{throwIfNoEntry:!1}),n?.isFile()){if("tsserver.js"===b.basename(t))return this.logger.log(`Resolved tsserver location: ${t}`),new jf("user-setting",t,this.logger);t=b.dirname(t),this.logger.log(`Resolved directory path from a file path: ${t}`)}try{const e=function({cwd:e}={}){return Ff("package.json",{cwd:e})}({cwd:t});this.logger.log(`Resolved package.json location: "${e}"`),e&&(t=b.join(b.dirname(e),"lib","tsserver.js"),this.logger.log(`Resolved tsserver location: "${t}"`))}catch{}return new jf("user-setting",t,this.logger)}getWorkspaceVersion(e){for(const t of e){const e=Lf(t,$f);if(e){const t=b.join(e,"tsserver.js"),n=new jf("workspace",t,this.logger);if(n.isValid)return n}}return null}bundledVersion(){const e=T(import.meta.url);try{const t=e.resolve("typescript"),n=b.join(b.dirname(t),"tsserver.js");return new jf("bundled",n,this.logger)}catch(e){return null}}}const Wf=Object.freeze({module:_h.ESNext,moduleResolution:Dh.Node,target:Ph.ES2020,jsx:Eh.React});function Vf(e){const t={...Wf};return e.checkJs&&(t.checkJs=!0),e.experimentalDecorators&&(t.experimentalDecorators=!0),e.strictNullChecks&&(t.strictNullChecks=!0),e.strictFunctionTypes&&(t.strictFunctionTypes=!0),e.module&&(t.module=e.module),e.target&&(t.target=e.target),t.sourceMap=!0,t}var Uf=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===Kf}(e)}(e)};var Kf="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Gf(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Yf((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function zf(e,t,n){return e.concat(t).map((function(e){return Gf(e,n)}))}function Bf(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function Jf(e,t){try{return t in e}catch(e){return!1}}function Xf(e,t,n){var r={};return n.isMergeableObject(e)&&Bf(e).forEach((function(t){r[t]=Gf(e[t],n)})),Bf(t).forEach((function(i){(function(e,t){return Jf(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Jf(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Yf;var n=t.customMerge(e);return"function"==typeof n?n:Yf}(i,n)(e[i],t[i],n):r[i]=Gf(t[i],n))})),r}function Yf(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||zf,n.isMergeableObject=n.isMergeableObject||Uf,n.cloneUnlessOtherwiseSpecified=Gf;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Xf(e,t,n):Gf(t,n)}Yf.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Yf(e,n,t)}),{})};const Qf=N(Yf),Zf={allowIncompleteCompletions:!0,allowRenameOfImportPath:!0,allowTextChangesInNewFiles:!0,autoImportFileExcludePatterns:[],disableLineTextInReferences:!0,disableSuggestions:!1,displayPartsForJSDoc:!0,generateReturnInDocTemplate:!0,importModuleSpecifierEnding:"auto",importModuleSpecifierPreference:"shortest",includeAutomaticOptionalChainCompletions:!0,includeCompletionsForImportStatements:!0,includeCompletionsForModuleExports:!0,includeCompletionsWithClassMemberSnippets:!0,includeCompletionsWithInsertText:!0,includeCompletionsWithObjectLiteralMethodSnippets:!0,includeCompletionsWithSnippetText:!0,includeInlayEnumMemberValueHints:!1,includeInlayFunctionLikeReturnTypeHints:!1,includeInlayFunctionParameterTypeHints:!1,includeInlayParameterNameHints:"none",includeInlayParameterNameHintsWhenArgumentMatchesName:!1,includeInlayPropertyDeclarationTypeHints:!1,includeInlayVariableTypeHints:!1,includeInlayVariableTypeHintsWhenTypeMatchesName:!1,includePackageJsonAutoImports:"auto",interactiveInlayHints:!0,jsxAttributeCompletionStyle:"auto",lazyConfiguredProjectsFromExternalProject:!1,organizeImportsAccentCollation:!0,organizeImportsCaseFirst:!1,organizeImportsCollation:"ordinal",organizeImportsCollationLocale:"en",organizeImportsIgnoreCase:"auto",organizeImportsNumericCollation:!1,providePrefixAndSuffixTextForRename:!0,provideRefactorNotApplicableReason:!0,quotePreference:"auto",useLabelDetailsInCompletionEntries:!0},em={implicitProjectConfiguration:{checkJs:!1,experimentalDecorators:!1,module:_h.ESNext,strictFunctionTypes:!0,strictNullChecks:!0,target:Ph.ES2020}};class tm{constructor(e){this.documents=e,this.tsPreferences=Qf({},Zf),this.workspaceConfiguration=Qf({},em),this.tspClient=null}mergeTsPreferences(e){this.tsPreferences=Qf(this.tsPreferences,e)}setWorkspaceConfiguration(e){this.workspaceConfiguration=Qf(em,e)}setAndConfigureTspClient(e,t,n){this.tspClient=t;const r={...n?{hostInfo:n}:{},formatOptions:{newLineCharacter:"\n"},preferences:{...this.tsPreferences,autoImportFileExcludePatterns:this.getAutoImportFileExcludePatternsPreference(e)}};t.request(Rh.Configure,r)}async configureGloballyFromDocument(e,t){const n={formatOptions:this.getFormattingOptions(e,t),preferences:this.getPreferences(e)};await(this.tspClient?.request(Rh.Configure,n))}getPreferences(e){if(this.tspClient?.apiVersion.lt(Sh.v290))return{};const t=this.getWorkspacePreferencesForFile(e),n=Object.assign({},this.tsPreferences,t?.inlayHints||{});return{...n,quotePreference:this.getQuoteStylePreference(n)}}getFormattingOptions(e,t){const n=this.getWorkspacePreferencesForFile(e),r={...n?.format,...t};return void 0===r.convertTabsToSpaces&&(r.convertTabsToSpaces=t?.insertSpaces),void 0===r.indentSize&&(r.indentSize=t?.tabSize),r}getQuoteStylePreference(e){switch(e.quotePreference){case"single":return"single";case"double":return"double";default:return this.tspClient?.apiVersion.gte(Sh.v333)?"auto":void 0}}getWorkspacePreferencesForFile(e){const t=this.documents.get(e),n=t?.languageId.startsWith("typescript")?"typescript":"javascript";return this.workspaceConfiguration[n]||{}}getAutoImportFileExcludePatternsPreference(e){if(e&&0!==this.tsPreferences.autoImportFileExcludePatterns.length)return this.tsPreferences.autoImportFileExcludePatterns.map((t=>{const n=t.replace(/\\/g,"/"),r=/^\.\.?($|\/)/.test(n);return b.posix.isAbsolute(t)?t:t.startsWith("*")?`/${n}`:r?b.posix.join(e,t):`/**/${n}`}))}}class nm{constructor(e){this.options=e,this._tspClient=null,this.hasShutDown=!1,this.initializeParams=null,this.completionDataCache=new wp,this.typeScriptAutoFixProvider=null,this.features={},this.documents=new cp,this.pendingDebouncedRequest=!1,this.doRequestDiagnosticsDebounced=Kc((()=>this.doRequestDiagnostics()),200),this.configurationManager=new tm(this.documents),this.logger=new Ao(e.logger,"[lspserver]")}closeAll(){for(const e of[...this.documents.files])this.closeDocument(e)}shutdown(){this._tspClient&&(this._tspClient.shutdown(),this._tspClient=null,this.hasShutDown=!0)}get tspClient(){if(!this._tspClient)throw new Error('TS client not created. Did you forget to send the "initialize" request?');return this._tspClient}async initialize(e){if(this.logger.log("initialize",e),this._tspClient)throw new Error('The "initialize" request has already called before.');this.initializeParams=e;const t=this.initializeParams.capabilities;this.workspaceRoot=this.initializeParams.rootUri?Fd(this.initializeParams.rootUri):this.initializeParams.rootPath||void 0;const n=this.initializeParams.initializationOptions||{},{disableAutomaticTypingAcquisition:r,hostInfo:i,maxTsServerMemory:o,npmLocation:s,locale:a,tsserver:c}=n,{plugins:u}={plugins:n.plugins||[]},l=[],h=[];for(const e of u)l.push(e.name),h.push(e.location);const d=this.findTypescriptVersion(c?.path);if(!d)throw Error('Could not find a valid TypeScript installation. Please ensure that the "typescript" dependency is installed in the workspace or that a valid `tsserver.path` is specified. Exiting.');this.options.lspClient.logMessage({type:be.MessageType.Info,message:`Using Typescript version (${d.source}) ${d.versionString} from path "${d.tsServerPath}"`}),this.configurationManager.mergeTsPreferences(n.preferences||{}),this.features.completionDisableFilterText=n.completionDisableFilterText??!1;const{textDocument:p}=t;if(p){const{codeAction:e,completion:t,definition:n,publishDiagnostics:r}=p;if(e&&(this.features.codeActionDisabledSupport=e.disabledSupport),t){const{completionItem:e}=t;if(e){const{commitCharactersSupport:t,insertReplaceSupport:n,labelDetailsSupport:r,snippetSupport:i}=e;this.features.completionCommitCharactersSupport=t,this.features.completionInsertReplaceSupport=n,this.features.completionSnippets=i,this.features.completionLabelDetails=this.configurationManager.tsPreferences.useLabelDetailsInCompletionEntries&&r&&d.version?.gte(Sh.v470)}}n&&(this.features.definitionLinkSupport=n.linkSupport&&d.version?.gte(Sh.v270)),r&&(this.features.diagnosticsTagSupport=Boolean(r.tagSupport))}this.configurationManager.mergeTsPreferences({useLabelDetailsInCompletionEntries:this.features.completionLabelDetails});const f=c?.logVerbosity&&Rd.fromString(c?.logVerbosity);this._tspClient=new Pd({lspClient:this.options.lspClient,trace:Cd.fromString(c?.trace||"off"),typescriptVersion:d,logDirectoryProvider:new rf(this.getLogDirectoryPath(n)),logVerbosity:f??this.options.tsserverLogVerbosity,disableAutomaticTypingAcquisition:r,maxTsServerMemory:o,npmLocation:s,locale:a,globalPlugins:l,pluginProbeLocations:h,logger:this.options.logger,onEvent:this.onTsEvent.bind(this),onExit:(e,t)=>{if(this.shutdown(),e)throw new Error(`tsserver process has exited (exit code: ${e}, signal: ${t}). Stopping the server.`)},useSyntaxServer:Dd(n.tsserver?.useSyntaxServer)}),this.diagnosticQueue=new ep((e=>this.options.lspClient.publishDiagnostics(e)),this.documents,this.features,this.logger,this._tspClient);if(!this.tspClient.start())throw new Error("tsserver process has failed to start.");process.on("exit",(()=>{this.shutdown()})),process.on("SIGINT",(()=>{process.exit()})),this.typeScriptAutoFixProvider=new Zp(this.tspClient),this.configurationManager.setAndConfigureTspClient(this.workspaceRoot,this._tspClient,i),this.setCompilerOptionsForInferredProjects();const m=p?.rename?.prepareSupport&&this.tspClient.apiVersion.gte(Sh.v310),g={capabilities:{textDocumentSync:be.TextDocumentSyncKind.Incremental,completionProvider:{triggerCharacters:[".",'"',"'","/","@","<"],resolveProvider:!0},codeActionProvider:!t.textDocument?.codeAction?.codeActionLiteralSupport||{codeActionKinds:[...Zp.kinds.map((e=>e.value)),Ip.SourceOrganizeImportsTs.value,Ip.SourceRemoveUnusedImportsTs.value,Ip.SourceSortImportsTs.value,Ip.QuickFix.value,Ip.Refactor.value]},definitionProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,documentHighlightProvider:!0,documentSymbolProvider:!0,executeCommandProvider:{commands:[lp.APPLY_WORKSPACE_EDIT,lp.APPLY_CODE_ACTION,lp.APPLY_REFACTORING,lp.CONFIGURE_PLUGIN,lp.ORGANIZE_IMPORTS,lp.APPLY_RENAME_FILE,lp.SOURCE_DEFINITION]},hoverProvider:!0,inlayHintProvider:!0,linkedEditingRangeProvider:!1,renameProvider:!m||{prepareProvider:!0},referencesProvider:!0,selectionRangeProvider:!0,signatureHelpProvider:{triggerCharacters:["(",",","<"],retriggerCharacters:[")"]},workspaceSymbolProvider:!0,implementationProvider:!0,typeDefinitionProvider:!0,foldingRangeProvider:!0,semanticTokensProvider:{documentSelector:null,legend:{tokenTypes:["class","enum","interface","namespace","typeParameter","type","parameter","variable","enumMember","property","function","member"],tokenModifiers:["declaration","static","async","readonly","defaultLibrary","local"]},full:!0,range:!0},workspace:{fileOperations:{willRename:{filters:[{scheme:"file",pattern:{glob:"**/*.{ts,js,jsx,tsx,mjs,mts,cjs,cts}",matches:"file"}}]}}}}};return p?.callHierarchy&&d.version?.gte(Sh.v380)&&(g.capabilities.callHierarchyProvider=!0),p?.linkedEditingRange&&d.version?.gte(Sh.v510)&&(g.capabilities.linkedEditingRangeProvider=!0),this.logger.log("onInitialize result",g),g}initialized(e){const{apiVersion:t,typescriptVersionSource:n}=this.tspClient;this.options.lspClient.sendNotification(hp,{version:t.displayName,source:n})}findTypescriptVersion(e){const t=new Hf(e||this.options.tsserverPath,this.logger),n=t.getUserSettingVersion();if(n){if(n.isValid)return n;this.logger.logIgnoringVerbosity(Oo.Warning,`Typescript specified through user setting ignored due to invalid path "${n.path}"`)}if(this.workspaceRoot){const e=t.getWorkspaceVersion([this.workspaceRoot]);if(e)return e}const r=t.bundledVersion();return r?.isValid?r:null}getLogDirectoryPath(e){return e.tsserver?.logDirectory?e.tsserver.logDirectory:this.workspaceRoot?v.join(this.workspaceRoot,".log"):void 0}setCompilerOptionsForInferredProjects(){const e={options:{...Vf(this.configurationManager.workspaceConfiguration.implicitProjectConfiguration),allowJs:!0,allowNonTsExtensions:!0,allowSyntheticDefaultImports:!0,resolveJsonModule:!0}};this.tspClient.executeWithoutWaitingForResponse(Rh.CompilerOptionsForInferredProjects,e)}didChangeConfiguration(e){this.configurationManager.setWorkspaceConfiguration(e.settings||{}),this.setCompilerOptionsForInferredProjects();const t=this.configurationManager.workspaceConfiguration.diagnostics?.ignoredCodes||[];this.diagnosticQueue?.updateIgnoredDiagnosticCodes(t),this.cancelDiagnostics(),this.requestDiagnostics()}interuptDiagnostics(e){if(!this.diagnosticsTokenSource)return e();this.cancelDiagnostics();const t=e();return this.requestDiagnostics(),t}async requestDiagnostics(){this.pendingDebouncedRequest=!0,await this.doRequestDiagnosticsDebounced()}async doRequestDiagnostics(){if(this.cancelDiagnostics(),this.hasShutDown)return;const e=new be.CancellationTokenSource;this.diagnosticsTokenSource=e;const{files:t}=this.documents;try{return await this.tspClient.requestGeterr({delay:0,files:t},this.diagnosticsTokenSource.token)}finally{this.diagnosticsTokenSource===e&&(this.diagnosticsTokenSource=void 0,this.pendingDebouncedRequest=!1)}}cancelDiagnostics(){this.diagnosticsTokenSource&&(this.diagnosticsTokenSource.cancel(),this.diagnosticsTokenSource=void 0)}didOpenTextDocument(e){const t=Fd(e.textDocument.uri);this.logger.log("onDidOpenTextDocument",e,t),t&&(this.documents.open(t,e.textDocument)?(this.tspClient.notify(Rh.Open,{file:t,fileContent:e.textDocument.text,scriptKindName:this.getScriptKindName(e.textDocument.languageId),projectRootPath:this.workspaceRoot}),this.cancelDiagnostics(),this.requestDiagnostics()):(this.logger.log(`Cannot open already opened doc '${e.textDocument.uri}'.`),this.didChangeTextDocument({textDocument:e.textDocument,contentChanges:[{text:e.textDocument.text}]})))}getScriptKindName(e){switch(e){case"typescript":return"TS";case"typescriptreact":return"TSX";case"javascript":return"JS";case"javascriptreact":return"JSX"}}didCloseTextDocument(e){const t=Fd(e.textDocument.uri);this.logger.log("onDidCloseTextDocument",e,t),t&&this.closeDocument(t)}closeDocument(e){const t=this.documents.close(e);t&&(this.tspClient.notify(Rh.Close,{file:e}),this.options.lspClient.publishDiagnostics({uri:t.uri,diagnostics:[]}))}didChangeTextDocument(e){const{textDocument:t}=e,n=Fd(t.uri);if(this.logger.log("onDidChangeTextDocument",e,n),!n)return;const r=this.documents.get(n);if(!r)throw this.logger.error(`Received change on non-opened document ${t.uri}`),new Error(`Received change on non-opened document ${t.uri}`);if(null===t.version)throw new Error(`Received document change event for ${t.uri} without valid version identifier`);for(const i of e.contentChanges){let e=0,o=0,s=0,a=0;if(be.TextDocumentContentChangeEvent.isIncremental(i))e=i.range.start.line+1,o=i.range.start.character+1,s=i.range.end.line+1,a=i.range.end.character+1;else{e=1,o=1;const t=r.positionAt(r.getText().length);s=t.line+1,a=t.character+1}this.tspClient.notify(Rh.Change,{file:n,line:e,offset:o,endLine:s,endOffset:a,insertString:i.text}),r.applyEdit(t.version,i)}this.cancelDiagnostics(),this.requestDiagnostics()}didSaveTextDocument(e){}async definition(e,t){return this.getDefinition({type:this.features.definitionLinkSupport?Rh.DefinitionAndBoundSpan:Rh.Definition,params:e},t)}async implementation(e,t){return this.getSymbolLocations({type:Rh.Implementation,params:e},t)}async typeDefinition(e,t){return this.getSymbolLocations({type:Rh.TypeDefinition,params:e},t)}async getDefinition({type:e,params:t},n){const r=Fd(t.textDocument.uri);if(this.logger.log(e,t,r),r){if(e===Rh.DefinitionAndBoundSpan){const i=Id.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);if("response"!==o.type||!o.body)return;const s=o.body.textSpan?Ad.fromTextSpan(o.body.textSpan):void 0;return o.body.definitions.map((e=>{const t=Wd(e,this.documents),n=e.contextStart&&e.contextEnd?Ad.fromLocations(e.contextStart,e.contextEnd):t.range;return{originSelectionRange:s,targetRange:n,targetUri:t.uri,targetSelectionRange:t.range}}))}return this.getSymbolLocations({type:Rh.Definition,params:t})}}async getSymbolLocations({type:e,params:t},n){const r=Fd(t.textDocument.uri);if(this.logger.log(e,t,r),!r)return[];const i=Id.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);return"response"===o.type&&o.body?o.body.map((e=>Wd(e,this.documents))):void 0}async documentSymbol(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("symbol",e,n),!n)return[];const r=await this.tspClient.request(Rh.NavTree,{file:n},t);if("response"!==r.type||!r.body?.childItems)return[];if(this.supportHierarchicalDocumentSymbol){const e=[];for(const t of r.body.childItems)Fp(t,e);return e}const i=[];for(const t of r.body.childItems)jp(e.textDocument.uri,t,i);return i}get supportHierarchicalDocumentSymbol(){const e=this.initializeParams?.capabilities.textDocument,t=e?.documentSymbol;return!!t&&!!t.hierarchicalDocumentSymbolSupport}async completion(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("completion",e,n),!n)return be.CompletionList.create([]);const r=this.documents.get(n);if(!r)throw new Error(`The document should be opened for completion, file: ${n}`);this.completionDataCache.reset();const i=this.configurationManager.workspaceConfiguration.completions||{},o=await this.interuptDiagnostics((()=>this.tspClient.request(Rh.CompletionInfo,{file:n,line:e.position.line+1,offset:e.position.character+1,triggerCharacter:Tp(e.context?.triggerCharacter),triggerKind:e.context?.triggerKind},t)));if("response"!==o.type||!o.body)return be.CompletionList.create();const{entries:s,isIncomplete:a,optionalReplacementSpan:c,isMemberCompletion:u}=o.body,l=r.getLine(e.position.line);let h;if(u){const t=l.slice(0,e.position.character).match(/\??\.\s*$/)||void 0;if(t){const n=be.Position.create(e.position.line,e.position.character-t[0].length),i=be.Range.create(n,e.position);h={range:i,text:r.getText(i)}}}const d={isMemberCompletion:u,dotAccessorContext:h,line:l,optionalReplacementRange:c?Ad.fromTextSpan(c):void 0},p=function(e,t,n,r,i,o,s,a,c){const u=[];for(const l of e){if("warning"===l.kind)continue;const e=Rp(l,t,n,r,i,o,s,a,c);e&&u.push(e)}return u}(s,this.completionDataCache,n,e.position,r,this.documents,i,this.features,d);return be.CompletionList.create(p,a)}async completionResolve(e,t){this.logger.log("completion/resolve",e),e.data=void 0!==e.data?.cacheId?this.completionDataCache.get(e.data.cacheId):e.data;const n=e.data?.file?this.documents.get(e.data.file):void 0;await this.configurationManager.configureGloballyFromDocument(e.data.file);const r=await this.interuptDiagnostics((()=>this.tspClient.request(Rh.CompletionDetails,e.data,t)));return"response"===r.type&&r.body?.length?_p(e,r.body[0],n,this.tspClient,this.documents,this.configurationManager.workspaceConfiguration.completions||{},this.features):e}async hover(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("hover",e,n),!n)return{contents:[]};const r=await this.interuptDiagnostics((()=>this.getQuickInfo(n,e.position,t)));if(!r?.body)return{contents:[]};const i=new dp,{displayString:o,documentation:s,tags:a}=r.body;return o&&i.appendCodeblock("typescript",o),vp(i,s,a,this.documents),{contents:i.toMarkupContent(),range:Ad.fromTextSpan(r.body)}}async getQuickInfo(e,t,n){const r=await this.tspClient.request(Rh.Quickinfo,{file:e,line:t.line+1,offset:t.character+1},n);if("response"===r.type)return r}async prepareRename(e,t){const n=Fd(e.textDocument.uri);if(!n)return null;const r=await this.tspClient.request(Rh.Rename,Id.toFileLocationRequestArgs(n,e.position),t);if("response"!==r.type||!r.body?.info)return null;const i=r.body.info;if(!i.canRename)throw new Error(i.localizedErrorMessage);return Ad.fromTextSpan(i.triggerSpan)}async rename(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("onRename",e,n),!n)return null;const r=await this.interuptDiagnostics((async()=>(await this.configurationManager.configureGloballyFromDocument(n),await this.tspClient.request(Rh.Rename,Id.toFileLocationRequestArgs(n,e.position),t))));if("response"!==r.type||!r.body?.info.canRename||!r.body?.locs.length)return null;const i={};return r.body.locs.forEach((t=>{const n=Ld(t.file,this.documents),r=i[n]||(i[n]=[]);t.locs.forEach((t=>{r.push({newText:`${t.prefixText||""}${e.newName}${t.suffixText||""}`,range:{start:Id.fromLocation(t.start),end:Id.fromLocation(t.end)}})}))})),{changes:i}}async references(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("onReferences",e,n),!n)return[];const r=await this.tspClient.request(Rh.References,{file:n,line:e.position.line+1,offset:e.position.character+1},t);return"response"===r.type&&r.body?r.body.refs.filter((t=>e.context.includeDeclaration||!t.isDefinition)).map((e=>Wd(e,this.documents))):[]}async documentFormatting(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("documentFormatting",e,n),!n)return[];const r=e.options;await this.configurationManager.configureGloballyFromDocument(n,r);const i=this.documents.get(n);if(!i)throw new Error(`The document should be opened for formatting', file: ${n}`);const o=await this.tspClient.request(Rh.Format,{...Ad.toFormattingRequestArgs(n,i.getFullRange()),options:r},t);return"response"===o.type&&o.body?o.body.map((e=>Jd(e))):[]}async documentRangeFormatting(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("documentRangeFormatting",e,n),!n)return[];const r=e.options;await this.configurationManager.configureGloballyFromDocument(n,r);const i=await this.tspClient.request(Rh.Format,{...Ad.toFormattingRequestArgs(n,e.range),options:r},t);return"response"===i.type&&i.body?i.body.map((e=>Jd(e))):[]}async selectionRanges(e,t){const n=Fd(e.textDocument.uri);if(!n)return null;const r=await this.tspClient.request(Rh.SelectionRange,{file:n,locations:e.positions.map(Id.toLocation)},t);return"response"===r.type&&r.body?r.body.map(Bd):null}async signatureHelp(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("signatureHelp",e,n),!n)return;const r=await this.interuptDiagnostics((()=>this.getSignatureHelp(n,e,t)));return r?.body?xp(r.body,e.context,this.documents):void 0}async getSignatureHelp(e,t,n){const{position:r,context:i}=t,o=await this.tspClient.request(Rh.SignatureHelp,{file:e,line:r.line+1,offset:r.character+1,triggerReason:i?Op(i):void 0},n);if("response"===o.type)return o}async codeAction(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("codeAction",e,n),!n)return[];await this.configurationManager.configureGloballyFromDocument(n);const r=Ad.toFileRangeRequestArgs(n,e.range),i=[],o=e.context.only?.map((e=>new Ip(e)));var s,a;o&&!o.some((e=>e.contains(Ip.QuickFix)))||i.push(...(s=await this.getCodeFixes(r,e.context,t),a=this.documents,s?.body?s.body.map((e=>be.CodeAction.create(e.description,{title:e.description,command:lp.APPLY_WORKSPACE_EDIT,arguments:[{documentChanges:e.changes.map((e=>Xd(e,a)))}]},be.CodeActionKind.QuickFix))):[])),o&&!o.some((e=>e.contains(Ip.Refactor)))||i.push(...function(e,t,n){if(!e?.body)return[];const r=[];for(const i of e.body)if(!1===i.inlineable)r.push(Np(i,t));else{const e=n.codeActionDisabledSupport?i.actions:i.actions.filter((e=>!e.notApplicableReason));for(const n of e)r.push(Ap(n,i,t))}return r}(await this.getRefactors(r,e.context,t),r,this.features));for(const n of o||[])for(const o of qp){if(!n.contains(o.kind)||o.minVersion&&this.tspClient.apiVersion.lt(o.minVersion))continue;let s=o.mode===Nh.SortAndCombine,a=o.mode;if(o.kind.equals(Ip.SourceOrganizeImportsTs)){const t=e.context.diagnostics.some((e=>(e.severity??0)<=2));s=t,a=Nh.SortAndCombine}const c=await this.interuptDiagnostics((()=>this.tspClient.request(Rh.OrganizeImports,{scope:{type:"file",args:r},skipDestructiveCodeActions:s,mode:a},t)));"response"===c.type&&c.body&&i.push(...Mp(o,c,this.documents))}if(o&&!this.pendingDebouncedRequest){const e=this.diagnosticQueue?.getDiagnosticsForFile(n)||[];e.length&&i.push(...await this.typeScriptAutoFixProvider.provideCodeActions(o,n,e,this.documents))}return i}async getCodeFixes(e,t,n){const r=t.diagnostics.map((e=>Number(e.code))),i={...e,errorCodes:r},o=await this.tspClient.request(Rh.GetCodeFixes,i,n);return"response"===o.type?o:void 0}async getRefactors(e,t,n){const r={...e,triggerReason:t.triggerKind===be.CodeActionTriggerKind.Invoked?"invoked":void 0,kind:1===t.only?.length?t.only[0]:void 0},i=await this.tspClient.request(Rh.GetApplicableRefactors,r,n);return"response"===i.type?i:void 0}async executeCommand(e,t,n){if(this.logger.log("executeCommand",e),e.command===lp.APPLY_WORKSPACE_EDIT&&e.arguments){const t=e.arguments[0];await this.options.lspClient.applyWorkspaceEdit({edit:t})}else if(e.command===lp.APPLY_CODE_ACTION&&e.arguments){const n=e.arguments[0];if(!await this.applyFileCodeEdits(n.changes))return;if(n.commands?.length)for(const e of n.commands)await this.tspClient.request(Rh.ApplyCodeActionCommand,{command:e},t)}else if(e.command===lp.APPLY_REFACTORING&&e.arguments){const n=e.arguments[0],r=await this.tspClient.request(Rh.GetEditsForRefactor,n,t);if("response"!==r.type||!r.body)return;const{body:i}=r;if(!i?.edits.length)return;for(const e of i.edits)await Uc.ensureFile(e.fileName);if(!await this.applyFileCodeEdits(i.edits))return;const o=i.renameLocation;o&&await this.options.lspClient.rename({textDocument:{uri:Ld(n.file,this.documents)},position:Id.fromLocation(o)})}else if(e.command===lp.CONFIGURE_PLUGIN&&e.arguments){const[t,n]=e.arguments;this.tspClient.apiVersion.gte(Sh.v314)&&this.tspClient.executeWithoutWaitingForResponse(Rh.ConfigurePlugin,{configuration:n,pluginName:t})}else if(e.command===lp.ORGANIZE_IMPORTS&&e.arguments){const n=e.arguments[0],r=e.arguments[1]||{};await this.configurationManager.configureGloballyFromDocument(n);const i=await this.tspClient.request(Rh.OrganizeImports,{scope:{type:"file",args:{file:n}},skipDestructiveCodeActions:r.skipDestructiveCodeActions},t);if("response"!==i.type||!i.body)return;const{body:o}=i;await this.applyFileCodeEdits(o)}else if(e.command===lp.APPLY_RENAME_FILE&&e.arguments){const{sourceUri:n,targetUri:r}=e.arguments[0];this.applyRenameFile(n,r,t)}else if(e.command===lp.APPLY_COMPLETION_CODE_ACTION&&e.arguments){const[n,r]=e.arguments;for(const e of r){if(await this.applyFileCodeEdits(e.changes),e.commands?.length)for(const n of e.commands)await this.tspClient.request(Rh.ApplyCodeActionCommand,{command:n},t);break}}else{if(e.command===lp.SOURCE_DEFINITION){const[r,i]=e.arguments||[],o=await this.options.lspClient.createProgressReporter(t,n);return up.execute(r,i,this.documents,this.tspClient,this.options.lspClient,o,t)}this.logger.error(`Unknown command ${e.command}.`)}}async applyFileCodeEdits(e){if(!e.length)return!1;const t={};for(const n of e)t[Ld(n.fileName,this.documents)]=n.textChanges.map(Jd);const{applied:n}=await this.options.lspClient.applyWorkspaceEdit({edit:{changes:t}});return n}async willRenameFiles(e,t){const n={};for(const r of e.files){const e=await this.getEditsForFileRename(r.oldUri,r.newUri,t);for(const t of e){const e=Ld(t.fileName,this.documents);(n[e]||(n[e]=[])).push(...t.textChanges.map(Jd))}}return{changes:n}}async applyRenameFile(e,t,n){const r=await this.getEditsForFileRename(e,t,n);this.applyFileCodeEdits(r)}async getEditsForFileRename(e,t,n){const r=Fd(t),i=Fd(e);if(!r||!i)return[];const o=await this.tspClient.request(Rh.GetEditsForFileRename,{oldFilePath:i,newFilePath:r},n);return"response"===o.type&&o.body?o.body:[]}async documentHighlight(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("documentHighlight",e,n),!n)return[];const r=await this.tspClient.request(Rh.DocumentHighlights,{file:n,line:e.position.line+1,offset:e.position.character+1,filesToSearch:[n]},t);if("response"!==r.type||!r.body)return[];const i=[];for(const e of r.body)if(jd(e.file)===n){const t=Yd(e);i.push(...t)}return i}lastFileOrDummy(){return this.documents.files[0]||this.workspaceRoot}async workspaceSymbol(e,t){const n=await this.tspClient.request(Rh.Navto,{file:this.lastFileOrDummy(),searchValue:e.query},t);return"response"===n.type&&n.body?n.body.map((e=>({location:{uri:Ld(e.file,this.documents),range:{start:Id.fromLocation(e.start),end:Id.fromLocation(e.end)}},kind:Ud(e.kind),name:e.name}))):[]}async foldingRanges(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("foldingRanges",e,n),!n)return;const r=this.documents.get(n);if(!r)throw new Error(`The document should be opened for foldingRanges', file: ${n}`);const i=await this.tspClient.request(Rh.GetOutliningSpans,{file:n},t);if("response"!==i.type||!i.body)return;const o=[];for(const e of i.body){const t=this.asFoldingRange(e,r);t&&o.push(t)}return o}asFoldingRange(e,t){const n=Ad.fromTextSpan(e.textSpan),r=this.asFoldingRangeKind(e);if("comment"===e.kind){if(t.getLine(n.start.line).match(/\/\/\s*#endregion/gi))return}return{startLine:n.start.line,endLine:n.end.character>0&&"}"===t.getText(be.Range.create(be.Position.create(n.end.line,n.end.character-1),n.end))?Math.max(n.end.line-1,n.start.line):n.end.line,kind:r}}asFoldingRangeKind(e){switch(e.kind){case"comment":return be.FoldingRangeKind.Comment;case"region":return be.FoldingRangeKind.Region;case"imports":return be.FoldingRangeKind.Imports;default:return}}async onTsEvent(e){if("semanticDiag"===e.event||"syntaxDiag"===e.event||"suggestionDiag"===e.event){const t=e;if(t.body?.diagnostics){const{file:n,diagnostics:r}=t.body;this.diagnosticQueue?.updateDiagnostics(function(e){switch(e.event){case"syntaxDiag":return 0;case"semanticDiag":return 1;case"suggestionDiag":return 2}throw new Error("Unknown dignostics kind")}(e),n,r)}}}async prepareCallHierarchy(e,t){const n=Fd(e.textDocument.uri);if(!n)return null;const r=Id.toFileLocationRequestArgs(n,e.position),i=await this.tspClient.request(Rh.PrepareCallHierarchy,r,t);if("response"!==i.type||!i.body)return null;return(Array.isArray(i.body)?i.body:[i.body]).map((e=>Hp(e,this.documents,this.workspaceRoot)))}async callHierarchyIncomingCalls(e,t){const n=Fd(e.item.uri);if(!n)return null;const r=Id.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(Rh.ProvideCallHierarchyIncomingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{from:Hp(e.from,t,n),fromRanges:e.fromSpans.map(Ad.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async callHierarchyOutgoingCalls(e,t){const n=Fd(e.item.uri);if(!n)return null;const r=Id.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(Rh.ProvideCallHierarchyOutgoingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{to:Hp(e.to,t,n),fromRanges:e.fromSpans.map(Ad.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async inlayHints(e,t){return await ef.provideInlayHints(e.textDocument.uri,e.range,this.documents,this.tspClient,this.options.lspClient,this.configurationManager,t)}async linkedEditingRange(e,t){const n=Fd(e.textDocument.uri);if(!n)return null;const r=Id.toFileLocationRequestArgs(n,e.position),i=await this.tspClient.request(Rh.LinkedEditingRange,r,t);return"response"===i.type&&i.body?{ranges:i.body.ranges.map(Ad.fromTextSpan),wordPattern:i.body.wordPattern}:null}async semanticTokensFull(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("semanticTokensFull",e,n),!n)return{data:[]};const r=this.documents.get(n);if(!r)return{data:[]};const i=r.offsetAt({line:0,character:0}),o=r.offsetAt({line:r.lineCount,character:0});return this.getSemanticTokens(r,n,i,o,t)}async semanticTokensRange(e,t){const n=Fd(e.textDocument.uri);if(this.logger.log("semanticTokensRange",e,n),!n)return{data:[]};const r=this.documents.get(n);if(!r)return{data:[]};const i=r.offsetAt(e.range.start),o=r.offsetAt(e.range.end);return this.getSemanticTokens(r,n,i,o,t)}async getSemanticTokens(e,t,n,r,i){const o=await this.tspClient.request(Rh.EncodedSemanticClassificationsFull,{file:t,start:n,length:r-n,format:"2020"},i);return"response"===o.type&&o.body?.spans?{data:nf(e,o.body.spans)}:{data:[]}}}const rm=Kr(void 0,void 0);class im{constructor(e){this.connection=e}async createProgressReporter(e,t){let n;return n=t&&t.constructor!==rm.constructor?t:t||await this.connection.window.createWorkDoneProgress(),n}async withProgress(e,t){const{message:n,reporter:r}=e;return r.begin(n),t(r).then((e=>(r.done(),e)))}publishDiagnostics(e){this.connection.sendDiagnostics(e)}showErrorMessage(e){this.connection.sendNotification(be.ShowMessageNotification.type,{type:be.MessageType.Error,message:e})}logMessage(e){this.connection.sendNotification(be.LogMessageNotification.type,e)}async applyWorkspaceEdit(e){return this.connection.workspace.applyEdit(e)}async rename(e){return this.connection.sendRequest(wh.type,e)}async sendNotification(e,t){await this.connection.sendNotification(e,t)}}const om=ko.MessageType.Info,{version:sm}=JSON.parse(i(new URL("../package.json",import.meta.url),{encoding:"utf8"})),am=new me("typescript-language-server").version(sm).requiredOption("--stdio","use stdio").option("--log-level <logLevel>","A number indicating the log level (4 = log, 3 = info, 2 = warn, 1 = error). Defaults to `2`.").option("--tsserver-log-verbosity <tsserverLogVerbosity>","[deprecated] Specify a tsserver log verbosity (terse, normal, verbose). Defaults to `normal`. example: --tsserver-log-verbosity verbose").option("--tsserver-path <path>","[deprecated] Specify path to tsserver.js or the lib directory. example: --tsserver-path=/Users/me/typescript/lib/tsserver.js").parse(process.argv).opts();let cm=om;am.logLevel&&(cm=parseInt(am.logLevel,10),cm&&(cm<1||cm>4)&&(console.error(`Invalid '--log-level ${cm}'. Falling back to 'info' level.`),cm=om)),function(e){const t=Po.createConnection(Po.ProposedFeatures.all),n=new im(t),r=new No(n,e.showMessageLevel),i=new nm({logger:r,lspClient:n,tsserverPath:e.cmdLineTsserverPath,tsserverLogVerbosity:e.cmdLineTsserverLogVerbosity});return t.onInitialize(i.initialize.bind(i)),t.onInitialized(i.initialized.bind(i)),t.onDidChangeConfiguration(i.didChangeConfiguration.bind(i)),t.onDidOpenTextDocument(i.didOpenTextDocument.bind(i)),t.onDidSaveTextDocument(i.didSaveTextDocument.bind(i)),t.onDidCloseTextDocument(i.didCloseTextDocument.bind(i)),t.onDidChangeTextDocument(i.didChangeTextDocument.bind(i)),t.onCodeAction(i.codeAction.bind(i)),t.onCompletion(i.completion.bind(i)),t.onCompletionResolve(i.completionResolve.bind(i)),t.onDefinition(i.definition.bind(i)),t.onImplementation(i.implementation.bind(i)),t.onTypeDefinition(i.typeDefinition.bind(i)),t.onDocumentFormatting(i.documentFormatting.bind(i)),t.onDocumentRangeFormatting(i.documentRangeFormatting.bind(i)),t.onDocumentHighlight(i.documentHighlight.bind(i)),t.onDocumentSymbol(i.documentSymbol.bind(i)),t.onExecuteCommand(i.executeCommand.bind(i)),t.onHover(i.hover.bind(i)),t.onReferences(i.references.bind(i)),t.onRenameRequest(i.rename.bind(i)),t.onPrepareRename(i.prepareRename.bind(i)),t.onSelectionRanges(i.selectionRanges.bind(i)),t.onSignatureHelp(i.signatureHelp.bind(i)),t.onWorkspaceSymbol(i.workspaceSymbol.bind(i)),t.onFoldingRanges(i.foldingRanges.bind(i)),t.languages.onLinkedEditingRange(i.linkedEditingRange.bind(i)),t.languages.callHierarchy.onPrepare(i.prepareCallHierarchy.bind(i)),t.languages.callHierarchy.onIncomingCalls(i.callHierarchyIncomingCalls.bind(i)),t.languages.callHierarchy.onOutgoingCalls(i.callHierarchyOutgoingCalls.bind(i)),t.languages.inlayHint.on(i.inlayHints.bind(i)),t.languages.semanticTokens.on(i.semanticTokensFull.bind(i)),t.languages.semanticTokens.onRange(i.semanticTokensRange.bind(i)),t.workspace.onWillRenameFiles(i.willRenameFiles.bind(i)),t}({cmdLineTsserverPath:am.tsserverPath,cmdLineTsserverLogVerbosity:Rd.fromString(am.tsserverLogVerbosity),showMessageLevel:cm}).listen();
|
|
3
3
|
//# sourceMappingURL=cli.mjs.map
|