@spree/cli 1.2.0 → 2.0.0-beta
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/README.md +167 -44
- package/dist/index.js +136 -6
- package/package.json +51 -77
- package/bin/dev +0 -17
- package/bin/dev.cmd +0 -3
- package/bin/run +0 -10
- package/bin/run.cmd +0 -3
- package/dist/commands/new/app.d.ts +0 -11
- package/dist/commands/new/app.d.ts.map +0 -1
- package/dist/commands/new/app.js +0 -164
- package/dist/commands/new/app.js.map +0 -1
- package/dist/commands/start/app.d.ts +0 -9
- package/dist/commands/start/app.d.ts.map +0 -1
- package/dist/commands/start/app.js +0 -42
- package/dist/commands/start/app.js.map +0 -1
- package/dist/domains/async/index.d.ts +0 -2
- package/dist/domains/async/index.d.ts.map +0 -1
- package/dist/domains/async/index.js +0 -9
- package/dist/domains/async/index.js.map +0 -1
- package/dist/domains/async/wait.d.ts +0 -7
- package/dist/domains/async/wait.d.ts.map +0 -1
- package/dist/domains/async/wait.js +0 -13
- package/dist/domains/async/wait.js.map +0 -1
- package/dist/domains/build/BuildScript.d.ts +0 -3
- package/dist/domains/build/BuildScript.d.ts.map +0 -1
- package/dist/domains/build/BuildScript.js +0 -3
- package/dist/domains/build/BuildScript.js.map +0 -1
- package/dist/domains/build/fetchBuildScript.d.ts +0 -4
- package/dist/domains/build/fetchBuildScript.d.ts.map +0 -1
- package/dist/domains/build/fetchBuildScript.js +0 -14
- package/dist/domains/build/fetchBuildScript.js.map +0 -1
- package/dist/domains/build/getBuildScript.d.ts +0 -4
- package/dist/domains/build/getBuildScript.d.ts.map +0 -1
- package/dist/domains/build/getBuildScript.js +0 -8
- package/dist/domains/build/getBuildScript.js.map +0 -1
- package/dist/domains/build/index.d.ts +0 -4
- package/dist/domains/build/index.d.ts.map +0 -1
- package/dist/domains/build/index.js +0 -12
- package/dist/domains/build/index.js.map +0 -1
- package/dist/domains/constants/api.d.ts +0 -2
- package/dist/domains/constants/api.d.ts.map +0 -1
- package/dist/domains/constants/api.js +0 -5
- package/dist/domains/constants/api.js.map +0 -1
- package/dist/domains/constants/index.d.ts +0 -2
- package/dist/domains/constants/index.d.ts.map +0 -1
- package/dist/domains/constants/index.js +0 -6
- package/dist/domains/constants/index.js.map +0 -1
- package/dist/domains/dependencies/ComparisonOperator.d.ts +0 -3
- package/dist/domains/dependencies/ComparisonOperator.d.ts.map +0 -1
- package/dist/domains/dependencies/ComparisonOperator.js +0 -3
- package/dist/domains/dependencies/ComparisonOperator.js.map +0 -1
- package/dist/domains/dependencies/ComparisonResult.d.ts +0 -3
- package/dist/domains/dependencies/ComparisonResult.d.ts.map +0 -1
- package/dist/domains/dependencies/ComparisonResult.js +0 -3
- package/dist/domains/dependencies/ComparisonResult.js.map +0 -1
- package/dist/domains/dependencies/VersionCheckResult.d.ts +0 -7
- package/dist/domains/dependencies/VersionCheckResult.d.ts.map +0 -1
- package/dist/domains/dependencies/VersionCheckResult.js +0 -3
- package/dist/domains/dependencies/VersionCheckResult.js.map +0 -1
- package/dist/domains/dependencies/VersionCondition.d.ts +0 -7
- package/dist/domains/dependencies/VersionCondition.d.ts.map +0 -1
- package/dist/domains/dependencies/VersionCondition.js +0 -3
- package/dist/domains/dependencies/VersionCondition.js.map +0 -1
- package/dist/domains/dependencies/checkDependencies.d.ts +0 -4
- package/dist/domains/dependencies/checkDependencies.d.ts.map +0 -1
- package/dist/domains/dependencies/checkDependencies.js +0 -25
- package/dist/domains/dependencies/checkDependencies.js.map +0 -1
- package/dist/domains/dependencies/checkVersionByShellCommand.d.ts +0 -4
- package/dist/domains/dependencies/checkVersionByShellCommand.d.ts.map +0 -1
- package/dist/domains/dependencies/checkVersionByShellCommand.js +0 -50
- package/dist/domains/dependencies/checkVersionByShellCommand.js.map +0 -1
- package/dist/domains/dependencies/compareVersions.d.ts +0 -4
- package/dist/domains/dependencies/compareVersions.d.ts.map +0 -1
- package/dist/domains/dependencies/compareVersions.js +0 -27
- package/dist/domains/dependencies/compareVersions.js.map +0 -1
- package/dist/domains/dependencies/extractVersion.d.ts +0 -3
- package/dist/domains/dependencies/extractVersion.d.ts.map +0 -1
- package/dist/domains/dependencies/extractVersion.js +0 -12
- package/dist/domains/dependencies/extractVersion.js.map +0 -1
- package/dist/domains/dependencies/parseVersionCondition.d.ts +0 -4
- package/dist/domains/dependencies/parseVersionCondition.d.ts.map +0 -1
- package/dist/domains/dependencies/parseVersionCondition.js +0 -47
- package/dist/domains/dependencies/parseVersionCondition.js.map +0 -1
- package/dist/domains/dependencies/validate/validateDependencies.d.ts +0 -4
- package/dist/domains/dependencies/validate/validateDependencies.d.ts.map +0 -1
- package/dist/domains/dependencies/validate/validateDependencies.js +0 -35
- package/dist/domains/dependencies/validate/validateDependencies.js.map +0 -1
- package/dist/domains/directory/createDirectory.d.ts +0 -3
- package/dist/domains/directory/createDirectory.d.ts.map +0 -1
- package/dist/domains/directory/createDirectory.js +0 -19
- package/dist/domains/directory/createDirectory.js.map +0 -1
- package/dist/domains/directory/existsDirectory.d.ts +0 -3
- package/dist/domains/directory/existsDirectory.d.ts.map +0 -1
- package/dist/domains/directory/existsDirectory.js +0 -16
- package/dist/domains/directory/existsDirectory.js.map +0 -1
- package/dist/domains/directory/getDirectory.d.ts +0 -4
- package/dist/domains/directory/getDirectory.d.ts.map +0 -1
- package/dist/domains/directory/getDirectory.js +0 -28
- package/dist/domains/directory/getDirectory.js.map +0 -1
- package/dist/domains/directory/index.d.ts +0 -5
- package/dist/domains/directory/index.d.ts.map +0 -1
- package/dist/domains/directory/index.js +0 -15
- package/dist/domains/directory/index.js.map +0 -1
- package/dist/domains/directory/removeFileOrDirectory.d.ts +0 -3
- package/dist/domains/directory/removeFileOrDirectory.d.ts.map +0 -1
- package/dist/domains/directory/removeFileOrDirectory.js +0 -8
- package/dist/domains/directory/removeFileOrDirectory.js.map +0 -1
- package/dist/domains/error/index.d.ts +0 -2
- package/dist/domains/error/index.d.ts.map +0 -1
- package/dist/domains/error/index.js +0 -9
- package/dist/domains/error/index.js.map +0 -1
- package/dist/domains/error/resolveToError.d.ts +0 -4
- package/dist/domains/error/resolveToError.d.ts.map +0 -1
- package/dist/domains/error/resolveToError.js +0 -16
- package/dist/domains/error/resolveToError.js.map +0 -1
- package/dist/domains/git-repository/cloneGitRepository.d.ts +0 -9
- package/dist/domains/git-repository/cloneGitRepository.d.ts.map +0 -1
- package/dist/domains/git-repository/cloneGitRepository.js +0 -35
- package/dist/domains/git-repository/cloneGitRepository.js.map +0 -1
- package/dist/domains/git-repository/index.d.ts +0 -3
- package/dist/domains/git-repository/index.d.ts.map +0 -1
- package/dist/domains/git-repository/index.js +0 -11
- package/dist/domains/git-repository/index.js.map +0 -1
- package/dist/domains/git-repository/terminateGitRepository.d.ts +0 -4
- package/dist/domains/git-repository/terminateGitRepository.d.ts.map +0 -1
- package/dist/domains/git-repository/terminateGitRepository.js +0 -11
- package/dist/domains/git-repository/terminateGitRepository.js.map +0 -1
- package/dist/domains/git-repository-url/extractSuggestionFromError.d.ts +0 -4
- package/dist/domains/git-repository-url/extractSuggestionFromError.d.ts.map +0 -1
- package/dist/domains/git-repository-url/extractSuggestionFromError.js +0 -18
- package/dist/domains/git-repository-url/extractSuggestionFromError.js.map +0 -1
- package/dist/domains/git-repository-url/getGitRepositoryURL.d.ts +0 -4
- package/dist/domains/git-repository-url/getGitRepositoryURL.d.ts.map +0 -1
- package/dist/domains/git-repository-url/getGitRepositoryURL.js +0 -42
- package/dist/domains/git-repository-url/getGitRepositoryURL.js.map +0 -1
- package/dist/domains/git-repository-url/index.d.ts +0 -4
- package/dist/domains/git-repository-url/index.d.ts.map +0 -1
- package/dist/domains/git-repository-url/index.js +0 -13
- package/dist/domains/git-repository-url/index.js.map +0 -1
- package/dist/domains/git-repository-url/validateGitRepositoryURL.d.ts +0 -5
- package/dist/domains/git-repository-url/validateGitRepositoryURL.d.ts.map +0 -1
- package/dist/domains/git-repository-url/validateGitRepositoryURL.js +0 -21
- package/dist/domains/git-repository-url/validateGitRepositoryURL.js.map +0 -1
- package/dist/domains/integration/Integration.d.ts +0 -6
- package/dist/domains/integration/Integration.d.ts.map +0 -1
- package/dist/domains/integration/Integration.js +0 -3
- package/dist/domains/integration/Integration.js.map +0 -1
- package/dist/domains/integration/fetchIntegrations.d.ts +0 -4
- package/dist/domains/integration/fetchIntegrations.d.ts.map +0 -1
- package/dist/domains/integration/fetchIntegrations.js +0 -17
- package/dist/domains/integration/fetchIntegrations.js.map +0 -1
- package/dist/domains/integration/getIntegration.d.ts +0 -9
- package/dist/domains/integration/getIntegration.d.ts.map +0 -1
- package/dist/domains/integration/getIntegration.js +0 -51
- package/dist/domains/integration/getIntegration.js.map +0 -1
- package/dist/domains/integration/index.d.ts +0 -4
- package/dist/domains/integration/index.d.ts.map +0 -1
- package/dist/domains/integration/index.js +0 -11
- package/dist/domains/integration/index.js.map +0 -1
- package/dist/domains/math/identity.d.ts +0 -8
- package/dist/domains/math/identity.d.ts.map +0 -1
- package/dist/domains/math/identity.js +0 -10
- package/dist/domains/math/identity.js.map +0 -1
- package/dist/domains/math/index.d.ts +0 -2
- package/dist/domains/math/index.d.ts.map +0 -1
- package/dist/domains/math/index.js +0 -9
- package/dist/domains/math/index.js.map +0 -1
- package/dist/domains/module/Module.d.ts +0 -10
- package/dist/domains/module/Module.d.ts.map +0 -1
- package/dist/domains/module/Module.js +0 -3
- package/dist/domains/module/Module.js.map +0 -1
- package/dist/domains/module/Runner.d.ts +0 -11
- package/dist/domains/module/Runner.d.ts.map +0 -1
- package/dist/domains/module/Runner.js +0 -3
- package/dist/domains/module/Runner.js.map +0 -1
- package/dist/domains/module/Template.d.ts +0 -18
- package/dist/domains/module/Template.d.ts.map +0 -1
- package/dist/domains/module/Template.js +0 -3
- package/dist/domains/module/Template.js.map +0 -1
- package/dist/domains/module/index.d.ts +0 -3
- package/dist/domains/module/index.d.ts.map +0 -1
- package/dist/domains/module/index.js +0 -5
- package/dist/domains/module/index.js.map +0 -1
- package/dist/domains/project-name/formatToProjectName.d.ts +0 -4
- package/dist/domains/project-name/formatToProjectName.d.ts.map +0 -1
- package/dist/domains/project-name/formatToProjectName.js +0 -8
- package/dist/domains/project-name/formatToProjectName.js.map +0 -1
- package/dist/domains/project-name/getProjectName.d.ts +0 -4
- package/dist/domains/project-name/getProjectName.d.ts.map +0 -1
- package/dist/domains/project-name/getProjectName.js +0 -33
- package/dist/domains/project-name/getProjectName.js.map +0 -1
- package/dist/domains/project-name/index.d.ts +0 -3
- package/dist/domains/project-name/index.d.ts.map +0 -1
- package/dist/domains/project-name/index.js +0 -11
- package/dist/domains/project-name/index.js.map +0 -1
- package/dist/domains/run/RunScript.d.ts +0 -3
- package/dist/domains/run/RunScript.d.ts.map +0 -1
- package/dist/domains/run/RunScript.js +0 -3
- package/dist/domains/run/RunScript.js.map +0 -1
- package/dist/domains/run/getRunScript.d.ts +0 -4
- package/dist/domains/run/getRunScript.d.ts.map +0 -1
- package/dist/domains/run/getRunScript.js +0 -14
- package/dist/domains/run/getRunScript.js.map +0 -1
- package/dist/domains/run/index.d.ts +0 -3
- package/dist/domains/run/index.d.ts.map +0 -1
- package/dist/domains/run/index.js +0 -10
- package/dist/domains/run/index.js.map +0 -1
- package/dist/domains/spree/Options.d.ts +0 -6
- package/dist/domains/spree/Options.d.ts.map +0 -1
- package/dist/domains/spree/Options.js +0 -3
- package/dist/domains/spree/Options.js.map +0 -1
- package/dist/domains/spree/Spree.d.ts +0 -6
- package/dist/domains/spree/Spree.d.ts.map +0 -1
- package/dist/domains/spree/Spree.js +0 -3
- package/dist/domains/spree/Spree.js.map +0 -1
- package/dist/domains/spree/SpreeChoice.d.ts +0 -7
- package/dist/domains/spree/SpreeChoice.d.ts.map +0 -1
- package/dist/domains/spree/SpreeChoice.js +0 -3
- package/dist/domains/spree/SpreeChoice.js.map +0 -1
- package/dist/domains/spree/UserOptions.d.ts +0 -6
- package/dist/domains/spree/UserOptions.d.ts.map +0 -1
- package/dist/domains/spree/UserOptions.js +0 -3
- package/dist/domains/spree/UserOptions.js.map +0 -1
- package/dist/domains/spree/buildSpreeChoices.d.ts +0 -7
- package/dist/domains/spree/buildSpreeChoices.d.ts.map +0 -1
- package/dist/domains/spree/buildSpreeChoices.js +0 -28
- package/dist/domains/spree/buildSpreeChoices.js.map +0 -1
- package/dist/domains/spree/fetchSpreeTemplates.d.ts +0 -4
- package/dist/domains/spree/fetchSpreeTemplates.d.ts.map +0 -1
- package/dist/domains/spree/fetchSpreeTemplates.js +0 -20
- package/dist/domains/spree/fetchSpreeTemplates.js.map +0 -1
- package/dist/domains/spree/getSpree.d.ts +0 -6
- package/dist/domains/spree/getSpree.d.ts.map +0 -1
- package/dist/domains/spree/getSpree.js +0 -24
- package/dist/domains/spree/getSpree.js.map +0 -1
- package/dist/domains/spree/index.d.ts +0 -8
- package/dist/domains/spree/index.d.ts.map +0 -1
- package/dist/domains/spree/index.js +0 -17
- package/dist/domains/spree/index.js.map +0 -1
- package/dist/domains/theme/index.d.ts +0 -2
- package/dist/domains/theme/index.d.ts.map +0 -1
- package/dist/domains/theme/index.js +0 -9
- package/dist/domains/theme/index.js.map +0 -1
- package/dist/domains/theme/inheritTheme.d.ts +0 -7
- package/dist/domains/theme/inheritTheme.d.ts.map +0 -1
- package/dist/domains/theme/inheritTheme.js +0 -38
- package/dist/domains/theme/inheritTheme.js.map +0 -1
- package/dist/domains/theme/processMagicComments.d.ts +0 -3
- package/dist/domains/theme/processMagicComments.d.ts.map +0 -1
- package/dist/domains/theme/processMagicComments.js +0 -14
- package/dist/domains/theme/processMagicComments.js.map +0 -1
- package/dist/domains/theme/removeDevCommentBlocks.d.ts +0 -3
- package/dist/domains/theme/removeDevCommentBlocks.d.ts.map +0 -1
- package/dist/domains/theme/removeDevCommentBlocks.js +0 -7
- package/dist/domains/theme/removeDevCommentBlocks.js.map +0 -1
- package/dist/domains/theme/uncommentProjectOnlyBlocks.d.ts +0 -3
- package/dist/domains/theme/uncommentProjectOnlyBlocks.d.ts.map +0 -1
- package/dist/domains/theme/uncommentProjectOnlyBlocks.js +0 -7
- package/dist/domains/theme/uncommentProjectOnlyBlocks.js.map +0 -1
- package/dist/domains/typescript/Diff.d.ts +0 -3
- package/dist/domains/typescript/Diff.d.ts.map +0 -1
- package/dist/domains/typescript/Diff.js +0 -3
- package/dist/domains/typescript/Diff.js.map +0 -1
- package/dist/domains/typescript/index.d.ts +0 -3
- package/dist/domains/typescript/index.d.ts.map +0 -1
- package/dist/domains/typescript/index.js +0 -10
- package/dist/domains/typescript/index.js.map +0 -1
- package/dist/domains/typescript/notEmpty.d.ts +0 -3
- package/dist/domains/typescript/notEmpty.d.ts.map +0 -1
- package/dist/domains/typescript/notEmpty.js +0 -7
- package/dist/domains/typescript/notEmpty.js.map +0 -1
- package/dist/domains/variables/Variables.d.ts +0 -9
- package/dist/domains/variables/Variables.d.ts.map +0 -1
- package/dist/domains/variables/Variables.js +0 -3
- package/dist/domains/variables/Variables.js.map +0 -1
- package/dist/domains/variables/index.d.ts +0 -3
- package/dist/domains/variables/index.d.ts.map +0 -1
- package/dist/domains/variables/index.js +0 -10
- package/dist/domains/variables/index.js.map +0 -1
- package/dist/domains/variables/useVariables.d.ts +0 -7
- package/dist/domains/variables/useVariables.d.ts.map +0 -1
- package/dist/domains/variables/useVariables.js +0 -19
- package/dist/domains/variables/useVariables.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/infrastructures/i18next.d.ts +0 -2
- package/dist/infrastructures/i18next.d.ts.map +0 -1
- package/dist/infrastructures/i18next.js +0 -23
- package/dist/infrastructures/i18next.js.map +0 -1
- package/locales/en-US/translation.json +0 -58
- package/oclif.manifest.json +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,136 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from "node:module";
|
|
3
|
+
const require = __createRequire(import.meta.url);
|
|
4
|
+
var am=Object.create;var Ri=Object.defineProperty;var um=Object.getOwnPropertyDescriptor;var cm=Object.getOwnPropertyNames;var lm=Object.getPrototypeOf,dm=Object.prototype.hasOwnProperty;var N=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var mm=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of cm(e))!dm.call(t,o)&&o!==r&&Ri(t,o,{get:()=>e[o],enumerable:!(n=um(e,o))||n.enumerable});return t};var G=(t,e,r)=>(r=t!=null?am(lm(t)):{},mm(e||!t||!t.__esModule?Ri(r,"default",{value:t,enumerable:!0}):r,t));var st=g(ln=>{"use strict";var It=class extends Error{constructor(e,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},cn=class extends It{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};ln.CommanderError=It;ln.InvalidArgumentError=cn});var Rt=g(mn=>{"use strict";var{InvalidArgumentError:fm}=st(),dn=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new fm(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function pm(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}mn.Argument=dn;mn.humanReadableArgName=pm});var Dn=g(pn=>{"use strict";var{humanReadableArgName:Dm}=Rt(),fn=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let r=e.commands.filter(o=>!o._hidden),n=e._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((o,s)=>o.name().localeCompare(s.name())),r}compareOptions(e,r){let n=o=>o.short?o.short.replace(/^-/,""):o.long.replace(/^--/,"");return n(e).localeCompare(n(r))}visibleOptions(e){let r=e.options.filter(o=>!o.hidden),n=e._getHelpOption();if(n&&!n.hidden){let o=n.short&&e._findOption(n.short),s=n.long&&e._findOption(n.long);!o&&!s?r.push(n):n.long&&!s?r.push(e.createOption(n.long,n.description)):n.short&&!o&&r.push(e.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let n=e.parent;n;n=n.parent){let o=n.options.filter(s=>!s.hidden);r.push(...o)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(n=>Dm(n)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(o)))),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(o)))),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((n,o)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(o)))),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let n="";for(let o=e.parent;o;o=o.parent)n=o.name()+" "+n;return n+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return e.description?`${e.description} ${n}`:n}return e.description}formatHelp(e,r){let n=r.padWidth(e,r),o=r.helpWidth??80;function s(d,m){return r.formatItem(d,n,m,r)}let i=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(e))}`,""],a=r.commandDescription(e);a.length>0&&(i=i.concat([r.boxWrap(r.styleCommandDescription(a),o),""]));let u=r.visibleArguments(e).map(d=>s(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));u.length>0&&(i=i.concat([r.styleTitle("Arguments:"),...u,""]));let c=r.visibleOptions(e).map(d=>s(r.styleOptionTerm(r.optionTerm(d)),r.styleOptionDescription(r.optionDescription(d))));if(c.length>0&&(i=i.concat([r.styleTitle("Options:"),...c,""])),r.showGlobalOptions){let d=r.visibleGlobalOptions(e).map(m=>s(r.styleOptionTerm(r.optionTerm(m)),r.styleOptionDescription(r.optionDescription(m))));d.length>0&&(i=i.concat([r.styleTitle("Global Options:"),...d,""]))}let l=r.visibleCommands(e).map(d=>s(r.styleSubcommandTerm(r.subcommandTerm(d)),r.styleSubcommandDescription(r.subcommandDescription(d))));return l.length>0&&(i=i.concat([r.styleTitle("Commands:"),...l,""])),i.join(`
|
|
5
|
+
`)}displayWidth(e){return Mi(e).length}styleTitle(e){return e}styleUsage(e){return e.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(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,r,n,o){let i=" ".repeat(2);if(!n)return i+e;let a=e.padEnd(r+e.length-o.displayWidth(e)),u=2,l=(this.helpWidth??80)-r-u-2,d;return l<this.minWidthToWrap||o.preformatted(n)?d=n:d=o.boxWrap(n,l).replace(/\n/g,`
|
|
6
|
+
`+" ".repeat(r+u)),i+a+" ".repeat(u)+d.replace(/\n/g,`
|
|
7
|
+
${i}`)}boxWrap(e,r){if(r<this.minWidthToWrap)return e;let n=e.split(/\r\n|\n/),o=/[\s]*[^\s]+/g,s=[];return n.forEach(i=>{let a=i.match(o);if(a===null){s.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let d=this.displayWidth(l);if(c+d<=r){u.push(l),c+=d;return}s.push(u.join(""));let m=l.trimStart();u=[m],c=this.displayWidth(m)}),s.push(u.join(""))}),s.join(`
|
|
8
|
+
`)}};function Mi(t){let e=/\x1b\[\d*(;\d*)*m/g;return t.replace(e,"")}pn.Help=fn;pn.stripColor=Mi});var Cn=g(bn=>{"use strict";var{InvalidArgumentError:hm}=st(),hn=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let n=gm(e);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new hm(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Pi(this.name().replace(/^no-/,"")):Pi(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},gn=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.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(e,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let o=this.negativeOptions.get(n).presetArg,s=o!==void 0?o:!1;return r.negate===(s===e)}};function Pi(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function gm(t){let e,r,n=/^-[^-]$/,o=/^--[^-]/,s=t.split(/[ |,]+/).concat("guard");if(n.test(s[0])&&(e=s.shift()),o.test(s[0])&&(r=s.shift()),!e&&n.test(s[0])&&(e=s.shift()),!e&&o.test(s[0])&&(e=r,r=s.shift()),s[0].startsWith("-")){let i=s[0],a=`option creation failed due to '${i}' in option flags '${t}'`;throw/^-[^-][^-]/.test(i)?new Error(`${a}
|
|
9
|
+
- a short flag is a single dash and a single character
|
|
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(i)?new Error(`${a}
|
|
12
|
+
- too many short flags`):o.test(i)?new Error(`${a}
|
|
13
|
+
- too many long flags`):new Error(`${a}
|
|
14
|
+
- unrecognised flag format`)}if(e===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${t}'.`);return{shortFlag:e,longFlag:r}}bn.Option=hn;bn.DualOptions=gn});var ki=g(Li=>{"use strict";function bm(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let n=0;n<=t.length;n++)r[n]=[n];for(let n=0;n<=e.length;n++)r[0][n]=n;for(let n=1;n<=e.length;n++)for(let o=1;o<=t.length;o++){let s=1;t[o-1]===e[n-1]?s=0:s=1,r[o][n]=Math.min(r[o-1][n]+1,r[o][n-1]+1,r[o-1][n-1]+s),o>1&&n>1&&t[o-1]===e[n-2]&&t[o-2]===e[n-1]&&(r[o][n]=Math.min(r[o][n],r[o-2][n-2]+1))}return r[t.length][e.length]}function Cm(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(i=>i.slice(2)));let n=[],o=3,s=.4;return e.forEach(i=>{if(i.length<=1)return;let a=bm(t,i),u=Math.max(t.length,i.length);(u-a)/u>s&&(a<o?(o=a,n=[i]):a===o&&n.push(i))}),n.sort((i,a)=>i.localeCompare(a)),r&&(n=n.map(i=>`--${i}`)),n.length>1?`
|
|
15
|
+
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
16
|
+
(Did you mean ${n[0]}?)`:""}Li.suggestSimilar=Cm});var Wi=g(Fn=>{"use strict";var Em=N("events").EventEmitter,En=N("child_process"),ue=N("path"),Mt=N("fs"),C=N("process"),{Argument:ym,humanReadableArgName:xm}=Rt(),{CommanderError:yn}=st(),{Help:wm,stripColor:Fm}=Dn(),{Option:ji,DualOptions:Sm}=Cn(),{suggestSimilar:Ni}=ki(),xn=class t extends Em{constructor(e){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=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>C.stdout.write(r),writeErr:r=>C.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>C.stdout.isTTY?C.stdout.columns:void 0,getErrHelpWidth:()=>C.stderr.isTTY?C.stderr.columns:void 0,getOutHasColors:()=>wn()??(C.stdout.isTTY&&C.stdout.hasColors?.()),getErrHasColors:()=>wn()??(C.stderr.isTTY&&C.stderr.hasColors?.()),stripColor:r=>Fm(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,n){let o=r,s=n;typeof o=="object"&&o!==null&&(s=o,o=null),s=s||{};let[,i,a]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(i);return o&&(u.description(o),u._executableHandler=!0),s.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(s.noHelp||s.hidden),u._executableFile=s.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),o?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new wm,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._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=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,r){return new ym(e,r)}argument(e,r,n,o){let s=this.createArgument(e,r);return typeof n=="function"?s.default(o).argParser(n):s.default(n),this.addArgument(s),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,r){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,n,o]=e.match(/([^ ]+) *(.*)/),s=r??"display help for command",i=this.createCommand(n);return i.helpOption(!1),o&&i.arguments(o),s&&i.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=i,this}addHelpCommand(e,r){return typeof e!="object"?(this.helpCommand(e,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,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(e,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
|
|
18
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,n){this._exitCallback&&this._exitCallback(new yn(e,r,n)),C.exit(e)}action(e){let r=n=>{let o=this.registeredArguments.length,s=n.slice(0,o);return this._storeOptionsAsProperties?s[o]=this:s[o]=this.opts(),s.push(this),e.apply(this,s)};return this._actionHandler=r,this}createOption(e,r){return new ji(e,r)}_callParseArg(e,r,n,o){try{return e.parseArg(r,n)}catch(s){if(s.code==="commander.invalidArgument"){let i=`${o} ${s.message}`;this.error(i,{exitCode:s.exitCode,code:s.code})}throw s}}_registerOption(e){let r=e.short&&this._findOption(e.short)||e.long&&this._findOption(e.long);if(r){let n=e.long&&this._findOption(e.long)?e.long:e.short;throw new Error(`Cannot add option '${e.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
19
|
+
- already used by option '${r.flags}'`)}this.options.push(e)}_registerCommand(e){let r=o=>[o.name()].concat(o.aliases()),n=r(e).find(o=>this._findCommand(o));if(n){let o=r(this._findCommand(n)).join("|"),s=r(e).join("|");throw new Error(`cannot add command '${s}' as already have command '${o}'`)}this.commands.push(e)}addOption(e){this._registerOption(e);let r=e.name(),n=e.attributeName();if(e.negate){let s=e.long.replace(/^--no-/,"--");this._findOption(s)||this.setOptionValueWithSource(n,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(n,e.defaultValue,"default");let o=(s,i,a)=>{s==null&&e.presetArg!==void 0&&(s=e.presetArg);let u=this.getOptionValue(n);s!==null&&e.parseArg?s=this._callParseArg(e,s,u,i):s!==null&&e.variadic&&(s=e._concatValue(s,u)),s==null&&(e.negate?s=!1:e.isBoolean()||e.optional?s=!0:s=""),this.setOptionValueWithSource(n,s,a)};return this.on("option:"+r,s=>{let i=`error: option '${e.flags}' argument '${s}' is invalid.`;o(s,i,"cli")}),e.envVar&&this.on("optionEnv:"+r,s=>{let i=`error: option '${e.flags}' value '${s}' from env '${e.envVar}' is invalid.`;o(s,i,"env")}),this}_optionEx(e,r,n,o,s){if(typeof r=="object"&&r instanceof ji)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let i=this.createOption(r,n);if(i.makeOptionMandatory(!!e.mandatory),typeof o=="function")i.default(s).argParser(o);else if(o instanceof RegExp){let a=o;o=(u,c)=>{let l=a.exec(u);return l?l[0]:c},i.default(s).argParser(o)}else i.default(o);return this.addOption(i)}option(e,r,n,o){return this._optionEx({},e,r,n,o)}requiredOption(e,r,n,o){return this._optionEx({mandatory:!0},e,r,n,o)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){return this._passThroughOptions=!!e,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(e=!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=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,n){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=n,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(e)!==void 0&&(r=n.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},e===void 0&&r.from===void 0){C.versions?.electron&&(r.from="electron");let o=C.execArgv??[];(o.includes("-e")||o.includes("--eval")||o.includes("-p")||o.includes("--print"))&&(r.from="eval")}e===void 0&&(e=C.argv),this.rawArgs=e.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=e[1],n=e.slice(2);break;case"electron":C.defaultApp?(this._scriptPath=e[1],n=e.slice(2)):n=e.slice(1);break;case"user":n=e.slice(0);break;case"eval":n=e.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(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,r);return this._parseCommand([],n),this}async parseAsync(e,r){this._prepareForParse();let n=this._prepareUserArgs(e,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(e,r,n){if(Mt.existsSync(e))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",s=`'${e}' does not exist
|
|
21
|
+
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
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(s)}_executeSubCommand(e,r){r=r.slice();let n=!1,o=[".js",".ts",".tsx",".mjs",".cjs"];function s(l,d){let m=ue.resolve(l,d);if(Mt.existsSync(m))return m;if(o.includes(ue.extname(d)))return;let f=o.find(D=>Mt.existsSync(`${m}${D}`));if(f)return`${m}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Mt.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=ue.resolve(ue.dirname(l),a)}if(a){let l=s(a,i);if(!l&&!e._executableFile&&this._scriptPath){let d=ue.basename(this._scriptPath,ue.extname(this._scriptPath));d!==this._name&&(l=s(a,`${d}-${e._name}`))}i=l||i}n=o.includes(ue.extname(i));let u;C.platform!=="win32"?n?(r.unshift(i),r=Ui(C.execArgv).concat(r),u=En.spawn(C.argv[0],r,{stdio:"inherit"})):u=En.spawn(i,r,{stdio:"inherit"}):(this._checkForMissingExecutable(i,a,e._name),r.unshift(i),r=Ui(C.execArgv).concat(r),u=En.spawn(C.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{C.on(d,()=>{u.killed===!1&&u.exitCode===null&&u.kill(d)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new yn(l,"commander.executeSubCommandAsync","(close)")):C.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(i,a,e._name);else if(l.code==="EACCES")throw new Error(`'${i}' not executable`);if(!c)C.exit(1);else{let d=new yn(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,c(d)}}),this.runningCommand=u}_dispatchSubcommand(e,r,n){let o=this._findCommand(e);o||this.help({error:!0}),o._prepareForParse();let s;return s=this._chainOrCallSubCommandHook(s,o,"preSubcommand"),s=this._chainOrCall(s,()=>{if(o._executableHandler)this._executeSubCommand(o,r.concat(n));else return o._parseCommand(r,n)}),s}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(n,o,s)=>{let i=o;if(o!==null&&n.parseArg){let a=`error: command-argument value '${o}' is invalid for argument '${n.name()}'.`;i=this._callParseArg(n,o,s,a)}return i};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,o)=>{let s=n.defaultValue;n.variadic?o<this.args.length?(s=this.args.slice(o),n.parseArg&&(s=s.reduce((i,a)=>e(n,a,i),n.defaultValue))):s===void 0&&(s=[]):o<this.args.length&&(s=this.args[o],n.parseArg&&(s=e(n,s,n.defaultValue))),r[o]=s}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let n=e,o=[];return this._getCommandAndAncestors().reverse().filter(s=>s._lifeCycleHooks[r]!==void 0).forEach(s=>{s._lifeCycleHooks[r].forEach(i=>{o.push({hookedCommand:s,callback:i})})}),r==="postAction"&&o.reverse(),o.forEach(s=>{n=this._chainOrCall(n,()=>s.callback(s.hookedCommand,this))}),n}_chainOrCallSubCommandHook(e,r,n){let o=e;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(s=>{o=this._chainOrCall(o,()=>s(this,r))}),o}_parseCommand(e,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(n.operands),r=n.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._getHelpCommand()&&e[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,e,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])},s=`command:${this.name()}`;if(this._actionHandler){o(),this._processArguments();let i;return i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{this.parent.emit(s,e,r)})),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent&&this.parent.listenerCount(s))o(),this._processArguments(),this.parent.emit(s,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(o(),this._processArguments())}else this.commands.length?(o(),this.help({error:!0})):(o(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(n=>{let o=n.attributeName();return this.getOptionValue(o)===void 0?!1:this.getOptionValueSource(o)!=="default"});e.filter(n=>n.conflictsWith.length>0).forEach(n=>{let o=e.find(s=>n.conflictsWith.includes(s.attributeName()));o&&this._conflictingOption(n,o)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],n=[],o=r,s=e.slice();function i(u){return u.length>1&&u[0]==="-"}let a=null;for(;s.length;){let u=s.shift();if(u==="--"){o===n&&o.push(u),o.push(...s);break}if(a&&!i(u)){this.emit(`option:${a.name()}`,u);continue}if(a=null,i(u)){let c=this._findOption(u);if(c){if(c.required){let l=s.shift();l===void 0&&this.optionMissingArgument(c),this.emit(`option:${c.name()}`,l)}else if(c.optional){let l=null;s.length>0&&!i(s[0])&&(l=s.shift()),this.emit(`option:${c.name()}`,l)}else this.emit(`option:${c.name()}`);a=c.variadic?c:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let c=this._findOption(`-${u[1]}`);if(c){c.required||c.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${c.name()}`,u.slice(2)):(this.emit(`option:${c.name()}`),s.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let c=u.indexOf("="),l=this._findOption(u.slice(0,c));if(l&&(l.required||l.optional)){this.emit(`option:${l.name()}`,u.slice(c+1));continue}}if(i(u)&&(o=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(u)){r.push(u),s.length>0&&n.push(...s);break}else if(this._getHelpCommand()&&u===this._getHelpCommand().name()){r.push(u),s.length>0&&r.push(...s);break}else if(this._defaultCommandName){n.push(u),s.length>0&&n.push(...s);break}}if(this._passThroughOptions){o.push(u),s.length>0&&o.push(...s);break}o.push(u)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let n=0;n<r;n++){let o=this.options[n].attributeName();e[o]=o===this._versionOptionName?this._version:this[o]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
|
|
24
|
+
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
25
|
+
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
26
|
+
`),this.outputHelp({error:!0}));let n=r||{},o=n.exitCode||1,s=n.code||"commander.error";this._exit(o,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in C.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,C.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Sm(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())&&e.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(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let n=i=>{let a=i.attributeName(),u=this.getOptionValue(a),c=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||i},o=i=>{let a=n(i),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},s=`error: ${o(e)} cannot be used with ${o(r)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let o=[],s=this;do{let i=s.createHelp().visibleOptions(s).filter(a=>a.long).map(a=>a.long);o=o.concat(i),s=s.parent}while(s&&!s._enablePositionalOptions);r=Ni(e,o)}let n=`error: unknown option '${e}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",s=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${e.length}.`;this.error(s,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let o=[];this.createHelp().visibleCommands(this).forEach(s=>{o.push(s.name()),s.alias()&&o.push(s.alias())}),r=Ni(e,o)}let n=`error: unknown command '${e}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(e,r,n){if(e===void 0)return this._version;this._version=e,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(`${e}
|
|
27
|
+
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===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]),e===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let o=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${o}'`)}return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>xm(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=ue.basename(e,ue.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp(),n=this._getOutputContext(e);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(e){e=e||{};let r=!!e.error,n,o,s;return r?(n=a=>this._outputConfiguration.writeErr(a),o=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),o=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(o||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:o,helpWidth:s}}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let n=this._getOutputContext(e),o={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(i=>i.emit("beforeAllHelp",o)),this.emit("beforeHelp",o);let s=this.helpInformation({error:n.error});if(r&&(s=r(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",o),this._getCommandAndAncestors().forEach(i=>i.emit("afterAllHelp",o))}helpOption(e,r){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",r=r??"display help for command",this._helpOption=this.createOption(e,r),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let r=Number(C.exitCode??0);r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
28
|
+
Expecting one of '${n.join("', '")}'`);let o=`${e}Help`;return this.on(o,s=>{let i;typeof r=="function"?i=r({error:s.error,command:s.command}):i=r,i&&s.write(`${i}
|
|
29
|
+
`)}),this}_outputHelpIfRequested(e){let r=this._getHelpOption();r&&e.find(o=>r.is(o))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Ui(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 wn(){if(C.env.NO_COLOR||C.env.FORCE_COLOR==="0"||C.env.FORCE_COLOR==="false")return!1;if(C.env.FORCE_COLOR||C.env.CLICOLOR_FORCE!==void 0)return!0}Fn.Command=xn;Fn.useColor=wn});var zi=g(H=>{"use strict";var{Argument:Vi}=Rt(),{Command:Sn}=Wi(),{CommanderError:Am,InvalidArgumentError:Gi}=st(),{Help:_m}=Dn(),{Option:Hi}=Cn();H.program=new Sn;H.createCommand=t=>new Sn(t);H.createOption=(t,e)=>new Hi(t,e);H.createArgument=(t,e)=>new Vi(t,e);H.Command=Sn;H.Option=Hi;H.Argument=Vi;H.Help=_m;H.CommanderError=Am;H.InvalidArgumentError=Gi;H.InvalidOptionArgumentError=Gi});var he=g((by,An)=>{"use strict";var Lt=process||{},Ki=Lt.argv||[],Pt=Lt.env||{},Om=!(Pt.NO_COLOR||Ki.includes("--no-color"))&&(!!Pt.FORCE_COLOR||Ki.includes("--color")||Lt.platform==="win32"||(Lt.stdout||{}).isTTY&&Pt.TERM!=="dumb"||!!Pt.CI),Tm=(t,e,r=t)=>n=>{let o=""+n,s=o.indexOf(e,t.length);return~s?t+vm(o,e,r,s)+e:t+o+e},vm=(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)},Ji=(t=Om)=>{let e=t?Tm:()=>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")}};An.exports=Ji();An.exports.createColors=Ji});var On=g((Cy,Xi)=>{"use strict";var _n={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"},$m={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},Bm={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?_n.up():"");return t&&(e+=_n.left),e}};Xi.exports={cursor:_n,scroll:$m,erase:Bm,beep:"\x07"}});var Qs=g((Sw,Zs)=>{"use strict";Zs.exports=Xs;Xs.sync=Ep;var Ks=N("fs");function Cp(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 Js(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:Cp(e,r)}function Xs(t,e,r){Ks.stat(t,function(n,o){r(n,n?!1:Js(o,t,e))})}function Ep(t,e){return Js(Ks.statSync(t),t,e)}});var oa=g((Aw,na)=>{"use strict";na.exports=ta;ta.sync=yp;var ea=N("fs");function ta(t,e,r){ea.stat(t,function(n,o){r(n,n?!1:ra(o,e))})}function yp(t,e){return ra(ea.statSync(t),e)}function ra(t,e){return t.isFile()&&xp(t,e)}function xp(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,d=r&c||r&u&&o===i||r&a&&n===s||r&l&&s===0;return d}});var sa=g((Ow,ia)=>{"use strict";var _w=N("fs"),ar;process.platform==="win32"||global.TESTING_WINDOWS?ar=Qs():ar=oa();ia.exports=Kn;Kn.sync=wp;function Kn(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){Kn(t,e||{},function(s,i){s?o(s):n(i)})})}ar(t,e||{},function(n,o){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function wp(t,e){try{return ar.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var fa=g((Tw,ma)=>{"use strict";var Ve=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",aa=N("path"),Fp=Ve?";":":",ua=sa(),ca=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),la=(t,e)=>{let r=e.colon||Fp,n=t.match(/\//)||Ve&&t.match(/\\/)?[""]:[...Ve?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],o=Ve?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=Ve?o.split(r):[""];return Ve&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:n,pathExt:s,pathExtExe:o}},da=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:o,pathExtExe:s}=la(t,e),i=[],a=c=>new Promise((l,d)=>{if(c===n.length)return e.all&&i.length?l(i):d(ca(t));let m=n[c],f=/^".*"$/.test(m)?m.slice(1,-1):m,D=aa.join(f,t),b=!f&&/^\.[\\\/]/.test(t)?t.slice(0,2)+D:D;l(u(b,c,0))}),u=(c,l,d)=>new Promise((m,f)=>{if(d===o.length)return m(a(l+1));let D=o[d];ua(c+D,{pathExt:s},(b,F)=>{if(!b&&F)if(e.all)i.push(c+D);else return m(c+D);return m(u(c,l,d+1))})});return r?a(0).then(c=>r(null,c),r):a(0)},Sp=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=la(t,e),s=[];for(let i=0;i<r.length;i++){let a=r[i],u=/^".*"$/.test(a)?a.slice(1,-1):a,c=aa.join(u,t),l=!u&&/^\.[\\\/]/.test(t)?t.slice(0,2)+c:c;for(let d=0;d<n.length;d++){let m=l+n[d];try{if(ua.sync(m,{pathExt:o}))if(e.all)s.push(m);else return m}catch{}}}if(e.all&&s.length)return s;if(e.nothrow)return null;throw ca(t)};ma.exports=da;da.sync=Sp});var Da=g((vw,Jn)=>{"use strict";var pa=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Jn.exports=pa;Jn.exports.default=pa});var Ca=g(($w,ba)=>{"use strict";var ha=N("path"),Ap=fa(),_p=Da();function ga(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=Ap.sync(t.command,{path:r[_p({env:r})],pathExt:e?ha.delimiter:void 0})}catch{}finally{s&&process.chdir(n)}return i&&(i=ha.resolve(o?t.options.cwd:"",i)),i}function Op(t){return ga(t)||ga(t,!0)}ba.exports=Op});var Ea=g((Bw,Zn)=>{"use strict";var Xn=/([()\][%!^"`<>&|;, *?])/g;function Tp(t){return t=t.replace(Xn,"^$1"),t}function vp(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(Xn,"^$1"),e&&(t=t.replace(Xn,"^$1")),t}Zn.exports.command=Tp;Zn.exports.argument=vp});var xa=g((Iw,ya)=>{"use strict";ya.exports=/^#!(.*)/});var Fa=g((Rw,wa)=>{"use strict";var $p=xa();wa.exports=(t="")=>{let e=t.match($p);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var Aa=g((Mw,Sa)=>{"use strict";var Qn=N("fs"),Bp=Fa();function Ip(t){let r=Buffer.alloc(150),n;try{n=Qn.openSync(t,"r"),Qn.readSync(n,r,0,150,0),Qn.closeSync(n)}catch{}return Bp(r.toString())}Sa.exports=Ip});var va=g((Pw,Ta)=>{"use strict";var Rp=N("path"),_a=Ca(),Oa=Ea(),Mp=Aa(),Pp=process.platform==="win32",Lp=/\.(?:com|exe)$/i,kp=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function jp(t){t.file=_a(t);let e=t.file&&Mp(t.file);return e?(t.args.unshift(t.file),t.command=e,_a(t)):t.file}function Np(t){if(!Pp)return t;let e=jp(t),r=!Lp.test(e);if(t.options.forceShell||r){let n=kp.test(e);t.command=Rp.normalize(t.command),t.command=Oa.command(t.command),t.args=t.args.map(s=>Oa.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 Up(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:Np(n)}Ta.exports=Up});var Ia=g((Lw,Ba)=>{"use strict";var eo=process.platform==="win32";function to(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 Wp(t,e){if(!eo)return;let r=t.emit;t.emit=function(n,o){if(n==="exit"){let s=$a(o,e);if(s)return r.call(t,"error",s)}return r.apply(t,arguments)}}function $a(t,e){return eo&&t===1&&!e.file?to(e.original,"spawn"):null}function Vp(t,e){return eo&&t===1&&!e.file?to(e.original,"spawnSync"):null}Ba.exports={hookChildProcess:Wp,verifyENOENT:$a,verifyENOENTSync:Vp,notFoundError:to}});var Pa=g((kw,Ge)=>{"use strict";var Ra=N("child_process"),ro=va(),no=Ia();function Ma(t,e,r){let n=ro(t,e,r),o=Ra.spawn(n.command,n.args,n.options);return no.hookChildProcess(o,n),o}function Gp(t,e,r){let n=ro(t,e,r),o=Ra.spawnSync(n.command,n.args,n.options);return o.error=o.error||no.verifyENOENTSync(o.status,n),o}Ge.exports=Ma;Ge.exports.spawn=Ma;Ge.exports.sync=Gp;Ge.exports._parse=ro;Ge.exports._enoent=no});var bi=g(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.DEFAULT_COLOR_MAP=void 0;rt.DEFAULT_COLOR_MAP={red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",white_bold:"\x1B[01m",reset:"\x1B[0m"};var gi=class{constructor(e=rt.DEFAULT_COLOR_MAP){this.text="",this.colorMap=e}addCharsWithColor(e,r){let n=this.colorMap[e];this.text+=n!==void 0?`${n}${r}${this.colorMap.reset}`:r}renderConsole(){return this.text}};rt.default=gi});var Ot=g($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.DEFAULT_HEADER_ALIGNMENT=$.DEFAULT_ROW_ALIGNMENT=$.DEFAULT_HEADER_FONT_COLOR=$.DEFAULT_ROW_FONT_COLOR=$.COLORS=$.ALIGNMENTS=$.DEFAULT_TABLE_STYLE=$.DEFAULT_ROW_SEPARATOR=$.DEFAULT_COLUMN_LEN=void 0;$.DEFAULT_COLUMN_LEN=20;$.DEFAULT_ROW_SEPARATOR=!1;$.DEFAULT_TABLE_STYLE={headerTop:{left:"\u250C",mid:"\u252C",right:"\u2510",other:"\u2500"},headerBottom:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"},tableBottom:{left:"\u2514",mid:"\u2534",right:"\u2518",other:"\u2500"},vertical:"\u2502",rowSeparator:{left:"\u251C",mid:"\u253C",right:"\u2524",other:"\u2500"}};$.ALIGNMENTS=["right","left","center"];$.COLORS=["red","green","yellow","white","blue","magenta","cyan","white_bold","reset"];$.DEFAULT_ROW_FONT_COLOR="white";$.DEFAULT_HEADER_FONT_COLOR="white_bold";$.DEFAULT_ROW_ALIGNMENT="right";$.DEFAULT_HEADER_ALIGNMENT="center"});var Pd=g(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});var JC=[{first:768,last:879},{first:1155,last:1158},{first:1160,last:1161},{first:1425,last:1469},{first:1471,last:1471},{first:1473,last:1474},{first:1476,last:1477},{first:1479,last:1479},{first:1536,last:1539},{first:1552,last:1557},{first:1611,last:1630},{first:1648,last:1648},{first:1750,last:1764},{first:1767,last:1768},{first:1770,last:1773},{first:1807,last:1807},{first:1809,last:1809},{first:1840,last:1866},{first:1958,last:1968},{first:2027,last:2035},{first:2305,last:2306},{first:2364,last:2364},{first:2369,last:2376},{first:2381,last:2381},{first:2385,last:2388},{first:2402,last:2403},{first:2433,last:2433},{first:2492,last:2492},{first:2497,last:2500},{first:2509,last:2509},{first:2530,last:2531},{first:2561,last:2562},{first:2620,last:2620},{first:2625,last:2626},{first:2631,last:2632},{first:2635,last:2637},{first:2672,last:2673},{first:2689,last:2690},{first:2748,last:2748},{first:2753,last:2757},{first:2759,last:2760},{first:2765,last:2765},{first:2786,last:2787},{first:2817,last:2817},{first:2876,last:2876},{first:2879,last:2879},{first:2881,last:2883},{first:2893,last:2893},{first:2902,last:2902},{first:2946,last:2946},{first:3008,last:3008},{first:3021,last:3021},{first:3134,last:3136},{first:3142,last:3144},{first:3146,last:3149},{first:3157,last:3158},{first:3260,last:3260},{first:3263,last:3263},{first:3270,last:3270},{first:3276,last:3277},{first:3298,last:3299},{first:3393,last:3395},{first:3405,last:3405},{first:3530,last:3530},{first:3538,last:3540},{first:3542,last:3542},{first:3633,last:3633},{first:3636,last:3642},{first:3655,last:3662},{first:3761,last:3761},{first:3764,last:3769},{first:3771,last:3772},{first:3784,last:3789},{first:3864,last:3865},{first:3893,last:3893},{first:3895,last:3895},{first:3897,last:3897},{first:3953,last:3966},{first:3968,last:3972},{first:3974,last:3975},{first:3984,last:3991},{first:3993,last:4028},{first:4038,last:4038},{first:4141,last:4144},{first:4146,last:4146},{first:4150,last:4151},{first:4153,last:4153},{first:4184,last:4185},{first:4448,last:4607},{first:4959,last:4959},{first:5906,last:5908},{first:5938,last:5940},{first:5970,last:5971},{first:6002,last:6003},{first:6068,last:6069},{first:6071,last:6077},{first:6086,last:6086},{first:6089,last:6099},{first:6109,last:6109},{first:6155,last:6157},{first:6313,last:6313},{first:6432,last:6434},{first:6439,last:6440},{first:6450,last:6450},{first:6457,last:6459},{first:6679,last:6680},{first:6912,last:6915},{first:6964,last:6964},{first:6966,last:6970},{first:6972,last:6972},{first:6978,last:6978},{first:7019,last:7027},{first:7616,last:7626},{first:7678,last:7679},{first:8203,last:8207},{first:8234,last:8238},{first:8288,last:8291},{first:8298,last:8303},{first:8400,last:8431},{first:12330,last:12335},{first:12441,last:12442},{first:43014,last:43014},{first:43019,last:43019},{first:43045,last:43046},{first:64286,last:64286},{first:65024,last:65039},{first:65056,last:65059},{first:65279,last:65279},{first:65529,last:65531},{first:68097,last:68099},{first:68101,last:68102},{first:68108,last:68111},{first:68152,last:68154},{first:68159,last:68159},{first:119143,last:119145},{first:119155,last:119170},{first:119173,last:119179},{first:119210,last:119213},{first:119362,last:119364},{first:917505,last:917505},{first:917536,last:917631},{first:917760,last:917999}];Ci.default=JC});var Ld=g(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});var XC=(t,e,r)=>{let n=0,o,s=r;if(t<e[0].first||t>e[s].last)return 0;for(;s>=n;)if(o=Math.floor((n+s)/2),t>e[o].last)n=o+1;else if(t<e[o].first)s=o-1;else return 1;return 0};Ei.default=XC});var yi=g(Tt=>{"use strict";var jd=Tt&&Tt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tt,"__esModule",{value:!0});var kd=jd(Pd()),ZC=jd(Ld()),QC=t=>t===0?0:t<32||t>=127&&t<160?-1:(0,ZC.default)(t,kd.default,kd.default.length-1)?0:1+ +(t>=4352&&(t<=4447||t===9001||t===9002||t>=11904&&t<=42191&&t!==12351||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65135||t>=65280&&t<=65376||t>=65504&&t<=65510||t>=131072&&t<=196605||t>=196608&&t<=262141));Tt.default=QC});var Nd=g(vt=>{"use strict";var eE=vt&&vt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vt,"__esModule",{value:!0});var tE=eE(yi()),rE=t=>{let e=0;for(let r=0;r<t.length;r++){let n=t.charCodeAt(r),o=(0,tE.default)(n);if(o<0)return-1;e+=o}return e};vt.default=rE});var Wd=g(Se=>{"use strict";var Ud=Se&&Se.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Se,"__esModule",{value:!0});Se.wcswidth=Se.wcwidth=void 0;var nE=Ud(Nd());Se.wcswidth=nE.default;var oE=Ud(yi());Se.wcwidth=oE.default});var xi=g(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.findWidthInConsole=Pe.stripAnsi=void 0;var iE=Wd(),sE=/\x1b\[\d{1,3}(;\d{1,3})*m/g,aE=t=>t.replace(sE,"");Pe.stripAnsi=aE;var uE=(t,e)=>{let r=0;return t=(0,Pe.stripAnsi)(t),e&&Object.entries(e).forEach(([n,o])=>{let s=new RegExp(n,"g");r+=(t.match(s)||[]).length*o,t=t.replace(n,"")}),r+=(0,iE.wcswidth)(t),r};Pe.findWidthInConsole=uE});var Fi=g(se=>{"use strict";Object.defineProperty(se,"__esModule",{value:!0});se.biggestWordInSentence=se.textWithPadding=se.splitTextIntoTextsOfMinLen=void 0;var wi=xi(),cE=(t,e,r)=>{let n=[];return t.split(/[\n\r]/).forEach(s=>{let i=s.split(" "),a=[],u=0;i.forEach(c=>{let l=(0,wi.findWidthInConsole)(c,r);u+l<=e?(u+=l+1,a.push(c)):(a.length>0&&n.push(a.join(" ")),a=[c],u=l+1)}),n.push(a.join(" "))}),n};se.splitTextIntoTextsOfMinLen=cE;var lE=(t,e,r,n)=>{let o=(0,wi.findWidthInConsole)(t,n),s=Math.floor((r-o)/2),i=r-s-o;if(r<o){let a=(0,se.splitTextIntoTextsOfMinLen)(t,r);return a.length===1?t:a.map(u=>(0,se.textWithPadding)(u,e,r,n)).join(`
|
|
30
|
+
`)}switch(e){case"left":return t.concat(" ".repeat(r-o));case"center":return" ".repeat(s).concat(t).concat(" ".repeat(i));default:return" ".repeat(r-o).concat(t)}};se.textWithPadding=lE;var dE=(t,e)=>t.split(" ").reduce((r,n)=>Math.max(r,(0,wi.findWidthInConsole)(n,e)),0);se.biggestWordInSentence=dE});var $t=g(x=>{"use strict";Object.defineProperty(x,"__esModule",{value:!0});x.getWidthLimitedColumnsArray=x.createHeaderAsRow=x.renderTableHorizontalBorders=x.findLenOfColumn=x.createRow=x.createColumFromOnlyName=x.createTableHorizontalBorders=x.convertRawRowOptionsToStandard=x.evaluateCellText=x.cellText=void 0;var Vd=xi(),Si=Fi(),Ai=Ot(),nt=(t,e)=>Math.max(t,e),mE=t=>t==null?"":`${t}`;x.cellText=mE;var fE=(t,e)=>e?`${e(t)}`:(0,x.cellText)(t);x.evaluateCellText=fE;var pE=t=>{if(t)return{color:t.color,separator:t.separator||Ai.DEFAULT_ROW_SEPARATOR}};x.convertRawRowOptionsToStandard=pE;var DE=({left:t,mid:e,right:r,other:n},o)=>{let s=t;return o.forEach(i=>{s+=n.repeat(i+2),s+=e}),s=s.slice(0,-e.length),s+=r,s};x.createTableHorizontalBorders=DE;var hE=t=>({name:t,title:t});x.createColumFromOnlyName=hE;var gE=(t,e,r)=>({color:t,separator:r,text:e});x.createRow=gE;var bE=(t,e,r)=>{let n=t.name,o=t.title,s=t.transform,i=nt(0,t?.minLen||0);return t.maxLen?(i=nt(i,nt(t.maxLen,(0,Si.biggestWordInSentence)(o,r))),i=e.reduce((a,u)=>nt(a,(0,Si.biggestWordInSentence)((0,x.evaluateCellText)(u.text[n],s),r)),i),i):(i=nt(i,(0,Vd.findWidthInConsole)(o,r)),e.forEach(a=>{i=nt(i,(0,Vd.findWidthInConsole)((0,x.evaluateCellText)(a.text[n],s),r))}),i)};x.findLenOfColumn=bE;var CE=(t,e)=>(0,x.createTableHorizontalBorders)(t,e);x.renderTableHorizontalBorders=CE;var EE=(t,e)=>{let r=Ai.DEFAULT_HEADER_FONT_COLOR,n=t(r,{},!1);return e.forEach(o=>{n.text[o.name]=o.title}),n};x.createHeaderAsRow=EE;var yE=(t,e,r)=>{let n={};return t.forEach(o=>{n[o.name]=(0,Si.splitTextIntoTextsOfMinLen)((0,x.cellText)(e.text[o.name]),o.length||Ai.DEFAULT_COLUMN_LEN,r)}),n};x.getWidthLimitedColumnsArray=yE});var Gd=g(fe=>{"use strict";Object.defineProperty(fe,"__esModule",{value:!0});fe.rawColumnToInternalColumn=fe.objIfExists=void 0;var xE=Ot(),wE=(t,e)=>e?{[t]:e}:{};fe.objIfExists=wE;var FE=(t,e)=>{var r;return Object.assign(Object.assign(Object.assign(Object.assign({name:t.name,title:(r=t.title)!==null&&r!==void 0?r:t.name},(0,fe.objIfExists)("color",t.color||e?.color)),(0,fe.objIfExists)("maxLen",t.maxLen||e?.maxLen)),(0,fe.objIfExists)("minLen",t.minLen||e?.minLen)),{alignment:t.alignment||e?.alignment||xE.DEFAULT_ROW_ALIGNMENT,transform:t.transform})};fe.rawColumnToInternalColumn=FE});var Hd=g(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.preProcessRows=ot.preProcessColumns=void 0;var SE=$t(),AE=t=>{t.computedColumns.length&&t.computedColumns.forEach(e=>{t.columns.some(n=>n.name===e.name)||(t.addColumn(Object.assign(Object.assign({},e),t.defaultColumnOptions)),t.rows.forEach((n,o,s)=>{let i=s.map(a=>a.text);n.text[e.name]=e.function(n.text,o,i)}))})},_E=t=>{t.enabledColumns.length&&(t.columns=t.columns.filter(e=>t.enabledColumns.includes(e.name)))},OE=t=>{t.disabledColumns.length&&(t.columns=t.columns.filter(e=>!t.disabledColumns.includes(e.name)))},TE=t=>{t.columns.forEach(e=>{e.length=(0,SE.findLenOfColumn)(e,t.rows,t.charLength)})},vE=t=>{AE(t),OE(t),_E(t),TE(t)};ot.preProcessColumns=vE;var $E=t=>{let e=t.rows.filter(r=>t.filterFunction(r.text)).sort((r,n)=>t.sortFunction(r.text,n.text));t.rows=e};ot.preProcessRows=$E});var _i=g(Y=>{"use strict";var qd=Y&&Y.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Y,"__esModule",{value:!0});Y.printSimpleTable=Y.renderSimpleTable=Y.renderTable=void 0;var Yd=qd(bi()),Kd=Fi(),ee=Ot(),Ae=$t(),BE=qd(Oi()),zd=Hd(),IE=(t,e,r,n,o,s,i,a)=>{let u=new Yd.default(i);return u.addCharsWithColor("",t.vertical),e.forEach(c=>{let d=r<n[c.name].length?(0,Ae.cellText)(n[c.name][r]):"";u.addCharsWithColor(ee.DEFAULT_ROW_FONT_COLOR," "),u.addCharsWithColor(o&&ee.DEFAULT_HEADER_FONT_COLOR||c.color||s.color,(0,Kd.textWithPadding)(d,c.alignment||ee.DEFAULT_ROW_ALIGNMENT,c.length||ee.DEFAULT_COLUMN_LEN,a)),u.addCharsWithColor("",` ${t.vertical}`)}),u.renderConsole()},Jd=(t,e,r,n,o,s)=>{let i=(0,Ae.getWidthLimitedColumnsArray)(e,r,s),a=Object.values(i).reduce((c,l)=>Math.max(c,l.length),0),u=[];for(let c=0;c<a;c+=1){let l=IE(t,e,c,i,o,r,n,s);u.push(l)}return u},RE=(t,e)=>{let r=JSON.parse(JSON.stringify(t)),n={};return e.filter(o=>!!o.transform).forEach(o=>{n[o.name]=o.transform}),Object.keys(n).forEach(o=>{r.text[o]=n[o](r.text[o])}),r},ME=(t,e)=>{let r=[],n=RE(e,t.columns);return r=r.concat(Jd(t.tableStyle,t.columns,n,t.colorMap,void 0,t.charLength)),r},PE=t=>{let e=[];if(t.title===void 0)return e;let r=()=>{let s=(i,a)=>i+a+2+1;return t.columns.map(i=>i.length||ee.DEFAULT_COLUMN_LEN).reduce(s,1)},n=(0,Kd.textWithPadding)(t.title,ee.DEFAULT_HEADER_ALIGNMENT,r()),o=new Yd.default(t.colorMap);return o.addCharsWithColor(ee.DEFAULT_HEADER_FONT_COLOR,n),e.push(o.renderConsole()),e},LE=t=>{let e=[];e.push((0,Ae.renderTableHorizontalBorders)(t.tableStyle.headerTop,t.columns.map(n=>n.length||ee.DEFAULT_COLUMN_LEN)));let r=(0,Ae.createHeaderAsRow)(Ae.createRow,t.columns);return e=e.concat(Jd(t.tableStyle,t.columns,r,t.colorMap,!0)),e.push((0,Ae.renderTableHorizontalBorders)(t.tableStyle.headerBottom,t.columns.map(n=>n.length||ee.DEFAULT_COLUMN_LEN))),e},kE=t=>{let e=[];return e.push((0,Ae.renderTableHorizontalBorders)(t.tableStyle.tableBottom,t.columns.map(r=>r.length||ee.DEFAULT_COLUMN_LEN))),e},jE=(t,e)=>{let r=[],n=t.rows.length-1;return t.rows.indexOf(e)!==n&&e.separator&&r.push((0,Ae.renderTableHorizontalBorders)(t.tableStyle.rowSeparator,t.columns.map(s=>s.length||ee.DEFAULT_COLUMN_LEN))),r},NE=t=>{(0,zd.preProcessColumns)(t),(0,zd.preProcessRows)(t);let e=[];return PE(t).forEach(r=>e.push(r)),LE(t).forEach(r=>e.push(r)),t.rows.forEach(r=>{ME(t,r).forEach(n=>e.push(n)),jE(t,r).forEach(n=>e.push(n))}),kE(t).forEach(r=>e.push(r)),e.join(`
|
|
31
|
+
`)};Y.renderTable=NE;var UE=(t,e)=>{let r=new BE.default(e);return r.addRows(t),(0,Y.renderTable)(r)};Y.renderSimpleTable=UE;var WE=(t,e)=>{console.log((0,Y.renderSimpleTable)(t,e))};Y.printSimpleTable=WE});var Oi=g(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});var VE=bi(),an=Ot(),Ti=$t(),vi=Gd(),GE=_i(),HE=()=>0,zE=()=>!0,$i=class{initSimple(e){this.columns=e.map(r=>({name:r,title:r,alignment:an.DEFAULT_ROW_ALIGNMENT}))}initDetailed(e){var r;this.title=e?.title||this.title,this.tableStyle=Object.assign(Object.assign({},this.tableStyle),e?.style),this.sortFunction=e?.sort||this.sortFunction,this.filterFunction=e?.filter||this.filterFunction,this.enabledColumns=e?.enabledColumns||this.enabledColumns,this.disabledColumns=e?.disabledColumns||this.disabledColumns,this.computedColumns=e?.computedColumns||this.computedColumns,this.columns=((r=e?.columns)===null||r===void 0?void 0:r.map(n=>(0,vi.rawColumnToInternalColumn)(n,e?.defaultColumnOptions)))||this.columns,this.rowSeparator=e?.rowSeparator||this.rowSeparator,this.charLength=e?.charLength||this.charLength,this.defaultColumnOptions=e?.defaultColumnOptions||this.defaultColumnOptions,e?.shouldDisableColors?this.colorMap={}:e?.colorMap&&(this.colorMap=Object.assign(Object.assign({},this.colorMap),e.colorMap)),e.rows!==void 0&&this.addRows(e.rows)}constructor(e){this.rows=[],this.columns=[],this.title=void 0,this.tableStyle=an.DEFAULT_TABLE_STYLE,this.filterFunction=zE,this.sortFunction=HE,this.enabledColumns=[],this.disabledColumns=[],this.computedColumns=[],this.rowSeparator=an.DEFAULT_ROW_SEPARATOR,this.colorMap=VE.DEFAULT_COLOR_MAP,this.charLength={},this.defaultColumnOptions=void 0,this.transforms={},e instanceof Array?this.initSimple(e):typeof e=="object"&&this.initDetailed(e)}createColumnFromRow(e){let r=this.columns.map(n=>n.name);Object.keys(e).forEach(n=>{r.includes(n)||this.columns.push((0,vi.rawColumnToInternalColumn)((0,Ti.createColumFromOnlyName)(n),this.defaultColumnOptions))})}addColumn(e){let r=typeof e=="string"?(0,Ti.createColumFromOnlyName)(e):e;this.columns.push((0,vi.rawColumnToInternalColumn)(r,this.defaultColumnOptions))}addColumns(e){e.forEach(r=>{this.addColumn(r)})}addRow(e,r){this.createColumnFromRow(e),this.rows.push((0,Ti.createRow)(r?.color||an.DEFAULT_ROW_FONT_COLOR,e,r?.separator!==void 0?r?.separator:this.rowSeparator))}addRows(e,r){e.forEach(n=>{this.addRow(n,r)})}renderTable(){return(0,GE.renderTable)(this)}};Bi.default=$i});var Zd=g(Bt=>{"use strict";var qE=Bt&&Bt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Bt,"__esModule",{value:!0});var YE=qE(Oi()),Xd=$t(),Ii=class{constructor(e){this.table=new YE.default(e)}addColumn(e){return this.table.addColumn(e),this}addColumns(e){return this.table.addColumns(e),this}addRow(e,r){return this.table.addRow(e,(0,Xd.convertRawRowOptionsToStandard)(r)),this}addRows(e,r){return this.table.addRows(e,(0,Xd.convertRawRowOptionsToStandard)(r)),this}printTable(){let e=this.table.renderTable();console.log(e)}render(){return this.table.renderTable()}};Bt.default=Ii});var em=g(ae=>{"use strict";var KE=ae&&ae.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ae,"__esModule",{value:!0});ae.renderTable=ae.printTable=ae.Table=void 0;var JE=KE(Zd());ae.Table=JE.default;var Qd=_i();Object.defineProperty(ae,"printTable",{enumerable:!0,get:function(){return Qd.printSimpleTable}});Object.defineProperty(ae,"renderTable",{enumerable:!0,get:function(){return Qd.renderSimpleTable}})});var qi=G(zi(),1),{program:ay,createCommand:uy,createArgument:cy,createOption:ly,CommanderError:dy,InvalidArgumentError:my,InvalidOptionArgumentError:fy,Command:Yi,Argument:py,Option:Dy,Help:hy}=qi.default;var sm=G(he(),1);import{stripVTControlCharacters as Mn}from"util";var P=G(On(),1),at=G(he(),1);import{stdin as as,stdout as us}from"process";import*as ge from"readline";import Zi from"readline";import{Writable as Im}from"stream";function Rm({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 Mm=Rm();function cs(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Mm,"")}function ls(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ds={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],d=e.length(l);if(a>=o-(d==2?1:0))if(a+d<=s)i+=l;else break;a+=d}return i}})(ds);var Pm=ds.exports,Lm=ls(Pm),km=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},jm=ls(km);function ut(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=cs(t),t.length===0))return 0;t=t.replace(jm()," ");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(Lm.eastAsianWidth(o)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Tn=10,Qi=(t=0)=>e=>`\x1B[${e+t}m`,es=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,ts=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`,S={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(S.modifier);var Nm=Object.keys(S.color),Um=Object.keys(S.bgColor);[...Nm,...Um];function Wm(){let t=new Map;for(let[e,r]of Object.entries(S)){for(let[n,o]of Object.entries(r))S[n]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},r[n]=S[n],t.set(o[0],o[1]);Object.defineProperty(S,e,{value:r,enumerable:!1})}return Object.defineProperty(S,"codes",{value:t,enumerable:!1}),S.color.close="\x1B[39m",S.bgColor.close="\x1B[49m",S.color.ansi=Qi(),S.color.ansi256=es(),S.color.ansi16m=ts(),S.bgColor.ansi=Qi(Tn),S.bgColor.ansi256=es(Tn),S.bgColor.ansi16m=ts(Tn),Object.defineProperties(S,{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=>S.rgbToAnsi256(...S.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)=>S.ansi256ToAnsi(S.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>S.ansi256ToAnsi(S.hexToAnsi256(e)),enumerable:!1}}),S}var Vm=Wm(),Vt=new Set(["\x1B","\x9B"]),Gm=39,Bn="\x07",ms="[",Hm="]",fs="m",In=`${Hm}8;;`,rs=t=>`${Vt.values().next().value}${ms}${t}${fs}`,ns=t=>`${Vt.values().next().value}${In}${t}${Bn}`,zm=t=>t.split(" ").map(e=>ut(e)),vn=(t,e,r)=>{let n=[...e],o=!1,s=!1,i=ut(cs(t[t.length-1]));for(let[a,u]of n.entries()){let c=ut(u);if(i+c<=r?t[t.length-1]+=u:(t.push(u),i=0),Vt.has(u)&&(o=!0,s=n.slice(a+1).join("").startsWith(In)),o){s?u===Bn&&(o=!1,s=!1):u===fs&&(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())},qm=t=>{let e=t.split(" "),r=e.length;for(;r>0&&!(ut(e[r-1])>0);)r--;return r===e.length?t:e.slice(0,r).join(" ")+e.slice(r).join("")},Ym=(t,e,r={})=>{if(r.trim!==!1&&t.trim()==="")return"";let n="",o,s,i=zm(t),a=[""];for(let[c,l]of t.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let d=ut(a[a.length-1]);if(c!==0&&(d>=e&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),d=0),(d>0||r.trim===!1)&&(a[a.length-1]+=" ",d++)),r.hard&&i[c]>e){let m=e-d,f=1+Math.floor((i[c]-m-1)/e);Math.floor((i[c]-1)/e)<f&&a.push(""),vn(a,l,e);continue}if(d+i[c]>e&&d>0&&i[c]>0){if(r.wordWrap===!1&&d<e){vn(a,l,e);continue}a.push("")}if(d+i[c]>e&&r.wordWrap===!1){vn(a,l,e);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>qm(c)));let u=[...a.join(`
|
|
32
|
+
`)];for(let[c,l]of u.entries()){if(n+=l,Vt.has(l)){let{groups:m}=new RegExp(`(?:\\${ms}(?<code>\\d+)m|\\${In}(?<uri>.*)${Bn})`).exec(u.slice(c).join(""))||{groups:{}};if(m.code!==void 0){let f=Number.parseFloat(m.code);o=f===Gm?void 0:f}else m.uri!==void 0&&(s=m.uri.length===0?void 0:m.uri)}let d=Vm.codes.get(Number(o));u[c+1]===`
|
|
33
|
+
`?(s&&(n+=ns("")),o&&d&&(n+=rs(d))):l===`
|
|
34
|
+
`&&(o&&d&&(n+=rs(o)),s&&(n+=ns(s)))}return n};function os(t,e,r){return String(t).normalize().replace(/\r\n/g,`
|
|
35
|
+
`).split(`
|
|
36
|
+
`).map(n=>Ym(n,e,r)).join(`
|
|
37
|
+
`)}var Km=["up","down","left","right","space","enter","cancel"],jt={actions:new Set(Km),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Rn(t,e){if(typeof t=="string")return jt.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Rn(r,e))return!0;return!1}function Jm(t,e){if(t===e)return;let r=t.split(`
|
|
38
|
+
`),n=e.split(`
|
|
39
|
+
`),o=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&o.push(s);return o}var Xm=globalThis.process.platform.startsWith("win"),$n=Symbol("clack:cancel");function be(t){return t===$n}function kt(t,e){let r=t;r.isTTY&&r.setRawMode(e)}function ps({input:t=as,output:e=us,overwrite:r=!0,hideCursor:n=!0}={}){let o=ge.createInterface({input:t,output:e,prompt:"",tabSize:1});ge.emitKeypressEvents(t,o),t.isTTY&&t.setRawMode(!0);let s=(i,{name:a,sequence:u})=>{let c=String(i);if(Rn([c,a,u],"cancel")){n&&e.write(P.cursor.show),process.exit(0);return}if(!r)return;ge.moveCursor(e,a==="return"?0:-1,a==="return"?-1:0,()=>{ge.clearLine(e,1,()=>{t.once("keypress",s)})})};return n&&e.write(P.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),n&&e.write(P.cursor.show),t.isTTY&&!Xm&&t.setRawMode(!1),o.terminal=!1,o.close()}}var Zm=Object.defineProperty,Qm=(t,e,r)=>e in t?Zm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,U=(t,e,r)=>(Qm(t,typeof e!="symbol"?e+"":e,r),r),ct=class{constructor(e,r=!0){U(this,"input"),U(this,"output"),U(this,"_abortSignal"),U(this,"rl"),U(this,"opts"),U(this,"_render"),U(this,"_track",!1),U(this,"_prevFrame",""),U(this,"_subscribers",new Map),U(this,"_cursor",0),U(this,"state","initial"),U(this,"error",""),U(this,"value");let{input:n=as,output:o=us,render:s,signal:i,...a}=e;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=i,this.input=n,this.output=o}unsubscribe(){this._subscribers.clear()}setSubscriber(e,r){let n=this._subscribers.get(e)??[];n.push(r),this._subscribers.set(e,n)}on(e,r){this.setSubscriber(e,{cb:r})}once(e,r){this.setSubscriber(e,{cb:r,once:!0})}emit(e,...r){let n=this._subscribers.get(e)??[],o=[];for(let s of n)s.cb(...r),s.once&&o.push(()=>n.splice(n.indexOf(s),1));for(let s of o)s()}prompt(){return new Promise((e,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),e($n);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new Im;n._write=(o,s,i)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),i()},this.input.pipe(n),this.rl=Zi.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),Zi.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),kt(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(P.cursor.show),this.output.off("resize",this.render),kt(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(P.cursor.show),this.output.off("resize",this.render),kt(this.input,!1),e($n)})})}onKeypress(e,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&jt.aliases.has(r.name)&&this.emit("cursor",jt.aliases.get(r.name)),jt.actions.has(r.name)&&this.emit("cursor",r.name)),e&&(e.toLowerCase()==="y"||e.toLowerCase()==="n")&&this.emit("confirm",e.toLowerCase()==="y"),e===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),e&&this.emit("key",e.toLowerCase()),r?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Rn([e,r?.name,r?.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(`
|
|
40
|
+
`),kt(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let e=os(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
41
|
+
`).length-1;this.output.write(P.cursor.move(-999,e*-1))}render(){let e=os(this._render(this)??"",process.stdout.columns,{hard:!0});if(e!==this._prevFrame){if(this.state==="initial")this.output.write(P.cursor.hide);else{let r=Jm(this._prevFrame,e);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(P.cursor.move(0,n)),this.output.write(P.erase.lines(1));let o=e.split(`
|
|
42
|
+
`);this.output.write(o[n]),this._prevFrame=e,this.output.write(P.cursor.move(0,o.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(P.cursor.move(0,n)),this.output.write(P.erase.down());let o=e.split(`
|
|
43
|
+
`).slice(n);this.output.write(o.join(`
|
|
44
|
+
`)),this._prevFrame=e;return}this.output.write(P.erase.down())}this.output.write(e),this.state==="initial"&&(this.state="active"),this._prevFrame=e}}};var ef;ef=new WeakMap;var tf=Object.defineProperty,rf=(t,e,r)=>e in t?tf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,is=(t,e,r)=>(rf(t,typeof e!="symbol"?e+"":e,r),r),Nt=class extends ct{constructor({mask:e,...r}){super(r),is(this,"valueWithCursor",""),is(this,"_mask","\u2022"),this._mask=e??"\u2022",this.on("finalize",()=>{this.valueWithCursor=this.masked}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.masked}${at.default.inverse(at.default.hidden("_"))}`;else{let n=this.masked.slice(0,this.cursor),o=this.masked.slice(this.cursor);this.valueWithCursor=`${n}${at.default.inverse(o[0])}${o.slice(1)}`}})}get cursor(){return this._cursor}get masked(){return this.value.replaceAll(/./g,this._mask)}},nf=Object.defineProperty,of=(t,e,r)=>e in t?nf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ss=(t,e,r)=>(of(t,typeof e!="symbol"?e+"":e,r),r),Ut=class extends ct{constructor(e){super(e,!1),ss(this,"options"),ss(this,"cursor",0),this.options=e.options,this.cursor=this.options.findIndex(({value:r})=>r===e.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var Wt=class extends ct{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let e=this.value.slice(0,this.cursor),[r,...n]=this.value.slice(this.cursor);return`${e}${at.default.inverse(r)}${n.join("")}`}get cursor(){return this._cursor}constructor(e){super(e),this.on("finalize",()=>{this.value||(this.value=e.defaultValue)})}};var p=G(he(),1),Gt=G(On(),1);import K from"process";function sf(){return K.platform!=="win32"?K.env.TERM!=="linux":!!K.env.CI||!!K.env.WT_SESSION||!!K.env.TERMINUS_SUBLIME||K.env.ConEmuTask==="{cmd::Cmder}"||K.env.TERM_PROGRAM==="Terminus-Sublime"||K.env.TERM_PROGRAM==="vscode"||K.env.TERM==="xterm-256color"||K.env.TERM==="alacritty"||K.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Pn=sf(),O=(t,e)=>Pn?t:e,af=O("\u25C6","*"),hs=O("\u25A0","x"),gs=O("\u25B2","x"),Ht=O("\u25C7","o"),By=O("\u250C","T"),w=O("\u2502","|"),Le=O("\u2514","\u2014"),uf=O("\u25CF",">"),cf=O("\u25CB"," "),Iy=O("\u25FB","[\u2022]"),Ry=O("\u25FC","[+]"),My=O("\u25FB","[ ]"),lf=O("\u25AA","\u2022"),Ds=O("\u2500","-"),df=O("\u256E","+"),mf=O("\u251C","+"),ff=O("\u256F","+"),pf=O("\u25CF","\u2022"),Df=O("\u25C6","*"),hf=O("\u25B2","!"),gf=O("\u25A0","x"),Ln=t=>{switch(t){case"initial":case"active":return p.default.cyan(af);case"cancel":return p.default.red(hs);case"error":return p.default.yellow(gs);case"submit":return p.default.green(Ht)}},bf=t=>{let{cursor:e,options:r,style:n}=t,o=t.maxItems??Number.POSITIVE_INFINITY,s=Math.max(process.stdout.rows-4,0),i=Math.min(s,Math.max(o,5)),a=0;e>=a+i-3?a=Math.max(Math.min(e-i+3,r.length-i),0):e<a+2&&(a=Math.max(e-2,0));let u=i<r.length&&a>0,c=i<r.length&&a+i<r.length;return r.slice(a,a+i).map((l,d,m)=>{let f=d===0&&u,D=d===m.length-1&&c;return f||D?p.default.dim("..."):n(l,d+a===e)})},zt=t=>new Wt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let e=`${p.default.gray(w)}
|
|
45
|
+
${Ln(this.state)} ${t.message}
|
|
46
|
+
`,r=t.placeholder?p.default.inverse(t.placeholder[0])+p.default.dim(t.placeholder.slice(1)):p.default.inverse(p.default.hidden("_")),n=this.value?this.valueWithCursor:r;switch(this.state){case"error":return`${e.trim()}
|
|
47
|
+
${p.default.yellow(w)} ${n}
|
|
48
|
+
${p.default.yellow(Le)} ${p.default.yellow(this.error)}
|
|
49
|
+
`;case"submit":return`${e}${p.default.gray(w)} ${p.default.dim(this.value||t.placeholder)}`;case"cancel":return`${e}${p.default.gray(w)} ${p.default.strikethrough(p.default.dim(this.value??""))}${this.value?.trim()?`
|
|
50
|
+
${p.default.gray(w)}`:""}`;default:return`${e}${p.default.cyan(w)} ${n}
|
|
51
|
+
${p.default.cyan(Le)}
|
|
52
|
+
`}}}).prompt(),bs=t=>new Nt({validate:t.validate,mask:t.mask??lf,render(){let e=`${p.default.gray(w)}
|
|
53
|
+
${Ln(this.state)} ${t.message}
|
|
54
|
+
`,r=this.valueWithCursor,n=this.masked;switch(this.state){case"error":return`${e.trim()}
|
|
55
|
+
${p.default.yellow(w)} ${n}
|
|
56
|
+
${p.default.yellow(Le)} ${p.default.yellow(this.error)}
|
|
57
|
+
`;case"submit":return`${e}${p.default.gray(w)} ${p.default.dim(n)}`;case"cancel":return`${e}${p.default.gray(w)} ${p.default.strikethrough(p.default.dim(n??""))}${n?`
|
|
58
|
+
${p.default.gray(w)}`:""}`;default:return`${e}${p.default.cyan(w)} ${r}
|
|
59
|
+
${p.default.cyan(Le)}
|
|
60
|
+
`}}}).prompt();var Cs=t=>{let e=(r,n)=>{let o=r.label??String(r.value);switch(n){case"selected":return`${p.default.dim(o)}`;case"active":return`${p.default.green(uf)} ${o} ${r.hint?p.default.dim(`(${r.hint})`):""}`;case"cancelled":return`${p.default.strikethrough(p.default.dim(o))}`;default:return`${p.default.dim(cf)} ${p.default.dim(o)}`}};return new Ut({options:t.options,initialValue:t.initialValue,render(){let r=`${p.default.gray(w)}
|
|
61
|
+
${Ln(this.state)} ${t.message}
|
|
62
|
+
`;switch(this.state){case"submit":return`${r}${p.default.gray(w)} ${e(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${p.default.gray(w)} ${e(this.options[this.cursor],"cancelled")}
|
|
63
|
+
${p.default.gray(w)}`;default:return`${r}${p.default.cyan(w)} ${bf({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(n,o)=>e(n,o?"active":"inactive")}).join(`
|
|
64
|
+
${p.default.cyan(w)} `)}
|
|
65
|
+
${p.default.cyan(Le)}
|
|
66
|
+
`}}}).prompt()};var ke=(t="",e="")=>{let r=`
|
|
67
|
+
${t}
|
|
68
|
+
`.split(`
|
|
69
|
+
`),n=Mn(e).length,o=Math.max(r.reduce((i,a)=>{let u=Mn(a);return u.length>i?u.length:i},0),n)+2,s=r.map(i=>`${p.default.gray(w)} ${p.default.dim(i)}${" ".repeat(o-Mn(i).length)}${p.default.gray(w)}`).join(`
|
|
70
|
+
`);process.stdout.write(`${p.default.gray(w)}
|
|
71
|
+
${p.default.green(Ht)} ${p.default.reset(e)} ${p.default.gray(Ds.repeat(Math.max(o-n-1,1))+df)}
|
|
72
|
+
${s}
|
|
73
|
+
${p.default.gray(mf+Ds.repeat(o+2)+ff)}
|
|
74
|
+
`)},je=(t="")=>{process.stdout.write(`${p.default.gray(Le)} ${p.default.red(t)}
|
|
75
|
+
|
|
76
|
+
`)};var L={message:(t="",{symbol:e=p.default.gray(w)}={})=>{let r=[`${p.default.gray(w)}`];if(t){let[n,...o]=t.split(`
|
|
77
|
+
`);r.push(`${e} ${n}`,...o.map(s=>`${p.default.gray(w)} ${s}`))}process.stdout.write(`${r.join(`
|
|
78
|
+
`)}
|
|
79
|
+
`)},info:t=>{L.message(t,{symbol:p.default.blue(pf)})},success:t=>{L.message(t,{symbol:p.default.green(Df)})},step:t=>{L.message(t,{symbol:p.default.green(Ht)})},warn:t=>{L.message(t,{symbol:p.default.yellow(hf)})},warning:t=>{L.warn(t)},error:t=>{L.message(t,{symbol:p.default.red(gf)})}},Py=`${p.default.gray(w)} `;var M=({indicator:t="dots"}={})=>{let e=Pn?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=Pn?80:120,n=process.env.CI==="true",o,s,i=!1,a="",u,c=performance.now(),l=y=>{let _=y>1?"Something went wrong":"Canceled";i&&R(_,y)},d=()=>l(2),m=()=>l(1),f=()=>{process.on("uncaughtExceptionMonitor",d),process.on("unhandledRejection",d),process.on("SIGINT",m),process.on("SIGTERM",m),process.on("exit",l)},D=()=>{process.removeListener("uncaughtExceptionMonitor",d),process.removeListener("unhandledRejection",d),process.removeListener("SIGINT",m),process.removeListener("SIGTERM",m),process.removeListener("exit",l)},b=()=>{if(u===void 0)return;n&&process.stdout.write(`
|
|
80
|
+
`);let y=u.split(`
|
|
81
|
+
`);process.stdout.write(Gt.cursor.move(-999,y.length-1)),process.stdout.write(Gt.erase.down(y.length))},F=y=>y.replace(/\.+$/,""),E=y=>{let _=(performance.now()-y)/1e3,B=Math.floor(_/60),k=Math.floor(_%60);return B>0?`[${B}m ${k}s]`:`[${k}s]`},v=(y="")=>{i=!0,o=ps(),a=F(y),c=performance.now(),process.stdout.write(`${p.default.gray(w)}
|
|
82
|
+
`);let _=0,B=0;f(),s=setInterval(()=>{if(n&&a===u)return;b(),u=a;let k=p.default.magenta(e[_]);if(n)process.stdout.write(`${k} ${a}...`);else if(t==="timer")process.stdout.write(`${k} ${a} ${E(c)}`);else{let pe=".".repeat(Math.floor(B)).slice(0,3);process.stdout.write(`${k} ${a}${pe}`)}_=_+1<e.length?_+1:0,B=B<e.length?B+.125:0},r)},R=(y="",_=0)=>{i=!1,clearInterval(s),b();let B=_===0?p.default.green(Ht):_===1?p.default.red(hs):p.default.red(gs);a=F(y??a),t==="timer"?process.stdout.write(`${B} ${a} ${E(c)}
|
|
83
|
+
`):process.stdout.write(`${B} ${a}
|
|
84
|
+
`),D(),o()};return{start:v,stop:R,message:(y="")=>{a=F(y??a)}}};var _t=G(he(),1);import kn from"fs";import ys from"path";var qt="spree@example.com",Yt="spree123";function A(t=process.cwd()){let e=ys.join(t,"docker-compose.yml");if(!kn.existsSync(e))throw new Error(`Not a Spree project directory. No docker-compose.yml found.
|
|
85
|
+
Run this command from a directory created with create-spree-app.`);let r=Cf(t);return{mode:"docker",projectDir:t,port:r}}function Cf(t){let e=ys.join(t,".env");if(!kn.existsSync(e))return 3e3;let n=kn.readFileSync(e,"utf-8").match(/^SPREE_PORT=(\d+)/m);return n?Number(n[1]):3e3}function T(t){if(typeof t!="object"||t===null)return!1;let e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}import{fileURLToPath as Ef}from"url";var Ne=(t,e)=>{let r=Nn(yf(t));if(typeof r!="string")throw new TypeError(`${e} must be a string or a file URL: ${r}.`);return r},yf=t=>jn(t)?t.toString():t,jn=t=>typeof t!="string"&&t&&Object.getPrototypeOf(t)===String.prototype,Nn=t=>t instanceof URL?Ef(t):t;var Kt=(t,e=[],r={})=>{let n=Ne(t,"First argument"),[o,s]=T(e)?[[],e]:[e,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(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${o}`);let i=o.map(String),a=i.find(u=>u.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!T(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[n,i,s]};import{ChildProcess as Of}from"child_process";import{StringDecoder as xf}from"string_decoder";var{toString:xs}=Object.prototype,ws=t=>xs.call(t)==="[object ArrayBuffer]",I=t=>xs.call(t)==="[object Uint8Array]",ce=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),wf=new TextEncoder,Fs=t=>wf.encode(t),Ff=new TextDecoder,Jt=t=>Ff.decode(t),Ss=(t,e)=>Sf(t,e).join(""),Sf=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;let r=new xf(e),n=t.map(s=>typeof s=="string"?Fs(s):s).map(s=>r.write(s)),o=r.end();return o===""?n:[...n,o]},lt=t=>t.length===1&&I(t[0])?t[0]:Un(Af(t)),Af=t=>t.map(e=>typeof e=="string"?Fs(e):e),Un=t=>{let e=new Uint8Array(_f(t)),r=0;for(let n of t)e.set(n,r),r+=n.length;return e},_f=t=>{let e=0;for(let r of t)e+=r.length;return e};var Ts=t=>Array.isArray(t)&&Array.isArray(t.raw),vs=(t,e)=>{let r=[];for(let[s,i]of t.entries())r=Tf({templates:t,expressions:e,tokens:r,index:s,template:i});if(r.length===0)throw new TypeError("Template script must not be empty");let[n,...o]=r;return[n,o,{}]},Tf=({templates:t,expressions:e,tokens:r,index:n,template:o})=>{if(o===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[n]}`);let{nextTokens:s,leadingWhitespaces:i,trailingWhitespaces:a}=vf(o,t.raw[n]),u=_s(r,s,i);if(n===e.length)return u;let c=e[n],l=Array.isArray(c)?c.map(d=>Os(d)):[Os(c)];return _s(u,l,a)},vf=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let r=[],n=0,o=As.has(e[0]);for(let i=0,a=0;i<t.length;i+=1,a+=1){let u=e[a];if(As.has(u))n!==i&&r.push(t.slice(n,i)),n=i+1;else if(u==="\\"){let c=e[a+1];c===`
|
|
86
|
+
`?(i-=1,a+=1):c==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=$f[c]??1}}let s=n===t.length;return s||r.push(t.slice(n)),{nextTokens:r,leadingWhitespaces:o,trailingWhitespaces:s}},As=new Set([" "," ","\r",`
|
|
87
|
+
`]),$f={x:3,u:5},_s=(t,e,r)=>r||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Os=t=>{let e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(T(t)&&("stdout"in t||"isMaxBuffer"in t))return Bf(t);throw t instanceof Of||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},Bf=({stdout:t})=>{if(typeof t=="string")return t;if(I(t))return Jt(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)};import{spawnSync as P0}from"child_process";import{debuglog as If}from"util";import Wn from"process";var J=t=>Xt.includes(t),Xt=[Wn.stdin,Wn.stdout,Wn.stderr],z=["stdin","stdout","stderr"],Zt=t=>z[t]??`stdio[${t}]`;var Bs=t=>{let e={...t};for(let r of Hn)e[r]=Vn(t,r);return e},Vn=(t,e)=>{let r=Array.from({length:Rf(t)+1}),n=Mf(t[e],r,e);return Nf(n,e)},Rf=({stdio:t})=>Array.isArray(t)?Math.max(t.length,z.length):z.length,Mf=(t,e,r)=>T(t)?Pf(t,e,r):e.fill(t),Pf=(t,e,r)=>{for(let n of Object.keys(t).sort(Lf))for(let o of kf(n,r,e))e[o]=t[n];return e},Lf=(t,e)=>$s(t)<$s(e)?1:-1,$s=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,kf=(t,e,r)=>{if(t==="ipc")return[r.length-1];let n=Gn(t);if(n===void 0||n===0)throw new TypeError(`"${e}.${t}" is invalid.
|
|
88
|
+
It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(n>=r.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
|
|
89
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);return n==="all"?[1,2]:[n]},Gn=t=>{if(t==="all")return t;if(z.includes(t))return z.indexOf(t);let e=jf.exec(t);if(e!==null)return Number(e[1])},jf=/^fd(\d+)$/,Nf=(t,e)=>t.map(r=>r===void 0?Wf[e]:r),Uf=If("execa").enabled?"full":"none",Wf={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:Uf,stripFinalNewline:!0},Hn=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],le=(t,e)=>e==="ipc"?t.at(-1):t[e];var Ue=({verbose:t},e)=>zn(t,e)!=="none",We=({verbose:t},e)=>!["none","short"].includes(zn(t,e)),Is=({verbose:t},e)=>{let r=zn(t,e);return Qt(r)?r:void 0},zn=(t,e)=>e===void 0?Vf(t):le(t,e),Vf=t=>t.find(e=>Qt(e))??er.findLast(e=>t.includes(e)),Qt=t=>typeof t=="function",er=["none","short","full"];import{inspect as dp}from"util";import{platform as Gf}from"process";import{stripVTControlCharacters as Hf}from"util";var Rs=(t,e)=>{let r=[t,...e],n=r.join(" "),o=r.map(s=>Xf(Ms(s))).join(" ");return{command:n,escapedCommand:o}},dt=t=>Hf(t).split(`
|
|
90
|
+
`).map(e=>Ms(e)).join(`
|
|
91
|
+
`),Ms=t=>t.replaceAll(Yf,e=>zf(e)),zf=t=>{let e=Kf[t];if(e!==void 0)return e;let r=t.codePointAt(0),n=r.toString(16);return r<=Jf?`\\u${n.padStart(4,"0")}`:`\\U${n}`},qf=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Yf=qf(),Kf={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Jf=65535,Xf=t=>Zf.test(t)?t:Gf==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,Zf=/^[\w./-]+$/;import Ps from"process";function qn(){let{env:t}=Ps,{TERM:e,TERM_PROGRAM:r}=t;return Ps.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Ls={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"},ks={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"},Qf={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"},ep={...Ls,...ks},tp={...Ls,...Qf},rp=qn(),np=rp?ep:tp,tr=np,Dx=Object.entries(ks);import op from"tty";var ip=op?.WriteStream?.prototype?.hasColors?.()??!1,h=(t,e)=>{if(!ip)return o=>o;let r=`\x1B[${t}m`,n=`\x1B[${e}m`;return o=>{let s=o+"",i=s.indexOf(n);if(i===-1)return r+s+n;let a=r,u=0,l=(e===22?n:"")+r;for(;i!==-1;)a+=s.slice(u,i)+l,u=i+n.length,i=s.indexOf(n,u);return a+=s.slice(u)+n,a}},bx=h(0,0),js=h(1,22),Cx=h(2,22),Ex=h(3,23),yx=h(4,24),xx=h(53,55),wx=h(7,27),Fx=h(8,28),Sx=h(9,29),Ax=h(30,39),_x=h(31,39),Ox=h(32,39),Tx=h(33,39),vx=h(34,39),$x=h(35,39),Bx=h(36,39),Ix=h(37,39),rr=h(90,39),Rx=h(40,49),Mx=h(41,49),Px=h(42,49),Lx=h(43,49),kx=h(44,49),jx=h(45,49),Nx=h(46,49),Ux=h(47,49),Wx=h(100,49),Ns=h(91,39),Vx=h(92,39),Us=h(93,39),Gx=h(94,39),Hx=h(95,39),zx=h(96,39),qx=h(97,39),Yx=h(101,49),Kx=h(102,49),Jx=h(103,49),Xx=h(104,49),Zx=h(105,49),Qx=h(106,49),ew=h(107,49);var Gs=({type:t,message:e,timestamp:r,piped:n,commandId:o,result:{failed:s=!1}={},options:{reject:i=!0}})=>{let a=sp(r),u=ap[t]({failed:s,reject:i,piped:n}),c=up[t]({reject:i});return`${rr(`[${a}]`)} ${rr(`[${o}]`)} ${c(u)} ${c(e)}`},sp=t=>`${nr(t.getHours(),2)}:${nr(t.getMinutes(),2)}:${nr(t.getSeconds(),2)}.${nr(t.getMilliseconds(),3)}`,nr=(t,e)=>String(t).padStart(e,"0"),Ws=({failed:t,reject:e})=>t?e?tr.cross:tr.warning:tr.tick,ap={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:Ws,duration:Ws},Vs=t=>t,up={command:()=>js,output:()=>Vs,ipc:()=>Vs,error:({reject:t})=>t?Ns:Us,duration:()=>rr};var Hs=(t,e,r)=>{let n=Is(e,r);return t.map(({verboseLine:o,verboseObject:s})=>cp(o,s,n)).filter(o=>o!==void 0).map(o=>lp(o)).join("")},cp=(t,e,r)=>{if(r===void 0)return t;let n=r(t,e);if(typeof n=="string")return n},lp=t=>t.endsWith(`
|
|
92
|
+
`)?t:`${t}
|
|
93
|
+
`;var te=({type:t,verboseMessage:e,fdNumber:r,verboseInfo:n,result:o})=>{let s=mp({type:t,result:o,verboseInfo:n}),i=fp(e,s),a=Hs(i,n,r);a!==""&&console.warn(a.slice(0,-1))},mp=({type:t,result:e,verboseInfo:{escapedCommand:r,commandId:n,rawOptions:{piped:o=!1,...s}}})=>({type:t,escapedCommand:r,commandId:`${n}`,timestamp:new Date,piped:o,result:e,options:s}),fp=(t,e)=>t.split(`
|
|
94
|
+
`).map(r=>pp({...e,message:r})),pp=t=>({verboseLine:Gs(t),verboseObject:t}),or=t=>{let e=typeof t=="string"?t:dp(t);return dt(e).replaceAll(" "," ".repeat(Dp))},Dp=2;var zs=(t,e)=>{Ue(e)&&te({type:"command",verboseMessage:t,verboseInfo:e})};var qs=(t,e,r)=>{bp(t);let n=hp(t);return{verbose:t,escapedCommand:e,commandId:n,rawOptions:r}},hp=t=>Ue({verbose:t})?gp++:void 0,gp=0n,bp=t=>{for(let e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!er.includes(e)&&!Qt(e)){let r=er.map(n=>`'${n}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${r} or a function.`)}}};import{hrtime as Ys}from"process";var ir=()=>Ys.bigint(),Yn=t=>Number(Ys.bigint()-t)/1e6;var sr=(t,e,r)=>{let n=ir(),{command:o,escapedCommand:s}=Rs(t,e),i=Vn(r,"verbose"),a=qs(i,s,{...r});return zs(s,a),{command:o,escapedCommand:s,startTime:n,verboseInfo:a}};var qu=G(Pa(),1);import th from"path";import zu from"process";import lr from"process";import Oe from"path";function ur(t={}){let{env:e=process.env,platform:r=process.platform}=t;return r!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}import{promisify as Hp}from"util";import{execFile as zp,execFileSync as Ww}from"child_process";import La from"path";import{fileURLToPath as qp}from"url";var Hw=Hp(zp);function cr(t){return t instanceof URL?qp(t):t}function ka(t){return{*[Symbol.iterator](){let e=La.resolve(cr(t)),r;for(;r!==e;)yield e,r=e,e=La.resolve(e,"..")}}}var zw=10*1024*1024;var Yp=({cwd:t=lr.cwd(),path:e=lr.env[ur()],preferLocal:r=!0,execPath:n=lr.execPath,addExecPath:o=!0}={})=>{let s=Oe.resolve(cr(t)),i=[],a=e.split(Oe.delimiter);return r&&Kp(i,a,s),o&&Jp(i,a,n,s),e===""||e===Oe.delimiter?`${i.join(Oe.delimiter)}${e}`:[...i,e].join(Oe.delimiter)},Kp=(t,e,r)=>{for(let n of ka(r)){let o=Oe.join(n,"node_modules/.bin");e.includes(o)||t.push(o)}},Jp=(t,e,r,n)=>{let o=Oe.resolve(n,cr(r),"..");e.includes(o)||t.push(o)},ja=({env:t=lr.env,...e}={})=>{t={...t};let r=ur({env:t});return e.path=t[r],t[r]=Yp(e),t};import{setTimeout as dD}from"timers/promises";var Na=(t,e,r)=>{let n=r?ft:mt,o=t instanceof X?{}:{cause:t};return new n(e,o)},X=class extends Error{},Ua=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,Va,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Wa=t=>dr(t)&&Va in t,Va=Symbol("isExecaError"),dr=t=>Object.prototype.toString.call(t)==="[object Error]",mt=class extends Error{};Ua(mt,mt.name);var ft=class extends Error{};Ua(ft,ft.name);import{constants as pt}from"os";import{constants as eD}from"os";var Ga=()=>{let t=za-Ha+1;return Array.from({length:t},Xp)},Xp=(t,e)=>({name:`SIGRT${e+1}`,number:Ha+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ha=34,za=64;import{constants as Zp}from"os";var qa=[{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 oo=()=>{let t=Ga();return[...qa,...t].map(Qp)},Qp=({name:t,number:e,description:r,action:n,forced:o=!1,standard:s})=>{let{signals:{[t]:i}}=Zp,a=i!==void 0;return{name:t,number:a?i:e,description:r,supported:a,action:n,forced:o,standard:s}};var tD=()=>{let t=oo();return Object.fromEntries(t.map(rD))},rD=({name:t,number:e,description:r,supported:n,action:o,forced:s,standard:i})=>[t,{name:t,number:e,description:r,supported:n,action:o,forced:s,standard:i}],Ya=tD(),nD=()=>{let t=oo(),e=65,r=Array.from({length:e},(n,o)=>oD(o,t));return Object.assign({},...r)},oD=(t,e)=>{let r=iD(t,e);if(r===void 0)return{};let{name:n,description:o,supported:s,action:i,forced:a,standard:u}=r;return{[t]:{name:n,number:t,description:o,supported:s,action:i,forced:a,standard:u}}},iD=(t,e)=>{let r=e.find(({name:n})=>eD.signals[n]===t);return r!==void 0?r:e.find(n=>n.number===t)},cF=nD();var Ja=t=>{let e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return Za(t,e)},Xa=t=>t===0?t:Za(t,"`subprocess.kill()`'s argument"),Za=(t,e)=>{if(Number.isInteger(t))return sD(t,e);if(typeof t=="string")return uD(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
|
|
95
|
+
${io()}`)},sD=(t,e)=>{if(Ka.has(t))return Ka.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
|
|
96
|
+
${io()}`)},aD=()=>new Map(Object.entries(pt.signals).reverse().map(([t,e])=>[e,t])),Ka=aD(),uD=(t,e)=>{if(t in pt.signals)return t;throw t.toUpperCase()in pt.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
|
|
97
|
+
${io()}`)},io=()=>`Available signal names: ${cD()}.
|
|
98
|
+
Available signal numbers: ${lD()}.`,cD=()=>Object.keys(pt.signals).sort().map(t=>`'${t}'`).join(", "),lD=()=>[...new Set(Object.values(pt.signals).sort((t,e)=>t-e))].join(", "),mr=t=>Ya[t].description;var Qa=t=>{if(t===!1)return t;if(t===!0)return mD;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},mD=1e3*5,eu=({kill:t,options:{forceKillAfterDelay:e,killSignal:r},onInternalError:n,context:o,controller:s},i,a)=>{let{signal:u,error:c}=fD(i,a,r);pD(c,n);let l=t(u);return DD({kill:t,signal:u,forceKillAfterDelay:e,killSignal:r,killResult:l,context:o,controller:s}),l},fD=(t,e,r)=>{let[n=r,o]=dr(t)?[void 0,t]:[t,e];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&&!dr(o))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${o}`);return{signal:Xa(n),error:o}},pD=(t,e)=>{t!==void 0&&e.reject(t)},DD=async({kill:t,signal:e,forceKillAfterDelay:r,killSignal:n,killResult:o,context:s,controller:i})=>{e===n&&o&&so({kill:t,forceKillAfterDelay:r,context:s,controllerSignal:i.signal})},so=async({kill:t,forceKillAfterDelay:e,context:r,controllerSignal:n})=>{if(e!==!1)try{await dD(e,void 0,{signal:n}),t("SIGKILL")&&(r.isForcefullyTerminated??=!0)}catch{}};import{once as hD}from"events";var fr=async(t,e)=>{t.aborted||await hD(t,"abort",{signal:e})};var tu=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},ru=({subprocess:t,cancelSignal:e,gracefulCancel:r,context:n,controller:o})=>e===void 0||r?[]:[gD(t,e,n,o)],gD=async(t,e,r,{signal:n})=>{throw await fr(e,n),r.terminationReason??="cancel",t.kill(),e.reason};import{scheduler as kD}from"timers/promises";import{promisify as MD}from"util";var He=({methodName:t,isSubprocess:e,ipc:r,isConnected:n})=>{bD(t,e,r),ao(t,e,n)},bD=(t,e,r)=>{if(!r)throw new Error(`${Z(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},ao=(t,e,r)=>{if(!r)throw new Error(`${Z(t,e)} cannot be used: the ${Ee(e)} has already exited or disconnected.`)},nu=t=>{throw new Error(`${Z("getOneMessage",t)} could not complete: the ${Ee(t)} exited or disconnected.`)},ou=t=>{throw new Error(`${Z("sendMessage",t)} failed: the ${Ee(t)} is sending a message too, instead of listening to incoming messages.
|
|
99
|
+
This can be fixed by both sending a message and listening to incoming messages at the same time:
|
|
100
|
+
|
|
101
|
+
const [receivedMessage] = await Promise.all([
|
|
102
|
+
${Z("getOneMessage",t)},
|
|
103
|
+
${Z("sendMessage",t,"message, {strict: true}")},
|
|
104
|
+
]);`)},pr=(t,e)=>new Error(`${Z("sendMessage",e)} failed when sending an acknowledgment response to the ${Ee(e)}.`,{cause:t}),iu=t=>{throw new Error(`${Z("sendMessage",t)} failed: the ${Ee(t)} is not listening to incoming messages.`)},su=t=>{throw new Error(`${Z("sendMessage",t)} failed: the ${Ee(t)} exited without listening to incoming messages.`)},au=()=>new Error(`\`cancelSignal\` aborted: the ${Ee(!0)} disconnected.`),uu=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},cu=({error:t,methodName:e,isSubprocess:r})=>{if(t.code==="EPIPE")throw new Error(`${Z(e,r)} cannot be used: the ${Ee(r)} is disconnecting.`,{cause:t})},lu=({error:t,methodName:e,isSubprocess:r,message:n})=>{if(CD(t))throw new Error(`${Z(e,r)}'s argument type is invalid: the message cannot be serialized: ${String(n)}.`,{cause:t})},CD=({code:t,message:e})=>ED.has(t)||yD.some(r=>e.includes(r)),ED=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),yD=["could not be cloned","circular structure","call stack size exceeded"],Z=(t,e,r="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${xD(e)}${t}(${r})`,xD=t=>t?"":"subprocess.",Ee=t=>t?"parent process":"subprocess",ze=t=>{t.connected&&t.disconnect()};var re=()=>{let t={},e=new Promise((r,n)=>{Object.assign(t,{resolve:r,reject:n})});return Object.assign(e,t)};var hr=(t,e="stdin")=>{let{options:n,fileDescriptors:o}=ne.get(t),s=du(o,e,!0),i=t.stdio[s];if(i===null)throw new TypeError(mu(s,e,n,!0));return i},qe=(t,e="stdout")=>{let{options:n,fileDescriptors:o}=ne.get(t),s=du(o,e,!1),i=s==="all"?t.all:t.stdio[s];if(i==null)throw new TypeError(mu(s,e,n,!1));return i},ne=new WeakMap,du=(t,e,r)=>{let n=wD(e,r);return FD(n,e,r,t),n},wD=(t,e)=>{let r=Gn(t);if(r!==void 0)return r;let{validOptions:n,defaultValue:o}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Dt(e)}" must not be "${t}".
|
|
105
|
+
It must be ${n} or "fd3", "fd4" (and so on).
|
|
106
|
+
It is optional and defaults to "${o}".`)},FD=(t,e,r,n)=>{let o=n[fu(t)];if(o===void 0)throw new TypeError(`"${Dt(r)}" must not be ${e}. That file descriptor does not exist.
|
|
107
|
+
Please set the "stdio" option to ensure that file descriptor exists.`);if(o.direction==="input"&&!r)throw new TypeError(`"${Dt(r)}" must not be ${e}. It must be a readable stream, not writable.`);if(o.direction!=="input"&&r)throw new TypeError(`"${Dt(r)}" must not be ${e}. It must be a writable stream, not readable.`)},mu=(t,e,r,n)=>{if(t==="all"&&!r.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:o,optionValue:s}=SD(t,r);return`The "${o}: ${Dr(s)}" option is incompatible with using "${Dt(n)}: ${Dr(e)}".
|
|
108
|
+
Please set this option with "pipe" instead.`},SD=(t,{stdin:e,stdout:r,stderr:n,stdio:o})=>{let s=fu(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&r!==void 0?{optionName:"stdout",optionValue:r}:s===2&&n!==void 0?{optionName:"stderr",optionValue:n}:{optionName:`stdio[${s}]`,optionValue:o[s]}},fu=t=>t==="all"?1:t,Dt=t=>t?"to":"from",Dr=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream";import{once as $D}from"events";import{addAbortListener as AD}from"events";var Te=(t,e,r)=>{let n=t.getMaxListeners();n===0||n===Number.POSITIVE_INFINITY||(t.setMaxListeners(n+e),AD(r,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))};import{EventEmitter as TD}from"events";import{once as _D}from"events";import{scheduler as OD}from"timers/promises";var gr=(t,e)=>{e&&uo(t)},uo=t=>{t.refCounted()},br=(t,e)=>{e&&co(t)},co=t=>{t.unrefCounted()},pu=(t,e)=>{e&&(co(t),co(t))},Du=(t,e)=>{e&&(uo(t),uo(t))};var hu=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n},o)=>{if(Cu(o)||yu(o))return;Cr.has(t)||Cr.set(t,[]);let s=Cr.get(t);if(s.push(o),!(s.length>1))for(;s.length>0;){await Eu(t,n,o),await OD.yield();let i=await bu({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n});s.shift(),n.emit("message",i),n.emit("message:done")}},gu=async({anyProcess:t,channel:e,isSubprocess:r,ipcEmitter:n,boundOnMessage:o})=>{lo();let s=Cr.get(t);for(;s?.length>0;)await _D(n,"message:done");t.removeListener("message",o),Du(e,r),n.connected=!1,n.emit("disconnect")},Cr=new WeakMap;var ye=(t,e,r)=>{if(Er.has(t))return Er.get(t);let n=new TD;return n.connected=!0,Er.set(t,n),vD({ipcEmitter:n,anyProcess:t,channel:e,isSubprocess:r}),n},Er=new WeakMap,vD=({ipcEmitter:t,anyProcess:e,channel:r,isSubprocess:n})=>{let o=hu.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t});e.on("message",o),e.once("disconnect",gu.bind(void 0,{anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:t,boundOnMessage:o})),pu(r,n)},yr=t=>{let e=Er.get(t);return e===void 0?t.channel!==null:e.connected};var xu=({anyProcess:t,channel:e,isSubprocess:r,message:n,strict:o})=>{if(!o)return n;let s=ye(t,e,r),i=Fr(t,s);return{id:BD++,type:wr,message:n,hasListeners:i}},BD=0n,wu=(t,e)=>{if(!(e?.type!==wr||e.hasListeners))for(let{id:r}of t)r!==void 0&&xr[r].resolve({isDeadlock:!0,hasListeners:!1})},bu=async({wrappedMessage:t,anyProcess:e,channel:r,isSubprocess:n,ipcEmitter:o})=>{if(t?.type!==wr||!e.connected)return t;let{id:s,message:i}=t,a={id:s,type:Su,message:Fr(e,o)};try{await Sr({anyProcess:e,channel:r,isSubprocess:n,ipc:!0},a)}catch(u){o.emit("strict:error",u)}return i},Cu=t=>{if(t?.type!==Su)return!1;let{id:e,message:r}=t;return xr[e]?.resolve({isDeadlock:!1,hasListeners:r}),!0},Fu=async(t,e,r)=>{if(t?.type!==wr)return;let n=re();xr[t.id]=n;let o=new AbortController;try{let{isDeadlock:s,hasListeners:i}=await Promise.race([n,ID(e,r,o)]);s&&ou(r),i||iu(r)}finally{o.abort(),delete xr[t.id]}},xr={},ID=async(t,e,{signal:r})=>{Te(t,1,r),await $D(t,"disconnect",{signal:r}),su(e)},wr="execa:ipc:request",Su="execa:ipc:response";var Au=(t,e,r)=>{ht.has(t)||ht.set(t,new Set);let n=ht.get(t),o=re(),s=r?e.id:void 0,i={onMessageSent:o,id:s};return n.add(i),{outgoingMessages:n,outgoingMessage:i}},_u=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},Eu=async(t,e,r)=>{for(;!Fr(t,e)&&ht.get(t)?.size>0;){let n=[...ht.get(t)];wu(n,r),await Promise.all(n.map(({onMessageSent:o})=>o))}},ht=new WeakMap,Fr=(t,e)=>e.listenerCount("message")>RD(t),RD=t=>ne.has(t)&&!le(ne.get(t).options.buffer,"ipc")?1:0;var Sr=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},o,{strict:s=!1}={})=>{let i="sendMessage";return He({methodName:i,isSubprocess:r,ipc:n,isConnected:t.connected}),PD({anyProcess:t,channel:e,methodName:i,isSubprocess:r,message:o,strict:s})},PD=async({anyProcess:t,channel:e,methodName:r,isSubprocess:n,message:o,strict:s})=>{let i=xu({anyProcess:t,channel:e,isSubprocess:n,message:o,strict:s}),a=Au(t,i,s);try{await fo({anyProcess:t,methodName:r,isSubprocess:n,wrappedMessage:i,message:o})}catch(u){throw ze(t),u}finally{_u(a)}},fo=async({anyProcess:t,methodName:e,isSubprocess:r,wrappedMessage:n,message:o})=>{let s=LD(t);try{await Promise.all([Fu(n,t,r),s(n)])}catch(i){throw cu({error:i,methodName:e,isSubprocess:r}),lu({error:i,methodName:e,isSubprocess:r,message:o}),i}},LD=t=>{if(mo.has(t))return mo.get(t);let e=MD(t.send.bind(t));return mo.set(t,e),e},mo=new WeakMap;var Tu=(t,e)=>{let r="cancelSignal";return ao(r,!1,t.connected),fo({anyProcess:t,methodName:r,isSubprocess:!1,wrappedMessage:{type:$u,message:e},message:e})},vu=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>(await jD({anyProcess:t,channel:e,isSubprocess:r,ipc:n}),po.signal),jD=async({anyProcess:t,channel:e,isSubprocess:r,ipc:n})=>{if(!Ou){if(Ou=!0,!n){uu();return}if(e===null){lo();return}ye(t,e,r),await kD.yield()}},Ou=!1,yu=t=>t?.type!==$u?!1:(po.abort(t.message),!0),$u="execa:ipc:cancel",lo=()=>{po.abort(au())},po=new AbortController;var Bu=({gracefulCancel:t,cancelSignal:e,ipc:r,serialization:n})=>{if(t){if(e===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.")}},Iu=({subprocess:t,cancelSignal:e,gracefulCancel:r,forceKillAfterDelay:n,context:o,controller:s})=>r?[ND({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:o,controller:s})]:[],ND=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:n,controller:{signal:o}})=>{await fr(e,o);let s=UD(e);throw await Tu(t,s),so({kill:t.kill,forceKillAfterDelay:r,context:n,controllerSignal:o}),n.terminationReason??="gracefulCancel",e.reason},UD=({reason:t})=>{if(!(t instanceof DOMException))return t;let e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e};import{setTimeout as WD}from"timers/promises";var Ru=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},Mu=(t,e,r,n)=>e===0||e===void 0?[]:[VD(t,e,r,n)],VD=async(t,e,r,{signal:n})=>{throw await WD(e,void 0,{signal:n}),r.terminationReason??="timeout",t.kill(),new X};import{execPath as GD,execArgv as HD}from"process";import Pu from"path";var Lu=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},ku=(t,e,{node:r=!1,nodePath:n=GD,nodeOptions:o=HD.filter(u=>!u.startsWith("--inspect")),cwd:s,execPath:i,...a})=>{if(i!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let u=Ne(n,'The "nodePath" option'),c=Pu.resolve(s,u),l={...a,nodePath:c,node:r,cwd:s};if(!r)return[t,e,l];if(Pu.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[c,[...o,t,...e],{ipc:!0,...l,shell:!1}]};import{serialize as zD}from"v8";var ju=({ipcInput:t,ipc:e,serialization:r})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");KD[r](t)}},qD=t=>{try{zD(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},YD=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},KD={advanced:qD,json:YD},Nu=async(t,e)=>{e!==void 0&&await t.sendMessage(e)};var Wu=({encoding:t})=>{if(Do.has(t))return;let e=XD(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Ar(t)}\`.
|
|
109
|
+
Please rename it to ${Ar(e)}.`);let r=[...Do].map(n=>Ar(n)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Ar(t)}\`.
|
|
110
|
+
Please rename it to one of: ${r}.`)},JD=new Set(["utf8","utf16le"]),W=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Do=new Set([...JD,...W]),XD=t=>{if(t===null)return"buffer";if(typeof t!="string")return;let e=t.toLowerCase();if(e in Uu)return Uu[e];if(Do.has(e))return e},Uu={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Ar=t=>typeof t=="string"?`"${t}"`:String(t);import{statSync as ZD}from"fs";import QD from"path";import eh from"process";var Vu=(t=Gu())=>{let e=Ne(t,'The "cwd" option');return QD.resolve(e)},Gu=()=>{try{return eh.cwd()}catch(t){throw t.message=`The current directory does not exist.
|
|
111
|
+
${t.message}`,t}},Hu=(t,e)=>{if(e===Gu())return t;let r;try{r=ZD(e)}catch(n){return`The "cwd" option is invalid: ${e}.
|
|
112
|
+
${n.message}
|
|
113
|
+
${t}`}return r.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
|
|
114
|
+
${t}`};var _r=(t,e,r)=>{r.cwd=Vu(r.cwd);let[n,o,s]=ku(t,e,r),{command:i,args:a,options:u}=qu.default._parse(n,o,s),c=Bs(u),l=rh(c);return Ru(l),Wu(l),ju(l),tu(l),Bu(l),l.shell=Nn(l.shell),l.env=nh(l),l.killSignal=Ja(l.killSignal),l.forceKillAfterDelay=Qa(l.forceKillAfterDelay),l.lines=l.lines.map((d,m)=>d&&!W.has(l.encoding)&&l.buffer[m]),zu.platform==="win32"&&th.basename(i,".exe")==="cmd"&&a.unshift("/q"),{file:i,commandArguments:a,options:l}},rh=({extendEnv:t=!0,preferLocal:e=!1,cwd:r,localDir:n=r,encoding:o="utf8",reject:s=!0,cleanup:i=!0,all:a=!1,windowsHide:u=!0,killSignal:c="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:m,ipc:f=m!==void 0||d,serialization:D="advanced",...b})=>({...b,extendEnv:t,preferLocal:e,cwd:r,localDirectory:n,encoding:o,reject:s,cleanup:i,all:a,windowsHide:u,killSignal:c,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:m,ipc:f,serialization:D}),nh=({env:t,extendEnv:e,preferLocal:r,node:n,localDirectory:o,nodePath:s})=>{let i=e?{...zu.env,...t}:t;return r||n?ja({env:i,cwd:o,execPath:s,preferLocal:r,addExecPath:n}):i};var Or=(t,e,r)=>r.shell&&e.length>0?[[t,...e].join(" "),[],r]:[t,e,r];import{inspect as Lh}from"util";function Ye(t){if(typeof t=="string")return oh(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return ih(t)}var oh=t=>t.at(-1)===Yu?t.slice(0,t.at(-2)===Ku?-2:-1):t,ih=t=>t.at(-1)===sh?t.subarray(0,t.at(-2)===ah?-2:-1):t,Yu=`
|
|
115
|
+
`,sh=Yu.codePointAt(0),Ku="\r",ah=Ku.codePointAt(0);import{on as Ih}from"events";import{finished as Rh}from"stream/promises";function Q(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function ho(t,{checkOpen:e=!0}={}){return Q(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function ve(t,{checkOpen:e=!0}={}){return Q(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function go(t,e){return ho(t,e)&&ve(t,e)}var uh=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype),bo=class{#t;#r;#e=!1;#n=void 0;constructor(e,r){this.#t=e,this.#r=r}next(){let e=()=>this.#i();return this.#n=this.#n?this.#n.then(e,e):e(),this.#n}return(e){let r=()=>this.#o(e);return this.#n?this.#n.then(r,r):r()}async#i(){if(this.#e)return{done:!0,value:void 0};let e;try{e=await this.#t.read()}catch(r){throw this.#n=void 0,this.#e=!0,this.#t.releaseLock(),r}return e.done&&(this.#n=void 0,this.#e=!0,this.#t.releaseLock()),e}async#o(e){if(this.#e)return{done:!0,value:e};if(this.#e=!0,!this.#r){let r=this.#t.cancel(e);return this.#t.releaseLock(),await r,{done:!0,value:e}}return this.#t.releaseLock(),{done:!0,value:e}}},Co=Symbol();function Ju(){return this[Co].next()}Object.defineProperty(Ju,"name",{value:"next"});function Xu(t){return this[Co].return(t)}Object.defineProperty(Xu,"name",{value:"return"});var ch=Object.create(uh,{next:{enumerable:!0,configurable:!0,writable:!0,value:Ju},return:{enumerable:!0,configurable:!0,writable:!0,value:Xu}});function Eo({preventCancel:t=!1}={}){let e=this.getReader(),r=new bo(e,t),n=Object.create(ch);return n[Co]=r,n}var Zu=t=>{if(ve(t,{checkOpen:!1})&>.on!==void 0)return dh(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(lh.call(t)==="[object ReadableStream]")return Eo.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:lh}=Object.prototype,dh=async function*(t){let e=new AbortController,r={};mh(t,e,r);try{for await(let[n]of gt.on(t,"data",{signal:e.signal}))yield n}catch(n){if(r.error!==void 0)throw r.error;if(!e.signal.aborted)throw n}finally{t.destroy()}},mh=async(t,e,r)=>{try{await gt.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(n){r.error=n}finally{e.abort()}},gt={};var Ke=async(t,{init:e,convertChunk:r,getSize:n,truncateChunk:o,addChunk:s,getFinalChunk:i,finalize:a},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{let c=Zu(t),l=e();l.length=0;try{for await(let d of c){let m=ph(d),f=r[m](d,l);tc({convertedChunk:f,state:l,getSize:n,truncateChunk:o,addChunk:s,maxBuffer:u})}return fh({state:l,convertChunk:r,getSize:n,truncateChunk:o,addChunk:s,getFinalChunk:i,maxBuffer:u}),a(l)}catch(d){let m=typeof d=="object"&&d!==null?d:new Error(d);throw m.bufferedData=a(l),m}},fh=({state:t,getSize:e,truncateChunk:r,addChunk:n,getFinalChunk:o,maxBuffer:s})=>{let i=o(t);i!==void 0&&tc({convertedChunk:i,state:t,getSize:e,truncateChunk:r,addChunk:n,maxBuffer:s})},tc=({convertedChunk:t,state:e,getSize:r,truncateChunk:n,addChunk:o,maxBuffer:s})=>{let i=r(t),a=e.length+i;if(a<=s){Qu(t,e,o,a);return}let u=n(t,s-e.length);throw u!==void 0&&Qu(u,e,o,s),new oe},Qu=(t,e,r,n)=>{e.contents=r(t,e,n),e.length=n},ph=t=>{let e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";let r=ec.call(t);return r==="[object ArrayBuffer]"?"arrayBuffer":r==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&ec.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:ec}=Object.prototype,oe=class extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}};var de=t=>t,bt=()=>{},Tr=({contents:t})=>t,vr=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},$r=t=>t.length;async function Br(t,e){return Ke(t,bh,e)}var Dh=()=>({contents:[]}),hh=()=>1,gh=(t,{contents:e})=>(e.push(t),e),bh={init:Dh,convertChunk:{string:de,buffer:de,arrayBuffer:de,dataView:de,typedArray:de,others:de},getSize:hh,truncateChunk:bt,addChunk:gh,getFinalChunk:bt,finalize:Tr};async function Ir(t,e){return Ke(t,_h,e)}var Ch=()=>({contents:new ArrayBuffer(0)}),Eh=t=>yh.encode(t),yh=new TextEncoder,rc=t=>new Uint8Array(t),nc=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),xh=(t,e)=>t.slice(0,e),wh=(t,{contents:e,length:r},n)=>{let o=sc()?Sh(e,n):Fh(e,n);return new Uint8Array(o).set(t,r),o},Fh=(t,e)=>{if(e<=t.byteLength)return t;let r=new ArrayBuffer(ic(e));return new Uint8Array(r).set(new Uint8Array(t),0),r},Sh=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;let r=new ArrayBuffer(e,{maxByteLength:ic(e)});return new Uint8Array(r).set(new Uint8Array(t),0),r},ic=t=>oc**Math.ceil(Math.log(t)/Math.log(oc)),oc=2,Ah=({contents:t,length:e})=>sc()?t:t.slice(0,e),sc=()=>"resize"in ArrayBuffer.prototype,_h={init:Ch,convertChunk:{string:Eh,buffer:rc,arrayBuffer:rc,dataView:nc,typedArray:nc,others:vr},getSize:$r,truncateChunk:xh,addChunk:wh,getFinalChunk:bt,finalize:Ah};async function Mr(t,e){return Ke(t,Bh,e)}var Oh=()=>({contents:"",textDecoder:new TextDecoder}),Rr=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Th=(t,{contents:e})=>e+t,vh=(t,e)=>t.slice(0,e),$h=({textDecoder:t})=>{let e=t.decode();return e===""?void 0:e},Bh={init:Oh,convertChunk:{string:de,buffer:Rr,arrayBuffer:Rr,dataView:Rr,typedArray:Rr,others:vr},getSize:$r,truncateChunk:vh,addChunk:Th,getFinalChunk:$h,finalize:Tr};Object.assign(gt,{on:Ih,finished:Rh});var ac=({error:t,stream:e,readableObjectMode:r,lines:n,encoding:o,fdNumber:s})=>{if(!(t instanceof oe))throw t;if(s==="all")return t;let i=Mh(r,n,o);throw t.maxBufferInfo={fdNumber:s,unit:i},e.destroy(),t},Mh=(t,e,r)=>t?"objects":e?"lines":r==="buffer"?"bytes":"characters",uc=(t,e,r)=>{if(e.length!==r)return;let n=new oe;throw n.maxBufferInfo={fdNumber:"ipc"},n},cc=(t,e)=>{let{streamName:r,threshold:n,unit:o}=Ph(t,e);return`Command's ${r} was larger than ${n} ${o}`},Ph=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:r,unit:n}}=t;delete t.maxBufferInfo;let o=le(e,r);return r==="ipc"?{streamName:"IPC output",threshold:o,unit:"messages"}:{streamName:Zt(r),threshold:o,unit:n}},lc=(t,e,r)=>t?.code==="ENOBUFS"&&e!==null&&e.some(n=>n!==null&&n.length>Pr(r)),dc=(t,e,r)=>{if(!e)return t;let n=Pr(r);return t.length>n?t.slice(0,n):t},Pr=([,t])=>t;var fc=({stdio:t,all:e,ipcOutput:r,originalError:n,signal:o,signalDescription:s,exitCode:i,escapedCommand:a,timedOut:u,isCanceled:c,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:m,forceKillAfterDelay:f,killSignal:D,maxBuffer:b,timeout:F,cwd:E})=>{let v=n?.code,R=kh({originalError:n,timedOut:u,timeout:F,isMaxBuffer:d,maxBuffer:b,errorCode:v,signal:o,signalDescription:s,exitCode:i,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:m,forceKillAfterDelay:f,killSignal:D}),y=Nh(n,E),_=y===void 0?"":`
|
|
116
|
+
${y}`,B=`${R}: ${a}${_}`,k=e===void 0?[t[2],t[1]]:[e],pe=[B,...k,...t.slice(3),r.map(De=>Uh(De)).join(`
|
|
117
|
+
`)].map(De=>dt(Ye(Wh(De)))).filter(Boolean).join(`
|
|
118
|
+
|
|
119
|
+
`);return{originalMessage:y,shortMessage:B,message:pe}},kh=({originalError:t,timedOut:e,timeout:r,isMaxBuffer:n,maxBuffer:o,errorCode:s,signal:i,signalDescription:a,exitCode:u,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:m,killSignal:f})=>{let D=jh(d,m);return e?`Command timed out after ${r} milliseconds${D}`:l?i===void 0?`Command was gracefully canceled with exit code ${u}`:d?`Command was gracefully canceled${D}`:`Command was gracefully canceled with ${i} (${a})`:c?`Command was canceled${D}`:n?`${cc(t,o)}${D}`:s!==void 0?`Command failed with ${s}${D}`:d?`Command was killed with ${f} (${mr(f)})${D}`:i!==void 0?`Command was killed with ${i} (${a})`:u!==void 0?`Command failed with exit code ${u}`:"Command failed"},jh=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Nh=(t,e)=>{if(t instanceof X)return;let r=Wa(t)?t.originalMessage:String(t?.message??t),n=dt(Hu(r,e));return n===""?void 0:n},Uh=t=>typeof t=="string"?t:Lh(t),Wh=t=>Array.isArray(t)?t.map(e=>Ye(mc(e))).filter(Boolean).join(`
|
|
120
|
+
`):mc(t),mc=t=>typeof t=="string"?t:I(t)?Jt(t):"";var Lr=({command:t,escapedCommand:e,stdio:r,all:n,ipcOutput:o,options:{cwd:s},startTime:i})=>pc({command:t,escapedCommand:e,cwd:s,durationMs:Yn(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:[]}),Je=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:i})=>Ct({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}),Ct=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:d,all:m,ipcOutput:f,options:{timeoutDuration:D,timeout:b=D,forceKillAfterDelay:F,killSignal:E,cwd:v,maxBuffer:R},isSync:y})=>{let{exitCode:_,signal:B,signalDescription:k}=Gh(c,l),{originalMessage:pe,shortMessage:De,message:un}=fc({stdio:d,all:m,ipcOutput:f,originalError:t,signal:B,signalDescription:k,exitCode:_,escapedCommand:r,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,forceKillAfterDelay:F,killSignal:E,maxBuffer:R,timeout:b,cwd:v}),it=Na(t,un,y);return Object.assign(it,Vh({error:it,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:_,signal:B,signalDescription:k,stdio:d,all:m,ipcOutput:f,cwd:v,originalMessage:pe,shortMessage:De})),it},Vh=({error:t,command:e,escapedCommand:r,startTime:n,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:d,stdio:m,all:f,ipcOutput:D,cwd:b,originalMessage:F,shortMessage:E})=>pc({shortMessage:E,originalMessage:F,command:e,escapedCommand:r,cwd:b,durationMs:Yn(n),failed:!0,timedOut:o,isCanceled:s,isGracefullyCanceled:i,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:d,code:t.cause?.code,stdout:m[1],stderr:m[2],all:f,stdio:m,ipcOutput:D,pipedFrom:[]}),pc=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Gh=(t,e)=>{let r=t===null?void 0:t,n=e===null?void 0:e,o=n===void 0?void 0:mr(e);return{exitCode:r,signal:n,signalDescription:o}};var Dc=t=>Number.isFinite(t)?t:0;function Hh(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(Dc(t*1e3)%1e3),nanoseconds:Math.trunc(Dc(t*1e6)%1e3)}}function zh(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 yo(t){switch(typeof t){case"number":{if(Number.isFinite(t))return Hh(t);break}case"bigint":return zh(t)}throw new TypeError("Expected a finite number or bigint")}var qh=t=>t===0||t===0n,Yh=(t,e)=>e===1||e===1n?t:`${t}s`,Kh=1e-7,Jh=24n*60n*60n*1000n;function xo(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,d)=>{let m=Math.floor(l*10**d+Kh);return(Math.round(m)/10**d).toFixed(d)},i=(l,d,m,f)=>{if(!((o.length===0||!e.colonNotation)&&qh(l)&&!(e.colonNotation&&m==="m"))){if(f??=String(l),e.colonNotation){let D=f.includes(".")?f.split(".")[0].length:f.length,b=o.length>0?2:1;f="0".repeat(Math.max(0,b-D))+f}else f+=e.verbose?" "+Yh(d,l):m;o.push(f)}},a=yo(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),d=Number(a.milliseconds),m=Number(a.microseconds),f=Number(a.nanoseconds);if(i(l,"second","s"),e.formatSubMilliseconds)i(d,"millisecond","ms"),i(m,"microsecond","\xB5s"),i(f,"nanosecond","ns");else{let D=d+m/1e3+f/1e6,b=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,F=D>=1?Math.round(D):Math.ceil(D),E=b?D.toFixed(b):F;i(Number.parseFloat(E),"millisecond","ms",E)}}else{let l=(r?Number(t%Jh):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,m=s(l,d),f=e.keepDecimalsOnWholeSeconds?m:m.replace(/\.0+$/,"");i(Number.parseFloat(f),"second","s",f)}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 hc=(t,e)=>{t.failed&&te({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})};var gc=(t,e)=>{Ue(e)&&(hc(t,e),Xh(t,e))},Xh=(t,e)=>{let r=`(done in ${xo(t.durationMs)})`;te({type:"duration",verboseMessage:r,verboseInfo:e,result:t})};var Xe=(t,e,{reject:r})=>{if(gc(t,e),t.failed&&r)throw t;return t};import{readFileSync as Gc}from"fs";var Ec=(t,e)=>$e(t)?"asyncGenerator":wc(t)?"generator":kr(t)?"fileUrl":rg(t)?"filePath":ig(t)?"webStream":Q(t,{checkOpen:!1})?"native":I(t)?"uint8Array":sg(t)?"asyncIterable":ag(t)?"iterable":So(t)?yc({transform:t},e):tg(t)?Zh(t,e):"native",Zh=(t,e)=>go(t.transform,{checkOpen:!1})?Qh(t,e):So(t.transform)?yc(t,e):eg(t,e),Qh=(t,e)=>(xc(t,e,"Duplex stream"),"duplex"),yc=(t,e)=>(xc(t,e,"web TransformStream"),"webTransform"),xc=({final:t,binary:e,objectMode:r},n,o)=>{bc(t,`${n}.final`,o),bc(e,`${n}.binary`,o),wo(r,`${n}.objectMode`)},bc=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${r}.`)},eg=({transform:t,final:e,binary:r,objectMode:n},o)=>{if(t!==void 0&&!Cc(t))throw new TypeError(`The \`${o}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(go(e,{checkOpen:!1}))throw new TypeError(`The \`${o}.final\` option must not be a Duplex stream.`);if(So(e))throw new TypeError(`The \`${o}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!Cc(e))throw new TypeError(`The \`${o}.final\` option must be a generator.`);return wo(r,`${o}.binary`),wo(n,`${o}.objectMode`),$e(t)||$e(e)?"asyncGenerator":"generator"},wo=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},Cc=t=>$e(t)||wc(t),$e=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",wc=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",tg=t=>T(t)&&(t.transform!==void 0||t.final!==void 0),kr=t=>Object.prototype.toString.call(t)==="[object URL]",Fc=t=>kr(t)&&t.protocol!=="file:",rg=t=>T(t)&&Object.keys(t).length>0&&Object.keys(t).every(e=>ng.has(e))&&Fo(t.file),ng=new Set(["file","append"]),Fo=t=>typeof t=="string",Sc=(t,e)=>t==="native"&&typeof e=="string"&&!og.has(e),og=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ac=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",jr=t=>Object.prototype.toString.call(t)==="[object WritableStream]",ig=t=>Ac(t)||jr(t),So=t=>Ac(t?.readable)&&jr(t?.writable),sg=t=>_c(t)&&typeof t[Symbol.asyncIterator]=="function",ag=t=>_c(t)&&typeof t[Symbol.iterator]=="function",_c=t=>typeof t=="object"&&t!==null,q=new Set(["generator","asyncGenerator","duplex","webTransform"]),Nr=new Set(["fileUrl","filePath","fileNumber"]),Ao=new Set(["fileUrl","filePath"]),Oc=new Set([...Ao,"webStream","nodeStream"]),Tc=new Set(["webTransform","duplex"]),xe={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 _o=(t,e,r,n)=>n==="output"?ug(t,e,r):cg(t,e,r),ug=(t,e,r)=>{let n=e!==0&&r[e-1].value.readableObjectMode;return{writableObjectMode:n,readableObjectMode:t??n}},cg=(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}},vc=(t,e)=>{let r=t.findLast(({type:n})=>q.has(n));return r===void 0?!1:e==="input"?r.value.writableObjectMode:r.value.readableObjectMode};var $c=(t,e,r,n)=>[...t.filter(({type:o})=>!q.has(o)),...lg(t,e,r,n)],lg=(t,e,r,{encoding:n})=>{let o=t.filter(({type:i})=>q.has(i)),s=Array.from({length:o.length});for(let[i,a]of Object.entries(o))s[i]=dg({stdioItem:a,index:Number(i),newTransforms:s,optionName:e,direction:r,encoding:n});return Dg(s,r)},dg=({stdioItem:t,stdioItem:{type:e},index:r,newTransforms:n,optionName:o,direction:s,encoding:i})=>e==="duplex"?mg({stdioItem:t,optionName:o}):e==="webTransform"?fg({stdioItem:t,index:r,newTransforms:n,direction:s}):pg({stdioItem:t,index:r,newTransforms:n,direction:s,encoding:i}),mg=({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}}},fg=({stdioItem:t,stdioItem:{value:e},index:r,newTransforms:n,direction:o})=>{let{transform:s,objectMode:i}=T(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:u}=_o(i,r,n,o);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:u}}},pg=({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}=T(e)?e:{transform:e},d=u||W.has(s),{writableObjectMode:m,readableObjectMode:f}=_o(l,r,n,o);return{...t,value:{transform:i,final:a,binary:d,preserveNewlines:c,writableObjectMode:m,readableObjectMode:f}}},Dg=(t,e)=>e==="input"?t.reverse():t;import Oo from"process";var Bc=(t,e,r)=>{let n=t.map(o=>hg(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)??Cg},hg=({type:t,value:e},r)=>gg[r]??Ic[t](e),gg=["input","output","output"],Ze=()=>{},To=()=>"input",Ic={generator:Ze,asyncGenerator:Ze,fileUrl:Ze,filePath:Ze,iterable:To,asyncIterable:To,uint8Array:To,webStream:t=>jr(t)?"output":"input",nodeStream(t){return ve(t,{checkOpen:!1})?ho(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:Ze,duplex:Ze,native(t){let e=bg(t);if(e!==void 0)return e;if(Q(t,{checkOpen:!1}))return Ic.nodeStream(t)}},bg=t=>{if([0,Oo.stdin].includes(t))return"input";if([1,2,Oo.stdout,Oo.stderr].includes(t))return"output"},Cg="output";var Rc=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t;var Mc=({stdio:t,ipc:e,buffer:r,...n},o,s)=>{let i=Eg(t,n).map((a,u)=>Pc(a,u));return s?xg(i,r,o):Rc(i,e)},Eg=(t,e)=>{if(t===void 0)return z.map(n=>e[n]);if(yg(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${z.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,z.length);return Array.from({length:r},(n,o)=>t[o])},yg=t=>z.some(e=>t[e]!==void 0),Pc=(t,e)=>Array.isArray(t)?t.map(r=>Pc(r,e)):t??(e>=z.length?"ignore":"pipe"),xg=(t,e,r)=>t.map((n,o)=>!e[o]&&o!==0&&!We(r,o)&&wg(n)?"ignore":n),wg=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe");import{readFileSync as Fg}from"fs";import Sg from"tty";var kc=({stdioItem:t,stdioItem:{type:e},isStdioArray:r,fdNumber:n,direction:o,isSync:s})=>!r||e!=="native"?t:s?Ag({stdioItem:t,fdNumber:n,direction:o}):Tg({stdioItem:t,fdNumber:n}),Ag=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n,direction:o})=>{let s=_g({value:e,optionName:r,fdNumber:n,direction:o});if(s!==void 0)return s;if(Q(e,{checkOpen:!1}))throw new TypeError(`The \`${r}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},_g=({value:t,optionName:e,fdNumber:r,direction:n})=>{let o=Og(t,r);if(o!==void 0){if(n==="output")return{type:"fileNumber",value:o,optionName:e};if(Sg.isatty(o))throw new TypeError(`The \`${e}: ${Dr(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:ce(Fg(o)),optionName:e}}},Og=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;let r=Xt.indexOf(t);if(r!==-1)return r},Tg=({stdioItem:t,stdioItem:{value:e,optionName:r},fdNumber:n})=>e==="inherit"?{type:"nodeStream",value:Lc(n,e,r),optionName:r}:typeof e=="number"?{type:"nodeStream",value:Lc(e,e,r),optionName:r}:Q(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:r}:t,Lc=(t,e,r)=>{let n=Xt[t];if(n===void 0)throw new TypeError(`The \`${r}: ${e}\` option is invalid: no such standard stream.`);return n};var jc=({input:t,inputFile:e},r)=>r===0?[...vg(t),...Bg(e)]:[],vg=t=>t===void 0?[]:[{type:$g(t),value:t,optionName:"input"}],$g=t=>{if(ve(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(I(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Bg=t=>t===void 0?[]:[{...Ig(t),optionName:"inputFile"}],Ig=t=>{if(kr(t))return{type:"fileUrl",value:t};if(Fo(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")};var Nc=t=>t.filter((e,r)=>t.every((n,o)=>e.value!==n.value||r>=o||e.type==="generator"||e.type==="asyncGenerator")),Uc=({stdioItem:{type:t,value:e,optionName:r},direction:n,fileDescriptors:o,isSync:s})=>{let i=Rg(o,t);if(i.length!==0){if(s){Mg({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});return}if(Oc.has(t))return Wc({otherStdioItems:i,type:t,value:e,optionName:r,direction:n});Tc.has(t)&&Lg({otherStdioItems:i,type:t,value:e,optionName:r})}},Rg=(t,e)=>t.flatMap(({direction:r,stdioItems:n})=>n.filter(o=>o.type===e).map((o=>({...o,direction:r})))),Mg=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{Ao.has(e)&&Wc({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})},Wc=({otherStdioItems:t,type:e,value:r,optionName:n,direction:o})=>{let s=t.filter(a=>Pg(a,r));if(s.length===0)return;let i=s.find(a=>a.direction!==o);return Vc(i,n,e),o==="output"?s[0].stream:void 0},Pg=({type:t,value:e},r)=>t==="filePath"?e.file===r.file:t==="fileUrl"?e.href===r.href:e===r,Lg=({otherStdioItems:t,type:e,value:r,optionName:n})=>{let o=t.find(({value:{transform:s}})=>s===r.transform);Vc(o,n,e)},Vc=(t,e,r)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${xe[r]} that is the same.`)};var Ur=(t,e,r,n)=>{let s=Mc(e,r,n).map((a,u)=>kg({stdioOption:a,fdNumber:u,options:e,isSync:n})),i=zg({initialFileDescriptors:s,addProperties:t,options:e,isSync:n});return e.stdio=i.map(({stdioItems:a})=>Kg(a)),i},kg=({stdioOption:t,fdNumber:e,options:r,isSync:n})=>{let o=Zt(e),{stdioItems:s,isStdioArray:i}=jg({stdioOption:t,fdNumber:e,options:r,optionName:o}),a=Bc(s,e,o),u=s.map(d=>kc({stdioItem:d,isStdioArray:i,fdNumber:e,direction:a,isSync:n})),c=$c(u,o,a,r),l=vc(c,a);return Hg(c,l),{direction:a,objectMode:l,stdioItems:c}},jg=({stdioOption:t,fdNumber:e,options:r,optionName:n})=>{let s=[...(Array.isArray(t)?t:[t]).map(u=>Ng(u,n)),...jc(r,e)],i=Nc(s),a=i.length>1;return Ug(i,a,n),Vg(i),{stdioItems:i,isStdioArray:a}},Ng=(t,e)=>({type:Ec(t,e),value:t,optionName:e}),Ug=(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(Wg.has(n))throw new Error(`The \`${o}\` option must not include \`${n}\`.`)}},Wg=new Set(["ignore","ipc"]),Vg=t=>{for(let e of t)Gg(e)},Gg=({type:t,value:e,optionName:r})=>{if(Fc(e))throw new TypeError(`The \`${r}: URL\` option must use the \`file:\` scheme.
|
|
121
|
+
For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Sc(t,e))throw new TypeError(`The \`${r}: { file: '...' }\` option must be used instead of \`${r}: '...'\`.`)},Hg=(t,e)=>{if(!e)return;let r=t.find(({type:n})=>Nr.has(n));if(r!==void 0)throw new TypeError(`The \`${r.optionName}\` option cannot use both files and transforms in objectMode.`)},zg=({initialFileDescriptors:t,addProperties:e,options:r,isSync:n})=>{let o=[];try{for(let s of t)o.push(qg({fileDescriptor:s,fileDescriptors:o,addProperties:e,options:r,isSync:n}));return o}catch(s){throw vo(o),s}},qg=({fileDescriptor:{direction:t,objectMode:e,stdioItems:r},fileDescriptors:n,addProperties:o,options:s,isSync:i})=>{let a=r.map(u=>Yg({stdioItem:u,addProperties:o,direction:t,options:s,fileDescriptors:n,isSync:i}));return{direction:t,objectMode:e,stdioItems:a}},Yg=({stdioItem:t,addProperties:e,direction:r,options:n,fileDescriptors:o,isSync:s})=>{let i=Uc({stdioItem:t,direction:r,fileDescriptors:o,isSync:s});return i!==void 0?{...t,stream:i}:{...t,...e[r][t.type](t,n)}},vo=t=>{for(let{stdioItems:e}of t)for(let{stream:r}of e)r!==void 0&&!J(r)&&r.destroy()},Kg=t=>{if(t.length>1)return t.some(({value:n})=>n==="overlapped")?"overlapped":"pipe";let[{type:e,value:r}]=t;return e==="native"?r:"pipe"};var zc=(t,e)=>Ur(Xg,t,e,!0),ie=({type:t,optionName:e})=>{qc(e,xe[t])},Jg=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&qc(t,`"${e}"`),{}),qc=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Hc={generator(){},asyncGenerator:ie,webStream:ie,nodeStream:ie,webTransform:ie,duplex:ie,asyncIterable:ie,native:Jg},Xg={input:{...Hc,fileUrl:({value:t})=>({contents:[ce(Gc(t))]}),filePath:({value:{file:t}})=>({contents:[ce(Gc(t))]}),fileNumber:ie,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Hc,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t,append:e}})=>({path:t,append:e}),fileNumber:({value:t})=>({path:t}),iterable:ie,string:ie,uint8Array:ie}};var me=(t,{stripFinalNewline:e},r)=>$o(e,r)&&t!==void 0&&!Array.isArray(t)?Ye(t):t,$o=(t,e)=>e==="all"?t[1]||t[2]:t[e];import{Transform as b0,getDefaultHighWaterMark as ol}from"stream";var Wr=(t,e,r,n)=>t||r?void 0:Kc(e,n),Io=(t,e,r)=>r?t.flatMap(n=>Yc(n,e)):Yc(t,e),Yc=(t,e)=>{let{transform:r,final:n}=Kc(e,{});return[...r(t),...n()]},Kc=(t,e)=>(e.previousChunks="",{transform:Zg.bind(void 0,e,t),final:e0.bind(void 0,e)}),Zg=function*(t,e,r){if(typeof r!="string"){yield r;return}let{previousChunks:n}=t,o=-1;for(let s=0;s<r.length;s+=1)if(r[s]===`
|
|
122
|
+
`){let i=Qg(r,s,e,t),a=r.slice(o+1,s+1-i);n.length>0&&(a=Bo(n,a),n=""),yield a,o=s}o!==r.length-1&&(n=Bo(n,r.slice(o+1))),t.previousChunks=n},Qg=(t,e,r,n)=>r?0:(n.isWindowsNewline=e!==0&&t[e-1]==="\r",n.isWindowsNewline?2:1),e0=function*({previousChunks:t}){t.length>0&&(yield t)},Jc=({binary:t,preserveNewlines:e,readableObjectMode:r,state:n})=>t||e||r?void 0:{transform:t0.bind(void 0,n)},t0=function*({isWindowsNewline:t=!1},e){let{unixNewline:r,windowsNewline:n,LF:o,concatBytes:s}=typeof e=="string"?r0:o0;if(e.at(-1)===o){yield e;return}yield s(e,t?n:r)},Bo=(t,e)=>`${t}${e}`,r0={windowsNewline:`\r
|
|
123
|
+
`,unixNewline:`
|
|
124
|
+
`,LF:`
|
|
125
|
+
`,concatBytes:Bo},n0=(t,e)=>{let r=new Uint8Array(t.length+e.length);return r.set(t,0),r.set(e,t.length),r},o0={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:n0};import{Buffer as i0}from"buffer";var Xc=(t,e)=>t?void 0:s0.bind(void 0,e),s0=function*(t,e){if(typeof e!="string"&&!I(e)&&!i0.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},Zc=(t,e)=>t?a0.bind(void 0,e):u0.bind(void 0,e),a0=function*(t,e){Qc(t,e),yield e},u0=function*(t,e){if(Qc(t,e),typeof e!="string"&&!I(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},Qc=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
|
|
126
|
+
Instead, \`yield\` should either be called with a value, or not be called at all. For example:
|
|
127
|
+
if (condition) { yield value; }`)};import{Buffer as c0}from"buffer";import{StringDecoder as l0}from"string_decoder";var Vr=(t,e,r)=>{if(r)return;if(t)return{transform:d0.bind(void 0,new TextEncoder)};let n=new l0(e);return{transform:m0.bind(void 0,n),final:f0.bind(void 0,n)}},d0=function*(t,e){c0.isBuffer(e)?yield ce(e):typeof e=="string"?yield t.encode(e):yield e},m0=function*(t,e){yield I(e)?t.write(e):e},f0=function*(t){let e=t.end();e!==""&&(yield e)};import{callbackify as el}from"util";var Ro=el(async(t,e,r,n)=>{e.currentIterable=t(...r);try{for await(let o of e.currentIterable)n.push(o)}finally{delete e.currentIterable}}),Gr=async function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=D0}=e[r];for await(let o of n(t))yield*Gr(o,e,r+1)},tl=async function*(t){for(let[e,{final:r}]of Object.entries(t))yield*p0(r,Number(e),t)},p0=async function*(t,e,r){if(t!==void 0)for await(let n of t())yield*Gr(n,r,e+1)},rl=el(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),D0=function*(t){yield t};var Mo=(t,e,r,n)=>{try{for(let o of t(...e))r.push(o);n()}catch(o){n(o)}},nl=(t,e)=>[...e.flatMap(r=>[...Be(r,t,0)]),...Et(t)],Be=function*(t,e,r){if(r===e.length){yield t;return}let{transform:n=g0}=e[r];for(let o of n(t))yield*Be(o,e,r+1)},Et=function*(t){for(let[e,{final:r}]of Object.entries(t))yield*h0(r,Number(e),t)},h0=function*(t,e,r){if(t!==void 0)for(let n of t())yield*Be(n,r,e+1)},g0=function*(t){yield t};var Po=({value:t,value:{transform:e,final:r,writableObjectMode:n,readableObjectMode:o},optionName:s},{encoding:i})=>{let a={},u=il(t,i,s),c=$e(e),l=$e(r),d=c?Ro.bind(void 0,Gr,a):Mo.bind(void 0,Be),m=c||l?Ro.bind(void 0,tl,a):Mo.bind(void 0,Et),f=c||l?rl.bind(void 0,a):void 0;return{stream:new b0({writableObjectMode:n,writableHighWaterMark:ol(n),readableObjectMode:o,readableHighWaterMark:ol(o),transform(b,F,E){d([b,u,0],this,E)},flush(b){m([u],this,b)},destroy:f})}},Hr=(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=il(i,r,a);t=nl(u,t)}return t},il=({transform:t,final:e,binary:r,writableObjectMode:n,readableObjectMode:o,preserveNewlines:s},i,a)=>{let u={};return[{transform:Xc(n,a)},Vr(r,i,n),Wr(r,s,n,u),{transform:t,final:e},{transform:Zc(o,a)},Jc({binary:r,preserveNewlines:s,readableObjectMode:o,state:u})].filter(Boolean)};var sl=(t,e)=>{for(let r of C0(t))E0(t,r,e)},C0=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),E0=(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 ${xe[a]} with synchronous methods.`)}let i=o.map(({contents:a})=>a).map(a=>y0(a,n));r.input=lt(i)},y0=(t,e)=>{let r=Hr(t,e,"utf8",!0);return x0(r),lt(r)},x0=t=>{let e=t.find(r=>typeof r!="string"&&!I(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 A0,appendFileSync as _0}from"fs";var zr=({stdioItems:t,encoding:e,verboseInfo:r,fdNumber:n})=>n!=="all"&&We(r,n)&&!W.has(e)&&w0(n)&&(t.some(({type:o,value:s})=>o==="native"&&F0.has(s))||t.every(({type:o})=>q.has(o))),w0=t=>t===1||t===2,F0=new Set(["pipe","overlapped"]),al=async(t,e,r,n)=>{for await(let o of t)S0(e)||cl(o,r,n)},ul=(t,e,r)=>{for(let n of t)cl(n,e,r)},S0=t=>t._readableState.pipes.length>0,cl=(t,e,r)=>{let n=or(t);te({type:"output",verboseMessage:n,fdNumber:e,verboseInfo:r})};var ll=({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)=>O0({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:i,isMaxBuffer:n,verboseInfo:o},r)),...s}},O0=({result:t,fileDescriptors:e,fdNumber:r,state:n,outputFiles:o,isMaxBuffer:s,verboseInfo:i},{buffer:a,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;let m=dc(t,s,d),f=ce(m),{stdioItems:D,objectMode:b}=e[r],F=T0([f],D,u,n),{serializedResult:E,finalResult:v=E}=v0({chunks:F,objectMode:b,encoding:u,lines:c,stripFinalNewline:l,fdNumber:r});$0({serializedResult:E,fdNumber:r,state:n,verboseInfo:i,encoding:u,stdioItems:D,objectMode:b});let R=a[r]?v:void 0;try{return n.error===void 0&&B0(E,D,o),R}catch(y){return n.error=y,R}},T0=(t,e,r,n)=>{try{return Hr(t,e,r,!1)}catch(o){return n.error=o,t}},v0=({chunks:t,objectMode:e,encoding:r,lines:n,stripFinalNewline:o,fdNumber:s})=>{if(e)return{serializedResult:t};if(r==="buffer")return{serializedResult:lt(t)};let i=Ss(t,r);return n[s]?{serializedResult:i,finalResult:Io(i,!o[s],e)}:{serializedResult:i}},$0=({serializedResult:t,fdNumber:e,state:r,verboseInfo:n,encoding:o,stdioItems:s,objectMode:i})=>{if(!zr({stdioItems:s,encoding:o,verboseInfo:n,fdNumber:e}))return;let a=Io(t,!1,i);try{ul(a,e,n)}catch(u){r.error??=u}},B0=(t,e,r)=>{for(let{path:n,append:o}of e.filter(({type:s})=>Nr.has(s))){let s=typeof n=="string"?n:n.toString();o||r.has(s)?_0(n,t):(r.add(s),A0(n,t))}};var dl=([,t,e],r)=>{if(r.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,me(e,r,"all")]:Array.isArray(e)?[me(t,r,"all"),...e]:I(t)&&I(e)?Un([t,e]):`${t}${e}`};import{once as Lo}from"events";var ml=async(t,e)=>{let[r,n]=await I0(t);return e.isForcefullyTerminated??=!1,[r,n]},I0=async t=>{let[e,r]=await Promise.allSettled([Lo(t,"spawn"),Lo(t,"exit")]);return e.status==="rejected"?[]:r.status==="rejected"?fl(t):r.value},fl=async t=>{try{return await Lo(t,"exit")}catch{return fl(t)}},pl=async t=>{let[e,r]=await t;if(!R0(e,r)&&ko(e,r))throw new X;return[e,r]},R0=(t,e)=>t===void 0&&e===void 0,ko=(t,e)=>t!==0||e!==null;var Dl=({error:t,status:e,signal:r,output:n},{maxBuffer:o})=>{let s=M0(t,e,r),i=s?.code==="ETIMEDOUT",a=lc(s,n,o);return{resultError:s,exitCode:e,signal:r,timedOut:i,isMaxBuffer:a}},M0=(t,e,r)=>t!==void 0?t:ko(e,r)?new X:void 0;var hl=(t,e,r)=>{let{file:n,commandArguments:o,command:s,escapedCommand:i,startTime:a,verboseInfo:u,options:c,fileDescriptors:l}=L0(t,e,r),d=N0({file:n,commandArguments:o,options:c,command:s,escapedCommand:i,verboseInfo:u,fileDescriptors:l,startTime:a});return Xe(d,u,c)},L0=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=sr(t,e,r),a=k0(r),{file:u,commandArguments:c,options:l}=_r(t,e,a);j0(l);let d=zc(l,i);return{file:u,commandArguments:c,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:d}},k0=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,j0=({ipc:t,ipcInput:e,detached:r,cancelSignal:n})=>{e&&qr("ipcInput"),t&&qr("ipc: true"),r&&qr("detached: true"),n&&qr("cancelSignal")},qr=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},N0=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,verboseInfo:s,fileDescriptors:i,startTime:a})=>{let u=U0({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:d,timedOut:m,isMaxBuffer:f}=Dl(u,r),{output:D,error:b=c}=ll({fileDescriptors:i,syncResult:u,options:r,isMaxBuffer:f,verboseInfo:s}),F=D.map((v,R)=>me(v,r,R)),E=me(dl(D,r),r,"all");return V0({error:b,exitCode:l,signal:d,timedOut:m,isMaxBuffer:f,stdio:F,all:E,options:r,command:n,escapedCommand:o,startTime:a})},U0=({file:t,commandArguments:e,options:r,command:n,escapedCommand:o,fileDescriptors:s,startTime:i})=>{try{sl(s,r);let a=W0(r);return P0(...Or(t,e,a))}catch(a){return Je({error:a,command:n,escapedCommand:o,fileDescriptors:s,options:r,startTime:i,isSync:!0})}},W0=({encoding:t,maxBuffer:e,...r})=>({...r,encoding:"buffer",maxBuffer:Pr(e)}),V0=({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?Lr({command:u,escapedCommand:c,stdio:s,all:i,ipcOutput:[],options:a,startTime:l}):Ct({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 vC}from"events";import{spawn as $C}from"child_process";import yl from"process";import{once as jo,on as G0}from"events";var gl=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0,filter:s}={})=>(He({methodName:"getOneMessage",isSubprocess:r,ipc:n,isConnected:yr(t)}),H0({anyProcess:t,channel:e,isSubprocess:r,filter:s,reference:o})),H0=async({anyProcess:t,channel:e,isSubprocess:r,filter:n,reference:o})=>{gr(e,o);let s=ye(t,e,r),i=new AbortController;try{return await Promise.race([z0(s,n,i),q0(s,r,i),Y0(s,r,i)])}catch(a){throw ze(t),a}finally{i.abort(),br(e,o)}},z0=async(t,e,{signal:r})=>{if(e===void 0){let[n]=await jo(t,"message",{signal:r});return n}for await(let[n]of G0(t,"message",{signal:r}))if(e(n))return n},q0=async(t,e,{signal:r})=>{await jo(t,"disconnect",{signal:r}),nu(e)},Y0=async(t,e,{signal:r})=>{let[n]=await jo(t,"strict:error",{signal:r});throw pr(n,e)};import{once as Cl,on as K0}from"events";var El=({anyProcess:t,channel:e,isSubprocess:r,ipc:n},{reference:o=!0}={})=>No({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:!r,reference:o}),No=({anyProcess:t,channel:e,isSubprocess:r,ipc:n,shouldAwait:o,reference:s})=>{He({methodName:"getEachMessage",isSubprocess:r,ipc:n,isConnected:yr(t)}),gr(e,s);let i=ye(t,e,r),a=new AbortController,u={};return J0(t,i,a),X0({ipcEmitter:i,isSubprocess:r,controller:a,state:u}),Z0({anyProcess:t,channel:e,ipcEmitter:i,isSubprocess:r,shouldAwait:o,controller:a,state:u,reference:s})},J0=async(t,e,r)=>{try{await Cl(e,"disconnect",{signal:r.signal}),r.abort()}catch{}},X0=async({ipcEmitter:t,isSubprocess:e,controller:r,state:n})=>{try{let[o]=await Cl(t,"strict:error",{signal:r.signal});n.error=pr(o,e),r.abort()}catch{}},Z0=async function*({anyProcess:t,channel:e,ipcEmitter:r,isSubprocess:n,shouldAwait:o,controller:s,state:i,reference:a}){try{for await(let[u]of K0(r,"message",{signal:s.signal}))bl(i),yield u}catch{bl(i)}finally{s.abort(),br(e,a),n||ze(t),o&&await t}},bl=({error:t})=>{if(t)throw t};var xl=(t,{ipc:e})=>{Object.assign(t,Fl(t,!1,e))},wl=()=>{let t=yl,e=!0,r=yl.channel!==void 0;return{...Fl(t,e,r),getCancelSignal:vu.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})}},Fl=(t,e,r)=>({sendMessage:Sr.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getOneMessage:gl.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r}),getEachMessage:El.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:r})});import{ChildProcess as Q0}from"child_process";import{PassThrough as eb,Readable as tb,Writable as rb,Duplex as nb}from"stream";var Sl=({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,verboseInfo:i})=>{vo(n);let a=new Q0;ob(a,n),Object.assign(a,{readable:ib,writable:sb,duplex:ab});let u=Je({error:t,command:e,escapedCommand:r,fileDescriptors:n,options:o,startTime:s,isSync:!1}),c=ub(u,i,o);return{subprocess:a,promise:c}},ob=(t,e)=>{let r=yt(),n=yt(),o=yt(),s=Array.from({length:e.length-3},yt),i=yt(),a=[r,n,o,...s];Object.assign(t,{stdin:r,stdout:n,stderr:o,all:i,stdio:a})},yt=()=>{let t=new eb;return t.end(),t},ib=()=>new tb({read(){}}),sb=()=>new rb({write(){}}),ab=()=>new nb({read(){},write(){}}),ub=async(t,e,r)=>Xe(t,e,r);import{createReadStream as Al,createWriteStream as _l}from"fs";import{Buffer as cb}from"buffer";import{Readable as xt,Writable as lb,Duplex as db}from"stream";var Tl=(t,e)=>Ur(mb,t,e,!1),wt=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${xe[t]}.`)},Ol={fileNumber:wt,generator:Po,asyncGenerator:Po,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:r}}){let n=e||r;return{stream:db.fromWeb(t,{objectMode:n})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},mb={input:{...Ol,fileUrl:({value:t})=>({stream:Al(t)}),filePath:({value:{file:t}})=>({stream:Al(t)}),webStream:({value:t})=>({stream:xt.fromWeb(t)}),iterable:({value:t})=>({stream:xt.from(t)}),asyncIterable:({value:t})=>({stream:xt.from(t)}),string:({value:t})=>({stream:xt.from(t)}),uint8Array:({value:t})=>({stream:xt.from(cb.from(t))})},output:{...Ol,fileUrl:({value:t})=>({stream:_l(t)}),filePath:({value:{file:t,append:e}})=>({stream:_l(t,e?{flags:"a"}:{})}),webStream:({value:t})=>({stream:lb.fromWeb(t)}),iterable:wt,asyncIterable:wt,string:wt,uint8Array:wt}};import{on as fb,once as vl}from"events";import{PassThrough as pb,getDefaultHighWaterMark as Db}from"stream";import{finished as Il}from"stream/promises";function Ie(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(let o of t)Wo(o);let e=t.some(({readableObjectMode:o})=>o),r=hb(t,e),n=new Uo({objectMode:e,writableHighWaterMark:r,readableHighWaterMark:r});for(let o of t)n.add(o);return n}var hb=(t,e)=>{if(t.length===0)return Db(e);let r=t.filter(({readableObjectMode:n})=>n===e).map(({readableHighWaterMark:n})=>n);return Math.max(...r)},Uo=class extends pb{#t=new Set([]);#r=new Set([]);#e=new Set([]);#n;#i=Symbol("unpipe");#o=new WeakMap;add(e){if(Wo(e),this.#t.has(e))return;this.#t.add(e),this.#n??=gb(this,this.#t,this.#i);let r=Eb({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(Wo(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)}},gb=async(t,e,r)=>{Yr(t,$l);let n=new AbortController;try{await Promise.race([bb(t,n),Cb(t,e,r,n)])}finally{n.abort(),Yr(t,-$l)}},bb=async(t,{signal:e})=>{try{await Il(t,{signal:e,cleanup:!0})}catch(r){throw Rl(t,r),r}},Cb=async(t,e,r,{signal:n})=>{for await(let[o]of fb(t,"unpipe",{signal:n}))e.has(o)&&o.emit(r)},Wo=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},Eb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,onFinished:s,unpipeEvent:i})=>{Yr(t,Bl);let a=new AbortController;try{await Promise.race([yb(s,e,a),xb({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:a}),wb({stream:e,streams:r,ended:n,aborted:o,unpipeEvent:i,controller:a})])}finally{a.abort(),Yr(t,-Bl)}r.size>0&&r.size===n.size+o.size&&(n.size===0&&o.size>0?Vo(t):Fb(t))},yb=async(t,e,{signal:r})=>{try{await t,r.aborted||Vo(e)}catch(n){r.aborted||Rl(e,n)}},xb=async({passThroughStream:t,stream:e,streams:r,ended:n,aborted:o,controller:{signal:s}})=>{try{await Il(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),r.has(e)&&n.add(e)}catch(i){if(s.aborted||!r.has(e))return;Ml(i)?o.add(e):Pl(t,i)}},wb=async({stream:t,streams:e,ended:r,aborted:n,unpipeEvent:o,controller:{signal:s}})=>{if(await vl(t,o,{signal:s}),!t.readable)return vl(s,"abort",{signal:s});e.delete(t),r.delete(t),n.delete(t)},Fb=t=>{t.writable&&t.end()},Rl=(t,e)=>{Ml(e)?Vo(t):Pl(t,e)},Ml=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Vo=t=>{(t.readable||t.writable)&&t.destroy()},Pl=(t,e)=>{t.destroyed||(t.once("error",Sb),t.destroy(e))},Sb=()=>{},Yr=(t,e)=>{let r=t.getMaxListeners();r!==0&&r!==Number.POSITIVE_INFINITY&&t.setMaxListeners(r+e)},$l=2,Bl=1;import{finished as Ll}from"stream/promises";var Qe=(t,e)=>{t.pipe(e),Ab(t,e),_b(t,e)},Ab=async(t,e)=>{if(!(J(t)||J(e))){try{await Ll(t,{cleanup:!0,readable:!0,writable:!1})}catch{}Go(e)}},Go=t=>{t.writable&&t.end()},_b=async(t,e)=>{if(!(J(t)||J(e))){try{await Ll(e,{cleanup:!0,readable:!1,writable:!0})}catch{}Ho(t)}},Ho=t=>{t.readable&&t.destroy()};var kl=(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})=>q.has(u)))Ob(t,a,i,o);for(let{stream:a}of s.filter(({type:u})=>!q.has(u)))vb({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]:Ie(s);Qe(i,o)}},Ob=(t,e,r,n)=>{r==="output"?Qe(t.stdio[n],e):Qe(e,t.stdio[n]);let o=Tb[n];o!==void 0&&(t[o]=e),t.stdio[n]=e},Tb=["stdin","stdout","stderr"],vb=({subprocess:t,stream:e,direction:r,fdNumber:n,pipeGroups:o,controller:s})=>{if(e===void 0)return;$b(e,s);let[i,a]=r==="output"?[e,t.stdio[n]]:[t.stdio[n],e],u=o.get(i)??[];o.set(i,[...u,a])},$b=(t,{signal:e})=>{J(t)&&Te(t,Bb,e)},Bb=2;import{addAbortListener as Mb}from"events";var Re=[];Re.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Re.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Re.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Kr=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",zo=Symbol.for("signal-exit emitter"),qo=globalThis,Ib=Object.defineProperty.bind(Object),Yo=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(qo[zo])return qo[zo];Ib(qo,zo,{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}},Jr=class{},Rb=t=>({onExit(e,r){return t.onExit(e,r)},load(){return t.load()},unload(){return t.unload()}}),Ko=class extends Jr{onExit(){return()=>{}}load(){}unload(){}},Jo=class extends Jr{#t=Xo.platform==="win32"?"SIGINT":"SIGHUP";#r=new Yo;#e;#n;#i;#o={};#s=!1;constructor(e){super(),this.#e=e,this.#o={};for(let r of Re)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(!Kr(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 Re)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,Re.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 Kr(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"&&Kr(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)}},Xo=globalThis.process,{onExit:jl,load:zA,unload:qA}=Rb(Kr(Xo)?new Jo(Xo):new Ko);var Nl=(t,{cleanup:e,detached:r},{signal:n})=>{if(!e||r)return;let o=jl(()=>{t.kill()});Mb(n,()=>{o()})};var Wl=({source:t,sourcePromise:e,boundOptions:r,createNested:n},...o)=>{let s=ir(),{destination:i,destinationStream:a,destinationError:u,from:c,unpipeSignal:l}=Pb(r,n,o),{sourceStream:d,sourceError:m}=kb(t,c),{options:f,fileDescriptors:D}=ne.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:f,sourceError:m,destination:i,destinationStream:a,destinationError:u,unpipeSignal:l,fileDescriptors:D,startTime:s}},Pb=(t,e,r)=>{try{let{destination:n,pipeOptions:{from:o,to:s,unpipeSignal:i}={}}=Lb(t,e,...r),a=hr(n,s);return{destination:n,destinationStream:a,from:o,unpipeSignal:i}}catch(n){return{destinationError:n}}},Lb=(t,e,r,...n)=>{if(Array.isArray(r))return{destination:e(Ul,t)(r,...n),pipeOptions:t};if(typeof r=="string"||r instanceof URL||jn(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]=Kt(r,...n);return{destination:e(Ul)(o,s,i),pipeOptions:i}}if(ne.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}`)},Ul=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),kb=(t,e)=>{try{return{sourceStream:qe(t,e)}}catch(r){return{sourceError:r}}};var Gl=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n,fileDescriptors:o,sourceOptions:s,startTime:i})=>{let a=jb({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n});if(a!==void 0)throw Zo({error:a,fileDescriptors:o,sourceOptions:s,startTime:i})},jb=({sourceStream:t,sourceError:e,destinationStream:r,destinationError:n})=>{if(e!==void 0&&n!==void 0)return n;if(n!==void 0)return Ho(t),n;if(e!==void 0)return Go(r),e},Zo=({error:t,fileDescriptors:e,sourceOptions:r,startTime:n})=>Je({error:t,command:Vl,escapedCommand:Vl,fileDescriptors:e,options:r,startTime:n,isSync:!1}),Vl="source.pipe(destination)";var Hl=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 Nb}from"stream/promises";var zl=(t,e,r)=>{let n=Xr.has(e)?Wb(t,e):Ub(t,e);return Te(t,Gb,r.signal),Te(e,Hb,r.signal),Vb(e),n},Ub=(t,e)=>{let r=Ie([t]);return Qe(r,e),Xr.set(e,r),r},Wb=(t,e)=>{let r=Xr.get(e);return r.add(t),r},Vb=async t=>{try{await Nb(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Xr.delete(t)},Xr=new WeakMap,Gb=2,Hb=1;import{aborted as zb}from"util";var ql=(t,e)=>t===void 0?[]:[qb(t,e)],qb=async(t,{sourceStream:e,mergedStream:r,fileDescriptors:n,sourceOptions:o,startTime:s})=>{await zb(t,e),await r.remove(e);let i=new Error("Pipe canceled by `unpipeSignal` option.");throw Zo({error:i,fileDescriptors:n,sourceOptions:o,startTime:s})};var Zr=(t,...e)=>{if(T(e[0]))return Zr.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});let{destination:r,...n}=Wl(t,...e),o=Yb({...n,destination:r});return o.pipe=Zr.bind(void 0,{...t,source:r,sourcePromise:o,boundOptions:{}}),o},Yb=async({sourcePromise:t,sourceStream:e,sourceOptions:r,sourceError:n,destination:o,destinationStream:s,destinationError:i,unpipeSignal:a,fileDescriptors:u,startTime:c})=>{let l=Kb(t,o);Gl({sourceStream:e,sourceError:n,destinationStream:s,destinationError:i,fileDescriptors:u,sourceOptions:r,startTime:c});let d=new AbortController;try{let m=zl(e,s,d);return await Promise.race([Hl(l),...ql(a,{sourceStream:e,mergedStream:m,sourceOptions:r,fileDescriptors:u,startTime:c})])}finally{d.abort()}},Kb=(t,e)=>Promise.allSettled([t,e]);import{setImmediate as rC}from"timers/promises";import{on as Jb}from"events";import{getDefaultHighWaterMark as Xb}from"stream";var Qr=({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:n,encoding:o,preserveNewlines:s})=>{let i=new AbortController;return Zb(e,i),Kl({stream:t,controller:i,binary:r,shouldEncode:!t.readableObjectMode&&n,encoding:o,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},Zb=async(t,e)=>{try{await t}catch{}finally{e.abort()}},Qo=({stream:t,onStreamEnd:e,lines:r,encoding:n,stripFinalNewline:o,allMixed:s})=>{let i=new AbortController;Qb(e,i,t);let a=t.readableObjectMode&&!s;return Kl({stream:t,controller:i,binary:n==="buffer",shouldEncode:!a,encoding:n,shouldSplit:!a&&r,preserveNewlines:!o})},Qb=async(t,e,r)=>{try{await t}catch{r.destroy()}finally{e.abort()}},Kl=({stream:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})=>{let a=Jb(t,"data",{signal:e.signal,highWaterMark:Yl,highWatermark:Yl});return eC({onStdoutChunk:a,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i})},ei=Xb(!0),Yl=ei,eC=async function*({onStdoutChunk:t,controller:e,binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i}){let a=tC({binary:r,shouldEncode:n,encoding:o,shouldSplit:s,preserveNewlines:i});try{for await(let[u]of t)yield*Be(u,a,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*Et(a)}},tC=({binary:t,shouldEncode:e,encoding:r,shouldSplit:n,preserveNewlines:o})=>[Vr(t,r,!e),Wr(t,o,!n,{})].filter(Boolean);var Jl=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,buffer:o,maxBuffer:s,lines:i,allMixed:a,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{let d=nC({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:a,verboseInfo:c,streamInfo:l});if(!o){await Promise.all([oC(t),d]);return}let m=$o(u,r),f=Qo({stream:t,onStreamEnd:e,lines:i,encoding:n,stripFinalNewline:m,allMixed:a}),[D]=await Promise.all([iC({stream:t,iterable:f,fdNumber:r,encoding:n,maxBuffer:s,lines:i}),d]);return D},nC=async({stream:t,onStreamEnd:e,fdNumber:r,encoding:n,allMixed:o,verboseInfo:s,streamInfo:{fileDescriptors:i}})=>{if(!zr({stdioItems:i[r]?.stdioItems,encoding:n,verboseInfo:s,fdNumber:r}))return;let a=Qo({stream:t,onStreamEnd:e,lines:!0,encoding:n,stripFinalNewline:!0,allMixed:o});await al(a,t,r,s)},oC=async t=>{await rC(),t.readableFlowing===null&&t.resume()},iC=async({stream:t,stream:{readableObjectMode:e},iterable:r,fdNumber:n,encoding:o,maxBuffer:s,lines:i})=>{try{return e||i?await Br(r,{maxBuffer:s}):o==="buffer"?new Uint8Array(await Ir(r,{maxBuffer:s})):await Mr(r,{maxBuffer:s})}catch(a){return Xl(ac({error:a,stream:t,readableObjectMode:e,lines:i,encoding:o,fdNumber:n}))}},ti=async t=>{try{return await t}catch(e){return Xl(e)}},Xl=({bufferedData:t})=>ws(t)?new Uint8Array(t):t;import{finished as sC}from"stream/promises";var Ft=async(t,e,r,{isSameDirection:n,stopOnExit:o=!1}={})=>{let s=aC(t,r),i=new AbortController;try{await Promise.race([...o?[r.exitPromise]:[],sC(t,{cleanup:!0,signal:i.signal})])}catch(a){s.stdinCleanedUp||lC(a,e,r,n)}finally{i.abort()}},aC=(t,{originalStreams:[e],subprocess:r})=>{let n={stdinCleanedUp:!1};return t===e&&uC(t,r,n),n},uC=(t,e,r)=>{let{_destroy:n}=t;t._destroy=(...o)=>{cC(e,r),n.call(t,...o)}},cC=({exitCode:t,signalCode:e},r)=>{(t!==null||e!==null)&&(r.stdinCleanedUp=!0)},lC=(t,e,r,n)=>{if(!dC(t,e,r,n))throw t},dC=(t,e,r,n=!0)=>r.propagating?Zl(t)||en(t):(r.propagating=!0,ri(r,e)===n?Zl(t):en(t)),ri=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",en=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",Zl=t=>t?.code==="EPIPE";var Ql=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>t.stdio.map((u,c)=>ni({stream:u,fdNumber:c,encoding:e,buffer:r[c],maxBuffer:n[c],lines:o[c],allMixed:!1,stripFinalNewline:s,verboseInfo:i,streamInfo:a})),ni=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=Ft(t,e,c);if(ri(c,e)){await l;return}let[d]=await Promise.all([Jl({stream:t,onStreamEnd:l,fdNumber:e,encoding:r,buffer:n,maxBuffer:o,lines:s,allMixed:i,stripFinalNewline:a,verboseInfo:u,streamInfo:c}),l]);return d};var ed=({stdout:t,stderr:e},{all:r})=>r&&(t||e)?Ie([t,e].filter(Boolean)):void 0,td=({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:s,verboseInfo:i,streamInfo:a})=>ni({...mC(t,r),fdNumber:"all",encoding:e,maxBuffer:n[1]+n[2],lines:o[1]||o[2],allMixed:fC(t),stripFinalNewline:s,verboseInfo:i,streamInfo:a}),mC=({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}},fC=({all:t,stdout:e,stderr:r})=>t&&e&&r&&e.readableObjectMode!==r.readableObjectMode;import{once as pC}from"events";var rd=t=>We(t,"ipc"),nd=(t,e)=>{let r=or(t);te({type:"ipc",verboseMessage:r,fdNumber:"ipc",verboseInfo:e})};var od=async({subprocess:t,buffer:e,maxBuffer:r,ipc:n,ipcOutput:o,verboseInfo:s})=>{if(!n)return o;let i=rd(s),a=le(e,"ipc"),u=le(r,"ipc");for await(let c of No({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:n,shouldAwait:!1,reference:!0}))a&&(uc(t,o,u),o.push(c)),i&&nd(c,s);return o},id=async(t,e)=>(await Promise.allSettled([t]),e);var sd=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:d},context:m,verboseInfo:f,fileDescriptors:D,originalStreams:b,onInternalError:F,controller:E})=>{let v=ml(t,m),R={originalStreams:b,fileDescriptors:D,subprocess:t,exitPromise:v,propagating:!1},y=Ql({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:f,streamInfo:R}),_=td({subprocess:t,encoding:e,buffer:r,maxBuffer:n,lines:o,stripFinalNewline:c,verboseInfo:f,streamInfo:R}),B=[],k=od({subprocess:t,buffer:r,maxBuffer:n,ipc:l,ipcOutput:B,verboseInfo:f}),pe=DC(b,t,R),De=hC(D,R);try{return await Promise.race([Promise.all([{},pl(v),Promise.all(y),_,k,Nu(t,d),...pe,...De]),F,gC(t,E),...Mu(t,s,m,E),...ru({subprocess:t,cancelSignal:i,gracefulCancel:a,context:m,controller:E}),...Iu({subprocess:t,cancelSignal:i,gracefulCancel:a,forceKillAfterDelay:u,context:m,controller:E})])}catch(un){return m.terminationReason??="other",Promise.all([{error:un},v,Promise.all(y.map(it=>ti(it))),ti(_),id(k,B),Promise.allSettled(pe),Promise.allSettled(De)])}},DC=(t,e,r)=>t.map((n,o)=>n===e.stdio[o]?void 0:Ft(n,o,r)),hC=(t,e)=>t.flatMap(({stdioItems:r},n)=>r.filter(({value:o,stream:s=o})=>Q(s,{checkOpen:!1})&&!J(s)).map(({type:o,value:s,stream:i=s})=>Ft(i,n,e,{isSameDirection:q.has(o),stopOnExit:o==="native"}))),gC=async(t,{signal:e})=>{let[r]=await pC(t,"error",{signal:e});throw r};var ad=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),St=(t,e,r)=>{let n=t[r];n.has(e)||n.set(e,[]);let o=n.get(e),s=re();return o.push(s),{resolve:s.resolve.bind(s),promises:o}},et=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 bC}from"stream";import{callbackify as CC}from"util";import{finished as ud}from"stream/promises";var oi=async t=>{if(t!==void 0)try{await ii(t)}catch{}},cd=async t=>{if(t!==void 0)try{await si(t)}catch{}},ii=async t=>{await ud(t,{cleanup:!0,readable:!1,writable:!0})},si=async t=>{await ud(t,{cleanup:!0,readable:!0,writable:!1})},tn=async(t,e)=>{if(await t,e)throw e},rn=(t,e,r)=>{r&&!en(r)?t.destroy(r):e&&t.destroy()};var ld=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,binary:o=!0,preserveNewlines:s=!0}={})=>{let i=o||W.has(r),{subprocessStdout:a,waitReadableDestroy:u}=ai(t,n,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:d}=ui(a,i),{read:m,onStdoutDataDone:f}=ci({subprocessStdout:a,subprocess:t,binary:i,encoding:r,preserveNewlines:s}),D=new bC({read:m,destroy:CC(di.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:u})),highWaterMark:d,objectMode:l,encoding:c});return li({subprocessStdout:a,onStdoutDataDone:f,readable:D,subprocess:t}),D},ai=(t,e,r)=>{let n=qe(t,e),o=St(r,n,"readableDestroy");return{subprocessStdout:n,waitReadableDestroy:o}},ui=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r},n)=>n?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:r}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:ei},ci=({subprocessStdout:t,subprocess:e,binary:r,encoding:n,preserveNewlines:o})=>{let s=re(),i=Qr({subprocessStdout:t,subprocess:e,binary:r,shouldEncode:!r,encoding:n,preserveNewlines:o});return{read(){EC(this,i,s)},onStdoutDataDone:s}},EC=async(t,e,r)=>{try{let{value:n,done:o}=await e.next();o?r.resolve():t.push(n)}catch{}},li=async({subprocessStdout:t,onStdoutDataDone:e,readable:r,subprocess:n,subprocessStdin:o})=>{try{await si(t),await n,await oi(o),await e,r.readable&&r.push(null)}catch(s){await oi(o),dd(r,s)}},di=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:r},n)=>{await et(r,e)&&(dd(t,n),await tn(e,n))},dd=(t,e)=>{rn(t,t.readable,e)};import{Writable as yC}from"stream";import{callbackify as md}from"util";var fd=({subprocess:t,concurrentStreams:e},{to:r}={})=>{let{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}=mi(t,r,e),i=new yC({...fi(n,t,o),destroy:md(Di.bind(void 0,{subprocessStdin:n,subprocess:t,waitWritableFinal:o,waitWritableDestroy:s})),highWaterMark:n.writableHighWaterMark,objectMode:n.writableObjectMode});return pi(n,i),i},mi=(t,e,r)=>{let n=hr(t,e),o=St(r,n,"writableFinal"),s=St(r,n,"writableDestroy");return{subprocessStdin:n,waitWritableFinal:o,waitWritableDestroy:s}},fi=(t,e,r)=>({write:xC.bind(void 0,t),final:md(wC.bind(void 0,t,e,r))}),xC=(t,e,r,n)=>{t.write(e,r)?n():t.once("drain",n)},wC=async(t,e,r)=>{await et(r,e)&&(t.writable&&t.end(),await e)},pi=async(t,e,r)=>{try{await ii(t),e.writable&&e.end()}catch(n){await cd(r),pd(e,n)}},Di=async({subprocessStdin:t,subprocess:e,waitWritableFinal:r,waitWritableDestroy:n},o)=>{await et(r,e),await et(n,e)&&(pd(t,o),await tn(e,o))},pd=(t,e)=>{rn(t,t.writable,e)};import{Duplex as FC}from"stream";import{callbackify as SC}from"util";var Dd=({subprocess:t,concurrentStreams:e,encoding:r},{from:n,to:o,binary:s=!0,preserveNewlines:i=!0}={})=>{let a=s||W.has(r),{subprocessStdout:u,waitReadableDestroy:c}=ai(t,n,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:m}=mi(t,o,e),{readableEncoding:f,readableObjectMode:D,readableHighWaterMark:b}=ui(u,a),{read:F,onStdoutDataDone:E}=ci({subprocessStdout:u,subprocess:t,binary:a,encoding:r,preserveNewlines:i}),v=new FC({read:F,...fi(l,t,d),destroy:SC(AC.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:d,waitWritableDestroy:m})),readableHighWaterMark:b,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:D,writableObjectMode:l.writableObjectMode,encoding:f});return li({subprocessStdout:u,onStdoutDataDone:E,readable:v,subprocess:t,subprocessStdin:l}),pi(l,v,u),v},AC=async({subprocessStdout:t,subprocessStdin:e,subprocess:r,waitReadableDestroy:n,waitWritableFinal:o,waitWritableDestroy:s},i)=>{await Promise.all([di({subprocessStdout:t,subprocess:r,waitReadableDestroy:n},i),Di({subprocessStdin:e,subprocess:r,waitWritableFinal:o,waitWritableDestroy:s},i)])};var hi=(t,e,{from:r,binary:n=!1,preserveNewlines:o=!1}={})=>{let s=n||W.has(e),i=qe(t,r),a=Qr({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 hd=(t,{encoding:e})=>{let r=ad();t.readable=ld.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.writable=fd.bind(void 0,{subprocess:t,concurrentStreams:r}),t.duplex=Dd.bind(void 0,{subprocess:t,concurrentStreams:r,encoding:e}),t.iterable=hi.bind(void 0,t,e),t[Symbol.asyncIterator]=hi.bind(void 0,t,e,{})};var gd=(t,e)=>{for(let[r,n]of TC){let o=n.value.bind(e);Reflect.defineProperty(t,r,{...n,value:o})}},OC=(async()=>{})().constructor.prototype,TC=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(OC,t)]);var bd=(t,e,r,n)=>{let{file:o,commandArguments:s,command:i,escapedCommand:a,startTime:u,verboseInfo:c,options:l,fileDescriptors:d}=BC(t,e,r),{subprocess:m,promise:f}=RC({file:o,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:i,escapedCommand:a,fileDescriptors:d});return m.pipe=Zr.bind(void 0,{source:m,sourcePromise:f,boundOptions:{},createNested:n}),gd(m,f),ne.set(m,{options:l,fileDescriptors:d}),m},BC=(t,e,r)=>{let{command:n,escapedCommand:o,startTime:s,verboseInfo:i}=sr(t,e,r),{file:a,commandArguments:u,options:c}=_r(t,e,r),l=IC(c),d=Tl(l,i);return{file:a,commandArguments:u,command:n,escapedCommand:o,startTime:s,verboseInfo:i,options:l,fileDescriptors:d}},IC=({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}},RC=({file:t,commandArguments:e,options:r,startTime:n,verboseInfo:o,command:s,escapedCommand:i,fileDescriptors:a})=>{let u;try{u=$C(...Or(t,e,r))}catch(D){return Sl({error:D,command:s,escapedCommand:i,fileDescriptors:a,options:r,startTime:n,verboseInfo:o})}let c=new AbortController;vC(Number.POSITIVE_INFINITY,c.signal);let l=[...u.stdio];kl(u,a,c),Nl(u,r,c);let d={},m=re();u.kill=eu.bind(void 0,{kill:u.kill.bind(u),options:r,onInternalError:m,context:d,controller:c}),u.all=ed(u,r),hd(u,r),xl(u,r);let f=MC({subprocess:u,options:r,startTime:n,verboseInfo:o,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:i,context:d,onInternalError:m,controller:c});return{subprocess:u,promise:f}},MC=async({subprocess:t,options:e,startTime:r,verboseInfo:n,fileDescriptors:o,originalStreams:s,command:i,escapedCommand:a,context:u,onInternalError:c,controller:l})=>{let[d,[m,f],D,b,F]=await sd({subprocess:t,options:e,context:u,verboseInfo:n,fileDescriptors:o,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();let E=D.map((y,_)=>me(y,e,_)),v=me(b,e,"all"),R=PC({errorInfo:d,exitCode:m,signal:f,stdio:E,all:v,ipcOutput:F,context:u,options:e,command:i,escapedCommand:a,startTime:r});return Xe(R,n,e)},PC=({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?Ct({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 oe,isForcefullyTerminated:i.isForcefullyTerminated,exitCode:e,signal:r,stdio:n,all:o,ipcOutput:s,options:a,startTime:l,isSync:!1}):Lr({command:u,escapedCommand:c,stdio:n,all:o,ipcOutput:s,options:a,startTime:l});var nn=(t,e)=>{let r=Object.fromEntries(Object.entries(e).map(([n,o])=>[n,LC(n,t[n],o)]));return{...t,...r}},LC=(t,e,r)=>kC.has(t)&&T(e)&&T(r)?{...e,...r}:r,kC=new Set(["env",...Hn]);var we=(t,e,r,n)=>{let o=(i,a,u)=>we(i,a,r,u),s=(...i)=>jC({mapArguments:t,deepOptions:r,boundOptions:e,setBoundExeca:n,createNested:o},...i);return n!==void 0&&n(s,o,e),s},jC=({mapArguments:t,deepOptions:e={},boundOptions:r={},setBoundExeca:n,createNested:o},s,...i)=>{if(T(s))return o(t,nn(r,s),n);let{file:a,commandArguments:u,options:c,isSync:l}=NC({mapArguments:t,firstArgument:s,nextArguments:i,deepOptions:e,boundOptions:r});return l?hl(a,u,c):bd(a,u,c,o)},NC=({mapArguments:t,firstArgument:e,nextArguments:r,deepOptions:n,boundOptions:o})=>{let s=Ts(e)?vs(e,r):[e,...r],[i,a,u]=Kt(...s),c=nn(nn(n,o),u),{file:l=i,commandArguments:d=a,options:m=c,isSync:f=!1}=t({file:i,commandArguments:a,options:c});return{file:l,commandArguments:d,options:m,isSync:f}};var Cd=({file:t,commandArguments:e})=>yd(t,e),Ed=({file:t,commandArguments:e})=>({...yd(t,e),isSync:!0}),yd=(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]=UC(t);return{file:r,commandArguments:n}},UC=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(WC)){let o=r.at(-1);o&&o.endsWith("\\")?r[r.length-1]=`${o.slice(0,-1)} ${n}`:r.push(n)}return r},WC=/ +/g;var xd=(t,e,r)=>{t.sync=e(VC,r),t.s=t.sync},wd=({options:t})=>Fd(t),VC=({options:t})=>({...Fd(t),isSync:!0}),Fd=t=>({options:{...GC(t),...t}}),GC=({input:t,inputFile:e,stdio:r})=>t===void 0&&e===void 0&&r===void 0?{stdin:"inherit"}:{},Sd={preferLocal:!0};var At=we(()=>({})),PO=we(()=>({isSync:!0})),on=we(Cd),LO=we(Ed),kO=we(Lu),jO=we(wd,{},Sd,xd),{sendMessage:NO,getOneMessage:UO,getEachMessage:WO,getCancelSignal:VO}=wl();function tt(t){return t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}async function j(t,e,r){return At("docker",["compose",...t],{cwd:e,...r})}async function Fe(t,e){let{stdout:r}=await At("docker",["compose","exec","-T","web","bin/rails","runner",t],{cwd:e});return r.split(`
|
|
128
|
+
`).filter(n=>!n.startsWith("[")).join(`
|
|
129
|
+
`).trim()}async function Ad(t){await At("docker",["compose","exec","web","bin/rails","c"],{cwd:t,stdio:"inherit"})}async function sn(t,e){await At("docker",["compose","logs","-f",t],{cwd:e,stdio:"inherit"})}function _d(t){t.command("dev").description("Start services and stream logs").action(async()=>{let e=A(),r=M();r.start("Starting Docker services..."),await j(["up","-d"],e.projectDir),r.stop("Docker services started."),ke(["",_t.default.bold("Admin Dashboard"),` ${_t.default.cyan(`http://localhost:${e.port}/admin`)}`,` Email: ${qt}`,` Password: ${Yt}`,"",_t.default.bold("Store API"),` ${_t.default.cyan(`http://localhost:${e.port}/api/v3/store`)}`,""].join(`
|
|
130
|
+
`),"Spree Commerce"),L.info(`Streaming logs (Ctrl+C to stop)...
|
|
131
|
+
`),await sn("web",e.projectDir)})}function Od(t){t.command("stop").description("Stop services").action(async()=>{let e=A(),r=M();r.start("Stopping services..."),await j(["stop"],e.projectDir),r.stop("Services stopped.")})}function Td(t){t.command("update").description("Pull latest image and recreate containers").action(async()=>{let e=A(),r=M();r.start("Pulling latest images..."),await j(["pull"],e.projectDir),r.stop("Images pulled."),r.start("Recreating containers..."),await j(["up","-d"],e.projectDir),r.stop("Containers recreated."),L.success("Update complete! Migrations will run automatically on startup."),L.info("Run `spree logs` to follow the startup progress.")})}function vd(t){t.command("logs").description("Stream service logs").argument("[service]","service name (web or worker)","web").action(async e=>{let r=A();await sn(e,r.projectDir)})}var Me=G(he(),1);import{platform as HC}from"os";var zC=3e3,$d=12e4;function Bd(t){t.command("init").description("First-run setup: start services, configure API key, load sample data").option("--no-sample-data","skip loading sample data").option("--no-open","skip opening browser").action(async e=>{let r=A(),n=M();n.start("Starting Docker services..."),await j(["up","-d"],r.projectDir),n.stop("Docker services started."),n.start("Waiting for Spree to be ready..."),await qC(r.port),n.stop("Spree is ready."),n.start("Configuring API key...");let o=await YC(r.projectDir);n.stop(`API key: ${Me.default.cyan(o)}`),e.sampleData&&(n.start("Loading sample data..."),await j(["exec","-T","web","bin/rails","spree:load_sample_data"],r.projectDir),n.stop("Sample data loaded.")),ke(["",Me.default.bold("Admin Dashboard"),` ${Me.default.cyan(`http://localhost:${r.port}/admin`)}`,` Email: ${qt}`,` Password: ${Yt}`,"",Me.default.bold("Store API"),` ${Me.default.cyan(`http://localhost:${r.port}/api/v3/store`)}`,` API Key: ${Me.default.cyan(o)}`,""].join(`
|
|
132
|
+
`),"Your Spree store is ready!"),e.open&&await KC(`http://localhost:${r.port}/admin`)})}async function qC(t){let e=`http://localhost:${t}/up`,r=Date.now();for(;Date.now()-r<$d;){try{if((await fetch(e)).ok)return}catch{}await new Promise(n=>setTimeout(n,zC))}throw new Error(`Spree did not become healthy within ${$d/1e3}s`)}async function YC(t){let e=["store = Spree::Store.default;","key = store.api_keys.active.publishable.first ||"," store.api_keys.create!(name: 'Default', key_type: 'publishable');","print key.plaintext_token"].join(" "),r=await Fe(e,t),n=r.match(/pk_[A-Za-z0-9_-]+/);if(!n)throw new Error(`Could not extract API key from Rails output: ${r}`);return n[0]}async function KC(t){let e=HC(),r=e==="darwin"?"open":e==="win32"?"start":"xdg-open";try{await on(`${r} ${t}`,{stdio:"ignore"})}catch{}}function Id(t){t.command("console").description("Open Rails console").action(async()=>{let e=A();await Ad(e.projectDir)})}var Rd=G(he(),1);function Md(t){t.command("user").description("Manage admin users").command("create").description("Create an admin user").option("--email <email>","admin email").option("--password <password>","admin password").action(async r=>{let n=A(),o=r.email,s=r.password;if(!o){let l=await zt({message:"Admin email:",placeholder:"admin@example.com",validate(d){if(!d)return"Email is required";if(!d.includes("@"))return"Invalid email"}});be(l)&&(je("Cancelled."),process.exit(0)),o=l}if(!s){let l=await bs({message:"Admin password:",validate(d){if(!d||d.length<6)return"Password must be at least 6 characters"}});be(l)&&(je("Cancelled."),process.exit(0)),s=l}let i=M();i.start("Creating admin user...");let a=tt(o),u=tt(s),c=["admin = Spree.admin_user_class.create!(",`email: '${a}',`,`password: '${u}',`,`password_confirmation: '${u}'`,");","admin.add_role('admin', Spree::Store.default);","print admin.email"].join(" ");await Fe(c,n.projectDir),i.stop("Admin user created."),L.success(`Email: ${Rd.default.cyan(o)}`)})}var _e=G(he(),1),tm=G(em(),1);function rm(t){let e=t.command("api-key").description("Manage API keys");e.command("create").description("Create an API key").option("--name <name>","key name").option("--type <type>","key type: publishable or secret").action(async r=>{let n=A(),o=r.name,s=r.type;if(!o){let D=await zt({message:"Key name:",placeholder:"My Storefront",validate(b){if(!b)return"Name is required"}});be(D)&&(je("Cancelled."),process.exit(0)),o=D}if(!s){let D=await Cs({message:"Key type:",options:[{value:"publishable",label:"Publishable (for storefronts)"},{value:"secret",label:"Secret (for server-to-server)"}]});be(D)&&(je("Cancelled."),process.exit(0)),s=D}if(s!=="publishable"&&s!=="secret")throw new Error('Key type must be "publishable" or "secret".');let i=M();i.start("Creating API key...");let u=["key = Spree::Store.default.api_keys.create!(",`name: '${tt(o)}',`,`key_type: '${s}'`,");","print key.plaintext_token"].join(" "),c=await Fe(u,n.projectDir),l=s==="publishable"?"pk_":"sk_",d=c.match(new RegExp(`${l}[A-Za-z0-9_-]+`)),m=d?d[0]:c.trim();i.stop("API key created.");let f=[`${_e.default.bold("Name:")} ${o}`,`${_e.default.bold("Type:")} ${s}`,`${_e.default.bold("Token:")} ${_e.default.cyan(m)}`];s==="secret"&&(f.push(""),f.push(_e.default.yellow("Save this token now \u2014 secret keys cannot be retrieved later."))),ke(f.join(`
|
|
133
|
+
`),"API Key")}),e.command("list").description("List API keys").action(async()=>{let r=A(),n=M();n.start("Fetching API keys...");let o=["Spree::Store.default.api_keys.order(created_at: :desc).each { |k|","status = k.revoked_at ? 'revoked' : 'active';","token = k.secret? ? k.token_prefix : k.token;","puts [k.prefixed_id, k.name, k.key_type, token, k.created_at.strftime('%Y-%m-%d %H:%M'), status].join('|')","}"].join(" "),s=await Fe(o,r.projectDir);n.stop("");let i=s.trim().split(`
|
|
134
|
+
`).filter(Boolean);if(i.length===0){L.info("No API keys found.");return}let a=i.map(u=>{let[c,l,d,m,f,D]=u.split("|");return{ID:c??"",Name:l??"",Type:d??"",Token:m??"",Created:f??"",Status:D==="active"?_e.default.green(D):_e.default.red(D??"")}});(0,tm.printTable)(a)}),e.command("revoke").description("Revoke an API key").argument("<id>","ID of the key to revoke (from api-key list)").action(async r=>{let n=A(),o=M();o.start("Revoking API key...");let i=[`key = Spree::Store.default.api_keys.find_by_prefix_id!('${tt(r)}');`,"key.revoke!;","print key.name"].join(" "),u=(await Fe(i,n.projectDir)).trim();o.stop(`API key "${u}" revoked.`)})}function nm(t){t.command("seed").description("Seed the database").action(async()=>{let e=A(),r=M();r.start("Seeding database..."),await j(["exec","-T","web","bin/rails","db:seed"],e.projectDir),r.stop("Database seeded.")})}import{platform as XE}from"os";function om(t){t.command("open").description("Open the admin dashboard in the browser").action(async()=>{let r=`http://localhost:${A().port}/admin`,n=XE();await on(`${n==="darwin"?"open":n==="win32"?"start":"xdg-open"} ${r}`)})}function im(t){t.command("sample-data").description("Load sample data (products, categories, images)").action(async()=>{let e=A(),r=M();r.start("Loading sample data..."),await j(["exec","-T","web","bin/rails","spree:load_sample_data"],e.projectDir),r.stop("Sample data loaded.")})}var V=new Yi().name("spree").description("CLI for managing Spree Commerce projects").version("2.0.0-beta");Bd(V);_d(V);Od(V);Td(V);vd(V);Id(V);Md(V);rm(V);om(V);nm(V);im(V);V.exitOverride();async function ZE(){try{await V.parseAsync()}catch(t){t instanceof Error&&"code"in t&&(t.code==="commander.helpDisplayed"||t.code==="commander.version")&&process.exit(0);let e=t instanceof Error?t.message:"An unexpected error occurred.";console.error(`
|
|
135
|
+
${sm.default.red("Error:")} ${e}
|
|
136
|
+
`),process.exit(1)}}ZE();
|