skynet/nvim/lua/node_modules/typescript-language-server/lib/cli.mjs

4 lines
379 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env node
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*as m from"node:path";import g,{resolve as y}from"node:path";import v from"constants";import b from"stream";import S from"assert";import"node:fs/promises";import w from"node:stream";import{promisify as R}from"node:util";import C from"node:child_process";import{createRequire as E}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];n.push.apply(n,arguments);var r=Function.bind.apply(t,n);return new r}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={},O={get exports(){return P},set exports(e){P=e}},N={},q={};let I=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=I,q.InvalidArgumentError=class extends I{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};const{InvalidArgumentError:A}=q;N.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 A(`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}},N.humanReadableArgName=function(e){const t=e.name()+(!0===e.variadic?"...":"");return e.required?"<"+t+">":"["+t+"]"};var M={},F={};const{humanReadableArgName:L}=N;F.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=>L(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 j={};const{InvalidArgumentError:$}=q;function H(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}}j.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=H(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){return this.implied=Object.assign(this.implied||{},e),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 $(`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}},j.splitOptionFlags=H,j.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 W={};W.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=3;return t.forEach((t=>{if(t.length<=1)return;const n=function(e,t){if(Math.abs(e.length-t.length)>3)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}=N,{CommanderError:X}=q,{Help:Y}=F,{Option:Q,splitOptionFlags:Z,DualOptions:ee}=j,{suggestSimilar:te}=W;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}M.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 Y,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.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 X(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 X(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 X(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}_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 1===e.length&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);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}=N,{Command:r}=M,{CommanderError:i,InvalidArgumentError:o}=q,{Help:s}=F,{Option:a}=j;(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}(O,P);const oe=P,{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,Ce,Ee={},_e={},De={},Te={get exports(){return De},set exports(e){De=e}},ke={},xe={},Pe={},Oe={},Ne={};function qe(){if(Re)return Ne;function e(e){return"string"==typeof e||e instanceof String}function t(e){return Array.isArray(e)}return Re=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(){return Ce||(Ce=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=qe();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)}}(Oe)),Oe}var Ae,Me={};function Fe(){return Ae||(Ae=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))}}}(Me)),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(){return He||(He=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Emitter=e.Event=void 0;const t=Ue();!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(){}}(We)),We}var Ge,ze={};function Be(){return Ge||(Ge=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CancellationTokenSource=e.CancellationToken=void 0;const t=Ue(),n=qe(),r=Ke();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}}}(ze)),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=qe(),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||(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)}}(C=e.MessageStrategy||(e.MessageStrategy={})),(e.ConnectionOptions||(e.ConnectionOptions={})).is=function(e){const t=e;return t&&(R.is(t.cancellationStrategy)||y.is(t.connectionStrategy)||C.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"}(E||(E={})),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=E.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-"+(++k).toString():"res-"+n.toString(),t):e.set("not-"+(++T).toString(),t)}function Q(e){}function Z(){return V===E.Listening}function ee(){return V===E.Closed}function te(){return V===E.Disposed}function ne(){V!==E.New&&V!==E.Listening||(V=E.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;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: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=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 _(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=E.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=E.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=function(){return Le||(Le=1,e=je,Object.defineProperty(e,"__esModule",{value:!0}),e.Disposable=void 0,(e.Disposable||(e.Disposable={})).create=function(e){return{dispose:e}}),je;var e}();Object.defineProperty(e,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=Ke();Object.defineProperty(e,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(e,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const o=Be();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(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 s.SharedArraySenderStrategy}}),Object.defineProperty(e,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return s.SharedArrayReceiverStrategy}});const a=(Qe||(Qe=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ReadableStreamMessageReader=e.AbstractMessageReader=e.MessageReader=void 0;const t=Ue(),n=qe(),r=Ke(),i=tt();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))}}}(Ze)),Ze);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=(nt||(nt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WriteableStreamMessageWriter=e.AbstractMessageWriter=e.MessageWriter=void 0;const t=Ue(),n=qe(),r=tt(),i=Ke();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()}}}(rt)),rt);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=(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 :");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 u.AbstractMessageBuffer}});const l=ut();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=Ue();e.RAL=h.default}(Pe)),Pe}Object.defineProperty(xe,"__esModule",{value:!0});const ht=u,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={})),xe.default=yt,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=xe;r.default.install();const i=s,o=h,a=d,c=p,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 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)}}(ke),Te.exports=ke;var vt,bt,St,wt,Rt,Ct,Et,_t,Dt,Tt,kt,xt,Pt,Ot,Nt,qt,It,At,Mt,Ft,Lt,jt,$t,Ht,Wt,Vt,Ut,Kt,Gt={};!function(e){e.is=function(e){return"string"==typeof e}}(vt||(vt={})),(bt||(bt={})).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}}(St||(St={})),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}}(wt||(wt={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=wt.MAX_VALUE),t===Number.MAX_VALUE&&(t=wt.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.uinteger(t.line)&&Wn.uinteger(t.character)}}(Rt||(Rt={})),function(e){e.create=function(e,t,n,r){if(Wn.uinteger(e)&&Wn.uinteger(t)&&Wn.uinteger(n)&&Wn.uinteger(r))return{start:Rt.create(e,t),end:Rt.create(n,r)};if(Rt.is(e)&&Rt.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 Wn.objectLiteral(t)&&Rt.is(t.start)&&Rt.is(t.end)}}(Ct||(Ct={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Ct.is(t.range)&&(Wn.string(t.uri)||Wn.undefined(t.uri))}}(Et||(Et={})),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 Wn.objectLiteral(t)&&Ct.is(t.targetRange)&&Wn.string(t.targetUri)&&Ct.is(t.targetSelectionRange)&&(Ct.is(t.originSelectionRange)||Wn.undefined(t.originSelectionRange))}}(_t||(_t={})),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 Wn.objectLiteral(t)&&Wn.numberRange(t.red,0,1)&&Wn.numberRange(t.green,0,1)&&Wn.numberRange(t.blue,0,1)&&Wn.numberRange(t.alpha,0,1)}}(Dt||(Dt={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Ct.is(t.range)&&Dt.is(t.color)}}(Tt||(Tt={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.label)&&(Wn.undefined(t.textEdit)||Ft.is(t))&&(Wn.undefined(t.additionalTextEdits)||Wn.typedArray(t.additionalTextEdits,Ft.is))}}(kt||(kt={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(xt||(xt={})),function(e){e.create=function(e,t,n,r,i,o){var s={startLine:e,endLine:t};return Wn.defined(n)&&(s.startCharacter=n),Wn.defined(r)&&(s.endCharacter=r),Wn.defined(i)&&(s.kind=i),Wn.defined(o)&&(s.collapsedText=o),s},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.uinteger(t.startLine)&&Wn.uinteger(t.startLine)&&(Wn.undefined(t.startCharacter)||Wn.uinteger(t.startCharacter))&&(Wn.undefined(t.endCharacter)||Wn.uinteger(t.endCharacter))&&(Wn.undefined(t.kind)||Wn.string(t.kind))}}(Pt||(Pt={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Et.is(t.location)&&Wn.string(t.message)}}(Ot||(Ot={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(Nt||(Nt={})),function(e){e.Unnecessary=1,e.Deprecated=2}(qt||(qt={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&Wn.string(t.href)}}(It||(It={})),function(e){e.create=function(e,t,n,r,i,o){var s={range:e,message:t};return Wn.defined(n)&&(s.severity=n),Wn.defined(r)&&(s.code=r),Wn.defined(i)&&(s.source=i),Wn.defined(o)&&(s.relatedInformation=o),s},e.is=function(e){var t,n=e;return Wn.defined(n)&&Ct.is(n.range)&&Wn.string(n.message)&&(Wn.number(n.severity)||Wn.undefined(n.severity))&&(Wn.integer(n.code)||Wn.string(n.code)||Wn.undefined(n.code))&&(Wn.undefined(n.codeDescription)||Wn.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Wn.string(n.source)||Wn.undefined(n.source))&&(Wn.undefined(n.relatedInformation)||Wn.typedArray(n.relatedInformation,Ot.is))}}(At||(At={})),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 Wn.defined(n)&&n.length>0&&(i.arguments=n),i},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.title)&&Wn.string(t.command)}}(Mt||(Mt={})),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 Wn.objectLiteral(t)&&Wn.string(t.newText)&&Ct.is(t.range)}}(Ft||(Ft={})),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 Wn.objectLiteral(t)&&Wn.string(t.label)&&(Wn.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Wn.string(t.description)||void 0===t.description)}}(Lt||(Lt={})),function(e){e.is=function(e){var t=e;return Wn.string(t)}}(jt||(jt={})),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 Ft.is(t)&&(Lt.is(t.annotationId)||jt.is(t.annotationId))}}($t||($t={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Jt.is(t.textDocument)&&Array.isArray(t.edits)}}(Ht||(Ht={})),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&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Wt||(Wt={})),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&&Wn.string(t.oldUri)&&Wn.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Wn.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Wn.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Vt||(Vt={})),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&&Wn.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Wn.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Wn.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||jt.is(t.annotationId))}}(Ut||(Ut={})),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 Wn.string(e.kind)?Wt.is(e)||Vt.is(e)||Ut.is(e):Ht.is(e)})))}}(Kt||(Kt={}));var zt,Bt,Jt,Xt,Yt,Qt,Zt,en,tn,nn,rn,on,sn,an,cn,un,ln,hn,dn,pn,fn,mn,gn,yn,vn,bn,Sn,wn,Rn,Cn,En,_n,Dn,Tn,kn,xn,Pn,On,Nn,qn,In,An,Mn,Fn,Ln=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=Ft.insert(e,t):jt.is(n)?(i=n,r=$t.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=$t.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=Ft.replace(e,t):jt.is(n)?(i=n,r=$t.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=$t.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=Ft.del(e):jt.is(t)?(r=t,n=$t.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=$t.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}(),jn=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(jt.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}(),$n=function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new jn(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(Ht.is(e)){var n=new Ln(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new Ln(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(Jt.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 Ln(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 Ln(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new jn,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(Lt.is(t)||jt.is(t)?r=t:n=t,void 0===r?i=Wt.create(e,n):(o=jt.is(r)?r:this._changeAnnotations.manage(r),i=Wt.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(Lt.is(n)||jt.is(n)?i=n:r=n,void 0===i?o=Vt.create(e,t,r):(s=jt.is(i)?i:this._changeAnnotations.manage(i),o=Vt.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(Lt.is(t)||jt.is(t)?r=t:n=t,void 0===r?i=Ut.create(e,n):(o=jt.is(r)?r:this._changeAnnotations.manage(r),i=Ut.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 Wn.defined(t)&&Wn.string(t.uri)}}(zt||(zt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&Wn.integer(t.version)}}(Bt||(Bt={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.string(t.uri)&&(null===t.version||Wn.integer(t.version))}}(Jt||(Jt={})),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 Wn.defined(t)&&Wn.string(t.uri)&&Wn.string(t.languageId)&&Wn.integer(t.version)&&Wn.string(t.text)}}(Xt||(Xt={})),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 Wn.objectLiteral(e)&&Yt.is(t.kind)&&Wn.string(t.value)}}(Qt||(Qt={})),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}(Zt||(Zt={})),function(e){e.PlainText=1,e.Snippet=2}(en||(en={})),function(e){e.Deprecated=1}(tn||(tn={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Wn.string(t.newText)&&Ct.is(t.insert)&&Ct.is(t.replace)}}(nn||(nn={})),function(e){e.asIs=1,e.adjustIndentation=2}(rn||(rn={})),function(e){e.is=function(e){var t=e;return t&&(Wn.string(t.detail)||void 0===t.detail)&&(Wn.string(t.description)||void 0===t.description)}}(on||(on={})),function(e){e.create=function(e){return{label:e}}}(sn||(sn={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(an||(an={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Wn.string(t)||Wn.objectLiteral(t)&&Wn.string(t.language)&&Wn.string(t.value)}}(cn||(cn={})),function(e){e.is=function(e){var t=e;return!!t&&Wn.objectLiteral(t)&&(Qt.is(t.contents)||cn.is(t.contents)||Wn.typedArray(t.contents,cn.is))&&(void 0===e.range||Ct.is(e.range))}}(un||(un={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(ln||(ln={})),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 Wn.defined(t)&&(i.documentation=t),Wn.defined(n)?i.parameters=n:i.parameters=[],i}}(hn||(hn={})),function(e){e.Text=1,e.Read=2,e.Write=3}(dn||(dn={})),function(e){e.create=function(e,t){var n={range:e};return Wn.number(t)&&(n.kind=t),n}}(pn||(pn={})),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}(fn||(fn={})),function(e){e.Deprecated=1}(mn||(mn={})),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}}(gn||(gn={})),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}}}}(yn||(yn={})),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&&Wn.string(t.name)&&Wn.number(t.kind)&&Ct.is(t.range)&&Ct.is(t.selectionRange)&&(void 0===t.detail||Wn.string(t.detail))&&(void 0===t.deprecated||Wn.boolean(t.deprecated))&&(void 0===t.children||Array.isArray(t.children))&&(void 0===t.tags||Array.isArray(t.tags))}}(vn||(vn={})),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"}(bn||(bn={})),function(e){e.Invoked=1,e.Automatic=2}(Sn||(Sn={})),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 Wn.defined(t)&&Wn.typedArray(t.diagnostics,At.is)&&(void 0===t.only||Wn.typedArray(t.only,Wn.string))&&(void 0===t.triggerKind||t.triggerKind===Sn.Invoked||t.triggerKind===Sn.Automatic)}}(wn||(wn={})),function(e){e.create=function(e,t,n){var r={title:e},i=!0;return"string"==typeof t?(i=!1,r.kind=t):Mt.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&&Wn.string(t.title)&&(void 0===t.diagnostics||Wn.typedArray(t.diagnostics,At.is))&&(void 0===t.kind||Wn.string(t.kind))&&(void 0!==t.edit||void 0!==t.command)&&(void 0===t.command||Mt.is(t.command))&&(void 0===t.isPreferred||Wn.boolean(t.isPreferred))&&(void 0===t.edit||Kt.is(t.edit))}}(Rn||(Rn={})),function(e){e.create=function(e,t){var n={range:e};return Wn.defined(t)&&(n.data=t),n},e.is=function(e){var t=e;return Wn.defined(t)&&Ct.is(t.range)&&(Wn.undefined(t.command)||Mt.is(t.command))}}(Cn||(Cn={})),function(e){e.create=function(e,t){return{tabSize:e,insertSpaces:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Wn.uinteger(t.tabSize)&&Wn.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 Wn.defined(t)&&Ct.is(t.range)&&(Wn.undefined(t.target)||Wn.string(t.target))}}(_n||(_n={})),function(e){e.create=function(e,t){return{range:e,parent:t}},e.is=function(t){var n=t;return Wn.objectLiteral(n)&&Ct.is(n.range)&&(void 0===n.parent||e.is(n.parent))}}(Dn||(Dn={})),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"}(Tn||(Tn={})),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"}(kn||(kn={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&(void 0===t.resultId||"string"==typeof t.resultId)&&Array.isArray(t.data)&&(0===t.data.length||"number"==typeof t.data[0])}}(xn||(xn={})),function(e){e.create=function(e,t){return{range:e,text:t}},e.is=function(e){var t=e;return null!=t&&Ct.is(t.range)&&Wn.string(t.text)}}(Pn||(Pn={})),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&&Ct.is(t.range)&&Wn.boolean(t.caseSensitiveLookup)&&(Wn.string(t.variableName)||void 0===t.variableName)}}(On||(On={})),function(e){e.create=function(e,t){return{range:e,expression:t}},e.is=function(e){var t=e;return null!=t&&Ct.is(t.range)&&(Wn.string(t.expression)||void 0===t.expression)}}(Nn||(Nn={})),function(e){e.create=function(e,t){return{frameId:e,stoppedLocation:t}},e.is=function(e){var t=e;return Wn.defined(t)&&Ct.is(e.stoppedLocation)}}(qn||(qn={})),function(e){e.Type=1,e.Parameter=2,e.is=function(e){return 1===e||2===e}}(In||(In={})),function(e){e.create=function(e){return{value:e}},e.is=function(e){var t=e;return Wn.objectLiteral(t)&&(void 0===t.tooltip||Wn.string(t.tooltip)||Qt.is(t.tooltip))&&(void 0===t.location||Et.is(t.location))&&(void 0===t.command||Mt.is(t.command))}}(An||(An={})),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 Wn.objectLiteral(t)&&Rt.is(t.position)&&(Wn.string(t.label)||Wn.typedArray(t.label,An.is))&&(void 0===t.kind||In.is(t.kind))&&void 0===t.textEdits||Wn.typedArray(t.textEdits,Ft.is)&&(void 0===t.tooltip||Wn.string(t.tooltip)||Qt.is(t.tooltip))&&(void 0===t.paddingLeft||Wn.boolean(t.paddingLeft))&&(void 0===t.paddingRight||Wn.boolean(t.paddingRight))}}(Mn||(Mn={})),function(e){e.is=function(e){var t=e;return Wn.objectLiteral(t)&&bt.is(t.uri)&&Wn.string(t.name)}}(Fn||(Fn={}));var Hn;!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 Vn(e,t,n,r)},e.is=function(e){var t=e;return!!(Wn.defined(t)&&Wn.string(t.uri)&&(Wn.undefined(t.languageId)||Wn.string(t.languageId))&&Wn.uinteger(t.lineCount)&&Wn.func(t.getText)&&Wn.func(t.positionAt)&&Wn.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}}(Hn||(Hn={}));var Wn,Vn=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 Rt.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 Rt.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)}}(Wn||(Wn={}));const Un=x(Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return $t},get ChangeAnnotation(){return Lt},get ChangeAnnotationIdentifier(){return jt},get CodeAction(){return Rn},get CodeActionContext(){return wn},get CodeActionKind(){return bn},get CodeActionTriggerKind(){return Sn},get CodeDescription(){return It},get CodeLens(){return Cn},get Color(){return Dt},get ColorInformation(){return Tt},get ColorPresentation(){return kt},get Command(){return Mt},get CompletionItem(){return sn},get CompletionItemKind(){return Zt},get CompletionItemLabelDetails(){return on},get CompletionItemTag(){return tn},get CompletionList(){return an},get CreateFile(){return Wt},get DeleteFile(){return Ut},get Diagnostic(){return At},get DiagnosticRelatedInformation(){return Ot},get DiagnosticSeverity(){return Nt},get DiagnosticTag(){return qt},get DocumentHighlight(){return pn},get DocumentHighlightKind(){return dn},get DocumentLink(){return _n},get DocumentSymbol(){return vn},get DocumentUri(){return vt},EOL:["\n","\r\n","\r"],get FoldingRange(){return Pt},get FoldingRangeKind(){return xt},get FormattingOptions(){return En},get Hover(){return un},get InlayHint(){return Mn},get InlayHintKind(){return In},get InlayHintLabelPart(){return An},get InlineValueContext(){return qn},get InlineValueEvaluatableExpression(){return Nn},get InlineValueText(){return Pn},get InlineValueVariableLookup(){return On},get InsertReplaceEdit(){return nn},get InsertTextFormat(){return en},get InsertTextMode(){return rn},get Location(){return Et},get LocationLink(){return _t},get MarkedString(){return cn},get MarkupContent(){return Qt},get MarkupKind(){return Yt},get OptionalVersionedTextDocumentIdentifier(){return Jt},get ParameterInformation(){return ln},get Position(){return Rt},get Range(){return Ct},get RenameFile(){return Vt},get SelectionRange(){return Dn},get SemanticTokenModifiers(){return kn},get SemanticTokenTypes(){return Tn},get SemanticTokens(){return xn},get SignatureInformation(){return hn},get SymbolInformation(){return gn},get SymbolKind(){return fn},get SymbolTag(){return mn},get TextDocument(){return Hn},get TextDocumentEdit(){return Ht},get TextDocumentIdentifier(){return zt},get TextDocumentItem(){return Xt},get TextEdit(){return Ft},get URI(){return bt},get VersionedTextDocumentIdentifier(){return Bt},WorkspaceChange:$n,get WorkspaceEdit(){return Kt},get WorkspaceFolder(){return Fn},get WorkspaceSymbol(){return yn},get integer(){return St},get uinteger(){return wt}},Symbol.toStringTag,{value:"Module"})));var Kn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ProtocolNotificationType=e.ProtocolNotificationType0=e.ProtocolRequestType=e.ProtocolRequestType0=e.RegistrationType=e.MessageDirection=void 0;const t=ke;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)}}}(Kn);var Gn={},zn={};function Bn(e){return"string"==typeof e||e instanceof String}function Jn(e){return Array.isArray(e)}Object.defineProperty(zn,"__esModule",{value:!0}),zn.objectLiteral=zn.typedArray=zn.stringArray=zn.array=zn.func=zn.error=zn.number=zn.string=zn.boolean=void 0,zn.boolean=function(e){return!0===e||!1===e},zn.string=Bn,zn.number=function(e){return"number"==typeof e||e instanceof Number},zn.error=function(e){return e instanceof Error},zn.func=function(e){return"function"==typeof e},zn.array=Jn,zn.stringArray=function(e){return Jn(e)&&e.every((e=>Bn(e)))},zn.typedArray=function(e,t){return Array.isArray(e)&&e.every(t)},zn.objectLiteral=function(e){return null!==e&&"object"==typeof e};var Xn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationRequest=void 0;const t=Kn;var n;(n=e.ImplementationRequest||(e.ImplementationRequest={})).method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Xn);var Yn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeDefinitionRequest=void 0;const t=Kn;var n;(n=e.TypeDefinitionRequest||(e.TypeDefinitionRequest={})).method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(Yn);var Qn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DidChangeWorkspaceFoldersNotification=e.WorkspaceFoldersRequest=void 0;const t=Kn;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)}(Qn);var Zn={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfigurationRequest=void 0;const t=Kn;var n;(n=e.ConfigurationRequest||(e.ConfigurationRequest={})).method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(Zn);var er={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ColorPresentationRequest=e.DocumentColorRequest=void 0;const t=Kn;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)}(er);var tr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FoldingRangeRequest=void 0;const t=Kn;var n;(n=e.FoldingRangeRequest||(e.FoldingRangeRequest={})).method="textDocument/foldingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(tr);var nr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeclarationRequest=void 0;const t=Kn;var n;(n=e.DeclarationRequest||(e.DeclarationRequest={})).method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(nr);var rr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionRangeRequest=void 0;const t=Kn;var n;(n=e.SelectionRangeRequest||(e.SelectionRangeRequest={})).method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(rr);var ir={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.WorkDoneProgressCancelNotification=e.WorkDoneProgressCreateRequest=e.WorkDoneProgress=void 0;const t=ke,n=Kn;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)}(ir);var or={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CallHierarchyOutgoingCallsRequest=e.CallHierarchyIncomingCallsRequest=e.CallHierarchyPrepareRequest=void 0;const t=Kn;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)}(or);var sr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SemanticTokensRefreshRequest=e.SemanticTokensRangeRequest=e.SemanticTokensDeltaRequest=e.SemanticTokensRequest=e.SemanticTokensRegistrationType=e.TokenFormat=void 0;const t=Kn;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)}(sr);var ar={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ShowDocumentRequest=void 0;const t=Kn;var n;(n=e.ShowDocumentRequest||(e.ShowDocumentRequest={})).method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(ar);var cr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedEditingRangeRequest=void 0;const t=Kn;var n;(n=e.LinkedEditingRangeRequest||(e.LinkedEditingRangeRequest={})).method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(cr);var ur={};!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=Kn;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)}(ur);var lr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MonikerRequest=e.MonikerKind=e.UniquenessLevel=void 0;const t=Kn;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)}(lr);var hr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TypeHierarchySubtypesRequest=e.TypeHierarchySupertypesRequest=e.TypeHierarchyPrepareRequest=void 0;const t=Kn;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)}(hr);var dr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlineValueRefreshRequest=e.InlineValueRequest=void 0;const t=Kn;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)}(dr);var pr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.InlayHintRefreshRequest=e.InlayHintResolveRequest=e.InlayHintRequest=void 0;const t=Kn;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)}(pr);var fr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagnosticRefreshRequest=e.WorkspaceDiagnosticRequest=e.DocumentDiagnosticRequest=e.DocumentDiagnosticReportKind=e.DiagnosticServerCancellationData=void 0;const t=ke,n=zn,r=Kn;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)}(fr);var mr={};!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=Un,n=zn,r=Kn;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}(mr),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=Kn,n=Un,r=zn,i=Xn;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=Qn;Object.defineProperty(e,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return s.WorkspaceFoldersRequest}}),Object.defineProperty(e,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return s.DidChangeWorkspaceFoldersNotification}});const a=Zn;Object.defineProperty(e,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=er;Object.defineProperty(e,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(e,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=tr;Object.defineProperty(e,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}});const l=nr;Object.defineProperty(e,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const h=rr;Object.defineProperty(e,"SelectionRangeRequest",{enumerable:!0,get:function(){return h.SelectionRangeRequest}});const d=ir;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=or;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=sr;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=ar;Object.defineProperty(e,"ShowDocumentRequest",{enumerable:!0,get:function(){return m.ShowDocumentRequest}});const g=cr;Object.defineProperty(e,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return g.LinkedEditingRangeRequest}});const y=ur;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=lr;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=hr;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=dr;Object.defineProperty(e,"InlineValueRequest",{enumerable:!0,get:function(){return S.InlineValueRequest}}),Object.defineProperty(e,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return S.InlineValueRefreshRequest}});const w=pr;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=fr;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=mr;var E,_,D,T,k,x,P,O,N,q,I,A,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,ke;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}}),function(e){e.is=function(e){const t=e;return r.string(t.language)||r.string(t.scheme)||r.string(t.pattern)}}(E=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)&&!E.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),(X=e.TextDocumentSaveReason||(e.TextDocumentSaveReason={})).Manual=1,X.AfterDelay=2,X.FocusOut=3,(Y=e.WillSaveTextDocumentNotification||(e.WillSaveTextDocumentNotification={})).method="textDocument/willSave",Y.messageDirection=t.MessageDirection.clientToServer,Y.type=new t.ProtocolNotificationType(Y.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),(Ce=e.DocumentRangeFormattingRequest||(e.DocumentRangeFormattingRequest={})).method="textDocument/rangeFormatting",Ce.messageDirection=t.MessageDirection.clientToServer,Ce.type=new t.ProtocolRequestType(Ce.method),(Ee=e.DocumentOnTypeFormattingRequest||(e.DocumentOnTypeFormattingRequest={})).method="textDocument/onTypeFormatting",Ee.messageDirection=t.MessageDirection.clientToServer,Ee.type=new t.ProtocolRequestType(Ee.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")}(Gn);var gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.createProtocolConnection=void 0;const yr=ke;gr.createProtocolConnection=function(e,t,n,r){return yr.ConnectionStrategy.is(r)&&(r={connectionStrategy:r}),(0,yr.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(ke,e),n(Un,e),n(Kn,e),n(Gn,e);var r,i=gr;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}(Gt),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=De;n(De,e),n(Gt,e),e.createProtocolConnection=function(e,t,n,i){return(0,r.createMessageConnection)(e,t,n,i)}}(_e);const vr=k(_e);var br={};Object.defineProperty(br,"__esModule",{value:!0}),br.generateUuid=br.parse=br.isUUID=br.v4=br.empty=void 0;class Sr{constructor(e){this._value=e}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}}class wr extends Sr{constructor(){super([wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-","4",wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._oneOf(wr._timeHighBits),wr._randomHex(),wr._randomHex(),wr._randomHex(),"-",wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex(),wr._randomHex()].join(""))}static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return wr._oneOf(wr._chars)}}function Rr(){return new wr}wr._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],wr._timeHighBits=["8","9","a","b"],br.empty=new Sr("00000000-0000-0000-0000-000000000000"),br.v4=Rr;const Cr=/^[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 Cr.test(e)}br.isUUID=Er,br.parse=function(e){if(!Er(e))throw new Error("invalid uuid");return new Sr(e)},br.generateUuid=function(){return Rr().asHex()};var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.attachPartialResult=_r.ProgressFeature=Nr=_r.attachWorkDone=void 0;const Dr=_e,Tr=br;class kr{constructor(e,t){this._connection=e,this._token=t,kr.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(Dr.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(Dr.WorkDoneProgress.type,this._token,n)}done(){kr.Instances.delete(this._token),this._connection.sendProgress(Dr.WorkDoneProgress.type,this._token,{kind:"end"})}}kr.Instances=new Map;class xr extends kr{constructor(e,t){super(e,t),this._source=new Dr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class Pr{constructor(){}begin(){}report(){}done(){}}class Or extends Pr{constructor(){super(),this._source=new Dr.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}var Nr=_r.attachWorkDone=function(e,t){if(void 0===t||void 0===t.workDoneToken)return new Pr;const n=t.workDoneToken;return delete t.workDoneToken,new kr(e,n)};var qr;_r.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(Dr.WorkDoneProgressCancelNotification.type,(e=>{let t=kr.Instances.get(e.token);(t instanceof xr||t instanceof Or)&&t.cancel()})))}attachWorkDoneProgress(e){return void 0===e?new Pr:new kr(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){const e=(0,Tr.generateUuid)();return this.connection.sendRequest(Dr.WorkDoneProgressCreateRequest.type,{token:e}).then((()=>new xr(this.connection,e)))}return Promise.resolve(new Or)}},function(e){e.type=new Dr.ProgressType}(qr||(qr={}));class Ir{constructor(e,t){this._connection=e,this._token=t}report(e){this._connection.sendProgress(qr.type,this._token,e)}}_r.attachPartialResult=function(e,t){if(void 0===t||void 0===t.partialResultToken)return;const n=t.partialResultToken;return delete t.partialResultToken,new Ir(e,n)};var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.ConfigurationFeature=void 0;const Mr=_e,Fr=ve;Ar.ConfigurationFeature=e=>class extends e{getConfiguration(e){return e?Fr.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(Mr.ConfigurationRequest.type,t).then((t=>Array.isArray(t)?Array.isArray(e)?t:t[0]:Array.isArray(e)?[]:null))}};var Lr={};Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.WorkspaceFoldersFeature=void 0;const jr=_e;Lr.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 jr.Emitter,this.connection.onNotification(jr.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(jr.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(jr.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};var $r={};Object.defineProperty($r,"__esModule",{value:!0}),$r.CallHierarchyFeature=void 0;const Hr=_e;$r.CallHierarchyFeature=e=>class extends e{get callHierarchy(){return{onPrepare:e=>this.connection.onRequest(Hr.CallHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onIncomingCalls:e=>{const t=Hr.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onOutgoingCalls:e=>{const t=Hr.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0}),Wr.SemanticTokensBuilder=Wr.SemanticTokensDiff=Wr.SemanticTokensFeature=void 0;const Vr=_e;Wr.SemanticTokensFeature=e=>class extends e{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(Vr.SemanticTokensRefreshRequest.type),on:e=>{const t=Vr.SemanticTokensRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onDelta:e=>{const t=Vr.SemanticTokensDeltaRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onRange:e=>{const t=Vr.SemanticTokensRangeRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};class Ur{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}]:[]}}Wr.SemanticTokensDiff=Ur;Wr.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 Ur(this._prevData,this._data).computeDiff()}:this.build()}};var Kr={};Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.ShowDocumentFeature=void 0;const Gr=_e;Kr.ShowDocumentFeature=e=>class extends e{showDocument(e){return this.connection.sendRequest(Gr.ShowDocumentRequest.type,e)}};var zr={};Object.defineProperty(zr,"__esModule",{value:!0}),zr.FileOperationsFeature=void 0;const Br=_e;zr.FileOperationsFeature=e=>class extends e{onDidCreateFiles(e){return this.connection.onNotification(Br.DidCreateFilesNotification.type,(t=>{e(t)}))}onDidRenameFiles(e){return this.connection.onNotification(Br.DidRenameFilesNotification.type,(t=>{e(t)}))}onDidDeleteFiles(e){return this.connection.onNotification(Br.DidDeleteFilesNotification.type,(t=>{e(t)}))}onWillCreateFiles(e){return this.connection.onRequest(Br.WillCreateFilesRequest.type,((t,n)=>e(t,n)))}onWillRenameFiles(e){return this.connection.onRequest(Br.WillRenameFilesRequest.type,((t,n)=>e(t,n)))}onWillDeleteFiles(e){return this.connection.onRequest(Br.WillDeleteFilesRequest.type,((t,n)=>e(t,n)))}};var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.LinkedEditingRangeFeature=void 0;const Xr=_e;Jr.LinkedEditingRangeFeature=e=>class extends e{onLinkedEditingRange(e){return this.connection.onRequest(Xr.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 Qr=_e;Yr.TypeHierarchyFeature=e=>class extends e{get typeHierarchy(){return{onPrepare:e=>this.connection.onRequest(Qr.TypeHierarchyPrepareRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),void 0))),onSupertypes:e=>{const t=Qr.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))},onSubtypes:e=>{const t=Qr.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(t,((n,r)=>e(n,r,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(t,n))))}}}};var Zr={};Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.InlineValueFeature=void 0;const ei=_e;Zr.InlineValueFeature=e=>class extends e{get inlineValue(){return{refresh:()=>this.connection.sendRequest(ei.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(ei.InlineValueRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t))))}}};var ti={};Object.defineProperty(ti,"__esModule",{value:!0}),ti.InlayHintFeature=void 0;const ni=_e;ti.InlayHintFeature=e=>class extends e{get inlayHint(){return{refresh:()=>this.connection.sendRequest(ni.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(ni.InlayHintRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t)))),resolve:e=>this.connection.onRequest(ni.InlayHintResolveRequest.type,((t,n)=>e(t,n)))}}};var ri={};Object.defineProperty(ri,"__esModule",{value:!0}),ri.DiagnosticFeature=void 0;const ii=_e;ri.DiagnosticFeature=e=>class extends e{get diagnostics(){return{refresh:()=>this.connection.sendRequest(ii.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ii.DocumentDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ii.DocumentDiagnosticRequest.partialResult,t)))),onWorkspace:e=>this.connection.onRequest(ii.WorkspaceDiagnosticRequest.type,((t,n)=>e(t,n,this.attachWorkDoneProgress(t),this.attachPartialResultProgress(ii.WorkspaceDiagnosticRequest.partialResult,t))))}}};var oi={},si={};Object.defineProperty(si,"__esModule",{value:!0}),si.TextDocuments=void 0;const ai=_e;si.TextDocuments=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ai.Emitter,this._onDidOpen=new ai.Emitter,this._onDidClose=new ai.Emitter,this._onDidSave=new ai.Emitter,this._onWillSave=new ai.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=ai.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}))}))),ai.Disposable.create((()=>{t.forEach((e=>e.dispose()))}))}},Object.defineProperty(oi,"__esModule",{value:!0}),oi.NotebookDocuments=oi.NotebookSyncFeature=void 0;const ci=_e,ui=si;oi.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 li{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 li.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return li.NULL_DISPOSE}onDidSaveTextDocument(){return li.NULL_DISPOSE}}li.NULL_DISPOSE=Object.freeze({dispose:()=>{}});oi.NotebookDocuments=class{constructor(e){e instanceof ui.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new ui.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 li,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 hi={};Object.defineProperty(hi,"__esModule",{value:!0}),hi.MonikerFeature=void 0;const di=_e;hi.MonikerFeature=e=>class extends e{get moniker(){return{on:e=>{const t=di.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=br,i=_r,o=Ar,s=Lr,a=$r,c=Wr,u=Kr,l=zr,h=Jr,d=Yr,p=Zr,f=ti,m=ri,g=oi,y=hi;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 C{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 E=(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(C)):new C,h=o&&o.window?new(o.window(S)):new S,d=o&&o.workspace?new(o.workspace(E)):new E,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];function g(e){return e instanceof Promise?e:n.thenable(e)?new Promise(((t,n)=>{e.then((e=>t(e)),(e=>n(e)))})):Promise.resolve(e)}let y,v,w,R={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=>(v=e,{dispose:()=>{v=void 0}}),onInitialized:e=>a.onNotification(t.InitializedNotification.type,e),onShutdown:e=>(y=e,{dispose:()=>{y=void 0}}),onExit:e=>(w=e,{dispose:()=>{w=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(R);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(v){return g(v(e,(new t.CancellationTokenSource).token,(0,i.attachWorkDone)(a,e),void 0)).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(R.__textDocumentSync)?R.__textDocumentSync:t.TextDocumentSyncKind.None:n.number(i.textDocumentSync)||n.number(i.textDocumentSync.change)||(i.textDocumentSync.change=n.number(R.__textDocumentSync)?R.__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}})),a.onRequest(t.ShutdownRequest.type,(()=>(r.shutdownReceived=!0,y?y((new t.CancellationTokenSource).token):void 0))),a.onNotification(t.ExitNotification.type,(()=>{try{w&&w()}finally{r.shutdownReceived?r.exit(0):r.exit(1)}})),a.onNotification(t.SetTraceNotification.type,(e=>{c.trace=t.Trace.fromString(e.value)})),R}}(Ee);var pi={};!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)}}(pi);var fi={};({get exports(){return fi},set exports(e){fi=e}}).exports=_e;var mi={};!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=Wr;Object.defineProperty(e,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}}),n(_e,e);const i=si;Object.defineProperty(e,"TextDocuments",{enumerable:!0,get:function(){return i.TextDocuments}});const o=oi;Object.defineProperty(e,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(Ee,e),(e.ProposedFeatures||(e.ProposedFeatures={})).all={__brand:"features"}}(mi),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=Ee,o=pi,s=fi;var a;n(fi,e),n(mi,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 gi=k(ye);var yi={};({get exports(){return yi},set exports(e){yi=e}}).exports=ye;const vi=k(yi);var bi;!function(e){e[e.Error=0]="Error",e[e.Warning=1]="Warning",e[e.Info=2]="Info",e[e.Log=3]="Log"}(bi=bi||(bi={})),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"}}}(bi=bi||(bi={}));class Si{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 bi.Log:return gi.MessageType.Log;case bi.Info:return gi.MessageType.Info;case bi.Warning:return gi.MessageType.Warning;case bi.Error:return gi.MessageType.Error}}error(...e){this.sendMessage(gi.MessageType.Error,e)}warn(...e){this.sendMessage(gi.MessageType.Warning,e)}info(...e){this.sendMessage(gi.MessageType.Info,e)}log(...e){this.sendMessage(gi.MessageType.Log,e)}logIgnoringVerbosity(e,...t){this.sendMessage(this.logLevelToLspMessageType(e),t,{overrideLevel:!0})}trace(e,t,n){this.logIgnoringVerbosity(bi.Log,`[${e} - ${Ri()}] ${t}`),n&&this.logIgnoringVerbosity(bi.Log,Ei(n))}}class wi{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(bi.Log,this.prefix,`[${e} - ${Ri()}] ${t}`),n&&this.logIgnoringVerbosity(bi.Log,this.prefix,Ei(n))}}function Ri(){const e=new Date;return`${Ci(`${e.getUTCHours()}`,2,"0")}:${Ci(`${e.getMinutes()}`,2,"0")}:${Ci(`${e.getUTCSeconds()}`,2,"0")}.${e.getMilliseconds()}`}function Ci(e,t,n=" "){return n.repeat(Math.max(0,t-e.length))+e}function Ei(e){return e instanceof Error?e.stack||e.message:!1===e.success&&e.message?e.message:e.toString()}var _i={},Di={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})}},Ti=v,ki=process.cwd,xi=null,Pi=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xi||(xi=ki.call(process)),xi};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Oi=process.chdir;process.chdir=function(e){xi=null,Oi.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Oi)}var Ni=function(e){Ti.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,Ti.O_WRONLY|Ti.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,Ti.O_WRONLY|Ti.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){Ti.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,r,i){e.open(t,Ti.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,Ti.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"===Pi&&(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 qi=b.Stream,Ii=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);qi.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);qi.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 Ai=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:Mi(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},Mi=Object.getPrototypeOf||function(e){return e.__proto__};var Fi,Li,ji=a,$i=Ni,Hi=Ii,Wi=Ai,Vi=u;function Ui(e,t){Object.defineProperty(e,Fi,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Fi=Symbol.for("graceful-fs.queue"),Li=Symbol.for("graceful-fs.previous")):(Fi="___graceful-fs.queue",Li="___graceful-fs.previous");var Ki=function(){};if(Vi.debuglog?Ki=Vi.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Ki=function(){var e=Vi.format.apply(Vi,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!ji[Fi]){var Gi=T[Fi]||[];Ui(ji,Gi),ji.close=function(e){function t(t,n){return e.call(ji,t,(function(e){e||Yi(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Li,{value:e}),t}(ji.close),ji.closeSync=function(e){function t(t){e.apply(ji,arguments),Yi()}return Object.defineProperty(t,Li,{value:e}),t}(ji.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){Ki(ji[Fi]),S.equal(ji[Fi].length,0)}))}T[Fi]||Ui(T,ji[Fi]);var zi,Bi=Ji(Wi(ji));function Ji(e){$i(e),e.gracefulify=Ji,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):Xi([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):Xi([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):Xi([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):Xi([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)):Xi([e,[t,n,r],o,i||Date.now(),Date.now()])}))}(e,t,n)},"v0.8"===process.version.substr(0,4)){var s=Hi(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):Xi([e,[t,n,r,i],s,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=f,e}function Xi(e){Ki("ENQUEUE",e[0].name,e[1]),ji[Fi].push(e),Qi()}function Yi(){for(var e=Date.now(),t=0;t<ji[Fi].length;++t)ji[Fi][t].length>2&&(ji[Fi][t][3]=e,ji[Fi][t][4]=e);Qi()}function Qi(){if(clearTimeout(zi),zi=void 0,0!==ji[Fi].length){var e=ji[Fi].shift(),t=e[0],n=e[1],r=e[2],i=e[3],o=e[4];if(void 0===i)Ki("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Ki("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)?(Ki("RETRY",t.name,n),t.apply(null,n.concat([i]))):ji[Fi].push(e)}void 0===zi&&(zi=setTimeout(Qi,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ji.__patched&&(Bi=Ji(ji),ji.__patched=!0),function(e){const t=Di.fromCallback,n=Bi,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")}(_i);var Zi={},eo={};const to=s;eo.checkPath=function(e){if("win32"===process.platform){if(/[<>:"|?*]/.test(e.replace(to.parse(e).root,""))){const t=new Error(`Path contains invalid characters: ${e}`);throw t.code="EINVAL",t}}};const no=_i,{checkPath:ro}=eo,io=e=>"number"==typeof e?e:{mode:511,...e}.mode;Zi.makeDir=async(e,t)=>(ro(e),no.mkdir(e,{mode:io(t),recursive:!0})),Zi.makeDirSync=(e,t)=>(ro(e),no.mkdirSync(e,{mode:io(t),recursive:!0}));const oo=Di.fromPromise,{makeDir:so,makeDirSync:ao}=Zi,co=oo(so);var uo={mkdirs:co,mkdirsSync:ao,mkdirp:co,mkdirpSync:ao,ensureDir:co,ensureDirSync:ao};const lo=Di.fromPromise,ho=_i;var po={pathExists:lo((function(e){return ho.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:ho.existsSync};const fo=Bi;var mo=function(e,t,n,r){fo.open(e,"r+",((e,i)=>{if(e)return r(e);fo.futimes(i,t,n,(e=>{fo.close(i,(t=>{r&&r(e||t)}))}))}))},go=function(e,t,n){const r=fo.openSync(e,"r+");return fo.futimesSync(r,t,n),fo.closeSync(r)};const yo=_i,vo=s,bo=u;function So(e,t,n){const r=n.dereference?e=>yo.stat(e,{bigint:!0}):e=>yo.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 wo(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function Ro(e,t){const n=vo.resolve(e).split(vo.sep).filter((e=>e)),r=vo.resolve(t).split(vo.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Co(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Eo={checkPaths:function(e,t,n,r,i){bo.callbackify(So)(e,t,r,((r,o)=>{if(r)return i(r);const{srcStat:s,destStat:a}=o;if(a){if(wo(s,a)){const r=vo.basename(e),o=vo.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()&&Ro(e,t)?i(new Error(Co(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=>yo.statSync(e,{bigint:!0}):e=>yo.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(wo(i,o)){const r=vo.basename(e),s=vo.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()&&Ro(e,t))throw new Error(Co(e,t,n));return{srcStat:i,destStat:o}},checkParentPaths:function e(t,n,r,i,o){const s=vo.resolve(vo.dirname(t)),a=vo.resolve(vo.dirname(r));if(a===s||a===vo.parse(a).root)return o();yo.stat(a,{bigint:!0},((s,c)=>s?"ENOENT"===s.code?o():o(s):wo(n,c)?o(new Error(Co(t,r,i))):e(t,n,a,i,o)))},checkParentPathsSync:function e(t,n,r,i){const o=vo.resolve(vo.dirname(t)),s=vo.resolve(vo.dirname(r));if(s===o||s===vo.parse(s).root)return;let a;try{a=yo.statSync(s,{bigint:!0})}catch(e){if("ENOENT"===e.code)return;throw e}if(wo(n,a))throw new Error(Co(t,r,i));return e(t,n,s,i)},isSrcSubdir:Ro,areIdentical:wo};const _o=Bi,Do=s,To=uo.mkdirs,ko=po.pathExists,xo=mo,Po=Eo;function Oo(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 No(e,t,n,r,i){(r.dereference?_o.stat:_o.lstat)(t,((o,s)=>o?i(o):s.isDirectory()?function(e,t,n,r,i,o){return t?Mo(n,r,i,o):function(e,t,n,r,i){_o.mkdir(n,(o=>{if(o)return i(o);Mo(t,n,r,(t=>t?i(t):Ao(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();_o.unlink(n,(o=>o?i(o):qo(e,t,n,r,i)))}(e,n,r,i,o):qo(e,n,r,i,o)}(s,e,t,n,r,i):s.isSymbolicLink()?function(e,t,n,r,i){_o.readlink(t,((t,o)=>t?i(t):(r.dereference&&(o=Do.resolve(process.cwd(),o)),e?void _o.readlink(n,((e,t)=>e?"EINVAL"===e.code||"UNKNOWN"===e.code?_o.symlink(o,n,i):i(e):(r.dereference&&(t=Do.resolve(process.cwd(),t)),Po.isSrcSubdir(o,t)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${t}'.`)):Po.isSrcSubdir(t,o)?i(new Error(`Cannot overwrite '${t}' with '${o}'.`)):function(e,t,n){_o.unlink(t,(r=>r?n(r):_o.symlink(e,t,n)))}(o,n,i)))):_o.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 qo(e,t,n,r,i){_o.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 Ao(e,128|t,n)}(n,e,(i=>i?r(i):Io(e,t,n,r)));return Io(e,t,n,r)}(e.mode,t,n,i):Ao(n,e.mode,i)))}function Io(e,t,n,r){!function(e,t,n){_o.stat(e,((e,r)=>e?n(e):xo(t,r.atime,r.mtime,n)))}(t,n,(t=>t?r(t):Ao(n,e,r)))}function Ao(e,t,n){return _o.chmod(e,t,n)}function Mo(e,t,n,r){_o.readdir(e,((i,o)=>i?r(i):Fo(o,e,t,n,r)))}function Fo(e,t,n,r,i){const o=e.pop();return o?function(e,t,n,r,i,o){const s=Do.join(n,t),a=Do.join(r,t);Oo(s,a,i,((t,c)=>t?o(t):c?void Po.checkPaths(s,a,"copy",i,((t,c)=>{if(t)return o(t);const{destStat:u}=c;No(u,s,a,i,(t=>t?o(t):Fo(e,n,r,i,o)))})):Fo(e,n,r,i,o)))}(e,o,t,n,r,i):i()}var Lo=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"),Po.checkPaths(e,t,"copy",n,((i,o)=>{if(i)return r(i);const{srcStat:s,destStat:a}=o;Po.checkParentPaths(e,s,t,"copy",(i=>{if(i)return r(i);Oo(e,t,n,((i,o)=>i?r(i):o?void function(e,t,n,r,i){const o=Do.dirname(n);ko(o,((s,a)=>s?i(s):a?No(e,t,n,r,i):void To(o,(o=>o?i(o):No(e,t,n,r,i)))))}(a,e,t,n,r):r()))}))}))};const jo=Bi,$o=s,Ho=uo.mkdirsSync,Wo=go,Vo=Eo;function Uo(e,t,n,r){const i=(r.dereference?jo.statSync:jo.lstatSync)(t);if(i.isDirectory())return function(e,t,n,r,i){return t?zo(n,r,i):function(e,t,n,r){return jo.mkdirSync(n),zo(t,n,r),Go(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 jo.unlinkSync(n),Ko(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,i):Ko(e,n,r,i)}(i,e,t,n,r);if(i.isSymbolicLink())return function(e,t,n,r){let i=jo.readlinkSync(t);r.dereference&&(i=$o.resolve(process.cwd(),i));if(e){let e;try{e=jo.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return jo.symlinkSync(i,n);throw e}if(r.dereference&&(e=$o.resolve(process.cwd(),e)),Vo.isSrcSubdir(i,e))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${e}'.`);if(Vo.isSrcSubdir(e,i))throw new Error(`Cannot overwrite '${e}' with '${i}'.`);return function(e,t){return jo.unlinkSync(t),jo.symlinkSync(e,t)}(i,n)}return jo.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 Ko(e,t,n,r){return jo.copyFileSync(t,n),r.preserveTimestamps&&function(e,t,n){(function(e){return 0==(128&e)})(e)&&function(e,t){Go(e,128|t)}(n,e);(function(e,t){const n=jo.statSync(e);Wo(t,n.atime,n.mtime)})(t,n)}(e.mode,t,n),Go(n,e.mode)}function Go(e,t){return jo.chmodSync(e,t)}function zo(e,t,n){jo.readdirSync(e).forEach((r=>function(e,t,n,r){const i=$o.join(t,e),o=$o.join(n,e);if(r.filter&&!r.filter(i,o))return;const{destStat:s}=Vo.checkPathsSync(i,o,"copy",r);return Uo(s,i,o,r)}(r,e,t,n)))}var Bo=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}=Vo.checkPathsSync(e,t,"copy",n);if(Vo.checkParentPathsSync(e,r,t,"copy"),n.filter&&!n.filter(e,t))return;const o=$o.dirname(t);return jo.existsSync(o)||Ho(o),Uo(i,e,t,n)};var Jo={copy:(0,Di.fromCallback)(Lo),copySync:Bo};const Xo=Bi;var Yo={remove:(0,Di.fromCallback)((function(e,t){Xo.rm(e,{recursive:!0,force:!0},t)})),removeSync:function(e){Xo.rmSync(e,{recursive:!0,force:!0})}};const Qo=Di.fromPromise,Zo=_i,es=s,ts=uo,ns=Yo,rs=Qo((async function(e){let t;try{t=await Zo.readdir(e)}catch{return ts.mkdirs(e)}return Promise.all(t.map((t=>ns.remove(es.join(e,t)))))}));function is(e){let t;try{t=Zo.readdirSync(e)}catch{return ts.mkdirsSync(e)}t.forEach((t=>{t=es.join(e,t),ns.removeSync(t)}))}var os={emptyDirSync:is,emptydirSync:is,emptyDir:rs,emptydir:rs};const ss=Di.fromCallback,as=s,cs=Bi,us=uo;var ls={createFile:ss((function(e,t){function n(){cs.writeFile(e,"",(e=>{if(e)return t(e);t()}))}cs.stat(e,((r,i)=>{if(!r&&i.isFile())return t();const o=as.dirname(e);cs.stat(o,((e,r)=>{if(e)return"ENOENT"===e.code?us.mkdirs(o,(e=>{if(e)return t(e);n()})):t(e);r.isDirectory()?n():cs.readdir(o,(e=>{if(e)return t(e)}))}))}))})),createFileSync:function(e){let t;try{t=cs.statSync(e)}catch{}if(t&&t.isFile())return;const n=as.dirname(e);try{cs.statSync(n).isDirectory()||cs.readdirSync(n)}catch(e){if(!e||"ENOENT"!==e.code)throw e;us.mkdirsSync(n)}cs.writeFileSync(e,"")}};const hs=Di.fromCallback,ds=s,ps=Bi,fs=uo,ms=po.pathExists,{areIdentical:gs}=Eo;var ys={createLink:hs((function(e,t,n){function r(e,t){ps.link(e,t,(e=>{if(e)return n(e);n(null)}))}ps.lstat(t,((i,o)=>{ps.lstat(e,((i,s)=>{if(i)return i.message=i.message.replace("lstat","ensureLink"),n(i);if(o&&gs(s,o))return n(null);const a=ds.dirname(t);ms(a,((i,o)=>i?n(i):o?r(e,t):void fs.mkdirs(a,(i=>{if(i)return n(i);r(e,t)}))))}))}))})),createLinkSync:function(e,t){let n;try{n=ps.lstatSync(t)}catch{}try{const t=ps.lstatSync(e);if(n&&gs(t,n))return}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const r=ds.dirname(t);return ps.existsSync(r)||fs.mkdirsSync(r),ps.linkSync(e,t)}};const vs=s,bs=Bi,Ss=po.pathExists;var ws={symlinkPaths:function(e,t,n){if(vs.isAbsolute(e))return bs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=vs.dirname(t),i=vs.join(r,e);return Ss(i,((t,o)=>t?n(t):o?n(null,{toCwd:i,toDst:e}):bs.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:vs.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(vs.isAbsolute(e)){if(n=bs.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=vs.dirname(t),i=vs.join(r,e);if(n=bs.existsSync(i),n)return{toCwd:i,toDst:e};if(n=bs.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:vs.relative(r,e)}}}};const Rs=Bi;var Cs={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Rs.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=Rs.lstatSync(e)}catch{return"file"}return n&&n.isDirectory()?"dir":"file"}};const Es=Di.fromCallback,_s=s,Ds=_i,Ts=uo.mkdirs,ks=uo.mkdirsSync,xs=ws.symlinkPaths,Ps=ws.symlinkPathsSync,Os=Cs.symlinkType,Ns=Cs.symlinkTypeSync,qs=po.pathExists,{areIdentical:Is}=Eo;function As(e,t,n,r){xs(e,t,((i,o)=>{if(i)return r(i);e=o.toDst,Os(o.toCwd,n,((n,i)=>{if(n)return r(n);const o=_s.dirname(t);qs(o,((n,s)=>n?r(n):s?Ds.symlink(e,t,i,r):void Ts(o,(n=>{if(n)return r(n);Ds.symlink(e,t,i,r)}))))}))}))}var Ms={createSymlink:Es((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,Ds.lstat(t,((i,o)=>{!i&&o.isSymbolicLink()?Promise.all([Ds.stat(e),Ds.stat(t)]).then((([i,o])=>{if(Is(i,o))return r(null);As(e,t,n,r)})):As(e,t,n,r)}))})),createSymlinkSync:function(e,t,n){let r;try{r=Ds.lstatSync(t)}catch{}if(r&&r.isSymbolicLink()){const n=Ds.statSync(e),r=Ds.statSync(t);if(Is(n,r))return}const i=Ps(e,t);e=i.toDst,n=Ns(i.toCwd,n);const o=_s.dirname(t);return Ds.existsSync(o)||ks(o),Ds.symlinkSync(e,t,n)}};const{createFile:Fs,createFileSync:Ls}=ls,{createLink:js,createLinkSync:$s}=ys,{createSymlink:Hs,createSymlinkSync:Ws}=Ms;var Vs,Us,Ks,Gs,zs,Bs,Js,Xs,Ys={createFile:Fs,createFileSync:Ls,ensureFile:Fs,ensureFileSync:Ls,createLink:js,createLinkSync:$s,ensureLink:js,ensureLinkSync:$s,createSymlink:Hs,createSymlinkSync:Ws,ensureSymlink:Hs,ensureSymlinkSync:Ws};function Qs(){if(Us)return Vs;Us=1;var e=v,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 Vs=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},Vs}var Zs={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 ea;try{ea=function(){if(Xs)return Js;Xs=1;var e,t,n=a,r=Qs(),i=function(){if(Gs)return Ks;Gs=1;var e=b.Stream;return Ks=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())}}},Ks}(),o=function(){if(Bs)return zs;Bs=1,zs=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 zs}(),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]),S.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),g()}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);g()}function g(){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(g,0))}}return T[e]||c(T,n[e]),Js=p(o(n)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched&&(Js=p(n),n.__patched=!0),Js}()}catch(e){ea=a}const ta=Di,{stringify:na,stripBom:ra}=Zs;const ia=ta.fromPromise((async function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||ea,r=!("throws"in t)||t.throws;let i,o=await ta.fromCallback(n.readFile)(e,t);o=ra(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 oa=ta.fromPromise((async function(e,t,n={}){const r=n.fs||ea,i=na(t,n);await ta.fromCallback(r.writeFile)(e,i,n)}));const sa={readFile:ia,readFileSync:function(e,t={}){"string"==typeof t&&(t={encoding:t});const n=t.fs||ea,r=!("throws"in t)||t.throws;try{let r=n.readFileSync(e,t);return r=ra(r),JSON.parse(r,t.reviver)}catch(t){if(r)throw t.message=`${e}: ${t.message}`,t;return null}},writeFile:oa,writeFileSync:function(e,t,n={}){const r=n.fs||ea,i=na(t,n);return r.writeFileSync(e,i,n)}};var aa={readJson:sa.readFile,readJsonSync:sa.readFileSync,writeJson:sa.writeFile,writeJsonSync:sa.writeFileSync};const ca=Di.fromCallback,ua=Bi,la=s,ha=uo,da=po.pathExists;var pa={outputFile:ca((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const i=la.dirname(e);da(i,((o,s)=>o?r(o):s?ua.writeFile(e,t,n,r):void ha.mkdirs(i,(i=>{if(i)return r(i);ua.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=la.dirname(e);if(ua.existsSync(n))return ua.writeFileSync(e,...t);ha.mkdirsSync(n),ua.writeFileSync(e,...t)}};const{stringify:fa}=Zs,{outputFile:ma}=pa;var ga=async function(e,t,n={}){const r=fa(t,n);await ma(e,r,n)};const{stringify:ya}=Zs,{outputFileSync:va}=pa;var ba=function(e,t,n){const r=ya(t,n);va(e,r,n)};const Sa=Di.fromPromise,wa=aa;wa.outputJson=Sa(ga),wa.outputJsonSync=ba,wa.outputJSON=wa.outputJson,wa.outputJSONSync=wa.outputJsonSync,wa.writeJSON=wa.writeJson,wa.writeJSONSync=wa.writeJsonSync,wa.readJSON=wa.readJson,wa.readJSONSync=wa.readJsonSync;var Ra=wa;const Ca=Bi,Ea=s,_a=Jo.copy,Da=Yo.remove,Ta=uo.mkdirp,ka=po.pathExists,xa=Eo;function Pa(e,t,n,r,i){return r?Oa(e,t,n,i):n?Da(t,(r=>r?i(r):Oa(e,t,n,i))):void ka(t,((r,o)=>r?i(r):o?i(new Error("dest already exists.")):Oa(e,t,n,i)))}function Oa(e,t,n,r){Ca.rename(e,t,(i=>i?"EXDEV"!==i.code?r(i):function(e,t,n,r){const i={overwrite:n,errorOnExist:!0,preserveTimestamps:!0};_a(e,t,i,(t=>t?r(t):Da(e,r)))}(e,t,n,r):r()))}var Na=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const i=(n=n||{}).overwrite||n.clobber||!1;xa.checkPaths(e,t,"move",n,((n,o)=>{if(n)return r(n);const{srcStat:s,isChangingCase:a=!1}=o;xa.checkParentPaths(e,s,t,"move",(n=>n?r(n):function(e){const t=Ea.dirname(e);return Ea.parse(t).root===t}(t)?Pa(e,t,i,a,r):void Ta(Ea.dirname(t),(n=>n?r(n):Pa(e,t,i,a,r)))))}))};const qa=Bi,Ia=s,Aa=Jo.copySync,Ma=Yo.removeSync,Fa=uo.mkdirpSync,La=Eo;function ja(e,t,n){try{qa.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 Aa(e,t,r),Ma(e)}(e,t,n)}}var $a=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:i,isChangingCase:o=!1}=La.checkPathsSync(e,t,"move",n);return La.checkParentPathsSync(e,i,t,"move"),function(e){const t=Ia.dirname(e);return Ia.parse(t).root===t}(t)||Fa(Ia.dirname(t)),function(e,t,n,r){if(r)return ja(e,t,n);if(n)return Ma(t),ja(e,t,n);if(qa.existsSync(t))throw new Error("dest already exists.");return ja(e,t,n)}(e,t,r,o)};var Ha={move:(0,Di.fromCallback)(Na),moveSync:$a};const Wa={..._i,...Jo,...os,...Ys,...Ra,...uo,...Ha,...pa,...po,...Yo},Va=(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)}))}};Va.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 Ua={},Ka={get exports(){return Ua},set exports(e){Ua=e}};var Ga={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16};var za="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}=Ga,r=za,i=(t=e.exports={}).re=[],o=t.src=[],s=t.t={};let a=0;const c=(e,t,n)=>{const c=a++;r(e,c,t),s[e]=c,o[c]=t,i[c]=new RegExp(t,n?"g":void 0)};c("NUMERICIDENTIFIER","0|[1-9]\\d*"),c("NUMERICIDENTIFIERLOOSE","[0-9]+"),c("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),c("MAINVERSION",`(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})\\.(${o[s.NUMERICIDENTIFIER]})`),c("MAINVERSIONLOOSE",`(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})\\.(${o[s.NUMERICIDENTIFIERLOOSE]})`),c("PRERELEASEIDENTIFIER",`(?:${o[s.NUMERICIDENTIFIER]}|${o[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASEIDENTIFIERLOOSE",`(?:${o[s.NUMERICIDENTIFIERLOOSE]}|${o[s.NONNUMERICIDENTIFIER]})`),c("PRERELEASE",`(?:-(${o[s.PRERELEASEIDENTIFIER]}(?:\\.${o[s.PRERELEASEIDENTIFIER]})*))`),c("PRERELEASELOOSE",`(?:-?(${o[s.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${o[s.PRERELEASEIDENTIFIERLOOSE]})*))`),c("BUILDIDENTIFIER","[0-9A-Za-z-]+"),c("BUILD",`(?:\\+(${o[s.BUILDIDENTIFIER]}(?:\\.${o[s.BUILDIDENTIFIER]})*))`),c("FULLPLAIN",`v?${o[s.MAINVERSION]}${o[s.PRERELEASE]}?${o[s.BUILD]}?`),c("FULL",`^${o[s.FULLPLAIN]}$`),c("LOOSEPLAIN",`[v=\\s]*${o[s.MAINVERSIONLOOSE]}${o[s.PRERELEASELOOSE]}?${o[s.BUILD]}?`),c("LOOSE",`^${o[s.LOOSEPLAIN]}$`),c("GTLT","((?:<|>)?=?)"),c("XRANGEIDENTIFIERLOOSE",`${o[s.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),c("XRANGEIDENTIFIER",`${o[s.NUMERICIDENTIFIER]}|x|X|\\*`),c("XRANGEPLAIN",`[v=\\s]*(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:\\.(${o[s.XRANGEIDENTIFIER]})(?:${o[s.PRERELEASE]})?${o[s.BUILD]}?)?)?`),c("XRANGEPLAINLOOSE",`[v=\\s]*(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:\\.(${o[s.XRANGEIDENTIFIERLOOSE]})(?:${o[s.PRERELEASELOOSE]})?${o[s.BUILD]}?)?)?`),c("XRANGE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAIN]}$`),c("XRANGELOOSE",`^${o[s.GTLT]}\\s*${o[s.XRANGEPLAINLOOSE]}$`),c("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),c("COERCERTL",o[s.COERCE],!0),c("LONETILDE","(?:~>?)"),c("TILDETRIM",`(\\s*)${o[s.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",c("TILDE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAIN]}$`),c("TILDELOOSE",`^${o[s.LONETILDE]}${o[s.XRANGEPLAINLOOSE]}$`),c("LONECARET","(?:\\^)"),c("CARETTRIM",`(\\s*)${o[s.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",c("CARET",`^${o[s.LONECARET]}${o[s.XRANGEPLAIN]}$`),c("CARETLOOSE",`^${o[s.LONECARET]}${o[s.XRANGEPLAINLOOSE]}$`),c("COMPARATORLOOSE",`^${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]})$|^$`),c("COMPARATOR",`^${o[s.GTLT]}\\s*(${o[s.FULLPLAIN]})$|^$`),c("COMPARATORTRIM",`(\\s*)${o[s.GTLT]}\\s*(${o[s.LOOSEPLAIN]}|${o[s.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",c("HYPHENRANGE",`^\\s*(${o[s.XRANGEPLAIN]})\\s+-\\s+(${o[s.XRANGEPLAIN]})\\s*$`),c("HYPHENRANGELOOSE",`^\\s*(${o[s.XRANGEPLAINLOOSE]})\\s+-\\s+(${o[s.XRANGEPLAINLOOSE]})\\s*$`),c("STAR","(<|>)?=?\\s*\\*"),c("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),c("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Ka,Ua);const Ba=["includePrerelease","loose","rtl"];var Ja=e=>e?"object"!=typeof e?{loose:!0}:Ba.filter((t=>e[t])).reduce(((e,t)=>(e[t]=!0,e)),{}):{};const Xa=/^[0-9]+$/,Ya=(e,t)=>{const n=Xa.test(e),r=Xa.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:Ya,rcompareIdentifiers:(e,t)=>Ya(t,e)};const Za=za,{MAX_LENGTH:ec,MAX_SAFE_INTEGER:tc}=Ga,{re:nc,t:rc}=Ua,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: ${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){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);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":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(0===oc(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};const{MAX_LENGTH:ac}=Ga,{re:cc,t:uc}=Ua,lc=sc,hc=Ja;var dc=(e,t)=>{if(t=hc(t),e instanceof lc)return e;if("string"!=typeof e)return null;if(e.length>ac)return null;if(!(t.loose?cc[uc.LOOSE]:cc[uc.FULL]).test(e))return null;try{return new lc(e,t)}catch(e){return null}};const pc=dc;var fc=(e,t)=>{const n=pc(e,t);return n?n.version:null};const mc=dc;var gc=(e,t)=>{const n=mc(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const yc=sc;var vc=(e,t,n,r)=>{"string"==typeof n&&(r=n,n=void 0);try{return new yc(e instanceof yc?e.version:e,n).inc(t,r).version}catch(e){return null}};const bc=sc;var Sc=(e,t,n)=>new bc(e,n).compare(new bc(t,n));const wc=Sc;var Rc=(e,t,n)=>0===wc(e,t,n);const Cc=dc,Ec=Rc;var _c=(e,t)=>{if(Ec(e,t))return null;{const n=Cc(e),r=Cc(t),i=n.prerelease.length||r.prerelease.length,o=i?"pre":"",s=i?"prerelease":"";for(const e in n)if(("major"===e||"minor"===e||"patch"===e)&&n[e]!==r[e])return o+e;return s}};const Dc=sc;var Tc=(e,t)=>new Dc(e,t).major;const kc=sc;var xc=(e,t)=>new kc(e,t).minor;const Pc=sc;var Oc=(e,t)=>new Pc(e,t).patch;const Nc=dc;var qc=(e,t)=>{const n=Nc(e,t);return n&&n.prerelease.length?n.prerelease:null};const Ic=Sc;var Ac=(e,t,n)=>Ic(t,e,n);const Mc=Sc;var Fc=(e,t)=>Mc(e,t,!0);const Lc=sc;var jc=(e,t,n)=>{const r=new Lc(e,n),i=new Lc(t,n);return r.compare(i)||r.compareBuild(i)};const $c=jc;var Hc=(e,t)=>e.sort(((e,n)=>$c(e,n,t)));const Wc=jc;var Vc=(e,t)=>e.sort(((e,n)=>Wc(n,e,t)));const Uc=Sc;var Kc=(e,t,n)=>Uc(e,t,n)>0;const Gc=Sc;var zc=(e,t,n)=>Gc(e,t,n)<0;const Bc=Sc;var Jc=(e,t,n)=>0!==Bc(e,t,n);const Xc=Sc;var Yc=(e,t,n)=>Xc(e,t,n)>=0;const Qc=Sc;var Zc=(e,t,n)=>Qc(e,t,n)<=0;const eu=Rc,tu=Jc,nu=Kc,ru=Yc,iu=zc,ou=Zc;var su=(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 eu(e,n,r);case"!=":return tu(e,n,r);case">":return nu(e,n,r);case">=":return ru(e,n,r);case"<":return iu(e,n,r);case"<=":return ou(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const au=sc,cu=dc,{re:uu,t:lu}=Ua;var hu,du,pu,fu,mu,gu,yu,vu,bu,Su,wu=(e,t)=>{if(e instanceof au)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=uu[lu.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),uu[lu.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;uu[lu.COERCERTL].lastIndex=-1}else n=e.match(uu[lu.COERCE]);return null===n?null:cu(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function Ru(){if(fu)return pu;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}fu=1,pu=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{(du?hu:(du=1,hu=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}))(e)}catch(e){}return pu}function Cu(){if(vu)return yu;vu=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,this.set=t.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${t}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!d(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&&p(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){e=e.trim();const t=`parseRange:${Object.keys(this.options).join(",")}:${e}`,r=n.get(t);if(r)return r;const s=this.options.loose,p=s?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];e=e.replace(p,_(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(a[c.COMPARATORTRIM],u),o("comparator trim",e);let f=(e=(e=(e=e.replace(a[c.TILDETRIM],l)).replace(a[c.CARETTRIM],h)).split(/\s+/).join(" ")).split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));s&&(f=f.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(a[c.COMPARATORLOOSE]))))),o("range list",f);const g=new Map,y=f.map((e=>new i(e,this.options)));for(const e of y){if(d(e))return[e];g.set(e.value,e)}g.size>1&&g.has("")&&g.delete("");const v=[...g.values()];return n.set(t,v),v}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>f(e,n)&&t.set.some((t=>f(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(D(this.set[t],e,this.options))return!0;return!1}}yu=e;const t=function(){if(gu)return mu;gu=1;const e=Ru(),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 mu=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)))}},mu}(),n=new t({max:1e3}),r=Ja,i=Eu(),o=za,s=sc,{re:a,t:c,comparatorTrimReplace:u,tildeTrimReplace:l,caretTrimReplace:h}=Ua,d=e=>"<0.0.0-0"===e.value,p=e=>""===e.value,f=(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},m=(e,t)=>(o("comp",e,t),e=b(e,t),o("caret",e),e=y(e,t),o("tildes",e),e=w(e,t),o("xrange",e),e=C(e,t),o("stars",e),e),g=e=>!e||"x"===e.toLowerCase()||"*"===e,y=(e,t)=>e.trim().split(/\s+/).map((e=>v(e,t))).join(" "),v=(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),g(n)?a="":g(r)?a=`>=${n}.0.0 <${+n+1}.0.0-0`:g(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}))},b=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(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),g(n)?c="":g(i)?c=`>=${n}.0.0${r} <${+n+1}.0.0-0`:g(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}))},w=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>R(e,t))).join(" ")),R=(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=g(i),l=u||g(s),h=l||g(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}))},C=(e,t)=>(o("replaceStars",e,t),e.trim().replace(a[c.STAR],"")),E=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(a[t.includePrerelease?c.GTE0PRE:c.GTE0],"")),_=e=>(t,n,r,i,o,s,a,c,u,l,h,d,p)=>`${n=g(r)?"":g(i)?`>=${r}.0.0${e?"-0":""}`:g(o)?`>=${r}.${i}.0${e?"-0":""}`:s?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=g(u)?"":g(l)?`<${+u+1}.0.0-0`:g(h)?`<${u}.${+l+1}.0-0`:d?`<=${u}.${l}.${h}-${d}`:e?`<${u}.${l}.${+h+1}-0`:`<=${c}`}`.trim(),D=(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 yu}function Eu(){if(Su)return bu;Su=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}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,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");if(n&&"object"==typeof n||(n={loose:!!n,includePrerelease:!1}),""===this.operator)return""===this.value||new c(e.value,n).test(this.value);if(""===e.operator)return""===e.value||new c(this.value,n).test(e.semver);const r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),s=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),u=o(this.semver,"<",e.semver,n)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),l=o(this.semver,">",e.semver,n)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||i||s&&a||u||l}}bu=t;const n=Ja,{re:r,t:i}=Ua,o=su,s=za,a=sc,c=Cu();return bu}const _u=Cu();var Du=(e,t,n)=>{try{t=new _u(t,n)}catch(e){return!1}return t.test(e)};const Tu=Cu();var ku=(e,t)=>new Tu(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const xu=sc,Pu=Cu();var Ou=(e,t,n)=>{let r=null,i=null,o=null;try{o=new Pu(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&-1!==i.compare(e)||(r=e,i=new xu(r,n)))})),r};const Nu=sc,qu=Cu();var Iu=(e,t,n)=>{let r=null,i=null,o=null;try{o=new qu(t,n)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(r&&1!==i.compare(e)||(r=e,i=new Nu(r,n)))})),r};const Au=sc,Mu=Cu(),Fu=Kc;var Lu=(e,t)=>{e=new Mu(e,t);let n=new Au("0.0.0");if(e.test(n))return n;if(n=new Au("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 Au(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":i&&!Fu(t,i)||(i=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!i||n&&!Fu(n,i)||(n=i)}return n&&e.test(n)?n:null};const ju=Cu();var $u=(e,t)=>{try{return new ju(e,t).range||"*"}catch(e){return null}};const Hu=sc,Wu=Eu(),{ANY:Vu}=Wu,Uu=Cu(),Ku=Du,Gu=Kc,zu=zc,Bu=Zc,Ju=Yc;var Xu=(e,t,n,r)=>{let i,o,s,a,c;switch(e=new Hu(e,r),t=new Uu(t,r),n){case">":i=Gu,o=Bu,s=zu,a=">",c=">=";break;case"<":i=zu,o=Ju,s=Gu,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ku(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===Vu&&(e=new Wu(">=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 Yu=Xu;var Qu=(e,t,n)=>Yu(e,t,">",n);const Zu=Xu;var el=(e,t,n)=>Zu(e,t,"<",n);const tl=Cu();var nl=(e,t,n)=>(e=new tl(e,n),t=new tl(t,n),e.intersects(t));const rl=Du,il=Sc;const ol=Cu(),sl=Eu(),{ANY:al}=sl,cl=Du,ul=Sc,ll=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===al){if(1===t.length&&t[0].semver===al)return!0;e=n.includePrerelease?[new sl(">=0.0.0-0")]:[new sl(">=0.0.0")]}if(1===t.length&&t[0].semver===al){if(n.includePrerelease)return!0;t=[new sl(">=0.0.0")]}const r=new Set;let i,o,s,a,c,u,l;for(const t of e)">"===t.operator||">="===t.operator?i=hl(i,t,n):"<"===t.operator||"<="===t.operator?o=dl(o,t,n):r.add(t.semver);if(r.size>1)return null;if(i&&o){if(s=ul(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&&!cl(e,String(i),n))return null;if(o&&!cl(e,String(o),n))return null;for(const r of t)if(!cl(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=hl(i,e,n),a===e&&a!==i)return!1}else if(">="===i.operator&&!cl(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=dl(o,e,n),c===e&&c!==o)return!1}else if("<="===o.operator&&!cl(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))},hl=(e,t,n)=>{if(!e)return t;const r=ul(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},dl=(e,t,n)=>{if(!e)return t;const r=ul(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var pl=(e,t,n={})=>{if(e===t)return!0;e=new ol(e,n),t=new ol(t,n);let r=!1;e:for(const i of e.set){for(const e of t.set){const t=ll(i,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const fl=Ua,ml=Ga,gl=sc,yl=Qa,vl=(e,t,n)=>{const r=[];let i=null,o=null;const s=e.sort(((e,t)=>il(e,t,n)));for(const e of s){rl(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};var bl,Sl,wl,Rl,Cl,El,_l,Dl,Tl,kl,xl,Pl,Ol={parse:dc,valid:fc,clean:gc,inc:vc,diff:_c,major:Tc,minor:xc,patch:Oc,prerelease:qc,compare:Sc,rcompare:Ac,compareLoose:Fc,compareBuild:jc,sort:Hc,rsort:Vc,gt:Kc,lt:zc,eq:Rc,neq:Jc,gte:Yc,lte:Zc,cmp:su,coerce:wu,Comparator:Eu(),Range:Cu(),satisfies:Du,toComparators:ku,maxSatisfying:Ou,minSatisfying:Iu,minVersion:Lu,validRange:$u,outside:Xu,gtr:Qu,ltr:el,intersects:nl,simplifyRange:vl,subset:pl,SemVer:gl,re:fl.re,src:fl.src,tokens:fl.t,SEMVER_SPEC_VERSION:ml.SEMVER_SPEC_VERSION,compareIdentifiers:yl.compareIdentifiers,rcompareIdentifiers:yl.rcompareIdentifiers};class Nl{static fromSimpleString(e){return new Nl(e,e,e)}static fromVersionString(e){let t=Ol.valid(e);if(!t)return new Nl("invalid version","1.0.0","1.0.0");const n=e.indexOf("-");return n>=0&&(t=t.substr(0,n)),new Nl(e,t,e)}constructor(e,t,n){this.displayName=e,this.version=t,this.fullVersionString=n}eq(e){return Ol.eq(this.version,e.version)}gte(e){return Ol.gte(this.version,e.version)}lt(e){return!this.gte(e)}}Nl.defaultVersion=Nl.fromSimpleString("1.0.0"),Nl.v240=Nl.fromSimpleString("2.4.0"),Nl.v250=Nl.fromSimpleString("2.5.0"),Nl.v260=Nl.fromSimpleString("2.6.0"),Nl.v270=Nl.fromSimpleString("2.7.0"),Nl.v280=Nl.fromSimpleString("2.8.0"),Nl.v290=Nl.fromSimpleString("2.9.0"),Nl.v291=Nl.fromSimpleString("2.9.1"),Nl.v300=Nl.fromSimpleString("3.0.0"),Nl.v310=Nl.fromSimpleString("3.1.0"),Nl.v314=Nl.fromSimpleString("3.1.4"),Nl.v320=Nl.fromSimpleString("3.2.0"),Nl.v333=Nl.fromSimpleString("3.3.3"),Nl.v340=Nl.fromSimpleString("3.4.0"),Nl.v345=Nl.fromSimpleString("3.4.5"),Nl.v350=Nl.fromSimpleString("3.5.0"),Nl.v380=Nl.fromSimpleString("3.8.0"),Nl.v381=Nl.fromSimpleString("3.8.1"),Nl.v390=Nl.fromSimpleString("3.9.0"),Nl.v400=Nl.fromSimpleString("4.0.0"),Nl.v401=Nl.fromSimpleString("4.0.1"),Nl.v420=Nl.fromSimpleString("4.2.0"),Nl.v430=Nl.fromSimpleString("4.3.0"),Nl.v440=Nl.fromSimpleString("4.4.0"),Nl.v460=Nl.fromSimpleString("4.6.0"),Nl.v470=Nl.fromSimpleString("4.7.0"),Nl.v480=Nl.fromSimpleString("4.8.0"),Nl.v490=Nl.fromSimpleString("4.9.0"),function(e){e.type=new vr.RequestType("_typescript.rename")}(bl=bl||(bl={})),function(e){e.JsxClosingTag="jsxClosingTag",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"}(Sl=Sl||(Sl={})),function(e){e.none="none",e.definition="definition",e.reference="reference",e.writtenReference="writtenReference"}(wl=wl||(wl={})),function(e){e.None="None",e.Preserve="Preserve",e.ReactNative="ReactNative",e.React="React"}(Rl=Rl||(Rl={})),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"}(Cl=Cl||(Cl={})),function(e){e.Classic="Classic",e.Node="Node"}(El=El||(El={})),function(e){e.Ignore="ignore",e.Insert="insert",e.Remove="remove"}(_l=_l||(_l={})),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"}(Dl=Dl||(Dl={})),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"}(Tl=Tl||(Tl={})),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"}(kl=kl||(kl={})),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"}(xl=xl||(xl={})),function(e){e.All="All",e.SortAndCombine="SortAndCombine",e.RemoveUnused="RemoveUnused"}(Pl=Pl||(Pl={}));class ql{}ql.optional="optional",ql.deprecated="deprecated",ql.dtsFile=".d.ts",ql.tsFile=".ts",ql.tsxFile=".tsx",ql.jsFile=".js",ql.jsxFile=".jsx",ql.jsonFile=".json",ql.fileExtensionKindModifiers=[ql.dtsFile,ql.tsFile,ql.tsxFile,ql.jsFile,ql.jsxFile,ql.jsonFile];const Il={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 Al(e){return Il[e]}var Ml,Fl,Ll;!function(e){e.Syntax="syntax",e.Semantic="semantic"}(Ml=Ml||(Ml={})),function(e){e.Cancelled=class{constructor(e){this.reason=e,this.type="cancelled"}},e.NoContent={type:"noContent"},e.NoServer={type:"noServer"}}(Fl=Fl||(Fl={})),function(e){e[e.Syntax=0]="Syntax",e[e.EnhancedSyntax=1]="EnhancedSyntax",e[e.Semantic=2]="Semantic"}(Ll=Ll||(Ll={}));class jl{constructor(...e){this.capabilities=new Set(e)}has(e){return this.capabilities.has(e)}}class $l extends Error{static create(e,t,n){const r=$l.parseErrorText(n);return new $l(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 Hl=l(d.randomBytes),Wl="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~".split(""),Vl="0123456789".split(""),Ul="CDEHKMPRTUWXY012458".split(""),Kl="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~".split(""),Gl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),zl=new Set([void 0,"hex","base64","url-safe","numeric","distinguishable","ascii-printable","alphanumeric"]),Bl=(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(!zl.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,Wl);if("numeric"===r)return e(n,Vl);if("distinguishable"===r)return e(n,Ul);if("ascii-printable"===r)return e(n,Kl);if("alphanumeric"===r)return e(n,Gl);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(""))},Jl=Bl(((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)));Jl.async=Bl((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 Hl(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 Hl(e)).toString(t).slice(0,n)));const Xl=a,Yl=h,Ql=Symbol.for("__RESOLVED_TEMP_DIRECTORY__");T[Ql]||Object.defineProperty(T,Ql,{value:Xl.realpathSync(Yl.tmpdir())});var Zl=T[Ql];R(w.pipeline);const eh=(e="")=>g.join(Zl,e+Jl({length:32}));function th({name:t,extension:n}={}){if(t){if(null!=n)throw new Error("The `name` and `extension` options are mutually exclusive");return g.join(function({prefix:t=""}={}){const n=eh(t);return e.mkdirSync(n),n}(),t)}return eh()+(null==n?"":"."+n.replace(/^\./,""))}class nh{constructor(e,t){this._serverId=e,this._tracer=t,this.cancellationPipeName=th({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 rh=new class{create(e,t){return new nh(e,t)}};var ih,oh,sh;!function(e){e[e.Normal=1]="Normal",e[e.LowPriority=2]="LowPriority",e[e.Fence=3]="Fence"}(ih=ih||(ih={}));class ah{constructor(){this.queue=[],this.sequenceNumber=0}get length(){return this.queue.length}enqueue(e){if(e.queueingType===ih.Normal){let t=this.queue.length-1;for(;t>=0&&this.queue[t].queueingType===ih.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 ch{constructor(){this._callbacks=new Map,this._asyncCallbacks=new Map}destroy(e){const t=new Fl.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"}(oh=oh||(oh={}));class uh{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 ah,this._callbacks=new ch,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{this.fetchCallback(e)?.onSuccess(new Fl.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(Fl.NoContent):t.onError($l.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:uh.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){this.fetchCallback(t.seq)?.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 uh.fenceCommands.has(e)?ih.Fence:t?ih.LowPriority:ih.Normal}}uh.fenceCommands=new Set(["change","close","open","updateOpen"]);class lh{constructor(e,t){this.servers=e,this.delegate=t}execute(e,t,n){if(lh.sharedCommands.has(e)&&void 0===n.executionTarget){const r=this.servers.map((()=>sh.Unresolved));let i;if(n.token){const e=new ye.CancellationTokenSource;n.token.onCancellationRequested((()=>{r.some((e=>e===sh.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]=sh.Resolved;const n=r.find((e=>2===e.type));return n&&this.delegate.onFatalError(e,n.err),t}),(t=>{throw r[s]=new sh.Errored(t),r.some((e=>e===sh.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}'`)}}lh.sharedCommands=new Set([Sl.Change,Sl.Close,Sl.Open,Sl.UpdateOpen,Sl.Configure]);class hh{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 lh([{server:this.syntaxServer,canRun:(e,t)=>{switch(t.executionTarget){case oh.Semantic:return!1;case oh.Syntax:return!0}return!!hh.syntaxAlwaysCommands.has(e)||!hh.semanticCommands.has(e)&&!!(n&&this.projectLoading&&hh.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)}}hh.syntaxAlwaysCommands=new Set([Sl.NavTree,Sl.GetOutliningSpans,Sl.JsxClosingTag,Sl.SelectionRange,Sl.Format,Sl.Formatonkey,Sl.DocCommentTemplate]),hh.semanticCommands=new Set([Sl.Geterr,Sl.GeterrForProject,Sl.ProjectInfo,Sl.ConfigurePlugin]),hh.syntaxAllowedCommands=new Set([Sl.CompletionEntryDetails,Sl.CompletionInfo,Sl.Definition,Sl.DefinitionAndBoundSpan,Sl.DocumentHighlights,Sl.Implementation,Sl.Navto,Sl.Quickinfo,Sl.References,Sl.Rename,Sl.SignatureHelp]),function(e){e.Unresolved={type:0},e.Resolved={type:1};e.Errored=class{constructor(e){this.err=e,this.type=2}}}(sh||(sh={}));class dh{fork(e,t,n,r){const i=e.tsServerPath,o=e.version?.gte(Nl.v490),s=[...t];o&&s.push("--useNodeIpc");const a=C.fork(i,s,{silent:!0,cwd:void 0,env:ph(process.env,i),execArgv:fh(n,r),stdio:o?["pipe","pipe","pipe","ipc"]:void 0});return o?new gh(a):new yh(a)}}function ph(e,t){const n=Object.assign({},e);return n.NODE_PATH=g.join(t,"..","..",".."),n.PATH=n.PATH||process.env.PATH,n}function fh(e,t){const n=[],r=function(e){if("syntax"===e)return;const t=mh()||process.env.TSS_DEBUG;if(t){const e=parseInt(t);if(!isNaN(e))return e}return}(e);if(r){const e=mh()?"--inspect-brk":"--inspect";n.push(`${e}=${r}`)}return t.maxTsServerMemory&&n.push(`--max-old-space-size=${t.maxTsServerMemory}`),n}function mh(){return process.env.TSS_DEBUG_BRK}class gh{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 yh{constructor(e){this._process=e,this._reader=new vh(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 vh{constructor(e){this.buffer=new Eh,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 bh=8192,Sh=Buffer.byteLength("Content-Length: ","utf8"),wh=Buffer.from(" ","utf8")[0],Rh=Buffer.from("\r","utf8")[0],Ch=Buffer.from("\n","utf8")[0];class Eh{constructor(){this.index=0,this.buffer=Buffer.allocUnsafe(bh)}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)/bh)+1)*bh;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]===wh||this.buffer[t]===Rh||this.buffer[t]===Ch);)t++;if(this.index<t+Sh)return e;t+=Sh;const n=t;for(;t<this.index&&this.buffer[t]!==Rh;)t++;if(t+3>=this.index||this.buffer[t+1]!==Ch||this.buffer[t+2]!==Rh||this.buffer[t+3]!==Ch)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]===Rh||this.buffer[n]===Ch);)n++;return this.buffer.copy(this.buffer,0,n),this.index=this.index-n,t}}var _h,Dh,Th,kh;function xh(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"}(_h=_h||(_h={})),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"}}}(_h=_h||(_h={}));class Ph{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 hh({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(Ll.Semantic))return 3;switch(n.useSyntaxServer){case 1:return 3;case 0:return 0;case 2:return e.version?.gte(Nl.v340)?e.version?.gte(Nl.v400)?2:1:0}}spawnTsServer(e,t,n){const r=new dh,i=rh.create(e,this._tracer),{args:o,tsServerLogFile:s}=this.getTsServerArgs(e,n,this._apiVersion,i.cancellationPipeName);this.isLoggingEnabled(n)&&(s?this._logger.logIgnoringVerbosity(bi.Info,`<${e}> Log file: ${s}`):this._logger.logIgnoringVerbosity(bi.Error,`<${e}> Could not create log directory`));const a=r.fork(t,o,e,n);return this._logger.log("Starting tsserver"),new uh(e,this.kindToServerType(e),a,s,i,t,this._tracer)}kindToServerType(e){return"syntax"===e?Ml.Syntax:Ml.Semantic}getTsServerArgs(e,t,n,r){const i=[];let o;"syntax"===e&&(n.gte(Nl.v401)?i.push("--serverMode","partialSemantic"):i.push("--syntaxOnly")),n.gte(Nl.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=g.join(e,"tsserver.log"),i.push("--logVerbosity",_h.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!==_h.Off}}!function(e){e[e.Off=0]="Off",e[e.Messages=1]="Messages",e[e.Verbose=2]="Verbose"}(Dh=Dh||(Dh={})),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}}}(Dh=Dh||(Dh={}));class Oh{constructor(e,t){this.logger=e,this.trace=t}traceRequest(e,t,n,r){if(this.trace===Dh.Off)return;let i;this.trace===Dh.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===Dh.Off)return;let r;this.trace===Dh.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!==Dh.Off&&this.logTrace(e,`Async response received: ${t} (${n}). Request took ${Date.now()-r.queuingStartTime} ms.`)}traceEvent(e,t){if(this.trace===Dh.Off)return;let n;this.trace===Dh.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!==Dh.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}}}(Th||(Th={}));class Nh{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 qh{constructor(e){this.options=e,this.serverState=Th.None,this.apiVersion=e.typescriptVersion.version||Nl.defaultVersion,this.typescriptVersionSource=e.typescriptVersion.source,this.logger=new wi(e.logger,"[tsclient]"),this.tsserverLogger=new wi(e.logger,"[tsserver]"),this.loadingIndicator=new Nh(e.lspClient),this.tracer=new Oh(this.tsserverLogger,e.trace)}get capabilities(){return 1===this.options.useSyntaxServer?new jl(Ll.Syntax,Ll.EnhancedSyntax):this.apiVersion.gte(Nl.v400)?new jl(Ll.Syntax,Ll.EnhancedSyntax,Ll.Semantic):new jl(Ll.Syntax,Ll.Semantic)}hasCapabilityForResource(e,t){if(!this.capabilities.has(t))return!1;switch(t){case Ll.Semantic:return["file","untitled"].includes(e.scheme);case Ll.Syntax:case Ll.EnhancedSyntax:return!0}}start(){const e=new Ph(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 Th.Running(e,this.apiVersion,void 0,!0),e.onExit((e=>{this.serverState=Th.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 Th.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(Nl.v300)&&this.capabilities.has(Ll.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=Th.None}notify(e,t){this.executeWithoutWaitingForResponse(e,t)}requestGeterr(e,t){return this.executeAsync(Sl.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===Sl.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(Fl.NoServer)]}fatalError(e,t){if(this.tsserverLogger.error(`A non-recoverable error occurred while executing command: ${e}`),t instanceof $l&&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 $l&&(this.serverState=new Th.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,E(n[4]||h),E(n[5]||h),E(n[7]||h),E(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 C=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function E(e){return e.match(C)?e.replace(C,(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)}}(_||(_={}))})(),kh=r})();const{URI:Ih,Utils:Ah}=kh;var Mh,Fh,Lh;!function(e){e.fromTextSpan=t=>e.fromLocations(t.start,t.end),e.toTextSpan=e=>({start:Fh.toLocation(e.start),end:Fh.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=Fh.Max(t.start,e.start),r=Fh.Min(t.end,e.end);if(!Fh.isAfter(n,r))return _e.Range.create(n,r)},e.union=function(e,t){const n=Fh.Min(t.start,e.start),r=Fh.Max(t.end,e.end);return _e.Range.create(n,r)}}(Mh=Mh||(Mh={})),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}(Fh=Fh||(Fh={})),function(e){e.fromTextSpan=(e,t)=>_e.Location.create(e,Mh.fromTextSpan(t))}(Lh=Lh||(Lh={}));const jh=/\\/g;function $h(e){if(e.startsWith("zipfile:"))return e;const t=Ih.parse(e);return"file"===t.scheme?Vh(t.fsPath):void 0}function Hh(e,t){if(e.startsWith("zipfile:"))return e;const n=Ih.file(e),r=Wh(n.fsPath),i=t?.get(r);return i?i.uri:n.toString()}function Wh(e){return Vh(Ih.file(e).fsPath)}function Vh(e){return e.replace(jh,"/")}function Uh(e,t){const n=Wh(Ih.file(e).fsPath),r=t?.get(n);return r?r.version:null}function Kh(e,t){return{uri:Hh(e.file,t),range:{start:Fh.fromLocation(e.start),end:Fh.fromLocation(e.end)}}}const Gh={"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 zh(e){return Gh[e]||ye.SymbolKind.Variable}function Bh(e){switch(e){case"error":default:return ye.DiagnosticSeverity.Error;case"warning":return ye.DiagnosticSeverity.Warning;case"suggestion":return ye.DiagnosticSeverity.Hint}}function Jh(e,t,n){const r={range:{start:Fh.fromLocation(e.start),end:Fh.fromLocation(e.end)},message:e.text,severity:Bh(e.category),code:e.code,source:e.source||"typescript",relatedInformation:Xh(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 Xh(e,t){if(!e)return;const n=[];for(const r of e){const e=r.span;e&&n.push(ye.DiagnosticRelatedInformation.create(Kh(e,t),r.message))}return n}function Yh(e){return ye.SelectionRange.create(Mh.fromTextSpan(e.textSpan),e.parent?Yh(e.parent):void 0)}function Qh(e){return{range:{start:Fh.fromLocation(e.start),end:Fh.fromLocation(e.end)},newText:e.newText}}function Zh(e,t){return{textDocument:{uri:Hh(e.fileName,t),version:Uh(e.fileName,t)},edits:e.textChanges.map((e=>Qh(e)))}}function ed(e){return e.highlightSpans.map((e=>({kind:td(e.kind),range:{start:Fh.fromLocation(e.start),end:Fh.fromLocation(e.end)}})))}function td(e){switch(e){case wl.definition:return ye.DocumentHighlightKind.Write;case wl.reference:case wl.writtenReference:return ye.DocumentHighlightKind.Read;default:return ye.DocumentHighlightKind.Text}}class nd{constructor(e,t,n,r){this.uri=e,this.publishDiagnostics=t,this.documents=n,this.features=r,this.diagnosticsPerKind=new Map,this.firePublishDiagnostics=Va((()=>{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(Jh(n,this.documents,this.features));return e}}class rd{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),Ll.Semantic))return;this.ignoredDiagnosticCodes.size&&(n=n.filter((e=>!this.isDiagnosticIgnored(e))));const r=Hh(t,this.documents),i=this.diagnostics.get(r)||new nd(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=Hh(e,this.documents);return this.diagnostics.get(t)?.getDiagnostics()||[]}isDiagnosticIgnored(e){return void 0!==e.code&&this.ignoredDiagnosticCodes.has(e.code)}}var id,od=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))},sd=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=ud(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=cd(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,od([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=cd(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 ad(e,t){if(e.length<=1)return e;var n=e.length/2|0,r=e.slice(0,n),i=e.slice(n);ad(r,t),ad(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 cd(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 ud(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 ld(e){var t=ud(e.range);return t!==e.range?{newText:e.newText,range:t}:e}!function(e){e.create=function(e,t,n,r){return new sd(e,t,n,r)},e.update=function(e,t,n){if(e instanceof sd)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=ad(t.map(ld),(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("")}}(id||(id={}));class hd{constructor(e){const{uri:t,languageId:n,version:r,text:i}=e;this.document=id.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)}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=id.create(this.uri,this.languageId,e,r)}}class dd{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 hd(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?Ih.parse(t.uri):Ih.file(e)}}class pd{static async execute(e,t,n,r,i,o,s){if(r.apiVersion.lt(pd.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=$h(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=Fh.toFileLocationRequestArgs(a,t);return await i.withProgress({message:"Finding source definitions…",reporter:o},(async()=>{const e=await r.request(Sl.FindSourceDefinition,c,s);if("response"===e.type&&e.body)return e.body.map((e=>Kh(e,n)));i.showErrorMessage("No source definitions found.")}))}}pd.id="_typescript.goToSourceDefinition",pd.minVersion=Nl.v470;const fd={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:pd.id},md=new ye.NotificationType("$/typescriptVersion");class gd{constructor(e=""){this.value=e}appendText(e,t=0){var n;return this.value+=(n=e,n.replace(/[\\`*_{}[\]()#+\-!]/g,"\\$&")).replace(/([ \t]+)/g,((e,t)=>"&nbsp;".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 yd(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 vd(e,t){switch(e.name){case"augments":case"extends":case"param":case"template":{const n=Sd(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"+yd(r):`${yd(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=Sd(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 yd(r)}(e,t);return r?n+(r.match(/\r\n|\n/g)?" \n"+r:`${r}`):n}function bd(e,t){return yd(Sd(e,t))}function Sd(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:Cd(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=Cd(t.slice(1).join(" "));n.push(`[${r.linkcode?"`"+e+"`":e}](${t[0]})`)}}else n.push(Cd(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 yd(n.join(""))}function wd(e,t,n){const r=new gd;return Rd(r,e,t,n),r.value?r.toMarkupContent():void 0}function Rd(e,t,n,r){if(t&&e.appendMarkdown(bd(t,r)),n){const t=function(e,t){return e.map((e=>vd(e,t))).join(" \n\n")}(n,r);t&&e.appendMarkdown("\n\n"+t)}return e}function Cd(e){return e.replace(/`/g,"\\$&")}class Ed{static isSnippetString(e){return e instanceof Ed||!!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+=Ed._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 Ed;t._tabstop=this._tabstop,e(t),this._tabstop=t._tabstop,e=t.value}else e=Ed._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 Ed;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 _d(e,t,n,r,i,o,s,a){const c={label:e.name,kind:Td(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 Dl.memberGetAccessorElement:case Dl.memberSetAccessorElement:case Dl.constructSignatureElement:case Dl.callSignatureElement:case Dl.indexSignatureElement:case Dl.enumElement:case Dl.interfaceElement:t.push(".");break;case Dl.moduleElement:case Dl.alias:case Dl.constElement:case Dl.letElement:case Dl.variableElement:case Dl.localVariableElement:case Dl.memberVariableElement:case Dl.classElement:case Dl.functionElement:case Dl.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||xd(c.kind,o))&&(c.insertTextFormat=ye.InsertTextFormat.Snippet),h&&(c.detail=bd(h,i));const{line:d,optionalReplacementRange:p,isMemberCompletion:f,dotAccessorContext:m}=a;let g=function(e,t,n,r,i){if(e)return{replace:Dd(Mh.fromTextSpan(e),r)};if(i.completionInsertReplaceSupport&&t){const e=Dd(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:Mh.union(m.range,p)}:{replace:m.range},y=e)}if(e.kindModifiers){const t=new Set(e.kindModifiers.split(/,|\s+/g));if(t.has(ql.optional)&&(y||(y=c.label),c.filterText||(c.filterText=c.label),c.label+="?"),t.has(ql.deprecated)&&(c.tags=[ye.CompletionItemTag.Deprecated]),e.kind===Dl.scriptElement)for(const n of ql.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 Dd(e,t){return e.start.line!==e.end.line?ye.Range.create(e.start,t.getLineEnd(e.start.line)):e}function Td(e){switch(e){case Dl.primitiveType:case Dl.keyword:return ye.CompletionItemKind.Keyword;case Dl.constElement:return ye.CompletionItemKind.Constant;case Dl.letElement:case Dl.variableElement:case Dl.localVariableElement:case Dl.alias:return ye.CompletionItemKind.Variable;case Dl.memberVariableElement:case Dl.memberGetAccessorElement:case Dl.memberSetAccessorElement:return ye.CompletionItemKind.Field;case Dl.functionElement:return ye.CompletionItemKind.Function;case Dl.memberFunctionElement:case Dl.constructSignatureElement:case Dl.callSignatureElement:case Dl.indexSignatureElement:return ye.CompletionItemKind.Method;case Dl.enumElement:return ye.CompletionItemKind.Enum;case Dl.moduleElement:case Dl.externalModuleName:return ye.CompletionItemKind.Module;case Dl.classElement:case Dl.typeElement:return ye.CompletionItemKind.Class;case Dl.interfaceElement:return ye.CompletionItemKind.Interface;case Dl.warning:case Dl.scriptElement:return ye.CompletionItemKind.File;case Dl.directory:return ye.CompletionItemKind.Folder;case Dl.string:return ye.CompletionItemKind.Constant}return ye.CompletionItemKind.Property}async function kd(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 '${bd(o,r)}'`);const s=bd(e,r);s&&i.push(s);return i.join("\n")}(t,i);const{documentation:a,tags:c}=t;e.documentation=wd(a,c,i);const u=Wh(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(Qh(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:fd.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&&xd(e.kind,o)){const{line:i,offset:o}=e.data,s=Fh.fromLocation({line:i,offset:o}),a=await async function(e,t,n,r){try{const r=Fh.toFileLocationRequestArgs(e,t),i=await n.request(Sl.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(Al(a.kind)){case xl.methodName:case xl.functionName:case xl.text:case xl.propertyName:0===i&&0===o&&(n=!0);break;case xl.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 xl.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 Ed;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 xd(e,t){return!0===t.completeFunctionCalls&&(e===ye.CompletionItemKind.Function||e===ye.CompletionItemKind.Method)}function Pd(e){switch(e){case"@":case"#":case" ":case".":case'"':case"'":case"`":case"/":case"<":return e;default:return}}function Od(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:bd(n,t),documentation:wd(r,void 0,t)}}(e,t))),r={label:bd(e.prefixDisplayParts,t),documentation:wd(e.documentation,e.tags.filter((e=>"param"!==e.name)),t),parameters:n};return r.label+=n.map((e=>e.label)).join(bd(e.separatorDisplayParts,t)),r.label+=bd(e.suffixDisplayParts,t),r}(e,n)));return{activeSignature:Nd(e,r,t),activeParameter:qd(e),signatures:r}}function Nd(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 qd(e){const t=e.items[e.selectedItemIndex];return t?.isVariadic?Math.min(e.argumentIndex,t.parameters.length-1):e.argumentIndex}function Id(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 Ad(e,t){return ye.CodeAction.create(e.description,ye.Command.create(e.description,fd.SELECT_REFACTORING,e,t),ye.CodeActionKind.Refactor)}function Md(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,fd.APPLY_REFACTORING,{...n,refactor:t.name,action:e.name}),r}class Fd{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+Fd.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new Fd(this.value+Fd.sep+e)}}Fd.sep=".",Fd.Empty=new Fd(ye.CodeActionKind.Empty),Fd.QuickFix=new Fd(ye.CodeActionKind.QuickFix),Fd.Refactor=new Fd(ye.CodeActionKind.Refactor),Fd.Source=new Fd(ye.CodeActionKind.Source),Fd.SourceAddMissingImportsTs=Fd.Source.append("addMissingImports").append("ts"),Fd.SourceFixAll=new Fd(ye.CodeActionKind.SourceFixAll),Fd.SourceFixAllTs=Fd.SourceFixAll.append("ts"),Fd.SourceOrganizeImports=new Fd(ye.CodeActionKind.SourceOrganizeImports),Fd.SourceOrganizeImportsTs=Fd.SourceOrganizeImports.append("ts"),Fd.SourceRemoveUnusedImportsTs=Fd.Source.append("removeUnusedImports").append("ts"),Fd.SourceRemoveUnusedTs=Fd.Source.append("removeUnused").append("ts"),Fd.SourceSortImportsTs=Fd.Source.append("sortImports").append("ts");const Ld=[{title:"Organize Imports",kind:Fd.SourceOrganizeImportsTs,mode:Pl.All},{minVersion:Nl.v430,title:"Sort Imports",kind:Fd.SourceSortImportsTs,mode:Pl.SortAndCombine},{minVersion:Nl.v490,title:"Remove Unused Imports",kind:Fd.SourceRemoveUnusedImportsTs,mode:Pl.RemoveUnused}];function jd(e,t,n){return t&&0!==t.body.length?[ye.CodeAction.create(e.title,{documentChanges:t.body.map((e=>Zh(e,n)))},e.kind.value)]:[]}function $d(e,t){return Hd(e,t,{start:Mh.fromTextSpan(e.spans[0]).start,end:Mh.fromTextSpan(e.spans[e.spans.length-1]).end})}function Hd(e,t,n){let r=Vd(e);for(const i of e.spans){const o=Mh.fromTextSpan(i);if(!Mh.intersection(n,o))continue;const s=[];if(e.childItems)for(const t of e.childItems)if(t.spans.some((e=>!!Mh.intersection(o,Mh.fromTextSpan(e))))){const e=Hd(t,s,o);r=r||e}let a=o;if(e.nameSpan){const t=Mh.fromTextSpan(e.nameSpan);Mh.intersection(o,t)&&(a=t)}r&&t.push({name:e.text,detail:"",kind:zh(e.kind),range:o,selectionRange:a,children:s})}return r}function Wd(e,t,n,r){let i=Vd(t);const o=t.text;for(const s of t.spans){const a=Mh.fromTextSpan(s),c=[];if(t.childItems)for(const n of t.childItems)if(n.spans.some((e=>!!Mh.intersection(a,Mh.fromTextSpan(e))))){const t=Wd(e,n,c,o);i=i||t}i&&(n.push({name:o,kind:zh(t.kind),location:{uri:e,range:a},containerName:r}),n.push(...c))}return i}function Vd(e){return e.kind!==Dl.alias&&!(!e.text||"<function>"===e.text||"<class>"===e.text)}function Ud(e,t,n){const r=function(e){return e.kind===Dl.scriptElement||e.kind===Dl.moduleElement&&1===e.selectionSpan.start.line&&1===e.selectionSpan.start.offset}(e),i=r?g.basename(e.file):e.name,o=r?n?g.relative(n,g.dirname(e.file)):g.dirname(e.file):e.containerName??"",s={kind:Kd(e.kind),name:i,detail:o,uri:Hh(e.file,t),range:Mh.fromTextSpan(e.span),selectionRange:Mh.fromTextSpan(e.selectionSpan)};return(e.kindModifiers?function(e){return new Set(e.split(/,|\s+/g))}(e.kindModifiers):void 0)?.has(Tl.deprecatedModifier)&&(s.tags=[ye.SymbolTag.Deprecated]),s}function Kd(e){switch(e){case Dl.moduleElement:return ye.SymbolKind.Module;case Dl.classElement:return ye.SymbolKind.Class;case Dl.enumElement:return ye.SymbolKind.Enum;case Dl.enumMemberElement:return ye.SymbolKind.EnumMember;case Dl.interfaceElement:return ye.SymbolKind.Interface;case Dl.indexSignatureElement:case Dl.callSignatureElement:case Dl.memberFunctionElement:return ye.SymbolKind.Method;case Dl.memberVariableElement:case Dl.memberGetAccessorElement:case Dl.memberSetAccessorElement:return ye.SymbolKind.Property;case Dl.variableElement:case Dl.letElement:case Dl.constElement:case Dl.localVariableElement:case Dl.alias:return ye.SymbolKind.Variable;case Dl.functionElement:case Dl.localFunctionElement:return ye.SymbolKind.Function;case Dl.constructSignatureElement:case Dl.constructorImplementationElement:return ye.SymbolKind.Constructor;case Dl.typeParameterElement:return ye.SymbolKind.TypeParameter;case Dl.string:return ye.SymbolKind.String;default:return ye.SymbolKind.Variable}}const Gd=new Set([6196,6133]),zd=new Set([7027]),Bd=new Set([2420]),Jd=new Set([2552,2304]),Xd=new Set([1308]);async function Yd(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={...Mh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(Sl.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=>Zh(e,r)))),o;const l={scope:{type:"file",args:{file:n}},fixId:u.fixId},h=await t.request(Sl.GetCombinedCodeFix,l);return"response"===h.type&&h.body?(o.push(...h.body.changes.map((e=>Zh(e,r)))),o):o}return o}class Qd{}class Zd extends Qd{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={...Mh.toFileRangeRequestArgs(n,s.range),errorCodes:[+s.code]},c=await t.request(Sl.GetCodeFixes,e);if("response"!==c.type)continue;const u=c.body?.find((e=>e.fixName===a));if(u){o.push(...u.changes.map((e=>Zh(e,r))));break}}return o}([{codes:Bd,fixName:"fixClassIncorrectlyImplementsInterface"},{codes:Xd,fixName:"fixAwaitInSyncFunction"}],e,t,n,r)),i.push(...await Yd([{codes:zd,fixName:"fixUnreachableCode"}],e,t,n,r)),i.length?ye.CodeAction.create(this.title,{documentChanges:i},Zd.kind.value):null}}Zd.kind=Fd.SourceFixAllTs;class ep extends Qd{constructor(){super(...arguments),this.title="Remove all unused code"}async build(e,t,n,r){const i=await Yd([{codes:Gd,fixName:"unusedIdentifier"}],e,t,n,r);return i.length?ye.CodeAction.create(this.title,{documentChanges:i},ep.kind.value):null}}ep.kind=Fd.SourceRemoveUnusedTs;class tp extends Qd{constructor(){super(...arguments),this.title="Add all missing imports"}async build(e,t,n,r){const i=await Yd([{codes:Jd,fixName:"import"}],e,t,n,r);return i.length?ye.CodeAction.create(this.title,{documentChanges:i},tp.kind.value):null}}tp.kind=Fd.SourceAddMissingImportsTs;class np{static get kinds(){return np.kindProviders.map((e=>e.kind))}constructor(e){this.client=e}async provideCodeActions(e,t,n,r){const i=[];for(const o of np.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||[]))}}np.kindProviders=[Zd,ep,tp];class rp{static async provideInlayHints(e,t,n,r,i,o,s){if(r.apiVersion.lt(rp.minVersion))return i.showErrorMessage("Inlay Hints request failed. Requires TypeScript 4.4+."),[];const a=$h(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(Sl.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(Fh.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 ip,op,sp,ap,cp,up;function lp(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&ip.modifierMask,l=(c>>ip.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}rp.minVersion=Nl.v440,function(e){e[e.typeOffset=8]="typeOffset",e[e.modifierMask=255]="modifierMask"}(ip||(ip={}));class hp{constructor(e){this.rootPath=e}getNewLogDirectory(){const t=this.logDirectory();if(t)try{return e.mkdtempSync(g.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}}}up="win32"===process.platform||T.TESTING_WINDOWS?function(){if(sp)return op;sp=1,op=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 op}():function(){if(cp)return ap;cp=1,ap=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 ap}();var dp=pp;function pp(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){pp(e,t||{},(function(e,t){e?r(e):n(t)}))}))}up(e,t||{},(function(e,r){e&&("EACCES"===e.code||t&&t.ignoreErrors)&&(e=null,r=!1),n(e,r)}))}pp.sync=function(e,t){try{return up.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||"EACCES"===e.code)return!1;throw e}};const fp=dp,{join:mp,delimiter:gp,sep:yp,posix:vp}=s,bp="win32"===process.platform,Sp=new RegExp(`[${vp.sep}${yp===vp.sep?"":yp}]`.replace(/(\\)/g,"\\$1")),wp=new RegExp(`^\\.${Sp.source}`),Rp=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Cp=(e,{path:t=process.env.PATH,pathExt:n=process.env.PATHEXT,delimiter:r=gp})=>{const i=e.match(Sp)?[""]:[...bp?[process.cwd()]:[],...(t||"").split(r)];if(bp){const t=n||[".EXE",".CMD",".BAT",".COM"].join(r),o=t.split(r);return e.includes(".")&&""!==o[0]&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:t}}return{pathEnv:i,pathExt:[""]}},Ep=(e,t)=>{const n=/^".*"$/.test(e)?e.slice(1,-1):e;return(!n&&wp.test(t)?t.slice(0,2):"")+mp(n,t)},_p=async(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=Cp(e,t),o=[];for(const s of n){const n=Ep(s,e);for(const e of r){const r=n+e;if(await fp(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 Rp(e)};var Dp=_p;_p.sync=(e,t={})=>{const{pathEnv:n,pathExt:r,pathExtExe:i}=Cp(e,t),o=[];for(const s of n){const n=Ep(s,e);for(const e of r){const r=n+e;if(fp.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 Rp(e)};const Tp={directory:"isDirectory",file:"isFile"};const kp=(e,t)=>t[Tp[e]]();function xp(t,{cwd:n=D.cwd(),type:r="file",allowSymlinks:i=!0}={}){var o;!function(e){if(!Object.hasOwnProperty.call(Tp,e))throw new Error(`Invalid type specified: ${e}`)}(r),n=(o=n)instanceof URL?_(o):o;const s=i?e.statSync:e.lstatSync;for(const e of t)try{const t=s(g.resolve(n,e));if(kp(r,t))return e}catch{}}const Pp=Symbol("findUpStop");function Op(e,t={}){let n=g.resolve(((r=t.cwd)instanceof URL?_(r):r)||"");var r;const{root:i}=g.parse(n),o=t.stopAt||i,s=t.limit||Number.POSITIVE_INFINITY,a=[e].flat(),c=t=>{if("function"!=typeof e)return xp(a,t);const n=e(t.cwd);return"string"==typeof n?xp([n],t):n},u=[];for(;;){const e=c({...t,cwd:n});if(e===Pp)break;if(e&&u.push(g.resolve(n,e)),n===o||u.length>=s)break;n=g.dirname(n)}return u}function Np({cwd:e}={}){return function(e,t={}){return Op(e,{...t,limit:1})[0]}("package.json",{cwd:e})}function qp(e,r){if(t(e).isDirectory()){const t=r.map((t=>y(e,t))).find(n);if(t)return t}const i=y(e,"..");if(i!==e)return qp(i,r)}class Ip{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(g.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(g.sep);let i=g.join(r,"package.json");if(e.existsSync(i)||"built"===g.basename(r)&&(i=g.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}"`),Nl.fromVersionString(s.version)):(this.logger.log("Failed reading version number from package.json."),null)}}const Ap=["node_modules/typescript/lib",".vscode/pnpify/typescript/lib",".yarn/sdks/typescript/lib"];class Mp{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(!g.isAbsolute(t)){const e=Dp.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"===g.basename(t))return this.logger.log(`Resolved tsserver location: ${t}`),new Ip("user-setting",t,this.logger);t=g.dirname(t),this.logger.log(`Resolved directory path from a file path: ${t}`)}try{const e=Np({cwd:t});this.logger.log(`Resolved package.json location: "${e}"`),e&&(t=g.join(g.dirname(e),"lib","tsserver.js"),this.logger.log(`Resolved tsserver location: "${t}"`))}catch{}return new Ip("user-setting",t,this.logger)}getWorkspaceVersion(e){for(const t of e){const e=qp(t,Ap);if(e){const t=g.join(e,"tsserver.js"),n=new Ip("workspace",t,this.logger);if(n.isValid)return n}}return null}bundledVersion(){const e=E(import.meta.url);try{const t=e.resolve("typescript"),n=g.join(g.dirname(t),"tsserver.js");return new Ip("bundled",n,this.logger)}catch(e){return null}}}const Fp=Object.freeze({module:Cl.ESNext,moduleResolution:El.Node,target:kl.ES2020,jsx:Rl.React});function Lp(e){const t={...Fp};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 jp=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===$p}(e)}(e)};var $p="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function Hp(e,t){return!1!==t.clone&&t.isMergeableObject(e)?Gp((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function Wp(e,t,n){return e.concat(t).map((function(e){return Hp(e,n)}))}function Vp(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 Up(e,t){try{return t in e}catch(e){return!1}}function Kp(e,t,n){var r={};return n.isMergeableObject(e)&&Vp(e).forEach((function(t){r[t]=Hp(e[t],n)})),Vp(t).forEach((function(i){(function(e,t){return Up(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(Up(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return Gp;var n=t.customMerge(e);return"function"==typeof n?n:Gp}(i,n)(e[i],t[i],n):r[i]=Hp(t[i],n))})),r}function Gp(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||Wp,n.isMergeableObject=n.isMergeableObject||jp,n.cloneUnlessOtherwiseSpecified=Hp;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):Kp(e,t,n):Hp(t,n)}Gp.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return Gp(e,n,t)}),{})};var zp=Gp;const Bp={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,providePrefixAndSuffixTextForRename:!0,provideRefactorNotApplicableReason:!0,quotePreference:"auto",useLabelDetailsInCompletionEntries:!0},Jp={implicitProjectConfiguration:{checkJs:!1,experimentalDecorators:!1,module:Cl.ESNext,strictFunctionTypes:!0,strictNullChecks:!0,target:kl.ES2020}};class Xp{constructor(e){this.documents=e,this.tsPreferences=zp({},Bp),this.workspaceConfiguration=zp({},Jp),this.tspClient=null}mergeTsPreferences(e){this.tsPreferences=zp(this.tsPreferences,e)}setWorkspaceConfiguration(e){this.workspaceConfiguration=zp(Jp,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(Sl.Configure,r)}async configureGloballyFromDocument(e,t){const n={formatOptions:this.getFormattingOptions(e,t),preferences:this.getPreferences(e)};await(this.tspClient?.request(Sl.Configure,n))}getPreferences(e){if(this.tspClient?.apiVersion.lt(Nl.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)?.format,...t};return void 0===n.convertTabsToSpaces&&(n.convertTabsToSpaces=t?.insertSpaces),void 0===n.indentSize&&(n.indentSize=t?.tabSize),n}getQuoteStylePreference(e){switch(e.quotePreference){case"single":return"single";case"double":return"double";default:return this.tspClient?.apiVersion.gte(Nl.v333)?"auto":void 0}}getWorkspacePreferencesForFile(e){const t=this.documents.get(e)?.languageId.startsWith("typescript")?"typescript":"javascript";return this.workspaceConfiguration[t]||{}}getAutoImportFileExcludePatternsPreference(e){if(e&&0!==this.tsPreferences.autoImportFileExcludePatterns.length)return this.tsPreferences.autoImportFileExcludePatterns.map((t=>{const n=t.replace(/\\/g,"/"),r=/^\.\.?($|\/)/.test(n);return g.posix.isAbsolute(t)?t:t.startsWith("*")?`/${n}`:r?g.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 dd,this.pendingDebouncedRequest=!1,this.doRequestDiagnosticsDebounced=Va((()=>this.doRequestDiagnostics()),200),this.configurationManager=new Xp(this.documents),this.logger=new wi(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?$h(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:bi.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(Nl.v470)}}n&&(this.features.definitionLinkSupport=n.linkSupport&&d.version?.gte(Nl.v270)),r&&(this.features.diagnosticsTagSupport=Boolean(r.tagSupport))}this.configurationManager.mergeTsPreferences({useLabelDetailsInCompletionEntries:this.features.completionLabelDetails});const f=c?.logVerbosity&&_h.fromString(c?.logVerbosity);this._tspClient=new qh({lspClient:this.options.lspClient,trace:Dh.fromString(c?.trace||"off"),typescriptVersion:d,logDirectoryProvider:new hp(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:xh(n.tsserver?.useSyntaxServer)}),this.diagnosticQueue=new rd((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 np(this.tspClient),this.configurationManager.setAndConfigureTspClient(this.workspaceRoot,this._tspClient,i),this.setCompilerOptionsForInferredProjects();const m=p?.rename?.prepareSupport&&this.tspClient.apiVersion.gte(Nl.v310),g={capabilities:{textDocumentSync:ye.TextDocumentSyncKind.Incremental,completionProvider:{triggerCharacters:[".",'"',"'","/","@","<"],resolveProvider:!0},codeActionProvider:!t.textDocument?.codeAction?.codeActionLiteralSupport||{codeActionKinds:[...np.kinds.map((e=>e.value)),Fd.SourceOrganizeImportsTs.value,Fd.SourceRemoveUnusedImportsTs.value,Fd.SourceSortImportsTs.value,Fd.QuickFix.value,Fd.Refactor.value]},definitionProvider:!0,documentFormattingProvider:!0,documentRangeFormattingProvider:!0,documentHighlightProvider:!0,documentSymbolProvider:!0,executeCommandProvider:{commands:[fd.APPLY_WORKSPACE_EDIT,fd.APPLY_CODE_ACTION,fd.APPLY_REFACTORING,fd.CONFIGURE_PLUGIN,fd.ORGANIZE_IMPORTS,fd.APPLY_RENAME_FILE,fd.SOURCE_DEFINITION]},hoverProvider:!0,inlayHintProvider:!0,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(Nl.v380)&&(g.capabilities.callHierarchyProvider=!0),this.logger.log("onInitialize result",g),g}initialized(e){const{apiVersion:t,typescriptVersionSource:n}=this.tspClient;this.options.lspClient.sendNotification(md,{version:t.displayName,source:n})}findTypescriptVersion(e){const t=new Mp(e||this.options.tsserverPath,this.logger),n=t.getUserSettingVersion();if(n){if(n.isValid)return n;this.logger.logIgnoringVerbosity(bi.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?m.join(this.workspaceRoot,".log"):void 0}setCompilerOptionsForInferredProjects(){const e={options:{...Lp(this.configurationManager.workspaceConfiguration.implicitProjectConfiguration),allowJs:!0,allowNonTsExtensions:!0,allowSyntheticDefaultImports:!0,resolveJsonModule:!0}};this.tspClient.executeWithoutWaitingForResponse(Sl.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=$h(e.textDocument.uri);this.logger.log("onDidOpenTextDocument",e,t),t&&(this.documents.open(t,e.textDocument)?(this.tspClient.notify(Sl.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=$h(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(Sl.Close,{file:e}),this.options.lspClient.publishDiagnostics({uri:t.uri,diagnostics:[]}))}didChangeTextDocument(e){const{textDocument:t}=e,n=$h(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(Sl.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?Sl.DefinitionAndBoundSpan:Sl.Definition,params:e},t)}async implementation(e,t){return this.getSymbolLocations({type:Sl.Implementation,params:e},t)}async typeDefinition(e,t){return this.getSymbolLocations({type:Sl.TypeDefinition,params:e},t)}async getDefinition({type:e,params:t},n){const r=$h(t.textDocument.uri);if(this.logger.log(e,t,r),r){if(e===Sl.DefinitionAndBoundSpan){const i=Fh.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);if("response"!==o.type||!o.body)return;const s=o.body.textSpan?Mh.fromTextSpan(o.body.textSpan):void 0;return o.body.definitions.map((e=>{const t=Kh(e,this.documents),n=e.contextStart&&e.contextEnd?Mh.fromLocations(e.contextStart,e.contextEnd):t.range;return{originSelectionRange:s,targetRange:n,targetUri:t.uri,targetSelectionRange:t.range}}))}return this.getSymbolLocations({type:Sl.Definition,params:t})}}async getSymbolLocations({type:e,params:t},n){const r=$h(t.textDocument.uri);if(this.logger.log(e,t,r),!r)return[];const i=Fh.toFileLocationRequestArgs(r,t.position),o=await this.tspClient.request(e,i,n);return"response"===o.type&&o.body?o.body.map((e=>Kh(e,this.documents))):void 0}async documentSymbol(e,t){const n=$h(e.textDocument.uri);if(this.logger.log("symbol",e,n),!n)return[];const r=await this.tspClient.request(Sl.NavTree,{file:n},t);if("response"!==r.type||!r.body?.childItems)return[];if(this.supportHierarchicalDocumentSymbol){const e=[];for(const t of r.body.childItems)$d(t,e);return e}const i=[];for(const t of r.body.childItems)Wd(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=$h(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(Sl.CompletionInfo,{file:n,line:e.position.line+1,offset:e.position.character+1,triggerCharacter:Pd(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?Mh.fromTextSpan(c):void 0},p=[];for(const t of s||[]){if("warning"===t.kind)continue;const o=_d(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(Sl.CompletionDetails,e.data,t)));return"response"===r.type&&r.body?.length?kd(e,r.body[0],n,this.tspClient,this.documents,this.configurationManager.workspaceConfiguration.completions||{},this.features):e}async hover(e,t){const n=$h(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 gd,{displayString:o,documentation:s,tags:a}=r.body;return o&&i.appendCodeblock("typescript",o),Rd(i,s,a,this.documents),{contents:i.toMarkupContent(),range:Mh.fromTextSpan(r.body)}}async getQuickInfo(e,t,n){const r=await this.tspClient.request(Sl.Quickinfo,{file:e,line:t.line+1,offset:t.character+1},n);if("response"===r.type)return r}async prepareRename(e,t){const n=$h(e.textDocument.uri);if(!n)return null;const r=await this.tspClient.request(Sl.Rename,Fh.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 Mh.fromTextSpan(i.triggerSpan)}async rename(e,t){const n=$h(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(Sl.Rename,Fh.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=Hh(t.file,this.documents),r=i[n]||(i[n]=[]);t.locs.forEach((t=>{r.push({newText:`${t.prefixText||""}${e.newName}${t.suffixText||""}`,range:{start:Fh.fromLocation(t.start),end:Fh.fromLocation(t.end)}})}))})),{changes:i}}async references(e,t){const n=$h(e.textDocument.uri);if(this.logger.log("onReferences",e,n),!n)return[];const r=await this.tspClient.request(Sl.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=>Kh(e,this.documents))):[]}async documentFormatting(e,t){const n=$h(e.textDocument.uri);if(this.logger.log("documentFormatting",e,n),!n)return[];const r=e.options;await this.configurationManager.configureGloballyFromDocument(n,r);const i=await this.tspClient.request(Sl.Format,{file:n,line:1,offset:1,endLine:Number.MAX_SAFE_INTEGER,endOffset:Number.MAX_SAFE_INTEGER,options:r},t);return"response"===i.type&&i.body?i.body.map((e=>Qh(e))):[]}async documentRangeFormatting(e,t){const n=$h(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(Sl.Format,{file:n,line:e.range.start.line+1,offset:e.range.start.character+1,endLine:e.range.end.line+1,endOffset:e.range.end.character+1,options:r},t);return"response"===i.type&&i.body?i.body.map((e=>Qh(e))):[]}async selectionRanges(e,t){const n=$h(e.textDocument.uri);if(!n)return null;const r=await this.tspClient.request(Sl.SelectionRange,{file:n,locations:e.positions.map(Fh.toLocation)},t);return"response"===r.type&&r.body?r.body.map(Yh):null}async signatureHelp(e,t){const n=$h(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?Od(r.body,e.context,this.documents):void 0}async getSignatureHelp(e,t,n){const{position:r,context:i}=t,o=await this.tspClient.request(Sl.SignatureHelp,{file:e,line:r.line+1,offset:r.character+1,triggerReason:i?Id(i):void 0},n);if("response"===o.type)return o}async codeAction(e,t){const n=$h(e.textDocument.uri);if(this.logger.log("codeAction",e,n),!n)return[];await this.configurationManager.configureGloballyFromDocument(n);const r=Mh.toFileRangeRequestArgs(n,e.range),i=[],o=e.context.only?.map((e=>new Fd(e)));var s,a;o&&!o.some((e=>e.contains(Fd.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:fd.APPLY_WORKSPACE_EDIT,arguments:[{documentChanges:e.changes.map((e=>Zh(e,a)))}]},ye.CodeActionKind.QuickFix))):[])),o&&!o.some((e=>e.contains(Fd.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(Ad(i,t));else{const e=n.codeActionDisabledSupport?i.actions:i.actions.filter((e=>!e.notApplicableReason));for(const n of e)r.push(Md(n,i,t))}return r}(await this.getRefactors(r,e.context,t),r,this.features));for(const n of o||[])for(const o of Ld){if(!n.contains(o.kind)||o.minVersion&&this.tspClient.apiVersion.lt(o.minVersion))continue;let s=o.mode===Pl.SortAndCombine,a=o.mode;if(o.kind.equals(Fd.SourceOrganizeImportsTs)){const t=e.context.diagnostics.some((e=>(e.severity??0)<=2));s=t,a=Pl.SortAndCombine}const c=await this.interuptDiagnostics((()=>this.tspClient.request(Sl.OrganizeImports,{scope:{type:"file",args:r},skipDestructiveCodeActions:s,mode:a},t)));"response"===c.type&&c.body&&i.push(...jd(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(Sl.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(Sl.GetApplicableRefactors,r,n);return"response"===i.type?i:void 0}async executeCommand(e,t,n){if(this.logger.log("executeCommand",e),e.command===fd.APPLY_WORKSPACE_EDIT&&e.arguments){const t=e.arguments[0];await this.options.lspClient.applyWorkspaceEdit({edit:t})}else if(e.command===fd.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(Sl.ApplyCodeActionCommand,{command:e},t)}else if(e.command===fd.APPLY_REFACTORING&&e.arguments){const n=e.arguments[0],r=await this.tspClient.request(Sl.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 Wa.ensureFile(e.fileName);if(!await this.applyFileCodeEdits(i.edits))return;const o=i.renameLocation;o&&await this.options.lspClient.rename({textDocument:{uri:Hh(n.file,this.documents)},position:Fh.fromLocation(o)})}else if(e.command===fd.CONFIGURE_PLUGIN&&e.arguments){const[t,n]=e.arguments;this.tspClient.apiVersion.gte(Nl.v314)&&this.tspClient.executeWithoutWaitingForResponse(Sl.ConfigurePlugin,{configuration:n,pluginName:t})}else if(e.command===fd.ORGANIZE_IMPORTS&&e.arguments){const n=e.arguments[0],r=e.arguments[1]||{};await this.configurationManager.configureGloballyFromDocument(n);const i=await this.tspClient.request(Sl.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===fd.APPLY_RENAME_FILE&&e.arguments){const{sourceUri:n,targetUri:r}=e.arguments[0];this.applyRenameFile(n,r,t)}else if(e.command===fd.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(Sl.ApplyCodeActionCommand,{command:n},t);break}}else{if(e.command===fd.SOURCE_DEFINITION){const[r,i]=e.arguments||[],o=await this.options.lspClient.createProgressReporter(t,n);return pd.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[Hh(n.fileName,this.documents)]=n.textChanges.map(Qh);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=Hh(t.fileName,this.documents);(n[e]||(n[e]=[])).push(...t.textChanges.map(Qh))}}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=$h(t),i=$h(e);if(!r||!i)return[];const o=await this.tspClient.request(Sl.GetEditsForFileRename,{oldFilePath:i,newFilePath:r},n);return"response"===o.type&&o.body?o.body:[]}async documentHighlight(e,t){const n=$h(e.textDocument.uri);if(this.logger.log("documentHighlight",e,n),!n)return[];const r=await this.tspClient.request(Sl.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(Wh(e.file)===n){const t=ed(e);i.push(...t)}return i}lastFileOrDummy(){return this.documents.files[0]||this.workspaceRoot}async workspaceSymbol(e,t){const n=await this.tspClient.request(Sl.Navto,{file:this.lastFileOrDummy(),searchValue:e.query},t);return"response"===n.type&&n.body?n.body.map((e=>({location:{uri:Hh(e.file,this.documents),range:{start:Fh.fromLocation(e.start),end:Fh.fromLocation(e.end)}},kind:zh(e.kind),name:e.name}))):[]}async foldingRanges(e,t){const n=$h(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(Sl.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=Mh.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=$h(e.textDocument.uri);if(!n)return null;const r=Fh.toFileLocationRequestArgs(n,e.position),i=await this.tspClient.request(Sl.PrepareCallHierarchy,r,t);if("response"!==i.type||!i.body)return null;return(Array.isArray(i.body)?i.body:[i.body]).map((e=>Ud(e,this.documents,this.workspaceRoot)))}async callHierarchyIncomingCalls(e,t){const n=$h(e.item.uri);if(!n)return null;const r=Fh.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(Sl.ProvideCallHierarchyIncomingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{from:Ud(e.from,t,n),fromRanges:e.fromSpans.map(Mh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async callHierarchyOutgoingCalls(e,t){const n=$h(e.item.uri);if(!n)return null;const r=Fh.toFileLocationRequestArgs(n,e.item.selectionRange.start),i=await this.tspClient.request(Sl.ProvideCallHierarchyOutgoingCalls,r,t);return"response"===i.type&&i.body?i.body.map((e=>function(e,t,n){return{to:Ud(e.to,t,n),fromRanges:e.fromSpans.map(Mh.fromTextSpan)}}(e,this.documents,this.workspaceRoot))):null}async inlayHints(e,t){return await rp.provideInlayHints(e.textDocument.uri,e.range,this.documents,this.tspClient,this.options.lspClient,this.configurationManager,t)}async semanticTokensFull(e,t){const n=$h(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=$h(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(Sl.EncodedSemanticClassificationsFull,{file:t,start:n,length:r-n,format:"2020"},i);return"response"===o.type&&o.body?.spans?{data:lp(e,o.body.spans)}:{data:[]}}}const Qp=Nr(void 0,void 0);class Zp{constructor(e){this.connection=e}async createProgressReporter(e,t){let n;return n=t&&t.constructor!==Qp.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(bl.type,e)}async sendNotification(e,t){await this.connection.sendNotification(e,t)}}const ef=gi.MessageType.Info,{version:tf}=JSON.parse(r(new URL("../package.json",import.meta.url),{encoding:"utf8"})),nf=new pe("typescript-language-server").version(tf).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 rf=ef;nf.logLevel&&(rf=parseInt(nf.logLevel,10),rf&&(rf<1||rf>4)&&(console.error(`Invalid '--log-level ${rf}'. Falling back to 'info' level.`),rf=ef)),function(e){const t=vi.createConnection(vi.ProposedFeatures.all),n=new Zp(t),r=new Si(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.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:nf.tsserverPath,cmdLineTsserverLogVerbosity:_h.fromString(nf.tsserverLogVerbosity),showMessageLevel:rf}).listen();
//# sourceMappingURL=cli.mjs.map