npm-check-updates
Version:
Find newer versions of dependencies than what your package.json allows
28 lines • 177 kB
JavaScript
#!/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,g){return o.formatItem(F,D,g,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,g)=>{const E=F.map(v=>u(o.styleOptionTerm(o.optionTerm(v)),o.styleOptionDescription(o.optionDescription(v))));c=c.concat(this.formatItemList(g,E,o))}),o.showGlobalOptions){const F=o.visibleGlobalOptions(i).map(g=>u(o.styleOptionTerm(o.optionTerm(g)),o.styleOptionDescription(o.optionDescription(g))));c=c.concat(this.formatItemList("Global Options:",F,o))}return this.groupItems(i.commands,o.visibleCommands(i),F=>F.helpGroup()||"Commands:").forEach((F,g)=>{const E=F.map(v=>u(o.styleSubcommandTerm(o.subcommandTerm(v)),o.styleSubcommandDescription(o.subcommandDescription(v))));c=c.concat(this.formatItemList(g,E,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 g;return F<this.minWidthToWrap||s.preformatted(D)?g=D:g=s.boxWrap(D,F).replace(/\n/g,`
`+" ".repeat(o+h)),c+m+" ".repeat(h)+g.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(g=>{const E=this.displayWidth(g);if(F+E<=o){h.push(g),F+=E;return}u.push(h.join(""));const v=g.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],g=`option creation failed due to '${F}' in option flags '${D}'`;throw/^-[^-][^-]/.test(F)?new Error(`${g}
- 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(`${g}
- too many short flags`):m.test(F)?new Error(`${g}
- too many long flags`):new Error(`${g}
- 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:g}=Cr(),E=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,d)=>d(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,d){let p=a,C=d;typeof p=="object"&&p!==null&&(C=p,p=null),C=C||{};const[,_,A]=t.match(/([^ ]+) *(.*)/),b=this.createCommand(_);return p&&(b.description(p),b._executableHandler=!0),C.isDefault&&(this._defaultCommandName=b._name),b._hidden=!!(C.noHelp||C.hidden),b._executableFile=C.executableFile||null,A&&b.arguments(A),this._registerCommand(b),b.parent=this,b.copyInheritedSettings(this),p?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,d,p){const C=this.createArgument(t,a);return typeof d=="function"?C.default(p).argParser(d):C.default(d),this.addArgument(C),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[,d,p]=(t??"help [command]").match(/([^ ]+) *(.*)/),C=a??"display help for command",_=this.createCommand(d);return _.helpOption(!1),p&&_.arguments(p),C&&_.description(C),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 d=["preSubcommand","preAction","postAction"];if(!d.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
Expecting one of '${d.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,d){this._exitCallback&&this._exitCallback(new u(t,a,d)),o.exit(t)}action(t){const a=d=>{const p=this.registeredArguments.length,C=d.slice(0,p);return this._storeOptionsAsProperties?C[p]=this:C[p]=this.opts(),C.push(this),t.apply(this,C)};return this._actionHandler=a,this}createOption(t,a){return new h(t,a)}_callParseArg(t,a,d,p){try{return t.parseArg(a,d)}catch(C){if(C.code==="commander.invalidArgument"){const _=`${p} ${C.message}`;this.error(_,{exitCode:C.exitCode,code:C.code})}throw C}}_registerOption(t){const a=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(a){const d=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 '${d}'
- already used by option '${a.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){const a=p=>[p.name()].concat(p.aliases()),d=a(t).find(p=>this._findCommand(p));if(d){const p=a(this._findCommand(d)).join("|"),C=a(t).join("|");throw new Error(`cannot add command '${C}' as already have command '${p}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);const a=t.name(),d=t.attributeName();if(t.negate){const C=t.long.replace(/^--no-/,"--");this._findOption(C)||this.setOptionValueWithSource(d,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(d,t.defaultValue,"default");const p=(C,_,A)=>{C==null&&t.presetArg!==void 0&&(C=t.presetArg);const b=this.getOptionValue(d);C!==null&&t.parseArg?C=this._callParseArg(t,C,b,_):C!==null&&t.variadic&&(C=t._collectValue(C,b)),C==null&&(t.negate?C=!1:t.isBoolean()||t.optional?C=!0:C=""),this.setOptionValueWithSource(d,C,A)};return this.on("option:"+a,C=>{p(C,`error: option '${t.flags}' argument '${C}' is invalid.`,"cli")}),t.envVar&&this.on("optionEnv:"+a,C=>{p(C,`error: option '${t.flags}' value '${C}' from env '${t.envVar}' is invalid.`,"env")}),this}_optionEx(t,a,d,p,C){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,d);if(_.makeOptionMandatory(!!t.mandatory),typeof p=="function")_.default(C).argParser(p);else if(p instanceof RegExp){const A=p;p=(b,S)=>{const B=A.exec(b);return B?B[0]:S},_.default(C).argParser(p)}else _.default(p);return this.addOption(_)}option(t,a,d,p){return this._optionEx({},t,a,d,p)}requiredOption(t,a,d,p){return this._optionEx({mandatory:!0},t,a,d,p)}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,d){return this._storeOptionsAsProperties?this[t]=a:this._optionValues[t]=a,this._optionValueSources[t]=d,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let a;return this._getCommandAndAncestors().forEach(d=>{d.getOptionValueSource(t)!==void 0&&(a=d.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 p=o.execArgv??[];(p.includes("-e")||p.includes("--eval")||p.includes("-p")||p.includes("--print"))&&(a.from="eval")}t===void 0&&(t=o.argv),this.rawArgs=t.slice();let d;switch(a.from){case void 0:case"node":this._scriptPath=t[1],d=t.slice(2);break;case"electron":o.defaultApp?(this._scriptPath=t[1],d=t.slice(2)):d=t.slice(1);break;case"user":d=t.slice(0);break;case"eval":d=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",d}parse(t,a){this._prepareForParse();const d=this._prepareUserArgs(t,a);return this._parseCommand([],d),this}async parseAsync(t,a){this._prepareForParse();const d=this._prepareUserArgs(t,a);return await this._parseCommand([],d),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,d){if(i.existsSync(t))return;const p=`'${t}' does not exist
- if '${d}' 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(p)}_executeSubCommand(t,a){a=a.slice();let d=!1;const p=[".js",".ts",".tsx",".mjs",".cjs"];function C(B,O){const U=l.resolve(B,O);if(i.existsSync(U))return U;if(p.includes(l.extname(O)))return;const J=p.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=C(A,_);if(!B&&!t._executableFile&&this._scriptPath){const O=l.basename(this._scriptPath,l.extname(this._scriptPath));O!==this._name&&(B=C(A,`${O}-${t._name}`))}_=B||_}d=p.includes(l.extname(_));let b;o.platform!=="win32"?d?(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,d){const p=this._findCommand(t);p||this.help({error:!0}),p._prepareForParse();let C;return C=this._chainOrCallSubCommandHook(C,p,"preSubcommand"),C=this._chainOrCall(C,()=>{if(p._executableHandler)this._executeSubCommand(p,a.concat(d));else return p._parseCommand(a,d)}),C}_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=(d,p,C)=>{let _=p;if(p!==null&&d.parseArg){const A=`error: command-argument value '${p}' is invalid for argument '${d.name()}'.`;_=this._callParseArg(d,p,C,A)}return _};this._checkNumberOfArguments();const a=[];this.registeredArguments.forEach((d,p)=>{let C=d.defaultValue;d.variadic?p<this.args.length?(C=this.args.slice(p),d.parseArg&&(C=C.reduce((_,A)=>t(d,A,_),d.defaultValue))):C===void 0&&(C=[]):p<this.args.length&&(C=this.args[p],d.parseArg&&(C=t(d,C,d.defaultValue))),a[p]=C}),this.processedArgs=a}_chainOrCall(t,a){return t?.then&&typeof t.then=="function"?t.then(()=>a()):a()}_chainOrCallHooks(t,a){let d=t;const p=[];return this._getCommandAndAncestors().reverse().filter(C=>C._lifeCycleHooks[a]!==void 0).forEach(C=>{C._lifeCycleHooks[a].forEach(_=>{p.push({hookedCommand:C,callback:_})})}),a==="postAction"&&p.reverse(),p.forEach(C=>{d=this._chainOrCall(d,()=>C.callback(C.hookedCommand,this))}),d}_chainOrCallSubCommandHook(t,a,d){let p=t;return this._lifeCycleHooks[d]!==void 0&&this._lifeCycleHooks[d].forEach(C=>{p=this._chainOrCall(p,()=>C(this,a))}),p}_parseCommand(t,a){const d=this.parseOptions(a);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(d.operands),a=d.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(d.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const p=()=>{d.unknown.length>0&&this.unknownOption(d.unknown[0])},C=`command:${this.name()}`;if(this._actionHandler){p(),this._processArguments();let _;return _=this._chainOrCallHooks(_,"preAction"),_=this._chainOrCall(_,()=>this._actionHandler(this.processedArgs)),this.parent&&(_=this._chainOrCall(_,()=>{this.parent.emit(C,t,a)})),_=this._chainOrCallHooks(_,"postAction"),_}if(this.parent?.listenerCount(C))p(),this._processArguments(),this.parent.emit(C,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():(p(),this._processArguments())}else this.commands.length?(p(),this.help({error:!0})):(p(),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 d=a.attributeName();return this.getOptionValue(d)===void 0?!1:this.getOptionValueSource(d)!=="default"});t.filter(a=>a.conflictsWith.length>0).forEach(a=>{const d=t.find(p=>a.conflictsWith.includes(p.attributeName()));d&&this._conflictingOption(a,d)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){const a=[],d=[];let p=a;function C(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==="--"){p===d&&p.push(B),p.push(...t.slice(S));break}if(A&&(!C(B)||_(B))){this.emit(`option:${A.name()}`,B);continue}if(A=null,C(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&&(!C(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(p===a&&C(B)&&!(this.commands.length===0&&_(B))&&(p=d),(this._enablePositionalOptions||this._passThroughOptions)&&a.length===0&&d.length===0){if(this._findCommand(B)){a.push(B),d.push(...t.slice(S));break}else if(this._getHelpCommand()&&B===this._getHelpCommand().name()){a.push(B,...t.slice(S));break}else if(this._defaultCommandName){d.push(B,...t.slice(S));break}}if(this._passThroughOptions){p.push(B,...t.slice(S));break}p.push(B)}return{operands:a,unknown:d}}opts(){if(this._storeOptionsAsProperties){const t={},a=this.options.length;for(let d=0;d<a;d++){const p=this.options[d].attributeName();t[p]=p===this._versionOptionName?this._version:this[p]}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 d=a||{},p=d.exitCode||1,C=d.code||"commander.error";this._exit(p,C,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=d=>this.getOptionValue(d)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(d));this.options.filter(d=>d.implied!==void 0&&a(d.attributeName())&&t.valueFromOption(this.getOptionValue(d.attributeName()),d)).forEach(d=>{Object.keys(d.implied).filter(p=>!a(p)).forEach(p=>{this.setOptionValueWithSource(p,d.implied[p],"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 d=_=>{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||_},p=_=>{const A=d(_),b=A.attributeName();return this.getOptionValueSource(b)==="env"?`environment variable '${A.envVar}'`:`option '${A.flags}'`},C=`error: ${p(t)} cannot be used with ${p(a)}`;this.error(C,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let a="";if(t.startsWith("--")&&this._showSuggestionAfterError){let p=[],C=this;do{const _=C.createHelp().visibleOptions(C).filter(A=>A.long).map(A=>A.long);p=p.concat(_),C=C.parent}while(C&&!C._enablePositionalOptions);a=g(t,p)}const d=`error: unknown option '${t}'${a}`;this.error(d,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const a=this.registeredArguments.length,d=a===1?"":"s",p=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${a} argument${d} but got ${t.length}.`;this.error(p,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let a="";if(this._showSuggestionAfterError){const p=[];this.createHelp().visibleCommands(this).forEach(C=>{p.push(C.name()),C.alias()&&p.push(C.alias())}),a=g(t,p)}const d=`error: unknown command '${t}'${a}`;this.error(d,{code:"commander.unknownCommand"})}version(t,a,d){if(t===void 0)return this._version;this._version=t,a=a||"-V, --version",d=d||"output the version number";const p=this.createOption(a,d);return this._versionOptionName=p.attributeName(),this._registerOption(p),this.on("option:"+p.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 d=this.parent?._findCommand(t);if(d){const p=[d.name()].concat(d.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${p}'`)}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(d=>s(d));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(),d=this._getOutputContext(t);a.prepareContext({error:d.error,helpWidth:d.helpWidth,outputHasColors:d.hasColors});const p=a.formatHelp(this,a);return d.hasColors?p:this._outputConfiguration.stripColor(p)}_getOutputContext(t){t=t||{};const a=!!t.error;let d,p,C;return a?(d=A=>this._outputConfiguration.writeErr(A),p=this._outputConfiguration.getErrHasColors(),C=this._outputConfiguration.getErrHelpWidth()):(d=A=>this._outputConfiguration.writeOut(A),p=this._outputConfiguration.getOutHasColors(),C=this._outputConfiguration.getOutHelpWidth()),{error:a,write:A=>(p||(A=this._outputConfiguration.stripColor(A)),d(A)),hasColors:p,helpWidth:C}}outputHelp(t){let a;typeof t=="function"&&(a=t,t=void 0);const d=this._getOutputContext(t),p={error:d.error,write:d.write,command:this};this._getCommandAndAncestors().reverse().forEach(_=>_.emit("beforeAllHelp",p)),this.emit("beforeHelp",p);let C=this.helpInformation({error:d.error});if(a&&(C=a(C),typeof C!="string"&&!Buffer.isBuffer(C)))throw new Error("outputHelp callback must return a string or a Buffer");d.write(C),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",p),this._getCommandAndAncestors().forEach(_=>_.emit("afterAllHelp",p))}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 d=["beforeAll","before","after","afterAll"];if(!d.includes(t))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${d.join("', '")}'`);const p=`${t}Help`;return this.on(p,C=>{let _;typeof a=="function"?_=a({error:C.error,command:C.command}):_=a,_&&C.write(`${_}
`)}),this}_outputHelpIfRequested(t){const a=this._getHelpOption();a&&t.find(d=>a.is(d))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function v(f){return f.map(t=>{if(!t.startsWith("--inspect"))return t;let a,d="127.0.0.1",p="9229",C;return(C=t.match(/^(--inspect(-brk)?)$/))!==null?a=C[1]:(C=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(a=C[1],/^\d+$/.test(C[3])?p=C[3]:d=C[3]):(C=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(a=C[1],d=C[3],p=C[4]),a&&p!=="0"?`${a}=${d}:${parseInt(p)+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=E,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 g=Object.keys(h),E=new Array(g.length);for(let v=0;v<g.length;v++){const y=g[v],f=h[y];typeof f!="object"||f===null?E[y]=f:f.constructor!==Object&&(s=D.get(f.constructor))?E[y]=s(f,F):ArrayBuffer.isView(f)?E[y]=n(f):E[y]=F(f)}return E}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 g in h){if(Object.hasOwnProperty.call(h,g)===!1)continue;const E=h[g];typeof E!="object"||E===null?F[g]=E:E.constructor!==Object&&(s=D.get(E.constructor))?F[g]=s(E,c):ArrayBuffer.isView(E)?F[g]=n(E):F[g]=c(E)}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 g in h){const E=h[g];typeof E!="object"||E===null?F[g]=E:E.constructor!==Object&&(s=D.get(E.constructor))?F[g]=s(E,m):ArrayBuffer.isView(E)?F[g]=n(E):F[g]=m(E)}return F}}function i(o){const D=[],s=[],u=new Map;if(u.set(Date,g=>new Date(g)),u.set(Map,(g,E)=>new Map(m(Array.from(g),E))),u.set(Set,(g,E)=>new Set(m(Array.from(g),E))),o.constructorHandlers)for(const g of o.constructorHandlers)u.set(g[0],g[1]);let c=null;return o.proto?F:h;function m(g,E){const v=Object.keys(g),y=new Array(v.length);for(let f=0;f<v.length;f++){const t=v[f],a=g[t];if(typeof a!="object"||a===null)y[t]=a;else if(a.constructor!==Object&&(c=u.get(a.constructor)))y[t]=c(a,E);else if(ArrayBuffer.isView(a))y[t]=n(a);else{const d=D.indexOf(a);d!==-1?y[t]=s[d]:y[t]=E(a)}}return y}function h(g){if(typeof g!="object"||g===null)return g;if(Array.isArray(g))return m(g,h);if(g.constructor!==Object&&(c=u.get(g.constructor)))return c(g,h);const E={};D.push(g),s.push(E);for(const v in g){if(Object.hasOwnProperty.call(g,v)===!1)continue;const y=g[v];if(typeof y!="object"||y===null)E[v]=y;else if(y.constructor!==Object&&(c=u.get(y.constructor)))E[v]=c(y,h);else if(ArrayBuffer.isView(y))E[v]=n(y);else{const f=D.indexOf(y);f!==-1?E[v]=s[f]:E[v]=h(y)}}return D.pop(),s.pop(),E}function F(g){if(typeof g!="object"||g===null)return g;if(Array.isArray(g))return m(g,F);if(g.constructor!==Object&&(c=u.get(g.constructor)))return c(g,F);const E={};D.push(g),s.push(E);for(const v in g){const y=g[v];if(typeof y!="object"||y===null)E[v]=y;else if(y.constructor!==Object&&(c=u.get(y.constructor)))E[v]=c(y,F);else if(ArrayBuffer.isView(y))E[v]=n(y);else{const f=D.indexOf(y);f!==-1?E[v]=s[f]:E[v]=F(y)}}return D.pop(),s.pop(),E}}})),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=g(u.chown),u.fchown=g(u.fchown),u.lchown=g(u.lchown),u.chmod=h(u.chmod),u.fchmod=h(u.fchmod),u.lchmod=h(u.lchmod),u.chownSync=E(u.chownSync),u.fchownSync=E(u.fchownSync),u.lchownSync=E(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,d){d&&process.nextTick(d)},u.lchmodSync=function(){}),u.chown&&!u.lchown&&(u.lchown=function(t,a,d,p){p&&process.nextTick(p)},u.lchownSync=function(){}),o==="win32"&&(u.rename=typeof u.rename!="function"?u.rename:(function(t){function a(d,p,C){var _=Date.now(),A=0;t(d,p,function b(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-_<6e4){setTimeout(function(){u.stat(p,function(B,O){B&&B.code==="ENOENT"?t(d,p,b):C(S)})},A),A<100&&(A+=10);return}C&&C(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(a,t),a})(u.rename)),u.read=typeof u.read!="function"?u.read:(function(t){function a(d,p,C,_,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,d,p,C,_,A,S);b.apply(this,arguments)}}return t.call(u,d,p,C,_,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,d,p,C,_){for(var A=0;;)try{return t.call(u,a,d,p,C,_)}catch(b){if(b.code==="EAGAIN"&&A<10){A++;continue}throw b}}})(u.readSync);function c(t){t.lchmod=function(a,d,p){t.open(a,n.O_WRONLY|n.O_SYMLINK,d,function(C,_){if(C){p&&p(C);return}t.fchmod(_,d,function(A){t.close(_,function(b){p&&p(A||b)})})})},t.lchmodSync=function(a,d){var p=t.openSync(a,n.O_WRONLY|n.O_SYMLINK,d),C=!0,_;try{_=t.fchmodSync(p,d),C=!1}finally{if(C)try{t.closeSync(p)}catch{}else t.closeSync(p)}return _}}function m(t){n.hasOwnProperty("O_SYMLINK")&&t.futimes?(t.lutimes=function(a,d,p,C){t.open(a,n.O_SYMLINK,function(_,A){if(_){C&&C(_);return}t.futimes(A,d,p,function(b){t.close(A,function(S){C&&C(b||S)})})})},t.lutimesSync=function(a,d,p){var C=t.openSync(a,n.O_SYMLINK),_,A=!0;try{_=t.futimesSync(C,d,p),A=!1}finally{if(A)try{t.closeSync(C)}catch{}else t.closeSync(C)}return _}):t.futimes&&(t.lutimes=function(a,d,p,C){C&&process.nextTick(C)},t.lutimesSync=function(){})}function h(t){return t&&function(a,d,p){return t.call(u,a,d,function(C){f(C)&&(C=null),p&&p.apply(this,arguments)})}}function F(t){return t&&function(a,d){try{return t.call(u,a,d)}catch(p){if(!f(p))throw p}}}function g(t){return t&&function(a,d,p,C){return t.call(u,a,d,p,function(_){f(_)&&(_=null),C&&C.apply(this,arguments)})}}function E(t){return t&&function(a,d,p){try{return t.call(u,a,d,p)}catch(C){if(!f(C))throw C}}}function v(t){return t&&function(a,d,p){typeof d=="function"&&(p=d,d=null);function C(_,A){A&&(A.uid<0&&(A.uid+=4294967296),A.gid<0&&(A.gid+=4294967296)),p&&p.apply(this,arguments)}return d?t.call(u,a,d,C):t.call(u,a,C)}}function y(t){return t&&function(a,d){var p=d?t.call(u,a,d):t.call(u,a);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}function f(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 g=m[h];this[g]=u[g]}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(E,v){if(E){c.emit("error",E),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(f,t){Object.defineProperty(f,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 f=D.format.apply(D,arguments);f="GFS4: "+f.split(/\n/).join(`
GFS4: `),console.error(