UNPKG

npm-check-updates

Version:

Find newer versions of dependencies than what your package.json allows

28 lines 178 kB
#!/usr/bin/env node Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./chunks/chunk-BAUY9lu4.cjs"),W=require("./index.cjs");let Fe=require("path");Fe=T.__toESM(Fe,1);let Ge=require("os");Ge=T.__toESM(Ge,1);let $=require("node:process");$=T.__toESM($,1);let ge=require("node:os");ge=T.__toESM(ge,1);let V=require("node:path");V=T.__toESM(V,1);let Gt=require("node:url"),X=require("node:util"),j=require("node:fs");j=T.__toESM(j,1);let Er=require("node:child_process");var Te=T.__commonJSMin((e=>{var r=class extends Error{constructor(l,i,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=l,this.nestedError=void 0}},n=class extends r{constructor(l){super(1,"commander.invalidArgument",l),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};e.CommanderError=r,e.InvalidArgumentError=n})),st=T.__commonJSMin((e=>{var{InvalidArgumentError:r}=Te(),n=class{constructor(i,o){switch(this.description=o||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(i,o){return o===this.defaultValue||!Array.isArray(o)?[i]:(o.push(i),o)}default(i,o){return this.defaultValue=i,this.defaultValueDescription=o,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(o,D)=>{if(!this.argChoices.includes(o))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(o,D):o},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function l(i){const o=i.name()+(i.variadic===!0?"...":"");return i.required?"<"+o+">":"["+o+"]"}e.Argument=n,e.humanReadableArgName=l})),Jt=T.__commonJSMin((e=>{var{humanReadableArgName:r}=st(),n=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(i){this.helpWidth=this.helpWidth??i.helpWidth??80}visibleCommands(i){const o=i.commands.filter(s=>!s._hidden),D=i._getHelpCommand();return D&&!D._hidden&&o.push(D),this.sortSubcommands&&o.sort((s,u)=>s.name().localeCompare(u.name())),o}compareOptions(i,o){const D=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");return D(i).localeCompare(D(o))}visibleOptions(i){const o=i.options.filter(s=>!s.hidden),D=i._getHelpOption();if(D&&!D.hidden){const s=D.short&&i._findOption(D.short),u=D.long&&i._findOption(D.long);!s&&!u?o.push(D):D.long&&!u?o.push(i.createOption(D.long,D.description)):D.short&&!s&&o.push(i.createOption(D.short,D.description))}return this.sortOptions&&o.sort(this.compareOptions),o}visibleGlobalOptions(i){if(!this.showGlobalOptions)return[];const o=[];for(let D=i.parent;D;D=D.parent){const s=D.options.filter(u=>!u.hidden);o.push(...s)}return this.sortOptions&&o.sort(this.compareOptions),o}visibleArguments(i){return i._argsDescription&&i.registeredArguments.forEach(o=>{o.description=o.description||i._argsDescription[o.name()]||""}),i.registeredArguments.find(o=>o.description)?i.registeredArguments:[]}subcommandTerm(i){const o=i.registeredArguments.map(D=>r(D)).join(" ");return i._name+(i._aliases[0]?"|"+i._aliases[0]:"")+(i.options.length?" [options]":"")+(o?" "+o:"")}optionTerm(i){return i.flags}argumentTerm(i){return i.name()}longestSubcommandTermLength(i,o){return o.visibleCommands(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleSubcommandTerm(o.subcommandTerm(s)))),0)}longestOptionTermLength(i,o){return o.visibleOptions(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleOptionTerm(o.optionTerm(s)))),0)}longestGlobalOptionTermLength(i,o){return o.visibleGlobalOptions(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleOptionTerm(o.optionTerm(s)))),0)}longestArgumentTermLength(i,o){return o.visibleArguments(i).reduce((D,s)=>Math.max(D,this.displayWidth(o.styleArgumentTerm(o.argumentTerm(s)))),0)}commandUsage(i){let o=i._name;i._aliases[0]&&(o=o+"|"+i._aliases[0]);let D="";for(let s=i.parent;s;s=s.parent)D=s.name()+" "+D;return D+o+" "+i.usage()}commandDescription(i){return i.description()}subcommandDescription(i){return i.summary()||i.description()}optionDescription(i){const o=[];if(i.argChoices&&o.push(`choices: ${i.argChoices.map(D=>JSON.stringify(D)).join(", ")}`),i.defaultValue!==void 0&&(i.required||i.optional||i.isBoolean()&&typeof i.defaultValue=="boolean")&&o.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),i.presetArg!==void 0&&i.optional&&o.push(`preset: ${JSON.stringify(i.presetArg)}`),i.envVar!==void 0&&o.push(`env: ${i.envVar}`),o.length>0){const D=`(${o.join(", ")})`;return i.description?`${i.description} ${D}`:D}return i.description}argumentDescription(i){const o=[];if(i.argChoices&&o.push(`choices: ${i.argChoices.map(D=>JSON.stringify(D)).join(", ")}`),i.defaultValue!==void 0&&o.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),o.length>0){const D=`(${o.join(", ")})`;return i.description?`${i.description} ${D}`:D}return i.description}formatItemList(i,o,D){return o.length===0?[]:[D.styleTitle(i),...o,""]}groupItems(i,o,D){const s=new Map;return i.forEach(u=>{const c=D(u);s.has(c)||s.set(c,[])}),o.forEach(u=>{const c=D(u);s.has(c)||s.set(c,[]),s.get(c).push(u)}),s}formatHelp(i,o){const D=o.padWidth(i,o),s=o.helpWidth??80;function u(F,E){return o.formatItem(F,D,E,o)}let c=[`${o.styleTitle("Usage:")} ${o.styleUsage(o.commandUsage(i))}`,""];const m=o.commandDescription(i);m.length>0&&(c=c.concat([o.boxWrap(o.styleCommandDescription(m),s),""]));const h=o.visibleArguments(i).map(F=>u(o.styleArgumentTerm(o.argumentTerm(F)),o.styleArgumentDescription(o.argumentDescription(F))));if(c=c.concat(this.formatItemList("Arguments:",h,o)),this.groupItems(i.options,o.visibleOptions(i),F=>F.helpGroupHeading??"Options:").forEach((F,E)=>{const C=F.map(v=>u(o.styleOptionTerm(o.optionTerm(v)),o.styleOptionDescription(o.optionDescription(v))));c=c.concat(this.formatItemList(E,C,o))}),o.showGlobalOptions){const F=o.visibleGlobalOptions(i).map(E=>u(o.styleOptionTerm(o.optionTerm(E)),o.styleOptionDescription(o.optionDescription(E))));c=c.concat(this.formatItemList("Global Options:",F,o))}return this.groupItems(i.commands,o.visibleCommands(i),F=>F.helpGroup()||"Commands:").forEach((F,E)=>{const C=F.map(v=>u(o.styleSubcommandTerm(o.subcommandTerm(v)),o.styleSubcommandDescription(o.subcommandDescription(v))));c=c.concat(this.formatItemList(E,C,o))}),c.join(` `)}displayWidth(i){return l(i).length}styleTitle(i){return i}styleUsage(i){return i.split(" ").map(o=>o==="[options]"?this.styleOptionText(o):o==="[command]"?this.styleSubcommandText(o):o[0]==="["||o[0]==="<"?this.styleArgumentText(o):this.styleCommandText(o)).join(" ")}styleCommandDescription(i){return this.styleDescriptionText(i)}styleOptionDescription(i){return this.styleDescriptionText(i)}styleSubcommandDescription(i){return this.styleDescriptionText(i)}styleArgumentDescription(i){return this.styleDescriptionText(i)}styleDescriptionText(i){return i}styleOptionTerm(i){return this.styleOptionText(i)}styleSubcommandTerm(i){return i.split(" ").map(o=>o==="[options]"?this.styleOptionText(o):o[0]==="["||o[0]==="<"?this.styleArgumentText(o):this.styleSubcommandText(o)).join(" ")}styleArgumentTerm(i){return this.styleArgumentText(i)}styleOptionText(i){return i}styleArgumentText(i){return i}styleSubcommandText(i){return i}styleCommandText(i){return i}padWidth(i,o){return Math.max(o.longestOptionTermLength(i,o),o.longestGlobalOptionTermLength(i,o),o.longestSubcommandTermLength(i,o),o.longestArgumentTermLength(i,o))}preformatted(i){return/\n[^\S\r\n]/.test(i)}formatItem(i,o,D,s){const c=" ".repeat(2);if(!D)return c+i;const m=i.padEnd(o+i.length-s.displayWidth(i)),h=2,F=(this.helpWidth??80)-o-h-2;let E;return F<this.minWidthToWrap||s.preformatted(D)?E=D:E=s.boxWrap(D,F).replace(/\n/g,` `+" ".repeat(o+h)),c+m+" ".repeat(h)+E.replace(/\n/g,` ${c}`)}boxWrap(i,o){if(o<this.minWidthToWrap)return i;const D=i.split(/\r\n|\n/),s=/[\s]*[^\s]+/g,u=[];return D.forEach(c=>{const m=c.match(s);if(m===null){u.push("");return}let h=[m.shift()],F=this.displayWidth(h[0]);m.forEach(E=>{const C=this.displayWidth(E);if(F+C<=o){h.push(E),F+=C;return}u.push(h.join(""));const v=E.trimStart();h=[v],F=this.displayWidth(v)}),u.push(h.join(""))}),u.join(` `)}};function l(i){return i.replace(/\x1b\[\d*(;\d*)*m/g,"")}e.Help=n,e.stripColor=l})),Yt=T.__commonJSMin((e=>{var{InvalidArgumentError:r}=Te(),n=class{constructor(D,s){this.flags=D,this.description=s||"",this.required=D.includes("<"),this.optional=D.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(D),this.mandatory=!1;const u=o(D);this.short=u.shortFlag,this.long=u.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,this.helpGroupHeading=void 0}default(D,s){return this.defaultValue=D,this.defaultValueDescription=s,this}preset(D){return this.presetArg=D,this}conflicts(D){return this.conflictsWith=this.conflictsWith.concat(D),this}implies(D){let s=D;return typeof D=="string"&&(s={[D]:!0}),this.implied=Object.assign(this.implied||{},s),this}env(D){return this.envVar=D,this}argParser(D){return this.parseArg=D,this}makeOptionMandatory(D=!0){return this.mandatory=!!D,this}hideHelp(D=!0){return this.hidden=!!D,this}_collectValue(D,s){return s===this.defaultValue||!Array.isArray(s)?[D]:(s.push(D),s)}choices(D){return this.argChoices=D.slice(),this.parseArg=(s,u)=>{if(!this.argChoices.includes(s))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(s,u):s},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?i(this.name().replace(/^no-/,"")):i(this.name())}helpGroup(D){return this.helpGroupHeading=D,this}is(D){return this.short===D||this.long===D}isBoolean(){return!this.required&&!this.optional&&!this.negate}},l=class{constructor(D){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,D.forEach(s=>{s.negate?this.negativeOptions.set(s.attributeName(),s):this.positiveOptions.set(s.attributeName(),s)}),this.negativeOptions.forEach((s,u)=>{this.positiveOptions.has(u)&&this.dualOptions.add(u)})}valueFromOption(D,s){const u=s.attributeName();if(!this.dualOptions.has(u))return!0;const c=this.negativeOptions.get(u).presetArg,m=c!==void 0?c:!1;return s.negate===(m===D)}};function i(D){return D.split("-").reduce((s,u)=>s+u[0].toUpperCase()+u.slice(1))}function o(D){let s,u;const c=/^-[^-]$/,m=/^--[^-]/,h=D.split(/[ |,]+/).concat("guard");if(c.test(h[0])&&(s=h.shift()),m.test(h[0])&&(u=h.shift()),!s&&c.test(h[0])&&(s=h.shift()),!s&&m.test(h[0])&&(s=u,u=h.shift()),h[0].startsWith("-")){const F=h[0],E=`option creation failed due to '${F}' in option flags '${D}'`;throw/^-[^-][^-]/.test(F)?new Error(`${E} - a short flag is a single dash and a single character - either use a single dash and a single character (for a short flag) - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):c.test(F)?new Error(`${E} - too many short flags`):m.test(F)?new Error(`${E} - too many long flags`):new Error(`${E} - unrecognised flag format`)}if(s===void 0&&u===void 0)throw new Error(`option creation failed due to no flags found in '${D}'.`);return{shortFlag:s,longFlag:u}}e.Option=n,e.DualOptions=l})),Cr=T.__commonJSMin((e=>{var r=3;function n(i,o){if(Math.abs(i.length-o.length)>r)return Math.max(i.length,o.length);const D=[];for(let s=0;s<=i.length;s++)D[s]=[s];for(let s=0;s<=o.length;s++)D[0][s]=s;for(let s=1;s<=o.length;s++)for(let u=1;u<=i.length;u++){let c=1;i[u-1]===o[s-1]?c=0:c=1,D[u][s]=Math.min(D[u-1][s]+1,D[u][s-1]+1,D[u-1][s-1]+c),u>1&&s>1&&i[u-1]===o[s-2]&&i[u-2]===o[s-1]&&(D[u][s]=Math.min(D[u][s],D[u-2][s-2]+1))}return D[i.length][o.length]}function l(i,o){if(!o||o.length===0)return"";o=Array.from(new Set(o));const D=i.startsWith("--");D&&(i=i.slice(2),o=o.map(m=>m.slice(2)));let s=[],u=r;const c=.4;return o.forEach(m=>{if(m.length<=1)return;const h=n(i,m),F=Math.max(i.length,m.length);(F-h)/F>c&&(h<u?(u=h,s=[m]):h===u&&s.push(m))}),s.sort((m,h)=>m.localeCompare(h)),D&&(s=s.map(m=>`--${m}`)),s.length>1?` (Did you mean one of ${s.join(", ")}?)`:s.length===1?` (Did you mean ${s[0]}?)`:""}e.suggestSimilar=l})),yr=T.__commonJSMin((e=>{var r=require("node:events").EventEmitter,n=require("node:child_process"),l=require("node:path"),i=require("node:fs"),o=require("node:process"),{Argument:D,humanReadableArgName:s}=st(),{CommanderError:u}=Te(),{Help:c,stripColor:m}=Jt(),{Option:h,DualOptions:F}=Yt(),{suggestSimilar:E}=Cr(),C=class Kt extends r{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",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._savedState=null,this._outputConfiguration={writeOut:a=>o.stdout.write(a),writeErr:a=>o.stderr.write(a),outputError:(a,f)=>f(a),getOutHelpWidth:()=>o.stdout.isTTY?o.stdout.columns:void 0,getErrHelpWidth:()=>o.stderr.isTTY?o.stderr.columns:void 0,getOutHasColors:()=>y()??(o.stdout.isTTY&&o.stdout.hasColors?.()),getErrHasColors:()=>y()??(o.stderr.isTTY&&o.stderr.hasColors?.()),stripColor:a=>m(a)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){const t=[];for(let a=this;a;a=a.parent)t.push(a);return t}command(t,a,f){let d=a,g=f;typeof d=="object"&&d!==null&&(g=d,d=null),g=g||{};const[,_,A]=t.match(/([^ ]+) *(.*)/),b=this.createCommand(_);return d&&(b.description(d),b._executableHandler=!0),g.isDefault&&(this._defaultCommandName=b._name),b._hidden=!!(g.noHelp||g.hidden),b._executableFile=g.executableFile||null,A&&b.arguments(A),this._registerCommand(b),b.parent=this,b.copyInheritedSettings(this),d?this:b}createCommand(t){return new Kt(t)}createHelp(){return Object.assign(new c,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,a){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name - specify the name in Command constructor or using .name()`);return a=a||{},a.isDefault&&(this._defaultCommandName=t._name),(a.noHelp||a.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,a){return new D(t,a)}argument(t,a,f,d){const g=this.createArgument(t,a);return typeof f=="function"?g.default(d).argParser(f):g.default(f),this.addArgument(g),this}arguments(t){return t.trim().split(/ +/).forEach(a=>{this.argument(a)}),this}addArgument(t){const a=this.registeredArguments.slice(-1)[0];if(a?.variadic)throw new Error(`only the last argument can be variadic '${a.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,a){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;const[,f,d]=(t??"help [command]").match(/([^ ]+) *(.*)/),g=a??"display help for command",_=this.createCommand(f);return _.helpOption(!1),d&&_.arguments(d),g&&_.description(g),this._addImplicitHelpCommand=!0,this._helpCommand=_,(t||a)&&this._initCommandGroup(_),this}addHelpCommand(t,a){return typeof t!="object"?(this.helpCommand(t,a),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,a){const f=["preSubcommand","preAction","postAction"];if(!f.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'. Expecting one of '${f.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(a):this._lifeCycleHooks[t]=[a],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=a=>{if(a.code!=="commander.executeSubCommandAsync")throw a},this}_exit(t,a,f){this._exitCallback&&this._exitCallback(new u(t,a,f)),o.exit(t)}action(t){const a=f=>{const d=this.registeredArguments.length,g=f.slice(0,d);return this._storeOptionsAsProperties?g[d]=this:g[d]=this.opts(),g.push(this),t.apply(this,g)};return this._actionHandler=a,this}createOption(t,a){return new h(t,a)}_callParseArg(t,a,f,d){try{return t.parseArg(a,f)}catch(g){if(g.code==="commander.invalidArgument"){const _=`${d} ${g.message}`;this.error(_,{exitCode:g.exitCode,code:g.code})}throw g}}_registerOption(t){const a=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(a){const f=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${f}' - already used by option '${a.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){const a=d=>[d.name()].concat(d.aliases()),f=a(t).find(d=>this._findCommand(d));if(f){const d=a(this._findCommand(f)).join("|"),g=a(t).join("|");throw new Error(`cannot add command '${g}' as already have command '${d}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);const a=t.name(),f=t.attributeName();if(t.negate){const g=t.long.replace(/^--no-/,"--");this._findOption(g)||this.setOptionValueWithSource(f,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(f,t.defaultValue,"default");const d=(g,_,A)=>{g==null&&t.presetArg!==void 0&&(g=t.presetArg);const b=this.getOptionValue(f);g!==null&&t.parseArg?g=this._callParseArg(t,g,b,_):g!==null&&t.variadic&&(g=t._collectValue(g,b)),g==null&&(t.negate?g=!1:t.isBoolean()||t.optional?g=!0:g=""),this.setOptionValueWithSource(f,g,A)};return this.on("option:"+a,g=>{d(g,`error: option '${t.flags}' argument '${g}' is invalid.`,"cli")}),t.envVar&&this.on("optionEnv:"+a,g=>{d(g,`error: option '${t.flags}' value '${g}' from env '${t.envVar}' is invalid.`,"env")}),this}_optionEx(t,a,f,d,g){if(typeof a=="object"&&a instanceof h)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const _=this.createOption(a,f);if(_.makeOptionMandatory(!!t.mandatory),typeof d=="function")_.default(g).argParser(d);else if(d instanceof RegExp){const A=d;d=(b,S)=>{const B=A.exec(b);return B?B[0]:S},_.default(g).argParser(d)}else _.default(d);return this.addOption(_)}option(t,a,f,d){return this._optionEx({},t,a,f,d)}requiredOption(t,a,f,d){return this._optionEx({mandatory:!0},t,a,f,d)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,a){return this.setOptionValueWithSource(t,a,void 0)}setOptionValueWithSource(t,a,f){return this._storeOptionsAsProperties?this[t]=a:this._optionValues[t]=a,this._optionValueSources[t]=f,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let a;return this._getCommandAndAncestors().forEach(f=>{f.getOptionValueSource(t)!==void 0&&(a=f.getOptionValueSource(t))}),a}_prepareUserArgs(t,a){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(a=a||{},t===void 0&&a.from===void 0){o.versions?.electron&&(a.from="electron");const d=o.execArgv??[];(d.includes("-e")||d.includes("--eval")||d.includes("-p")||d.includes("--print"))&&(a.from="eval")}t===void 0&&(t=o.argv),this.rawArgs=t.slice();let f;switch(a.from){case void 0:case"node":this._scriptPath=t[1],f=t.slice(2);break;case"electron":o.defaultApp?(this._scriptPath=t[1],f=t.slice(2)):f=t.slice(1);break;case"user":f=t.slice(0);break;case"eval":f=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${a.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",f}parse(t,a){this._prepareForParse();const f=this._prepareUserArgs(t,a);return this._parseCommand([],f),this}async parseAsync(t,a){this._prepareForParse();const f=this._prepareUserArgs(t,a);return await this._parseCommand([],f),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true. - either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,a,f){if(i.existsSync(t))return;const d=`'${t}' does not exist - if '${f}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - ${a?`searched for local subcommand relative to directory '${a}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory"}`;throw new Error(d)}_executeSubCommand(t,a){a=a.slice();let f=!1;const d=[".js",".ts",".tsx",".mjs",".cjs"];function g(B,O){const U=l.resolve(B,O);if(i.existsSync(U))return U;if(d.includes(l.extname(O)))return;const J=d.find(Y=>i.existsSync(`${U}${Y}`));if(J)return`${U}${J}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let _=t._executableFile||`${this._name}-${t._name}`,A=this._executableDir||"";if(this._scriptPath){let B;try{B=i.realpathSync(this._scriptPath)}catch{B=this._scriptPath}A=l.resolve(l.dirname(B),A)}if(A){let B=g(A,_);if(!B&&!t._executableFile&&this._scriptPath){const O=l.basename(this._scriptPath,l.extname(this._scriptPath));O!==this._name&&(B=g(A,`${O}-${t._name}`))}_=B||_}f=d.includes(l.extname(_));let b;o.platform!=="win32"?f?(a.unshift(_),a=v(o.execArgv).concat(a),b=n.spawn(o.argv[0],a,{stdio:"inherit"})):b=n.spawn(_,a,{stdio:"inherit"}):(this._checkForMissingExecutable(_,A,t._name),a.unshift(_),a=v(o.execArgv).concat(a),b=n.spawn(o.execPath,a,{stdio:"inherit"})),b.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(B=>{o.on(B,()=>{b.killed===!1&&b.exitCode===null&&b.kill(B)})});const S=this._exitCallback;b.on("close",B=>{B=B??1,S?S(new u(B,"commander.executeSubCommandAsync","(close)")):o.exit(B)}),b.on("error",B=>{if(B.code==="ENOENT")this._checkForMissingExecutable(_,A,t._name);else if(B.code==="EACCES")throw new Error(`'${_}' not executable`);if(!S)o.exit(1);else{const O=new u(1,"commander.executeSubCommandAsync","(error)");O.nestedError=B,S(O)}}),this.runningCommand=b}_dispatchSubcommand(t,a,f){const d=this._findCommand(t);d||this.help({error:!0}),d._prepareForParse();let g;return g=this._chainOrCallSubCommandHook(g,d,"preSubcommand"),g=this._chainOrCall(g,()=>{if(d._executableHandler)this._executeSubCommand(d,a.concat(f));else return d._parseCommand(a,f)}),g}_dispatchHelpCommand(t){t||this.help();const a=this._findCommand(t);return a&&!a._executableHandler&&a.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,a)=>{t.required&&this.args[a]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const t=(f,d,g)=>{let _=d;if(d!==null&&f.parseArg){const A=`error: command-argument value '${d}' is invalid for argument '${f.name()}'.`;_=this._callParseArg(f,d,g,A)}return _};this._checkNumberOfArguments();const a=[];this.registeredArguments.forEach((f,d)=>{let g=f.defaultValue;f.variadic?d<this.args.length?(g=this.args.slice(d),f.parseArg&&(g=g.reduce((_,A)=>t(f,A,_),f.defaultValue))):g===void 0&&(g=[]):d<this.args.length&&(g=this.args[d],f.parseArg&&(g=t(f,g,f.defaultValue))),a[d]=g}),this.processedArgs=a}_chainOrCall(t,a){return t?.then&&typeof t.then=="function"?t.then(()=>a()):a()}_chainOrCallHooks(t,a){let f=t;const d=[];return this._getCommandAndAncestors().reverse().filter(g=>g._lifeCycleHooks[a]!==void 0).forEach(g=>{g._lifeCycleHooks[a].forEach(_=>{d.push({hookedCommand:g,callback:_})})}),a==="postAction"&&d.reverse(),d.forEach(g=>{f=this._chainOrCall(f,()=>g.callback(g.hookedCommand,this))}),f}_chainOrCallSubCommandHook(t,a,f){let d=t;return this._lifeCycleHooks[f]!==void 0&&this._lifeCycleHooks[f].forEach(g=>{d=this._chainOrCall(d,()=>g(this,a))}),d}_parseCommand(t,a){const f=this.parseOptions(a);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(f.operands),a=f.unknown,this.args=t.concat(a),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),a);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(a),this._dispatchSubcommand(this._defaultCommandName,t,a);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(f.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const d=()=>{f.unknown.length>0&&this.unknownOption(f.unknown[0])},g=`command:${this.name()}`;if(this._actionHandler){d(),this._processArguments();let _;return _=this._chainOrCallHooks(_,"preAction"),_=this._chainOrCall(_,()=>this._actionHandler(this.processedArgs)),this.parent&&(_=this._chainOrCall(_,()=>{this.parent.emit(g,t,a)})),_=this._chainOrCallHooks(_,"postAction"),_}if(this.parent?.listenerCount(g))d(),this._processArguments(),this.parent.emit(g,t,a);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,a);this.listenerCount("command:*")?this.emit("command:*",t,a):this.commands.length?this.unknownCommand():(d(),this._processArguments())}else this.commands.length?(d(),this.help({error:!0})):(d(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(a=>a._name===t||a._aliases.includes(t))}_findOption(t){return this.options.find(a=>a.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(a=>{a.mandatory&&t.getOptionValue(a.attributeName())===void 0&&t.missingMandatoryOptionValue(a)})})}_checkForConflictingLocalOptions(){const t=this.options.filter(a=>{const f=a.attributeName();return this.getOptionValue(f)===void 0?!1:this.getOptionValueSource(f)!=="default"});t.filter(a=>a.conflictsWith.length>0).forEach(a=>{const f=t.find(d=>a.conflictsWith.includes(d.attributeName()));f&&this._conflictingOption(a,f)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){const a=[],f=[];let d=a;function g(B){return B.length>1&&B[0]==="-"}const _=B=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(B)?!this._getCommandAndAncestors().some(O=>O.options.map(U=>U.short).some(U=>/^-\d$/.test(U))):!1;let A=null,b=null,S=0;for(;S<t.length||b;){const B=b??t[S++];if(b=null,B==="--"){d===f&&d.push(B),d.push(...t.slice(S));break}if(A&&(!g(B)||_(B))){this.emit(`option:${A.name()}`,B);continue}if(A=null,g(B)){const O=this._findOption(B);if(O){if(O.required){const U=t[S++];U===void 0&&this.optionMissingArgument(O),this.emit(`option:${O.name()}`,U)}else if(O.optional){let U=null;S<t.length&&(!g(t[S])||_(t[S]))&&(U=t[S++]),this.emit(`option:${O.name()}`,U)}else this.emit(`option:${O.name()}`);A=O.variadic?O:null;continue}}if(B.length>2&&B[0]==="-"&&B[1]!=="-"){const O=this._findOption(`-${B[1]}`);if(O){O.required||O.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${O.name()}`,B.slice(2)):(this.emit(`option:${O.name()}`),b=`-${B.slice(2)}`);continue}}if(/^--[^=]+=/.test(B)){const O=B.indexOf("="),U=this._findOption(B.slice(0,O));if(U&&(U.required||U.optional)){this.emit(`option:${U.name()}`,B.slice(O+1));continue}}if(d===a&&g(B)&&!(this.commands.length===0&&_(B))&&(d=f),(this._enablePositionalOptions||this._passThroughOptions)&&a.length===0&&f.length===0){if(this._findCommand(B)){a.push(B),f.push(...t.slice(S));break}else if(this._getHelpCommand()&&B===this._getHelpCommand().name()){a.push(B,...t.slice(S));break}else if(this._defaultCommandName){f.push(B,...t.slice(S));break}}if(this._passThroughOptions){d.push(B,...t.slice(S));break}d.push(B)}return{operands:a,unknown:f}}opts(){if(this._storeOptionsAsProperties){const t={},a=this.options.length;for(let f=0;f<a;f++){const d=this.options[f].attributeName();t[d]=d===this._versionOptionName?this._version:this[d]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,a)=>Object.assign(t,a.opts()),{})}error(t,a){this._outputConfiguration.outputError(`${t} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` `),this.outputHelp({error:!0}));const f=a||{},d=f.exitCode||1,g=f.code||"commander.error";this._exit(d,g,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in o.env){const a=t.attributeName();(this.getOptionValue(a)===void 0||["default","config","env"].includes(this.getOptionValueSource(a)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,o.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){const t=new F(this.options),a=f=>this.getOptionValue(f)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(f));this.options.filter(f=>f.implied!==void 0&&a(f.attributeName())&&t.valueFromOption(this.getOptionValue(f.attributeName()),f)).forEach(f=>{Object.keys(f.implied).filter(d=>!a(d)).forEach(d=>{this.setOptionValueWithSource(d,f.implied[d],"implied")})})}missingArgument(t){const a=`error: missing required argument '${t}'`;this.error(a,{code:"commander.missingArgument"})}optionMissingArgument(t){const a=`error: option '${t.flags}' argument missing`;this.error(a,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const a=`error: required option '${t.flags}' not specified`;this.error(a,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,a){const f=_=>{const A=_.attributeName(),b=this.getOptionValue(A),S=this.options.find(O=>O.negate&&A===O.attributeName()),B=this.options.find(O=>!O.negate&&A===O.attributeName());return S&&(S.presetArg===void 0&&b===!1||S.presetArg!==void 0&&b===S.presetArg)?S:B||_},d=_=>{const A=f(_),b=A.attributeName();return this.getOptionValueSource(b)==="env"?`environment variable '${A.envVar}'`:`option '${A.flags}'`},g=`error: ${d(t)} cannot be used with ${d(a)}`;this.error(g,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let a="";if(t.startsWith("--")&&this._showSuggestionAfterError){let d=[],g=this;do{const _=g.createHelp().visibleOptions(g).filter(A=>A.long).map(A=>A.long);d=d.concat(_),g=g.parent}while(g&&!g._enablePositionalOptions);a=E(t,d)}const f=`error: unknown option '${t}'${a}`;this.error(f,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const a=this.registeredArguments.length,f=a===1?"":"s",d=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${a} argument${f} but got ${t.length}.`;this.error(d,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let a="";if(this._showSuggestionAfterError){const d=[];this.createHelp().visibleCommands(this).forEach(g=>{d.push(g.name()),g.alias()&&d.push(g.alias())}),a=E(t,d)}const f=`error: unknown command '${t}'${a}`;this.error(f,{code:"commander.unknownCommand"})}version(t,a,f){if(t===void 0)return this._version;this._version=t,a=a||"-V, --version",f=f||"output the version number";const d=this.createOption(a,f);return this._versionOptionName=d.attributeName(),this._registerOption(d),this.on("option:"+d.name(),()=>{this._outputConfiguration.writeOut(`${t} `),this._exit(0,"commander.version",t)}),this}description(t,a){return t===void 0&&a===void 0?this._description:(this._description=t,a&&(this._argsDescription=a),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let a=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(a=this.commands[this.commands.length-1]),t===a._name)throw new Error("Command alias can't be the same as its name");const f=this.parent?._findCommand(t);if(f){const d=[f.name()].concat(f.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${d}'`)}return a._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(a=>this.alias(a)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;const a=this.registeredArguments.map(f=>s(f));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?a:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=l.basename(t,l.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){const a=this.createHelp(),f=this._getOutputContext(t);a.prepareContext({error:f.error,helpWidth:f.helpWidth,outputHasColors:f.hasColors});const d=a.formatHelp(this,a);return f.hasColors?d:this._outputConfiguration.stripColor(d)}_getOutputContext(t){t=t||{};const a=!!t.error;let f,d,g;return a?(f=A=>this._outputConfiguration.writeErr(A),d=this._outputConfiguration.getErrHasColors(),g=this._outputConfiguration.getErrHelpWidth()):(f=A=>this._outputConfiguration.writeOut(A),d=this._outputConfiguration.getOutHasColors(),g=this._outputConfiguration.getOutHelpWidth()),{error:a,write:A=>(d||(A=this._outputConfiguration.stripColor(A)),f(A)),hasColors:d,helpWidth:g}}outputHelp(t){let a;typeof t=="function"&&(a=t,t=void 0);const f=this._getOutputContext(t),d={error:f.error,write:f.write,command:this};this._getCommandAndAncestors().reverse().forEach(_=>_.emit("beforeAllHelp",d)),this.emit("beforeHelp",d);let g=this.helpInformation({error:f.error});if(a&&(g=a(g),typeof g!="string"&&!Buffer.isBuffer(g)))throw new Error("outputHelp callback must return a string or a Buffer");f.write(g),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",d),this._getCommandAndAncestors().forEach(_=>_.emit("afterAllHelp",d))}helpOption(t,a){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",a??"display help for command"),(t||a)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let a=Number(o.exitCode??0);a===0&&t&&typeof t!="function"&&t.error&&(a=1),this._exit(a,"commander.help","(outputHelp)")}addHelpText(t,a){const f=["beforeAll","before","after","afterAll"];if(!f.includes(t))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${f.join("', '")}'`);const d=`${t}Help`;return this.on(d,g=>{let _;typeof a=="function"?_=a({error:g.error,command:g.command}):_=a,_&&g.write(`${_} `)}),this}_outputHelpIfRequested(t){const a=this._getHelpOption();a&&t.find(f=>a.is(f))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function v(p){return p.map(t=>{if(!t.startsWith("--inspect"))return t;let a,f="127.0.0.1",d="9229",g;return(g=t.match(/^(--inspect(-brk)?)$/))!==null?a=g[1]:(g=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(a=g[1],/^\d+$/.test(g[3])?d=g[3]:f=g[3]):(g=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(a=g[1],f=g[3],d=g[4]),a&&d!=="0"?`${a}=${f}:${parseInt(d)+1}`:t})}function y(){if(o.env.NO_COLOR||o.env.FORCE_COLOR==="0"||o.env.FORCE_COLOR==="false")return!1;if(o.env.FORCE_COLOR||o.env.CLICOLOR_FORCE!==void 0)return!0}e.Command=C,e.useColor=y})),vr=T.__commonJSMin((e=>{var{Argument:r}=st(),{Command:n}=yr(),{CommanderError:l,InvalidArgumentError:i}=Te(),{Help:o}=Jt(),{Option:D}=Yt();e.program=new n,e.createCommand=s=>new n(s),e.createOption=(s,u)=>new D(s,u),e.createArgument=(s,u)=>new r(s,u),e.Command=n,e.Option=D,e.Argument=r,e.Help=o,e.CommanderError=l,e.InvalidArgumentError=i,e.InvalidOptionArgumentError=i})),_r=T.__toESM(vr(),1),{program:te,createCommand:yi,createArgument:vi,createOption:_i,CommanderError:Ai,InvalidArgumentError:bi,InvalidOptionArgumentError:wi,Command:Bi,Argument:Si,Option:Ft,Help:Ar}=_r.default,br=T.__commonJSMin(((e,r)=>{r.exports=l;function n(o){return o instanceof Buffer?Buffer.from(o):new o.constructor(o.buffer.slice(),o.byteOffset,o.length)}function l(o){if(o=o||{},o.circles)return i(o);const D=new Map;if(D.set(Date,h=>new Date(h)),D.set(Map,(h,F)=>new Map(u(Array.from(h),F))),D.set(Set,(h,F)=>new Set(u(Array.from(h),F))),o.constructorHandlers)for(const h of o.constructorHandlers)D.set(h[0],h[1]);let s=null;return o.proto?m:c;function u(h,F){const E=Object.keys(h),C=new Array(E.length);for(let v=0;v<E.length;v++){const y=E[v],p=h[y];typeof p!="object"||p===null?C[y]=p:p.constructor!==Object&&(s=D.get(p.constructor))?C[y]=s(p,F):ArrayBuffer.isView(p)?C[y]=n(p):C[y]=F(p)}return C}function c(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return u(h,c);if(h.constructor!==Object&&(s=D.get(h.constructor)))return s(h,c);const F={};for(const E in h){if(Object.hasOwnProperty.call(h,E)===!1)continue;const C=h[E];typeof C!="object"||C===null?F[E]=C:C.constructor!==Object&&(s=D.get(C.constructor))?F[E]=s(C,c):ArrayBuffer.isView(C)?F[E]=n(C):F[E]=c(C)}return F}function m(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return u(h,m);if(h.constructor!==Object&&(s=D.get(h.constructor)))return s(h,m);const F={};for(const E in h){const C=h[E];typeof C!="object"||C===null?F[E]=C:C.constructor!==Object&&(s=D.get(C.constructor))?F[E]=s(C,m):ArrayBuffer.isView(C)?F[E]=n(C):F[E]=m(C)}return F}}function i(o){const D=[],s=[],u=new Map;if(u.set(Date,E=>new Date(E)),u.set(Map,(E,C)=>new Map(m(Array.from(E),C))),u.set(Set,(E,C)=>new Set(m(Array.from(E),C))),o.constructorHandlers)for(const E of o.constructorHandlers)u.set(E[0],E[1]);let c=null;return o.proto?F:h;function m(E,C){const v=Object.keys(E),y=new Array(v.length);for(let p=0;p<v.length;p++){const t=v[p],a=E[t];if(typeof a!="object"||a===null)y[t]=a;else if(a.constructor!==Object&&(c=u.get(a.constructor)))y[t]=c(a,C);else if(ArrayBuffer.isView(a))y[t]=n(a);else{const f=D.indexOf(a);f!==-1?y[t]=s[f]:y[t]=C(a)}}return y}function h(E){if(typeof E!="object"||E===null)return E;if(Array.isArray(E))return m(E,h);if(E.constructor!==Object&&(c=u.get(E.constructor)))return c(E,h);const C={};D.push(E),s.push(C);for(const v in E){if(Object.hasOwnProperty.call(E,v)===!1)continue;const y=E[v];if(typeof y!="object"||y===null)C[v]=y;else if(y.constructor!==Object&&(c=u.get(y.constructor)))C[v]=c(y,h);else if(ArrayBuffer.isView(y))C[v]=n(y);else{const p=D.indexOf(y);p!==-1?C[v]=s[p]:C[v]=h(y)}}return D.pop(),s.pop(),C}function F(E){if(typeof E!="object"||E===null)return E;if(Array.isArray(E))return m(E,F);if(E.constructor!==Object&&(c=u.get(E.constructor)))return c(E,F);const C={};D.push(E),s.push(C);for(const v in E){const y=E[v];if(typeof y!="object"||y===null)C[v]=y;else if(y.constructor!==Object&&(c=u.get(y.constructor)))C[v]=c(y,F);else if(ArrayBuffer.isView(y))C[v]=n(y);else{const p=D.indexOf(y);p!==-1?C[v]=s[p]:C[v]=F(y)}}return D.pop(),s.pop(),C}}})),wr=T.__commonJSMin(((e,r)=>{var n=require("constants"),l=process.cwd,i=null,o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=l.call(process)),i};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var D=process.chdir;process.chdir=function(u){i=null,D.call(process,u)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,D)}r.exports=s;function s(u){n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&c(u),u.lutimes||m(u),u.chown=E(u.chown),u.fchown=E(u.fchown),u.lchown=E(u.lchown),u.chmod=h(u.chmod),u.fchmod=h(u.fchmod),u.lchmod=h(u.lchmod),u.chownSync=C(u.chownSync),u.fchownSync=C(u.fchownSync),u.lchownSync=C(u.lchownSync),u.chmodSync=F(u.chmodSync),u.fchmodSync=F(u.fchmodSync),u.lchmodSync=F(u.lchmodSync),u.stat=v(u.stat),u.fstat=v(u.fstat),u.lstat=v(u.lstat),u.statSync=y(u.statSync),u.fstatSync=y(u.fstatSync),u.lstatSync=y(u.lstatSync),u.chmod&&!u.lchmod&&(u.lchmod=function(t,a,f){f&&process.nextTick(f)},u.lchmodSync=function(){}),u.chown&&!u.lchown&&(u.lchown=function(t,a,f,d){d&&process.nextTick(d)},u.lchownSync=function(){}),o==="win32"&&(u.rename=typeof u.rename!="function"?u.rename:(function(t){function a(f,d,g){var _=Date.now(),A=0;t(f,d,function b(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){u.stat(d,function(B,O){B&&B.code==="ENOENT"?t(f,d,b):g(S)})},A),A<100&&(A+=10);return}g&&g(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(a,t),a})(u.rename)),u.read=typeof u.read!="function"?u.read:(function(t){function a(f,d,g,_,A,b){var S;if(b&&typeof b=="function"){var B=0;S=function(O,U,J){if(O&&O.code==="EAGAIN"&&B<10)return B++,t.call(u,f,d,g,_,A,S);b.apply(this,arguments)}}return t.call(u,f,d,g,_,A,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(a,t),a})(u.read),u.readSync=typeof u.readSync!="function"?u.readSync:(function(t){return function(a,f,d,g,_){for(var A=0;;)try{return t.call(u,a,f,d,g,_)}catch(b){if(b.code==="EAGAIN"&&A<10){A++;continue}throw b}}})(u.readSync);function c(t){t.lchmod=function(a,f,d){t.open(a,n.O_WRONLY|n.O_SYMLINK,f,function(g,_){if(g){d&&d(g);return}t.fchmod(_,f,function(A){t.close(_,function(b){d&&d(A||b)})})})},t.lchmodSync=function(a,f){var d=t.openSync(a,n.O_WRONLY|n.O_SYMLINK,f),g=!0,_;try{_=t.fchmodSync(d,f),g=!1}finally{if(g)try{t.closeSync(d)}catch{}else t.closeSync(d)}return _}}function m(t){n.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(a,f,d,g){t.open(a,n.O_SYMLINK,function(_,A){if(_){g&&g(_);return}t.futimes(A,f,d,function(b){t.close(A,function(S){g&&g(b||S)})})})},t.lutimesSync=function(a,f,d){var g=t.openSync(a,n.O_SYMLINK),_,A=!0;try{_=t.futimesSync(g,f,d),A=!1}finally{if(A)try{t.closeSync(g)}catch{}else t.closeSync(g)}return _}):t.futimes&&(t.lutimes=function(a,f,d,g){g&&process.nextTick(g)},t.lutimesSync=function(){})}function h(t){return t&&function(a,f,d){return t.call(u,a,f,function(g){p(g)&&(g=null),d&&d.apply(this,arguments)})}}function F(t){return t&&function(a,f){try{return t.call(u,a,f)}catch(d){if(!p(d))throw d}}}function E(t){return t&&function(a,f,d,g){return t.call(u,a,f,d,function(_){p(_)&&(_=null),g&&g.apply(this,arguments)})}}function C(t){return t&&function(a,f,d){try{return t.call(u,a,f,d)}catch(g){if(!p(g))throw g}}}function v(t){return t&&function(a,f,d){typeof f=="function"&&(d=f,f=null);function g(_,A){A&&(A.uid<0&&(A.uid+=4294967296),A.gid<0&&(A.gid+=4294967296)),d&&d.apply(this,arguments)}return f?t.call(u,a,f,g):t.call(u,a,g)}}function y(t){return t&&function(a,f){var d=f?t.call(u,a,f):t.call(u,a);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function p(t){return!t||t.code==="ENOSYS"||(!process.getuid||process.getuid()!==0)&&(t.code==="EINVAL"||t.code==="EPERM")}}})),Br=T.__commonJSMin(((e,r)=>{var n=require("stream").Stream;r.exports=l;function l(i){return{ReadStream:o,WriteStream:D};function o(s,u){if(!(this instanceof o))return new o(s,u);n.call(this);var c=this;this.path=s,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,u=u||{};for(var m=Object.keys(u),h=0,F=m.length;h<F;h++){var E=m[h];this[E]=u[E]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){c._read()});return}i.open(this.path,this.flags,this.mode,function(C,v){if(C){c.emit("error",C),c.readable=!1;return}c.fd=v,c.emit("open",v),c._read()})}function D(s,u){if(!(this instanceof D))return new D(s,u);n.call(this),this.path=s,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,u=u||{};for(var c=Object.keys(u),m=0,h=c.length;m<h;m++){var F=c[m];this[F]=u[F]}if(this.start!==void 0){if(typeof this.start!="number")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=[],this.fd===null&&(this._open=i.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}})),Sr=T.__commonJSMin(((e,r)=>{r.exports=l;var n=Object.getPrototypeOf||function(i){return i.__proto__};function l(i){if(i===null||typeof i!="object")return i;if(i instanceof Object)var o={__proto__:n(i)};else var o=Object.create(null);return Object.getOwnPropertyNames(i).forEach(function(D){Object.defineProperty(o,D,Object.getOwnPropertyDescriptor(i,D))}),o}})),Or=T.__commonJSMin(((e,r)=>{var n=require("fs"),l=wr(),i=Br(),o=Sr(),D=require("util"),s,u;typeof Symbol=="function"&&typeof Symbol.for=="function"?(s=Symbol.for("graceful-fs.queue"),u=Symbol.for("graceful-fs.previous")):(s="___graceful-fs.queue",u="___graceful-fs.previous");function c(){}function m(p,t){Object.defineProperty(p,s,{get:function(){return t}})}var h=c;D.debuglog?h=D.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(h=function(){var p=D.format.apply(D,arguments);p="GFS4: "+p.split(/\n/).join(` GFS4: `),console.error(