create-spree-app 0.5.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +116 -112
- package/package.json +11 -11
package/dist/index.js
CHANGED
|
@@ -1,128 +1,129 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __createRequire } from "node:module";
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
|
-
var
|
|
5
|
-
`)}displayWidth(
|
|
6
|
-
`+" ".repeat(r+
|
|
7
|
-
${
|
|
8
|
-
`)}};function
|
|
4
|
+
var Ip=Object.create;var ii=Object.defineProperty;var Dp=Object.getOwnPropertyDescriptor;var Fp=Object.getOwnPropertyNames;var Rp=Object.getPrototypeOf,Mp=Object.prototype.hasOwnProperty;var L=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Pp=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Fp(t))!Mp.call(e,o)&&o!==r&&ii(e,o,{get:()=>t[o],enumerable:!(n=Dp(t,o))||n.enumerable});return e};var Ie=(e,t,r)=>(r=e!=null?Ip(Rp(e)):{},Pp(t||!e||!e.__esModule?ii(r,"default",{value:e,enumerable:!0}):r,e));var Ke=T(qr=>{"use strict";var gt=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},zr=class extends gt{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};qr.CommanderError=gt;qr.InvalidArgumentError=zr});var yt=T(Kr=>{"use strict";var{InvalidArgumentError:kp}=Ke(),Yr=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new kp(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function Bp(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}Kr.Argument=Yr;Kr.humanReadableArgName=Bp});var Zr=T(Xr=>{"use strict";var{humanReadableArgName:Lp}=yt(),Jr=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(o=>!o._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((o,i)=>o.name().localeCompare(i.name())),r}compareOptions(t,r){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(o=>!o.hidden),n=t._getHelpOption();if(n&&!n.hidden){let o=n.short&&t._findOption(n.short),i=n.long&&t._findOption(n.long);!o&&!i?r.push(n):n.long&&!i?r.push(t.createOption(n.long,n.description)):n.short&&!o&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let o=n.options.filter(i=>!i.hidden);r.push(...o)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(n=>Lp(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(o)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(o)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let o=t.parent;o;o=o.parent)n=o.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let o=new Map;return t.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[])}),r.forEach(i=>{let s=n(i);o.has(s)||o.set(s,[]),o.get(s).push(i)}),o}formatHelp(t,r){let n=r.padWidth(t,r),o=r.helpWidth??80;function i(p,d){return r.formatItem(p,n,d,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),o),""]));let c=r.visibleArguments(t).map(p=>i(r.styleArgumentTerm(r.argumentTerm(p)),r.styleArgumentDescription(r.argumentDescription(p))));if(s=s.concat(this.formatItemList("Arguments:",c,r)),this.groupItems(t.options,r.visibleOptions(t),p=>p.helpGroupHeading??"Options:").forEach((p,d)=>{let f=p.map(m=>i(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));s=s.concat(this.formatItemList(d,f,r))}),r.showGlobalOptions){let p=r.visibleGlobalOptions(t).map(d=>i(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));s=s.concat(this.formatItemList("Global Options:",p,r))}return this.groupItems(t.commands,r.visibleCommands(t),p=>p.helpGroup()||"Commands:").forEach((p,d)=>{let f=p.map(m=>i(r.styleSubcommandTerm(r.subcommandTerm(m)),r.styleSubcommandDescription(r.subcommandDescription(m))));s=s.concat(this.formatItemList(d,f,r))}),s.join(`
|
|
5
|
+
`)}displayWidth(t){return si(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,n,o){let s=" ".repeat(2);if(!n)return s+t;let a=t.padEnd(r+t.length-o.displayWidth(t)),c=2,l=(this.helpWidth??80)-r-c-2,p;return l<this.minWidthToWrap||o.preformatted(n)?p=n:p=o.boxWrap(n,l).replace(/\n/g,`
|
|
6
|
+
`+" ".repeat(r+c)),s+a+" ".repeat(c)+p.replace(/\n/g,`
|
|
7
|
+
${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,i=[];return n.forEach(s=>{let a=s.match(o);if(a===null){i.push("");return}let c=[a.shift()],u=this.displayWidth(c[0]);a.forEach(l=>{let p=this.displayWidth(l);if(u+p<=r){c.push(l),u+=p;return}i.push(c.join(""));let d=l.trimStart();c=[d],u=this.displayWidth(d)}),i.push(c.join(""))}),i.join(`
|
|
8
|
+
`)}};function si(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}Xr.Help=Jr;Xr.stripColor=si});var rn=T(tn=>{"use strict";var{InvalidArgumentError:Np}=Ke(),Qr=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=jp(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new Np(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?ai(this.name().replace(/^no-/,"")):ai(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},en=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,i=o!==void 0?o:!1;return r.negate===(i===t)}};function ai(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function jp(e){let t,r,n=/^-[^-]$/,o=/^--[^-]/,i=e.split(/[ |,]+/).concat("guard");if(n.test(i[0])&&(t=i.shift()),o.test(i[0])&&(r=i.shift()),!t&&n.test(i[0])&&(t=i.shift()),!t&&o.test(i[0])&&(t=r,r=i.shift()),i[0].startsWith("-")){let s=i[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
9
9
|
- a short flag is a single dash and a single character
|
|
10
10
|
- either use a single dash and a single character (for a short flag)
|
|
11
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(
|
|
12
|
-
- too many short flags`):o.test(
|
|
11
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
12
|
+
- too many short flags`):o.test(s)?new Error(`${a}
|
|
13
13
|
- too many long flags`):new Error(`${a}
|
|
14
|
-
- unrecognised flag format`)}if(
|
|
14
|
+
- unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}tn.Option=Qr;tn.DualOptions=en});var li=T(ci=>{"use strict";function Up(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let o=1;o<=e.length;o++){let i=1;e[o-1]===t[n-1]?i=0:i=1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+i),o>1&&n>1&&e[o-1]===t[n-2]&&e[o-2]===t[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[e.length][t.length]}function Gp(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let n=[],o=3,i=.4;return t.forEach(s=>{if(s.length<=1)return;let a=Up(e,s),c=Math.max(e.length,s.length);(c-a)/c>i&&(a<o?(o=a,n=[s]):a===o&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
|
|
15
15
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
16
|
-
(Did you mean ${n[0]}?)`:""}
|
|
17
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=
|
|
18
|
-
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[
|
|
19
|
-
- already used by option '${r.flags}'`)}this.options.push(
|
|
20
|
-
- 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(
|
|
16
|
+
(Did you mean ${n[0]}?)`:""}ci.suggestSimilar=Gp});var mi=T(cn=>{"use strict";var Vp=L("events").EventEmitter,nn=L("child_process"),ce=L("path"),bt=L("fs"),E=L("process"),{Argument:Wp,humanReadableArgName:Hp}=yt(),{CommanderError:on}=Ke(),{Help:zp,stripColor:qp}=Zr(),{Option:ui,DualOptions:Yp}=rn(),{suggestSimilar:pi}=li(),sn=class e extends Vp{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:r=>E.stdout.write(r),writeErr:r=>E.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>E.stdout.isTTY?E.stdout.columns:void 0,getErrHelpWidth:()=>E.stderr.isTTY?E.stderr.columns:void 0,getOutHasColors:()=>an()??(E.stdout.isTTY&&E.stdout.hasColors?.()),getErrHasColors:()=>an()??(E.stderr.isTTY&&E.stderr.hasColors?.()),stripColor:r=>qp(r)},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(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let o=r,i=n;typeof o=="object"&&o!==null&&(i=o,o=null),i=i||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return o&&(c.description(o),c._executableHandler=!0),i.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(i.noHelp||i.hidden),c._executableFile=i.executableFile||null,a&&c.arguments(a),this._registerCommand(c),c.parent=this,c.copyInheritedSettings(this),o?this:c}createCommand(t){return new e(t)}createHelp(){return Object.assign(new zp,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,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
17
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new Wp(t,r)}argument(t,r,n,o){let i=this.createArgument(t,r);return typeof n=="function"?i.default(o).argParser(n):i.default(n),this.addArgument(i),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.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,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,o,i]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(o);return a.helpOption(!1),i&&a.arguments(i),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),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,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
18
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new on(t,r,n)),E.exit(t)}action(t){let r=n=>{let o=this.registeredArguments.length,i=n.slice(0,o);return this._storeOptionsAsProperties?i[o]=this:i[o]=this.opts(),i.push(this),t.apply(this,i)};return this._actionHandler=r,this}createOption(t,r){return new ui(t,r)}_callParseArg(t,r,n,o){try{return t.parseArg(r,n)}catch(i){if(i.code==="commander.invalidArgument"){let s=`${o} ${i.message}`;this.error(s,{exitCode:i.exitCode,code:i.code})}throw i}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=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 '${n}'
|
|
19
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=o=>[o.name()].concat(o.aliases()),n=r(t).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),i=r(t).join("|");throw new Error(`cannot add command '${i}' as already have command '${o}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let i=t.long.replace(/^--no-/,"--");this._findOption(i)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let o=(i,s,a)=>{i==null&&t.presetArg!==void 0&&(i=t.presetArg);let c=this.getOptionValue(n);i!==null&&t.parseArg?i=this._callParseArg(t,i,c,s):i!==null&&t.variadic&&(i=t._collectValue(i,c)),i==null&&(t.negate?i=!1:t.isBoolean()||t.optional?i=!0:i=""),this.setOptionValueWithSource(n,i,a)};return this.on("option:"+r,i=>{let s=`error: option '${t.flags}' argument '${i}' is invalid.`;o(i,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,i=>{let s=`error: option '${t.flags}' value '${i}' from env '${t.envVar}' is invalid.`;o(i,s,"env")}),this}_optionEx(t,r,n,o,i){if(typeof r=="object"&&r instanceof ui)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!t.mandatory),typeof o=="function")s.default(i).argParser(o);else if(o instanceof RegExp){let a=o;o=(c,u)=>{let l=a.exec(c);return l?l[0]:u},s.default(i).argParser(o)}else s.default(o);return this.addOption(s)}option(t,r,n,o){return this._optionEx({},t,r,n,o)}requiredOption(t,r,n,o){return this._optionEx({mandatory:!0},t,r,n,o)}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,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){E.versions?.electron&&(r.from="electron");let o=E.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}t===void 0&&(t=E.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":E.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),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.
|
|
20
|
+
- 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,r,n){if(bt.existsSync(t))return;let o=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",i=`'${t}' does not exist
|
|
21
21
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
22
22
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
23
|
-
- ${o}`;throw new Error(
|
|
23
|
+
- ${o}`;throw new Error(i)}_executeSubCommand(t,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function i(l,p){let d=ce.resolve(l,p);if(bt.existsSync(d))return d;if(o.includes(ce.extname(p)))return;let f=o.find(m=>bt.existsSync(`${d}${m}`));if(f)return`${d}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=bt.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=ce.resolve(ce.dirname(l),a)}if(a){let l=i(a,s);if(!l&&!t._executableFile&&this._scriptPath){let p=ce.basename(this._scriptPath,ce.extname(this._scriptPath));p!==this._name&&(l=i(a,`${p}-${t._name}`))}s=l||s}n=o.includes(ce.extname(s));let c;E.platform!=="win32"?n?(r.unshift(s),r=di(E.execArgv).concat(r),c=nn.spawn(E.argv[0],r,{stdio:"inherit"})):c=nn.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=di(E.execArgv).concat(r),c=nn.spawn(E.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{E.on(p,()=>{c.killed===!1&&c.exitCode===null&&c.kill(p)})});let u=this._exitCallback;c.on("close",l=>{l=l??1,u?u(new on(l,"commander.executeSubCommandAsync","(close)")):E.exit(l)}),c.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!u)E.exit(1);else{let p=new on(1,"commander.executeSubCommandAsync","(error)");p.nestedError=l,u(p)}}),this.runningCommand=c}_dispatchSubcommand(t,r,n){let o=this._findCommand(t);o||this.help({error:!0}),o._prepareForParse();let i;return i=this._chainOrCallSubCommandHook(i,o,"preSubcommand"),i=this._chainOrCall(i,()=>{if(o._executableHandler)this._executeSubCommand(o,r.concat(n));else return o._parseCommand(r,n)}),i}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==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(){let t=(n,o,i)=>{let s=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,o,i,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,o)=>{let i=n.defaultValue;n.variadic?o<this.args.length?(i=this.args.slice(o),n.parseArg&&(i=i.reduce((s,a)=>t(n,a,s),n.defaultValue))):i===void 0&&(i=[]):o<this.args.length&&(i=this.args[o],n.parseArg&&(i=t(n,i,n.defaultValue))),r[o]=i}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,o=[];return this._getCommandAndAncestors().reverse().filter(i=>i._lifeCycleHooks[r]!==void 0).forEach(i=>{i._lifeCycleHooks[r].forEach(s=>{o.push({hookedCommand:i,callback:s})})}),r==="postAction"&&o.reverse(),o.forEach(i=>{n=this._chainOrCall(n,()=>i.callback(i.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let o=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(i=>{o=this._chainOrCall(o,()=>i(this,r))}),o}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let o=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},i=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(i,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(i))o(),this._processArguments(),this.parent.emit(i,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=t.find(i=>n.conflictsWith.includes(i.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],o=r;function i(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(p=>p.options.map(d=>d.short).some(d=>/^-\d$/.test(d))):!1,a=null,c=null,u=0;for(;u<t.length||c;){let l=c??t[u++];if(c=null,l==="--"){o===n&&o.push(l),o.push(...t.slice(u));break}if(a&&(!i(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,i(l)){let p=this._findOption(l);if(p){if(p.required){let d=t[u++];d===void 0&&this.optionMissingArgument(p),this.emit(`option:${p.name()}`,d)}else if(p.optional){let d=null;u<t.length&&(!i(t[u])||s(t[u]))&&(d=t[u++]),this.emit(`option:${p.name()}`,d)}else this.emit(`option:${p.name()}`);a=p.variadic?p:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let p=this._findOption(`-${l[1]}`);if(p){p.required||p.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${p.name()}`,l.slice(2)):(this.emit(`option:${p.name()}`),c=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let p=l.indexOf("="),d=this._findOption(l.slice(0,p));if(d&&(d.required||d.optional)){this.emit(`option:${d.name()}`,l.slice(p+1));continue}}if(o===r&&i(l)&&!(this.commands.length===0&&s(l))&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),n.push(...t.slice(u));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...t.slice(u));break}else if(this._defaultCommandName){n.push(l,...t.slice(u));break}}if(this._passThroughOptions){o.push(l,...t.slice(u));break}o.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let o=this.options[n].attributeName();t[o]=o===this._versionOptionName?this._version:this[o]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
|
|
24
24
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
25
25
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
26
|
-
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,
|
|
27
|
-
`),this._exit(0,"commander.version",
|
|
28
|
-
Expecting one of '${n.join("', '")}'`);let o=`${
|
|
29
|
-
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function ni(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,n="127.0.0.1",o="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?r=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=s[1],/^\d+$/.test(s[3])?o=s[3]:n=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=s[1],n=s[3],o=s[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:e})}function Qr(){if(b.env.NO_COLOR||b.env.FORCE_COLOR==="0"||b.env.FORCE_COLOR==="false")return!1;if(b.env.FORCE_COLOR||b.env.CLICOLOR_FORCE!==void 0)return!0}en.Command=Zr;en.useColor=Qr});var ui=S(k=>{"use strict";var{Argument:ii}=lt(),{Command:tn}=oi(),{CommanderError:Tp,InvalidArgumentError:si}=Ve(),{Help:Ip}=Hr(),{Option:ai}=Kr();k.program=new tn;k.createCommand=t=>new tn(t);k.createOption=(t,e)=>new ai(t,e);k.createArgument=(t,e)=>new ii(t,e);k.Command=tn;k.Option=ai;k.Argument=ii;k.Help=Ip;k.CommanderError=Tp;k.InvalidArgumentError=si;k.InvalidOptionArgumentError=si});var nn=S((by,pi)=>{"use strict";var rn={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},Rp={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Mp={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?rn.up():"");return t&&(e+=rn.left),e}};pi.exports={cursor:rn,scroll:Rp,erase:Mp,beep:"\x07"}});var Ge=S((Cy,on)=>{"use strict";var Dt=process||{},di=Dt.argv||[],dt=Dt.env||{},Pp=!(dt.NO_COLOR||di.includes("--no-color"))&&(!!dt.FORCE_COLOR||di.includes("--color")||Dt.platform==="win32"||(Dt.stdout||{}).isTTY&&dt.TERM!=="dumb"||!!dt.CI),kp=(t,e,r=t)=>n=>{let o=""+n,s=o.indexOf(e,t.length);return~s?t+Lp(o,e,r,s)+e:t+o+e},Lp=(t,e,r,n)=>{let o="",s=0;do o+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return o+t.substring(s)},Di=(t=Pp)=>{let e=t?kp:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};on.exports=Di();on.exports.createColors=Di});var ws=S((xw,Es)=>{"use strict";Es.exports=ys;ys.sync=wD;var bs=R("fs");function ED(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&t.substr(-o.length).toLowerCase()===o)return!0}return!1}function Cs(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:ED(e,r)}function ys(t,e,r){bs.stat(t,function(n,o){r(n,n?!1:Cs(o,t,e))})}function wD(t,e){return Cs(bs.statSync(t),t,e)}});var Os=S((Aw,As)=>{"use strict";As.exports=Ss;Ss.sync=FD;var Fs=R("fs");function Ss(t,e,r){Fs.stat(t,function(n,o){r(n,n?!1:xs(o,e))})}function FD(t,e){return xs(Fs.statSync(t),e)}function xs(t,e){return t.isFile()&&SD(t,e)}function SD(t,e){var r=t.mode,n=t.uid,o=t.gid,s=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),i=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),u=parseInt("010",8),c=parseInt("001",8),l=a|u,p=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return p}});var Bs=S(($w,$s)=>{"use strict";var Ow=R("fs"),Lt;process.platform==="win32"||global.TESTING_WINDOWS?Lt=ws():Lt=Os();$s.exports=An;An.sync=xD;function An(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){An(t,e||{},function(s,i){s?o(s):n(i)})})}Lt(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function xD(t,e){try{return Lt.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Ps=S((Bw,Ms)=>{"use strict";var $e=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",_s=R("path"),AD=$e?";":":",vs=Bs(),Ts=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),Is=(t,e)=>{let r=e.colon||AD,n=t.match(/\//)||$e&&t.match(/\\/)?[""]:[...$e?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=$e?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=$e?o.split(r):[""];return $e&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},Rs=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=Is(t,e),i=[],a=c=>new Promise((l,p)=>{if(c===n.length)return e.all&&i.length?l(i):p(Ts(t));let d=n[c],D=/^".*"$/.test(d)?d.slice(1,-1):d,f=_s.join(D,t),g=!D&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;l(u(g,c,0))}),u=(c,l,p)=>new Promise((d,D)=>{if(p===o.length)return d(a(l+1));let f=o[p];vs(c+f,{pathExt:s},(g,E)=>{if(!g&&E)if(e.all)i.push(c+f);else return d(c+f);return d(u(c,l,p+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},OD=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Is(t,e),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=_s.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(vs.sync(d,{pathExt:o}))if(e.all)s.push(d);else return d}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw Ts(t)};Ms.exports=Rs;Rs.sync=OD});var Ls=S((_w,On)=>{"use strict";var ks=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};On.exports=ks;On.exports.default=ks});var Vs=S((vw,Us)=>{"use strict";var js=R("path"),$D=Ps(),BD=Ls();function Ns(t,e){let r=t.options.env||process.env,n=process.cwd(),o=t.options.cwd!=null,s=o&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let i;try{i=$D.sync(t.command,{path:r[BD({env:r})],pathExt:e?js.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=js.resolve(o?t.options.cwd:"",i)),i}function _D(t){return Ns(t)||Ns(t,!0)}Us.exports=_D});var Gs=S((Tw,Bn)=>{"use strict";var $n=/([()\][%!^"`<>&|;, *?])/g;function vD(t){return t=t.replace($n,"^$1"),t}function TD(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace($n,"^$1"),e&&(t=t.replace($n,"^$1")),t}Bn.exports.command=vD;Bn.exports.argument=TD});var Hs=S((Iw,Ws)=>{"use strict";Ws.exports=/^#!(.*)/});var qs=S((Rw,zs)=>{"use strict";var ID=Hs();zs.exports=(t="")=>{let e=t.match(ID);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Ks=S((Mw,Ys)=>{"use strict";var _n=R("fs"),RD=qs();function MD(t){let r=Buffer.alloc(150),n;try{n=_n.openSync(t,"r"),_n.readSync(n,r,0,150,0),_n.closeSync(n)}catch{}return RD(r.toString())}Ys.exports=MD});var Qs=S((Pw,Zs)=>{"use strict";var PD=R("path"),Js=Vs(),Xs=Gs(),kD=Ks(),LD=process.platform==="win32",jD=/\.(?:com|exe)$/i,ND=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function UD(t){t.file=Js(t);let e=t.file&&kD(t.file);return e?(t.args.unshift(t.file),t.command=e,Js(t)):t.file}function VD(t){if(!LD)return t;let e=UD(t),r=!jD.test(e);if(t.options.forceShell||r){let n=ND.test(e);t.command=PD.normalize(t.command),t.command=Xs.command(t.command),t.args=t.args.map(s=>Xs.argument(s,n));let o=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${o}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function GD(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:VD(n)}Zs.exports=GD});var ra=S((kw,ta)=>{"use strict";var vn=process.platform==="win32";function Tn(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function WD(t,e){if(!vn)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=ea(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function ea(t,e){return vn&&t===1&&!e.file?Tn(e.original,"spawn"):null}function HD(t,e){return vn&&t===1&&!e.file?Tn(e.original,"spawnSync"):null}ta.exports={hookChildProcess:WD,verifyENOENT:ea,verifyENOENTSync:HD,notFoundError:Tn}});var ia=S((Lw,Be)=>{"use strict";var na=R("child_process"),In=Qs(),Rn=ra();function oa(t,e,r){let n=In(t,e,r),o=na.spawn(n.command,n.args,n.options);return Rn.hookChildProcess(o,n),o}function zD(t,e,r){let n=In(t,e,r),o=na.spawnSync(n.command,n.args,n.options);return o.error=o.error||Rn.verifyENOENTSync(o.status,n),o}Be.exports=oa;Be.exports.spawn=oa;Be.exports.sync=zD;Be.exports._parse=In;Be.exports._enoent=Rn});var ci=ue(ui(),1),{program:ay,createCommand:uy,createArgument:cy,createOption:ly,CommanderError:py,InvalidArgumentError:dy,InvalidOptionArgumentError:Dy,Command:li,Argument:my,Option:fy,Help:hy}=ci.default;import{stripVTControlCharacters as dn}from"util";var T=ue(nn(),1),Fi=ue(Ge(),1);import{stdin as Ei,stdout as wi}from"process";import*as ce from"readline";import mi from"readline";import{Writable as jp}from"stream";function Np({onlyFirst:t=!1}={}){let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}var Up=Np();function Si(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Up,"")}function xi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ai={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(n){var o=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,i=o;return 55296<=o&&o<=56319&&56320<=s&&s<=57343&&(o&=1023,s&=1023,i=o<<10|s,i+=65536),i==12288||65281<=i&&i<=65376||65504<=i&&i<=65510?"F":i==8361||65377<=i&&i<=65470||65474<=i&&i<=65479||65482<=i&&i<=65487||65490<=i&&i<=65495||65498<=i&&i<=65500||65512<=i&&i<=65518?"H":4352<=i&&i<=4447||4515<=i&&i<=4519||4602<=i&&i<=4607||9001<=i&&i<=9002||11904<=i&&i<=11929||11931<=i&&i<=12019||12032<=i&&i<=12245||12272<=i&&i<=12283||12289<=i&&i<=12350||12353<=i&&i<=12438||12441<=i&&i<=12543||12549<=i&&i<=12589||12593<=i&&i<=12686||12688<=i&&i<=12730||12736<=i&&i<=12771||12784<=i&&i<=12830||12832<=i&&i<=12871||12880<=i&&i<=13054||13056<=i&&i<=19903||19968<=i&&i<=42124||42128<=i&&i<=42182||43360<=i&&i<=43388||44032<=i&&i<=55203||55216<=i&&i<=55238||55243<=i&&i<=55291||63744<=i&&i<=64255||65040<=i&&i<=65049||65072<=i&&i<=65106||65108<=i&&i<=65126||65128<=i&&i<=65131||110592<=i&&i<=110593||127488<=i&&i<=127490||127504<=i&&i<=127546||127552<=i&&i<=127560||127568<=i&&i<=127569||131072<=i&&i<=194367||177984<=i&&i<=196605||196608<=i&&i<=262141?"W":32<=i&&i<=126||162<=i&&i<=163||165<=i&&i<=166||i==172||i==175||10214<=i&&i<=10221||10629<=i&&i<=10630?"Na":i==161||i==164||167<=i&&i<=168||i==170||173<=i&&i<=174||176<=i&&i<=180||182<=i&&i<=186||188<=i&&i<=191||i==198||i==208||215<=i&&i<=216||222<=i&&i<=225||i==230||232<=i&&i<=234||236<=i&&i<=237||i==240||242<=i&&i<=243||247<=i&&i<=250||i==252||i==254||i==257||i==273||i==275||i==283||294<=i&&i<=295||i==299||305<=i&&i<=307||i==312||319<=i&&i<=322||i==324||328<=i&&i<=331||i==333||338<=i&&i<=339||358<=i&&i<=359||i==363||i==462||i==464||i==466||i==468||i==470||i==472||i==474||i==476||i==593||i==609||i==708||i==711||713<=i&&i<=715||i==717||i==720||728<=i&&i<=731||i==733||i==735||768<=i&&i<=879||913<=i&&i<=929||931<=i&&i<=937||945<=i&&i<=961||963<=i&&i<=969||i==1025||1040<=i&&i<=1103||i==1105||i==8208||8211<=i&&i<=8214||8216<=i&&i<=8217||8220<=i&&i<=8221||8224<=i&&i<=8226||8228<=i&&i<=8231||i==8240||8242<=i&&i<=8243||i==8245||i==8251||i==8254||i==8308||i==8319||8321<=i&&i<=8324||i==8364||i==8451||i==8453||i==8457||i==8467||i==8470||8481<=i&&i<=8482||i==8486||i==8491||8531<=i&&i<=8532||8539<=i&&i<=8542||8544<=i&&i<=8555||8560<=i&&i<=8569||i==8585||8592<=i&&i<=8601||8632<=i&&i<=8633||i==8658||i==8660||i==8679||i==8704||8706<=i&&i<=8707||8711<=i&&i<=8712||i==8715||i==8719||i==8721||i==8725||i==8730||8733<=i&&i<=8736||i==8739||i==8741||8743<=i&&i<=8748||i==8750||8756<=i&&i<=8759||8764<=i&&i<=8765||i==8776||i==8780||i==8786||8800<=i&&i<=8801||8804<=i&&i<=8807||8810<=i&&i<=8811||8814<=i&&i<=8815||8834<=i&&i<=8835||8838<=i&&i<=8839||i==8853||i==8857||i==8869||i==8895||i==8978||9312<=i&&i<=9449||9451<=i&&i<=9547||9552<=i&&i<=9587||9600<=i&&i<=9615||9618<=i&&i<=9621||9632<=i&&i<=9633||9635<=i&&i<=9641||9650<=i&&i<=9651||9654<=i&&i<=9655||9660<=i&&i<=9661||9664<=i&&i<=9665||9670<=i&&i<=9672||i==9675||9678<=i&&i<=9681||9698<=i&&i<=9701||i==9711||9733<=i&&i<=9734||i==9737||9742<=i&&i<=9743||9748<=i&&i<=9749||i==9756||i==9758||i==9792||i==9794||9824<=i&&i<=9825||9827<=i&&i<=9829||9831<=i&&i<=9834||9836<=i&&i<=9837||i==9839||9886<=i&&i<=9887||9918<=i&&i<=9919||9924<=i&&i<=9933||9935<=i&&i<=9953||i==9955||9960<=i&&i<=9983||i==10045||i==10071||10102<=i&&i<=10111||11093<=i&&i<=11097||12872<=i&&i<=12879||57344<=i&&i<=63743||65024<=i&&i<=65039||i==65533||127232<=i&&i<=127242||127248<=i&&i<=127277||127280<=i&&i<=127337||127344<=i&&i<=127386||917760<=i&&i<=917999||983040<=i&&i<=1048573||1048576<=i&&i<=1114109?"A":"N"},e.characterLength=function(n){var o=this.eastAsianWidth(n);return o=="F"||o=="W"||o=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(n){for(var o=r(n),s=0,i=0;i<o.length;i++)s=s+this.characterLength(o[i]);return s},e.slice=function(n,o,s){textLen=e.length(n),o=o||0,s=s||1,o<0&&(o=textLen+o),s<0&&(s=textLen+s);for(var i="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=e.length(l);if(a>=o-(p==2?1:0))if(a+p<=s)i+=l;else break;a+=p}return i}})(Ai);var Vp=Ai.exports,Gp=xi(Vp),Wp=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},Hp=xi(Wp);function We(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=Si(t),t.length===0))return 0;t=t.replace(Hp()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let o of t){let s=o.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Gp.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var sn=10,fi=(t=0)=>e=>`\x1B[${e+t}m`,hi=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,gi=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,w={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(w.modifier);var zp=Object.keys(w.color),qp=Object.keys(w.bgColor);[...zp,...qp];function Yp(){let t=new Map;for(let[e,r]of Object.entries(w)){for(let[n,o]of Object.entries(r))w[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=w[n],t.set(o[0],o[1]);Object.defineProperty(w,e,{value:r,enumerable:!1})}return Object.defineProperty(w,"codes",{value:t,enumerable:!1}),w.color.close="\x1B[39m",w.bgColor.close="\x1B[49m",w.color.ansi=fi(),w.color.ansi256=hi(),w.color.ansi16m=gi(),w.bgColor.ansi=fi(sn),w.bgColor.ansi256=hi(sn),w.bgColor.ansi16m=gi(sn),Object.defineProperties(w,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:e=>w.rgbToAnsi256(...w.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,o;if(e>=232)r=((e-232)*10+8)/255,n=r,o=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,o=a%6/5}let s=Math.max(r,n,o)*2;if(s===0)return 30;let i=30+(Math.round(o)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>w.ansi256ToAnsi(w.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>w.ansi256ToAnsi(w.hexToAnsi256(e)),enumerable:!1}}),w}var Kp=Yp(),Ct=new Set(["\x1B","\x9B"]),Jp=39,cn="\x07",Oi="[",Xp="]",$i="m",ln=`${Xp}8;;`,bi=t=>`${Ct.values().next().value}${Oi}${t}${$i}`,Ci=t=>`${Ct.values().next().value}${ln}${t}${cn}`,Zp=t=>t.split(" ").map(e=>We(e)),an=(t,e,r)=>{let n=[...e],o=!1,s=!1,i=We(Si(t[t.length-1]));for(let[a,u]of n.entries()){let c=We(u);if(i+c<=r?t[t.length-1]+=u:(t.push(u),i=0),Ct.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(ln)),o){s?u===cn&&(o=!1,s=!1):u===$i&&(o=!1);continue}i+=c,i===r&&a<n.length-1&&(t.push(""),i=0)}!i&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},Qp=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(We(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},ed=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,i=Zp(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=We(a[a.length-1]);if(c!==0&&(p>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&i[c]>e){let d=e-p,D=1+Math.floor((i[c]-d-1)/e);Math.floor((i[c]-1)/e)<D&&a.push(""),an(a,l,e);continue}if(p+i[c]>e&&p>0&&i[c]>0){if(r.wordWrap===!1&&p<e){an(a,l,e);continue}a.push("")}if(p+i[c]>e&&r.wordWrap===!1){an(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>Qp(c)));let u=[...a.join(`
|
|
30
|
-
`)
|
|
31
|
-
|
|
32
|
-
`&&(o&&
|
|
33
|
-
`).split(`
|
|
34
|
-
`)
|
|
35
|
-
`)}var
|
|
36
|
-
`),n
|
|
37
|
-
`)
|
|
38
|
-
`)
|
|
39
|
-
`).length-1;this.output.write(
|
|
40
|
-
`);this.output.write(
|
|
41
|
-
`).slice(
|
|
42
|
-
`)),this._prevFrame=e;return}this.output.write(
|
|
43
|
-
|
|
44
|
-
`,
|
|
45
|
-
${
|
|
46
|
-
${
|
|
47
|
-
|
|
48
|
-
${
|
|
49
|
-
|
|
50
|
-
`
|
|
51
|
-
${Mi(this.state)} ${t.message}
|
|
52
|
-
`,o=this.value?e:r;switch(this.state){case"submit":return`${n}${m.default.gray($)} ${m.default.dim(o)}`;case"cancel":return`${n}${m.default.gray($)} ${m.default.strikethrough(m.default.dim(o))}
|
|
53
|
-
${m.default.gray($)}`;default:return`${n}${m.default.cyan($)} ${this.value?`${m.default.green(_i)} ${e}`:`${m.default.dim(vi)} ${m.default.dim(e)}`} ${m.default.dim("/")} ${this.value?`${m.default.dim(vi)} ${m.default.dim(r)}`:`${m.default.green(_i)} ${r}`}
|
|
54
|
-
${m.default.cyan(He)}
|
|
55
|
-
`}}}).prompt()};var ki=(t="",e="")=>{let r=`
|
|
56
|
-
${t}
|
|
57
|
-
`.split(`
|
|
58
|
-
`),n=dn(e).length,o=Math.max(r.reduce((i,a)=>{let u=dn(a);return u.length>i?u.length:i},0),n)+2,s=r.map(i=>`${m.default.gray($)} ${m.default.dim(i)}${" ".repeat(o-dn(i).length)}${m.default.gray($)}`).join(`
|
|
59
|
-
`);process.stdout.write(`${m.default.gray($)}
|
|
60
|
-
${m.default.green(Et)} ${m.default.reset(e)} ${m.default.gray(Ti.repeat(Math.max(o-n-1,1))+ld)}
|
|
61
|
-
${s}
|
|
62
|
-
${m.default.gray(pd+Ti.repeat(o+2)+dd)}
|
|
63
|
-
`)},U=(t="")=>{process.stdout.write(`${m.default.gray(He)} ${m.default.red(t)}
|
|
64
|
-
|
|
65
|
-
`)},Li=(t="")=>{process.stdout.write(`${m.default.gray(cd)} ${t}
|
|
66
|
-
`)},ji=(t="")=>{process.stdout.write(`${m.default.gray($)}
|
|
67
|
-
${m.default.gray(He)} ${t}
|
|
68
|
-
|
|
69
|
-
`)},Y={message:(t="",{symbol:e=m.default.gray($)}={})=>{let r=[`${m.default.gray($)}`];if(t){let[n,...o]=t.split(`
|
|
70
|
-
`);r.push(`${e} ${n}`,...o.map(s=>`${m.default.gray($)} ${s}`))}process.stdout.write(`${r.join(`
|
|
26
|
+
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,i=n.code||"commander.error";this._exit(o,i,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in E.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,E.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new Yp(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(o=>!r(o)).forEach(o=>{this.setOptionValueWithSource(o,n.implied[o],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=s=>{let a=s.attributeName(),c=this.getOptionValue(a),u=this.options.find(p=>p.negate&&a===p.attributeName()),l=this.options.find(p=>!p.negate&&a===p.attributeName());return u&&(u.presetArg===void 0&&c===!1||u.presetArg!==void 0&&c===u.presetArg)?u:l||s},o=s=>{let a=n(s),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},i=`error: ${o(t)} cannot be used with ${o(r)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let o=[],i=this;do{let s=i.createHelp().visibleOptions(i).filter(a=>a.long).map(a=>a.long);o=o.concat(s),i=i.parent}while(i&&!i._enablePositionalOptions);r=pi(t,o)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",i=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(i,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(i=>{o.push(i.name()),i.alias()&&o.push(i.alias())}),r=pi(t,o)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let o=this.createOption(r,n);return this._versionOptionName=o.attributeName(),this._registerOption(o),this.on("option:"+o.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
27
|
+
`),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>Hp(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).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=ce.basename(t,ce.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let o=r.formatHelp(this,r);return n.hasColors?o:this._outputConfiguration.stripColor(o)}_getOutputContext(t){t=t||{};let r=!!t.error,n,o,i;return r?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),i=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),i=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:i}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let i=this.helpInformation({error:n.error});if(r&&(i=r(i),typeof i!="string"&&!Buffer.isBuffer(i)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(i),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",o))}helpOption(t,r){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",r??"display help for command"),(t||r)&&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 r=Number(E.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
28
|
+
Expecting one of '${n.join("', '")}'`);let o=`${t}Help`;return this.on(o,i=>{let s;typeof r=="function"?s=r({error:i.error,command:i.command}):s=r,s&&i.write(`${s}
|
|
29
|
+
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function di(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",o="9229",i;return(i=t.match(/^(--inspect(-brk)?)$/))!==null?r=i[1]:(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=i[1],/^\d+$/.test(i[3])?o=i[3]:n=i[3]):(i=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=i[1],n=i[3],o=i[4]),r&&o!=="0"?`${r}=${n}:${parseInt(o)+1}`:t})}function an(){if(E.env.NO_COLOR||E.env.FORCE_COLOR==="0"||E.env.FORCE_COLOR==="false")return!1;if(E.env.FORCE_COLOR||E.env.CLICOLOR_FORCE!==void 0)return!0}cn.Command=sn;cn.useColor=an});var yi=T(V=>{"use strict";var{Argument:fi}=yt(),{Command:ln}=mi(),{CommanderError:Kp,InvalidArgumentError:hi}=Ke(),{Help:Jp}=Zr(),{Option:gi}=rn();V.program=new ln;V.createCommand=e=>new ln(e);V.createOption=(e,t)=>new gi(e,t);V.createArgument=(e,t)=>new fi(e,t);V.Command=ln;V.Option=gi;V.Argument=fi;V.Help=Jp;V.CommanderError=Kp;V.InvalidArgumentError=hi;V.InvalidOptionArgumentError=hi});var gn=T((US,Fi)=>{"use strict";var hn={to(e,t){return t?`\x1B[${t+1};${e+1}H`:`\x1B[${e+1}G`},move(e,t){let r="";return e<0?r+=`\x1B[${-e}D`:e>0&&(r+=`\x1B[${e}C`),t<0?r+=`\x1B[${-t}A`:t>0&&(r+=`\x1B[${t}B`),r},up:(e=1)=>`\x1B[${e}A`,down:(e=1)=>`\x1B[${e}B`,forward:(e=1)=>`\x1B[${e}C`,backward:(e=1)=>`\x1B[${e}D`,nextLine:(e=1)=>"\x1B[E".repeat(e),prevLine:(e=1)=>"\x1B[F".repeat(e),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},sd={up:(e=1)=>"\x1B[S".repeat(e),down:(e=1)=>"\x1B[T".repeat(e)},ad={screen:"\x1B[2J",up:(e=1)=>"\x1B[1J".repeat(e),down:(e=1)=>"\x1B[J".repeat(e),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?hn.up():"");return e&&(t+=hn.left),t}};Fi.exports={cursor:hn,scroll:sd,erase:ad,beep:"\x07"}});var $n=T((Aw,En)=>{"use strict";var It=process||{},Ji=It.argv||[],Tt=It.env||{},Td=!(Tt.NO_COLOR||Ji.includes("--no-color"))&&(!!Tt.FORCE_COLOR||Ji.includes("--color")||It.platform==="win32"||(It.stdout||{}).isTTY&&Tt.TERM!=="dumb"||!!Tt.CI),Id=(e,t,r=e)=>n=>{let o=""+n,i=o.indexOf(t,e.length);return~i?e+Dd(o,t,r,i)+t:e+o+t},Dd=(e,t,r,n)=>{let o="",i=0;do o+=e.substring(i,n)+r,i=n+t.length,n=e.indexOf(t,i);while(~n);return o+e.substring(i)},Xi=(e=Td)=>{let t=e?Id:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};En.exports=Xi();En.exports.createColors=Xi});var Ms=T((mE,Rs)=>{"use strict";Rs.exports=Fs;Fs.sync=Lm;var Is=L("fs");function Bm(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Ds(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:Bm(t,r)}function Fs(e,t,r){Is.stat(e,function(n,o){r(n,n?!1:Ds(o,e,t))})}function Lm(e,t){return Ds(Is.statSync(e),e,t)}});var Ns=T((fE,Ls)=>{"use strict";Ls.exports=ks;ks.sync=Nm;var Ps=L("fs");function ks(e,t,r){Ps.stat(e,function(n,o){r(n,n?!1:Bs(o,t))})}function Nm(e,t){return Bs(Ps.statSync(e),t)}function Bs(e,t){return e.isFile()&&jm(e,t)}function jm(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),l=a|c,p=r&u||r&c&&o===s||r&a&&n===i||r&l&&i===0;return p}});var Us=T((gE,js)=>{"use strict";var hE=L("fs"),zt;process.platform==="win32"||global.TESTING_WINDOWS?zt=Ms():zt=Ns();js.exports=Pn;Pn.sync=Um;function Pn(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){Pn(e,t||{},function(i,s){i?o(i):n(s)})})}zt(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function Um(e,t){try{return zt.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var Ys=T((yE,qs)=>{"use strict";var Pe=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Gs=L("path"),Gm=Pe?";":":",Vs=Us(),Ws=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Hs=(e,t)=>{let r=t.colon||Gm,n=e.match(/\//)||Pe&&e.match(/\\/)?[""]:[...Pe?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=Pe?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=Pe?o.split(r):[""];return Pe&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},zs=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=Hs(e,t),s=[],a=u=>new Promise((l,p)=>{if(u===n.length)return t.all&&s.length?l(s):p(Ws(e));let d=n[u],f=/^".*"$/.test(d)?d.slice(1,-1):d,m=Gs.join(f,e),h=!f&&/^\.[\\\/]/.test(e)?e.slice(0,2)+m:m;l(c(h,u,0))}),c=(u,l,p)=>new Promise((d,f)=>{if(p===o.length)return d(a(l+1));let m=o[p];Vs(u+m,{pathExt:i},(h,$)=>{if(!h&&$)if(t.all)s.push(u+m);else return d(u+m);return d(c(u,l,p+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},Vm=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=Hs(e,t),i=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=Gs.join(c,e),l=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let p=0;p<n.length;p++){let d=l+n[p];try{if(Vs.sync(d,{pathExt:o}))if(t.all)i.push(d);else return d}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw Ws(e)};qs.exports=zs;zs.sync=Vm});var Js=T((bE,kn)=>{"use strict";var Ks=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};kn.exports=Ks;kn.exports.default=Ks});var ea=T((SE,Qs)=>{"use strict";var Xs=L("path"),Wm=Ys(),Hm=Js();function Zs(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Wm.sync(e.command,{path:r[Hm({env:r})],pathExt:t?Xs.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=Xs.resolve(o?e.options.cwd:"",s)),s}function zm(e){return Zs(e)||Zs(e,!0)}Qs.exports=zm});var ta=T((wE,Ln)=>{"use strict";var Bn=/([()\][%!^"`<>&|;, *?])/g;function qm(e){return e=e.replace(Bn,"^$1"),e}function Ym(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Bn,"^$1"),t&&(e=e.replace(Bn,"^$1")),e}Ln.exports.command=qm;Ln.exports.argument=Ym});var na=T((xE,ra)=>{"use strict";ra.exports=/^#!(.*)/});var ia=T((EE,oa)=>{"use strict";var Km=na();oa.exports=(e="")=>{let t=e.match(Km);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var aa=T(($E,sa)=>{"use strict";var Nn=L("fs"),Jm=ia();function Xm(e){let r=Buffer.alloc(150),n;try{n=Nn.openSync(e,"r"),Nn.readSync(n,r,0,150,0),Nn.closeSync(n)}catch{}return Jm(r.toString())}sa.exports=Xm});var pa=T((_E,ua)=>{"use strict";var Zm=L("path"),ca=ea(),la=ta(),Qm=aa(),ef=process.platform==="win32",tf=/\.(?:com|exe)$/i,rf=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function nf(e){e.file=ca(e);let t=e.file&&Qm(e.file);return t?(e.args.unshift(e.file),e.command=t,ca(e)):e.file}function of(e){if(!ef)return e;let t=nf(e),r=!tf.test(t);if(e.options.forceShell||r){let n=rf.test(t);e.command=Zm.normalize(e.command),e.command=la.command(e.command),e.args=e.args.map(i=>la.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function sf(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:of(n)}ua.exports=sf});var fa=T((CE,ma)=>{"use strict";var jn=process.platform==="win32";function Un(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function af(e,t){if(!jn)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=da(o,t);if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function da(e,t){return jn&&e===1&&!t.file?Un(t.original,"spawn"):null}function cf(e,t){return jn&&e===1&&!t.file?Un(t.original,"spawnSync"):null}ma.exports={hookChildProcess:af,verifyENOENT:da,verifyENOENTSync:cf,notFoundError:Un}});var ya=T((AE,ke)=>{"use strict";var ha=L("child_process"),Gn=pa(),Vn=fa();function ga(e,t,r){let n=Gn(e,t,r),o=ha.spawn(n.command,n.args,n.options);return Vn.hookChildProcess(o,n),o}function lf(e,t,r){let n=Gn(e,t,r),o=ha.spawnSync(n.command,n.args,n.options);return o.error=o.error||Vn.verifyENOENTSync(o.status,n),o}ke.exports=ga;ke.exports.spawn=ga;ke.exports.sync=lf;ke.exports._parse=Gn;ke.exports._enoent=Vn});var bi=Ie(yi(),1),{program:$S,createCommand:_S,createArgument:CS,createOption:AS,CommanderError:OS,InvalidArgumentError:vS,InvalidOptionArgumentError:TS,Command:Si,Argument:IS,Option:DS,Help:FS}=bi.default;import{styleText as cd}from"util";import{stdout as bn,stdin as Mi}from"process";import*as he from"readline";import ld from"readline";var wi=e=>e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109,xi=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,Ei=e=>e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9800&&e<=9811||e===9855||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=19968&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101632&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129672||e>=129680&&e<=129725||e>=129727&&e<=129733||e>=129742&&e<=129755||e>=129760&&e<=129768||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141;var un=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y,St=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,wt=/\t{1,1000}/y,pn=new RegExp("[\\u{1F1E6}-\\u{1F1FF}]{2}|\\u{1F3F4}[\\u{E0061}-\\u{E007A}]{2}[\\u{E0030}-\\u{E0039}\\u{E0061}-\\u{E007A}]{1,3}\\u{E007F}|(?:\\p{Emoji}\\uFE0F\\u20E3?|\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation})(?:\\u200D(?:\\p{Emoji_Modifier_Base}\\p{Emoji_Modifier}?|\\p{Emoji_Presentation}|\\p{Emoji}\\uFE0F\\u20E3?))*","yu"),xt=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,Xp=new RegExp("\\p{M}+","gu"),Zp={limit:1/0,ellipsis:""},$i=(e,t={},r={})=>{let n=t.limit??1/0,o=t.ellipsis??"",i=t?.ellipsisWidth??(o?$i(o,Zp,r).width:0),s=r.ansiWidth??0,a=r.controlWidth??0,c=r.tabWidth??8,u=r.ambiguousWidth??1,l=r.emojiWidth??2,p=r.fullWidthWidth??2,d=r.regularWidth??1,f=r.wideWidth??2,m=0,h=0,$=e.length,b=0,x=!1,S=$,C=Math.max(0,n-i),O=0,F=0,w=0,_=0;e:for(;;){if(F>O||h>=$&&h>m){let B=e.slice(O,F)||e.slice(m,h);b=0;for(let ie of B.replaceAll(Xp,"")){let q=ie.codePointAt(0)||0;if(xi(q)?_=p:Ei(q)?_=f:u!==d&&wi(q)?_=u:_=d,w+_>C&&(S=Math.min(S,Math.max(O,m)+b)),w+_>n){x=!0;break e}b+=ie.length,w+=_}O=F=0}if(h>=$)break;if(xt.lastIndex=h,xt.test(e)){if(b=xt.lastIndex-h,_=b*d,w+_>C&&(S=Math.min(S,h+Math.floor((C-w)/d))),w+_>n){x=!0;break}w+=_,O=m,F=h,h=m=xt.lastIndex;continue}if(un.lastIndex=h,un.test(e)){if(w+s>C&&(S=Math.min(S,h)),w+s>n){x=!0;break}w+=s,O=m,F=h,h=m=un.lastIndex;continue}if(St.lastIndex=h,St.test(e)){if(b=St.lastIndex-h,_=b*a,w+_>C&&(S=Math.min(S,h+Math.floor((C-w)/a))),w+_>n){x=!0;break}w+=_,O=m,F=h,h=m=St.lastIndex;continue}if(wt.lastIndex=h,wt.test(e)){if(b=wt.lastIndex-h,_=b*c,w+_>C&&(S=Math.min(S,h+Math.floor((C-w)/c))),w+_>n){x=!0;break}w+=_,O=m,F=h,h=m=wt.lastIndex;continue}if(pn.lastIndex=h,pn.test(e)){if(w+l>C&&(S=Math.min(S,h)),w+l>n){x=!0;break}w+=l,O=m,F=h,h=m=pn.lastIndex;continue}h+=1}return{width:x?C:w,index:x?S:$,truncated:x,ellipsed:x&&n>=i}},_i=$i;var Qp={limit:1/0,ellipsis:"",ellipsisWidth:0},ed=(e,t={})=>_i(e,Qp,t).width,k=ed;var Et="\x1B",Ti="\x9B",td=39,mn="\x07",Ii="[",rd="]",Di="m",fn=`${rd}8;;`,Ci=new RegExp(`(?:\\${Ii}(?<code>\\d+)m|\\${fn}(?<uri>.*)${mn})`,"y"),Ai=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Oi=e=>`${Et}${Ii}${e}${Di}`,vi=e=>`${Et}${fn}${e}${mn}`,dn=(e,t,r)=>{let n=t[Symbol.iterator](),o=!1,i=!1,s=e.at(-1),a=s===void 0?0:k(s),c=n.next(),u=n.next(),l=0;for(;!c.done;){let p=c.value,d=k(p);a+d<=r?e[e.length-1]+=p:(e.push(p),a=0),(p===Et||p===Ti)&&(o=!0,i=t.startsWith(fn,l+1)),o?i?p===mn&&(o=!1,i=!1):p===Di&&(o=!1):(a+=d,a===r&&!u.done&&(e.push(""),a=0)),c=u,u=n.next(),l+=p.length}s=e.at(-1),!a&&s!==void 0&&s.length&&e.length>1&&(e[e.length-2]+=e.pop())},nd=e=>{let t=e.split(" "),r=t.length;for(;r&&!k(t[r-1]);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},od=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",o,i,s=e.split(" "),a=[""],c=0;for(let p=0;p<s.length;p++){let d=s[p];if(r.trim!==!1){let m=a.at(-1)??"",h=m.trimStart();m.length!==h.length&&(a[a.length-1]=h,c=k(h))}p!==0&&(c>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),c=0),(c||r.trim===!1)&&(a[a.length-1]+=" ",c++));let f=k(d);if(r.hard&&f>t){let m=t-c,h=1+Math.floor((f-m-1)/t);Math.floor((f-1)/t)<h&&a.push(""),dn(a,d,t),c=k(a.at(-1)??"");continue}if(c+f>t&&c&&f){if(r.wordWrap===!1&&c<t){dn(a,d,t),c=k(a.at(-1)??"");continue}a.push(""),c=0}if(c+f>t&&r.wordWrap===!1){dn(a,d,t),c=k(a.at(-1)??"");continue}a[a.length-1]+=d,c+=f}r.trim!==!1&&(a=a.map(p=>nd(p)));let u=a.join(`
|
|
30
|
+
`),l=!1;for(let p=0;p<u.length;p++){let d=u[p];if(n+=d,!l)l=d>="\uD800"&&d<="\uDBFF";else continue;if(d===Et||d===Ti){Ci.lastIndex=p+1;let m=Ci.exec(u)?.groups;if(m?.code!==void 0){let h=Number.parseFloat(m.code);o=h===td?void 0:h}else m?.uri!==void 0&&(i=m.uri.length===0?void 0:m.uri)}if(u[p+1]===`
|
|
31
|
+
`){i&&(n+=vi(""));let f=o?Ai(o):void 0;o&&f&&(n+=Oi(f))}else d===`
|
|
32
|
+
`&&(o&&Ai(o)&&(n+=Oi(o)),i&&(n+=vi(i)))}return n},id=/\r?\n/;function le(e,t,r){return String(e).normalize().split(id).map(n=>od(n,t,r)).join(`
|
|
33
|
+
`)}var M=Ie(gn(),1);import{ReadStream as Ri}from"tty";var ud=["up","down","left","right","space","enter","cancel"],pd=["January","February","March","April","May","June","July","August","September","October","November","December"],P={actions:new Set(ud),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]]),messages:{cancel:"Canceled",error:"Something went wrong"},withGuide:!0,date:{monthNames:[...pd],messages:{required:"Please enter a valid date",invalidMonth:"There are only 12 months in a year",invalidDay:(e,t)=>`There are only ${e} days in ${t}`,afterMin:e=>`Date must be on or after ${e.toISOString().slice(0,10)}`,beforeMax:e=>`Date must be on or before ${e.toISOString().slice(0,10)}`}}};function Sn(e,t){if(typeof e=="string")return P.aliases.get(e)===t;for(let r of e)if(r!==void 0&&Sn(r,t))return!0;return!1}function dd(e,t){if(e===t)return;let r=e.split(`
|
|
34
|
+
`),n=t.split(`
|
|
35
|
+
`),o=Math.max(r.length,n.length),i=[];for(let s=0;s<o;s++)r[s]!==n[s]&&i.push(s);return{lines:i,numLinesBefore:r.length,numLinesAfter:n.length,numLines:o}}var md=globalThis.process.platform.startsWith("win"),yn=Symbol("clack:cancel");function xe(e){return e===yn}function $t(e,t){let r=e;r.isTTY&&r.setRawMode(t)}function Pi({input:e=Mi,output:t=bn,overwrite:r=!0,hideCursor:n=!0}={}){let o=he.createInterface({input:e,output:t,prompt:"",tabSize:1});he.emitKeypressEvents(e,o),e instanceof Ri&&e.isTTY&&e.setRawMode(!0);let i=(s,{name:a,sequence:c})=>{let u=String(s);if(Sn([u,a,c],"cancel")){n&&t.write(M.cursor.show),process.exit(0);return}if(!r)return;he.moveCursor(t,a==="return"?0:-1,a==="return"?-1:0,()=>{he.clearLine(t,1,()=>{e.once("keypress",i)})})};return n&&t.write(M.cursor.hide),e.once("keypress",i),()=>{e.off("keypress",i),n&&t.write(M.cursor.show),e instanceof Ri&&e.isTTY&&!md&&e.setRawMode(!1),o.terminal=!1,o.close()}}var At=e=>"columns"in e&&typeof e.columns=="number"?e.columns:80,ki=e=>"rows"in e&&typeof e.rows=="number"?e.rows:20;function Bi(e,t,r,n=r){let o=At(e??bn);return le(t,o-r.length,{hard:!0,trim:!1}).split(`
|
|
36
|
+
`).map((i,s)=>`${s===0?n:r}${i}`).join(`
|
|
37
|
+
`)}var Li=class{input;output;_abortSignal;rl;opts;_render;_track=!1;_prevFrame="";_subscribers=new Map;_cursor=0;state="initial";error="";value;userInput="";constructor(e,t=!0){let{input:r=Mi,output:n=bn,render:o,signal:i,...s}=e;this.opts=s,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=o.bind(this),this._track=t,this._abortSignal=i,this.input=r,this.output=n}unsubscribe(){this._subscribers.clear()}setSubscriber(e,t){let r=this._subscribers.get(e)??[];r.push(t),this._subscribers.set(e,r)}on(e,t){this.setSubscriber(e,{cb:t})}once(e,t){this.setSubscriber(e,{cb:t,once:!0})}emit(e,...t){let r=this._subscribers.get(e)??[],n=[];for(let o of r)o.cb(...t),o.once&&n.push(()=>r.splice(r.indexOf(o),1));for(let o of n)o()}prompt(){return new Promise(e=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e(yn);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}this.rl=ld.createInterface({input:this.input,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),this.rl.prompt(),this.opts.initialUserInput!==void 0&&this._setUserInput(this.opts.initialUserInput,!0),this.input.on("keypress",this.onKeypress),$t(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(M.cursor.show),this.output.off("resize",this.render),$t(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(M.cursor.show),this.output.off("resize",this.render),$t(this.input,!1),e(yn)})})}_isActionKey(e,t){return e===" "}_setValue(e){this.value=e,this.emit("value",this.value)}_setUserInput(e,t){this.userInput=e??"",this.emit("userInput",this.userInput),t&&this._track&&this.rl&&(this.rl.write(this.userInput),this._cursor=this.rl.cursor)}_clearUserInput(){this.rl?.write(null,{ctrl:!0,name:"u"}),this._setUserInput("")}onKeypress(e,t){if(this._track&&t.name!=="return"&&(t.name&&this._isActionKey(e,t)&&this.rl?.write(null,{ctrl:!0,name:"h"}),this._cursor=this.rl?.cursor??0,this._setUserInput(this.rl?.line)),this.state==="error"&&(this.state="active"),t?.name&&(!this._track&&P.aliases.has(t.name)&&this.emit("cursor",P.aliases.get(t.name)),P.actions.has(t.name)&&this.emit("cursor",t.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),this.emit("key",e?.toLowerCase(),t),t?.name==="return"){if(this.opts.validate){let r=this.opts.validate(this.value);r&&(this.error=r instanceof Error?r.message:r,this.state="error",this.rl?.write(this.userInput))}this.state!=="error"&&(this.state="submit")}Sn([e,t?.name,t?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
38
|
+
`),$t(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=le(this._prevFrame,process.stdout.columns,{hard:!0,trim:!1}).split(`
|
|
39
|
+
`).length-1;this.output.write(M.cursor.move(-999,e*-1))}render(){let e=le(this._render(this)??"",process.stdout.columns,{hard:!0,trim:!1});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(M.cursor.hide);else{let t=dd(this._prevFrame,e),r=ki(this.output);if(this.restoreCursor(),t){let n=Math.max(0,t.numLinesAfter-r),o=Math.max(0,t.numLinesBefore-r),i=t.lines.find(s=>s>=n);if(i===void 0){this._prevFrame=e;return}if(t.lines.length===1){this.output.write(M.cursor.move(0,i-o)),this.output.write(M.erase.lines(1));let s=e.split(`
|
|
40
|
+
`);this.output.write(s[i]),this._prevFrame=e,this.output.write(M.cursor.move(0,s.length-i-1));return}else if(t.lines.length>1){if(n<o)i=n;else{let a=i-o;a>0&&this.output.write(M.cursor.move(0,a))}this.output.write(M.erase.down());let s=e.split(`
|
|
41
|
+
`).slice(i);this.output.write(s.join(`
|
|
42
|
+
`)),this._prevFrame=e;return}}this.output.write(M.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var _t=class extends Li{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("userInput",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(M.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var Ct=class extends Li{get userInputWithCursor(){if(this.state==="submit")return this.userInput;let t=this.userInput;if(this.cursor>=t.length)return`${this.userInput}\u2588`;let r=t.slice(0,this.cursor),[n,...o]=t.slice(this.cursor);return`${r}${cd("inverse",n)}${o.join("")}`}get cursor(){return this._cursor}constructor(t){super({...t,initialUserInput:t.initialUserInput??t.initialValue}),this.on("userInput",r=>{this._setValue(r)}),this.on("finalize",()=>{this.value||(this.value=t.defaultValue),this.value===void 0&&(this.value="")})}};import{styleText as g,stripVTControlCharacters as iw}from"util";import W from"process";var Je=Ie(gn(),1);import{existsSync as uw,lstatSync as pw,readdirSync as dw}from"fs";import{dirname as fw,join as hw}from"path";function fd(){return W.platform!=="win32"?W.env.TERM!=="linux":!!W.env.CI||!!W.env.WT_SESSION||!!W.env.TERMINUS_SUBLIME||W.env.ConEmuTask==="{cmd::Cmder}"||W.env.TERM_PROGRAM==="Terminus-Sublime"||W.env.TERM_PROGRAM==="vscode"||W.env.TERM==="xterm-256color"||W.env.TERM==="alacritty"||W.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var wn=fd(),hd=()=>process.env.CI==="true";var A=(e,t)=>wn?e:t,gd=A("\u25C6","*"),Gi=A("\u25A0","x"),Vi=A("\u25B2","x"),Ot=A("\u25C7","o"),yd=A("\u250C","T"),D=A("\u2502","|"),Xe=A("\u2514","\u2014"),gw=A("\u2510","T"),yw=A("\u2518","\u2014"),Ni=A("\u25CF",">"),ji=A("\u25CB"," "),bw=A("\u25FB","[\u2022]"),Sw=A("\u25FC","[+]"),ww=A("\u25FB","[ ]"),xw=A("\u25AA","\u2022"),Ui=A("\u2500","-"),bd=A("\u256E","+"),Sd=A("\u251C","+"),wd=A("\u256F","+"),xd=A("\u2570","+"),Ew=A("\u256D","+"),Ed=A("\u25CF","\u2022"),$d=A("\u25C6","*"),_d=A("\u25B2","!"),Cd=A("\u25A0","x"),Wi=e=>{switch(e){case"initial":case"active":return g("cyan",gd);case"cancel":return g("red",Gi);case"error":return g("yellow",Vi);case"submit":return g("green",Ot)}};var vt=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new _t({active:t,inactive:r,signal:e.signal,input:e.input,output:e.output,initialValue:e.initialValue??!0,render(){let n=e.withGuide??P.withGuide,o=`${Wi(this.state)} `,i=n?`${g("gray",D)} `:"",s=Bi(e.output,e.message,i,o),a=`${n?`${g("gray",D)}
|
|
43
|
+
`:""}${s}
|
|
44
|
+
`,c=this.value?t:r;switch(this.state){case"submit":{let u=n?`${g("gray",D)} `:"";return`${a}${u}${g("dim",c)}`}case"cancel":{let u=n?`${g("gray",D)} `:"";return`${a}${u}${g(["strikethrough","dim"],c)}${n?`
|
|
45
|
+
${g("gray",D)}`:""}`}default:{let u=n?`${g("cyan",D)} `:"",l=n?g("cyan",Xe):"";return`${a}${u}${this.value?`${g("green",Ni)} ${t}`:`${g("dim",ji)} ${g("dim",t)}`}${e.vertical?n?`
|
|
46
|
+
${g("cyan",D)} `:`
|
|
47
|
+
`:` ${g("dim","/")} `}${this.value?`${g("dim",ji)} ${g("dim",r)}`:`${g("green",Ni)} ${r}`}
|
|
48
|
+
${l}
|
|
49
|
+
`}}}}).prompt()};var Q={message:(e=[],{symbol:t=g("gray",D),secondarySymbol:r=g("gray",D),output:n=process.stdout,spacing:o=1,withGuide:i}={})=>{let s=[],a=i??P.withGuide,c=a?r:"",u=a?`${t} `:"",l=a?`${r} `:"";for(let d=0;d<o;d++)s.push(c);let p=Array.isArray(e)?e:e.split(`
|
|
50
|
+
`);if(p.length>0){let[d,...f]=p;d.length>0?s.push(`${u}${d}`):s.push(a?t:"");for(let m of f)m.length>0?s.push(`${l}${m}`):s.push(a?r:"")}n.write(`${s.join(`
|
|
71
51
|
`)}
|
|
72
|
-
`)},info:t=>{
|
|
73
|
-
|
|
74
|
-
`)
|
|
75
|
-
`)
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
`
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
52
|
+
`)},info:(e,t)=>{Q.message(e,{...t,symbol:g("blue",Ed)})},success:(e,t)=>{Q.message(e,{...t,symbol:g("green",$d)})},step:(e,t)=>{Q.message(e,{...t,symbol:g("green",Ot)})},warn:(e,t)=>{Q.message(e,{...t,symbol:g("yellow",_d)})},warning:(e,t)=>{Q.warn(e,t)},error:(e,t)=>{Q.message(e,{...t,symbol:g("red",Cd)})}},Y=(e="",t)=>{let r=t?.output??process.stdout,n=t?.withGuide??P.withGuide?`${g("gray",Xe)} `:"";r.write(`${n}${g("red",e)}
|
|
53
|
+
|
|
54
|
+
`)},Hi=(e="",t)=>{let r=t?.output??process.stdout,n=t?.withGuide??P.withGuide?`${g("gray",yd)} `:"";r.write(`${n}${e}
|
|
55
|
+
`)},zi=(e="",t)=>{let r=t?.output??process.stdout,n=t?.withGuide??P.withGuide?`${g("gray",D)}
|
|
56
|
+
${g("gray",Xe)} `:"";r.write(`${n}${e}
|
|
57
|
+
|
|
58
|
+
`)};var Ad=e=>g("dim",e),Od=(e,t,r)=>{let n={hard:!0,trim:!1},o=le(e,t,n).split(`
|
|
59
|
+
`),i=o.reduce((c,u)=>Math.max(k(u),c),0),s=o.map(r).reduce((c,u)=>Math.max(k(u),c),0),a=t-(s-i);return le(e,a,n)},qi=(e="",t="",r)=>{let n=r?.output??W.stdout,o=r?.withGuide??P.withGuide,i=r?.format??Ad,s=["",...Od(e,At(n)-6,i).split(`
|
|
60
|
+
`).map(i),""],a=k(t),c=Math.max(s.reduce((d,f)=>{let m=k(f);return m>d?m:d},0),a)+2,u=s.map(d=>`${g("gray",D)} ${d}${" ".repeat(c-k(d))}${g("gray",D)}`).join(`
|
|
61
|
+
`),l=o?`${g("gray",D)}
|
|
62
|
+
`:"",p=o?Sd:xd;n.write(`${l}${g("green",Ot)} ${g("reset",t)} ${g("gray",Ui.repeat(Math.max(c-a-1,1))+bd)}
|
|
63
|
+
${u}
|
|
64
|
+
${g("gray",p+Ui.repeat(c+2)+wd)}
|
|
65
|
+
`)};var vd=e=>g("magenta",e),Yi=({indicator:e="dots",onCancel:t,output:r=process.stdout,cancelMessage:n,errorMessage:o,frames:i=wn?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:s=wn?80:120,signal:a,...c}={})=>{let u=hd(),l,p,d=!1,f=!1,m="",h,$=performance.now(),b=At(r),x=c?.styleFrame??vd,S=v=>{let G=v>1?o??P.messages.error:n??P.messages.cancel;f=v===1,d&&(Ye(G,v),f&&typeof t=="function"&&t())},C=()=>S(2),O=()=>S(1),F=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",O),process.on("SIGTERM",O),process.on("exit",S),a&&a.addEventListener("abort",O)},w=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",O),process.removeListener("SIGTERM",O),process.removeListener("exit",S),a&&a.removeEventListener("abort",O)},_=()=>{if(h===void 0)return;u&&r.write(`
|
|
66
|
+
`);let v=le(h,b,{hard:!0,trim:!1}).split(`
|
|
67
|
+
`);v.length>1&&r.write(Je.cursor.up(v.length-1)),r.write(Je.cursor.to(0)),r.write(Je.erase.down())},B=v=>v.replace(/\.+$/,""),ie=v=>{let G=(performance.now()-v)/1e3,se=Math.floor(G/60),ae=Math.floor(G%60);return se>0?`[${se}m ${ae}s]`:`[${ae}s]`},q=c.withGuide??P.withGuide,Op=(v="")=>{d=!0,l=Pi({output:r}),m=B(v),$=performance.now(),q&&r.write(`${g("gray",D)}
|
|
68
|
+
`);let G=0,se=0;F(),p=setInterval(()=>{if(u&&m===h)return;_(),h=m;let ae=x(i[G]),ht;if(u)ht=`${ae} ${m}...`;else if(e==="timer")ht=`${ae} ${m} ${ie($)}`;else{let Tp=".".repeat(Math.floor(se)).slice(0,3);ht=`${ae} ${m}${Tp}`}let vp=le(ht,b,{hard:!0,trim:!1});r.write(vp),G=G+1<i.length?G+1:0,se=se<4?se+.125:0},s)},Ye=(v="",G=0,se=!1)=>{if(!d)return;d=!1,clearInterval(p),_();let ae=G===0?g("green",Ot):G===1?g("red",Gi):g("red",Vi);m=v??m,se||(e==="timer"?r.write(`${ae} ${m} ${ie($)}
|
|
69
|
+
`):r.write(`${ae} ${m}
|
|
70
|
+
`)),w(),l()};return{start:Op,stop:(v="")=>Ye(v,0),message:(v="")=>{m=B(v??m)},cancel:(v="")=>Ye(v,1),error:(v="")=>Ye(v,2),clear:()=>Ye("",0,!0),get isCancelled(){return f}}},$w={light:A("\u2500","-"),heavy:A("\u2501","="),block:A("\u2588","#")};var _w=`${g("gray",D)} `;var Ki=e=>new Ct({validate:e.validate,placeholder:e.placeholder,defaultValue:e.defaultValue,initialValue:e.initialValue,output:e.output,signal:e.signal,input:e.input,render(){let t=e?.withGuide??P.withGuide,r=`${`${t?`${g("gray",D)}
|
|
71
|
+
`:""}${Wi(this.state)} `}${e.message}
|
|
72
|
+
`,n=e.placeholder?g("inverse",e.placeholder[0])+g("dim",e.placeholder.slice(1)):g(["inverse","hidden"],"_"),o=this.userInput?this.userInputWithCursor:n,i=this.value??"";switch(this.state){case"error":{let s=this.error?` ${g("yellow",this.error)}`:"",a=t?`${g("yellow",D)} `:"",c=t?g("yellow",Xe):"";return`${r.trim()}
|
|
73
|
+
${a}${o}
|
|
74
|
+
${c}${s}
|
|
75
|
+
`}case"submit":{let s=i?` ${g("dim",i)}`:"",a=t?g("gray",D):"";return`${r}${a}${s}`}case"cancel":{let s=i?` ${g(["strikethrough","dim"],i)}`:"",a=t?g("gray",D):"";return`${r}${a}${s}${i.trim()?`
|
|
76
|
+
${a}`:""}`}default:{let s=t?`${g("cyan",D)} `:"",a=t?g("cyan",Xe):"";return`${r}${s}${o}
|
|
77
|
+
${a}
|
|
78
|
+
`}}}}).prompt();var oi=Ie($n(),1);import Fd from"net";import Rd from"os";var Rt=class extends Error{constructor(t){super(`${t} is locked`)}},De={old:new Set,young:new Set},Md=1e3*15,es=new Set,Dt=1024,Ft=65535,Ze,Pd=()=>{let e=Rd.networkInterfaces(),t=new Set([void 0,"0.0.0.0"]);for(let r of Object.values(e))for(let n of r)t.add(n.address);return t},Zi=e=>new Promise((t,r)=>{let n=Fd.createServer();n.unref(),n.on("error",r),n.listen(e,()=>{let{port:o}=n.address();n.close(()=>{t(o)})})}),Qi=async(e,t)=>{if(e.host||e.port===0)return Zi(e);for(let r of t)try{await Zi({port:e.port,host:r})}catch(n){if(!["EADDRNOTAVAIL","EINVAL"].includes(n.code))throw n}return e.port},kd=e=>De.old.has(e)||De.young.has(e)||es.has(e),Bd=function*(e){e&&(yield*e),yield 0};async function _n(e){let t,r=new Set;if(e&&(e.port&&(t=typeof e.port=="number"?[e.port]:e.port),e.exclude)){let s=e.exclude;if(typeof s[Symbol.iterator]!="function")throw new TypeError("The `exclude` option must be an iterable.");for(let a of s){if(typeof a!="number")throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");if(!Number.isSafeInteger(a))throw new TypeError(`Number ${a} in the exclude option is not a safe integer and can't be used`)}r=new Set(s)}let{reserve:n,...o}=e??{};Ze===void 0&&(Ze=setTimeout(()=>{Ze=void 0,De.old=De.young,De.young=new Set},Md),Ze.unref&&Ze.unref());let i=Pd();for(let s of Bd(t))try{if(r.has(s))continue;let a=await Qi({...o,port:s},i);for(;kd(a);){if(s!==0)throw new Rt(s);a=await Qi({...o,port:s},i)}return n?es.add(a):De.young.add(a),a}catch(a){if(!["EADDRINUSE","EACCES"].includes(a.code)&&!(a instanceof Rt))throw a}throw new Error("No available ports found")}function ts(e,t){if(!Number.isInteger(e)||!Number.isInteger(t))throw new TypeError("`from` and `to` must be integer numbers");if(e<Dt||e>Ft)throw new RangeError(`'from' must be between ${Dt} and ${Ft}`);if(t<Dt||t>Ft)throw new RangeError(`'to' must be between ${Dt} and ${Ft}`);if(e>t)throw new RangeError("`to` must be greater than or equal to `from`");return function*(n,o){for(let i=n;i<=o;i++)yield i}(e,t)}async function rs(e){let t=e.directory??await Ki({message:"Where would you like to create your project?",placeholder:"./my-store",defaultValue:"./my-store",validate(i){if(!i)return"Please enter a directory"}});xe(t)&&(Y("Setup cancelled."),process.exit(0));let r;if(e.noStorefront!==void 0)r=!e.noStorefront;else{let i=await vt({message:"Include Next.js storefront?",initialValue:!0});xe(i)&&(Y("Setup cancelled."),process.exit(0)),r=i}let n;if(e.noSampleData!==void 0)n=!e.noSampleData;else{let i=await vt({message:"Include sample data? (products, categories, images)",initialValue:!0});xe(i)&&(Y("Setup cancelled."),process.exit(0)),n=i}let o;if(e.noStart!==void 0)o=!e.noStart;else{let i=await vt({message:"Start services now? (requires Docker)",initialValue:!0});xe(i)&&(Y("Setup cancelled."),process.exit(0)),o=i}return{directory:t,storefront:r,sampleData:n,start:o,packageManager:e.packageManager??"npm"}}var fe=Ie($n(),1);import j from"fs";import U from"path";function I(e){if(typeof e!="object"||e===null)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}import{fileURLToPath as Ld}from"url";var Fe=(e,t)=>{let r=An(Nd(e));if(typeof r!="string")throw new TypeError(`${t} must be a string or a file URL: ${r}.`);return r},Nd=e=>Cn(e)?e.toString():e,Cn=e=>typeof e!="string"&&e&&Object.getPrototypeOf(e)===String.prototype,An=e=>e instanceof URL?Ld(e):e;var Mt=(e,t=[],r={})=>{let n=Fe(e,"First argument"),[o,i]=I(t)?[[],t]:[t,r];if(!Array.isArray(o))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${o}`);if(o.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let s=o.map(String),a=s.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!I(i))throw new TypeError(`Last argument must be an options object: ${i}`);return[n,s,i]};import{ChildProcess as zd}from"child_process";import{StringDecoder as jd}from"string_decoder";var{toString:ns}=Object.prototype,os=e=>ns.call(e)==="[object ArrayBuffer]",R=e=>ns.call(e)==="[object Uint8Array]",ue=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Ud=new TextEncoder,is=e=>Ud.encode(e),Gd=new TextDecoder,Pt=e=>Gd.decode(e),ss=(e,t)=>Vd(e,t).join(""),Vd=(e,t)=>{if(t==="utf8"&&e.every(i=>typeof i=="string"))return e;let r=new jd(t),n=e.map(i=>typeof i=="string"?is(i):i).map(i=>r.write(i)),o=r.end();return o===""?n:[...n,o]},Qe=e=>e.length===1&&R(e[0])?e[0]:On(Wd(e)),Wd=e=>e.map(t=>typeof t=="string"?is(t):t),On=e=>{let t=new Uint8Array(Hd(e)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t},Hd=e=>{let t=0;for(let r of e)t+=r.length;return t};var us=e=>Array.isArray(e)&&Array.isArray(e.raw),ps=(e,t)=>{let r=[];for(let[i,s]of e.entries())r=qd({templates:e,expressions:t,tokens:r,index:i,template:s});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},qd=({templates:e,expressions:t,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${e.raw[n]}`);let{nextTokens:i,leadingWhitespaces:s,trailingWhitespaces:a}=Yd(o,e.raw[n]),c=cs(r,i,s);if(n===t.length)return c;let u=t[n],l=Array.isArray(u)?u.map(p=>ls(p)):[ls(u)];return cs(c,l,a)},Yd=(e,t)=>{if(t.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=as.has(t[0]);for(let s=0,a=0;s<e.length;s+=1,a+=1){let c=t[a];if(as.has(c))n!==s&&r.push(e.slice(n,s)),n=s+1;else if(c==="\\"){let u=t[a+1];u===`
|
|
79
|
+
`?(s-=1,a+=1):u==="u"&&t[a+2]==="{"?a=t.indexOf("}",a+3):a+=Kd[u]??1}}let i=n===e.length;return i||r.push(e.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:i}},as=new Set([" "," ","\r",`
|
|
80
|
+
`]),Kd={x:3,u:5},cs=(e,t,r)=>r||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e.at(-1)}${t[0]}`,...t.slice(1)],ls=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(I(e)&&("stdout"in e||"isMaxBuffer"in e))return Jd(e);throw e instanceof zd||Object.prototype.toString.call(e)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${t}" in template expression`)},Jd=({stdout:e})=>{if(typeof e=="string")return e;if(R(e))return Pt(e);throw e===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof e}" stdout in template expression`)};import{spawnSync as tb}from"child_process";import{debuglog as Xd}from"util";import vn from"process";var K=e=>kt.includes(e),kt=[vn.stdin,vn.stdout,vn.stderr],H=["stdin","stdout","stderr"],Bt=e=>H[e]??`stdio[${e}]`;var ms=e=>{let t={...e};for(let r of Dn)t[r]=Tn(e,r);return t},Tn=(e,t)=>{let r=Array.from({length:Zd(e)+1}),n=Qd(e[t],r,t);return om(n,t)},Zd=({stdio:e})=>Array.isArray(e)?Math.max(e.length,H.length):H.length,Qd=(e,t,r)=>I(e)?em(e,t,r):t.fill(e),em=(e,t,r)=>{for(let n of Object.keys(e).sort(tm))for(let o of rm(n,r,t))t[o]=e[n];return t},tm=(e,t)=>ds(e)<ds(t)?1:-1,ds=e=>e==="stdout"||e==="stderr"?0:e==="all"?2:1,rm=(e,t,r)=>{if(e==="ipc")return[r.length-1];let n=In(e);if(n===void 0||n===0)throw new TypeError(`"${t}.${e}" is invalid.
|
|
81
|
+
It must be "${t}.stdout", "${t}.stderr", "${t}.all", "${t}.ipc", or "${t}.fd3", "${t}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${t}.${e}" is invalid: that file descriptor does not exist.
|
|
82
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},In=e=>{if(e==="all")return e;if(H.includes(e))return H.indexOf(e);let t=nm.exec(e);if(t!==null)return Number(t[1])},nm=/^fd(\d+)$/,om=(e,t)=>e.map(r=>r===void 0?sm[t]:r),im=Xd("execa").enabled?"full":"none",sm={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:im,stripFinalNewline:!0},Dn=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],pe=(e,t)=>t==="ipc"?e.at(-1):e[t];var Re=({verbose:e},t)=>Fn(e,t)!=="none",Me=({verbose:e},t)=>!["none","short"].includes(Fn(e,t)),fs=({verbose:e},t)=>{let r=Fn(e,t);return Lt(r)?r:void 0},Fn=(e,t)=>t===void 0?am(e):pe(e,t),am=e=>e.find(t=>Lt(t))??Nt.findLast(t=>e.includes(t)),Lt=e=>typeof e=="function",Nt=["none","short","full"];import{inspect as Tm}from"util";import{platform as cm}from"process";import{stripVTControlCharacters as lm}from"util";var hs=(e,t)=>{let r=[e,...t],n=r.join(" "),o=r.map(i=>hm(gs(i))).join(" ");return{command:n,escapedCommand:o}},et=e=>lm(e).split(`
|
|
83
|
+
`).map(t=>gs(t)).join(`
|
|
84
|
+
`),gs=e=>e.replaceAll(dm,t=>um(t)),um=e=>{let t=mm[e];if(t!==void 0)return t;let r=e.codePointAt(0),n=r.toString(16);return r<=fm?`\\u${n.padStart(4,"0")}`:`\\U${n}`},pm=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},dm=pm(),mm={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},fm=65535,hm=e=>gm.test(e)?e:cm==="win32"?`"${e.replaceAll('"','""')}"`:`'${e.replaceAll("'","'\\''")}'`,gm=/^[\w./-]+$/;import ys from"process";function Rn(){let{env:e}=ys,{TERM:t,TERM_PROGRAM:r}=e;return ys.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var bs={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},Ss={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},ym={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},bm={...bs,...Ss},Sm={...bs,...ym},wm=Rn(),xm=wm?bm:Sm,jt=xm,nx=Object.entries(Ss);import Em from"tty";var $m=Em?.WriteStream?.prototype?.hasColors?.()??!1,y=(e,t)=>{if(!$m)return o=>o;let r=`\x1B[${e}m`,n=`\x1B[${t}m`;return o=>{let i=o+"",s=i.indexOf(n);if(s===-1)return r+i+n;let a=r,c=0,l=(t===22?n:"")+r;for(;s!==-1;)a+=i.slice(c,s)+l,c=s+n.length,s=i.indexOf(n,c);return a+=i.slice(c)+n,a}},sx=y(0,0),ws=y(1,22),ax=y(2,22),cx=y(3,23),lx=y(4,24),ux=y(53,55),px=y(7,27),dx=y(8,28),mx=y(9,29),fx=y(30,39),hx=y(31,39),gx=y(32,39),yx=y(33,39),bx=y(34,39),Sx=y(35,39),wx=y(36,39),xx=y(37,39),Ut=y(90,39),Ex=y(40,49),$x=y(41,49),_x=y(42,49),Cx=y(43,49),Ax=y(44,49),Ox=y(45,49),vx=y(46,49),Tx=y(47,49),Ix=y(100,49),xs=y(91,39),Dx=y(92,39),Es=y(93,39),Fx=y(94,39),Rx=y(95,39),Mx=y(96,39),Px=y(97,39),kx=y(101,49),Bx=y(102,49),Lx=y(103,49),Nx=y(104,49),jx=y(105,49),Ux=y(106,49),Gx=y(107,49);var Cs=({type:e,message:t,timestamp:r,piped:n,commandId:o,result:{failed:i=!1}={},options:{reject:s=!0}})=>{let a=_m(r),c=Cm[e]({failed:i,reject:s,piped:n}),u=Am[e]({reject:s});return`${Ut(`[${a}]`)} ${Ut(`[${o}]`)} ${u(c)} ${u(t)}`},_m=e=>`${Gt(e.getHours(),2)}:${Gt(e.getMinutes(),2)}:${Gt(e.getSeconds(),2)}.${Gt(e.getMilliseconds(),3)}`,Gt=(e,t)=>String(e).padStart(t,"0"),$s=({failed:e,reject:t})=>e?t?jt.cross:jt.warning:jt.tick,Cm={command:({piped:e})=>e?"|":"$",output:()=>" ",ipc:()=>"*",error:$s,duration:$s},_s=e=>e,Am={command:()=>ws,output:()=>_s,ipc:()=>_s,error:({reject:e})=>e?xs:Es,duration:()=>Ut};var As=(e,t,r)=>{let n=fs(t,r);return e.map(({verboseLine:o,verboseObject:i})=>Om(o,i,n)).filter(o=>o!==void 0).map(o=>vm(o)).join("")},Om=(e,t,r)=>{if(r===void 0)return e;let n=r(e,t);if(typeof n=="string")return n},vm=e=>e.endsWith(`
|
|
85
|
+
`)?e:`${e}
|
|
86
|
+
`;var ee=({type:e,verboseMessage:t,fdNumber:r,verboseInfo:n,result:o})=>{let i=Im({type:e,result:o,verboseInfo:n}),s=Dm(t,i),a=As(s,n,r);a!==""&&console.warn(a.slice(0,-1))},Im=({type:e,result:t,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:o=!1,...i}}})=>({type:e,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:o,result:t,options:i}),Dm=(e,t)=>e.split(`
|
|
87
|
+
`).map(r=>Fm({...t,message:r})),Fm=e=>({verboseLine:Cs(e),verboseObject:e}),Vt=e=>{let t=typeof e=="string"?e:Tm(e);return et(t).replaceAll(" "," ".repeat(Rm))},Rm=2;var Os=(e,t)=>{Re(t)&&ee({type:"command",verboseMessage:e,verboseInfo:t})};var vs=(e,t,r)=>{km(e);let n=Mm(e);return{verbose:e,escapedCommand:t,commandId:n,rawOptions:r}},Mm=e=>Re({verbose:e})?Pm++:void 0,Pm=0n,km=e=>{for(let t of e){if(t===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(t===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!Nt.includes(t)&&!Lt(t)){let r=Nt.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${t}. Allowed values are: ${r} or a function.`)}}};import{hrtime as Ts}from"process";var Wt=()=>Ts.bigint(),Mn=e=>Number(Ts.bigint()-e)/1e6;var Ht=(e,t,r)=>{let n=Wt(),{command:o,escapedCommand:i}=hs(e,t),s=Tn(r,"verbose"),a=vs(s,i,{...r});return Os(i,a),{command:o,escapedCommand:i,startTime:n,verboseInfo:a}};var vc=Ie(ya(),1);import wh from"path";import Oc from"process";import Kt from"process";import Ee from"path";function qt(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as uf}from"util";import{execFile as pf,execFileSync as IE}from"child_process";import ba from"path";import{fileURLToPath as df}from"url";var RE=uf(pf);function Yt(e){return e instanceof URL?df(e):e}function Sa(e){return{*[Symbol.iterator](){let t=ba.resolve(Yt(e)),r;for(;r!==t;)yield t,r=t,t=ba.resolve(t,"..")}}}var ME=10*1024*1024;var mf=({cwd:e=Kt.cwd(),path:t=Kt.env[qt()],preferLocal:r=!0,execPath:n=Kt.execPath,addExecPath:o=!0}={})=>{let i=Ee.resolve(Yt(e)),s=[],a=t.split(Ee.delimiter);return r&&ff(s,a,i),o&&hf(s,a,n,i),t===""||t===Ee.delimiter?`${s.join(Ee.delimiter)}${t}`:[...s,t].join(Ee.delimiter)},ff=(e,t,r)=>{for(let n of Sa(r)){let o=Ee.join(n,"node_modules/.bin");t.includes(o)||e.push(o)}},hf=(e,t,r,n)=>{let o=Ee.resolve(n,Yt(r),"..");t.includes(o)||e.push(o)},wa=({env:e=Kt.env,...t}={})=>{e={...e};let r=qt({env:e});return t.path=e[r],e[r]=mf(t),e};import{setTimeout as If}from"timers/promises";var xa=(e,t,r)=>{let n=r?rt:tt,o=e instanceof J?{}:{cause:e};return new n(t,o)},J=class extends Error{},Ea=(e,t)=>{Object.defineProperty(e.prototype,"name",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,_a,{value:!0,writable:!1,enumerable:!1,configurable:!1})},$a=e=>Jt(e)&&_a in e,_a=Symbol("isExecaError"),Jt=e=>Object.prototype.toString.call(e)==="[object Error]",tt=class extends Error{};Ea(tt,tt.name);var rt=class extends Error{};Ea(rt,rt.name);import{constants as nt}from"os";import{constants as Sf}from"os";var Ca=()=>{let e=Oa-Aa+1;return Array.from({length:e},gf)},gf=(e,t)=>({name:`SIGRT${t+1}`,number:Aa+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Aa=34,Oa=64;import{constants as yf}from"os";var va=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var Wn=()=>{let e=Ca();return[...va,...e].map(bf)},bf=({name:e,number:t,description:r,action:n,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=yf,a=s!==void 0;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}};var wf=()=>{let e=Wn();return Object.fromEntries(e.map(xf))},xf=({name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:r,supported:n,action:o,forced:i,standard:s}],Ta=wf(),Ef=()=>{let e=Wn(),t=65,r=Array.from({length:t},(n,o)=>$f(o,e));return Object.assign({},...r)},$f=(e,t)=>{let r=_f(e,t);if(r===void 0)return{};let{name:n,description:o,supported:i,action:s,forced:a,standard:c}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:c}}},_f=(e,t)=>{let r=t.find(({name:n})=>Sf.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},XE=Ef();var Da=e=>{let t="option `killSignal`";if(e===0)throw new TypeError(`Invalid ${t}: 0 cannot be used.`);return Ra(e,t)},Fa=e=>e===0?e:Ra(e,"`subprocess.kill()`'s argument"),Ra=(e,t)=>{if(Number.isInteger(e))return Cf(e,t);if(typeof e=="string")return Of(e,t);throw new TypeError(`Invalid ${t} ${String(e)}: it must be a string or an integer.
|
|
88
|
+
${Hn()}`)},Cf=(e,t)=>{if(Ia.has(e))return Ia.get(e);throw new TypeError(`Invalid ${t} ${e}: this signal integer does not exist.
|
|
89
|
+
${Hn()}`)},Af=()=>new Map(Object.entries(nt.signals).reverse().map(([e,t])=>[t,e])),Ia=Af(),Of=(e,t)=>{if(e in nt.signals)return e;throw e.toUpperCase()in nt.signals?new TypeError(`Invalid ${t} '${e}': please rename it to '${e.toUpperCase()}'.`):new TypeError(`Invalid ${t} '${e}': this signal name does not exist.
|
|
90
|
+
${Hn()}`)},Hn=()=>`Available signal names: ${vf()}.
|
|
91
|
+
Available signal numbers: ${Tf()}.`,vf=()=>Object.keys(nt.signals).sort().map(e=>`'${e}'`).join(", "),Tf=()=>[...new Set(Object.values(nt.signals).sort((e,t)=>e-t))].join(", "),Xt=e=>Ta[e].description;var Ma=e=>{if(e===!1)return e;if(e===!0)return Df;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Df=1e3*5,Pa=({kill:e,options:{forceKillAfterDelay:t,killSignal:r},onInternalError:n,context:o,controller:i},s,a)=>{let{signal:c,error:u}=Ff(s,a,r);Rf(u,n);let l=e(c);return Mf({kill:e,signal:c,forceKillAfterDelay:t,killSignal:r,killResult:l,context:o,controller:i}),l},Ff=(e,t,r)=>{let[n=r,o]=Jt(e)?[void 0,e]:[e,t];if(typeof n!="string"&&!Number.isInteger(n))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(n)}`);if(o!==void 0&&!Jt(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:Fa(n),error:o}},Rf=(e,t)=>{e!==void 0&&t.reject(e)},Mf=async({kill:e,signal:t,forceKillAfterDelay:r,killSignal:n,killResult:o,context:i,controller:s})=>{t===n&&o&&zn({kill:e,forceKillAfterDelay:r,context:i,controllerSignal:s.signal})},zn=async({kill:e,forceKillAfterDelay:t,context:r,controllerSignal:n})=>{if(t!==!1)try{await If(t,void 0,{signal:n}),e("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as Pf}from"events";var Zt=async(e,t)=>{e.aborted||await Pf(e,"abort",{signal:t})};var ka=({cancelSignal:e})=>{if(e!==void 0&&Object.prototype.toString.call(e)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(e)}`)},Ba=({subprocess:e,cancelSignal:t,gracefulCancel:r,context:n,controller:o})=>t===void 0||r?[]:[kf(e,t,n,o)],kf=async(e,t,r,{signal:n})=>{throw await Zt(t,n),r.terminationReason??="cancel",e.kill(),t.reason};import{scheduler as nh}from"timers/promises";import{promisify as eh}from"util";var Be=({methodName:e,isSubprocess:t,ipc:r,isConnected:n})=>{Bf(e,t,r),qn(e,t,n)},Bf=(e,t,r)=>{if(!r)throw new Error(`${X(e,t)} can only be used if the \`ipc\` option is \`true\`.`)},qn=(e,t,r)=>{if(!r)throw new Error(`${X(e,t)} cannot be used: the ${ge(t)} has already exited or disconnected.`)},La=e=>{throw new Error(`${X("getOneMessage",e)} could not complete: the ${ge(e)} exited or disconnected.`)},Na=e=>{throw new Error(`${X("sendMessage",e)} failed: the ${ge(e)} is sending a message too, instead of listening to incoming messages.
|
|
91
92
|
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
92
93
|
|
|
93
94
|
const [receivedMessage] = await Promise.all([
|
|
94
|
-
${
|
|
95
|
-
${
|
|
96
|
-
]);`)},
|
|
95
|
+
${X("getOneMessage",e)},
|
|
96
|
+
${X("sendMessage",e,"message, {strict: true}")},
|
|
97
|
+
]);`)},Qt=(e,t)=>new Error(`${X("sendMessage",t)} failed when sending an acknowledgment response to the ${ge(t)}.`,{cause:e}),ja=e=>{throw new Error(`${X("sendMessage",e)} failed: the ${ge(e)} is not listening to incoming messages.`)},Ua=e=>{throw new Error(`${X("sendMessage",e)} failed: the ${ge(e)} exited without listening to incoming messages.`)},Ga=()=>new Error(`\`cancelSignal\` aborted: the ${ge(!0)} disconnected.`),Va=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},Wa=({error:e,methodName:t,isSubprocess:r})=>{if(e.code==="EPIPE")throw new Error(`${X(t,r)} cannot be used: the ${ge(r)} is disconnecting.`,{cause:e})},Ha=({error:e,methodName:t,isSubprocess:r,message:n})=>{if(Lf(e))throw new Error(`${X(t,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:e})},Lf=({code:e,message:t})=>Nf.has(e)||jf.some(r=>t.includes(r)),Nf=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),jf=["could not be cloned","circular structure","call stack size exceeded"],X=(e,t,r="")=>e==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${Uf(t)}${e}(${r})`,Uf=e=>e?"":"subprocess.",ge=e=>e?"parent process":"subprocess",Le=e=>{e.connected&&e.disconnect()};var te=()=>{let e={},t=new Promise((r,n)=>{Object.assign(e,{resolve:r,reject:n})});return Object.assign(t,e)};var tr=(e,t="stdin")=>{let{options:n,fileDescriptors:o}=re.get(e),i=za(o,t,!0),s=e.stdio[i];if(s===null)throw new TypeError(qa(i,t,n,!0));return s},Ne=(e,t="stdout")=>{let{options:n,fileDescriptors:o}=re.get(e),i=za(o,t,!1),s=i==="all"?e.all:e.stdio[i];if(s==null)throw new TypeError(qa(i,t,n,!1));return s},re=new WeakMap,za=(e,t,r)=>{let n=Gf(t,r);return Vf(n,t,r,e),n},Gf=(e,t)=>{let r=In(e);if(r!==void 0)return r;let{validOptions:n,defaultValue:o}=t?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${ot(t)}" must not be "${e}".
|
|
97
98
|
It must be ${n} or "fd3", "fd4" (and so on).
|
|
98
|
-
It is optional and defaults to "${o}".`)},
|
|
99
|
-
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${
|
|
100
|
-
Please set this option with "pipe" instead.`},
|
|
101
|
-
Please rename it to ${
|
|
102
|
-
Please rename it to one of: ${r}.`)},
|
|
103
|
-
${
|
|
99
|
+
It is optional and defaults to "${o}".`)},Vf=(e,t,r,n)=>{let o=n[Ya(e)];if(o===void 0)throw new TypeError(`"${ot(r)}" must not be ${t}. That file descriptor does not exist.
|
|
100
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${ot(r)}" must not be ${t}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&r)throw new TypeError(`"${ot(r)}" must not be ${t}. It must be a writable stream, not readable.`)},qa=(e,t,r,n)=>{if(e==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:i}=Wf(e,r);return`The "${o}: ${er(i)}" option is incompatible with using "${ot(n)}: ${er(t)}".
|
|
101
|
+
Please set this option with "pipe" instead.`},Wf=(e,{stdin:t,stdout:r,stderr:n,stdio:o})=>{let i=Ya(e);return i===0&&t!==void 0?{optionName:"stdin",optionValue:t}:i===1&&r!==void 0?{optionName:"stdout",optionValue:r}:i===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${i}]`,optionValue:o[i]}},Ya=e=>e==="all"?1:e,ot=e=>e?"to":"from",er=e=>typeof e=="string"?`'${e}'`:typeof e=="number"?`${e}`:"Stream";import{once as Jf}from"events";import{addAbortListener as Hf}from"events";var $e=(e,t,r)=>{let n=e.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(e.setMaxListeners(n+t),Hf(r,()=>{e.setMaxListeners(e.getMaxListeners()-t)}))};import{EventEmitter as Yf}from"events";import{once as zf}from"events";import{scheduler as qf}from"timers/promises";var rr=(e,t)=>{t&&Yn(e)},Yn=e=>{e.refCounted()},nr=(e,t)=>{t&&Kn(e)},Kn=e=>{e.unrefCounted()},Ka=(e,t)=>{t&&(Kn(e),Kn(e))},Ja=(e,t)=>{t&&(Yn(e),Yn(e))};var Xa=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n},o)=>{if(ec(o)||rc(o))return;or.has(e)||or.set(e,[]);let i=or.get(e);if(i.push(o),!(i.length>1))for(;i.length>0;){await tc(e,n,o),await qf.yield();let s=await Qa({wrappedMessage:i[0],anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n});i.shift(),n.emit("message",s),n.emit("message:done")}},Za=async({anyProcess:e,channel:t,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{Jn();let i=or.get(e);for(;i?.length>0;)await zf(n,"message:done");e.removeListener("message",o),Ja(t,r),n.connected=!1,n.emit("disconnect")},or=new WeakMap;var ye=(e,t,r)=>{if(ir.has(e))return ir.get(e);let n=new Yf;return n.connected=!0,ir.set(e,n),Kf({ipcEmitter:n,anyProcess:e,channel:t,isSubprocess:r}),n},ir=new WeakMap,Kf=({ipcEmitter:e,anyProcess:t,channel:r,isSubprocess:n})=>{let o=Xa.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e});t.on("message",o),t.once("disconnect",Za.bind(void 0,{anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:e,boundOnMessage:o})),Ka(r,n)},sr=e=>{let t=ir.get(e);return t===void 0?e.channel!==null:t.connected};var nc=({anyProcess:e,channel:t,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let i=ye(e,t,r),s=lr(e,i);return{id:Xf++,type:cr,message:n,hasListeners:s}},Xf=0n,oc=(e,t)=>{if(!(t?.type!==cr||t.hasListeners))for(let{id:r}of e)r!==void 0&&ar[r].resolve({isDeadlock:!0,hasListeners:!1})},Qa=async({wrappedMessage:e,anyProcess:t,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(e?.type!==cr||!t.connected)return e;let{id:i,message:s}=e,a={id:i,type:sc,message:lr(t,o)};try{await ur({anyProcess:t,channel:r,isSubprocess:n,ipc:!0},a)}catch(c){o.emit("strict:error",c)}return s},ec=e=>{if(e?.type!==sc)return!1;let{id:t,message:r}=e;return ar[t]?.resolve({isDeadlock:!1,hasListeners:r}),!0},ic=async(e,t,r)=>{if(e?.type!==cr)return;let n=te();ar[e.id]=n;let o=new AbortController;try{let{isDeadlock:i,hasListeners:s}=await Promise.race([n,Zf(t,r,o)]);i&&Na(r),s||ja(r)}finally{o.abort(),delete ar[e.id]}},ar={},Zf=async(e,t,{signal:r})=>{$e(e,1,r),await Jf(e,"disconnect",{signal:r}),Ua(t)},cr="execa:ipc:request",sc="execa:ipc:response";var ac=(e,t,r)=>{it.has(e)||it.set(e,new Set);let n=it.get(e),o=te(),i=r?t.id:void 0,s={onMessageSent:o,id:i};return n.add(s),{outgoingMessages:n,outgoingMessage:s}},cc=({outgoingMessages:e,outgoingMessage:t})=>{e.delete(t),t.onMessageSent.resolve()},tc=async(e,t,r)=>{for(;!lr(e,t)&&it.get(e)?.size>0;){let n=[...it.get(e)];oc(n,r),await Promise.all(n.map(({onMessageSent:o})=>o))}},it=new WeakMap,lr=(e,t)=>t.listenerCount("message")>Qf(e),Qf=e=>re.has(e)&&!pe(re.get(e).options.buffer,"ipc")?1:0;var ur=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},o,{strict:i=!1}={})=>{let s="sendMessage";return Be({methodName:s,isSubprocess:r,ipc:n,isConnected:e.connected}),th({anyProcess:e,channel:t,methodName:s,isSubprocess:r,message:o,strict:i})},th=async({anyProcess:e,channel:t,methodName:r,isSubprocess:n,message:o,strict:i})=>{let s=nc({anyProcess:e,channel:t,isSubprocess:n,message:o,strict:i}),a=ac(e,s,i);try{await Zn({anyProcess:e,methodName:r,isSubprocess:n,wrappedMessage:s,message:o})}catch(c){throw Le(e),c}finally{cc(a)}},Zn=async({anyProcess:e,methodName:t,isSubprocess:r,wrappedMessage:n,message:o})=>{let i=rh(e);try{await Promise.all([ic(n,e,r),i(n)])}catch(s){throw Wa({error:s,methodName:t,isSubprocess:r}),Ha({error:s,methodName:t,isSubprocess:r,message:o}),s}},rh=e=>{if(Xn.has(e))return Xn.get(e);let t=eh(e.send.bind(e));return Xn.set(e,t),t},Xn=new WeakMap;var uc=(e,t)=>{let r="cancelSignal";return qn(r,!1,e.connected),Zn({anyProcess:e,methodName:r,isSubprocess:!1,wrappedMessage:{type:dc,message:t},message:t})},pc=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>(await oh({anyProcess:e,channel:t,isSubprocess:r,ipc:n}),Qn.signal),oh=async({anyProcess:e,channel:t,isSubprocess:r,ipc:n})=>{if(!lc){if(lc=!0,!n){Va();return}if(t===null){Jn();return}ye(e,t,r),await nh.yield()}},lc=!1,rc=e=>e?.type!==dc?!1:(Qn.abort(e.message),!0),dc="execa:ipc:cancel",Jn=()=>{Qn.abort(Ga())},Qn=new AbortController;var mc=({gracefulCancel:e,cancelSignal:t,ipc:r,serialization:n})=>{if(e){if(t===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!r)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(n==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},fc=({subprocess:e,cancelSignal:t,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:i})=>r?[ih({subprocess:e,cancelSignal:t,forceKillAfterDelay:n,context:o,controller:i})]:[],ih=async({subprocess:e,cancelSignal:t,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await Zt(t,o);let i=sh(t);throw await uc(e,i),zn({kill:e.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",t.reason},sh=({reason:e})=>{if(!(e instanceof DOMException))return e;let t=new Error(e.message);return Object.defineProperty(t,"stack",{value:e.stack,enumerable:!1,configurable:!0,writable:!0}),t};import{setTimeout as ah}from"timers/promises";var hc=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},gc=(e,t,r,n)=>t===0||t===void 0?[]:[ch(e,t,r,n)],ch=async(e,t,r,{signal:n})=>{throw await ah(t,void 0,{signal:n}),r.terminationReason??="timeout",e.kill(),new J};import{execPath as lh,execArgv as uh}from"process";import yc from"path";var bc=({options:e})=>{if(e.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...e,node:!0}}},Sc=(e,t,{node:r=!1,nodePath:n=lh,nodeOptions:o=uh.filter(c=>!c.startsWith("--inspect")),cwd:i,execPath:s,...a})=>{if(s!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let c=Fe(n,'The "nodePath" option'),u=yc.resolve(i,c),l={...a,nodePath:u,node:r,cwd:i};if(!r)return[e,t,l];if(yc.basename(e,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...o,e,...t],{ipc:!0,...l,shell:!1}]};import{serialize as ph}from"v8";var wc=({ipcInput:e,ipc:t,serialization:r})=>{if(e!==void 0){if(!t)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");fh[r](e)}},dh=e=>{try{ph(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:t})}},mh=e=>{try{JSON.stringify(e)}catch(t){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:t})}},fh={advanced:dh,json:mh},xc=async(e,t)=>{t!==void 0&&await e.sendMessage(t)};var $c=({encoding:e})=>{if(eo.has(e))return;let t=gh(e);if(t!==void 0)throw new TypeError(`Invalid option \`encoding: ${pr(e)}\`.
|
|
102
|
+
Please rename it to ${pr(t)}.`);let r=[...eo].map(n=>pr(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${pr(e)}\`.
|
|
103
|
+
Please rename it to one of: ${r}.`)},hh=new Set(["utf8","utf16le"]),N=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),eo=new Set([...hh,...N]),gh=e=>{if(e===null)return"buffer";if(typeof e!="string")return;let t=e.toLowerCase();if(t in Ec)return Ec[t];if(eo.has(t))return t},Ec={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},pr=e=>typeof e=="string"?`"${e}"`:String(e);import{statSync as yh}from"fs";import bh from"path";import Sh from"process";var _c=(e=Cc())=>{let t=Fe(e,'The "cwd" option');return bh.resolve(t)},Cc=()=>{try{return Sh.cwd()}catch(e){throw e.message=`The current directory does not exist.
|
|
104
|
+
${e.message}`,e}},Ac=(e,t)=>{if(t===Cc())return e;let r;try{r=yh(t)}catch(n){return`The "cwd" option is invalid: ${t}.
|
|
104
105
|
${n.message}
|
|
105
|
-
${
|
|
106
|
-
${
|
|
107
|
-
`,
|
|
108
|
-
${
|
|
109
|
-
`)].map(
|
|
110
|
-
|
|
111
|
-
`);return{originalMessage:
|
|
112
|
-
`):Mu(t),Mu=t=>typeof t=="string"?t:_(t)?Ot(t):"";var mr=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:o,options:{cwd:s},startTime:i})=>ku({command:t,escapedCommand:e,cwd:s,durationMs:xn(i),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),Me=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:i})=>rt({error:t,command:e,escapedCommand:r,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:i}),rt=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:p,all:d,ipcOutput:D,options:{timeoutDuration:f,timeout:g=f,forceKillAfterDelay:E,killSignal:C,cwd:O,maxBuffer:v},isSync:y})=>{let{exitCode:F,signal:B,signalDescription:I}=qf(c,l),{originalMessage:se,shortMessage:ae,message:Lr}=Pu({stdio:p,all:d,ipcOutput:D,originalError:t,signal:B,signalDescription:I,exitCode:F,escapedCommand:r,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:E,killSignal:C,maxBuffer:v,timeout:g,cwd:O}),Ue=ca(t,Lr,y);return Object.assign(Ue,zf({error:Ue,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:F,signal:B,signalDescription:I,stdio:p,all:d,ipcOutput:D,cwd:O,originalMessage:se,shortMessage:ae})),Ue},zf=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,stdio:d,all:D,ipcOutput:f,cwd:g,originalMessage:E,shortMessage:C})=>ku({shortMessage:C,originalMessage:E,command:e,escapedCommand:r,cwd:g,durationMs:xn(n),failed:!0,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:p,code:t.cause?.code,stdout:d[1],stderr:d[2],all:D,stdio:d,ipcOutput:f,pipedFrom:[]}),ku=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),qf=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,o=n===void 0?void 0:Gt(e);return{exitCode:r,signal:n,signalDescription:o}};var Lu=t=>Number.isFinite(t)?t:0;function Yf(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Lu(t*1e3)%1e3),nanoseconds:Math.trunc(Lu(t*1e6)%1e3)}}function Kf(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function Xn(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Yf(t);break}case"bigint":return Kf(t)}throw new TypeError("Expected a finite number or bigint")}var Jf=t=>t===0||t===0n,Xf=(t,e)=>e===1||e===1n?t:`${t}s`,Zf=1e-7,Qf=24n*60n*60n*1000n;function Zn(t,e){let r=typeof t=="bigint";if(!r&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};let n=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let o=[],s=(l,p)=>{let d=Math.floor(l*10**p+Zf);return(Math.round(d)/10**p).toFixed(p)},i=(l,p,d,D)=>{if(!((o.length===0||!e.colonNotation)&&Jf(l)&&!(e.colonNotation&&d==="m"))){if(D??=String(l),e.colonNotation){let f=D.includes(".")?D.split(".")[0].length:D.length,g=o.length>0?2:1;D="0".repeat(Math.max(0,g-f))+D}else D+=e.verbose?" "+Xf(p,l):d;o.push(D)}},a=Xn(t),u=BigInt(a.days);if(e.hideYearAndDays?i(BigInt(u)*24n+BigInt(a.hours),"hour","h"):(e.hideYear?i(u,"day","d"):(i(u/365n,"year","y"),i(u%365n,"day","d")),i(Number(a.hours),"hour","h")),i(Number(a.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3&&!e.subSecondsAsDecimals){let l=Number(a.seconds),p=Number(a.milliseconds),d=Number(a.microseconds),D=Number(a.nanoseconds);if(i(l,"second","s"),e.formatSubMilliseconds)i(p,"millisecond","ms"),i(d,"microsecond","\xB5s"),i(D,"nanosecond","ns");else{let f=p+d/1e3+D/1e6,g=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,E=f>=1?Math.round(f):Math.ceil(f),C=g?f.toFixed(g):E;i(Number.parseFloat(C),"millisecond","ms",C)}}else{let l=(r?Number(t%Qf):t)/1e3%60,p=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,d=s(l,p),D=e.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");i(Number.parseFloat(D),"second","s",D)}if(o.length===0)return n+"0"+(e.verbose?" milliseconds":"ms");let c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(o=o.slice(0,Math.max(e.unitCount,1))),n+o.join(c)}var ju=(t,e)=>{t.failed&&K({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var Nu=(t,e)=>{Ae(e)&&(ju(t,e),eh(t,e))},eh=(t,e)=>{let r=`(done in ${Zn(t.durationMs)})`;K({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Pe=(t,e,{reject:r})=>{if(Nu(t,e),t.failed&&r)throw t;return t};import{readFileSync as Dc}from"fs";var Gu=(t,e)=>Ce(t)?"asyncGenerator":zu(t)?"generator":fr(t)?"fileUrl":ih(t)?"filePath":uh(t)?"webStream":H(t,{checkOpen:!1})?"native":_(t)?"uint8Array":ch(t)?"asyncIterable":lh(t)?"iterable":to(t)?Wu({transform:t},e):oh(t)?th(t,e):"native",th=(t,e)=>qn(t.transform,{checkOpen:!1})?rh(t,e):to(t.transform)?Wu(t,e):nh(t,e),rh=(t,e)=>(Hu(t,e,"Duplex stream"),"duplex"),Wu=(t,e)=>(Hu(t,e,"web TransformStream"),"webTransform"),Hu=({final:t,binary:e,objectMode:r},n,o)=>{Uu(t,`${n}.final`,o),Uu(e,`${n}.binary`,o),Qn(r,`${n}.objectMode`)},Uu=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},nh=({transform:t,final:e,binary:r,objectMode:n},o)=>{if(t!==void 0&&!Vu(t))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(qn(e,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(to(e))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Vu(e))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return Qn(r,`${o}.binary`),Qn(n,`${o}.objectMode`),Ce(t)||Ce(e)?"asyncGenerator":"generator"},Qn=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Vu=t=>Ce(t)||zu(t),Ce=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",zu=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",oh=t=>A(t)&&(t.transform!==void 0||t.final!==void 0),fr=t=>Object.prototype.toString.call(t)==="[object URL]",qu=t=>fr(t)&&t.protocol!=="file:",ih=t=>A(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>sh.has(e))&&eo(t.file),sh=new Set(["file","append"]),eo=t=>typeof t=="string",Yu=(t,e)=>t==="native"&&typeof e=="string"&&!ah.has(e),ah=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ku=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",hr=t=>Object.prototype.toString.call(t)==="[object WritableStream]",uh=t=>Ku(t)||hr(t),to=t=>Ku(t?.readable)&&hr(t?.writable),ch=t=>Ju(t)&&typeof t[Symbol.asyncIterator]=="function",lh=t=>Ju(t)&&typeof t[Symbol.iterator]=="function",Ju=t=>typeof t=="object"&&t!==null,j=new Set(["generator","asyncGenerator","duplex","webTransform"]),gr=new Set(["fileUrl","filePath","fileNumber"]),ro=new Set(["fileUrl","filePath"]),Xu=new Set([...ro,"webStream","nodeStream"]),Zu=new Set(["webTransform","duplex"]),de={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var no=(t,e,r,n)=>n==="output"?ph(t,e,r):dh(t,e,r),ph=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},dh=(t,e,r)=>{let n=e===0?t===!0:r[e-1].value.readableObjectMode,o=e!==r.length-1&&(t??n);return{writableObjectMode:n,readableObjectMode:o}},Qu=(t,e)=>{let r=t.findLast(({type:n})=>j.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var ec=(t,e,r,n)=>[...t.filter(({type:o})=>!j.has(o)),...Dh(t,e,r,n)],Dh=(t,e,r,{encoding:n})=>{let o=t.filter(({type:i})=>j.has(i)),s=Array.from({length:o.length});for(let[i,a]of Object.entries(o))s[i]=mh({stdioItem:a,index:Number(i),newTransforms:s,optionName:e,direction:r,encoding:n});return bh(s,r)},mh=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:o,direction:s,encoding:i})=>e==="duplex"?fh({stdioItem:t,optionName:o}):e==="webTransform"?hh({stdioItem:t,index:r,newTransforms:n,direction:s}):gh({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:i}),fh=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:s})=>{if(o&&!n)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:r,readableObjectMode:n}}},hh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o})=>{let{transform:s,objectMode:i}=A(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=no(i,r,n,o);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},gh=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o,encoding:s})=>{let{transform:i,final:a,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=A(e)?e:{transform:e},p=u||P.has(s),{writableObjectMode:d,readableObjectMode:D}=no(l,r,n,o);return{...t,value:{transform:i,final:a,binary:p,preserveNewlines:c,writableObjectMode:d,readableObjectMode:D}}},bh=(t,e)=>e==="input"?t.reverse():t;import oo from"process";var tc=(t,e,r)=>{let n=t.map(o=>Ch(o,e));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??wh},Ch=({type:t,value:e},r)=>yh[r]??rc[t](e),yh=["input","output","output"],ke=()=>{},io=()=>"input",rc={generator:ke,asyncGenerator:ke,fileUrl:ke,filePath:ke,iterable:io,asyncIterable:io,uint8Array:io,webStream:t=>hr(t)?"output":"input",nodeStream(t){return be(t,{checkOpen:!1})?zn(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:ke,duplex:ke,native(t){let e=Eh(t);if(e!==void 0)return e;if(H(t,{checkOpen:!1}))return rc.nodeStream(t)}},Eh=t=>{if([0,oo.stdin].includes(t))return"input";if([1,2,oo.stdout,oo.stderr].includes(t))return"output"},wh="output";var nc=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var oc=({stdio:t,ipc:e,buffer:r,...n},o,s)=>{let i=Fh(t,n).map((a,u)=>ic(a,u));return s?xh(i,r,o):nc(i,e)},Fh=(t,e)=>{if(t===void 0)return L.map(n=>e[n]);if(Sh(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${L.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,L.length);return Array.from({length:r},(n,o)=>t[o])},Sh=t=>L.some(e=>t[e]!==void 0),ic=(t,e)=>Array.isArray(t)?t.map(r=>ic(r,e)):t??(e>=L.length?"ignore":"pipe"),xh=(t,e,r)=>t.map((n,o)=>!e[o]&&o!==0&&!Oe(r,o)&&Ah(n)?"ignore":n),Ah=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");import{readFileSync as Oh}from"fs";import $h from"tty";var ac=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:o,isSync:s})=>!r||e!=="native"?t:s?Bh({stdioItem:t,fdNumber:n,direction:o}):Th({stdioItem:t,fdNumber:n}),Bh=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:o})=>{let s=_h({value:e,optionName:r,fdNumber:n,direction:o});if(s!==void 0)return s;if(H(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},_h=({value:t,optionName:e,fdNumber:r,direction:n})=>{let o=vh(t,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:e};if($h.isatty(o))throw new TypeError(`The \`${e}: ${zt(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:te(Oh(o)),optionName:e}}},vh=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=$t.indexOf(t);if(r!==-1)return r},Th=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:sc(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:sc(e,e,r),optionName:r}:H(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,sc=(t,e,r)=>{let n=$t[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var uc=({input:t,inputFile:e},r)=>r===0?[...Ih(t),...Mh(e)]:[],Ih=t=>t===void 0?[]:[{type:Rh(t),value:t,optionName:"input"}],Rh=t=>{if(be(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(_(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Mh=t=>t===void 0?[]:[{...Ph(t),optionName:"inputFile"}],Ph=t=>{if(fr(t))return{type:"fileUrl",value:t};if(eo(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var cc=t=>t.filter((e,r)=>t.every((n,o)=>e.value!==n.value||r>=o||e.type==="generator"||e.type==="asyncGenerator")),lc=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:o,isSync:s})=>{let i=kh(o,t);if(i.length!==0){if(s){Lh({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});return}if(Xu.has(t))return pc({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});Zu.has(t)&&Nh({otherStdioItems:i,type:t,value:e,optionName:r})}},kh=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===e).map((o=>({...o,direction:r})))),Lh=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{ro.has(e)&&pc({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})},pc=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{let s=t.filter(a=>jh(a,r));if(s.length===0)return;let i=s.find(a=>a.direction!==o);return dc(i,n,e),o==="output"?s[0].stream:void 0},jh=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Nh=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let o=t.find(({value:{transform:s}})=>s===r.transform);dc(o,n,e)},dc=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${de[r]} that is the same.`)};var br=(t,e,r,n)=>{let s=oc(e,r,n).map((a,u)=>Uh({stdioOption:a,fdNumber:u,options:e,isSync:n})),i=Kh({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=i.map(({stdioItems:a})=>Zh(a)),i},Uh=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let o=Bt(e),{stdioItems:s,isStdioArray:i}=Vh({stdioOption:t,fdNumber:e,options:r,optionName:o}),a=tc(s,e,o),u=s.map(p=>ac({stdioItem:p,isStdioArray:i,fdNumber:e,direction:a,isSync:n})),c=ec(u,o,a,r),l=Qu(c,a);return Yh(c,l),{direction:a,objectMode:l,stdioItems:c}},Vh=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>Gh(u,n)),...uc(r,e)],i=cc(s),a=i.length>1;return Wh(i,a,n),zh(i),{stdioItems:i,isStdioArray:a}},Gh=(t,e)=>({type:Gu(t,e),value:t,optionName:e}),Wh=(t,e,r)=>{if(t.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(e){for(let{value:n,optionName:o}of t)if(Hh.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},Hh=new Set(["ignore","ipc"]),zh=t=>{for(let e of t)qh(e)},qh=({type:t,value:e,optionName:r})=>{if(qu(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
113
|
-
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(
|
|
114
|
-
`){let
|
|
106
|
+
${e}`}return r.isDirectory()?e:`The "cwd" option is not a directory: ${t}.
|
|
107
|
+
${e}`};var dr=(e,t,r)=>{r.cwd=_c(r.cwd);let[n,o,i]=Sc(e,t,r),{command:s,args:a,options:c}=vc.default._parse(n,o,i),u=ms(c),l=xh(u);return hc(l),$c(l),wc(l),ka(l),mc(l),l.shell=An(l.shell),l.env=Eh(l),l.killSignal=Da(l.killSignal),l.forceKillAfterDelay=Ma(l.forceKillAfterDelay),l.lines=l.lines.map((p,d)=>p&&!N.has(l.encoding)&&l.buffer[d]),Oc.platform==="win32"&&wh.basename(s,".exe")==="cmd"&&a.unshift("/q"),{file:s,commandArguments:a,options:l}},xh=({extendEnv:e=!0,preferLocal:t=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:i=!0,cleanup:s=!0,all:a=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:p=!1,ipcInput:d,ipc:f=d!==void 0||p,serialization:m="advanced",...h})=>({...h,extendEnv:e,preferLocal:t,cwd:r,localDirectory:n,encoding:o,reject:i,cleanup:s,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:p,ipcInput:d,ipc:f,serialization:m}),Eh=({env:e,extendEnv:t,preferLocal:r,node:n,localDirectory:o,nodePath:i})=>{let s=t?{...Oc.env,...e}:e;return r||n?wa({env:s,cwd:o,execPath:i,preferLocal:r,addExecPath:n}):s};var mr=(e,t,r)=>r.shell&&t.length>0?[[e,...t].join(" "),[],r]:[e,t,r];import{inspect as rg}from"util";function je(e){if(typeof e=="string")return $h(e);if(!(ArrayBuffer.isView(e)&&e.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return _h(e)}var $h=e=>e.at(-1)===Tc?e.slice(0,e.at(-2)===Ic?-2:-1):e,_h=e=>e.at(-1)===Ch?e.subarray(0,e.at(-2)===Ah?-2:-1):e,Tc=`
|
|
108
|
+
`,Ch=Tc.codePointAt(0),Ic="\r",Ah=Ic.codePointAt(0);import{on as Zh}from"events";import{finished as Qh}from"stream/promises";function Z(e,{checkOpen:t=!0}={}){return e!==null&&typeof e=="object"&&(e.writable||e.readable||!t||e.writable===void 0&&e.readable===void 0)&&typeof e.pipe=="function"}function to(e,{checkOpen:t=!0}={}){return Z(e,{checkOpen:t})&&(e.writable||!t)&&typeof e.write=="function"&&typeof e.end=="function"&&typeof e.writable=="boolean"&&typeof e.writableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function _e(e,{checkOpen:t=!0}={}){return Z(e,{checkOpen:t})&&(e.readable||!t)&&typeof e.read=="function"&&typeof e.readable=="boolean"&&typeof e.readableObjectMode=="boolean"&&typeof e.destroy=="function"&&typeof e.destroyed=="boolean"}function ro(e,t){return to(e,t)&&_e(e,t)}var Oh=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),no=class{#t;#r;#e=!1;#n=void 0;constructor(t,r){this.#t=t,this.#r=r}next(){let t=()=>this.#i();return this.#n=this.#n?this.#n.then(t,t):t(),this.#n}return(t){let r=()=>this.#o(t);return this.#n?this.#n.then(r,r):r()}async#i(){if(this.#e)return{done:!0,value:void 0};let t;try{t=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return t.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),t}async#o(t){if(this.#e)return{done:!0,value:t};if(this.#e=!0,!this.#r){let r=this.#t.cancel(t);return this.#t.releaseLock(),await r,{done:!0,value:t}}return this.#t.releaseLock(),{done:!0,value:t}}},oo=Symbol();function Dc(){return this[oo].next()}Object.defineProperty(Dc,"name",{value:"next"});function Fc(e){return this[oo].return(e)}Object.defineProperty(Fc,"name",{value:"return"});var vh=Object.create(Oh,{next:{enumerable:!0,configurable:!0,writable:!0,value:Dc},return:{enumerable:!0,configurable:!0,writable:!0,value:Fc}});function io({preventCancel:e=!1}={}){let t=this.getReader(),r=new no(t,e),n=Object.create(vh);return n[oo]=r,n}var Rc=e=>{if(_e(e,{checkOpen:!1})&&st.on!==void 0)return Ih(e);if(typeof e?.[Symbol.asyncIterator]=="function")return e;if(Th.call(e)==="[object ReadableStream]")return io.call(e);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Th}=Object.prototype,Ih=async function*(e){let t=new AbortController,r={};Dh(e,t,r);try{for await(let[n]of st.on(e,"data",{signal:t.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!t.signal.aborted)throw n}finally{e.destroy()}},Dh=async(e,t,r)=>{try{await st.finished(e,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{t.abort()}},st={};var Ue=async(e,{init:t,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{let u=Rc(e),l=t();l.length=0;try{for await(let p of u){let d=Rh(p),f=r[d](p,l);kc({convertedChunk:f,state:l,getSize:n,truncateChunk:o,addChunk:i,maxBuffer:c})}return Fh({state:l,convertChunk:r,getSize:n,truncateChunk:o,addChunk:i,getFinalChunk:s,maxBuffer:c}),a(l)}catch(p){let d=typeof p=="object"&&p!==null?p:new Error(p);throw d.bufferedData=a(l),d}},Fh=({state:e,getSize:t,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:i})=>{let s=o(e);s!==void 0&&kc({convertedChunk:s,state:e,getSize:t,truncateChunk:r,addChunk:n,maxBuffer:i})},kc=({convertedChunk:e,state:t,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:i})=>{let s=r(e),a=t.length+s;if(a<=i){Mc(e,t,o,a);return}let c=n(e,i-t.length);throw c!==void 0&&Mc(c,t,o,i),new ne},Mc=(e,t,r,n)=>{t.contents=r(e,t,n),t.length=n},Rh=e=>{let t=typeof e;if(t==="string")return"string";if(t!=="object"||e===null)return"others";if(globalThis.Buffer?.isBuffer(e))return"buffer";let r=Pc.call(e);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(e.byteLength)&&Number.isInteger(e.byteOffset)&&Pc.call(e.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:Pc}=Object.prototype,ne=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var de=e=>e,at=()=>{},fr=({contents:e})=>e,hr=e=>{throw new Error(`Streams in object mode are not supported: ${String(e)}`)},gr=e=>e.length;async function yr(e,t){return Ue(e,Bh,t)}var Mh=()=>({contents:[]}),Ph=()=>1,kh=(e,{contents:t})=>(t.push(e),t),Bh={init:Mh,convertChunk:{string:de,buffer:de,arrayBuffer:de,dataView:de,typedArray:de,others:de},getSize:Ph,truncateChunk:at,addChunk:kh,getFinalChunk:at,finalize:fr};async function br(e,t){return Ue(e,zh,t)}var Lh=()=>({contents:new ArrayBuffer(0)}),Nh=e=>jh.encode(e),jh=new TextEncoder,Bc=e=>new Uint8Array(e),Lc=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength),Uh=(e,t)=>e.slice(0,t),Gh=(e,{contents:t,length:r},n)=>{let o=Uc()?Wh(t,n):Vh(t,n);return new Uint8Array(o).set(e,r),o},Vh=(e,t)=>{if(t<=e.byteLength)return e;let r=new ArrayBuffer(jc(t));return new Uint8Array(r).set(new Uint8Array(e),0),r},Wh=(e,t)=>{if(t<=e.maxByteLength)return e.resize(t),e;let r=new ArrayBuffer(t,{maxByteLength:jc(t)});return new Uint8Array(r).set(new Uint8Array(e),0),r},jc=e=>Nc**Math.ceil(Math.log(e)/Math.log(Nc)),Nc=2,Hh=({contents:e,length:t})=>Uc()?e:e.slice(0,t),Uc=()=>"resize"in ArrayBuffer.prototype,zh={init:Lh,convertChunk:{string:Nh,buffer:Bc,arrayBuffer:Bc,dataView:Lc,typedArray:Lc,others:hr},getSize:gr,truncateChunk:Uh,addChunk:Gh,getFinalChunk:at,finalize:Hh};async function wr(e,t){return Ue(e,Xh,t)}var qh=()=>({contents:"",textDecoder:new TextDecoder}),Sr=(e,{textDecoder:t})=>t.decode(e,{stream:!0}),Yh=(e,{contents:t})=>t+e,Kh=(e,t)=>e.slice(0,t),Jh=({textDecoder:e})=>{let t=e.decode();return t===""?void 0:t},Xh={init:qh,convertChunk:{string:de,buffer:Sr,arrayBuffer:Sr,dataView:Sr,typedArray:Sr,others:hr},getSize:gr,truncateChunk:Kh,addChunk:Yh,getFinalChunk:Jh,finalize:fr};Object.assign(st,{on:Zh,finished:Qh});var Gc=({error:e,stream:t,readableObjectMode:r,lines:n,encoding:o,fdNumber:i})=>{if(!(e instanceof ne))throw e;if(i==="all")return e;let s=eg(r,n,o);throw e.maxBufferInfo={fdNumber:i,unit:s},t.destroy(),e},eg=(e,t,r)=>e?"objects":t?"lines":r==="buffer"?"bytes":"characters",Vc=(e,t,r)=>{if(t.length!==r)return;let n=new ne;throw n.maxBufferInfo={fdNumber:"ipc"},n},Wc=(e,t)=>{let{streamName:r,threshold:n,unit:o}=tg(e,t);return`Command's ${r} was larger than ${n} ${o}`},tg=(e,t)=>{if(e?.maxBufferInfo===void 0)return{streamName:"output",threshold:t[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=e;delete e.maxBufferInfo;let o=pe(t,r);return r==="ipc"?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:Bt(r),threshold:o,unit:n}},Hc=(e,t,r)=>e?.code==="ENOBUFS"&&t!==null&&t.some(n=>n!==null&&n.length>xr(r)),zc=(e,t,r)=>{if(!t)return e;let n=xr(r);return e.length>n?e.slice(0,n):e},xr=([,e])=>e;var Yc=({stdio:e,all:t,ipcOutput:r,originalError:n,signal:o,signalDescription:i,exitCode:s,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:p,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:m,maxBuffer:h,timeout:$,cwd:b})=>{let x=n?.code,S=ng({originalError:n,timedOut:c,timeout:$,isMaxBuffer:p,maxBuffer:h,errorCode:x,signal:o,signalDescription:i,exitCode:s,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:m}),C=ig(n,b),O=C===void 0?"":`
|
|
109
|
+
${C}`,F=`${S}: ${a}${O}`,w=t===void 0?[e[2],e[1]]:[t],_=[F,...w,...e.slice(3),r.map(B=>sg(B)).join(`
|
|
110
|
+
`)].map(B=>et(je(ag(B)))).filter(Boolean).join(`
|
|
111
|
+
|
|
112
|
+
`);return{originalMessage:C,shortMessage:F,message:_}},ng=({originalError:e,timedOut:t,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:i,signal:s,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:p,forceKillAfterDelay:d,killSignal:f})=>{let m=og(p,d);return t?`Command timed out after ${r} milliseconds${m}`:l?s===void 0?`Command was gracefully canceled with exit code ${c}`:p?`Command was gracefully canceled${m}`:`Command was gracefully canceled with ${s} (${a})`:u?`Command was canceled${m}`:n?`${Wc(e,o)}${m}`:i!==void 0?`Command failed with ${i}${m}`:p?`Command was killed with ${f} (${Xt(f)})${m}`:s!==void 0?`Command was killed with ${s} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},og=(e,t)=>e?` and was forcefully terminated after ${t} milliseconds`:"",ig=(e,t)=>{if(e instanceof J)return;let r=$a(e)?e.originalMessage:String(e?.message??e),n=et(Ac(r,t));return n===""?void 0:n},sg=e=>typeof e=="string"?e:rg(e),ag=e=>Array.isArray(e)?e.map(t=>je(qc(t))).filter(Boolean).join(`
|
|
113
|
+
`):qc(e),qc=e=>typeof e=="string"?e:R(e)?Pt(e):"";var Er=({command:e,escapedCommand:t,stdio:r,all:n,ipcOutput:o,options:{cwd:i},startTime:s})=>Kc({command:e,escapedCommand:t,cwd:i,durationMs:Mn(s),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:r[1],stderr:r[2],all:n,stdio:r,ipcOutput:o,pipedFrom:[]}),Ge=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:s})=>ct({error:e,command:t,escapedCommand:r,startTime:i,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:n.length}),ipcOutput:[],options:o,isSync:s}),ct=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:p,all:d,ipcOutput:f,options:{timeoutDuration:m,timeout:h=m,forceKillAfterDelay:$,killSignal:b,cwd:x,maxBuffer:S},isSync:C})=>{let{exitCode:O,signal:F,signalDescription:w}=lg(u,l),{originalMessage:_,shortMessage:B,message:ie}=Yc({stdio:p,all:d,ipcOutput:f,originalError:e,signal:F,signalDescription:w,exitCode:O,escapedCommand:r,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:$,killSignal:b,maxBuffer:S,timeout:h,cwd:x}),q=xa(e,ie,C);return Object.assign(q,cg({error:q,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:O,signal:F,signalDescription:w,stdio:p,all:d,ipcOutput:f,cwd:x,originalMessage:_,shortMessage:B})),q},cg=({error:e,command:t,escapedCommand:r,startTime:n,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:p,stdio:d,all:f,ipcOutput:m,cwd:h,originalMessage:$,shortMessage:b})=>Kc({shortMessage:b,originalMessage:$,command:t,escapedCommand:r,cwd:h,durationMs:Mn(n),failed:!0,timedOut:o,isCanceled:i,isGracefullyCanceled:s,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:p,code:e.cause?.code,stdout:d[1],stderr:d[2],all:f,stdio:d,ipcOutput:m,pipedFrom:[]}),Kc=e=>Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0)),lg=(e,t)=>{let r=e===null?void 0:e,n=t===null?void 0:t,o=n===void 0?void 0:Xt(t);return{exitCode:r,signal:n,signalDescription:o}};var Jc=e=>Number.isFinite(e)?e:0;function ug(e){return{days:Math.trunc(e/864e5),hours:Math.trunc(e/36e5%24),minutes:Math.trunc(e/6e4%60),seconds:Math.trunc(e/1e3%60),milliseconds:Math.trunc(e%1e3),microseconds:Math.trunc(Jc(e*1e3)%1e3),nanoseconds:Math.trunc(Jc(e*1e6)%1e3)}}function pg(e){return{days:e/86400000n,hours:e/3600000n%24n,minutes:e/60000n%60n,seconds:e/1000n%60n,milliseconds:e%1000n,microseconds:0n,nanoseconds:0n}}function so(e){switch(typeof e){case"number":{if(Number.isFinite(e))return ug(e);break}case"bigint":return pg(e)}throw new TypeError("Expected a finite number or bigint")}var dg=e=>e===0||e===0n,mg=(e,t)=>t===1||t===1n?e:`${e}s`,fg=1e-7,hg=24n*60n*60n*1000n;function ao(e,t){let r=typeof e=="bigint";if(!r&&!Number.isFinite(e))throw new TypeError("Expected a finite number or bigint");t={...t};let n=e<0?"-":"";e=e<0?-e:e,t.colonNotation&&(t.compact=!1,t.formatSubMilliseconds=!1,t.separateMilliseconds=!1,t.verbose=!1),t.compact&&(t.unitCount=1,t.secondsDecimalDigits=0,t.millisecondsDecimalDigits=0);let o=[],i=(l,p)=>{let d=Math.floor(l*10**p+fg);return(Math.round(d)/10**p).toFixed(p)},s=(l,p,d,f)=>{if(!((o.length===0||!t.colonNotation)&&dg(l)&&!(t.colonNotation&&d==="m"))){if(f??=String(l),t.colonNotation){let m=f.includes(".")?f.split(".")[0].length:f.length,h=o.length>0?2:1;f="0".repeat(Math.max(0,h-m))+f}else f+=t.verbose?" "+mg(p,l):d;o.push(f)}},a=so(e),c=BigInt(a.days);if(t.hideYearAndDays?s(BigInt(c)*24n+BigInt(a.hours),"hour","h"):(t.hideYear?s(c,"day","d"):(s(c/365n,"year","y"),s(c%365n,"day","d")),s(Number(a.hours),"hour","h")),s(Number(a.minutes),"minute","m"),!t.hideSeconds)if(t.separateMilliseconds||t.formatSubMilliseconds||!t.colonNotation&&e<1e3&&!t.subSecondsAsDecimals){let l=Number(a.seconds),p=Number(a.milliseconds),d=Number(a.microseconds),f=Number(a.nanoseconds);if(s(l,"second","s"),t.formatSubMilliseconds)s(p,"millisecond","ms"),s(d,"microsecond","\xB5s"),s(f,"nanosecond","ns");else{let m=p+d/1e3+f/1e6,h=typeof t.millisecondsDecimalDigits=="number"?t.millisecondsDecimalDigits:0,$=m>=1?Math.round(m):Math.ceil(m),b=h?m.toFixed(h):$;s(Number.parseFloat(b),"millisecond","ms",b)}}else{let l=(r?Number(e%hg):e)/1e3%60,p=typeof t.secondsDecimalDigits=="number"?t.secondsDecimalDigits:1,d=i(l,p),f=t.keepDecimalsOnWholeSeconds?d:d.replace(/\.0+$/,"");s(Number.parseFloat(f),"second","s",f)}if(o.length===0)return n+"0"+(t.verbose?" milliseconds":"ms");let u=t.colonNotation?":":" ";return typeof t.unitCount=="number"&&(o=o.slice(0,Math.max(t.unitCount,1))),n+o.join(u)}var Xc=(e,t)=>{e.failed&&ee({type:"error",verboseMessage:e.shortMessage,verboseInfo:t,result:e})};var Zc=(e,t)=>{Re(t)&&(Xc(e,t),gg(e,t))},gg=(e,t)=>{let r=`(done in ${ao(e.durationMs)})`;ee({type:"duration",verboseMessage:r,verboseInfo:t,result:e})};var Ve=(e,t,{reject:r})=>{if(Zc(e,t),e.failed&&r)throw e;return e};import{readFileSync as Cl}from"fs";var tl=(e,t)=>Ce(e)?"asyncGenerator":ol(e)?"generator":$r(e)?"fileUrl":xg(e)?"filePath":_g(e)?"webStream":Z(e,{checkOpen:!1})?"native":R(e)?"uint8Array":Cg(e)?"asyncIterable":Ag(e)?"iterable":uo(e)?rl({transform:e},t):wg(e)?yg(e,t):"native",yg=(e,t)=>ro(e.transform,{checkOpen:!1})?bg(e,t):uo(e.transform)?rl(e,t):Sg(e,t),bg=(e,t)=>(nl(e,t,"Duplex stream"),"duplex"),rl=(e,t)=>(nl(e,t,"web TransformStream"),"webTransform"),nl=({final:e,binary:t,objectMode:r},n,o)=>{Qc(e,`${n}.final`,o),Qc(t,`${n}.binary`,o),co(r,`${n}.objectMode`)},Qc=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${t}\` option can only be defined when using a generator, not a ${r}.`)},Sg=({transform:e,final:t,binary:r,objectMode:n},o)=>{if(e!==void 0&&!el(e))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(ro(t,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(uo(t))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(t!==void 0&&!el(t))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return co(r,`${o}.binary`),co(n,`${o}.objectMode`),Ce(e)||Ce(t)?"asyncGenerator":"generator"},co=(e,t)=>{if(e!==void 0&&typeof e!="boolean")throw new TypeError(`The \`${t}\` option must use a boolean.`)},el=e=>Ce(e)||ol(e),Ce=e=>Object.prototype.toString.call(e)==="[object AsyncGeneratorFunction]",ol=e=>Object.prototype.toString.call(e)==="[object GeneratorFunction]",wg=e=>I(e)&&(e.transform!==void 0||e.final!==void 0),$r=e=>Object.prototype.toString.call(e)==="[object URL]",il=e=>$r(e)&&e.protocol!=="file:",xg=e=>I(e)&&Object.keys(e).length>0&&Object.keys(e).every(t=>Eg.has(t))&&lo(e.file),Eg=new Set(["file","append"]),lo=e=>typeof e=="string",sl=(e,t)=>e==="native"&&typeof t=="string"&&!$g.has(t),$g=new Set(["ipc","ignore","inherit","overlapped","pipe"]),al=e=>Object.prototype.toString.call(e)==="[object ReadableStream]",_r=e=>Object.prototype.toString.call(e)==="[object WritableStream]",_g=e=>al(e)||_r(e),uo=e=>al(e?.readable)&&_r(e?.writable),Cg=e=>cl(e)&&typeof e[Symbol.asyncIterator]=="function",Ag=e=>cl(e)&&typeof e[Symbol.iterator]=="function",cl=e=>typeof e=="object"&&e!==null,z=new Set(["generator","asyncGenerator","duplex","webTransform"]),Cr=new Set(["fileUrl","filePath","fileNumber"]),po=new Set(["fileUrl","filePath"]),ll=new Set([...po,"webStream","nodeStream"]),ul=new Set(["webTransform","duplex"]),be={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var mo=(e,t,r,n)=>n==="output"?Og(e,t,r):vg(e,t,r),Og=(e,t,r)=>{let n=t!==0&&r[t-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:e??n}},vg=(e,t,r)=>{let n=t===0?e===!0:r[t-1].value.readableObjectMode,o=t!==r.length-1&&(e??n);return{writableObjectMode:n,readableObjectMode:o}},pl=(e,t)=>{let r=e.findLast(({type:n})=>z.has(n));return r===void 0?!1:t==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var dl=(e,t,r,n)=>[...e.filter(({type:o})=>!z.has(o)),...Tg(e,t,r,n)],Tg=(e,t,r,{encoding:n})=>{let o=e.filter(({type:s})=>z.has(s)),i=Array.from({length:o.length});for(let[s,a]of Object.entries(o))i[s]=Ig({stdioItem:a,index:Number(s),newTransforms:i,optionName:t,direction:r,encoding:n});return Mg(i,r)},Ig=({stdioItem:e,stdioItem:{type:t},index:r,newTransforms:n,optionName:o,direction:i,encoding:s})=>t==="duplex"?Dg({stdioItem:e,optionName:o}):t==="webTransform"?Fg({stdioItem:e,index:r,newTransforms:n,direction:i}):Rg({stdioItem:e,index:r,newTransforms:n,direction:i,encoding:s}),Dg=({stdioItem:e,stdioItem:{value:{transform:t,transform:{writableObjectMode:r,readableObjectMode:n},objectMode:o=n}},optionName:i})=>{if(o&&!n)throw new TypeError(`The \`${i}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!o&&n)throw new TypeError(`The \`${i}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...e,value:{transform:t,writableObjectMode:r,readableObjectMode:n}}},Fg=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o})=>{let{transform:i,objectMode:s}=I(t)?t:{transform:t},{writableObjectMode:a,readableObjectMode:c}=mo(s,r,n,o);return{...e,value:{transform:i,writableObjectMode:a,readableObjectMode:c}}},Rg=({stdioItem:e,stdioItem:{value:t},index:r,newTransforms:n,direction:o,encoding:i})=>{let{transform:s,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=I(t)?t:{transform:t},p=c||N.has(i),{writableObjectMode:d,readableObjectMode:f}=mo(l,r,n,o);return{...e,value:{transform:s,final:a,binary:p,preserveNewlines:u,writableObjectMode:d,readableObjectMode:f}}},Mg=(e,t)=>t==="input"?e.reverse():e;import fo from"process";var ml=(e,t,r)=>{let n=e.map(o=>Pg(o,t));if(n.includes("input")&&n.includes("output"))throw new TypeError(`The \`${r}\` option must not be an array of both readable and writable values.`);return n.find(Boolean)??Lg},Pg=({type:e,value:t},r)=>kg[r]??fl[e](t),kg=["input","output","output"],We=()=>{},ho=()=>"input",fl={generator:We,asyncGenerator:We,fileUrl:We,filePath:We,iterable:ho,asyncIterable:ho,uint8Array:ho,webStream:e=>_r(e)?"output":"input",nodeStream(e){return _e(e,{checkOpen:!1})?to(e,{checkOpen:!1})?void 0:"input":"output"},webTransform:We,duplex:We,native(e){let t=Bg(e);if(t!==void 0)return t;if(Z(e,{checkOpen:!1}))return fl.nodeStream(e)}},Bg=e=>{if([0,fo.stdin].includes(e))return"input";if([1,2,fo.stdout,fo.stderr].includes(e))return"output"},Lg="output";var hl=(e,t)=>t&&!e.includes("ipc")?[...e,"ipc"]:e;var gl=({stdio:e,ipc:t,buffer:r,...n},o,i)=>{let s=Ng(e,n).map((a,c)=>yl(a,c));return i?Ug(s,r,o):hl(s,t)},Ng=(e,t)=>{if(e===void 0)return H.map(n=>t[n]);if(jg(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${H.map(n=>`\`${n}\``).join(", ")}`);if(typeof e=="string")return[e,e,e];if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);let r=Math.max(e.length,H.length);return Array.from({length:r},(n,o)=>e[o])},jg=e=>H.some(t=>e[t]!==void 0),yl=(e,t)=>Array.isArray(e)?e.map(r=>yl(r,t)):e??(t>=H.length?"ignore":"pipe"),Ug=(e,t,r)=>e.map((n,o)=>!t[o]&&o!==0&&!Me(r,o)&&Gg(n)?"ignore":n),Gg=e=>e==="pipe"||Array.isArray(e)&&e.every(t=>t==="pipe");import{readFileSync as Vg}from"fs";import Wg from"tty";var Sl=({stdioItem:e,stdioItem:{type:t},isStdioArray:r,fdNumber:n,direction:o,isSync:i})=>!r||t!=="native"?e:i?Hg({stdioItem:e,fdNumber:n,direction:o}):Yg({stdioItem:e,fdNumber:n}),Hg=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n,direction:o})=>{let i=zg({value:t,optionName:r,fdNumber:n,direction:o});if(i!==void 0)return i;if(Z(t,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return e},zg=({value:e,optionName:t,fdNumber:r,direction:n})=>{let o=qg(e,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:t};if(Wg.isatty(o))throw new TypeError(`The \`${t}: ${er(e)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:ue(Vg(o)),optionName:t}}},qg=(e,t)=>{if(e==="inherit")return t;if(typeof e=="number")return e;let r=kt.indexOf(e);if(r!==-1)return r},Yg=({stdioItem:e,stdioItem:{value:t,optionName:r},fdNumber:n})=>t==="inherit"?{type:"nodeStream",value:bl(n,t,r),optionName:r}:typeof t=="number"?{type:"nodeStream",value:bl(t,t,r),optionName:r}:Z(t,{checkOpen:!1})?{type:"nodeStream",value:t,optionName:r}:e,bl=(e,t,r)=>{let n=kt[e];if(n===void 0)throw new TypeError(`The \`${r}: ${t}\` option is invalid: no such standard stream.`);return n};var wl=({input:e,inputFile:t},r)=>r===0?[...Kg(e),...Xg(t)]:[],Kg=e=>e===void 0?[]:[{type:Jg(e),value:e,optionName:"input"}],Jg=e=>{if(_e(e,{checkOpen:!1}))return"nodeStream";if(typeof e=="string")return"string";if(R(e))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Xg=e=>e===void 0?[]:[{...Zg(e),optionName:"inputFile"}],Zg=e=>{if($r(e))return{type:"fileUrl",value:e};if(lo(e))return{type:"filePath",value:{file:e}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var xl=e=>e.filter((t,r)=>e.every((n,o)=>t.value!==n.value||r>=o||t.type==="generator"||t.type==="asyncGenerator")),El=({stdioItem:{type:e,value:t,optionName:r},direction:n,fileDescriptors:o,isSync:i})=>{let s=Qg(o,e);if(s.length!==0){if(i){ey({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});return}if(ll.has(e))return $l({otherStdioItems:s,type:e,value:t,optionName:r,direction:n});ul.has(e)&&ry({otherStdioItems:s,type:e,value:t,optionName:r})}},Qg=(e,t)=>e.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===t).map((o=>({...o,direction:r})))),ey=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{po.has(t)&&$l({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})},$l=({otherStdioItems:e,type:t,value:r,optionName:n,direction:o})=>{let i=e.filter(a=>ty(a,r));if(i.length===0)return;let s=i.find(a=>a.direction!==o);return _l(s,n,t),o==="output"?i[0].stream:void 0},ty=({type:e,value:t},r)=>e==="filePath"?t.file===r.file:e==="fileUrl"?t.href===r.href:t===r,ry=({otherStdioItems:e,type:t,value:r,optionName:n})=>{let o=e.find(({value:{transform:i}})=>i===r.transform);_l(o,n,t)},_l=(e,t,r)=>{if(e!==void 0)throw new TypeError(`The \`${e.optionName}\` and \`${t}\` options must not target ${be[r]} that is the same.`)};var Ar=(e,t,r,n)=>{let i=gl(t,r,n).map((a,c)=>ny({stdioOption:a,fdNumber:c,options:t,isSync:n})),s=py({initialFileDescriptors:i,addProperties:e,options:t,isSync:n});return t.stdio=s.map(({stdioItems:a})=>fy(a)),s},ny=({stdioOption:e,fdNumber:t,options:r,isSync:n})=>{let o=Bt(t),{stdioItems:i,isStdioArray:s}=oy({stdioOption:e,fdNumber:t,options:r,optionName:o}),a=ml(i,t,o),c=i.map(p=>Sl({stdioItem:p,isStdioArray:s,fdNumber:t,direction:a,isSync:n})),u=dl(c,o,a,r),l=pl(u,a);return uy(u,l),{direction:a,objectMode:l,stdioItems:u}},oy=({stdioOption:e,fdNumber:t,options:r,optionName:n})=>{let i=[...(Array.isArray(e)?e:[e]).map(c=>iy(c,n)),...wl(r,t)],s=xl(i),a=s.length>1;return sy(s,a,n),cy(s),{stdioItems:s,isStdioArray:a}},iy=(e,t)=>({type:tl(e,t),value:e,optionName:t}),sy=(e,t,r)=>{if(e.length===0)throw new TypeError(`The \`${r}\` option must not be an empty array.`);if(t){for(let{value:n,optionName:o}of e)if(ay.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},ay=new Set(["ignore","ipc"]),cy=e=>{for(let t of e)ly(t)},ly=({type:e,value:t,optionName:r})=>{if(il(t))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
114
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(sl(e,t))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},uy=(e,t)=>{if(!t)return;let r=e.find(({type:n})=>Cr.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},py=({initialFileDescriptors:e,addProperties:t,options:r,isSync:n})=>{let o=[];try{for(let i of e)o.push(dy({fileDescriptor:i,fileDescriptors:o,addProperties:t,options:r,isSync:n}));return o}catch(i){throw go(o),i}},dy=({fileDescriptor:{direction:e,objectMode:t,stdioItems:r},fileDescriptors:n,addProperties:o,options:i,isSync:s})=>{let a=r.map(c=>my({stdioItem:c,addProperties:o,direction:e,options:i,fileDescriptors:n,isSync:s}));return{direction:e,objectMode:t,stdioItems:a}},my=({stdioItem:e,addProperties:t,direction:r,options:n,fileDescriptors:o,isSync:i})=>{let s=El({stdioItem:e,direction:r,fileDescriptors:o,isSync:i});return s!==void 0?{...e,stream:s}:{...e,...t[r][e.type](e,n)}},go=e=>{for(let{stdioItems:t}of e)for(let{stream:r}of t)r!==void 0&&!K(r)&&r.destroy()},fy=e=>{if(e.length>1)return e.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:t,value:r}]=e;return t==="native"?r:"pipe"};var Ol=(e,t)=>Ar(gy,e,t,!0),oe=({type:e,optionName:t})=>{vl(t,be[e])},hy=({optionName:e,value:t})=>((t==="ipc"||t==="overlapped")&&vl(e,`"${t}"`),{}),vl=(e,t)=>{throw new TypeError(`The \`${e}\` option cannot be ${t} with synchronous methods.`)},Al={generator(){},asyncGenerator:oe,webStream:oe,nodeStream:oe,webTransform:oe,duplex:oe,asyncIterable:oe,native:hy},gy={input:{...Al,fileUrl:({value:e})=>({contents:[ue(Cl(e))]}),filePath:({value:{file:e}})=>({contents:[ue(Cl(e))]}),fileNumber:oe,iterable:({value:e})=>({contents:[...e]}),string:({value:e})=>({contents:[e]}),uint8Array:({value:e})=>({contents:[e]})},output:{...Al,fileUrl:({value:e})=>({path:e}),filePath:({value:{file:e,append:t}})=>({path:e,append:t}),fileNumber:({value:e})=>({path:e}),iterable:oe,string:oe,uint8Array:oe}};var me=(e,{stripFinalNewline:t},r)=>yo(t,r)&&e!==void 0&&!Array.isArray(e)?je(e):e,yo=(e,t)=>t==="all"?e[1]||e[2]:e[t];import{Transform as By,getDefaultHighWaterMark as Nl}from"stream";var Or=(e,t,r,n)=>e||r?void 0:Il(t,n),So=(e,t,r)=>r?e.flatMap(n=>Tl(n,t)):Tl(e,t),Tl=(e,t)=>{let{transform:r,final:n}=Il(t,{});return[...r(e),...n()]},Il=(e,t)=>(t.previousChunks="",{transform:yy.bind(void 0,t,e),final:Sy.bind(void 0,t)}),yy=function*(e,t,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=e,o=-1;for(let i=0;i<r.length;i+=1)if(r[i]===`
|
|
115
|
+
`){let s=by(r,i,t,e),a=r.slice(o+1,i+1-s);n.length>0&&(a=bo(n,a),n=""),yield a,o=i}o!==r.length-1&&(n=bo(n,r.slice(o+1))),e.previousChunks=n},by=(e,t,r,n)=>r?0:(n.isWindowsNewline=t!==0&&e[t-1]==="\r",n.isWindowsNewline?2:1),Sy=function*({previousChunks:e}){e.length>0&&(yield e)},Dl=({binary:e,preserveNewlines:t,readableObjectMode:r,state:n})=>e||t||r?void 0:{transform:wy.bind(void 0,n)},wy=function*({isWindowsNewline:e=!1},t){let{unixNewline:r,windowsNewline:n,LF:o,concatBytes:i}=typeof t=="string"?xy:$y;if(t.at(-1)===o){yield t;return}yield i(t,e?n:r)},bo=(e,t)=>`${e}${t}`,xy={windowsNewline:`\r
|
|
115
116
|
`,unixNewline:`
|
|
116
117
|
`,LF:`
|
|
117
|
-
`,concatBytes:
|
|
118
|
+
`,concatBytes:bo},Ey=(e,t)=>{let r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r},$y={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Ey};import{Buffer as _y}from"buffer";var Fl=(e,t)=>e?void 0:Cy.bind(void 0,t),Cy=function*(e,t){if(typeof t!="string"&&!R(t)&&!_y.isBuffer(t))throw new TypeError(`The \`${e}\` option's transform must use "objectMode: true" to receive as input: ${typeof t}.`);yield t},Rl=(e,t)=>e?Ay.bind(void 0,t):Oy.bind(void 0,t),Ay=function*(e,t){Ml(e,t),yield t},Oy=function*(e,t){if(Ml(e,t),typeof t!="string"&&!R(t))throw new TypeError(`The \`${e}\` option's function must yield a string or an Uint8Array, not ${typeof t}.`);yield t},Ml=(e,t)=>{if(t==null)throw new TypeError(`The \`${e}\` option's function must not call \`yield ${t}\`.
|
|
118
119
|
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
119
|
-
if (condition) { yield value; }`)};import{Buffer as dg}from"buffer";import{StringDecoder as Dg}from"string_decoder";var yr=(t,e,r)=>{if(r)return;if(t)return{transform:mg.bind(void 0,new TextEncoder)};let n=new Dg(e);return{transform:fg.bind(void 0,n),final:hg.bind(void 0,n)}},mg=function*(t,e){dg.isBuffer(e)?yield te(e):typeof e=="string"?yield t.encode(e):yield e},fg=function*(t,e){yield _(e)?t.write(e):e},hg=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as Fc}from"util";var lo=Fc(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),Er=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=bg}=e[r];for await(let o of n(t))yield*Er(o,e,r+1)},Sc=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*gg(r,Number(e),t)},gg=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Er(n,r,e+1)},xc=Fc(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),bg=function*(t){yield t};var po=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},Ac=(t,e)=>[...e.flatMap(r=>[...ye(r,t,0)]),...nt(t)],ye=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=yg}=e[r];for(let o of n(t))yield*ye(o,e,r+1)},nt=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*Cg(r,Number(e),t)},Cg=function*(t,e,r){if(t!==void 0)for(let n of t())yield*ye(n,r,e+1)},yg=function*(t){yield t};var Do=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=$c(t,i,s),c=Ce(e),l=Ce(r),p=c?lo.bind(void 0,Er,a):po.bind(void 0,ye),d=c||l?lo.bind(void 0,Sc,a):po.bind(void 0,nt),D=c||l?xc.bind(void 0,a):void 0;return{stream:new Eg({writableObjectMode:n,writableHighWaterMark:Oc(n),readableObjectMode:o,readableHighWaterMark:Oc(o),transform(g,E,C){p([g,u,0],this,C)},flush(g){d([u],this,g)},destroy:D})}},wr=(t,e,r,n)=>{let o=e.filter(({type:i})=>i==="generator"),s=n?o.reverse():o;for(let{value:i,optionName:a}of s){let u=$c(i,r,a);t=Ac(u,t)}return t},$c=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:yc(n,a)},yr(r,i,n),Cr(r,s,n,u),{transform:t,final:e},{transform:Ec(o,a)},Cc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var Bc=(t,e)=>{for(let r of wg(t))Fg(t,r,e)},wg=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Fg=(t,e,r)=>{let{stdioItems:n}=t[e],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(e!==0){let[{type:a,optionName:u}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${de[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>Sg(a,n));r.input=qe(i)},Sg=(t,e)=>{let r=wr(t,e,"utf8",!0);return xg(r),qe(r)},xg=t=>{let e=t.find(r=>typeof r!="string"&&!_(r));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)};import{writeFileSync as Bg,appendFileSync as _g}from"fs";var Fr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&Oe(r,n)&&!P.has(e)&&Ag(n)&&(t.some(({type:o,value:s})=>o==="native"&&Og.has(s))||t.every(({type:o})=>j.has(o))),Ag=t=>t===1||t===2,Og=new Set(["pipe","overlapped"]),_c=async(t,e,r,n)=>{for await(let o of t)$g(e)||Tc(o,r,n)},vc=(t,e,r)=>{for(let n of t)Tc(n,e,r)},$g=t=>t._readableState.pipes.length>0,Tc=(t,e,r)=>{let n=Mt(t);K({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var Ic=({fileDescriptors:t,syncResult:{output:e},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(e===null)return{output:Array.from({length:3})};let s={},i=new Set([]);return{output:e.map((u,c)=>vg({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},vg=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:p})=>{if(t===null)return;let d=Ru(t,s,p),D=te(d),{stdioItems:f,objectMode:g}=e[r],E=Tg([D],f,u,n),{serializedResult:C,finalResult:O=C}=Ig({chunks:E,objectMode:g,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});Rg({serializedResult:C,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:f,objectMode:g});let v=a[r]?O:void 0;try{return n.error===void 0&&Mg(C,f,o),v}catch(y){return n.error=y,v}},Tg=(t,e,r,n)=>{try{return wr(t,e,r,!1)}catch(o){return n.error=o,t}},Ig=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:qe(t)};let i=Yi(t,r);return n[s]?{serializedResult:i,finalResult:co(i,!o[s],e)}:{serializedResult:i}},Rg=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!Fr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=co(t,!1,i);try{vc(a,e,n)}catch(u){r.error??=u}},Mg=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>gr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?_g(n,t):(r.add(s),Bg(n,t))}};var Rc=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,oe(e,r,"all")]:Array.isArray(e)?[oe(t,r,"all"),...e]:_(t)&&_(e)?bn([t,e]):`${t}${e}`};import{once as mo}from"events";var Mc=async(t,e)=>{let[r,n]=await Pg(t);return e.isForcefullyTerminated??=!1,[r,n]},Pg=async t=>{let[e,r]=await Promise.allSettled([mo(t,"spawn"),mo(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?Pc(t):r.value},Pc=async t=>{try{return await mo(t,"exit")}catch{return Pc(t)}},kc=async t=>{let[e,r]=await t;if(!kg(e,r)&&fo(e,r))throw new G;return[e,r]},kg=(t,e)=>t===void 0&&e===void 0,fo=(t,e)=>t!==0||e!==null;var Lc=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=Lg(t,e,r),i=s?.code==="ETIMEDOUT",a=Iu(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},Lg=(t,e,r)=>t!==void 0?t:fo(e,r)?new G:void 0;var jc=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=Ng(t,e,r),p=Gg({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Pe(p,u,c)},Ng=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=kt(t,e,r),a=Ug(r),{file:u,commandArguments:c,options:l}=or(t,e,a);Vg(l);let p=fc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},Ug=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Vg=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&Sr("ipcInput"),t&&Sr("ipc: true"),r&&Sr("detached: true"),n&&Sr("cancelSignal")},Sr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},Gg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=Wg({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:a});if(u.failed)return u;let{resultError:c,exitCode:l,signal:p,timedOut:d,isMaxBuffer:D}=Lc(u,r),{output:f,error:g=c}=Ic({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:D,verboseInfo:s}),E=f.map((O,v)=>oe(O,r,v)),C=oe(Rc(f,r),r,"all");return zg({error:g,exitCode:l,signal:p,timedOut:d,isMaxBuffer:D,stdio:E,all:C,options:r,command:n,escapedCommand:o,startTime:a})},Wg=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{Bc(s,r);let a=Hg(r);return jg(...ir(t,e,a))}catch(a){return Me({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},Hg=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Dr(e)}),zg=({error:t,exitCode:e,signal:r,timedOut:n,isMaxBuffer:o,stdio:s,all:i,options:a,command:u,escapedCommand:c,startTime:l})=>t===void 0?mr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):rt({error:t,command:u,escapedCommand:c,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:e,signal:r,stdio:s,all:i,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as IC}from"events";import{spawn as RC}from"child_process";import Wc from"process";import{once as ho,on as qg}from"events";var Nc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(_e({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:Zt(t)}),Yg({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),Yg=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{Yt(e,o);let s=pe(t,e,r),i=new AbortController;try{return await Promise.race([Kg(s,n,i),Jg(s,r,i),Xg(s,r,i)])}catch(a){throw ve(t),a}finally{i.abort(),Kt(e,o)}},Kg=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await ho(t,"message",{signal:r});return n}for await(let[n]of qg(t,"message",{signal:r}))if(e(n))return n},Jg=async(t,e,{signal:r})=>{await ho(t,"disconnect",{signal:r}),Aa(e)},Xg=async(t,e,{signal:r})=>{let[n]=await ho(t,"strict:error",{signal:r});throw Ht(n,e)};import{once as Vc,on as Zg}from"events";var Gc=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>go({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),go=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{_e({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:Zt(t)}),Yt(e,s);let i=pe(t,e,r),a=new AbortController,u={};return Qg(t,i,a),eb({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),tb({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},Qg=async(t,e,r)=>{try{await Vc(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},eb=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Vc(t,"strict:error",{signal:r.signal});n.error=Ht(o,e),r.abort()}catch{}},tb=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of Zg(r,"message",{signal:s.signal}))Uc(i),yield u}catch{Uc(i)}finally{s.abort(),Kt(e,a),n||ve(t),o&&await t}},Uc=({error:t})=>{if(t)throw t};var Hc=(t,{ipc:e})=>{Object.assign(t,qc(t,!1,e))},zc=()=>{let t=Wc,e=!0,r=Wc.channel!==void 0;return{...qc(t,e,r),getCancelSignal:Qa.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},qc=(t,e,r)=>({sendMessage:rr.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:Nc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:Gc.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as rb}from"child_process";import{PassThrough as nb,Readable as ob,Writable as ib,Duplex as sb}from"stream";var Yc=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{so(n);let a=new rb;ab(a,n),Object.assign(a,{readable:ub,writable:cb,duplex:lb});let u=Me({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=pb(u,i,o);return{subprocess:a,promise:c}},ab=(t,e)=>{let r=ot(),n=ot(),o=ot(),s=Array.from({length:e.length-3},ot),i=ot(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},ot=()=>{let t=new nb;return t.end(),t},ub=()=>new ob({read(){}}),cb=()=>new ib({write(){}}),lb=()=>new sb({read(){},write(){}}),pb=async(t,e,r)=>Pe(t,e,r);import{createReadStream as Kc,createWriteStream as Jc}from"fs";import{Buffer as db}from"buffer";import{Readable as it,Writable as Db,Duplex as mb}from"stream";var Zc=(t,e)=>br(fb,t,e,!1),st=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${de[t]}.`)},Xc={fileNumber:st,generator:Do,asyncGenerator:Do,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:mb.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},fb={input:{...Xc,fileUrl:({value:t})=>({stream:Kc(t)}),filePath:({value:{file:t}})=>({stream:Kc(t)}),webStream:({value:t})=>({stream:it.fromWeb(t)}),iterable:({value:t})=>({stream:it.from(t)}),asyncIterable:({value:t})=>({stream:it.from(t)}),string:({value:t})=>({stream:it.from(t)}),uint8Array:({value:t})=>({stream:it.from(db.from(t))})},output:{...Xc,fileUrl:({value:t})=>({stream:Jc(t)}),filePath:({value:{file:t,append:e}})=>({stream:Jc(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:Db.fromWeb(t)}),iterable:st,asyncIterable:st,string:st,uint8Array:st}};import{on as hb,once as Qc}from"events";import{PassThrough as gb,getDefaultHighWaterMark as bb}from"stream";import{finished as rl}from"stream/promises";function Ee(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)Co(o);let e=t.some(({readableObjectMode:o})=>o),r=Cb(t,e),n=new bo({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var Cb=(t,e)=>{if(t.length===0)return bb(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},bo=class extends gb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(Co(e),this.#t.has(e))return;this.#t.add(e),this.#n??=yb(this,this.#t,this.#i);let r=Fb({passThroughStream:this,stream:e,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(e,r),e.pipe(this,{end:!1})}async remove(e){if(Co(e),!this.#t.has(e))return!1;let r=this.#o.get(e);return r===void 0?!1:(this.#o.delete(e),e.unpipe(this),await r,!0)}},yb=async(t,e,r)=>{xr(t,el);let n=new AbortController;try{await Promise.race([Eb(t,n),wb(t,e,r,n)])}finally{n.abort(),xr(t,-el)}},Eb=async(t,{signal:e})=>{try{await rl(t,{signal:e,cleanup:!0})}catch(r){throw nl(t,r),r}},wb=async(t,e,r,{signal:n})=>{for await(let[o]of hb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},Co=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Fb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{xr(t,tl);let a=new AbortController;try{await Promise.race([Sb(s,e,a),xb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),Ab({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),xr(t,-tl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?yo(t):Ob(t))},Sb=async(t,e,{signal:r})=>{try{await t,r.aborted||yo(e)}catch(n){r.aborted||nl(e,n)}},xb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await rl(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;ol(i)?o.add(e):il(t,i)}},Ab=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await Qc(t,o,{signal:s}),!t.readable)return Qc(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},Ob=t=>{t.writable&&t.end()},nl=(t,e)=>{ol(e)?yo(t):il(t,e)},ol=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",yo=t=>{(t.readable||t.writable)&&t.destroy()},il=(t,e)=>{t.destroyed||(t.once("error",$b),t.destroy(e))},$b=()=>{},xr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},el=2,tl=1;import{finished as sl}from"stream/promises";var Le=(t,e)=>{t.pipe(e),Bb(t,e),_b(t,e)},Bb=async(t,e)=>{if(!(V(t)||V(e))){try{await sl(t,{cleanup:!0,readable:!0,writable:!1})}catch{}Eo(e)}},Eo=t=>{t.writable&&t.end()},_b=async(t,e)=>{if(!(V(t)||V(e))){try{await sl(e,{cleanup:!0,readable:!1,writable:!0})}catch{}wo(t)}},wo=t=>{t.readable&&t.destroy()};var al=(t,e,r)=>{let n=new Map;for(let[o,{stdioItems:s,direction:i}]of Object.entries(e)){for(let{stream:a}of s.filter(({type:u})=>j.has(u)))vb(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!j.has(u)))Ib({subprocess:t,stream:a,direction:i,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,s]of n.entries()){let i=s.length===1?s[0]:Ee(s);Le(i,o)}},vb=(t,e,r,n)=>{r==="output"?Le(t.stdio[n],e):Le(e,t.stdio[n]);let o=Tb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},Tb=["stdin","stdout","stderr"],Ib=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;Rb(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},Rb=(t,{signal:e})=>{V(t)&&ge(t,Mb,e)},Mb=2;import{addAbortListener as Lb}from"events";var we=[];we.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&we.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&we.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Ar=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",Fo=Symbol.for("signal-exit emitter"),So=globalThis,Pb=Object.defineProperty.bind(Object),xo=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(So[Fo])return So[Fo];Pb(So,Fo,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,r){this.listeners[e].push(r)}removeListener(e,r){let n=this.listeners[e],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(e,r,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let o=!1;for(let s of this.listeners[e])o=s(r,n)===!0||o;return e==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Or=class{},kb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Ao=class extends Or{onExit(){return()=>{}}load(){}unload(){}},Oo=class extends Or{#t=$o.platform==="win32"?"SIGINT":"SIGHUP";#r=new xo;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of we)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(o+=s.__signal_exit_emitter__.count),n.length===o){this.unload();let i=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;i||e.kill(e.pid,a)}};this.#i=e.reallyExit,this.#n=e.emit}onExit(e,r){if(!Ar(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let e of we)try{let r=this.#o[e];r&&this.#e.on(e,r)}catch{}this.#e.emit=(e,...r)=>this.#u(e,...r),this.#e.reallyExit=e=>this.#a(e)}}unload(){this.#s&&(this.#s=!1,we.forEach(e=>{let r=this.#o[e];if(!r)throw new Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(e){return Ar(this.#e)?(this.#e.exitCode=e||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#u(e,...r){let n=this.#n;if(e==="exit"&&Ar(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,e,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,e,...r)}},$o=globalThis.process,{onExit:ul,load:z3,unload:q3}=kb(Ar($o)?new Oo($o):new Ao);var cl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=ul(()=>{t.kill()});Lb(n,()=>{o()})};var pl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=Pt(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=jb(r,n,o),{sourceStream:p,sourceError:d}=Ub(t,c),{options:D,fileDescriptors:f}=X.get(t);return{sourcePromise:e,sourceStream:p,sourceOptions:D,sourceError:d,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:f,startTime:s}},jb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=Nb(t,e,...r),a=qt(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},Nb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(ll,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||hn(r)){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,s,i]=At(r,...n);return{destination:e(ll)(o,s,i),pipeOptions:i}}if(X.has(r)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},ll=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),Ub=(t,e)=>{try{return{sourceStream:Te(t,e)}}catch(r){return{sourceError:r}}};var Dl=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=Vb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw Bo({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},Vb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return wo(t),n;if(e!==void 0)return Eo(r),e},Bo=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Me({error:t,command:dl,escapedCommand:dl,fileDescriptors:e,options:r,startTime:n,isSync:!1}),dl="source.pipe(destination)";var ml=async t=>{let[{status:e,reason:r,value:n=r},{status:o,reason:s,value:i=s}]=await t;if(i.pipedFrom.includes(n)||i.pipedFrom.push(n),o==="rejected")throw i;if(e==="rejected")throw n;return i};import{finished as Gb}from"stream/promises";var fl=(t,e,r)=>{let n=$r.has(e)?Hb(t,e):Wb(t,e);return ge(t,qb,r.signal),ge(e,Yb,r.signal),zb(e),n},Wb=(t,e)=>{let r=Ee([t]);return Le(r,e),$r.set(e,r),r},Hb=(t,e)=>{let r=$r.get(e);return r.add(t),r},zb=async t=>{try{await Gb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}$r.delete(t)},$r=new WeakMap,qb=2,Yb=1;import{aborted as Kb}from"util";var hl=(t,e)=>t===void 0?[]:[Jb(t,e)],Jb=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await Kb(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw Bo({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var Br=(t,...e)=>{if(A(e[0]))return Br.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=pl(t,...e),o=Xb({...n,destination:r});return o.pipe=Br.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},Xb=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=Zb(t,o);Dl({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let p=new AbortController;try{let d=fl(e,s,p);return await Promise.race([ml(l),...hl(a,{sourceStream:e,mergedStream:d,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{p.abort()}},Zb=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as iC}from"timers/promises";import{on as Qb}from"events";import{getDefaultHighWaterMark as eC}from"stream";var _r=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return tC(e,i),bl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},tC=async(t,e)=>{try{await t}catch{}finally{e.abort()}},_o=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;rC(e,i,t);let a=t.readableObjectMode&&!s;return bl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},rC=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},bl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=Qb(t,"data",{signal:e.signal,highWaterMark:gl,highWatermark:gl});return nC({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},vo=eC(!0),gl=vo,nC=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=oC({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*ye(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*nt(a)}},oC=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[yr(t,r,!e),Cr(t,o,!n,{})].filter(Boolean);var Cl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let p=sC({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([aC(t),p]);return}let d=ao(u,r),D=_o({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:d,allMixed:a}),[f]=await Promise.all([uC({stream:t,iterable:D,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),p]);return f},sC=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!Fr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=_o({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await _c(a,t,r,s)},aC=async t=>{await iC(),t.readableFlowing===null&&t.resume()},uC=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await cr(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await lr(r,{maxBuffer:s})):await dr(r,{maxBuffer:s})}catch(a){return yl(_u({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},To=async t=>{try{return await t}catch(e){return yl(e)}},yl=({bufferedData:t})=>zi(t)?new Uint8Array(t):t;import{finished as cC}from"stream/promises";var at=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=lC(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],cC(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||DC(a,e,r,n)}finally{i.abort()}},lC=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&pC(t,r,n),n},pC=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{dC(e,r),n.call(t,...o)}},dC=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},DC=(t,e,r,n)=>{if(!mC(t,e,r,n))throw t},mC=(t,e,r,n=!0)=>r.propagating?El(t)||vr(t):(r.propagating=!0,Io(r,e)===n?El(t):vr(t)),Io=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",vr=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",El=t=>t?.code==="EPIPE";var wl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>Ro({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),Ro=async({stream:t,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c})=>{if(!t)return;let l=at(t,e,c);if(Io(c,e)){await l;return}let[p]=await Promise.all([Cl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return p};var Fl=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ee([t,e].filter(Boolean)):void 0,Sl=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>Ro({...fC(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:hC(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),fC=({stdout:t,stderr:e,all:r},[,n,o])=>{let s=n||o;return s?n?o?{stream:r,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:r,buffer:s}},hC=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as gC}from"events";var xl=t=>Oe(t,"ipc"),Al=(t,e)=>{let r=Mt(t);K({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var Ol=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=xl(s),a=re(e,"ipc"),u=re(r,"ipc");for await(let c of go({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(vu(t,o,u),o.push(c)),i&&Al(c,s);return o},$l=async(t,e)=>(await Promise.allSettled([t]),e);var Bl=async({subprocess:t,options:{encoding:e,buffer:r,maxBuffer:n,lines:o,timeoutDuration:s,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:p},context:d,verboseInfo:D,fileDescriptors:f,originalStreams:g,onInternalError:E,controller:C})=>{let O=Mc(t,d),v={originalStreams:g,fileDescriptors:f,subprocess:t,exitPromise:O,propagating:!1},y=wl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:D,streamInfo:v}),F=Sl({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:D,streamInfo:v}),B=[],I=Ol({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:B,verboseInfo:D}),se=bC(g,t,v),ae=CC(f,v);try{return await Promise.race([Promise.all([{},kc(O),Promise.all(y),F,I,cu(t,p),...se,...ae]),E,yC(t,C),...ou(t,s,d,C),...xa({subprocess:t,cancelSignal:i,gracefulCancel:a,context:d,controller:C}),...ru({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:d,controller:C})])}catch(Lr){return d.terminationReason??="other",Promise.all([{error:Lr},O,Promise.all(y.map(Ue=>To(Ue))),To(F),$l(I,B),Promise.allSettled(se),Promise.allSettled(ae)])}},bC=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:at(n,o,r)),CC=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>H(s,{checkOpen:!1})&&!V(s)).map(({type:o,value:s,stream:i=s})=>at(i,n,e,{isSameDirection:j.has(o),stopOnExit:o==="native"}))),yC=async(t,{signal:e})=>{let[r]=await gC(t,"error",{signal:e});throw r};var _l=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ut=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=J();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},je=async({resolve:t,promises:e},r)=>{t();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...e])]);return!n};import{Readable as EC}from"stream";import{callbackify as wC}from"util";import{finished as vl}from"stream/promises";var Mo=async t=>{if(t!==void 0)try{await Po(t)}catch{}},Tl=async t=>{if(t!==void 0)try{await ko(t)}catch{}},Po=async t=>{await vl(t,{cleanup:!0,readable:!1,writable:!0})},ko=async t=>{await vl(t,{cleanup:!0,readable:!0,writable:!1})},Tr=async(t,e)=>{if(await t,e)throw e},Ir=(t,e,r)=>{r&&!vr(r)?t.destroy(r):e&&t.destroy()};var Il=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||P.has(r),{subprocessStdout:a,waitReadableDestroy:u}=Lo(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:p}=jo(a,i),{read:d,onStdoutDataDone:D}=No({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),f=new EC({read:d,destroy:wC(Vo.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:p,objectMode:l,encoding:c});return Uo({subprocessStdout:a,onStdoutDataDone:D,readable:f,subprocess:t}),f},Lo=(t,e,r)=>{let n=Te(t,e),o=ut(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},jo=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:vo},No=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=J(),i=_r({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){FC(this,i,s)},onStdoutDataDone:s}},FC=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},Uo=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await ko(t),await n,await Mo(o),await e,r.readable&&r.push(null)}catch(s){await Mo(o),Rl(r,s)}},Vo=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await je(r,e)&&(Rl(t,n),await Tr(e,n))},Rl=(t,e)=>{Ir(t,t.readable,e)};import{Writable as SC}from"stream";import{callbackify as Ml}from"util";var Pl=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=Go(t,r,e),i=new SC({...Wo(n,t,o),destroy:Ml(zo.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return Ho(n,i),i},Go=(t,e,r)=>{let n=qt(t,e),o=ut(r,n,"writableFinal"),s=ut(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},Wo=(t,e,r)=>({write:xC.bind(void 0,t),final:Ml(AC.bind(void 0,t,e,r))}),xC=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},AC=async(t,e,r)=>{await je(r,e)&&(t.writable&&t.end(),await e)},Ho=async(t,e,r)=>{try{await Po(t),e.writable&&e.end()}catch(n){await Tl(r),kl(e,n)}},zo=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await je(r,e),await je(n,e)&&(kl(t,o),await Tr(e,o))},kl=(t,e)=>{Ir(t,t.writable,e)};import{Duplex as OC}from"stream";import{callbackify as $C}from"util";var Ll=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||P.has(r),{subprocessStdout:u,waitReadableDestroy:c}=Lo(t,n,e),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:d}=Go(t,o,e),{readableEncoding:D,readableObjectMode:f,readableHighWaterMark:g}=jo(u,a),{read:E,onStdoutDataDone:C}=No({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),O=new OC({read:E,...Wo(l,t,p),destroy:$C(BC.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:p,waitWritableDestroy:d})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:f,writableObjectMode:l.writableObjectMode,encoding:D});return Uo({subprocessStdout:u,onStdoutDataDone:C,readable:O,subprocess:t,subprocessStdin:l}),Ho(l,O,u),O},BC=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([Vo({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),zo({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var qo=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||P.has(e),i=Te(t,r),a=_r({subprocessStdout:i,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:o});return _C(a,i,t)},_C=async function*(t,e,r){try{yield*t}finally{e.readable&&e.destroy(),await r}};var jl=(t,{encoding:e})=>{let r=_l();t.readable=Il.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=Pl.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Ll.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=qo.bind(void 0,t,e),t[Symbol.asyncIterator]=qo.bind(void 0,t,e,{})};var Nl=(t,e)=>{for(let[r,n]of TC){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},vC=(async()=>{})().constructor.prototype,TC=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(vC,t)]);var Ul=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:p}=MC(t,e,r),{subprocess:d,promise:D}=kC({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:p});return d.pipe=Br.bind(void 0,{source:d,sourcePromise:D,boundOptions:{},createNested:n}),Nl(d,D),X.set(d,{options:l,fileDescriptors:p}),d},MC=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=kt(t,e,r),{file:a,commandArguments:u,options:c}=or(t,e,r),l=PC(c),p=Zc(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:p}},PC=({timeout:t,signal:e,...r})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:t}},kC=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=RC(...ir(t,e,r))}catch(f){return Yc({error:f,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;IC(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];al(u,a,c),cl(u,r,c);let p={},d=J();u.kill=Fa.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:d,context:p,controller:c}),u.all=Fl(u,r),jl(u,r),Hc(u,r);let D=LC({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:p,onInternalError:d,controller:c});return{subprocess:u,promise:D}},LC=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[p,[d,D],f,g,E]=await Bl({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let C=f.map((y,F)=>oe(y,e,F)),O=oe(g,e,"all"),v=jC({errorInfo:p,exitCode:d,signal:D,stdio:C,all:O,ipcOutput:E,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Pe(v,n,e)},jC=({errorInfo:t,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,context:i,options:a,command:u,escapedCommand:c,startTime:l})=>"error"in t?rt({error:t.error,command:u,escapedCommand:c,timedOut:i.terminationReason==="timeout",isCanceled:i.terminationReason==="cancel"||i.terminationReason==="gracefulCancel",isGracefullyCanceled:i.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Z,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):mr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var Rr=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,NC(n,t[n],o)]));return{...t,...r}},NC=(t,e,r)=>UC.has(t)&&A(e)&&A(r)?{...e,...r}:r,UC=new Set(["env",...wn]);var De=(t,e,r,n)=>{let o=(i,a,u)=>De(i,a,r,u),s=(...i)=>VC({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},VC=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(A(s))return o(t,Rr(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=GC({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?jc(a,u,c):Ul(a,u,c,o)},GC=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=Zi(e)?Qi(e,r):[e,...r],[i,a,u]=At(...s),c=Rr(Rr(n,o),u),{file:l=i,commandArguments:p=a,options:d=c,isSync:D=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:p,options:d,isSync:D}};var Vl=({file:t,commandArguments:e})=>Wl(t,e),Gl=({file:t,commandArguments:e})=>({...Wl(t,e),isSync:!0}),Wl=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);let[r,...n]=WC(t);return{file:r,commandArguments:n}},WC=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);let e=t.trim();if(e==="")return[];let r=[];for(let n of e.split(HC)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},HC=/ +/g;var Hl=(t,e,r)=>{t.sync=e(zC,r),t.s=t.sync},zl=({options:t})=>ql(t),zC=({options:t})=>({...ql(t),isSync:!0}),ql=t=>({options:{...qC(t),...t}}),qC=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Yl={preferLocal:!0};var me=De(()=>({})),P8=De(()=>({isSync:!0})),Kl=De(Vl),k8=De(Gl),L8=De(su),j8=De(zl,{},Yl,Hl),{sendMessage:N8,getOneMessage:U8,getEachMessage:V8,getCancelSignal:G8}=zc();var Jl="https://github.com/spree/storefront.git",Xl="https://github.com/spree/spree-starter.git",Mr="spree@example.com",Pr="spree123";import YC from"crypto";function Zl(){let t=process.env.npm_config_user_agent??"";return t.startsWith("yarn")?"yarn":t.startsWith("pnpm")?"pnpm":"npm"}async function Ql(){try{return await Kl("docker info",{stdio:"ignore"}),!0}catch{return!1}}function ep(){return YC.randomBytes(64).toString("hex")}function Yo(t){return t==="yarn"?"yarn":`${t} install`}function tp(t,e){return`SECRET_KEY_BASE=${t}
|
|
120
|
-
SPREE_PORT=${
|
|
120
|
+
if (condition) { yield value; }`)};import{Buffer as vy}from"buffer";import{StringDecoder as Ty}from"string_decoder";var vr=(e,t,r)=>{if(r)return;if(e)return{transform:Iy.bind(void 0,new TextEncoder)};let n=new Ty(t);return{transform:Dy.bind(void 0,n),final:Fy.bind(void 0,n)}},Iy=function*(e,t){vy.isBuffer(t)?yield ue(t):typeof t=="string"?yield e.encode(t):yield t},Dy=function*(e,t){yield R(t)?e.write(t):t},Fy=function*(e){let t=e.end();t!==""&&(yield t)};import{callbackify as Pl}from"util";var wo=Pl(async(e,t,r,n)=>{t.currentIterable=e(...r);try{for await(let o of t.currentIterable)n.push(o)}finally{delete t.currentIterable}}),Tr=async function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=My}=t[r];for await(let o of n(e))yield*Tr(o,t,r+1)},kl=async function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Ry(r,Number(t),e)},Ry=async function*(e,t,r){if(e!==void 0)for await(let n of e())yield*Tr(n,r,t+1)},Bl=Pl(async({currentIterable:e},t)=>{if(e!==void 0){await(t?e.throw(t):e.return());return}if(t)throw t}),My=function*(e){yield e};var xo=(e,t,r,n)=>{try{for(let o of e(...t))r.push(o);n()}catch(o){n(o)}},Ll=(e,t)=>[...t.flatMap(r=>[...Ae(r,e,0)]),...lt(e)],Ae=function*(e,t,r){if(r===t.length){yield e;return}let{transform:n=ky}=t[r];for(let o of n(e))yield*Ae(o,t,r+1)},lt=function*(e){for(let[t,{final:r}]of Object.entries(e))yield*Py(r,Number(t),e)},Py=function*(e,t,r){if(e!==void 0)for(let n of e())yield*Ae(n,r,t+1)},ky=function*(e){yield e};var Eo=({value:e,value:{transform:t,final:r,writableObjectMode:n,readableObjectMode:o},optionName:i},{encoding:s})=>{let a={},c=jl(e,s,i),u=Ce(t),l=Ce(r),p=u?wo.bind(void 0,Tr,a):xo.bind(void 0,Ae),d=u||l?wo.bind(void 0,kl,a):xo.bind(void 0,lt),f=u||l?Bl.bind(void 0,a):void 0;return{stream:new By({writableObjectMode:n,writableHighWaterMark:Nl(n),readableObjectMode:o,readableHighWaterMark:Nl(o),transform(h,$,b){p([h,c,0],this,b)},flush(h){d([c],this,h)},destroy:f})}},Ir=(e,t,r,n)=>{let o=t.filter(({type:s})=>s==="generator"),i=n?o.reverse():o;for(let{value:s,optionName:a}of i){let c=jl(s,r,a);e=Ll(c,e)}return e},jl=({transform:e,final:t,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:i},s,a)=>{let c={};return[{transform:Fl(n,a)},vr(r,s,n),Or(r,i,n,c),{transform:e,final:t},{transform:Rl(o,a)},Dl({binary:r,preserveNewlines:i,readableObjectMode:o,state:c})].filter(Boolean)};var Ul=(e,t)=>{for(let r of Ly(e))Ny(e,r,t)},Ly=e=>new Set(Object.entries(e).filter(([,{direction:t}])=>t==="input").map(([t])=>Number(t))),Ny=(e,t,r)=>{let{stdioItems:n}=e[t],o=n.filter(({contents:a})=>a!==void 0);if(o.length===0)return;if(t!==0){let[{type:a,optionName:c}]=o;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${be[a]} with synchronous methods.`)}let s=o.map(({contents:a})=>a).map(a=>jy(a,n));r.input=Qe(s)},jy=(e,t)=>{let r=Ir(e,t,"utf8",!0);return Uy(r),Qe(r)},Uy=e=>{let t=e.find(r=>typeof r!="string"&&!R(r));if(t!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${t}.`)};import{writeFileSync as Hy,appendFileSync as zy}from"fs";var Dr=({stdioItems:e,encoding:t,verboseInfo:r,fdNumber:n})=>n!=="all"&&Me(r,n)&&!N.has(t)&&Gy(n)&&(e.some(({type:o,value:i})=>o==="native"&&Vy.has(i))||e.every(({type:o})=>z.has(o))),Gy=e=>e===1||e===2,Vy=new Set(["pipe","overlapped"]),Gl=async(e,t,r,n)=>{for await(let o of e)Wy(t)||Wl(o,r,n)},Vl=(e,t,r)=>{for(let n of e)Wl(n,t,r)},Wy=e=>e._readableState.pipes.length>0,Wl=(e,t,r)=>{let n=Vt(e);ee({type:"output",verboseMessage:n,fdNumber:t,verboseInfo:r})};var Hl=({fileDescriptors:e,syncResult:{output:t},options:r,isMaxBuffer:n,verboseInfo:o})=>{if(t===null)return{output:Array.from({length:3})};let i={},s=new Set([]);return{output:t.map((c,u)=>qy({result:c,fileDescriptors:e,fdNumber:u,state:i,outputFiles:s,isMaxBuffer:n,verboseInfo:o},r)),...i}},qy=({result:e,fileDescriptors:t,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:i,verboseInfo:s},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:p})=>{if(e===null)return;let d=zc(e,i,p),f=ue(d),{stdioItems:m,objectMode:h}=t[r],$=Yy([f],m,c,n),{serializedResult:b,finalResult:x=b}=Ky({chunks:$,objectMode:h,encoding:c,lines:u,stripFinalNewline:l,fdNumber:r});Jy({serializedResult:b,fdNumber:r,state:n,verboseInfo:s,encoding:c,stdioItems:m,objectMode:h});let S=a[r]?x:void 0;try{return n.error===void 0&&Xy(b,m,o),S}catch(C){return n.error=C,S}},Yy=(e,t,r,n)=>{try{return Ir(e,t,r,!1)}catch(o){return n.error=o,e}},Ky=({chunks:e,objectMode:t,encoding:r,lines:n,stripFinalNewline:o,fdNumber:i})=>{if(t)return{serializedResult:e};if(r==="buffer")return{serializedResult:Qe(e)};let s=ss(e,r);return n[i]?{serializedResult:s,finalResult:So(s,!o[i],t)}:{serializedResult:s}},Jy=({serializedResult:e,fdNumber:t,state:r,verboseInfo:n,encoding:o,stdioItems:i,objectMode:s})=>{if(!Dr({stdioItems:i,encoding:o,verboseInfo:n,fdNumber:t}))return;let a=So(e,!1,s);try{Vl(a,t,n)}catch(c){r.error??=c}},Xy=(e,t,r)=>{for(let{path:n,append:o}of t.filter(({type:i})=>Cr.has(i))){let i=typeof n=="string"?n:n.toString();o||r.has(i)?zy(n,e):(r.add(i),Hy(n,e))}};var zl=([,e,t],r)=>{if(r.all)return e===void 0?t:t===void 0?e:Array.isArray(e)?Array.isArray(t)?[...e,...t]:[...e,me(t,r,"all")]:Array.isArray(t)?[me(e,r,"all"),...t]:R(e)&&R(t)?On([e,t]):`${e}${t}`};import{once as $o}from"events";var ql=async(e,t)=>{let[r,n]=await Zy(e);return t.isForcefullyTerminated??=!1,[r,n]},Zy=async e=>{let[t,r]=await Promise.allSettled([$o(e,"spawn"),$o(e,"exit")]);return t.status==="rejected"?[]:r.status==="rejected"?Yl(e):r.value},Yl=async e=>{try{return await $o(e,"exit")}catch{return Yl(e)}},Kl=async e=>{let[t,r]=await e;if(!Qy(t,r)&&_o(t,r))throw new J;return[t,r]},Qy=(e,t)=>e===void 0&&t===void 0,_o=(e,t)=>e!==0||t!==null;var Jl=({error:e,status:t,signal:r,output:n},{maxBuffer:o})=>{let i=eb(e,t,r),s=i?.code==="ETIMEDOUT",a=Hc(i,n,o);return{resultError:i,exitCode:t,signal:r,timedOut:s,isMaxBuffer:a}},eb=(e,t,r)=>e!==void 0?e:_o(t,r)?new J:void 0;var Xl=(e,t,r)=>{let{file:n,commandArguments:o,command:i,escapedCommand:s,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=rb(e,t,r),p=ib({file:n,commandArguments:o,options:u,command:i,escapedCommand:s,verboseInfo:c,fileDescriptors:l,startTime:a});return Ve(p,c,u)},rb=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ht(e,t,r),a=nb(r),{file:c,commandArguments:u,options:l}=dr(e,t,a);ob(l);let p=Ol(l,s);return{file:c,commandArguments:u,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:l,fileDescriptors:p}},nb=e=>e.node&&!e.ipc?{...e,ipc:!1}:e,ob=({ipc:e,ipcInput:t,detached:r,cancelSignal:n})=>{t&&Fr("ipcInput"),e&&Fr("ipc: true"),r&&Fr("detached: true"),n&&Fr("cancelSignal")},Fr=e=>{throw new TypeError(`The "${e}" option cannot be used with synchronous methods.`)},ib=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,verboseInfo:i,fileDescriptors:s,startTime:a})=>{let c=sb({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:a});if(c.failed)return c;let{resultError:u,exitCode:l,signal:p,timedOut:d,isMaxBuffer:f}=Jl(c,r),{output:m,error:h=u}=Hl({fileDescriptors:s,syncResult:c,options:r,isMaxBuffer:f,verboseInfo:i}),$=m.map((x,S)=>me(x,r,S)),b=me(zl(m,r),r,"all");return cb({error:h,exitCode:l,signal:p,timedOut:d,isMaxBuffer:f,stdio:$,all:b,options:r,command:n,escapedCommand:o,startTime:a})},sb=({file:e,commandArguments:t,options:r,command:n,escapedCommand:o,fileDescriptors:i,startTime:s})=>{try{Ul(i,r);let a=ab(r);return tb(...mr(e,t,a))}catch(a){return Ge({error:a,command:n,escapedCommand:o,fileDescriptors:i,options:r,startTime:s,isSync:!0})}},ab=({encoding:e,maxBuffer:t,...r})=>({...r,encoding:"buffer",maxBuffer:xr(t)}),cb=({error:e,exitCode:t,signal:r,timedOut:n,isMaxBuffer:o,stdio:i,all:s,options:a,command:c,escapedCommand:u,startTime:l})=>e===void 0?Er({command:c,escapedCommand:u,stdio:i,all:s,ipcOutput:[],options:a,startTime:l}):ct({error:e,command:c,escapedCommand:u,timedOut:n,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:o,isForcefullyTerminated:!1,exitCode:t,signal:r,stdio:i,all:s,ipcOutput:[],options:a,startTime:l,isSync:!0});import{setMaxListeners as K0}from"events";import{spawn as J0}from"child_process";import ru from"process";import{once as Co,on as lb}from"events";var Zl=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0,filter:i}={})=>(Be({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:sr(e)}),ub({anyProcess:e,channel:t,isSubprocess:r,filter:i,reference:o})),ub=async({anyProcess:e,channel:t,isSubprocess:r,filter:n,reference:o})=>{rr(t,o);let i=ye(e,t,r),s=new AbortController;try{return await Promise.race([pb(i,n,s),db(i,r,s),mb(i,r,s)])}catch(a){throw Le(e),a}finally{s.abort(),nr(t,o)}},pb=async(e,t,{signal:r})=>{if(t===void 0){let[n]=await Co(e,"message",{signal:r});return n}for await(let[n]of lb(e,"message",{signal:r}))if(t(n))return n},db=async(e,t,{signal:r})=>{await Co(e,"disconnect",{signal:r}),La(t)},mb=async(e,t,{signal:r})=>{let[n]=await Co(e,"strict:error",{signal:r});throw Qt(n,t)};import{once as eu,on as fb}from"events";var tu=({anyProcess:e,channel:t,isSubprocess:r,ipc:n},{reference:o=!0}={})=>Ao({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),Ao=({anyProcess:e,channel:t,isSubprocess:r,ipc:n,shouldAwait:o,reference:i})=>{Be({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:sr(e)}),rr(t,i);let s=ye(e,t,r),a=new AbortController,c={};return hb(e,s,a),gb({ipcEmitter:s,isSubprocess:r,controller:a,state:c}),yb({anyProcess:e,channel:t,ipcEmitter:s,isSubprocess:r,shouldAwait:o,controller:a,state:c,reference:i})},hb=async(e,t,r)=>{try{await eu(t,"disconnect",{signal:r.signal}),r.abort()}catch{}},gb=async({ipcEmitter:e,isSubprocess:t,controller:r,state:n})=>{try{let[o]=await eu(e,"strict:error",{signal:r.signal});n.error=Qt(o,t),r.abort()}catch{}},yb=async function*({anyProcess:e,channel:t,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:i,state:s,reference:a}){try{for await(let[c]of fb(r,"message",{signal:i.signal}))Ql(s),yield c}catch{Ql(s)}finally{i.abort(),nr(t,a),n||Le(e),o&&await e}},Ql=({error:e})=>{if(e)throw e};var nu=(e,{ipc:t})=>{Object.assign(e,iu(e,!1,t))},ou=()=>{let e=ru,t=!0,r=ru.channel!==void 0;return{...iu(e,t,r),getCancelSignal:pc.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})}},iu=(e,t,r)=>({sendMessage:ur.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getOneMessage:Zl.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r}),getEachMessage:tu.bind(void 0,{anyProcess:e,channel:e.channel,isSubprocess:t,ipc:r})});import{ChildProcess as bb}from"child_process";import{PassThrough as Sb,Readable as wb,Writable as xb,Duplex as Eb}from"stream";var su=({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,verboseInfo:s})=>{go(n);let a=new bb;$b(a,n),Object.assign(a,{readable:_b,writable:Cb,duplex:Ab});let c=Ge({error:e,command:t,escapedCommand:r,fileDescriptors:n,options:o,startTime:i,isSync:!1}),u=Ob(c,s,o);return{subprocess:a,promise:u}},$b=(e,t)=>{let r=ut(),n=ut(),o=ut(),i=Array.from({length:t.length-3},ut),s=ut(),a=[r,n,o,...i];Object.assign(e,{stdin:r,stdout:n,stderr:o,all:s,stdio:a})},ut=()=>{let e=new Sb;return e.end(),e},_b=()=>new wb({read(){}}),Cb=()=>new xb({write(){}}),Ab=()=>new Eb({read(){},write(){}}),Ob=async(e,t,r)=>Ve(e,t,r);import{createReadStream as au,createWriteStream as cu}from"fs";import{Buffer as vb}from"buffer";import{Readable as pt,Writable as Tb,Duplex as Ib}from"stream";var uu=(e,t)=>Ar(Db,e,t,!1),dt=({type:e,optionName:t})=>{throw new TypeError(`The \`${t}\` option cannot be ${be[e]}.`)},lu={fileNumber:dt,generator:Eo,asyncGenerator:Eo,nodeStream:({value:e})=>({stream:e}),webTransform({value:{transform:e,writableObjectMode:t,readableObjectMode:r}}){let n=t||r;return{stream:Ib.fromWeb(e,{objectMode:n})}},duplex:({value:{transform:e}})=>({stream:e}),native(){}},Db={input:{...lu,fileUrl:({value:e})=>({stream:au(e)}),filePath:({value:{file:e}})=>({stream:au(e)}),webStream:({value:e})=>({stream:pt.fromWeb(e)}),iterable:({value:e})=>({stream:pt.from(e)}),asyncIterable:({value:e})=>({stream:pt.from(e)}),string:({value:e})=>({stream:pt.from(e)}),uint8Array:({value:e})=>({stream:pt.from(vb.from(e))})},output:{...lu,fileUrl:({value:e})=>({stream:cu(e)}),filePath:({value:{file:e,append:t}})=>({stream:cu(e,t?{flags:"a"}:{})}),webStream:({value:e})=>({stream:Tb.fromWeb(e)}),iterable:dt,asyncIterable:dt,string:dt,uint8Array:dt}};import{on as Fb,once as pu}from"events";import{PassThrough as Rb,getDefaultHighWaterMark as Mb}from"stream";import{finished as fu}from"stream/promises";function Oe(e){if(!Array.isArray(e))throw new TypeError(`Expected an array, got \`${typeof e}\`.`);for(let o of e)vo(o);let t=e.some(({readableObjectMode:o})=>o),r=Pb(e,t),n=new Oo({objectMode:t,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of e)n.add(o);return n}var Pb=(e,t)=>{if(e.length===0)return Mb(t);let r=e.filter(({readableObjectMode:n})=>n===t).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Oo=class extends Rb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(t){if(vo(t),this.#t.has(t))return;this.#t.add(t),this.#n??=kb(this,this.#t,this.#i);let r=Nb({passThroughStream:this,stream:t,streams:this.#t,ended:this.#r,aborted:this.#e,onFinished:this.#n,unpipeEvent:this.#i});this.#o.set(t,r),t.pipe(this,{end:!1})}async remove(t){if(vo(t),!this.#t.has(t))return!1;let r=this.#o.get(t);return r===void 0?!1:(this.#o.delete(t),t.unpipe(this),await r,!0)}},kb=async(e,t,r)=>{Rr(e,du);let n=new AbortController;try{await Promise.race([Bb(e,n),Lb(e,t,r,n)])}finally{n.abort(),Rr(e,-du)}},Bb=async(e,{signal:t})=>{try{await fu(e,{signal:t,cleanup:!0})}catch(r){throw hu(e,r),r}},Lb=async(e,t,r,{signal:n})=>{for await(let[o]of Fb(e,"unpipe",{signal:n}))t.has(o)&&o.emit(r)},vo=e=>{if(typeof e?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof e}\`.`)},Nb=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,onFinished:i,unpipeEvent:s})=>{Rr(e,mu);let a=new AbortController;try{await Promise.race([jb(i,t,a),Ub({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:a}),Gb({stream:t,streams:r,ended:n,aborted:o,unpipeEvent:s,controller:a})])}finally{a.abort(),Rr(e,-mu)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?To(e):Vb(e))},jb=async(e,t,{signal:r})=>{try{await e,r.aborted||To(t)}catch(n){r.aborted||hu(t,n)}},Ub=async({passThroughStream:e,stream:t,streams:r,ended:n,aborted:o,controller:{signal:i}})=>{try{await fu(t,{signal:i,cleanup:!0,readable:!0,writable:!1}),r.has(t)&&n.add(t)}catch(s){if(i.aborted||!r.has(t))return;gu(s)?o.add(t):yu(e,s)}},Gb=async({stream:e,streams:t,ended:r,aborted:n,unpipeEvent:o,controller:{signal:i}})=>{if(await pu(e,o,{signal:i}),!e.readable)return pu(i,"abort",{signal:i});t.delete(e),r.delete(e),n.delete(e)},Vb=e=>{e.writable&&e.end()},hu=(e,t)=>{gu(t)?To(e):yu(e,t)},gu=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",To=e=>{(e.readable||e.writable)&&e.destroy()},yu=(e,t)=>{e.destroyed||(e.once("error",Wb),e.destroy(t))},Wb=()=>{},Rr=(e,t)=>{let r=e.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&e.setMaxListeners(r+t)},du=2,mu=1;import{finished as bu}from"stream/promises";var He=(e,t)=>{e.pipe(t),Hb(e,t),zb(e,t)},Hb=async(e,t)=>{if(!(K(e)||K(t))){try{await bu(e,{cleanup:!0,readable:!0,writable:!1})}catch{}Io(t)}},Io=e=>{e.writable&&e.end()},zb=async(e,t)=>{if(!(K(e)||K(t))){try{await bu(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Do(e)}},Do=e=>{e.readable&&e.destroy()};var Su=(e,t,r)=>{let n=new Map;for(let[o,{stdioItems:i,direction:s}]of Object.entries(t)){for(let{stream:a}of i.filter(({type:c})=>z.has(c)))qb(e,a,s,o);for(let{stream:a}of i.filter(({type:c})=>!z.has(c)))Kb({subprocess:e,stream:a,direction:s,fdNumber:o,pipeGroups:n,controller:r})}for(let[o,i]of n.entries()){let s=i.length===1?i[0]:Oe(i);He(s,o)}},qb=(e,t,r,n)=>{r==="output"?He(e.stdio[n],t):He(t,e.stdio[n]);let o=Yb[n];o!==void 0&&(e[o]=t),e.stdio[n]=t},Yb=["stdin","stdout","stderr"],Kb=({subprocess:e,stream:t,direction:r,fdNumber:n,pipeGroups:o,controller:i})=>{if(t===void 0)return;Jb(t,i);let[s,a]=r==="output"?[t,e.stdio[n]]:[e.stdio[n],t],c=o.get(s)??[];o.set(s,[...c,a])},Jb=(e,{signal:t})=>{K(e)&&$e(e,Xb,t)},Xb=2;import{addAbortListener as e0}from"events";var ve=[];ve.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&ve.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&ve.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Mr=e=>!!e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function",Fo=Symbol.for("signal-exit emitter"),Ro=globalThis,Zb=Object.defineProperty.bind(Object),Mo=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Ro[Fo])return Ro[Fo];Zb(Ro,Fo,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,r){this.listeners[t].push(r)}removeListener(t,r){let n=this.listeners[t],o=n.indexOf(r);o!==-1&&(o===0&&n.length===1?n.length=0:n.splice(o,1))}emit(t,r,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let o=!1;for(let i of this.listeners[t])o=i(r,n)===!0||o;return t==="exit"&&(o=this.emit("afterExit",r,n)||o),o}},Pr=class{},Qb=e=>({onExit(t,r){return e.onExit(t,r)},load(){return e.load()},unload(){return e.unload()}}),Po=class extends Pr{onExit(){return()=>{}}load(){}unload(){}},ko=class extends Pr{#t=Bo.platform==="win32"?"SIGINT":"SIGHUP";#r=new Mo;#e;#n;#i;#o={};#s=!1;constructor(t){super(),this.#e=t,this.#o={};for(let r of ve)this.#o[r]=()=>{let n=this.#e.listeners(r),{count:o}=this.#r,i=t;if(typeof i.__signal_exit_emitter__=="object"&&typeof i.__signal_exit_emitter__.count=="number"&&(o+=i.__signal_exit_emitter__.count),n.length===o){this.unload();let s=this.#r.emit("exit",null,r),a=r==="SIGHUP"?this.#t:r;s||t.kill(t.pid,a)}};this.#i=t.reallyExit,this.#n=t.emit}onExit(t,r){if(!Mr(this.#e))return()=>{};this.#s===!1&&this.load();let n=r?.alwaysLast?"afterExit":"exit";return this.#r.on(n,t),()=>{this.#r.removeListener(n,t),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#s){this.#s=!0,this.#r.count+=1;for(let t of ve)try{let r=this.#o[t];r&&this.#e.on(t,r)}catch{}this.#e.emit=(t,...r)=>this.#c(t,...r),this.#e.reallyExit=t=>this.#a(t)}}unload(){this.#s&&(this.#s=!1,ve.forEach(t=>{let r=this.#o[t];if(!r)throw new Error("Listener not defined for signal: "+t);try{this.#e.removeListener(t,r)}catch{}}),this.#e.emit=this.#n,this.#e.reallyExit=this.#i,this.#r.count-=1)}#a(t){return Mr(this.#e)?(this.#e.exitCode=t||0,this.#r.emit("exit",this.#e.exitCode,null),this.#i.call(this.#e,this.#e.exitCode)):0}#c(t,...r){let n=this.#n;if(t==="exit"&&Mr(this.#e)){typeof r[0]=="number"&&(this.#e.exitCode=r[0]);let o=n.call(this.#e,t,...r);return this.#r.emit("exit",this.#e.exitCode,null),o}else return n.call(this.#e,t,...r)}},Bo=globalThis.process,{onExit:wu,load:MO,unload:PO}=Qb(Mr(Bo)?new ko(Bo):new Po);var xu=(e,{cleanup:t,detached:r},{signal:n})=>{if(!t||r)return;let o=wu(()=>{e.kill()});e0(n,()=>{o()})};var $u=({source:e,sourcePromise:t,boundOptions:r,createNested:n},...o)=>{let i=Wt(),{destination:s,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=t0(r,n,o),{sourceStream:p,sourceError:d}=n0(e,u),{options:f,fileDescriptors:m}=re.get(e);return{sourcePromise:t,sourceStream:p,sourceOptions:f,sourceError:d,destination:s,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:m,startTime:i}},t0=(e,t,r)=>{try{let{destination:n,pipeOptions:{from:o,to:i,unpipeSignal:s}={}}=r0(e,t,...r),a=tr(n,i);return{destination:n,destinationStream:a,from:o,unpipeSignal:s}}catch(n){return{destinationError:n}}},r0=(e,t,r,...n)=>{if(Array.isArray(r))return{destination:t(Eu,e)(r,...n),pipeOptions:e};if(typeof r=="string"||r instanceof URL||Cn(r)){if(Object.keys(e).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[o,i,s]=Mt(r,...n);return{destination:t(Eu)(o,i,s),pipeOptions:s}}if(re.has(r)){if(Object.keys(e).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:r,pipeOptions:n[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${r}`)},Eu=({options:e})=>({options:{...e,stdin:"pipe",piped:!0}}),n0=(e,t)=>{try{return{sourceStream:Ne(e,t)}}catch(r){return{sourceError:r}}};var Cu=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:i,startTime:s})=>{let a=o0({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n});if(a!==void 0)throw Lo({error:a,fileDescriptors:o,sourceOptions:i,startTime:s})},o0=({sourceStream:e,sourceError:t,destinationStream:r,destinationError:n})=>{if(t!==void 0&&n!==void 0)return n;if(n!==void 0)return Do(e),n;if(t!==void 0)return Io(r),t},Lo=({error:e,fileDescriptors:t,sourceOptions:r,startTime:n})=>Ge({error:e,command:_u,escapedCommand:_u,fileDescriptors:t,options:r,startTime:n,isSync:!1}),_u="source.pipe(destination)";var Au=async e=>{let[{status:t,reason:r,value:n=r},{status:o,reason:i,value:s=i}]=await e;if(s.pipedFrom.includes(n)||s.pipedFrom.push(n),o==="rejected")throw s;if(t==="rejected")throw n;return s};import{finished as i0}from"stream/promises";var Ou=(e,t,r)=>{let n=kr.has(t)?a0(e,t):s0(e,t);return $e(e,l0,r.signal),$e(t,u0,r.signal),c0(t),n},s0=(e,t)=>{let r=Oe([e]);return He(r,t),kr.set(t,r),r},a0=(e,t)=>{let r=kr.get(t);return r.add(e),r},c0=async e=>{try{await i0(e,{cleanup:!0,readable:!1,writable:!0})}catch{}kr.delete(e)},kr=new WeakMap,l0=2,u0=1;import{aborted as p0}from"util";var vu=(e,t)=>e===void 0?[]:[d0(e,t)],d0=async(e,{sourceStream:t,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:i})=>{await p0(e,t),await r.remove(t);let s=new Error("Pipe canceled by `unpipeSignal` option.");throw Lo({error:s,fileDescriptors:n,sourceOptions:o,startTime:i})};var Br=(e,...t)=>{if(I(t[0]))return Br.bind(void 0,{...e,boundOptions:{...e.boundOptions,...t[0]}});let{destination:r,...n}=$u(e,...t),o=m0({...n,destination:r});return o.pipe=Br.bind(void 0,{...e,source:r,sourcePromise:o,boundOptions:{}}),o},m0=async({sourcePromise:e,sourceStream:t,sourceOptions:r,sourceError:n,destination:o,destinationStream:i,destinationError:s,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{let l=f0(e,o);Cu({sourceStream:t,sourceError:n,destinationStream:i,destinationError:s,fileDescriptors:c,sourceOptions:r,startTime:u});let p=new AbortController;try{let d=Ou(t,i,p);return await Promise.race([Au(l),...vu(a,{sourceStream:t,mergedStream:d,sourceOptions:r,fileDescriptors:c,startTime:u})])}finally{p.abort()}},f0=(e,t)=>Promise.allSettled([e,t]);import{setImmediate as x0}from"timers/promises";import{on as h0}from"events";import{getDefaultHighWaterMark as g0}from"stream";var Lr=({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:n,encoding:o,preserveNewlines:i})=>{let s=new AbortController;return y0(t,s),Iu({stream:e,controller:s,binary:r,shouldEncode:!e.readableObjectMode&&n,encoding:o,shouldSplit:!e.readableObjectMode,preserveNewlines:i})},y0=async(e,t)=>{try{await e}catch{}finally{t.abort()}},No=({stream:e,onStreamEnd:t,lines:r,encoding:n,stripFinalNewline:o,allMixed:i})=>{let s=new AbortController;b0(t,s,e);let a=e.readableObjectMode&&!i;return Iu({stream:e,controller:s,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},b0=async(e,t,r)=>{try{await e}catch{r.destroy()}finally{t.abort()}},Iu=({stream:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})=>{let a=h0(e,"data",{signal:t.signal,highWaterMark:Tu,highWatermark:Tu});return S0({onStdoutChunk:a,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s})},jo=g0(!0),Tu=jo,S0=async function*({onStdoutChunk:e,controller:t,binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s}){let a=w0({binary:r,shouldEncode:n,encoding:o,shouldSplit:i,preserveNewlines:s});try{for await(let[c]of e)yield*Ae(c,a,0)}catch(c){if(!t.signal.aborted)throw c}finally{yield*lt(a)}},w0=({binary:e,shouldEncode:t,encoding:r,shouldSplit:n,preserveNewlines:o})=>[vr(e,r,!t),Or(e,o,!n,{})].filter(Boolean);var Du=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,buffer:o,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{let p=E0({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:a,verboseInfo:u,streamInfo:l});if(!o){await Promise.all([$0(e),p]);return}let d=yo(c,r),f=No({stream:e,onStreamEnd:t,lines:s,encoding:n,stripFinalNewline:d,allMixed:a}),[m]=await Promise.all([_0({stream:e,iterable:f,fdNumber:r,encoding:n,maxBuffer:i,lines:s}),p]);return m},E0=async({stream:e,onStreamEnd:t,fdNumber:r,encoding:n,allMixed:o,verboseInfo:i,streamInfo:{fileDescriptors:s}})=>{if(!Dr({stdioItems:s[r]?.stdioItems,encoding:n,verboseInfo:i,fdNumber:r}))return;let a=No({stream:e,onStreamEnd:t,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await Gl(a,e,r,i)},$0=async e=>{await x0(),e.readableFlowing===null&&e.resume()},_0=async({stream:e,stream:{readableObjectMode:t},iterable:r,fdNumber:n,encoding:o,maxBuffer:i,lines:s})=>{try{return t||s?await yr(r,{maxBuffer:i}):o==="buffer"?new Uint8Array(await br(r,{maxBuffer:i})):await wr(r,{maxBuffer:i})}catch(a){return Fu(Gc({error:a,stream:e,readableObjectMode:t,lines:s,encoding:o,fdNumber:n}))}},Uo=async e=>{try{return await e}catch(t){return Fu(t)}},Fu=({bufferedData:e})=>os(e)?new Uint8Array(e):e;import{finished as C0}from"stream/promises";var mt=async(e,t,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let i=A0(e,r),s=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],C0(e,{cleanup:!0,signal:s.signal})])}catch(a){i.stdinCleanedUp||T0(a,t,r,n)}finally{s.abort()}},A0=(e,{originalStreams:[t],subprocess:r})=>{let n={stdinCleanedUp:!1};return e===t&&O0(e,r,n),n},O0=(e,t,r)=>{let{_destroy:n}=e;e._destroy=(...o)=>{v0(t,r),n.call(e,...o)}},v0=({exitCode:e,signalCode:t},r)=>{(e!==null||t!==null)&&(r.stdinCleanedUp=!0)},T0=(e,t,r,n)=>{if(!I0(e,t,r,n))throw e},I0=(e,t,r,n=!0)=>r.propagating?Ru(e)||Nr(e):(r.propagating=!0,Go(r,t)===n?Ru(e):Nr(e)),Go=({fileDescriptors:e},t)=>t!=="all"&&e[t].direction==="input",Nr=e=>e?.code==="ERR_STREAM_PREMATURE_CLOSE",Ru=e=>e?.code==="EPIPE";var Mu=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>e.stdio.map((c,u)=>Vo({stream:c,fdNumber:u,encoding:t,buffer:r[u],maxBuffer:n[u],lines:o[u],allMixed:!1,stripFinalNewline:i,verboseInfo:s,streamInfo:a})),Vo=async({stream:e,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!e)return;let l=mt(e,t,u);if(Go(u,t)){await l;return}let[p]=await Promise.all([Du({stream:e,onStreamEnd:l,fdNumber:t,encoding:r,buffer:n,maxBuffer:o,lines:i,allMixed:s,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return p};var Pu=({stdout:e,stderr:t},{all:r})=>r&&(e||t)?Oe([e,t].filter(Boolean)):void 0,ku=({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:i,verboseInfo:s,streamInfo:a})=>Vo({...D0(e,r),fdNumber:"all",encoding:t,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:F0(e),stripFinalNewline:i,verboseInfo:s,streamInfo:a}),D0=({stdout:e,stderr:t,all:r},[,n,o])=>{let i=n||o;return i?n?o?{stream:r,buffer:i}:{stream:e,buffer:i}:{stream:t,buffer:i}:{stream:r,buffer:i}},F0=({all:e,stdout:t,stderr:r})=>e&&t&&r&&t.readableObjectMode!==r.readableObjectMode;import{once as R0}from"events";var Bu=e=>Me(e,"ipc"),Lu=(e,t)=>{let r=Vt(e);ee({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:t})};var Nu=async({subprocess:e,buffer:t,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:i})=>{if(!n)return o;let s=Bu(i),a=pe(t,"ipc"),c=pe(r,"ipc");for await(let u of Ao({anyProcess:e,channel:e.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(Vc(e,o,c),o.push(u)),s&&Lu(u,i);return o},ju=async(e,t)=>(await Promise.allSettled([e]),t);var Uu=async({subprocess:e,options:{encoding:t,buffer:r,maxBuffer:n,lines:o,timeoutDuration:i,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:p},context:d,verboseInfo:f,fileDescriptors:m,originalStreams:h,onInternalError:$,controller:b})=>{let x=ql(e,d),S={originalStreams:h,fileDescriptors:m,subprocess:e,exitPromise:x,propagating:!1},C=Mu({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:u,verboseInfo:f,streamInfo:S}),O=ku({subprocess:e,encoding:t,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:u,verboseInfo:f,streamInfo:S}),F=[],w=Nu({subprocess:e,buffer:r,maxBuffer:n,ipc:l,ipcOutput:F,verboseInfo:f}),_=M0(h,e,S),B=P0(m,S);try{return await Promise.race([Promise.all([{},Kl(x),Promise.all(C),O,w,xc(e,p),..._,...B]),$,k0(e,b),...gc(e,i,d,b),...Ba({subprocess:e,cancelSignal:s,gracefulCancel:a,context:d,controller:b}),...fc({subprocess:e,cancelSignal:s,gracefulCancel:a,forceKillAfterDelay:c,context:d,controller:b})])}catch(ie){return d.terminationReason??="other",Promise.all([{error:ie},x,Promise.all(C.map(q=>Uo(q))),Uo(O),ju(w,F),Promise.allSettled(_),Promise.allSettled(B)])}},M0=(e,t,r)=>e.map((n,o)=>n===t.stdio[o]?void 0:mt(n,o,r)),P0=(e,t)=>e.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:i=o})=>Z(i,{checkOpen:!1})&&!K(i)).map(({type:o,value:i,stream:s=i})=>mt(s,n,t,{isSameDirection:z.has(o),stopOnExit:o==="native"}))),k0=async(e,{signal:t})=>{let[r]=await R0(e,"error",{signal:t});throw r};var Gu=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),ft=(e,t,r)=>{let n=e[r];n.has(t)||n.set(t,[]);let o=n.get(t),i=te();return o.push(i),{resolve:i.resolve.bind(i),promises:o}},ze=async({resolve:e,promises:t},r)=>{e();let[n]=await Promise.race([Promise.allSettled([!0,r]),Promise.all([!1,...t])]);return!n};import{Readable as B0}from"stream";import{callbackify as L0}from"util";import{finished as Vu}from"stream/promises";var Wo=async e=>{if(e!==void 0)try{await Ho(e)}catch{}},Wu=async e=>{if(e!==void 0)try{await zo(e)}catch{}},Ho=async e=>{await Vu(e,{cleanup:!0,readable:!1,writable:!0})},zo=async e=>{await Vu(e,{cleanup:!0,readable:!0,writable:!1})},jr=async(e,t)=>{if(await e,t)throw t},Ur=(e,t,r)=>{r&&!Nr(r)?e.destroy(r):t&&e.destroy()};var Hu=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,binary:o=!0,preserveNewlines:i=!0}={})=>{let s=o||N.has(r),{subprocessStdout:a,waitReadableDestroy:c}=qo(e,n,t),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:p}=Yo(a,s),{read:d,onStdoutDataDone:f}=Ko({subprocessStdout:a,subprocess:e,binary:s,encoding:r,preserveNewlines:i}),m=new B0({read:d,destroy:L0(Xo.bind(void 0,{subprocessStdout:a,subprocess:e,waitReadableDestroy:c})),highWaterMark:p,objectMode:l,encoding:u});return Jo({subprocessStdout:a,onStdoutDataDone:f,readable:m,subprocess:e}),m},qo=(e,t,r)=>{let n=Ne(e,t),o=ft(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},Yo=({readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r},n)=>n?{readableEncoding:e,readableObjectMode:t,readableHighWaterMark:r}:{readableEncoding:e,readableObjectMode:!0,readableHighWaterMark:jo},Ko=({subprocessStdout:e,subprocess:t,binary:r,encoding:n,preserveNewlines:o})=>{let i=te(),s=Lr({subprocessStdout:e,subprocess:t,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){N0(this,s,i)},onStdoutDataDone:i}},N0=async(e,t,r)=>{try{let{value:n,done:o}=await t.next();o?r.resolve():e.push(n)}catch{}},Jo=async({subprocessStdout:e,onStdoutDataDone:t,readable:r,subprocess:n,subprocessStdin:o})=>{try{await zo(e),await n,await Wo(o),await t,r.readable&&r.push(null)}catch(i){await Wo(o),zu(r,i)}},Xo=async({subprocessStdout:e,subprocess:t,waitReadableDestroy:r},n)=>{await ze(r,t)&&(zu(e,n),await jr(t,n))},zu=(e,t)=>{Ur(e,e.readable,t)};import{Writable as j0}from"stream";import{callbackify as qu}from"util";var Yu=({subprocess:e,concurrentStreams:t},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}=Zo(e,r,t),s=new j0({...Qo(n,e,o),destroy:qu(ti.bind(void 0,{subprocessStdin:n,subprocess:e,waitWritableFinal:o,waitWritableDestroy:i})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return ei(n,s),s},Zo=(e,t,r)=>{let n=tr(e,t),o=ft(r,n,"writableFinal"),i=ft(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:i}},Qo=(e,t,r)=>({write:U0.bind(void 0,e),final:qu(G0.bind(void 0,e,t,r))}),U0=(e,t,r,n)=>{e.write(t,r)?n():e.once("drain",n)},G0=async(e,t,r)=>{await ze(r,t)&&(e.writable&&e.end(),await t)},ei=async(e,t,r)=>{try{await Ho(e),t.writable&&t.end()}catch(n){await Wu(r),Ku(t,n)}},ti=async({subprocessStdin:e,subprocess:t,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await ze(r,t),await ze(n,t)&&(Ku(e,o),await jr(t,o))},Ku=(e,t)=>{Ur(e,e.writable,t)};import{Duplex as V0}from"stream";import{callbackify as W0}from"util";var Ju=({subprocess:e,concurrentStreams:t,encoding:r},{from:n,to:o,binary:i=!0,preserveNewlines:s=!0}={})=>{let a=i||N.has(r),{subprocessStdout:c,waitReadableDestroy:u}=qo(e,n,t),{subprocessStdin:l,waitWritableFinal:p,waitWritableDestroy:d}=Zo(e,o,t),{readableEncoding:f,readableObjectMode:m,readableHighWaterMark:h}=Yo(c,a),{read:$,onStdoutDataDone:b}=Ko({subprocessStdout:c,subprocess:e,binary:a,encoding:r,preserveNewlines:s}),x=new V0({read:$,...Qo(l,e,p),destroy:W0(H0.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:e,waitReadableDestroy:u,waitWritableFinal:p,waitWritableDestroy:d})),readableHighWaterMark:h,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:m,writableObjectMode:l.writableObjectMode,encoding:f});return Jo({subprocessStdout:c,onStdoutDataDone:b,readable:x,subprocess:e,subprocessStdin:l}),ei(l,x,c),x},H0=async({subprocessStdout:e,subprocessStdin:t,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:i},s)=>{await Promise.all([Xo({subprocessStdout:e,subprocess:r,waitReadableDestroy:n},s),ti({subprocessStdin:t,subprocess:r,waitWritableFinal:o,waitWritableDestroy:i},s)])};var ri=(e,t,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let i=n||N.has(t),s=Ne(e,r),a=Lr({subprocessStdout:s,subprocess:e,binary:i,shouldEncode:!0,encoding:t,preserveNewlines:o});return z0(a,s,e)},z0=async function*(e,t,r){try{yield*e}finally{t.readable&&t.destroy(),await r}};var Xu=(e,{encoding:t})=>{let r=Gu();e.readable=Hu.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.writable=Yu.bind(void 0,{subprocess:e,concurrentStreams:r}),e.duplex=Ju.bind(void 0,{subprocess:e,concurrentStreams:r,encoding:t}),e.iterable=ri.bind(void 0,e,t),e[Symbol.asyncIterator]=ri.bind(void 0,e,t,{})};var Zu=(e,t)=>{for(let[r,n]of Y0){let o=n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}},q0=(async()=>{})().constructor.prototype,Y0=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(q0,e)]);var Qu=(e,t,r,n)=>{let{file:o,commandArguments:i,command:s,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:p}=X0(e,t,r),{subprocess:d,promise:f}=Q0({file:o,commandArguments:i,options:l,startTime:c,verboseInfo:u,command:s,escapedCommand:a,fileDescriptors:p});return d.pipe=Br.bind(void 0,{source:d,sourcePromise:f,boundOptions:{},createNested:n}),Zu(d,f),re.set(d,{options:l,fileDescriptors:p}),d},X0=(e,t,r)=>{let{command:n,escapedCommand:o,startTime:i,verboseInfo:s}=Ht(e,t,r),{file:a,commandArguments:c,options:u}=dr(e,t,r),l=Z0(u),p=uu(l,s);return{file:a,commandArguments:c,command:n,escapedCommand:o,startTime:i,verboseInfo:s,options:l,fileDescriptors:p}},Z0=({timeout:e,signal:t,...r})=>{if(t!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...r,timeoutDuration:e}},Q0=({file:e,commandArguments:t,options:r,startTime:n,verboseInfo:o,command:i,escapedCommand:s,fileDescriptors:a})=>{let c;try{c=J0(...mr(e,t,r))}catch(m){return su({error:m,command:i,escapedCommand:s,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let u=new AbortController;K0(Number.POSITIVE_INFINITY,u.signal);let l=[...c.stdio];Su(c,a,u),xu(c,r,u);let p={},d=te();c.kill=Pa.bind(void 0,{kill:c.kill.bind(c),options:r,onInternalError:d,context:p,controller:u}),c.all=Pu(c,r),Xu(c,r),nu(c,r);let f=eS({subprocess:c,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:i,escapedCommand:s,context:p,onInternalError:d,controller:u});return{subprocess:c,promise:f}},eS=async({subprocess:e,options:t,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:i,command:s,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{let[p,[d,f],m,h,$]=await Uu({subprocess:e,options:t,context:c,verboseInfo:n,fileDescriptors:o,originalStreams:i,onInternalError:u,controller:l});l.abort(),u.resolve();let b=m.map((C,O)=>me(C,t,O)),x=me(h,t,"all"),S=tS({errorInfo:p,exitCode:d,signal:f,stdio:b,all:x,ipcOutput:$,context:c,options:t,command:s,escapedCommand:a,startTime:r});return Ve(S,n,t)},tS=({errorInfo:e,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,context:s,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in e?ct({error:e.error,command:c,escapedCommand:u,timedOut:s.terminationReason==="timeout",isCanceled:s.terminationReason==="cancel"||s.terminationReason==="gracefulCancel",isGracefullyCanceled:s.terminationReason==="gracefulCancel",isMaxBuffer:e.error instanceof ne,isForcefullyTerminated:s.isForcefullyTerminated,exitCode:t,signal:r,stdio:n,all:o,ipcOutput:i,options:a,startTime:l,isSync:!1}):Er({command:c,escapedCommand:u,stdio:n,all:o,ipcOutput:i,options:a,startTime:l});var Gr=(e,t)=>{let r=Object.fromEntries(Object.entries(t).map(([n,o])=>[n,rS(n,e[n],o)]));return{...e,...r}},rS=(e,t,r)=>nS.has(e)&&I(t)&&I(r)?{...t,...r}:r,nS=new Set(["env",...Dn]);var Se=(e,t,r,n)=>{let o=(s,a,c)=>Se(s,a,r,c),i=(...s)=>oS({mapArguments:e,deepOptions:r,boundOptions:t,setBoundExeca:n,createNested:o},...s);return n!==void 0&&n(i,o,t),i},oS=({mapArguments:e,deepOptions:t={},boundOptions:r={},setBoundExeca:n,createNested:o},i,...s)=>{if(I(i))return o(e,Gr(r,i),n);let{file:a,commandArguments:c,options:u,isSync:l}=iS({mapArguments:e,firstArgument:i,nextArguments:s,deepOptions:t,boundOptions:r});return l?Xl(a,c,u):Qu(a,c,u,o)},iS=({mapArguments:e,firstArgument:t,nextArguments:r,deepOptions:n,boundOptions:o})=>{let i=us(t)?ps(t,r):[t,...r],[s,a,c]=Mt(...i),u=Gr(Gr(n,o),c),{file:l=s,commandArguments:p=a,options:d=u,isSync:f=!1}=e({file:s,commandArguments:a,options:u});return{file:l,commandArguments:p,options:d,isSync:f}};var ep=({file:e,commandArguments:t})=>rp(e,t),tp=({file:e,commandArguments:t})=>({...rp(e,t),isSync:!0}),rp=(e,t)=>{if(t.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${e} ${t}.`);let[r,...n]=sS(e);return{file:r,commandArguments:n}},sS=e=>{if(typeof e!="string")throw new TypeError(`The command must be a string: ${String(e)}.`);let t=e.trim();if(t==="")return[];let r=[];for(let n of t.split(aS)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},aS=/ +/g;var np=(e,t,r)=>{e.sync=t(cS,r),e.s=e.sync},op=({options:e})=>ip(e),cS=({options:e})=>({...ip(e),isSync:!0}),ip=e=>({options:{...lS(e),...e}}),lS=({input:e,inputFile:t,stdio:r})=>e===void 0&&t===void 0&&r===void 0?{stdin:"inherit"}:{},sp={preferLocal:!0};var we=Se(()=>({})),_I=Se(()=>({isSync:!0})),ap=Se(ep),CI=Se(tp),AI=Se(bc),OI=Se(op,{},sp,np),{sendMessage:vI,getOneMessage:TI,getEachMessage:II,getCancelSignal:DI}=ou();var cp="https://github.com/spree/storefront.git",lp="https://github.com/spree/spree-starter.git",Vr="spree@example.com",Wr="spree123";import uS from"crypto";function up(){let e=process.env.npm_config_user_agent??"";return e.startsWith("yarn")?"yarn":e.startsWith("pnpm")?"pnpm":"npm"}async function pp(){try{return await ap("docker info",{stdio:"ignore"}),!0}catch{return!1}}function dp(){return uS.randomBytes(64).toString("hex")}function ni(e){return e==="yarn"?"yarn":`${e} install`}function mp(e,t){return`SECRET_KEY_BASE=${e}
|
|
121
|
+
SPREE_PORT=${t}
|
|
121
122
|
SPREE_VERSION_TAG=latest
|
|
122
|
-
`}function
|
|
123
|
-
SPREE_PUBLISHABLE_KEY=${
|
|
124
|
-
`}function
|
|
125
|
-
`}function
|
|
123
|
+
`}function fp(e,t){return`SPREE_API_URL=http://localhost:${e}
|
|
124
|
+
SPREE_PUBLISHABLE_KEY=${t??"pk_REPLACE_ME_AFTER_DOCKER_START"}
|
|
125
|
+
`}function hp(e){return JSON.stringify({name:e,private:!0,scripts:{dev:"spree dev",stop:"spree stop",down:"docker compose down",update:"spree update",eject:"spree eject",logs:"spree logs","logs:worker":"spree logs worker",seed:"spree seed","load-sample-data":"spree sample-data",console:"spree console"},dependencies:{"@spree/cli":"^2.0.0","@spree/docs":"latest"}},null,2)+`
|
|
126
|
+
`}function gp(e,t,r){let n=`# ${e}
|
|
126
127
|
|
|
127
128
|
A [Spree Commerce](https://spreecommerce.org) project.
|
|
128
129
|
|
|
@@ -135,18 +136,17 @@ A [Spree Commerce](https://spreecommerce.org) project.
|
|
|
135
136
|
### Start the backend
|
|
136
137
|
|
|
137
138
|
\`\`\`bash
|
|
138
|
-
cd ${
|
|
139
|
+
cd ${e}
|
|
139
140
|
npx spree dev
|
|
140
141
|
\`\`\`
|
|
141
142
|
|
|
142
143
|
Wait for the services to be healthy, then open:
|
|
143
144
|
|
|
144
145
|
- **Admin Dashboard:** http://localhost:${r}/admin
|
|
145
|
-
- Email: \`${
|
|
146
|
-
- Password: \`${
|
|
146
|
+
- Email: \`${Vr}\`
|
|
147
|
+
- Password: \`${Wr}\`
|
|
147
148
|
- **Store API:** http://localhost:${r}/api/v3/store
|
|
148
|
-
|
|
149
|
-
`;return e&&(n+=`
|
|
149
|
+
`;return t&&(n+=`
|
|
150
150
|
### Start the storefront
|
|
151
151
|
|
|
152
152
|
\`\`\`bash
|
|
@@ -210,9 +210,13 @@ This project uses [\`@spree/cli\`](https://www.npmjs.com/package/@spree/cli) to
|
|
|
210
210
|
- [Spree Documentation](https://docs.spreecommerce.org)
|
|
211
211
|
- [Store API Reference](https://docs.spreecommerce.org/api-reference/store)
|
|
212
212
|
- [Spree GitHub](https://github.com/spree/spree)
|
|
213
|
-
`,n}function
|
|
213
|
+
`,n}function yp(){return`node_modules/
|
|
214
214
|
.env
|
|
215
215
|
.env.local
|
|
216
216
|
.DS_Store
|
|
217
|
-
`}
|
|
218
|
-
|
|
217
|
+
`}function bp(){return`# Agent Instructions
|
|
218
|
+
|
|
219
|
+
See [CLAUDE.md](./CLAUDE.md) for full project instructions and conventions.
|
|
220
|
+
`}function Sp(e){let t=["# Spree Commerce Application","","## Project Structure","","| Directory | Description |","|-----------|-------------|","| `backend/` | Rails API application (Spree Commerce) |"];return e&&t.push("| `apps/storefront/` | Next.js storefront |"),t.push("","## Agent Instructions","","- **Backend work** (Ruby/Rails, Spree models, API, database): See `backend/CLAUDE.md`"),e&&t.push("- **Storefront work** (Next.js, React, TypeScript): See `apps/storefront/CLAUDE.md`"),t.push("","## Spree Documentation","","Full developer docs are installed locally:","","```","node_modules/@spree/docs/dist/","\u251C\u2500\u2500 developer/","\u2502 \u251C\u2500\u2500 core-concepts/ # Products, orders, payments, inventory, etc.","\u2502 \u251C\u2500\u2500 customization/ # Decorators, extensions, configuration, dependencies","\u2502 \u251C\u2500\u2500 admin/ # Admin panel customization","\u2502 \u251C\u2500\u2500 storefront/ # Storefront building guides","\u2502 \u251C\u2500\u2500 sdk/ # TypeScript SDK documentation","\u2502 \u2514\u2500\u2500 tutorial/ # Step-by-step tutorials","\u251C\u2500\u2500 api-reference/","\u2502 \u251C\u2500\u2500 store-api/ # Store API v3 guides","\u2502 \u2514\u2500\u2500 store.yaml # OpenAPI 3.0 spec (all endpoints, params, schemas)","\u2514\u2500\u2500 integrations/ # Stripe, Meilisearch, etc.","```","","Read these files when you need Spree-specific guidance.","","## Common Commands","","```bash","npm run dev # Start backend (Docker)","npm run stop # Stop services","npm run console # Rails console","npm run logs # Backend logs","npx spree eject # Switch to local backend builds","```",""),t.join(`
|
|
221
|
+
`)}import wp from"fs";import Hr from"path";async function xp(e){let t=Hr.join(e,"apps","storefront");await we("git",["clone","--depth","1",cp,t],{stdio:"ignore"}),wp.rmSync(Hr.join(t,".git"),{recursive:!0,force:!0})}async function Ep(e,t){let[r,...n]=ni(t).split(" ");await we(r,n,{cwd:e,stdio:"ignore"})}async function $p(e,t){let r=Hr.join(e,"apps","storefront"),[n,...o]=ni(t).split(" ");await we(n,o,{cwd:r,stdio:"ignore"})}function _p(e,t,r){let n=Hr.join(e,"apps","storefront",".env.local");wp.writeFileSync(n,fp(t,r))}import qe from"fs";import Te from"path";async function Cp(e){let t=Te.join(e,"backend");await we("git",["clone","--depth","1",lp,t],{stdio:"ignore"}),qe.rmSync(Te.join(t,".git"),{recursive:!0,force:!0});let r=Te.join(t,".github","workflows");if(qe.existsSync(r)){let n=Te.join(e,".github","workflows");qe.mkdirSync(n,{recursive:!0});for(let o of qe.readdirSync(r))qe.renameSync(Te.join(r,o),Te.join(n,o));qe.rmSync(Te.join(t,".github"),{recursive:!0,force:!0})}}async function Ap(e){let t=U.resolve(e.directory),r=U.basename(t),{port:n,storefront:o}=e;e.start&&(await pp()||(Y("Docker is not running. Please start Docker and try again, or use --no-start."),process.exit(1))),j.existsSync(t)&&j.readdirSync(t).length>0&&(Y(`Directory ${fe.default.bold(e.directory)} is not empty.`),process.exit(1));let i=Yi();j.mkdirSync(t,{recursive:!0}),i.start("Downloading backend template..."),await Cp(t),i.stop("Backend template downloaded."),i.start("Creating project structure...");let s=U.join(t,"backend"),a=j.readFileSync(U.join(s,"docker-compose.yml"),"utf-8"),c=j.readFileSync(U.join(s,"docker-compose.dev.yml"),"utf-8");if(j.writeFileSync(U.join(t,"docker-compose.yml"),a),j.writeFileSync(U.join(t,"docker-compose.dev.yml"),c.replace("context: .","context: ./backend")),j.writeFileSync(U.join(t,".env"),mp(dp(),n)),j.writeFileSync(U.join(t,"package.json"),hp(r)),j.writeFileSync(U.join(t,"README.md"),gp(r,o,n)),j.writeFileSync(U.join(t,".gitignore"),yp()),j.writeFileSync(U.join(t,"CLAUDE.md"),Sp(o)),j.writeFileSync(U.join(t,"AGENTS.md"),bp()),i.stop("Project structure created."),i.start("Installing dependencies..."),await Ep(t,e.packageManager),i.stop("Dependencies installed."),o&&(i.start("Downloading storefront template..."),await xp(t),i.stop("Storefront template downloaded."),_p(t,n),i.start("Installing storefront dependencies..."),await $p(t,e.packageManager),i.stop("Storefront dependencies installed.")),e.start){let u=["spree","init"];e.sampleData||u.push("--no-sample-data"),await we("npx",u,{cwd:t,stdio:"inherit"}),o&&Q.info(`${fe.default.bold("Storefront")}: ${fe.default.cyan(`cd ${r}/apps/storefront && npm run dev`)}`)}else dS(r,o,n)}function dS(e,t,r){let n=["",`${fe.default.bold("Next steps:")}`,` cd ${e}`," npx spree dev"];t&&n.push("",` ${fe.default.dim("# In another terminal:")}`,` cd ${e}/apps/storefront`," npm install"," npm run dev"),n.push("",`${fe.default.bold("Admin Dashboard")}`,` http://localhost:${r}/admin`,` Email: ${Vr}`,` Password: ${Wr}`,"",`${fe.default.bold("Customize the backend")}`," npx spree eject",` ${fe.default.dim("# Then edit backend/Gemfile, backend/app/, backend/config/")}`),qi(n.join(`
|
|
222
|
+
`),"Project created!")}var fS=new Si().name("create-spree-app").description("Create a new Spree Commerce project").argument("[directory]","project directory").option("--no-storefront","skip Next.js storefront setup").option("--no-sample-data","skip loading sample data").option("--no-start","do not start Docker services").option("--port <number>","port for the Spree backend",String(3e3)).option("--use-npm","use npm as package manager").option("--use-yarn","use yarn as package manager").option("--use-pnpm","use pnpm as package manager").action(async(e,t)=>{Hi(oi.default.bold("Create Spree App"));let r=up();t.useNpm&&(r="npm"),t.useYarn&&(r="yarn"),t.usePnpm&&(r="pnpm");try{let n=await rs({directory:e,noStorefront:t.storefront===!1?!0:void 0,noSampleData:t.sampleData===!1?!0:void 0,noStart:t.start===!1?!0:void 0,packageManager:r}),o=Number(t.port),i=await _n({port:ts(o,o+100)});i!==o&&Q.warn(`Port ${o} is in use, using port ${oi.default.bold(String(i))} instead.`),await Ap({...n,port:i}),zi("Happy selling!")}catch(n){n instanceof Error&&n.message.includes("cancelled")&&(Y("Setup cancelled."),process.exit(0)),Y(n instanceof Error?n.message:"An unexpected error occurred."),process.exit(1)}});fS.parse();
|