UNPKG

skeet

Version:

Full-stack TypeScript Serverless Framework

21 lines 2.03 MB
#!/usr/bin/env node "use strict";var VY=Object.create;var T2=Object.defineProperty;var UY=Object.getOwnPropertyDescriptor;var $Y=Object.getOwnPropertyNames;var WY=Object.getPrototypeOf,GY=Object.prototype.hasOwnProperty;var h=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),HY=(e,t)=>{for(var r in t)T2(e,r,{get:t[r],enumerable:!0})},yb=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of $Y(t))!GY.call(e,a)&&a!==r&&T2(e,a,{get:()=>t[a],enumerable:!(n=UY(t,a))||n.enumerable});return e};var K=(e,t,r)=>(r=e!=null?VY(WY(e)):{},yb(t||!e||!e.__esModule?T2(r,"default",{value:e,enumerable:!0}):r,e)),zY=e=>yb(T2({},"__esModule",{value:!0}),e);var _b=h((lwe,KY)=>{KY.exports={name:"dotenv",version:"16.0.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{require:"./lib/main.js",types:"./lib/main.d.ts",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard","lint-readme":"standard-markdown",pretest:"npm run lint && npm run dts-check",test:"tap tests/*.js --100 -Rspec",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^17.0.9",decache:"^4.6.1",dtslint:"^3.7.0",sinon:"^12.0.1",standard:"^16.0.4","standard-markdown":"^7.1.0","standard-version":"^9.3.2",tap:"^15.1.6",tar:"^6.1.11",typescript:"^4.5.4"},engines:{node:">=12"}}});var wb=h((dwe,P2)=>{var YY=require("fs"),Eb=require("path"),JY=require("os"),QY=_b(),ZY=QY.version,XY=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function eJ(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,` `);let n;for(;(n=XY.exec(r))!=null;){let a=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,` `),o=o.replace(/\\r/g,"\r")),t[a]=o}return t}function j5(e){console.log(`[dotenv@${ZY}][DEBUG] ${e}`)}function tJ(e){return e[0]==="~"?Eb.join(JY.homedir(),e.slice(1)):e}function rJ(e){let t=Eb.resolve(process.cwd(),".env"),r="utf8",n=Boolean(e&&e.debug),a=Boolean(e&&e.override);e&&(e.path!=null&&(t=tJ(e.path)),e.encoding!=null&&(r=e.encoding));try{let o=B2.parse(YY.readFileSync(t,{encoding:r}));return Object.keys(o).forEach(function(s){Object.prototype.hasOwnProperty.call(process.env,s)?(a===!0&&(process.env[s]=o[s]),n&&j5(a===!0?`"${s}" is already defined in \`process.env\` and WAS overwritten`:`"${s}" is already defined in \`process.env\` and was NOT overwritten`)):process.env[s]=o[s]}),{parsed:o}}catch(o){return n&&j5(`Failed to load ${t} ${o.message}`),{error:o}}}var B2={config:rJ,parse:eJ};P2.exports.config=B2.config;P2.exports.parse=B2.parse;P2.exports=B2});var Ep=h(M5=>{var q2=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},L5=class extends q2{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};M5.CommanderError=q2;M5.InvalidArgumentError=L5});var N2=h(V5=>{var{InvalidArgumentError:iJ}=Ep(),k5=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new iJ(`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 nJ(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}V5.Argument=k5;V5.humanReadableArgName=nJ});var $5=h(Fb=>{var{humanReadableArgName:aJ}=N2(),U5=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(t){let r=t.commands.filter(n=>!n._hidden);if(t._hasImplicitHelpCommand()){let[,n,a]=t._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),o=t.createCommand(n).helpOption(!1);o.description(t._helpCommandDescription),a&&o.arguments(a),r.push(o)}return this.sortSubcommands&&r.sort((n,a)=>n.name().localeCompare(a.name())),r}visibleOptions(t){let r=t.options.filter(o=>!o.hidden),n=t._hasHelpOption&&t._helpShortFlag&&!t._findOption(t._helpShortFlag),a=t._hasHelpOption&&!t._findOption(t._helpLongFlag);if(n||a){let o;n?a?o=t.createOption(t._helpFlags,t._helpDescription):o=t.createOption(t._helpShortFlag,t._helpDescription):o=t.createOption(t._helpLongFlag,t._helpDescription),r.push(o)}if(this.sortOptions){let o=s=>s.short?s.short.replace(/^-/,""):s.long.replace(/^--/,"");r.sort((s,l)=>o(s).localeCompare(o(l)))}return r}visibleArguments(t){return t._argsDescription&&t._args.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t._args.find(r=>r.description)?t._args:[]}subcommandTerm(t){let r=t._args.map(n=>aJ(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,a)=>Math.max(n,r.subcommandTerm(a).length),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,a)=>Math.max(n,r.optionTerm(a).length),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,a)=>Math.max(n,r.argumentTerm(a).length),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let a=t.parent;a;a=a.parent)n=a.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];return t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0?`${t.description} (${r.join(", ")})`:t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatHelp(t,r){let n=r.padWidth(t,r),a=r.helpWidth||80,o=2,s=2;function l(O,q){if(q){let S=`${O.padEnd(n+s)}${q}`;return r.wrap(S,a-o,n+s)}return O}function c(O){return O.join(` `).replace(/^/gm," ".repeat(o))}let f=[`Usage: ${r.commandUsage(t)}`,""],v=r.commandDescription(t);v.length>0&&(f=f.concat([v,""]));let g=r.visibleArguments(t).map(O=>l(r.argumentTerm(O),r.argumentDescription(O)));g.length>0&&(f=f.concat(["Arguments:",c(g),""]));let _=r.visibleOptions(t).map(O=>l(r.optionTerm(O),r.optionDescription(O)));_.length>0&&(f=f.concat(["Options:",c(_),""]));let A=r.visibleCommands(t).map(O=>l(r.subcommandTerm(O),r.subcommandDescription(O)));return A.length>0&&(f=f.concat(["Commands:",c(A),""])),f.join(` `)}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}wrap(t,r,n,a=40){if(t.match(/[\n]\s+/))return t;let o=r-n;if(o<a)return t;let s=t.slice(0,n),l=t.slice(n),c=" ".repeat(n),f=new RegExp(".{1,"+(o-1)+"}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)","g"),v=l.match(f)||[];return s+v.map((g,_)=>(g.slice(-1)===` `&&(g=g.slice(0,g.length-1)),(_>0?c:"")+g.trimRight())).join(` `)}};Fb.Help=U5});var H5=h(R2=>{var{InvalidArgumentError:oJ}=Ep(),W5=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=Cb(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){return this.implied=Object.assign(this.implied||{},t),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_concatValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:r.concat(t)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new oJ(`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 uJ(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},G5=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let a=this.negativeOptions.get(n).presetArg,o=a!==void 0?a:!1;return r.negate===(o===t)}};function uJ(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function Cb(e){let t,r,n=e.split(/[ |,]+/);return n.length>1&&!/^[[<]/.test(n[1])&&(t=n.shift()),r=n.shift(),!t&&/^-[^-]$/.test(r)&&(t=r,r=void 0),{shortFlag:t,longFlag:r}}R2.Option=W5;R2.splitOptionFlags=Cb;R2.DualOptions=G5});var Ab=h(Sb=>{function sJ(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let a=1;a<=e.length;a++){let o=1;e[a-1]===t[n-1]?o=0:o=1,r[a][n]=Math.min(r[a-1][n]+1,r[a][n-1]+1,r[a-1][n-1]+o),a>1&&n>1&&e[a-1]===t[n-2]&&e[a-2]===t[n-1]&&(r[a][n]=Math.min(r[a][n],r[a-2][n-2]+1))}return r[e.length][t.length]}function pJ(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let n=[],a=3,o=.4;return t.forEach(s=>{if(s.length<=1)return;let l=sJ(e,s),c=Math.max(e.length,s.length);(c-l)/c>o&&(l<a?(a=l,n=[s]):l===a&&n.push(s))}),n.sort((s,l)=>s.localeCompare(l)),r&&(n=n.map(s=>`--${s}`)),n.length>1?` (Did you mean one of ${n.join(", ")}?)`:n.length===1?` (Did you mean ${n[0]}?)`:""}Sb.suggestSimilar=pJ});var Nb=h(qb=>{var lJ=require("events").EventEmitter,z5=require("child_process"),Qn=require("path"),K5=require("fs"),nt=require("process"),{Argument:dJ,humanReadableArgName:cJ}=N2(),{CommanderError:Y5}=Ep(),{Help:fJ}=$5(),{Option:Ob,splitOptionFlags:mJ,DualOptions:hJ}=H5(),{suggestSimilar:Tb}=Ab(),wp=class extends lJ{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>nt.stdout.write(r),writeErr:r=>nt.stderr.write(r),getOutHelpWidth:()=>nt.stdout.isTTY?nt.stdout.columns:void 0,getErrHelpWidth:()=>nt.stderr.isTTY?nt.stderr.columns:void 0,outputError:(r,n)=>n(r)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._hasHelpOption=t._hasHelpOption,this._helpFlags=t._helpFlags,this._helpDescription=t._helpDescription,this._helpShortFlag=t._helpShortFlag,this._helpLongFlag=t._helpLongFlag,this._helpCommandName=t._helpCommandName,this._helpCommandnameAndArgs=t._helpCommandnameAndArgs,this._helpCommandDescription=t._helpCommandDescription,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}command(t,r,n){let a=r,o=n;typeof a=="object"&&a!==null&&(o=a,a=null),o=o||{};let[,s,l]=t.match(/([^ ]+) *(.*)/),c=this.createCommand(s);return a&&(c.description(a),c._executableHandler=!0),o.isDefault&&(this._defaultCommandName=c._name),c._hidden=!!(o.noHelp||o.hidden),c._executableFile=o.executableFile||null,l&&c.arguments(l),this.commands.push(c),c.parent=this,c.copyInheritedSettings(this),a?this:c}createCommand(t){return new wp(t)}createHelp(){return Object.assign(new fJ,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,t),this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name - specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this.commands.push(t),t.parent=this,this}createArgument(t,r){return new dJ(t,r)}argument(t,r,n,a){let o=this.createArgument(t,r);return typeof n=="function"?o.default(a).argParser(n):o.default(n),this.addArgument(o),this}arguments(t){return t.split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this._args.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this._args.push(t),this}addHelpCommand(t,r){return t===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof t=="string"&&(this._helpCommandName=t.split(" ")[0],this._helpCommandnameAndArgs=t),this._helpCommandDescription=r||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'. Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new Y5(t,r,n)),nt.exit(t)}action(t){let r=n=>{let a=this._args.length,o=n.slice(0,a);return this._storeOptionsAsProperties?o[a]=this:o[a]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=r,this}createOption(t,r){return new Ob(t,r)}addOption(t){let r=t.name(),n=t.attributeName();if(t.negate){let o=t.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");this.options.push(t);let a=(o,s,l)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let c=this.getOptionValue(n);if(o!==null&&t.parseArg)try{o=t.parseArg(o,c)}catch(f){if(f.code==="commander.invalidArgument"){let v=`${s} ${f.message}`;this.error(v,{exitCode:f.exitCode,code:f.code})}throw f}else o!==null&&t.variadic&&(o=t._concatValue(o,c));o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,l)};return this.on("option:"+r,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;a(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;a(o,s,"env")}),this}_optionEx(t,r,n,a,o){if(typeof r=="object"&&r instanceof Ob)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!t.mandatory),typeof a=="function")s.default(o).argParser(a);else if(a instanceof RegExp){let l=a;a=(c,f)=>{let v=l.exec(c);return v?v[0]:f},s.default(o).argParser(a)}else s.default(a);return this.addOption(s)}option(t,r,n,a){return this._optionEx({},t,r,n,a)}requiredOption(t,r,n,a){return this._optionEx({mandatory:!0},t,r,n,a)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){if(this._passThroughOptions=!!t,this.parent&&t&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(t=!0){if(this._storeOptionsAsProperties=!!t,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");r=r||{},t===void 0&&(t=nt.argv,nt.versions&&nt.versions.electron&&(r.from="electron")),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":nt.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),this}_executeSubCommand(t,r){r=r.slice();let n=!1,a=[".js",".ts",".tsx",".mjs",".cjs"];function o(v,g){let _=Qn.resolve(v,g);if(K5.existsSync(_))return _;if(a.includes(Qn.extname(g)))return;let A=a.find(O=>K5.existsSync(`${_}${O}`));if(A)return`${_}${A}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,l=this._executableDir||"";if(this._scriptPath){let v;try{v=K5.realpathSync(this._scriptPath)}catch{v=this._scriptPath}l=Qn.resolve(Qn.dirname(v),l)}if(l){let v=o(l,s);if(!v&&!t._executableFile&&this._scriptPath){let g=Qn.basename(this._scriptPath,Qn.extname(this._scriptPath));g!==this._name&&(v=o(l,`${g}-${t._name}`))}s=v||s}n=a.includes(Qn.extname(s));let c;nt.platform!=="win32"?n?(r.unshift(s),r=Pb(nt.execArgv).concat(r),c=z5.spawn(nt.argv[0],r,{stdio:"inherit"})):c=z5.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=Pb(nt.execArgv).concat(r),c=z5.spawn(nt.execPath,r,{stdio:"inherit"})),c.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(g=>{nt.on(g,()=>{c.killed===!1&&c.exitCode===null&&c.kill(g)})});let f=this._exitCallback;f?c.on("close",()=>{f(new Y5(nt.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):c.on("close",nt.exit.bind(nt)),c.on("error",v=>{if(v.code==="ENOENT"){let g=l?`searched for local subcommand relative to directory '${l}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",_=`'${s}' does not exist - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead - if the default executable name is not suitable, use the executableFile option to supply a custom name or path - ${g}`;throw new Error(_)}else if(v.code==="EACCES")throw new Error(`'${s}' not executable`);if(!f)nt.exit(1);else{let g=new Y5(1,"commander.executeSubCommandAsync","(error)");g.nestedError=v,f(g)}}),this.runningCommand=c}_dispatchSubcommand(t,r,n){let a=this._findCommand(t);a||this.help({error:!0});let o;return o=this._chainOrCallSubCommandHook(o,a,"preSubcommand"),o=this._chainOrCall(o,()=>{if(a._executableHandler)this._executeSubCommand(a,r.concat(n));else return a._parseCommand(r,n)}),o}_checkNumberOfArguments(){this._args.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let t=(n,a,o)=>{let s=a;if(a!==null&&n.parseArg)try{s=n.parseArg(a,o)}catch(l){if(l.code==="commander.invalidArgument"){let c=`error: command-argument value '${a}' is invalid for argument '${n.name()}'. ${l.message}`;this.error(c,{exitCode:l.exitCode,code:l.code})}throw l}return s};this._checkNumberOfArguments();let r=[];this._args.forEach((n,a)=>{let o=n.defaultValue;n.variadic?a<this.args.length?(o=this.args.slice(a),n.parseArg&&(o=o.reduce((s,l)=>t(n,l,s),n.defaultValue))):o===void 0&&(o=[]):a<this.args.length&&(o=this.args[a],n.parseArg&&(o=t(n,o,n.defaultValue))),r[a]=o}),this.processedArgs=r}_chainOrCall(t,r){return t&&t.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,a=[];return I2(this).reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{a.push({hookedCommand:o,callback:s})})}),r==="postAction"&&a.reverse(),a.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let a=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{a=this._chainOrCall(a,()=>o(this,r))}),a}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._hasImplicitHelpCommand()&&t[0]===this._helpCommandName)return t.length===1&&this.help(),this._dispatchSubcommand(t[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return Bb(this,r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),Bb(this,n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let a=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){a(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(o))a(),this._processArguments(),this.parent.emit(o,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(a(),this._processArguments())}else this.commands.length?(a(),this.help({error:!0})):(a(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){for(let t=this;t;t=t.parent)t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let a=n.attributeName();return this.getOptionValue(a)===void 0?!1:this.getOptionValueSource(a)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let a=t.find(o=>n.conflictsWith.includes(o.attributeName()));a&&this._conflictingOption(n,a)})}_checkForConflictingOptions(){for(let t=this;t;t=t.parent)t._checkForConflictingLocalOptions()}parseOptions(t){let r=[],n=[],a=r,o=t.slice();function s(c){return c.length>1&&c[0]==="-"}let l=null;for(;o.length;){let c=o.shift();if(c==="--"){a===n&&a.push(c),a.push(...o);break}if(l&&!s(c)){this.emit(`option:${l.name()}`,c);continue}if(l=null,s(c)){let f=this._findOption(c);if(f){if(f.required){let v=o.shift();v===void 0&&this.optionMissingArgument(f),this.emit(`option:${f.name()}`,v)}else if(f.optional){let v=null;o.length>0&&!s(o[0])&&(v=o.shift()),this.emit(`option:${f.name()}`,v)}else this.emit(`option:${f.name()}`);l=f.variadic?f:null;continue}}if(c.length>2&&c[0]==="-"&&c[1]!=="-"){let f=this._findOption(`-${c[1]}`);if(f){f.required||f.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${f.name()}`,c.slice(2)):(this.emit(`option:${f.name()}`),o.unshift(`-${c.slice(2)}`));continue}}if(/^--[^=]+=/.test(c)){let f=c.indexOf("="),v=this._findOption(c.slice(0,f));if(v&&(v.required||v.optional)){this.emit(`option:${v.name()}`,c.slice(f+1));continue}}if(s(c)&&(a=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(c)){r.push(c),o.length>0&&n.push(...o);break}else if(c===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(c),o.length>0&&r.push(...o);break}else if(this._defaultCommandName){n.push(c),o.length>0&&n.push(...o);break}}if(this._passThroughOptions){a.push(c),o.length>0&&a.push(...o);break}a.push(c)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let a=this.options[n].attributeName();t[a]=a===this._versionOptionName?this._version:this[a]}return t}return this._optionValues}optsWithGlobals(){return I2(this).reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t} `,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError} `):this._showHelpAfterError&&(this._outputConfiguration.writeErr(` `),this.outputHelp({error:!0}));let n=r||{},a=n.exitCode||1,o=n.code||"commander.error";this._exit(a,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in nt.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,nt.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new hJ(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(a=>!r(a)).forEach(a=>{this.setOptionValueWithSource(a,n.implied[a],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=s=>{let l=s.attributeName(),c=this.getOptionValue(l),f=this.options.find(g=>g.negate&&l===g.attributeName()),v=this.options.find(g=>!g.negate&&l===g.attributeName());return f&&(f.presetArg===void 0&&c===!1||f.presetArg!==void 0&&c===f.presetArg)?f:v||s},a=s=>{let l=n(s),c=l.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${l.envVar}'`:`option '${l.flags}'`},o=`error: ${a(t)} cannot be used with ${a(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let a=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(l=>l.long).map(l=>l.long);a=a.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=Tb(t,a)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this._args.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let a=[];this.createHelp().visibleCommands(this).forEach(o=>{a.push(o.name()),o.alias()&&a.push(o.alias())}),r=Tb(t,a)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let a=this.createOption(r,n);return this._versionOptionName=a.attributeName(),this.options.push(a),this.on("option:"+a.name(),()=>{this._outputConfiguration.writeOut(`${t} `),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this._args.map(n=>cJ(n));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}nameFromFilename(t){return this._name=Qn.basename(t,Qn.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(t){t=t||{};let r={error:!!t.error},n;return r.error?n=a=>this._outputConfiguration.writeErr(a):n=a=>this._outputConfiguration.writeOut(a),r.write=t.write||n,r.command=this,r}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getHelpContext(t);I2(this).reverse().forEach(o=>o.emit("beforeAllHelp",n)),this.emit("beforeHelp",n);let a=this.helpInformation(n);if(r&&(a=r(a),typeof a!="string"&&!Buffer.isBuffer(a)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(a),this.emit(this._helpLongFlag),this.emit("afterHelp",n),I2(this).forEach(o=>o.emit("afterAllHelp",n))}helpOption(t,r){if(typeof t=="boolean")return this._hasHelpOption=t,this;this._helpFlags=t||this._helpFlags,this._helpDescription=r||this._helpDescription;let n=mJ(this._helpFlags);return this._helpShortFlag=n.shortFlag,this._helpLongFlag=n.longFlag,this}help(t){this.outputHelp(t);let r=nt.exitCode||0;r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText. Expecting one of '${n.join("', '")}'`);let a=`${t}Help`;return this.on(a,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s} `)}),this}};function Bb(e,t){e._hasHelpOption&&t.find(n=>n===e._helpLongFlag||n===e._helpShortFlag)&&(e.outputHelp(),e._exit(0,"commander.helpDisplayed","(outputHelp)"))}function Pb(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",a="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?a=o[3]:n=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],a=o[4]),r&&a!=="0"?`${r}=${n}:${parseInt(a)+1}`:t})}function I2(e){let t=[];for(let r=e;r;r=r.parent)t.push(r);return t}qb.Command=wp});var Lb=h((Oi,jb)=>{var{Argument:vJ}=N2(),{Command:Rb}=Nb(),{CommanderError:xJ,InvalidArgumentError:Ib}=Ep(),{Help:DJ}=$5(),{Option:gJ}=H5();Oi=jb.exports=new Rb;Oi.program=Oi;Oi.Argument=vJ;Oi.Command=Rb;Oi.CommanderError=xJ;Oi.Help=DJ;Oi.InvalidArgumentError=Ib;Oi.InvalidOptionArgumentError=Ib;Oi.Option=gJ});var $b=h((Twe,Ub)=>{"use strict";Ub.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var J5=h((Bwe,Gb)=>{var Fp=$b(),Wb={};for(let e of Object.keys(Fp))Wb[Fp[e]]=e;var ae={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Gb.exports=ae;for(let e of Object.keys(ae)){if(!("channels"in ae[e]))throw new Error("missing channels property: "+e);if(!("labels"in ae[e]))throw new Error("missing channel labels property: "+e);if(ae[e].labels.length!==ae[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:r}=ae[e];delete ae[e].channels,delete ae[e].labels,Object.defineProperty(ae[e],"channels",{value:t}),Object.defineProperty(ae[e],"labels",{value:r})}ae.rgb.hsl=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(t,r,n),o=Math.max(t,r,n),s=o-a,l,c;o===a?l=0:t===o?l=(r-n)/s:r===o?l=2+(n-t)/s:n===o&&(l=4+(t-r)/s),l=Math.min(l*60,360),l<0&&(l+=360);let f=(a+o)/2;return o===a?c=0:f<=.5?c=s/(o+a):c=s/(2-o-a),[l,c*100,f*100]};ae.rgb.hsv=function(e){let t,r,n,a,o,s=e[0]/255,l=e[1]/255,c=e[2]/255,f=Math.max(s,l,c),v=f-Math.min(s,l,c),g=function(_){return(f-_)/6/v+1/2};return v===0?(a=0,o=0):(o=v/f,t=g(s),r=g(l),n=g(c),s===f?a=n-r:l===f?a=1/3+t-n:c===f&&(a=2/3+r-t),a<0?a+=1:a>1&&(a-=1)),[a*360,o*100,f*100]};ae.rgb.hwb=function(e){let t=e[0],r=e[1],n=e[2],a=ae.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[a,o*100,n*100]};ae.rgb.cmyk=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.min(1-t,1-r,1-n),o=(1-t-a)/(1-a)||0,s=(1-r-a)/(1-a)||0,l=(1-n-a)/(1-a)||0;return[o*100,s*100,l*100,a*100]};function bJ(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}ae.rgb.keyword=function(e){let t=Wb[e];if(t)return t;let r=1/0,n;for(let a of Object.keys(Fp)){let o=Fp[a],s=bJ(e,o);s<r&&(r=s,n=a)}return n};ae.keyword.rgb=function(e){return Fp[e]};ae.rgb.xyz=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;let a=t*.4124+r*.3576+n*.1805,o=t*.2126+r*.7152+n*.0722,s=t*.0193+r*.1192+n*.9505;return[a*100,o*100,s*100]};ae.rgb.lab=function(e){let t=ae.rgb.xyz(e),r=t[0],n=t[1],a=t[2];r/=95.047,n/=100,a/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,a=a>.008856?a**(1/3):7.787*a+16/116;let o=116*n-16,s=500*(r-n),l=200*(n-a);return[o,s,l]};ae.hsl.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,a,o,s;if(r===0)return s=n*255,[s,s,s];n<.5?a=n*(1+r):a=n+r-n*r;let l=2*n-a,c=[0,0,0];for(let f=0;f<3;f++)o=t+1/3*-(f-1),o<0&&o++,o>1&&o--,6*o<1?s=l+(a-l)*6*o:2*o<1?s=a:3*o<2?s=l+(a-l)*(2/3-o)*6:s=l,c[f]=s*255;return c};ae.hsl.hsv=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,a=r,o=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,a*=o<=1?o:2-o;let s=(n+r)/2,l=n===0?2*a/(o+a):2*r/(n+r);return[t,l*100,s*100]};ae.hsv.rgb=function(e){let t=e[0]/60,r=e[1]/100,n=e[2]/100,a=Math.floor(t)%6,o=t-Math.floor(t),s=255*n*(1-r),l=255*n*(1-r*o),c=255*n*(1-r*(1-o));switch(n*=255,a){case 0:return[n,c,s];case 1:return[l,n,s];case 2:return[s,n,c];case 3:return[s,l,n];case 4:return[c,s,n];case 5:return[n,s,l]}};ae.hsv.hsl=function(e){let t=e[0],r=e[1]/100,n=e[2]/100,a=Math.max(n,.01),o,s;s=(2-r)*n;let l=(2-r)*a;return o=r*a,o/=l<=1?l:2-l,o=o||0,s/=2,[t,o*100,s*100]};ae.hwb.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100,a=r+n,o;a>1&&(r/=a,n/=a);let s=Math.floor(6*t),l=1-n;o=6*t-s,s&1&&(o=1-o);let c=r+o*(l-r),f,v,g;switch(s){default:case 6:case 0:f=l,v=c,g=r;break;case 1:f=c,v=l,g=r;break;case 2:f=r,v=l,g=c;break;case 3:f=r,v=c,g=l;break;case 4:f=c,v=r,g=l;break;case 5:f=l,v=r,g=c;break}return[f*255,v*255,g*255]};ae.cmyk.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,a=e[3]/100,o=1-Math.min(1,t*(1-a)+a),s=1-Math.min(1,r*(1-a)+a),l=1-Math.min(1,n*(1-a)+a);return[o*255,s*255,l*255]};ae.xyz.rgb=function(e){let t=e[0]/100,r=e[1]/100,n=e[2]/100,a,o,s;return a=t*3.2406+r*-1.5372+n*-.4986,o=t*-.9689+r*1.8758+n*.0415,s=t*.0557+r*-.204+n*1.057,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[a*255,o*255,s*255]};ae.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let a=116*r-16,o=500*(t-r),s=200*(r-n);return[a,o,s]};ae.lab.xyz=function(e){let t=e[0],r=e[1],n=e[2],a,o,s;o=(t+16)/116,a=r/500+o,s=o-n/200;let l=o**3,c=a**3,f=s**3;return o=l>.008856?l:(o-16/116)/7.787,a=c>.008856?c:(a-16/116)/7.787,s=f>.008856?f:(s-16/116)/7.787,a*=95.047,o*=100,s*=108.883,[a,o,s]};ae.lab.lch=function(e){let t=e[0],r=e[1],n=e[2],a;a=Math.atan2(n,r)*360/2/Math.PI,a<0&&(a+=360);let s=Math.sqrt(r*r+n*n);return[t,s,a]};ae.lch.lab=function(e){let t=e[0],r=e[1],a=e[2]/360*2*Math.PI,o=r*Math.cos(a),s=r*Math.sin(a);return[t,o,s]};ae.rgb.ansi16=function(e,t=null){let[r,n,a]=e,o=t===null?ae.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),o===0)return 30;let s=30+(Math.round(a/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return o===2&&(s+=60),s};ae.hsv.ansi16=function(e){return ae.rgb.ansi16(ae.hsv.rgb(e),e[2])};ae.rgb.ansi256=function(e){let t=e[0],r=e[1],n=e[2];return t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)};ae.ansi16.rgb=function(e){let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let r=(~~(e>50)+1)*.5,n=(t&1)*r*255,a=(t>>1&1)*r*255,o=(t>>2&1)*r*255;return[n,a,o]};ae.ansi256.rgb=function(e){if(e>=232){let o=(e-232)*10+8;return[o,o,o]}e-=16;let t,r=Math.floor(e/36)/5*255,n=Math.floor((t=e%36)/6)/5*255,a=t%6/5*255;return[r,n,a]};ae.rgb.hex=function(e){let r=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};ae.hex.rgb=function(e){let t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];t[0].length===3&&(r=r.split("").map(l=>l+l).join(""));let n=parseInt(r,16),a=n>>16&255,o=n>>8&255,s=n&255;return[a,o,s]};ae.rgb.hcg=function(e){let t=e[0]/255,r=e[1]/255,n=e[2]/255,a=Math.max(Math.max(t,r),n),o=Math.min(Math.min(t,r),n),s=a-o,l,c;return s<1?l=o/(1-s):l=0,s<=0?c=0:a===t?c=(r-n)/s%6:a===r?c=2+(n-t)/s:c=4+(t-r)/s,c/=6,c%=1,[c*360,s*100,l*100]};ae.hsl.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r),a=0;return n<1&&(a=(r-.5*n)/(1-n)),[e[0],n*100,a*100]};ae.hsv.hcg=function(e){let t=e[1]/100,r=e[2]/100,n=t*r,a=0;return n<1&&(a=(r-n)/(1-n)),[e[0],n*100,a*100]};ae.hcg.rgb=function(e){let t=e[0]/360,r=e[1]/100,n=e[2]/100;if(r===0)return[n*255,n*255,n*255];let a=[0,0,0],o=t%1*6,s=o%1,l=1-s,c=0;switch(Math.floor(o)){case 0:a[0]=1,a[1]=s,a[2]=0;break;case 1:a[0]=l,a[1]=1,a[2]=0;break;case 2:a[0]=0,a[1]=1,a[2]=s;break;case 3:a[0]=0,a[1]=l,a[2]=1;break;case 4:a[0]=s,a[1]=0,a[2]=1;break;default:a[0]=1,a[1]=0,a[2]=l}return c=(1-r)*n,[(r*a[0]+c)*255,(r*a[1]+c)*255,(r*a[2]+c)*255]};ae.hcg.hsv=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t),a=0;return n>0&&(a=t/n),[e[0],a*100,n*100]};ae.hcg.hsl=function(e){let t=e[1]/100,n=e[2]/100*(1-t)+.5*t,a=0;return n>0&&n<.5?a=t/(2*n):n>=.5&&n<1&&(a=t/(2*(1-n))),[e[0],a*100,n*100]};ae.hcg.hwb=function(e){let t=e[1]/100,r=e[2]/100,n=t+r*(1-t);return[e[0],(n-t)*100,(1-n)*100]};ae.hwb.hcg=function(e){let t=e[1]/100,n=1-e[2]/100,a=n-t,o=0;return a<1&&(o=(n-a)/(1-a)),[e[0],a*100,o*100]};ae.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};ae.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};ae.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};ae.gray.hsl=function(e){return[0,0,e[0]]};ae.gray.hsv=ae.gray.hsl;ae.gray.hwb=function(e){return[0,100,e[0]]};ae.gray.cmyk=function(e){return[0,0,0,e[0]]};ae.gray.lab=function(e){return[e[0],0,0]};ae.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,n=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(n.length)+n};ae.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}});var zb=h((Pwe,Hb)=>{var j2=J5();function yJ(){let e={},t=Object.keys(j2);for(let r=t.length,n=0;n<r;n++)e[t[n]]={distance:-1,parent:null};return e}function _J(e){let t=yJ(),r=[e];for(t[e].distance=0;r.length;){let n=r.pop(),a=Object.keys(j2[n]);for(let o=a.length,s=0;s<o;s++){let l=a[s],c=t[l];c.distance===-1&&(c.distance=t[n].distance+1,c.parent=n,r.unshift(l))}}return t}function EJ(e,t){return function(r){return t(e(r))}}function wJ(e,t){let r=[t[e].parent,e],n=j2[t[e].parent][e],a=t[e].parent;for(;t[a].parent;)r.unshift(t[a].parent),n=EJ(j2[t[a].parent][a],n),a=t[a].parent;return n.conversion=r,n}Hb.exports=function(e){let t=_J(e),r={},n=Object.keys(t);for(let a=n.length,o=0;o<a;o++){let s=n[o];t[s].parent!==null&&(r[s]=wJ(s,t))}return r}});var Yb=h((qwe,Kb)=>{var Q5=J5(),FJ=zb(),No={},CJ=Object.keys(Q5);function SJ(e){let t=function(...r){let n=r[0];return n==null?n:(n.length>1&&(r=n),e(r))};return"conversion"in e&&(t.conversion=e.conversion),t}function AJ(e){let t=function(...r){let n=r[0];if(n==null)return n;n.length>1&&(r=n);let a=e(r);if(typeof a=="object")for(let o=a.length,s=0;s<o;s++)a[s]=Math.round(a[s]);return a};return"conversion"in e&&(t.conversion=e.conversion),t}CJ.forEach(e=>{No[e]={},Object.defineProperty(No[e],"channels",{value:Q5[e].channels}),Object.defineProperty(No[e],"labels",{value:Q5[e].labels});let t=FJ(e);Object.keys(t).forEach(n=>{let a=t[n];No[e][n]=AJ(a),No[e][n].raw=SJ(a)})});Kb.exports=No});var ty=h((Nwe,ey)=>{"use strict";var Jb=(e,t)=>(...r)=>`\x1B[${e(...r)+t}m`,Qb=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};5;${n}m`},Zb=(e,t)=>(...r)=>{let n=e(...r);return`\x1B[${38+t};2;${n[0]};${n[1]};${n[2]}m`},L2=e=>e,Xb=(e,t,r)=>[e,t,r],Ro=(e,t,r)=>{Object.defineProperty(e,t,{get:()=>{let n=r();return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0}),n},enumerable:!0,configurable:!0})},Z5,Io=(e,t,r,n)=>{Z5===void 0&&(Z5=Yb());let a=n?10:0,o={};for(let[s,l]of Object.entries(Z5)){let c=s==="ansi16"?"ansi":s;s===t?o[c]=e(r,a):typeof l=="object"&&(o[c]=e(l[t],a))}return o};function OJ(){let e=new Map,t={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};t.color.gray=t.color.blackBright,t.bgColor.bgGray=t.bgColor.bgBlackBright,t.color.grey=t.color.blackB