@nice-move/cli 0.11.9 → 0.11.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/290.mjs +1 -1
- package/dist/359.mjs +1 -1
- package/dist/373.mjs +1 -1
- package/dist/402.mjs +1 -1
- package/dist/538.mjs +1 -1
- package/dist/609.mjs +1 -1
- package/dist/cli.mjs +1 -1
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as t}from"module";var e,n,s,i,r={1092:(t,e,n)=>{const s=n(5317),i=n(8147),r=n(995);function o(t,e,n){const o=i(t,e,n),a=s.spawn(o.command,o.args,o.options);return r.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(t,e,n){const o=i(t,e,n),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||r.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=r},995:t=>{const e="win32"===process.platform;function n(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 s(t,s){return e&&1===t&&!s.file?n(s.original,"spawn"):null}t.exports={hookChildProcess:function(t,n){if(!e)return;const i=t.emit;t.emit=function(e,r){if("exit"===e){const e=s(r,n);if(e)return i.call(t,"error",e)}return i.apply(t,arguments)}},verifyENOENT:s,verifyENOENTSync:function(t,s){return e&&1===t&&!s.file?n(s.original,"spawnSync"):null},notFoundError:n}},8147:(t,e,n)=>{const s=n(6928),i=n(4080),r=n(78),o=n(4489),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h(t){if(!a)return t;const e=function(t){t.file=i(t);const e=t.file&&o(t.file);return e?(t.args.unshift(t.file),t.command=e,i(t)):t.file}(t),n=!c.test(e);if(t.options.forceShell||n){const n=l.test(e);t.command=s.normalize(t.command),t.command=r.command(t.command),t.args=t.args.map((t=>r.argument(t,n)));const i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null);const s={command:t,args:e=e?e.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:t,args:e}};return n.shell?s:h(s)}},78:t=>{const e=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(e,"^$1")},t.exports.argument=function(t,n){return t=(t=`"${t=(t=(t=`${t}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(e,"^$1"),n&&(t=t.replace(e,"^$1")),t}},4489:(t,e,n)=>{const s=n(9896),i=n(230);t.exports=function(t){const e=Buffer.alloc(150);let n;try{n=s.openSync(t,"r"),s.readSync(n,e,0,150,0),s.closeSync(n)}catch(t){}return i(e.toString())}},4080:(t,e,n)=>{const s=n(6928),i=n(4644),r=n(8139);function o(t,e){const n=t.options.env||process.env,o=process.cwd(),a=null!=t.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=i.sync(t.command,{path:n[r({env:n})],pathExt:e?s.delimiter:void 0})}catch(t){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?t.options.cwd:"",l)),l}t.exports=function(t){return o(t)||o(t,!0)}},4644:(t,e,n)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=n(6928),r=s?";":":",o=n(9882),a=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,e)=>{const n=e.colon||r,i=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],o=s?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(n):[""];return s&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:i,pathExt:a,pathExtExe:o}},l=(t,e,n)=>{"function"==typeof e&&(n=e,e={}),e||(e={});const{pathEnv:s,pathExt:r,pathExtExe:l}=c(t,e),h=[],u=n=>new Promise(((r,o)=>{if(n===s.length)return e.all&&h.length?r(h):o(a(t));const c=s[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(l,t),f=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;r(d(f,n,0))})),d=(t,n,s)=>new Promise(((i,a)=>{if(s===r.length)return i(u(n+1));const c=r[s];o(t+c,{pathExt:l},((r,o)=>{if(!r&&o){if(!e.all)return i(t+c);h.push(t+c)}return i(d(t,n,s+1))}))}));return n?u(0).then((t=>n(null,t)),n):u(0)};t.exports=l,l.sync=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:s,pathExtExe:r}=c(t,e),l=[];for(let a=0;a<n.length;a++){const c=n[a],h=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(h,t),d=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let t=0;t<s.length;t++){const n=d+s[t];try{if(o.sync(n,{pathExt:r})){if(!e.all)return n;l.push(n)}}catch(t){}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw a(t)}},9882:(t,e,n)=>{var s;n(9896);function i(t,e,n){if("function"==typeof e&&(n=e,e={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,s){i(t,e||{},(function(t,e){t?s(t):n(e)}))}))}s(t,e||{},(function(t,s){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,s=!1),n(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?n(6095):n(4155),t.exports=i,i.sync=function(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},4155:(t,e,n)=>{t.exports=i,i.sync=function(t,e){return r(s.statSync(t),e)};var s=n(9896);function i(t,e,n){s.stat(t,(function(t,s){n(t,!t&&r(s,e))}))}function r(t,e){return t.isFile()&&function(t,e){var n=t.mode,s=t.uid,i=t.gid,r=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),h=a|c;return n&l||n&c&&i===o||n&a&&s===r||n&h&&0===r}(t,e)}},6095:(t,e,n)=>{t.exports=r,r.sync=function(t,e){return i(s.statSync(t),t,e)};var s=n(9896);function i(t,e,n){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var n=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var s=0;s<n.length;s++){var i=n[s].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}(e,n)}function r(t,e,n){s.stat(t,(function(s,r){n(s,!s&&i(r,t,e))}))}},257:(t,e,n)=>{const{PassThrough:s}=n(2203);t.exports=function(){var t=[],e=new s({objectMode:!0});return e.setMaxListeners(0),e.add=n,e.isEmpty=function(){return 0==t.length},e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),e;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",i.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function i(n){!(t=t.filter((function(t){return t!==n}))).length&&e.readable&&e.end()}}},8139:t=>{const e=(t={})=>{const e=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=e,t.exports.default=e},230:(t,e,n)=>{const s=n(5672);t.exports=(t="")=>{const e=t.match(s);if(!e)return null;const[n,i]=e[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return"env"===r?i:i?`${r} ${i}`:r}},5672:t=>{t.exports=/^#!(.*)/},2613:e=>{e.exports=t(import.meta.url)("assert")},5317:e=>{e.exports=t(import.meta.url)("child_process")},6982:e=>{e.exports=t(import.meta.url)("crypto")},4434:e=>{e.exports=t(import.meta.url)("events")},9896:e=>{e.exports=t(import.meta.url)("fs")},3024:e=>{e.exports=t(import.meta.url)("node:fs")},1455:e=>{e.exports=t(import.meta.url)("node:fs/promises")},8161:e=>{e.exports=t(import.meta.url)("node:os")},6760:e=>{e.exports=t(import.meta.url)("node:path")},1708:e=>{e.exports=t(import.meta.url)("node:process")},7075:e=>{e.exports=t(import.meta.url)("node:stream")},7066:e=>{e.exports=t(import.meta.url)("node:tty")},7975:e=>{e.exports=t(import.meta.url)("node:util")},857:e=>{e.exports=t(import.meta.url)("os")},6928:e=>{e.exports=t(import.meta.url)("path")},2203:e=>{e.exports=t(import.meta.url)("stream")},3193:e=>{e.exports=t(import.meta.url)("string_decoder")},2018:e=>{e.exports=t(import.meta.url)("tty")},9023:e=>{e.exports=t(import.meta.url)("util")},3419:(e,n,s)=>{s.d(n,{Ho:()=>ce,MP:()=>de,Kc:()=>le});const i=t(import.meta.url)("node:buffer");var r=s(6760);const o=t(import.meta.url)("node:child_process");var a=s(1708),c=s(1092);const l=t(import.meta.url)("node:url");function h(t={}){const{env:e=process.env,platform:n=process.platform}=t;return"win32"!==n?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"}function u({env:t=a.env,...e}={}){const n=h({env:t={...t}});return e.path=t[n],t[n]=function(t={}){const{cwd:e=a.cwd(),path:n=a.env[h()],execPath:s=a.execPath}=t;let i;const o=s instanceof URL?l.fileURLToPath(s):s,c=e instanceof URL?l.fileURLToPath(e):e;let u=r.resolve(c);const d=[];for(;i!==u;)d.push(r.join(u,"node_modules/.bin")),i=u,u=r.resolve(u,"..");return d.push(r.resolve(c,o,"..")),[...d,n].join(r.delimiter)}(e),t}const d=(t,e,n,s)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const i=Object.getOwnPropertyDescriptor(t,n),r=Object.getOwnPropertyDescriptor(e,n);!f(i,r)&&s||Object.defineProperty(t,n,r)},f=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},p=(t,e)=>`/* Wrapped ${t}*/\n${e}`,m=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),g=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function y(t,e,{ignoreNonConfigurable:n=!1}={}){const{name:s}=t;for(const s of Reflect.ownKeys(e))d(t,e,s,n);return((t,e)=>{const n=Object.getPrototypeOf(e);n!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,n)})(t,e),((t,e,n)=>{const s=""===n?"":`with ${n.trim()}() `,i=p.bind(null,s,e.toString());Object.defineProperty(i,"name",g),Object.defineProperty(t,"toString",{...m,value:i})})(t,e,s),t}const b=new WeakMap,v=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let n,s=0;const i=t.displayName||t.name||"<anonymous>",r=function(...o){if(b.set(r,++s),1===s)n=t.apply(this,o),t=null;else if(!0===e.throw)throw new Error(`Function \`${i}\` can only be called once`);return n};return y(r,t),b.set(r,s),r};v.callCount=t=>{if(!b.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return b.get(t)};const w=v;var O=s(8161);const x=(t,e)=>({name:`SIGRT${e+1}`,number:E+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),E=34,j=64,S=[{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"}],C=()=>{const t=(()=>{const t=j-E+1;return Array.from({length:t},x)})();return[...S,...t].map(k)},k=({name:t,number:e,description:n,action:s,forced:i=!1,standard:r})=>{const{signals:{[t]:o}}=O.constants,a=void 0!==o;return{name:t,number:a?o:e,description:n,supported:a,action:s,forced:i,standard:r}},A=({name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o})=>[t,{name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o}],_=(()=>{const t=C();return Object.fromEntries(t.map(A))})(),P=(t,e)=>{const n=$(t,e);if(void 0===n)return{};const{name:s,description:i,supported:r,action:o,forced:a,standard:c}=n;return{[t]:{name:s,number:t,description:i,supported:r,action:o,forced:a,standard:c}}},$=(t,e)=>{const n=e.find((({name:e})=>O.constants.signals[e]===t));return void 0!==n?n:e.find((e=>e.number===t))},I=((()=>{const t=C(),e=j+1,n=Array.from({length:e},((e,n)=>P(n,t)));Object.assign({},...n)})(),({stdout:t,stderr:e,all:n,error:s,signal:i,exitCode:r,command:o,escapedCommand:c,timedOut:l,isCanceled:h,killed:u,parsed:{options:{timeout:d,cwd:f=a.cwd()}}})=>{r=null===r?void 0:r;const p=void 0===(i=null===i?void 0:i)?void 0:_[i].description,m=(({timedOut:t,timeout:e,errorCode:n,signal:s,signalDescription:i,exitCode:r,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":void 0!==n?`failed with ${n}`:void 0!==s?`was killed with ${s} (${i})`:void 0!==r?`failed with exit code ${r}`:"failed")({timedOut:l,timeout:d,errorCode:s&&s.code,signal:i,signalDescription:p,exitCode:r,isCanceled:h}),g=`Command ${m}: ${o}`,y="[object Error]"===Object.prototype.toString.call(s),b=y?`${g}\n${s.message}`:g,v=[b,e,t].filter(Boolean).join("\n");return y?(s.originalMessage=s.message,s.message=v):s=new Error(v),s.shortMessage=b,s.command=o,s.escapedCommand=c,s.exitCode=r,s.signal=i,s.signalDescription=p,s.stdout=t,s.stderr=e,s.cwd=f,void 0!==n&&(s.all=n),"bufferedData"in s&&delete s.bufferedData,s.failed=!0,s.timedOut=Boolean(l),s.isCanceled=h,s.killed=u&&!l,s}),M=["stdin","stdout","stderr"],T=t=>{if(!t)return;const{stdio:e}=t;if(void 0===e)return M.map((e=>t[e]));if((t=>M.some((e=>void 0!==t[e])))(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${M.map((t=>`\`${t}\``)).join(", ")}`);if("string"==typeof e)return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,M.length);return Array.from({length:n},((t,n)=>e[n]))},L=[];L.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&L.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&L.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const N=t=>!!t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on,F=Symbol.for("signal-exit emitter"),D=globalThis,G=Object.defineProperty.bind(Object);class R{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(D[F])return D[F];G(D,F,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,e){this.listeners[t].push(e)}removeListener(t,e){const n=this.listeners[t],s=n.indexOf(e);-1!==s&&(0===s&&1===n.length?n.length=0:n.splice(s,1))}emit(t,e,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let s=!1;for(const i of this.listeners[t])s=!0===i(e,n)||s;return"exit"===t&&(s=this.emit("afterExit",e,n)||s),s}}class U{}const W=globalThis.process,{onExit:B,load:z,unload:H}=(q=N(W)?new class extends U{#t="win32"===W.platform?"SIGINT":"SIGHUP";#e=new R;#n;#s;#i;#r={};#o=!1;constructor(t){super(),this.#n=t,this.#r={};for(const e of L)this.#r[e]=()=>{const n=this.#n.listeners(e);let{count:s}=this.#e;const i=t;if("object"==typeof i.__signal_exit_emitter__&&"number"==typeof i.__signal_exit_emitter__.count&&(s+=i.__signal_exit_emitter__.count),n.length===s){this.unload();const n=this.#e.emit("exit",null,e),s="SIGHUP"===e?this.#t:e;n||t.kill(t.pid,s)}};this.#i=t.reallyExit,this.#s=t.emit}onExit(t,e){if(!N(this.#n))return()=>{};!1===this.#o&&this.load();const n=e?.alwaysLast?"afterExit":"exit";return this.#e.on(n,t),()=>{this.#e.removeListener(n,t),0===this.#e.listeners.exit.length&&0===this.#e.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#e.count+=1;for(const t of L)try{const e=this.#r[t];e&&this.#n.on(t,e)}catch(t){}this.#n.emit=(t,...e)=>this.#a(t,...e),this.#n.reallyExit=t=>this.#c(t)}}unload(){this.#o&&(this.#o=!1,L.forEach((t=>{const e=this.#r[t];if(!e)throw new Error("Listener not defined for signal: "+t);try{this.#n.removeListener(t,e)}catch(t){}})),this.#n.emit=this.#s,this.#n.reallyExit=this.#i,this.#e.count-=1)}#c(t){return N(this.#n)?(this.#n.exitCode=t||0,this.#e.emit("exit",this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#a(t,...e){const n=this.#s;if("exit"===t&&N(this.#n)){"number"==typeof e[0]&&(this.#n.exitCode=e[0]);const s=n.call(this.#n,t,...e);return this.#e.emit("exit",this.#n.exitCode,null),s}return n.call(this.#n,t,...e)}}(W):new class extends U{onExit(){return()=>{}}load(){}unload(){}},{onExit:(t,e)=>q.onExit(t,e),load:()=>q.load(),unload:()=>q.unload()});var q;const V=(t,e="SIGTERM",n={})=>{const s=t(e);return K(t,e,n,s),s},K=(t,e,n,s)=>{if(!Y(e,n,s))return;const i=Q(n),r=setTimeout((()=>{t("SIGKILL")}),i);r.unref&&r.unref()},Y=(t,{forceKillAfterTimeout:e},n)=>J(t)&&!1!==e&&n,J=t=>t===O.constants.signals.SIGTERM||"string"==typeof t&&"SIGTERM"===t.toUpperCase(),Q=({forceKillAfterTimeout:t=!0})=>{if(!0===t)return 5e3;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},X=(t,e)=>{t.kill()&&(e.isCanceled=!0)},Z=(t,{timeout:e,killSignal:n="SIGTERM"},s)=>{if(0===e||void 0===e)return s;let i;const r=new Promise(((s,r)=>{i=setTimeout((()=>{((t,e,n)=>{t.kill(e),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))})(t,n,r)}),e)})),o=s.finally((()=>{clearTimeout(i)}));return Promise.race([r,o])},tt=({timeout:t})=>{if(void 0!==t&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},et=async(t,{cleanup:e,detached:n},s)=>{if(!e||n)return s;const i=B((()=>{t.kill()}));return s.finally((()=>{i()}))};var nt=s(3024);function st(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function it(t){return st(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState}const rt=(t,e,n)=>{if("string"==typeof n)return t[e].pipe((0,nt.createWriteStream)(n)),t;if(it(n))return t[e].pipe(n),t;if(!(t=>t instanceof o.ChildProcess&&"function"==typeof t.then)(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!it(n.stdin))throw new TypeError("The target child process's stdin must be available.");return t[e].pipe(n.stdin),n},ot=t=>{null!==t.stdout&&(t.pipeStdout=rt.bind(void 0,t,"stdout")),null!==t.stderr&&(t.pipeStderr=rt.bind(void 0,t,"stderr")),void 0!==t.all&&(t.pipeAll=rt.bind(void 0,t,"all"))},at=t(import.meta.url)("node:timers/promises"),ct=async(t,{init:e,convertChunk:n,getSize:s,truncateChunk:i,addChunk:r,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{if(!dt(t))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");const l=e();l.length=0;try{for await(const e of t){const t=n[ft(e)](e,l);ht({convertedChunk:t,state:l,getSize:s,truncateChunk:i,addChunk:r,maxBuffer:c})}return lt({state:l,convertChunk:n,getSize:s,truncateChunk:i,addChunk:r,getFinalChunk:o,maxBuffer:c}),a(l)}catch(t){throw t.bufferedData=a(l),t}},lt=({state:t,getSize:e,truncateChunk:n,addChunk:s,getFinalChunk:i,maxBuffer:r})=>{const o=i(t);void 0!==o&&ht({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:s,maxBuffer:r})},ht=({convertedChunk:t,state:e,getSize:n,truncateChunk:s,addChunk:i,maxBuffer:r})=>{const o=n(t),a=e.length+o;if(a<=r)return void ut(t,e,i,a);const c=s(t,r-e.length);throw void 0!==c&&ut(c,e,i,r),new mt},ut=(t,e,n,s)=>{e.contents=n(t,e,s),e.length=s},dt=t=>"object"==typeof t&&null!==t&&"function"==typeof t[Symbol.asyncIterator],ft=t=>{const e=typeof t;if("string"===e)return"string";if("object"!==e||null===t)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=pt.call(t);return"[object ArrayBuffer]"===n?"arrayBuffer":"[object DataView]"===n?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&"[object ArrayBuffer]"===pt.call(t.buffer)?"typedArray":"others"},{toString:pt}=Object.prototype;class mt extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const gt=t=>t,yt=()=>{},bt=({contents:t})=>t,vt=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},wt=t=>t.length;const Ot=new TextEncoder,xt=t=>new Uint8Array(t),Et=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),jt=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(Ct(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},St=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:Ct(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},Ct=t=>kt**Math.ceil(Math.log(t)/Math.log(kt)),kt=2,At=()=>"resize"in ArrayBuffer.prototype,_t={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:t=>Ot.encode(t),buffer:xt,arrayBuffer:xt,dataView:Et,typedArray:Et,others:vt},getSize:wt,truncateChunk:(t,e)=>t.slice(0,e),addChunk:(t,{contents:e,length:n},s)=>{const i=At()?St(e,s):jt(e,s);return new Uint8Array(i).set(t,n),i},getFinalChunk:yt,finalize:({contents:t,length:e})=>At()?t:t.slice(0,e)};async function Pt(t,e){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return $t(await async function(t,e){return ct(t,_t,e)}(t,e))}catch(t){throw void 0!==t.bufferedData&&(t.bufferedData=$t(t.bufferedData)),t}}const $t=t=>globalThis.Buffer.from(t);const It=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Mt={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:gt,buffer:It,arrayBuffer:It,dataView:It,typedArray:It,others:vt},getSize:wt,truncateChunk:(t,e)=>t.slice(0,e),addChunk:(t,{contents:e})=>e+t,getFinalChunk:({textDecoder:t})=>{const e=t.decode();return""===e?void 0:e},finalize:bt};var Tt=s(257);const Lt=t=>{if(void 0!==t)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Nt=t=>{const e=(({input:t,inputFile:e})=>"string"!=typeof e?t:(Lt(t),(0,nt.readFileSync)(e)))(t);if(st(e))throw new TypeError("The `input` option cannot be a stream in sync mode");return e},Ft=(t,e)=>{const n=(({input:t,inputFile:e})=>"string"!=typeof e?t:(Lt(t),(0,nt.createReadStream)(e)))(e);void 0!==n&&(st(n)?n.pipe(t.stdin):t.stdin.end(n))},Dt=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;const n=Tt();return t.stdout&&n.add(t.stdout),t.stderr&&n.add(t.stderr),n},Gt=async(t,e)=>{if(t&&void 0!==e){await(0,at.setTimeout)(0),t.destroy();try{return await e}catch(t){return t.bufferedData}}},Rt=(t,{encoding:e,buffer:n,maxBuffer:s})=>{if(t&&n)return"utf8"===e||"utf-8"===e?async function(t,e){return ct(t,Mt,e)}(t,{maxBuffer:s}):null===e||"buffer"===e?Pt(t,{maxBuffer:s}):Ut(t,s,e)},Ut=async(t,e,n)=>(await Pt(t,{maxBuffer:e})).toString(n),Wt=async({stdout:t,stderr:e,all:n},{encoding:s,buffer:i,maxBuffer:r},o)=>{const a=Rt(t,{encoding:s,buffer:i,maxBuffer:r}),c=Rt(e,{encoding:s,buffer:i,maxBuffer:r}),l=Rt(n,{encoding:s,buffer:i,maxBuffer:2*r});try{return await Promise.all([o,a,c,l])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},Gt(t,a),Gt(e,c),Gt(n,l)])}},Bt=(async()=>{})().constructor.prototype,zt=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(Bt,t)])),Ht=(t,e)=>{for(const[n,s]of zt){const i="function"==typeof e?(...t)=>Reflect.apply(s.value,e(),t):s.value.bind(e);Reflect.defineProperty(t,n,{...s,value:i})}},qt=t=>new Promise(((e,n)=>{t.on("exit",((t,n)=>{e({exitCode:t,signal:n})})),t.on("error",(t=>{n(t)})),t.stdin&&t.stdin.on("error",(t=>{n(t)}))})),Vt=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],Kt=/^[\w.-]+$/,Yt=(t,e)=>Vt(t,e).join(" "),Jt=(t,e)=>Vt(t,e).map((t=>(t=>"string"!=typeof t||Kt.test(t)?t:`"${t.replaceAll('"','\\"')}"`)(t))).join(" "),Qt=/ +/g,Xt=t=>{const e=[];for(const n of t.trim().split(Qt)){const t=e.at(-1);t&&t.endsWith("\\")?e[e.length-1]=`${t.slice(0,-1)} ${n}`:e.push(n)}return e},Zt=t=>{const e=typeof t;if("string"===e)return t;if("number"===e)return String(t);if("object"===e&&null!==t&&!(t instanceof o.ChildProcess)&&"stdout"in t){const e=typeof t.stdout;if("string"===e)return t.stdout;if(i.Buffer.isBuffer(t.stdout))return t.stdout.toString();throw new TypeError(`Unexpected "${e}" stdout in template expression`)}throw new TypeError(`Unexpected "${e}" in template expression`)},te=(t,e,n)=>n||0===t.length||0===e.length?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],ee=({templates:t,expressions:e,tokens:n,index:s,template:i})=>{const r=i??t.raw[s],o=r.split(Qt).filter(Boolean),a=te(n,o,r.startsWith(" "));if(s===e.length)return a;const c=e[s],l=Array.isArray(c)?c.map((t=>Zt(t))):[Zt(c)];return te(a,l,r.endsWith(" "))},ne=(t,e)=>{let n=[];for(const[s,i]of t.entries())n=ee({templates:t,expressions:e,tokens:n,index:s,template:i});return n};const se=(0,s(7975).debuglog)("execa").enabled,ie=(t,e)=>String(t).padStart(e,"0"),re=(t,{verbose:e})=>{e&&a.stderr.write(`[${(()=>{const t=new Date;return`${ie(t.getHours(),2)}:${ie(t.getMinutes(),2)}:${ie(t.getSeconds(),2)}.${ie(t.getMilliseconds(),3)}`})()}] ${t}\n`)},oe=(t,e,n={})=>{const s=c._parse(t,e,n);return t=s.command,e=s.args,(n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(n=s.options).cwd||a.cwd(),execPath:a.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:se,...n}).env=(({env:t,extendEnv:e,preferLocal:n,localDir:s,execPath:i})=>{const r=e?{...a.env,...t}:t;return n?u({env:r,cwd:s,execPath:i}):r})(n),n.stdio=T(n),"win32"===a.platform&&"cmd"===r.basename(t,".exe")&&e.unshift("/q"),{file:t,args:e,options:n,parsed:s}},ae=(t,e,n)=>"string"==typeof e||i.Buffer.isBuffer(e)?t.stripFinalNewline?function(t){const e="string"==typeof t?"\n":"\n".charCodeAt(),n="string"==typeof t?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,-1)),t[t.length-1]===n&&(t=t.slice(0,-1)),t}(e):e:void 0===n?void 0:"";function ce(t,e,n){const s=oe(t,e,n),i=Yt(t,e),r=Jt(t,e);let a;re(r,s.options),tt(s.options);try{a=o.spawn(s.file,s.args,s.options)}catch(t){const e=new o.ChildProcess,n=Promise.reject(I({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return Ht(e,n),e}const c=qt(a),l=Z(a,s.options,c),h=et(a,s.options,l),u={isCanceled:!1};a.kill=V.bind(null,a.kill.bind(a)),a.cancel=X.bind(null,a,u);const d=w((async()=>{const[{error:t,exitCode:e,signal:n,timedOut:o},c,l,d]=await Wt(a,s.options,h),f=ae(s.options,c),p=ae(s.options,l),m=ae(s.options,d);if(t||0!==e||null!==n){const c=I({error:t,exitCode:e,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:r,parsed:s,timedOut:o,isCanceled:u.isCanceled||!!s.options.signal&&s.options.signal.aborted,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:i,escapedCommand:r,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return Ft(a,s.options),a.all=Dt(a,s.options),ot(a),Ht(a,d),a}function le(t,e,n){const s=oe(t,e,n),i=Yt(t,e),r=Jt(t,e);re(r,s.options);const a=Nt(s.options);let c;try{c=o.spawnSync(s.file,s.args,{...s.options,input:a})}catch(t){throw I({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const l=ae(s.options,c.stdout,c.error),h=ae(s.options,c.stderr,c.error);if(c.error||0!==c.status||null!==c.signal){const t=I({stdout:l,stderr:h,error:c.error,signal:c.signal,exitCode:c.status,command:i,escapedCommand:r,parsed:s,timedOut:c.error&&"ETIMEDOUT"===c.error.code,isCanceled:!1,killed:null!==c.signal});if(!s.options.reject)return t;throw t}return{command:i,escapedCommand:r,exitCode:0,stdout:l,stderr:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const he=({input:t,inputFile:e,stdio:n})=>void 0===t&&void 0===e&&void 0===n?{stdin:"inherit"}:{},ue=(t={})=>({preferLocal:!0,...he(t),...t});(function t(e){function n(n,...s){if(!Array.isArray(n))return t({...e,...n});const[i,...r]=ne(n,s);return ce(i,r,ue(e))}return n.sync=(t,...n)=>{if(!Array.isArray(t))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");const[s,...i]=ne(t,n);return le(s,i,ue(e))},n})();function de(t,e){const[n,...s]=Xt(t);return ce(n,s,e)}}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={exports:{}};return r[t](n,n.exports,a),n.exports}a.m=r,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,s){if(1&s&&(t=this(t)),8&s)return t;if("object"==typeof t&&t){if(4&s&&t.__esModule)return t;if(16&s&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var r={};e=e||[null,n({}),n([]),n(n)];for(var o=2&s&&t;"object"==typeof o&&!~e.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach((e=>r[e]=()=>t[e]));return r.default=()=>t,a.d(i,r),i},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>t+".mjs",a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s={27:0},i=t=>{var e,n,{ids:i,modules:r,runtime:o}=t,c=0;for(e in r)a.o(r,e)&&(a.m[e]=r[e]);for(o&&o(a);c<i.length;c++)n=i[c],a.o(s,n)&&s[n]&&s[n][0](),s[i[c]]=0},a.f.j=(t,e)=>{var n=a.o(s,t)?s[t]:void 0;if(0!==n)if(n)e.push(n[1]);else{var r=import("./"+a.u(t)).then(i,(e=>{throw 0!==s[t]&&(s[t]=void 0),e}));r=Promise.race([r,new Promise((e=>n=s[t]=[e]))]),e.push(n[1]=r)}},(()=>{var e={};a.r(e),a.d(e,{builder:()=>Ke,command:()=>ze,description:()=>He});var n={};a.r(n),a.d(n,{builder:()=>un,command:()=>hn});var s=a(9896),i=a(2613);const r={right:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n<e)return" ".repeat(e-n)+t;return t},center:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n>=e)return t;return" ".repeat(e-n>>1)+t}};class o{constructor(t){var e;this.width=t.width,this.wrap=null===(e=t.wrap)||void 0===e||e,this.rows=[]}span(...t){this.div(...t).span=!0}resetOutput(){this.rows=[]}div(...t){if(0===t.length&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&"string"==typeof t[0])return this.applyLayoutDSL(t[0]);const e=t.map((t=>"string"==typeof t?this.colFromString(t):t));return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return 1===t.length&&"string"==typeof t[0]&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const e=t.split("\n").map((t=>t.split("\t")));let n=0;return e.forEach((t=>{t.length>1&&l.stringWidth(t[0])>n&&(n=Math.min(Math.floor(.5*this.width),l.stringWidth(t[0])))})),e.forEach((t=>{this.div(...t.map(((e,s)=>({text:e.trim(),padding:this.measurePadding(e),width:0===s&&t.length>1?n:void 0}))))})),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const e=l.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){const t=[];return this.rows.forEach((e=>{this.rowToString(e,t)})),t.filter((t=>!t.hidden)).map((t=>t.text)).join("\n")}rowToString(t,e){return this.rasterize(t).forEach(((n,s)=>{let i="";n.forEach(((n,o)=>{const{width:a}=t[o],h=this.negatePadding(t[o]);let u=n;if(h>l.stringWidth(n)&&(u+=" ".repeat(h-l.stringWidth(n))),t[o].align&&"left"!==t[o].align&&this.wrap){u=(0,r[t[o].align])(u,h),l.stringWidth(u)<h&&(u+=" ".repeat((a||0)-l.stringWidth(u)-1))}const d=t[o].padding||[0,0,0,0];d[3]&&(i+=" ".repeat(d[3])),i+=c(t[o],u,"| "),i+=u,i+=c(t[o],u," |"),d[1]&&(i+=" ".repeat(d[1])),0===s&&e.length>0&&(i=this.renderInline(i,e[e.length-1]))})),e.push({text:i.replace(/ +$/,""),span:t.span})})),e}renderInline(t,e){const n=t.match(/^ */),s=n?n[0].length:0,i=e.text,r=l.stringWidth(i.trimRight());return e.span?this.wrap?s<r?t:(e.hidden=!0,i.trimRight()+" ".repeat(s-r)+t.trimLeft()):(e.hidden=!0,i+t):t}rasterize(t){const e=[],n=this.columnWidths(t);let s;return t.forEach(((t,i)=>{t.width=n[i],s=this.wrap?l.wrap(t.text,this.negatePadding(t),{hard:!0}).split("\n"):t.text.split("\n"),t.border&&(s.unshift("."+"-".repeat(this.negatePadding(t)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(t)+2)+"'")),t.padding&&(s.unshift(...new Array(t.padding[0]||0).fill("")),s.push(...new Array(t.padding[2]||0).fill(""))),s.forEach(((t,n)=>{e[n]||e.push([]);const s=e[n];for(let t=0;t<i;t++)void 0===s[t]&&s.push("");s.push(t)}))})),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[3]||0)+(t.padding[1]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map((t=>t.width||l.stringWidth(t.text)));let e=t.length,n=this.width;const s=t.map((t=>{if(t.width)return e--,n-=t.width,t.width})),i=e?Math.floor(n/e):0;return s.map(((e,n)=>void 0===e?Math.max(i,function(t){const e=t.padding||[],n=1+(e[3]||0)+(e[1]||0);if(t.border)return n+4;return n}(t[n])):e))}}function c(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":0!==e.trim().length?n:" ":""}let l;const h=new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function u(t){return t.replace(h,"")}function d(t,e){const[n,s]=t.match(h)||["",""];t=u(t);let i="";for(let n=0;n<t.length;n++)0!==n&&n%e==0&&(i+="\n"),i+=t.charAt(n);return n&&s&&(i=`${n}${i}${s}`),i}var f=a(6928);var p=a(9023);const m=t(import.meta.url)("url");function g(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),-1===t.indexOf("-")&&-1===t.indexOf("_"))return t;{let e="",n=!1;const s=t.match(/^-+/);for(let i=s?s[0].length:0;i<t.length;i++){let s=t.charAt(i);n&&(n=!1,s=s.toUpperCase()),0===i||"-"!==s&&"_"!==s?"-"!==s&&"_"!==s&&(e+=s):n=!0}return e}}function y(t,e){const n=t.toLowerCase();e=e||"-";let s="";for(let i=0;i<t.length;i++){const r=n.charAt(i),o=t.charAt(i);s+=r!==o&&i>0?`${e}${n.charAt(i)}`:o}return s}function b(t){return null!=t&&("number"==typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||!/^0[^.]/.test(t)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)))}var v;let w;!function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"}(v||(v={}));function O(t){return void 0!==t?t+1:1}function x(t){return"__proto__"===t?"___proto___":t}var E,j,S;const C=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,k=null!==(j=null===(E=null===process||void 0===process?void 0:process.versions)||void 0===E?void 0:E.node)&&void 0!==j?j:null===(S=null===process||void 0===process?void 0:process.version)||void 0===S?void 0:S.slice(1);if(k){if(Number(k.match(/^([^.]+)/)[1])<C)throw Error(`yargs parser supports a minimum Node.js version of ${C}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const A=process?process.env:{},_=new class{constructor(t){w=t}parse(t,e){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),s=function(t){if(Array.isArray(t))return t.map((t=>"string"!=typeof t?t+"":t));t=t.trim();let e=0,n=null,s=null,i=null;const r=[];for(let o=0;o<t.length;o++)n=s,s=t.charAt(o)," "!==s||i?(s===i?i=null:"'"!==s&&'"'!==s||i||(i=s),r[e]||(r[e]=""),r[e]+=s):" "!==n&&e++;return r}(t),i="string"==typeof t,r=function(t){const e=[],n=Object.create(null);let s=!0;Object.keys(t).forEach((function(n){e.push([].concat(t[n],n))}));for(;s;){s=!1;for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){if(e[t].filter((function(t){return-1!==e[n].indexOf(t)})).length){e[t]=e[t].concat(e[n]),e.splice(n,1),s=!0;break}}}return e.forEach((function(t){const e=(t=t.filter((function(t,e,n){return n.indexOf(t)===e}))).pop();void 0!==e&&"string"==typeof e&&(n[e]=t)})),n}(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,h=o["populate--"],u=h?"--":"_",d=Object.create(null),f=Object.create(null),p=n.__||w.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,j=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(t){const e="object"==typeof t?t.key:t,n=Object.keys(t).map((function(t){return{boolean:"bools",string:"strings",number:"numbers"}[t]})).filter(Boolean).pop();n&&(m[n][e]=!0),m.arrays[e]=!0,m.keys.push(e)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(t){m.bools[t]=!0,m.keys.push(t)})),[].concat(n.string||[]).filter(Boolean).forEach((function(t){m.strings[t]=!0,m.keys.push(t)})),[].concat(n.number||[]).filter(Boolean).forEach((function(t){m.numbers[t]=!0,m.keys.push(t)})),[].concat(n.count||[]).filter(Boolean).forEach((function(t){m.counts[t]=!0,m.keys.push(t)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(t){m.normalize[t]=!0,m.keys.push(t)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([t,e])=>{"number"==typeof e&&(m.nargs[t]=e,m.keys.push(t))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([t,e])=>{"function"==typeof e&&(m.coercions[t]=e,m.keys.push(t))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(t){m.configs[t]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([t,e])=>{"boolean"!=typeof e&&"function"!=typeof e||(m.configs[t]=e)}))),function(...t){t.forEach((function(t){Object.keys(t||{}).forEach((function(t){m.aliases[t]||(m.aliases[t]=[].concat(r[t]||[]),m.aliases[t].concat(t).forEach((function(e){if(/-/.test(e)&&o["camel-case-expansion"]){const n=g(e);n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].concat(t).forEach((function(e){if(e.length>1&&/[A-Z]/.test(e)&&o["camel-case-expansion"]){const n=y(e,"-");n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].forEach((function(e){m.aliases[e]=[t].concat(m.aliases[t].filter((function(t){return e!==t})))})))}))}))}(n.key,r,n.default,m.arrays),Object.keys(a).forEach((function(t){(m.aliases[t]||[]).forEach((function(e){a[e]=a[t]}))}));let S=null;Object.keys(m.counts).find((t=>U(t,m.arrays)?(S=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",t)),!0):!!U(t,m.nargs)&&(S=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",t)),!0)));let C=[];const k=Object.assign(Object.create(null),{_:[]}),A={};for(let t=0;t<s.length;t++){const e=s[t],n=e.replace(/^-{3,}/,"---");let i,r,a,c,l,h;if("--"!==e&&/^-/.test(e)&&B(e))_(e);else{if(n.match(/^---+(=|$)/)){_(e);continue}if(e.match(/^--.+=/)||!o["short-option-groups"]&&e.match(/^-.+=/))c=e.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(U(c[1],m.arrays)?t=$(t,c[1],s,c[2]):!1!==U(c[1],m.nargs)?t=P(t,c[1],s,c[2]):I(c[1],c[2],!0));else if(e.match(j)&&o["boolean-negation"])c=e.match(j),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],I(r,!!U(r,m.arrays)&&[!1]));else if(e.match(/^--.+/)||!o["short-option-groups"]&&e.match(/^-[^-]+/))c=e.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],U(r,m.arrays)?t=$(t,r,s):!1!==U(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||l.match(/^-/)&&!l.match(E)||U(r,m.bools)||U(r,m.counts)?/^(true|false)$/.test(l)?(I(r,l),t++):I(r,z(r)):(I(r,l),t++)));else if(e.match(/^-.\..+=/))c=e.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&I(c[1],c[2]);else if(e.match(/^-.\..+/)&&!e.match(E))l=s[t+1],c=e.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],void 0===l||l.match(/^-/)||U(r,m.bools)||U(r,m.counts)?I(r,z(r)):(I(r,l),t++));else if(e.match(/^-[^-]+/)&&!e.match(E)){a=e.slice(1,-1).split(""),i=!1;for(let n=0;n<a.length;n++){if(l=e.slice(n+2),a[n+1]&&"="===a[n+1]){h=e.slice(n+3),r=a[n],U(r,m.arrays)?t=$(t,r,s,h):!1!==U(r,m.nargs)?t=P(t,r,s,h):I(r,h),i=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===U(l,m.bools)){I(a[n],l),i=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){I(a[n],l),i=!0;break}I(a[n],z(a[n]))}else I(a[n],l)}r=e.slice(-1)[0],i||"-"===r||(U(r,m.arrays)?t=$(t,r,s):!1!==U(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(E)||U(r,m.bools)||U(r,m.counts)?/^(true|false)$/.test(l)?(I(r,l),t++):I(r,z(r)):(I(r,l),t++)))}else if(e.match(/^-[0-9]$/)&&e.match(E)&&U(e.slice(1),m.bools))r=e.slice(1),I(r,z(r));else{if("--"===e){C=s.slice(t+1);break}if(o["halt-at-non-option"]){C=s.slice(t);break}_(e)}}}function _(t){const e=L("_",t);"string"!=typeof e&&"number"!=typeof e||k._.push(e)}function P(t,e,n,s){let i,r=U(e,m.nargs);if(r="number"!=typeof r||isNaN(r)?1:r,0===r)return H(s)||(S=Error(p("Argument unexpected for: %s",e))),I(e,z(e)),t;let a=H(s)?0:1;if(o["nargs-eats-options"])n.length-(t+1)+a<r&&(S=Error(p("Not enough arguments following: %s",e))),a=r;else{for(i=t+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(E)||B(n[i]));i++)a++;a<r&&(S=Error(p("Not enough arguments following: %s",e)))}let c=Math.min(a,r);for(!H(s)&&c>0&&(I(e,s),c--),i=t+1;i<c+t+1;i++)I(e,n[i]);return t+c}function $(t,e,n,s){let r=[],c=s||n[t+1];const l=U(e,m.nargs);if(U(e,m.bools)&&!/^(true|false)$/.test(c))r.push(!0);else if(H(c)||H(s)&&/^-/.test(c)&&!E.test(c)&&!B(c)){if(void 0!==a[e]){const t=a[e];r=Array.isArray(t)?t:[t]}}else{H(s)||r.push(T(e,s,!0));for(let s=t+1;s<n.length&&!(!o["greedy-arrays"]&&r.length>0||l&&"number"==typeof l&&r.length>=l)&&(c=n[s],!/^-/.test(c)||E.test(c)||B(c));s++)t=s,r.push(T(e,c,i))}return"number"==typeof l&&(l&&r.length<l||isNaN(l)&&0===r.length)&&(S=Error(p("Not enough arguments following: %s",e))),I(e,r),t}function I(t,e,n=i){if(/-/.test(t)&&o["camel-case-expansion"]){const e=t.split(".").map((function(t){return g(t)})).join(".");M(t,e)}const s=T(t,e,n),r=t.split(".");if(R(k,r,s),m.aliases[t]&&m.aliases[t].forEach((function(t){const e=t.split(".");R(k,e,s)})),r.length>1&&o["dot-notation"]&&(m.aliases[r[0]]||[]).forEach((function(e){let n=e.split(".");const i=[].concat(r);i.shift(),n=n.concat(i),(m.aliases[t]||[]).includes(n.join("."))||R(k,n,s)})),U(t,m.normalize)&&!U(t,m.arrays)){[t].concat(m.aliases[t]||[]).forEach((function(t){Object.defineProperty(A,t,{enumerable:!0,get:()=>e,set(t){e="string"==typeof t?w.normalize(t):t}})}))}}function M(t,e){m.aliases[t]&&m.aliases[t].length||(m.aliases[t]=[e],d[e]=!0),m.aliases[e]&&m.aliases[e].length||M(e,t)}function T(t,e,n){n&&(e=function(t){return"string"!=typeof t||"'"!==t[0]&&'"'!==t[0]||t[t.length-1]!==t[0]?t:t.substring(1,t.length-1)}(e)),(U(t,m.bools)||U(t,m.counts))&&"string"==typeof e&&(e="true"===e);let s=Array.isArray(e)?e.map((function(e){return L(t,e)})):L(t,e);return U(t,m.counts)&&(H(s)||"boolean"==typeof s)&&(s=O()),U(t,m.normalize)&&U(t,m.arrays)&&(s=Array.isArray(e)?e.map((t=>w.normalize(t))):w.normalize(e)),s}function L(t,e){if(!o["parse-positional-numbers"]&&"_"===t)return e;if(!U(t,m.strings)&&!U(t,m.bools)&&!Array.isArray(e)){(b(e)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${e}`)))||!H(e)&&U(t,m.numbers))&&(e=Number(e))}return e}function N(t,e){Object.keys(t).forEach((function(n){const s=t[n],i=e?e+"."+n:n;"object"==typeof s&&null!==s&&!Array.isArray(s)&&o["dot-notation"]?N(s,i):(!G(k,i.split("."))||U(i,m.arrays)&&o["combine-arrays"])&&I(i,s)}))}function F(t,e){if(void 0===l)return;const n="string"==typeof l?l:"",s=w.env();Object.keys(s).forEach((function(i){if(""===n||0===i.lastIndexOf(n,0)){const r=i.split("__").map((function(t,e){return 0===e&&(t=t.substring(n.length)),g(t)}));(e&&m.configs[r.join(".")]||!e)&&!G(t,r)&&I(r.join("."),s[i])}}))}function D(t,e,n,s=!1){Object.keys(n).forEach((function(i){G(t,i.split("."))||(R(t,i.split("."),n[i]),s&&(f[i]=!0),(e[i]||[]).forEach((function(e){G(t,e.split("."))||R(t,e.split("."),n[i])})))}))}function G(t,e){let n=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){n=n[t]||{}}));const s=e[e.length-1];return"object"==typeof n&&s in n}function R(t,e,n){let s=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){t=x(t),"object"==typeof s&&void 0===s[t]&&(s[t]={}),"object"!=typeof s[t]||Array.isArray(s[t])?(Array.isArray(s[t])?s[t].push({}):s[t]=[s[t],{}],s=s[t][s[t].length-1]):s=s[t]}));const i=x(e[e.length-1]),r=U(e.join("."),m.arrays),a=Array.isArray(n);let c=o["duplicate-arguments-array"];!c&&U(i,m.nargs)&&(c=!0,(!H(s[i])&&1===m.nargs[i]||Array.isArray(s[i])&&s[i].length===m.nargs[i])&&(s[i]=void 0)),n===O()?s[i]=O(s[i]):Array.isArray(s[i])?c&&r&&a?s[i]=o["flatten-duplicate-arrays"]?s[i].concat(n):(Array.isArray(s[i][0])?s[i]:[s[i]]).concat([n]):c||Boolean(r)!==Boolean(a)?s[i]=s[i].concat([n]):s[i]=n:void 0===s[i]&&r?s[i]=a?n:[n]:!c||void 0===s[i]||U(i,m.counts)||U(i,m.bools)?s[i]=n:s[i]=[s[i],n]}function U(t,e){const n=[].concat(m.aliases[t]||[],t),s=Object.keys(e),i=n.find((t=>s.includes(t)));return!!i&&e[i]}function W(t){const e=Object.keys(m);return[].concat(e.map((t=>m[t]))).some((function(e){return Array.isArray(e)?e.includes(t):e[t]}))}function B(t){return o["unknown-options-as-args"]&&function(t){if(t=t.replace(/^-{3,}/,"--"),t.match(E))return!1;if(function(t){if(t.match(E)||!t.match(/^-[^-]+/))return!1;let e,n=!0;const s=t.slice(1).split("");for(let i=0;i<s.length;i++){if(e=t.slice(i+2),!W(s[i])){n=!1;break}if(s[i+1]&&"="===s[i+1]||"-"===e||/[A-Za-z]/.test(s[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(e)||s[i+1]&&s[i+1].match(/\W/))break}return n}(t))return!1;return!function(t,...e){return[].concat(...e).some((function(e){const n=t.match(e);return n&&W(n[1])}))}(t,/^-+([^=]+?)=[\s\S]*$/,j,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(t)}function z(t){return U(t,m.bools)||U(t,m.counts)||!(`${t}`in a)?(e=function(t){let e=v.BOOLEAN;return U(t,m.strings)?e=v.STRING:U(t,m.numbers)?e=v.NUMBER:U(t,m.bools)?e=v.BOOLEAN:U(t,m.arrays)&&(e=v.ARRAY),e}(t),{[v.BOOLEAN]:!0,[v.STRING]:"",[v.NUMBER]:void 0,[v.ARRAY]:[]}[e]):a[t];var e}function H(t){return void 0===t}return F(k,!0),F(k,!1),function(t){const e=Object.create(null);D(e,m.aliases,a),Object.keys(m.configs).forEach((function(n){const s=t[n]||e[n];if(s)try{let t=null;const e=w.resolve(w.cwd(),s),i=m.configs[n];if("function"==typeof i){try{t=i(e)}catch(e){t=e}if(t instanceof Error)return void(S=t)}else t=w.require(e);N(t)}catch(e){"PermissionDenied"===e.name?S=e:t[n]&&(S=Error(p("Invalid JSON config file: %s",s)))}}))}(k),void 0!==c&&c.forEach((function(t){N(t)})),D(k,m.aliases,a,!0),function(t){let e;const n=new Set;Object.keys(t).forEach((function(s){if(!n.has(s)&&(e=U(s,m.coercions),"function"==typeof e))try{const i=L(s,e(t[s]));[].concat(m.aliases[s]||[],s).forEach((e=>{n.add(e),t[e]=i}))}catch(t){S=t}}))}(k),o["set-placeholder-key"]&&function(t){m.keys.forEach((e=>{~e.indexOf(".")||void 0===t[e]&&(t[e]=void 0)}))}(k),Object.keys(m.counts).forEach((function(t){G(k,t.split("."))||I(t,0)})),h&&C.length&&(k[u]=[]),C.forEach((function(t){k[u].push(t)})),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(k).filter((t=>"--"!==t&&t.includes("-"))).forEach((t=>{delete k[t]})),o["strip-aliased"]&&[].concat(...Object.keys(r).map((t=>r[t]))).forEach((t=>{o["camel-case-expansion"]&&t.includes("-")&&delete k[t.split(".").map((t=>g(t))).join(".")],delete k[t]})),{aliases:Object.assign({},m.aliases),argv:Object.assign(A,k),configuration:o,defaulted:Object.assign({},f),error:S,newAliases:Object.assign({},d)}}}({cwd:process.cwd,env:()=>A,format:p.format,normalize:f.normalize,resolve:f.resolve,require:t=>{if("undefined"!=typeof require)return require(t);if(t.match(/\.json$/))return JSON.parse((0,s.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),P=function(t,e){return _.parse(t.slice(),e).argv};P.detailed=function(t,e){return _.parse(t.slice(),e)},P.camelCase=g,P.decamelize=y,P.looksLikeNumber=b;const $=P;function I(){return process.versions.electron&&!process.defaultApp?0:1}class M extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,M)}}const T={fs:{readFileSync:s.readFileSync,writeFile:s.writeFile},format:p.format,resolve:f.resolve,exists:t=>{try{return(0,s.statSync)(t).isFile()}catch(t){return!1}}};let L;class N{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles="boolean"!=typeof t.updateFiles||t.updateFiles,this.locale=t.locale||"en",this.fallbackToLanguage="boolean"!=typeof t.fallbackToLanguage||t.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return"function"==typeof t[t.length-1]&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),L.format.apply(L.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};"function"==typeof t[t.length-1]&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=1===s?e:n;if(this.cache[this.locale][e]){r=this.cache[this.locale][e][1===s?"one":"other"]}!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const o=[r];return~r.indexOf("%d")&&o.push(s),L.format.apply(L.format,o.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach((function(t,s){const i=e[s+1];n+=t,void 0!==i&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),o=JSON.stringify(this.cache[s],null,2);L.fs.writeFile(r,o,"utf-8",(function(e){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(e)}))}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{L.fs.readFileSync&&(t=JSON.parse(L.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),"ENOENT"!==n.code)throw n;t={}}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=L.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=L.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return L.exists(t)}}const F=t=>function(t,e){L=e;const n=new N(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}(t,T),D="loading a directory of commands is not supported yet for ESM";let G;try{G=(0,m.fileURLToPath)(import.meta.url)}catch(t){G=process.cwd()}const R=G.substring(0,G.lastIndexOf("node_modules")),U={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:function(t){return function(t,e){return l=e,new o({width:(null==t?void 0:t.width)||("object"==typeof process&&process.stdout&&process.stdout.columns?process.stdout.columns:80),wrap:null==t?void 0:t.wrap})}(t,{stringWidth:t=>[...t].length,stripAnsi:u,wrap:d})},findUp:function(t,e){let n,i=(0,f.resolve)(".",t);for((0,s.statSync)(i).isDirectory()||(i=(0,f.dirname)(i));;){if(n=e(i,(0,s.readdirSync)(i)),n)return(0,f.resolve)(i,n);if(i=(0,f.dirname)(n=i),n===i)break}},getEnv:t=>process.env[t],inspect:p.inspect,getCallerFile:()=>{throw new M(D)},getProcessArgvBin:function(){return process.argv[I()]},mainFilename:R||process.cwd(),Parser:$,path:{basename:f.basename,dirname:f.dirname,extname:f.extname,relative:f.relative,resolve:f.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:s.readFileSync,require:()=>{throw new M("require is not supported by ESM")},requireDirectory:()=>{throw new M(D)},stringWidth:t=>[...t].length,y18n:F({directory:(0,f.resolve)(G,"../../../locales"),updateFiles:!1})};function W(t,e,n,s){n.assert.notStrictEqual(t,e,s)}function B(t,e){e.assert.strictEqual(typeof t,"string")}function z(t){return Object.keys(t)}function H(t){return!!t&&!!t.then&&"function"==typeof t.then}function q(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${t}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach(((t,s)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&s===e.length-1&&(r=!0),/^\[/.test(t)?i.optional.push({cmd:t.replace(n,"").split("|"),variadic:r}):i.demanded.push({cmd:t.replace(n,"").split("|"),variadic:r})})),i}const V=["first","second","third","fourth","fifth","sixth"];function K(t,e,n){try{let s=0;const[i,r,o]="object"==typeof t?[{demanded:[],optional:[]},t,e]:[q(`cmd ${t}`),e,n],a=[].slice.call(r);for(;a.length&&void 0===a[a.length-1];)a.pop();const c=o||a.length;if(c<i.demanded.length)throw new M(`Not enough arguments provided. Expected ${i.demanded.length} but received ${a.length}.`);const l=i.demanded.length+i.optional.length;if(c>l)throw new M(`Too many arguments provided. Expected max ${l} but received ${c}.`);i.demanded.forEach((t=>{const e=Y(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&J(e,t.cmd,s),s+=1})),i.optional.forEach((t=>{if(0===a.length)return;const e=Y(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&J(e,t.cmd,s),s+=1}))}catch(t){console.warn(t.stack)}}function Y(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function J(t,e,n){throw new M(`Invalid ${V[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class Q{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(K("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if("function"!=typeof t[s])throw Error("middleware must be a function");const i=t[s];i.applyBeforeValidation=e,i.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const s=[...n[e]||[],e];return!t.option||!s.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function X(t,e,n,s){return n.reduce(((t,n)=>{if(n.applyBeforeValidation!==s)return t;if(n.mutates){if(n.applied)return t;n.applied=!0}if(H(t))return t.then((t=>Promise.all([t,n(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const s=n(t,e);return H(s)?s.then((e=>Object.assign(t,e))):Object.assign(t,s)}}),t)}function Z(t,e,n=(t=>{throw t})){try{const n="function"==typeof t?t():t;return H(n)?n.then((t=>e(t))):e(n)}catch(t){return n(t)}}const tt=/(^\*)|(^\$0)/;class et{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){"boolean"!=typeof(s=s||{}).recurse&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i="function"==typeof s.visit?s.visit:t=>t;s.visit=(t,e,n)=>{const s=i(t,e,n);if(s){if(this.requireCache.has(e))return s;this.requireCache.add(e),this.addHandler(s)}return s},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let o=[];const a=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(i);if(s=s||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...o]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(nt(n))return void this.addHandler([t].concat(o),e,n.builder,n.handler,n.middlewares,n.deprecated)}if("string"==typeof t){const i=q(t);o=o.map((t=>q(t).cmd));let c=!1;const l=[i.cmd].concat(o).filter((t=>!tt.test(t)||(c=!0,!1)));0===l.length&&c&&l.push("$0"),c&&(i.cmd=l[0],o=l.slice(1),t=t.replace(tt,i.cmd)),o.forEach((t=>{this.aliasMap[t]=i.cmd})),!1!==e&&this.usage.command(t,e,c,o,r),this.handlers[i.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:a,deprecated:r,demanded:i.demanded,optional:i.optional},c&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),c=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const h=this.applyBuilderUpdateUsageAndParse(l,o,e,n.aliases,c,s,i,r);return H(h)?h.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,i,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,h.innerArgv,a,i,h.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,o,a){const c=e.builder;let l=n;if(st(c)){n.getInternalMethods().getUsageInstance().freeze();const h=c(n.getInternalMethods().reset(s),a);if(H(h))return h.then((s=>{var a;return l=(a=s)&&"function"==typeof a.getInternalMethods?s:n,this.parseAndUpdateUsage(t,e,l,i,r,o)}))}else(function(t){return"object"==typeof t})(c)&&(n.getInternalMethods().getUsageInstance().freeze(),l=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach((t=>{l.option(t,c[t])})));return this.parseAndUpdateUsage(t,e,l,i,r,o)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return H(o)?o.then((t=>({aliases:n.parsed.aliases,innerArgv:t}))):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const n=tt.test(e.original)?e.original.replace(tt,"").trim():e.original,s=t.filter((t=>!tt.test(t)));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(i,a,r.parsed.error,t);n=Z(n,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const s=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,s,!1,!1),n=Z(n=X(n,r,o,!1),(t=>{const n=e.handler(t);return H(n)?n.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),H(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,o){let a={};if(i)return n;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,n,s,o));const c=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=X(n,o,c,!0);return H(l)?l.then((n=>this.handleValidationAndGetResult(t,e,n,s,r,o,c,a))):this.handleValidationAndGetResult(t,e,l,s,r,o,c,a)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const t=i.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=n.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),s),o}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=q(t);return n.demanded.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s,e.demand[n]=!0})),n.optional.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s})),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const t of Object.keys(n.alias))i.alias[t]=(i.alias[t]||[]).concat(n.alias[t]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{i.configuration["unknown-options-as-args"]&&(i.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(a.error)s.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const n=Object.keys(e);Object.keys(e).forEach((t=>{n.push(...a.aliases[t])})),Object.keys(a.argv).forEach((i=>{n.includes(i)&&(e[i]||(e[i]=a.argv[i]),!this.isInConfigs(s,i)&&!this.isDefaulted(s,i)&&Object.prototype.hasOwnProperty.call(t,i)&&Object.prototype.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||n.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=tt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(st(e))return e(t,!0);nt(e)||Object.keys(e).forEach((n=>{t.option(n,e[n])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,n=0,s=Object.keys(require.cache);n<s.length;n++)if(e=require.cache[s[n]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if("string"==typeof s||!1===s)return s;W(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();W(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function nt(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function st(t){return"function"==typeof t}function it(t={},e=(()=>!0)){const n={};return z(t).forEach((s=>{e(s,t[s])&&(n[s]=t[s])})),n}function rt(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const n=e;n._handle&&n.isTTY&&"function"==typeof n._handle.setBlocking&&n._handle.setBlocking(t)}))}function ot(t){return"boolean"==typeof t}function at(t,e){const n=e.y18n.__,s={},i=[];s.failFn=function(t){i.push(t)};let r=null,o=null,a=!0;s.showHelpOnFail=function(e=!0,n){const[i,c]="string"==typeof e?[!0,e]:[e,n];return t.getInternalMethods().isGlobalContext()&&(o=c),r=c,a=i,s};let c=!1;s.fail=function(e,n){const l=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&rt(!0),!c){c=!0,a&&(t.showHelp("error"),l.error()),(e||n)&&l.error(e||n);const s=r||o;s&&((e||n)&&l.error(""),l.error(s))}if(n=n||new M(e),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,n);throw n}for(let t=i.length-1;t>=0;--t){const r=i[t];if(ot(r)){if(n)throw n;if(e)throw Error(e)}else r(e,n,s)}};let l=[],h=!1;s.usage=(t,e)=>null===t?(h=!0,l=[],s):(h=!1,l.push([t,e||""]),s),s.getUsage=()=>l,s.getUsageDisabled=()=>h,s.getPositionalGroupName=()=>n("Positionals:");let u=[];s.example=(t,e)=>{u.push([t,e||""])};let d=[];s.command=function(t,e,n,s,i=!1){n&&(d=d.map((t=>(t[2]=!1,t)))),d.push([t,e||"",n,s,i])},s.getCommands=()=>d;let f={};s.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{s.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{s.describe(e,t[e])})):f[t]=e},s.getDescriptions=()=>f;let p=[];s.epilog=t=>{p.push(t)};let m,g=!1;s.wrap=t=>{g=!0,m=t},s.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(g||(m=function(){const t=80;return e.process.stdColumns?Math.min(t,e.process.stdColumns):t}(),g=!0),m);const y="__yargsString__:";function b(t,n,s){let i=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{i=Math.max(e.stringWidth(s?`${s} ${ht(t[0])}`:ht(t[0]))+lt(t[0]),i)})),n&&(i=Math.min(i,parseInt((.5*n).toString(),10))),i}let v;function w(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function O(t,e){let s=`[${n("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}s.deferY18nLookup=t=>y+t,s.help=function(){if(v)return v;!function(){const e=t.getDemandedOptions(),n=t.getOptions();(Object.keys(n.alias)||[]).forEach((i=>{n.alias[i].forEach((r=>{f[r]&&s.describe(i,f[r]),r in e&&t.demandOption(i,e[r]),n.boolean.includes(r)&&t.boolean(i),n.count.includes(r)&&t.count(i),n.string.includes(r)&&t.string(i),n.normalize.includes(r)&&t.normalize(i),n.array.includes(r)&&t.array(i),n.number.includes(r)&&t.number(i)}))}))}();const i=t.customScriptName?t.$0:e.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),c=t.getGroups(),m=t.getOptions();let g=[];g=g.concat(Object.keys(f)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(m.default)),g=g.filter(w),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const x=s.getWrap(),E=e.cliui({width:x,wrap:!!x});if(!h)if(l.length)l.forEach((t=>{E.div({text:`${t[0].replace(/\$0/g,i)}`}),t[1]&&E.div({text:`${t[1]}`,padding:[1,0,0,0]})})),E.div();else if(d.length){let t=null;t=o._?`${i} <${n("command")}>\n`:`${i} [${n("command")}]\n`,E.div(`${t}`)}if(d.length>1||1===d.length&&!d[0][2]){E.div(n("Commands:"));const e=t.getInternalMethods().getContext(),s=e.commands.length?`${e.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(d=d.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=i?`${i} `:"";d.forEach((t=>{const e=`${r}${s}${t[0].replace(/^\$0 ?/,"")}`;E.span({text:e,padding:[0,2,0,2],width:b(d,x,`${i}${s}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${n("default")}]`),t[3]&&t[3].length&&o.push(`[${n("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${n("deprecated: %s",t[4])}]`):o.push(`[${n("deprecated")}]`)),o.length?E.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):E.div()})),E.div()}const j=(Object.keys(m.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&j.every((t=>-1===(m.alias[t]||[]).indexOf(e)))));const S=n("Options:");c[S]||(c[S]=[]),function(t,e,n,s){let i=[],r=null;Object.keys(n).forEach((t=>{i=i.concat(n[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==i.indexOf(t)))||n[s].push(t)}))}(g,m.alias,c,S);const C=t=>/^--/.test(ht(t)),k=Object.keys(c).filter((t=>c[t].length>0)).map((t=>({groupName:t,normalizedKeys:c[t].filter(w).map((t=>{if(j.includes(t))return t;for(let e,n=0;void 0!==(e=j[n]);n++)if((m.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const n=e.reduce(((e,n)=>(e[n]=[n].concat(m.alias[n]||[]).map((e=>t===s.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?m.boolean.includes(n)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>C(t)===C(e)?0:C(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:n}}));if(k.filter((({groupName:t})=>t!==s.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>C(e[t])))))&&k.filter((({groupName:t})=>t!==s.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var n,s;C(e[t])&&(e[t]=(n=e[t],s=4,ct(n)?{text:n.text,indentation:n.indentation+s}:{text:n,indentation:s}))}))})),k.forEach((({groupName:e,normalizedKeys:i,switches:o})=>{E.div(e),i.forEach((e=>{const i=o[e];let c=f[e]||"",l=null;c.includes(y)&&(c=n(c.substring(16))),m.boolean.includes(e)&&(l=`[${n("boolean")}]`),m.count.includes(e)&&(l=`[${n("count")}]`),m.string.includes(e)&&(l=`[${n("string")}]`),m.normalize.includes(e)&&(l=`[${n("string")}]`),m.array.includes(e)&&(l=`[${n("array")}]`),m.number.includes(e)&&(l=`[${n("number")}]`);const h=[e in a?(u=a[e],"string"==typeof u?`[${n("deprecated: %s",u)}]`:`[${n("deprecated")}]`):null,l,e in r?`[${n("required")}]`:null,m.choices&&m.choices[e]?`[${n("choices:")} ${s.stringifiedValues(m.choices[e])}]`:null,O(m.default[e],m.defaultDescription[e])].filter(Boolean).join(" ");var u;E.span({text:ht(i),padding:[0,2,0,2+lt(i)],width:b(o,x)+4},c);const d=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];h&&!d?E.div({text:h,padding:[0,0,0,2],align:"right"}):E.div()})),E.div()})),u.length&&(E.div(n("Examples:")),u.forEach((t=>{t[0]=t[0].replace(/\$0/g,i)})),u.forEach((t=>{""===t[1]?E.div({text:t[0],padding:[0,2,0,2]}):E.div({text:t[0],padding:[0,2,0,2],width:b(u,x)+4},{text:t[1]})})),E.div()),p.length>0){const t=p.map((t=>t.replace(/\$0/g,i))).join("\n");E.div(`${t}\n`)}return E.toString().replace(/\s*$/,"")},s.cacheHelpMessage=function(){v=this.help()},s.clearCachedHelpMessage=function(){v=void 0},s.hasCachedHelpMessage=function(){return!!v},s.showHelp=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(s.help())},s.functionDescription=t=>["(",t.name?e.Parser.decamelize(t.name,"-"):n("generated-value"),")"].join(""),s.stringifiedValues=function(t,e){let n="";const s=e||", ",i=[].concat(t);return t&&i.length?(i.forEach((t=>{n.length&&(n+=s),n+=JSON.stringify(t)})),n):n};let x=null;s.version=t=>{x=t},s.showVersion=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(x)},s.reset=function(t){return r=null,c=!1,l=[],h=!1,p=[],u=[],d=[],f=it(f,(e=>!t[e])),s};const E=[];return s.freeze=function(){E.push({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f})},s.unfreeze=function(t=!1){const e=E.pop();e&&(t?(f={...e.descriptions,...f},d=[...e.commands,...d],l=[...e.usages,...l],u=[...e.examples,...u],p=[...e.epilogs,...p]):({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f}=e))},s}function ct(t){return"object"==typeof t}function lt(t){return ct(t)?t.indentation:0}function ht(t){return ct(t)?t.text:t}class ut{constructor(t,e,n,s){var i,r,o;this.yargs=t,this.usage=e,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(i=this.shim.getEnv("SHELL"))||void 0===i?void 0:i.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,n,s){const i=this.command.getCommandHandlers();for(let e=0,n=t.length;e<n;++e)if(i[t[e]]&&i[t[e]].builder){const n=i[t[e]].builder;if(st(n)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return n(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,n),this.optionCompletions(r,t,e,n),this.choicesFromOptionsCompletions(r,t,e,n),this.choicesFromPositionalsCompletions(r,t,e,n),s(null,r)}commandCompletions(t,e,n){const s=this.yargs.getInternalMethods().getContext().commands;n.match(/^-/)||s[s.length-1]===n||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((n=>{const s=q(n[0]).cmd;if(-1===e.indexOf(s))if(this.zshShell){const e=n[1]||"";t.push(s.replace(/:/g,"\\:")+":"+e)}else t.push(s)}))}optionCompletions(t,e,n,s){if((s.match(/^-/)||""===s&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((r=>{const o=!!n.configuration["boolean-negation"]&&n.boolean.includes(r);i.includes(r)||n.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||this.completeOptionKey(r,t,s,o&&!!n.default[r])}))}}choicesFromOptionsCompletions(t,e,n,s){if(this.previousArgHasChoices(e)){const n=this.getPreviousArgChoices(e);n&&n.length>0&&t.push(...n.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,n,s){if(""===s&&t.length>0&&this.previousArgHasChoices(e))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(s)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;const s=e.replace(/^-+/,""),i=this.yargs.getOptions(),r=[s,...this.yargs.getAliases()[s]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(i.key,t)&&Array.isArray(i.choices[t])){o=i.choices[t];break}return o?o.filter((t=>!n||t.startsWith(n))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,n){const s=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(s(e))return!0;if(n&&s(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(s(t))return!0;return!1}completeOptionKey(t,e,n,s){var i,r,o,a;let c=t;if(this.zshShell){const e=this.usage.getDescriptions(),n=null===(r=null===(i=null==this?void 0:this.aliases)||void 0===i?void 0:i[t])||void 0===r?void 0:r.find((t=>{const n=e[t];return"string"==typeof n&&n.length>0})),s=n?e[n]:void 0,l=null!==(a=null!==(o=e[t])&&void 0!==o?o:s)&&void 0!==a?a:"";c=`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const l=!/^--/.test(n)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";e.push(l+c),s&&e.push(l+"no-"+c)}customCompletion(t,e,n,s){if(W(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(n,e);return H(t)?t.then((t=>{this.shim.process.nextTick((()=>{s(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{s(t,void 0)}))})):s(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(n,e,((i=s)=>this.defaultCompletion(t,e,n,i)),(t=>{s(null,t)})):this.customCompletionFunction(n,e,(t=>{s(null,t)}))}getCompletion(t,e){const n=t.length?t[t.length-1]:"",s=this.yargs.parse(t,!0),i=this.customCompletionFunction?s=>this.customCompletion(t,s,n,e):s=>this.defaultCompletion(t,s,n,e);return H(s)?s.then(i):i(s)}generateCompletionScript(t,e){let n=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const s=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function dt(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const n=[];let s,i;for(s=0;s<=e.length;s++)n[s]=[s];for(i=0;i<=t.length;i++)n[0][i]=i;for(s=1;s<=e.length;s++)for(i=1;i<=t.length;i++)e.charAt(s-1)===t.charAt(i-1)?n[s][i]=n[s-1][i-1]:s>1&&i>1&&e.charAt(s-2)===t.charAt(i-1)&&e.charAt(s-1)===t.charAt(i-2)?n[s][i]=n[s-2][i-2]+1:n[s][i]=Math.min(n[s-1][i-1]+1,Math.min(n[s][i-1]+1,n[s-1][i]+1));return n[e.length][t.length]}const ft=["$0","--","_"];let pt,mt=[];function gt(t,e,n,s){pt=s;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return i;const s=/\.json|\..*rc$/.test(t.extends);let r=null;if(s)r=function(t,e){return pt.path.resolve(t,e)}(e,t.extends);else try{r=require.resolve(t.extends)}catch(e){return t}!function(t){if(mt.indexOf(t)>-1)throw new M(`Circular extended configurations: '${t}'.`)}(r),mt.push(r),i=s?JSON.parse(pt.readFileSync(r,"utf8")):require(t.extends),delete t.extends,i=gt(i,pt.path.dirname(r),n,pt)}return mt=[],n?yt(i,t):Object.assign({},i,t)}function yt(t,e){const n={};function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(n,t);for(const i of Object.keys(e))s(e[i])&&s(n[i])?n[i]=yt(t[i],e[i]):n[i]=e[i];return n}var bt,vt,wt,Ot,xt,Et,jt,St,Ct,kt,At,_t,Pt,$t,It,Mt,Tt,Lt,Nt,Ft,Dt,Gt,Rt,Ut,Wt,Bt,zt,Ht,qt,Vt,Kt,Yt,Jt,Qt,Xt,Zt=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},te=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};const ee=Symbol("copyDoubleDash"),ne=Symbol("copyDoubleDash"),se=Symbol("deleteFromParserHintObject"),ie=Symbol("emitWarning"),re=Symbol("freeze"),oe=Symbol("getDollarZero"),ae=Symbol("getParserConfiguration"),ce=Symbol("getUsageConfiguration"),le=Symbol("guessLocale"),he=Symbol("guessVersion"),ue=Symbol("parsePositionalNumbers"),de=Symbol("pkgUp"),fe=Symbol("populateParserHintArray"),pe=Symbol("populateParserHintSingleValueDictionary"),me=Symbol("populateParserHintArrayDictionary"),ge=Symbol("populateParserHintDictionary"),ye=Symbol("sanitizeKey"),be=Symbol("setKey"),ve=Symbol("unfreeze"),we=Symbol("validateAsync"),Oe=Symbol("getCommandInstance"),xe=Symbol("getContext"),Ee=Symbol("getHasOutput"),je=Symbol("getLoggerInstance"),Se=Symbol("getParseContext"),Ce=Symbol("getUsageInstance"),ke=Symbol("getValidationInstance"),Ae=Symbol("hasParseCallback"),_e=Symbol("isGlobalContext"),Pe=Symbol("postProcess"),$e=Symbol("rebase"),Ie=Symbol("reset"),Me=Symbol("runYargsParserAndExecuteCommands"),Te=Symbol("runValidation"),Le=Symbol("setHasOutput"),Ne=Symbol("kTrackManuallySetKeys");class Fe{constructor(t=[],e,n,s){this.customScriptName=!1,this.parsed=!1,bt.set(this,void 0),vt.set(this,void 0),wt.set(this,{commands:[],fullCommands:[]}),Ot.set(this,null),xt.set(this,null),Et.set(this,"show-hidden"),jt.set(this,null),St.set(this,!0),Ct.set(this,{}),kt.set(this,!0),At.set(this,[]),_t.set(this,void 0),Pt.set(this,{}),$t.set(this,!1),It.set(this,null),Mt.set(this,!0),Tt.set(this,void 0),Lt.set(this,""),Nt.set(this,void 0),Ft.set(this,void 0),Dt.set(this,{}),Gt.set(this,null),Rt.set(this,null),Ut.set(this,{}),Wt.set(this,{}),Bt.set(this,void 0),zt.set(this,!1),Ht.set(this,void 0),qt.set(this,!1),Vt.set(this,!1),Kt.set(this,!1),Yt.set(this,void 0),Jt.set(this,{}),Qt.set(this,null),Xt.set(this,void 0),Zt(this,Ht,s,"f"),Zt(this,Bt,t,"f"),Zt(this,vt,e,"f"),Zt(this,Ft,n,"f"),Zt(this,_t,new Q(this),"f"),this.$0=this[oe](),this[Ie](),Zt(this,bt,te(this,bt,"f"),"f"),Zt(this,Yt,te(this,Yt,"f"),"f"),Zt(this,Xt,te(this,Xt,"f"),"f"),Zt(this,Nt,te(this,Nt,"f"),"f"),te(this,Nt,"f").showHiddenOpt=te(this,Et,"f"),Zt(this,Tt,this[ne](),"f")}addHelpOpt(t,e){return K("[string|boolean] [string]",[t,e],arguments.length),te(this,It,"f")&&(this[se](te(this,It,"f")),Zt(this,It,null,"f")),!1===t&&void 0===e||(Zt(this,It,"string"==typeof t?t:"help","f"),this.boolean(te(this,It,"f")),this.describe(te(this,It,"f"),e||te(this,Yt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(K("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const n="string"==typeof t?t:te(this,Et,"f");return this.boolean(n),this.describe(n,e||te(this,Yt,"f").deferY18nLookup("Show hidden options")),te(this,Nt,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return K("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.alias.bind(this),"alias",t,e),this}array(t){return K("<array|string>",[t],arguments.length),this[fe]("array",t),this[Ne](t),this}boolean(t){return K("<array|string>",[t],arguments.length),this[fe]("boolean",t),this[Ne](t),this}check(t,e){return K("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,n)=>Z((()=>t(e,n.getOptions())),(n=>(n?("string"==typeof n||n instanceof Error)&&te(this,Yt,"f").fail(n.toString(),n):te(this,Yt,"f").fail(te(this,Ht,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(te(this,Yt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return K("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(K("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new M("coerce callback must be provided");for(const n of t)this.coerce(n,e);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!e)throw new M("coerce callback must be provided");return te(this,Nt,"f").key[t]=!0,te(this,_t,"f").addCoerceMiddleware(((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,t)?Z((()=>(i=s.getAliases(),e(n[t]))),(e=>{n[t]=e;const r=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[t]&&!0!==r)for(const s of i[t])n[s]=e;return n}),(t=>{throw new M(t.message)})):n}),t),this}conflicts(t,e){return K("<string|object> [string|array]",[t,e],arguments.length),te(this,Xt,"f").conflicts(t,e),this}config(t="config",e,n){return K("[object|string] [string|function] [function]",[t,e,n],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(n=e,e=void 0),this.describe(t,e||te(this,Yt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{te(this,Nt,"f").config[t]=n||!0})),this):(t=gt(t,te(this,vt,"f"),this[ae]()["deep-merge-config"]||!1,te(this,Ht,"f")),te(this,Nt,"f").configObjects=(te(this,Nt,"f").configObjects||[]).concat(t),this)}completion(t,e,n){return K("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),"function"==typeof e&&(n=e,e=void 0),Zt(this,xt,t||te(this,xt,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(te(this,xt,"f"),e),n&&te(this,Ot,"f").registerFunction(n),this}command(t,e,n,s,i,r){return K("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,s,i,r],arguments.length),te(this,bt,"f").addHandler(t,e,n,s,i,r),this}commands(t,e,n,s,i,r){return this.command(t,e,n,s,i,r)}commandDir(t,e){K("<string> [object]",[t,e],arguments.length);const n=te(this,Ft,"f")||te(this,Ht,"f").require;return te(this,bt,"f").addDirectory(t,n,te(this,Ht,"f").getCallerFile(),e),this}count(t){return K("<array|string>",[t],arguments.length),this[fe]("count",t),this[Ne](t),this}default(t,e,n){return K("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(B(t,te(this,Ht,"f")),te(this,Nt,"f").defaultDescription[t]=n),"function"==typeof e&&(B(t,te(this,Ht,"f")),te(this,Nt,"f").defaultDescription[t]||(te(this,Nt,"f").defaultDescription[t]=te(this,Yt,"f").functionDescription(e)),e=e.call()),this[pe](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,s){return K("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,s],arguments.length),"number"!=typeof e&&(n=e,e=1/0),this.global("_",!1),te(this,Nt,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:s},this}demand(t,e,n){return Array.isArray(e)?(e.forEach((t=>{W(n,!0,te(this,Ht,"f")),this.demandOption(t,n)})),e=1/0):"number"!=typeof e&&(n=e,e=1/0),"number"==typeof t?(W(n,!0,te(this,Ht,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach((t=>{W(n,!0,te(this,Ht,"f")),this.demandOption(t,n)})):"string"==typeof n?this.demandOption(t,n):!0!==n&&void 0!==n||this.demandOption(t),this}demandOption(t,e){return K("<object|string|array> [string]",[t,e],arguments.length),this[pe](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return K("<string> [string|boolean]",[t,e],arguments.length),te(this,Nt,"f").deprecatedOptions[t]=e,this}describe(t,e){return K("<object|string|array> [string]",[t,e],arguments.length),this[be](t,!0),te(this,Yt,"f").describe(t,e),this}detectLocale(t){return K("<boolean>",[t],arguments.length),Zt(this,St,t,"f"),this}env(t){return K("[string|boolean]",[t],arguments.length),!1===t?delete te(this,Nt,"f").envPrefix:te(this,Nt,"f").envPrefix=t||"",this}epilogue(t){return K("<string>",[t],arguments.length),te(this,Yt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return K("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):te(this,Yt,"f").example(t,e),this}exit(t,e){Zt(this,$t,!0,"f"),Zt(this,jt,e,"f"),te(this,kt,"f")&&te(this,Ht,"f").process.exit(t)}exitProcess(t=!0){return K("[boolean]",[t],arguments.length),Zt(this,kt,t,"f"),this}fail(t){if(K("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new M("Invalid first argument. Expected function or boolean 'false'");return te(this,Yt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return K("<array> [function]",[t,e],arguments.length),e?te(this,Ot,"f").getCompletion(t,e):new Promise(((e,n)=>{te(this,Ot,"f").getCompletion(t,((t,s)=>{t?n(t):e(s)}))}))}getDemandedOptions(){return K([],0),te(this,Nt,"f").demandedOptions}getDemandedCommands(){return K([],0),te(this,Nt,"f").demandedCommands}getDeprecatedOptions(){return K([],0),te(this,Nt,"f").deprecatedOptions}getDetectLocale(){return te(this,St,"f")}getExitProcess(){return te(this,kt,"f")}getGroups(){return Object.assign({},te(this,Pt,"f"),te(this,Wt,"f"))}getHelp(){if(Zt(this,$t,!0,"f"),!te(this,Yt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Me](te(this,Bt,"f"),void 0,void 0,0,!0);if(H(t))return t.then((()=>te(this,Yt,"f").help()))}const t=te(this,bt,"f").runDefaultBuilderOn(this);if(H(t))return t.then((()=>te(this,Yt,"f").help()))}return Promise.resolve(te(this,Yt,"f").help())}getOptions(){return te(this,Nt,"f")}getStrict(){return te(this,qt,"f")}getStrictCommands(){return te(this,Vt,"f")}getStrictOptions(){return te(this,Kt,"f")}global(t,e){return K("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?te(this,Nt,"f").local=te(this,Nt,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{te(this,Nt,"f").local.includes(t)||te(this,Nt,"f").local.push(t)})),this}group(t,e){K("<string|array> <string>",[t,e],arguments.length);const n=te(this,Wt,"f")[e]||te(this,Pt,"f")[e];te(this,Wt,"f")[e]&&delete te(this,Wt,"f")[e];const s={};return te(this,Pt,"f")[e]=(n||[]).concat(t).filter((t=>!s[t]&&(s[t]=!0))),this}hide(t){return K("<string>",[t],arguments.length),te(this,Nt,"f").hiddenOptions.push(t),this}implies(t,e){return K("<string|object> [number|string|array]",[t,e],arguments.length),te(this,Xt,"f").implies(t,e),this}locale(t){return K("[string]",[t],arguments.length),void 0===t?(this[le](),te(this,Ht,"f").y18n.getLocale()):(Zt(this,St,!1,"f"),te(this,Ht,"f").y18n.setLocale(t),this)}middleware(t,e,n){return te(this,_t,"f").addMiddleware(t,!!e,n)}nargs(t,e){return K("<string|object|array> [number]",[t,e],arguments.length),this[pe](this.nargs.bind(this),"narg",t,e),this}normalize(t){return K("<array|string>",[t],arguments.length),this[fe]("normalize",t),this}number(t){return K("<array|string>",[t],arguments.length),this[fe]("number",t),this[Ne](t),this}option(t,e){if(K("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Ne](t),!te(this,Qt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[ie](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),te(this,Nt,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(te(this,Nt,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc,r=te(this,Yt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof i||this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){K("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[re](),void 0===t&&(t=te(this,Bt,"f")),"object"==typeof e&&(Zt(this,Rt,e,"f"),e=n),"function"==typeof e&&(Zt(this,Gt,e,"f"),e=!1),e||Zt(this,Bt,t,"f"),te(this,Gt,"f")&&Zt(this,kt,!1,"f");const s=this[Me](t,!!e),i=this.parsed;return te(this,Ot,"f").setParsed(this.parsed),H(s)?s.then((t=>(te(this,Gt,"f")&&te(this,Gt,"f").call(this,te(this,jt,"f"),t,te(this,Lt,"f")),t))).catch((t=>{throw te(this,Gt,"f")&&te(this,Gt,"f")(t,this.parsed.argv,te(this,Lt,"f")),t})).finally((()=>{this[ve](),this.parsed=i})):(te(this,Gt,"f")&&te(this,Gt,"f").call(this,te(this,jt,"f"),s,te(this,Lt,"f")),this[ve](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return H(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(H(s))throw new M(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return K("<object>",[t],arguments.length),Zt(this,Dt,t,"f"),this}pkgConf(t,e){K("<string> [string]",[t,e],arguments.length);let n=null;const s=this[de](e||te(this,vt,"f"));return s[t]&&"object"==typeof s[t]&&(n=gt(s[t],e||te(this,vt,"f"),this[ae]()["deep-merge-config"]||!1,te(this,Ht,"f")),te(this,Nt,"f").configObjects=(te(this,Nt,"f").configObjects||[]).concat(n)),this}positional(t,e){K("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=it(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&n.includes(t)));const s=te(this,wt,"f").fullCommands[te(this,wt,"f").fullCommands.length-1],i=s?te(this,bt,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return z(i).forEach((n=>{const s=i[n];Array.isArray(s)?-1!==s.indexOf(t)&&(e[n]=!0):s[t]&&!(n in e)&&(e[n]=s[t])})),this.group(t,te(this,Yt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return K("[boolean]",[t],arguments.length),Zt(this,zt,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return K("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&te(this,Nt,"f").narg[t]||this[pe](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return K("[string] [string]",[t,e],arguments.length),t=t||this.$0,te(this,Tt,"f").log(te(this,Ot,"f").generateCompletionScript(t,e||te(this,xt,"f")||"completion")),this}showHelp(t){if(K("[string|function]",[t],arguments.length),Zt(this,$t,!0,"f"),!te(this,Yt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Me](te(this,Bt,"f"),void 0,void 0,0,!0);if(H(e))return e.then((()=>{te(this,Yt,"f").showHelp(t)})),this}const e=te(this,bt,"f").runDefaultBuilderOn(this);if(H(e))return e.then((()=>{te(this,Yt,"f").showHelp(t)})),this}return te(this,Yt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return K("[boolean|string] [string]",[t,e],arguments.length),te(this,Yt,"f").showHelpOnFail(t,e),this}showVersion(t){return K("[string|function]",[t],arguments.length),te(this,Yt,"f").showVersion(t),this}skipValidation(t){return K("<array|string>",[t],arguments.length),this[fe]("skipValidation",t),this}strict(t){return K("[boolean]",[t],arguments.length),Zt(this,qt,!1!==t,"f"),this}strictCommands(t){return K("[boolean]",[t],arguments.length),Zt(this,Vt,!1!==t,"f"),this}strictOptions(t){return K("[boolean]",[t],arguments.length),Zt(this,Kt,!1!==t,"f"),this}string(t){return K("<array|string>",[t],arguments.length),this[fe]("string",t),this[Ne](t),this}terminalWidth(){return K([],0),te(this,Ht,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return K("<object>",[t],arguments.length),Zt(this,St,!1,"f"),te(this,Ht,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(K("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),void 0!==e){if(W(t,null,te(this,Ht,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new M(".usage() description must start with $0 if being used as alias for .command()")}return te(this,Yt,"f").usage(t),this}usageConfiguration(t){return K("<object>",[t],arguments.length),Zt(this,Jt,t,"f"),this}version(t,e,n){const s="version";if(K("[boolean|string] [string] [string]",[t,e,n],arguments.length),te(this,Qt,"f")&&(this[se](te(this,Qt,"f")),te(this,Yt,"f").version(void 0),Zt(this,Qt,null,"f")),0===arguments.length)n=this[he](),t=s;else if(1===arguments.length){if(!1===t)return this;n=t,t=s}else 2===arguments.length&&(n=e,e=void 0);return Zt(this,Qt,"string"==typeof t?t:s,"f"),e=e||te(this,Yt,"f").deferY18nLookup("Show version number"),te(this,Yt,"f").version(n||void 0),this.boolean(te(this,Qt,"f")),this.describe(te(this,Qt,"f"),e),this}wrap(t){return K("<number|null|undefined>",[t],arguments.length),te(this,Yt,"f").wrap(t),this}[(bt=new WeakMap,vt=new WeakMap,wt=new WeakMap,Ot=new WeakMap,xt=new WeakMap,Et=new WeakMap,jt=new WeakMap,St=new WeakMap,Ct=new WeakMap,kt=new WeakMap,At=new WeakMap,_t=new WeakMap,Pt=new WeakMap,$t=new WeakMap,It=new WeakMap,Mt=new WeakMap,Tt=new WeakMap,Lt=new WeakMap,Nt=new WeakMap,Ft=new WeakMap,Dt=new WeakMap,Gt=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ht=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,Xt=new WeakMap,ee)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[ne](){return{log:(...t)=>{this[Ae]()||console.log(...t),Zt(this,$t,!0,"f"),te(this,Lt,"f").length&&Zt(this,Lt,te(this,Lt,"f")+"\n","f"),Zt(this,Lt,te(this,Lt,"f")+t.join(" "),"f")},error:(...t)=>{this[Ae]()||console.error(...t),Zt(this,$t,!0,"f"),te(this,Lt,"f").length&&Zt(this,Lt,te(this,Lt,"f")+"\n","f"),Zt(this,Lt,te(this,Lt,"f")+t.join(" "),"f")}}}[se](t){z(te(this,Nt,"f")).forEach((e=>{if("configObjects"===e)return;const n=te(this,Nt,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):"object"==typeof n&&delete n[t]})),delete te(this,Yt,"f").getDescriptions()[t]}[ie](t,e,n){te(this,Ct,"f")[n]||(te(this,Ht,"f").process.emitWarning(t,e),te(this,Ct,"f")[n]=!0)}[re](){te(this,At,"f").push({options:te(this,Nt,"f"),configObjects:te(this,Nt,"f").configObjects.slice(0),exitProcess:te(this,kt,"f"),groups:te(this,Pt,"f"),strict:te(this,qt,"f"),strictCommands:te(this,Vt,"f"),strictOptions:te(this,Kt,"f"),completionCommand:te(this,xt,"f"),output:te(this,Lt,"f"),exitError:te(this,jt,"f"),hasOutput:te(this,$t,"f"),parsed:this.parsed,parseFn:te(this,Gt,"f"),parseContext:te(this,Rt,"f")}),te(this,Yt,"f").freeze(),te(this,Xt,"f").freeze(),te(this,bt,"f").freeze(),te(this,_t,"f").freeze()}[oe](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(te(this,Ht,"f").process.argv()[0])?te(this,Ht,"f").process.argv().slice(1,2):te(this,Ht,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[$e](te(this,vt,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),te(this,Ht,"f").getEnv("_")&&te(this,Ht,"f").getProcessArgvBin()===te(this,Ht,"f").getEnv("_")&&(e=te(this,Ht,"f").getEnv("_").replace(`${te(this,Ht,"f").path.dirname(te(this,Ht,"f").process.execPath())}/`,"")),e}[ae](){return te(this,Dt,"f")}[ce](){return te(this,Jt,"f")}[le](){if(!te(this,St,"f"))return;const t=te(this,Ht,"f").getEnv("LC_ALL")||te(this,Ht,"f").getEnv("LC_MESSAGES")||te(this,Ht,"f").getEnv("LANG")||te(this,Ht,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[he](){return this[de]().version||"unknown"}[ue](t){const e=t["--"]?t["--"]:t._;for(let t,n=0;void 0!==(t=e[n]);n++)te(this,Ht,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[n]=Number(t));return t}[de](t){const e=t||"*";if(te(this,Ut,"f")[e])return te(this,Ut,"f")[e];let n={};try{let e=t||te(this,Ht,"f").mainFilename;!t&&te(this,Ht,"f").path.extname(e)&&(e=te(this,Ht,"f").path.dirname(e));const s=te(this,Ht,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));W(s,void 0,te(this,Ht,"f")),n=JSON.parse(te(this,Ht,"f").readFileSync(s,"utf8"))}catch(t){}return te(this,Ut,"f")[e]=n||{},te(this,Ut,"f")[e]}[fe](t,e){(e=[].concat(e)).forEach((e=>{e=this[ye](e),te(this,Nt,"f")[t].push(e)}))}[pe](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{te(this,Nt,"f")[t][e]=n}))}[me](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{te(this,Nt,"f")[t][e]=(te(this,Nt,"f")[t][e]||[]).concat(n)}))}[ge](t,e,n,s,i){if(Array.isArray(n))n.forEach((e=>{t(e,s)}));else if((t=>"object"==typeof t)(n))for(const e of z(n))t(e,n[e]);else i(e,this[ye](n),s)}[ye](t){return"__proto__"===t?"___proto___":t}[be](t,e){return this[pe](this[be].bind(this),"key",t,e),this}[ve](){var t,e,n,s,i,r,o,a,c,l,h,u;const d=te(this,At,"f").pop();let f;W(d,void 0,te(this,Ht,"f")),t=this,e=this,n=this,s=this,i=this,r=this,o=this,a=this,c=this,l=this,h=this,u=this,({options:{set value(e){Zt(t,Nt,e,"f")}}.value,configObjects:f,exitProcess:{set value(t){Zt(e,kt,t,"f")}}.value,groups:{set value(t){Zt(n,Pt,t,"f")}}.value,output:{set value(t){Zt(s,Lt,t,"f")}}.value,exitError:{set value(t){Zt(i,jt,t,"f")}}.value,hasOutput:{set value(t){Zt(r,$t,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){Zt(o,qt,t,"f")}}.value,strictCommands:{set value(t){Zt(a,Vt,t,"f")}}.value,strictOptions:{set value(t){Zt(c,Kt,t,"f")}}.value,completionCommand:{set value(t){Zt(l,xt,t,"f")}}.value,parseFn:{set value(t){Zt(h,Gt,t,"f")}}.value,parseContext:{set value(t){Zt(u,Rt,t,"f")}}.value}=d),te(this,Nt,"f").configObjects=f,te(this,Yt,"f").unfreeze(),te(this,Xt,"f").unfreeze(),te(this,bt,"f").unfreeze(),te(this,_t,"f").unfreeze()}[we](t,e){return Z(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Oe].bind(this),getContext:this[xe].bind(this),getHasOutput:this[Ee].bind(this),getLoggerInstance:this[je].bind(this),getParseContext:this[Se].bind(this),getParserConfiguration:this[ae].bind(this),getUsageConfiguration:this[ce].bind(this),getUsageInstance:this[Ce].bind(this),getValidationInstance:this[ke].bind(this),hasParseCallback:this[Ae].bind(this),isGlobalContext:this[_e].bind(this),postProcess:this[Pe].bind(this),reset:this[Ie].bind(this),runValidation:this[Te].bind(this),runYargsParserAndExecuteCommands:this[Me].bind(this),setHasOutput:this[Le].bind(this)}}[Oe](){return te(this,bt,"f")}[xe](){return te(this,wt,"f")}[Ee](){return te(this,$t,"f")}[je](){return te(this,Tt,"f")}[Se](){return te(this,Rt,"f")||{}}[Ce](){return te(this,Yt,"f")}[ke](){return te(this,Xt,"f")}[Ae](){return!!te(this,Gt,"f")}[_e](){return te(this,Mt,"f")}[Pe](t,e,n,s){if(n)return t;if(H(t))return t;e||(t=this[ee](t));return(this[ae]()["parse-positional-numbers"]||void 0===this[ae]()["parse-positional-numbers"])&&(t=this[ue](t)),s&&(t=X(t,this,te(this,_t,"f").getMiddleware(),!1)),t}[Ie](t={}){Zt(this,Nt,te(this,Nt,"f")||{},"f");const e={};e.local=te(this,Nt,"f").local||[],e.configObjects=te(this,Nt,"f").configObjects||[];const n={};e.local.forEach((e=>{n[e]=!0,(t[e]||[]).forEach((t=>{n[t]=!0}))})),Object.assign(te(this,Wt,"f"),Object.keys(te(this,Pt,"f")).reduce(((t,e)=>{const s=te(this,Pt,"f")[e].filter((t=>!(t in n)));return s.length>0&&(t[e]=s),t}),{})),Zt(this,Pt,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(te(this,Nt,"f")[t]||[]).filter((t=>!n[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=it(te(this,Nt,"f")[t],(t=>!n[t]))})),e.envPrefix=te(this,Nt,"f").envPrefix,Zt(this,Nt,e,"f"),Zt(this,Yt,te(this,Yt,"f")?te(this,Yt,"f").reset(n):at(this,te(this,Ht,"f")),"f"),Zt(this,Xt,te(this,Xt,"f")?te(this,Xt,"f").reset(n):function(t,e,n){const s=n.y18n.__,i=n.y18n.__n,r={nonOptionCount:function(n){const s=t.getDemandedCommands(),r=n._.length+(n["--"]?n["--"].length:0)-t.getInternalMethods().getContext().commands.length;s._&&(r<s._.min||r>s._.max)&&(r<s._.min?void 0!==s._.minMsg?e.fail(s._.minMsg?s._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),s._.min.toString())):r>s._.max&&(void 0!==s._.maxMsg?e.fail(s._.maxMsg?s._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),s._.max.toString()))))},positionalCount:function(t,n){n<t&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",n,n+"",t+""))},requiredArguments:function(t,n){let s=null;for(const e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(s=s||{},s[e]=n[e]);if(s){const t=[];for(const e of Object.keys(s)){const n=s[e];n&&t.indexOf(n)<0&&t.push(n)}const n=t.length?`\n${t.join("\n")}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(s).length,Object.keys(s).join(", ")+n))}},unknownArguments:function(n,s,o,a,c=!0){var l;const h=t.getInternalMethods().getCommandInstance().getCommands(),u=[],d=t.getInternalMethods().getContext();if(Object.keys(n).forEach((e=>{ft.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,s)||u.push(e)})),c&&(d.commands.length>0||h.length>0||a)&&n._.slice(d.commands.length).forEach((t=>{h.includes(""+t)||u.push(""+t)})),c){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,s=d.commands.length+e;s<n._.length&&n._.slice(s).forEach((t=>{t=String(t),d.commands.includes(t)||u.includes(t)||u.push(t)}))}u.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",u.length,u.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(n){const s=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||s.length>0)&&n._.slice(o.commands.length).forEach((t=>{s.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(i("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,n){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;const s=t.parsed.newAliases;return[e,...n[e]].some((t=>!Object.prototype.hasOwnProperty.call(s,t)||!s[e]))},limitedChoices:function(n){const i=t.getOptions(),r={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach((t=>{-1===ft.indexOf(t)&&Object.prototype.hasOwnProperty.call(i.choices,t)&&[].concat(n[t]).forEach((e=>{-1===i.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=s("Invalid values:");o.forEach((t=>{a+=`\n ${s("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(i.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const n=Number(e);return"number"==typeof(e=isNaN(n)?e:n)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,s){K("<string|object> [array|number|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(s)?s.forEach((t=>r.implies(e,t))):(W(s,void 0,n),o[e].push(s)))},r.getImplied=function(){return o},r.implications=function(t){const n=[];if(Object.keys(o).forEach((e=>{const s=e;(o[e]||[]).forEach((e=>{let i=s;const r=e;i=a(t,i),e=a(t,e),i&&!e&&n.push(` ${s} -> ${r}`)}))})),n.length){let t=`${s("Implications failed:")}\n`;n.forEach((e=>{t+=e})),e.fail(t)}};let c={};r.conflicts=function(e,n){K("<string|object> [array|string]",[e,n],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),c[e]||(c[e]=[]),Array.isArray(n)?n.forEach((t=>r.conflicts(e,t))):c[e].push(n))},r.getConflicting=()=>c,r.conflicting=function(i){Object.keys(i).forEach((t=>{c[t]&&c[t].forEach((n=>{n&&void 0!==i[t]&&void 0!==i[n]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,n))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach((t=>{c[t].forEach((r=>{r&&void 0!==i[n.Parser.camelCase(t)]&&void 0!==i[n.Parser.camelCase(r)]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,n){n=n.sort(((t,e)=>e.length-t.length));let i=null,r=1/0;for(let e,s=0;void 0!==(e=n[s]);s++){const n=dt(t,e);n<=3&&n<r&&(r=n,i=e)}i&&e.fail(s("Did you mean %s?",i))},r.reset=function(t){return o=it(o,(e=>!t[e])),c=it(c,(e=>!t[e])),r};const l=[];return r.freeze=function(){l.push({implied:o,conflicting:c})},r.unfreeze=function(){const t=l.pop();W(t,void 0,n),({implied:o,conflicting:c}=t)},r}(this,te(this,Yt,"f"),te(this,Ht,"f")),"f"),Zt(this,bt,te(this,bt,"f")?te(this,bt,"f").reset():function(t,e,n,s){return new et(t,e,n,s)}(te(this,Yt,"f"),te(this,Xt,"f"),te(this,_t,"f"),te(this,Ht,"f")),"f"),te(this,Ot,"f")||Zt(this,Ot,function(t,e,n,s){return new ut(t,e,n,s)}(this,te(this,Yt,"f"),te(this,bt,"f"),te(this,Ht,"f")),"f"),te(this,_t,"f").reset(),Zt(this,xt,null,"f"),Zt(this,Lt,"","f"),Zt(this,jt,null,"f"),Zt(this,$t,!1,"f"),this.parsed=!1,this}[$e](t,e){return te(this,Ht,"f").path.relative(t,e)}[Me](t,e,n,s=0,i=!1){let r=!!n||i;t=t||te(this,Bt,"f"),te(this,Nt,"f").__=te(this,Ht,"f").y18n.__,te(this,Nt,"f").configuration=this[ae]();const o=!!te(this,Nt,"f").configuration["populate--"],a=Object.assign({},te(this,Nt,"f").configuration,{"populate--":!0}),c=te(this,Ht,"f").Parser.detailed(t,Object.assign({},te(this,Nt,"f"),{configuration:{"parse-positional-numbers":!1,...a}})),l=Object.assign(c.argv,te(this,Rt,"f"));let h;const u=c.aliases;let d=!1,f=!1;Object.keys(l).forEach((t=>{t===te(this,It,"f")&&l[t]?d=!0:t===te(this,Qt,"f")&&l[t]&&(f=!0)})),l.$0=this.$0,this.parsed=c,0===s&&te(this,Yt,"f").clearCachedHelpMessage();try{if(this[le](),e)return this[Pe](l,o,!!n,!1);if(te(this,It,"f")){[te(this,It,"f")].concat(u[te(this,It,"f")]||[]).filter((t=>t.length>1)).includes(""+l._[l._.length-1])&&(l._.pop(),d=!0)}Zt(this,Mt,!1,"f");const a=te(this,bt,"f").getCommands(),p=te(this,Ot,"f").completionKey in l,m=d||p||i;if(l._.length){if(a.length){let t;for(let e,r=s||0;void 0!==l._[r];r++){if(e=String(l._[r]),a.includes(e)&&e!==te(this,xt,"f")){const t=te(this,bt,"f").runCommand(e,this,c,r+1,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(!t&&e!==te(this,xt,"f")){t=e;break}}!te(this,bt,"f").hasDefaultCommand()&&te(this,zt,"f")&&t&&!m&&te(this,Xt,"f").recommendCommands(t,a)}te(this,xt,"f")&&l._.includes(te(this,xt,"f"))&&!p&&(te(this,kt,"f")&&rt(!0),this.showCompletionScript(),this.exit(0))}if(te(this,bt,"f").hasDefaultCommand()&&!m){const t=te(this,bt,"f").runCommand(null,this,c,0,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(p){te(this,kt,"f")&&rt(!0);const e=(t=[].concat(t)).slice(t.indexOf(`--${te(this,Ot,"f").completionKey}`)+1);return te(this,Ot,"f").getCompletion(e,((t,e)=>{if(t)throw new M(t.message);(e||[]).forEach((t=>{te(this,Tt,"f").log(t)})),this.exit(0)})),this[Pe](l,!o,!!n,!1)}if(te(this,$t,"f")||(d?(te(this,kt,"f")&&rt(!0),r=!0,this.showHelp("log"),this.exit(0)):f&&(te(this,kt,"f")&&rt(!0),r=!0,te(this,Yt,"f").showVersion("log"),this.exit(0))),!r&&te(this,Nt,"f").skipValidation.length>0&&(r=Object.keys(l).some((t=>te(this,Nt,"f").skipValidation.indexOf(t)>=0&&!0===l[t]))),!r){if(c.error)throw new M(c.error.message);if(!p){const t=this[Te](u,{},c.error);n||(h=X(l,this,te(this,_t,"f").getMiddleware(),!0)),h=this[we](t,null!=h?h:l),H(h)&&!n&&(h=h.then((()=>X(l,this,te(this,_t,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof M))throw t;te(this,Yt,"f").fail(t.message,t)}return this[Pe](null!=h?h:l,o,!!n,!0)}[Te](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new M(n.message);te(this,Xt,"f").nonOptionCount(r),te(this,Xt,"f").requiredArguments(r,i);let o=!1;te(this,Vt,"f")&&(o=te(this,Xt,"f").unknownCommands(r)),te(this,qt,"f")&&!o?te(this,Xt,"f").unknownArguments(r,t,e,!!s):te(this,Kt,"f")&&te(this,Xt,"f").unknownArguments(r,t,{},!1,!1),te(this,Xt,"f").limitedChoices(r),te(this,Xt,"f").implications(r),te(this,Xt,"f").conflicting(r)}}[Le](){Zt(this,$t,!0,"f")}[Ne](t){if("string"==typeof t)te(this,Nt,"f").key[t]=!0;else for(const e of t)te(this,Nt,"f").key[e]=!0}}const De=(Ge=U,(t=[],e=Ge.process.cwd(),n)=>{const s=new Fe(t,e,n,Ge);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s});var Ge;const Re=De;function Ue(t,e){const n=t.startsWith(".")?(0,f.join)(e,t):t;return import(n)}function We(t,e){const{homepage:n,site:s=n,repository:i}=e,r=s&&s!==i,o=t.getInternalMethods(),a=(c=o.getCommandInstance().handlers,Object.keys(c).some((t=>t&&"$0"!==t)));var c;return 0===o.getUsageInstance().getUsage().length&&(a?t.usage("Usage: $0 <command>"):t.usage("Usage: $0")),a&&t.demandCommand(1,"Won't work without a command"),r&&t.epilogue(`Website: ${s}`),i&&t.epilogue(`Repository: ${i}`),t}var Be=a(3419);const ze="git",He="",qe=process.cwd();function Ve(){try{return function(){try{return Boolean((0,Be.Kc)("git",["--version"],{cwd:qe}).stdout)}catch{throw new Error("git is not installed")}}()&&function(){try{return"true"===(0,Be.Kc)("git",["rev-parse","--is-inside-work-tree"],{cwd:qe}).stdout}catch{throw new Error("not a git repository")}}()}catch(t){return console.error("Fail:",t.message),!1}}function Ke(t){t.command("hooks","Set .githooks as git.hooksPath",{},(()=>{Ve()&&(0,Be.Ho)("git",["config","core.hooksPath",".githooks"],{cwd:qe}).then((()=>{console.log("Done: set .githooks")})).catch((()=>{console.error("Fail:","setting hooks failed"),process.exitCode=1}))})),t.demandCommand(1,"Typing `hooks`")}const Ye=t(import.meta.url)("node:module"),Je=t(import.meta.url)("module"),Qe=process.cwd();const Xe=(0,Je.createRequire)(import.meta.url);function Ze(t,e=Qe){return t.startsWith(".")?(0,f.resolve)(e,t):(0,f.isAbsolute)(t)?t:Xe.resolve(t)}function tn(t){try{return(0,s.statSync)(Ze(t)),!0}catch{return!1}}function en(t,e={}){const n=function(t){try{const e=(0,s.readFileSync)(Ze(t),"utf8");return JSON.parse(e)}catch{return{}}}("./package.json");if(t){const{[t]:s=e}=n;return s}return n}var nn=a(1455),sn=a(6760);const rn={"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"subject-case":[0],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]],"scope-case":[0],"body-case":[0],"header-case":[0]};function on(){return(0,nn.readFile)((0,sn.resolve)(process.cwd(),".git/COMMIT_EDITMSG"),"utf8")}function an(t){t.command("commit","Lint git commit message",{},(()=>{(async function(){const t=await on(),e=await a.e(609).then(a.bind(a,7609)).then((t=>t.default.default||t.default)),n=await a.e(290).then(a.bind(a,2290)).then((t=>t.default.default||t.default)),s=await e(t,rn);return{result:s,output:await n({results:[s]})}})().then((({result:t,output:e})=>{t.valid?console.log("Pass."):(console.log("Fail:"),console.log(e),process.exitCode=1)})).catch((t=>{console.error(t),process.exitCode=1}))}))}function cn({garou:t,stylelint:e,eslint:n,prettier:s}){const i=process.stdin.isTTY?" --color":"";return function(t){const e=Object.entries(t).map((([t,e])=>[t,e.filter(Boolean)])).filter((([t,e])=>e.length));return e.length>0?Object.fromEntries(e):void 0}({"*.{vue,html,htm,md}":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{ts,tsx,mts,cts}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix${i}`],"*.{json,yml,yaml,svg}":[t&&"garou",s&&`prettier -w -u${i}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[s&&`prettier -w -u${i}`],"{*.jenkinsfile,{j,J}enkinsfile}":[s&&`prettier -w -u${i}`],"yarn.lock":[t&&"garou"]})}async function ln(){const{default:t}=await a.e(359).then(a.bind(a,5359));return t({allowEmpty:!0,concurrent:!0,config:cn(function(){const t=en("devDependencies");return{garou:"garou"in t,stylelint:"stylelint"in t,eslint:"eslint"in t,prettier:"prettier"in t}}()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})}const hn="lint";function un(t){an(t),function(t){t.command("staged","Lint and format git staged files",{},(()=>{ln().then((t=>{process.exitCode=t?0:1})).catch((t=>{console.error(t),process.exitCode=1}))}))}(t),t.demandCommand(1,"Typing `commit` or `staged`")}process.on("SIGINT",(()=>{})),new class{constructor(t,e){this.root=e;const{bin:n,homepage:i,name:r="cheetor",repository:{url:o=""}={},version:a}="string"==typeof t?JSON.parse((0,s.readFileSync)(new URL(t,e))):t;this.homepage=i,this.repository=o.includes("github.com")?o.replace(/\.git$/,""):"";const c=Re(process.argv.slice(2)).strict().alias("help","h").alias("version","v").hide("help").version(a).hide("version").detectLocale(!1),l=function(t,e){if("string"==typeof t||!t)return e;const n=Object.keys(t);return 1===n.length&&n[0]}(n,r);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(t){return this.cli=this.cli.then(t),this}command(...t){return this.cli=this.cli.then((e=>e.command(...t))),this}commandFrom(t){return this.cli=this.cli.then((async e=>{const n=await Ue(t,this.root);return e.command(n)})),this}commandSafe(t){return this.cli=this.cli.then((e=>function(t,e){return Ue(t,e).catch((t=>{if("ERR_MODULE_NOT_FOUND"===t.code&&t.message.endsWith(` imported from ${(0,m.fileURLToPath)(import.meta.url)}`))return!1;throw t}))}(t,this.root).then((t=>t&&t.command?e.command(t):e)))),this}commandSmart(t){return this.cli=this.cli.then((async e=>{const n=t();return n&&n.command?e.command(n):e})),this}website(t){return this.site=t,this}middleware(...t){return this.cli=this.cli.then((e=>e.middleware(...t))),this}setup(t){return this.cli.then((t=>We(t,this))).then((e=>"function"==typeof t?t(e.parse()):e.parse()))}}("../package.json",import.meta.url).website("https://www.npmjs.com/org/nice-move").command(n).command(e).commandSmart((function(){if(tn("svgo/package.json")&&tn("svgo-config/package.json"))return{command:"svgo",describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,e="./"]}){const n=(0,Ye.createRequire)(import.meta.url);(0,Be.Ho)("svgo",["-r","-q","--pretty","--indent","2","--config",n.resolve("svgo-config"),"-f",e]).then((()=>{console.log("Done: calling svgo")})).catch((t=>{process.exitCode=1,console.error("Error:",t.message)}))}}})).setup()})();
|
|
2
|
+
import{createRequire as t}from"module";var e,n,s,i,r={1092:(t,e,n)=>{const s=n(5317),i=n(8147),r=n(995);function o(t,e,n){const o=i(t,e,n),a=s.spawn(o.command,o.args,o.options);return r.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(t,e,n){const o=i(t,e,n),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||r.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=r},995:t=>{const e="win32"===process.platform;function n(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 s(t,s){return e&&1===t&&!s.file?n(s.original,"spawn"):null}t.exports={hookChildProcess:function(t,n){if(!e)return;const i=t.emit;t.emit=function(e,r){if("exit"===e){const e=s(r,n);if(e)return i.call(t,"error",e)}return i.apply(t,arguments)}},verifyENOENT:s,verifyENOENTSync:function(t,s){return e&&1===t&&!s.file?n(s.original,"spawnSync"):null},notFoundError:n}},8147:(t,e,n)=>{const s=n(6928),i=n(4080),r=n(78),o=n(4489),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h(t){if(!a)return t;const e=function(t){t.file=i(t);const e=t.file&&o(t.file);return e?(t.args.unshift(t.file),t.command=e,i(t)):t.file}(t),n=!c.test(e);if(t.options.forceShell||n){const n=l.test(e);t.command=s.normalize(t.command),t.command=r.command(t.command),t.args=t.args.map((t=>r.argument(t,n)));const i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null);const s={command:t,args:e=e?e.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:t,args:e}};return n.shell?s:h(s)}},78:t=>{const e=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(e,"^$1")},t.exports.argument=function(t,n){return t=(t=`"${t=(t=(t=`${t}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(e,"^$1"),n&&(t=t.replace(e,"^$1")),t}},4489:(t,e,n)=>{const s=n(9896),i=n(230);t.exports=function(t){const e=Buffer.alloc(150);let n;try{n=s.openSync(t,"r"),s.readSync(n,e,0,150,0),s.closeSync(n)}catch(t){}return i(e.toString())}},4080:(t,e,n)=>{const s=n(6928),i=n(4644),r=n(8139);function o(t,e){const n=t.options.env||process.env,o=process.cwd(),a=null!=t.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=i.sync(t.command,{path:n[r({env:n})],pathExt:e?s.delimiter:void 0})}catch(t){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?t.options.cwd:"",l)),l}t.exports=function(t){return o(t)||o(t,!0)}},4644:(t,e,n)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=n(6928),r=s?";":":",o=n(9882),a=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,e)=>{const n=e.colon||r,i=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],o=s?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(n):[""];return s&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:i,pathExt:a,pathExtExe:o}},l=(t,e,n)=>{"function"==typeof e&&(n=e,e={}),e||(e={});const{pathEnv:s,pathExt:r,pathExtExe:l}=c(t,e),h=[],u=n=>new Promise(((r,o)=>{if(n===s.length)return e.all&&h.length?r(h):o(a(t));const c=s[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(l,t),f=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;r(d(f,n,0))})),d=(t,n,s)=>new Promise(((i,a)=>{if(s===r.length)return i(u(n+1));const c=r[s];o(t+c,{pathExt:l},((r,o)=>{if(!r&&o){if(!e.all)return i(t+c);h.push(t+c)}return i(d(t,n,s+1))}))}));return n?u(0).then((t=>n(null,t)),n):u(0)};t.exports=l,l.sync=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:s,pathExtExe:r}=c(t,e),l=[];for(let a=0;a<n.length;a++){const c=n[a],h=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(h,t),d=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let t=0;t<s.length;t++){const n=d+s[t];try{if(o.sync(n,{pathExt:r})){if(!e.all)return n;l.push(n)}}catch(t){}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw a(t)}},9882:(t,e,n)=>{var s;n(9896);function i(t,e,n){if("function"==typeof e&&(n=e,e={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,s){i(t,e||{},(function(t,e){t?s(t):n(e)}))}))}s(t,e||{},(function(t,s){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,s=!1),n(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?n(6095):n(4155),t.exports=i,i.sync=function(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},4155:(t,e,n)=>{t.exports=i,i.sync=function(t,e){return r(s.statSync(t),e)};var s=n(9896);function i(t,e,n){s.stat(t,(function(t,s){n(t,!t&&r(s,e))}))}function r(t,e){return t.isFile()&&function(t,e){var n=t.mode,s=t.uid,i=t.gid,r=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),h=a|c;return n&l||n&c&&i===o||n&a&&s===r||n&h&&0===r}(t,e)}},6095:(t,e,n)=>{t.exports=r,r.sync=function(t,e){return i(s.statSync(t),t,e)};var s=n(9896);function i(t,e,n){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var n=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var s=0;s<n.length;s++){var i=n[s].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}(e,n)}function r(t,e,n){s.stat(t,(function(s,r){n(s,!s&&i(r,t,e))}))}},257:(t,e,n)=>{const{PassThrough:s}=n(2203);t.exports=function(){var t=[],e=new s({objectMode:!0});return e.setMaxListeners(0),e.add=n,e.isEmpty=function(){return 0==t.length},e.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),e;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",i.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function i(n){!(t=t.filter((function(t){return t!==n}))).length&&e.readable&&e.end()}}},8139:t=>{const e=(t={})=>{const e=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=e,t.exports.default=e},230:(t,e,n)=>{const s=n(5672);t.exports=(t="")=>{const e=t.match(s);if(!e)return null;const[n,i]=e[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return"env"===r?i:i?`${r} ${i}`:r}},5672:t=>{t.exports=/^#!(.*)/},2613:e=>{e.exports=t(import.meta.url)("assert")},5317:e=>{e.exports=t(import.meta.url)("child_process")},6982:e=>{e.exports=t(import.meta.url)("crypto")},4434:e=>{e.exports=t(import.meta.url)("events")},9896:e=>{e.exports=t(import.meta.url)("fs")},3024:e=>{e.exports=t(import.meta.url)("node:fs")},1455:e=>{e.exports=t(import.meta.url)("node:fs/promises")},8161:e=>{e.exports=t(import.meta.url)("node:os")},6760:e=>{e.exports=t(import.meta.url)("node:path")},1708:e=>{e.exports=t(import.meta.url)("node:process")},7075:e=>{e.exports=t(import.meta.url)("node:stream")},7066:e=>{e.exports=t(import.meta.url)("node:tty")},7975:e=>{e.exports=t(import.meta.url)("node:util")},857:e=>{e.exports=t(import.meta.url)("os")},6928:e=>{e.exports=t(import.meta.url)("path")},2203:e=>{e.exports=t(import.meta.url)("stream")},3193:e=>{e.exports=t(import.meta.url)("string_decoder")},2018:e=>{e.exports=t(import.meta.url)("tty")},9023:e=>{e.exports=t(import.meta.url)("util")},4867:(e,n,s)=>{s.d(n,{Ho:()=>he,MP:()=>pe,Kc:()=>ue});const i=t(import.meta.url)("node:buffer");var r=s(6760);const o=t(import.meta.url)("node:child_process");var a=s(1708),c=s(1092);const l=t(import.meta.url)("node:url");function h(t={}){const{env:e=process.env,platform:n=process.platform}=t;return"win32"!==n?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"}const u=(t,e)=>{let n;for(;n!==e;)t.push(r.join(e,"node_modules/.bin")),n=e,e=r.resolve(e,"..")},d=(t,e,n)=>{const s=e instanceof URL?(0,l.fileURLToPath)(e):e;t.push(r.resolve(n,s,".."))},f=({env:t=a.env,...e}={})=>{const n=h({env:t={...t}});return e.path=t[n],t[n]=(({cwd:t=a.cwd(),path:e=a.env[h()],preferLocal:n=!0,execPath:s=a.execPath,addExecPath:i=!0}={})=>{const o=t instanceof URL?(0,l.fileURLToPath)(t):t,c=r.resolve(o),f=[];return n&&u(f,c),i&&d(f,s,c),[...f,e].join(r.delimiter)})(e),t},p=(t,e,n,s)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const i=Object.getOwnPropertyDescriptor(t,n),r=Object.getOwnPropertyDescriptor(e,n);!m(i,r)&&s||Object.defineProperty(t,n,r)},m=function(t,e){return void 0===t||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},g=(t,e)=>`/* Wrapped ${t}*/\n${e}`,y=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),b=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function v(t,e,{ignoreNonConfigurable:n=!1}={}){const{name:s}=t;for(const s of Reflect.ownKeys(e))p(t,e,s,n);return((t,e)=>{const n=Object.getPrototypeOf(e);n!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,n)})(t,e),((t,e,n)=>{const s=""===n?"":`with ${n.trim()}() `,i=g.bind(null,s,e.toString());Object.defineProperty(i,"name",b),Object.defineProperty(t,"toString",{...y,value:i})})(t,e,s),t}const w=new WeakMap,O=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let n,s=0;const i=t.displayName||t.name||"<anonymous>",r=function(...o){if(w.set(r,++s),1===s)n=t.apply(this,o),t=null;else if(!0===e.throw)throw new Error(`Function \`${i}\` can only be called once`);return n};return v(r,t),w.set(r,s),r};O.callCount=t=>{if(!w.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return w.get(t)};const x=O;var E=s(8161);const j=(t,e)=>({name:`SIGRT${e+1}`,number:S+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),S=34,C=64,k=[{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"}],A=()=>{const t=(()=>{const t=C-S+1;return Array.from({length:t},j)})();return[...k,...t].map(_)},_=({name:t,number:e,description:n,action:s,forced:i=!1,standard:r})=>{const{signals:{[t]:o}}=E.constants,a=void 0!==o;return{name:t,number:a?o:e,description:n,supported:a,action:s,forced:i,standard:r}},P=({name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o})=>[t,{name:t,number:e,description:n,supported:s,action:i,forced:r,standard:o}],$=(()=>{const t=A();return Object.fromEntries(t.map(P))})(),I=(t,e)=>{const n=M(t,e);if(void 0===n)return{};const{name:s,description:i,supported:r,action:o,forced:a,standard:c}=n;return{[t]:{name:s,number:t,description:i,supported:r,action:o,forced:a,standard:c}}},M=(t,e)=>{const n=e.find((({name:e})=>E.constants.signals[e]===t));return void 0!==n?n:e.find((e=>e.number===t))},T=((()=>{const t=A(),e=C+1,n=Array.from({length:e},((e,n)=>I(n,t)));Object.assign({},...n)})(),({stdout:t,stderr:e,all:n,error:s,signal:i,exitCode:r,command:o,escapedCommand:c,timedOut:l,isCanceled:h,killed:u,parsed:{options:{timeout:d,cwd:f=a.cwd()}}})=>{r=null===r?void 0:r;const p=void 0===(i=null===i?void 0:i)?void 0:$[i].description,m=(({timedOut:t,timeout:e,errorCode:n,signal:s,signalDescription:i,exitCode:r,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":void 0!==n?`failed with ${n}`:void 0!==s?`was killed with ${s} (${i})`:void 0!==r?`failed with exit code ${r}`:"failed")({timedOut:l,timeout:d,errorCode:s&&s.code,signal:i,signalDescription:p,exitCode:r,isCanceled:h}),g=`Command ${m}: ${o}`,y="[object Error]"===Object.prototype.toString.call(s),b=y?`${g}\n${s.message}`:g,v=[b,e,t].filter(Boolean).join("\n");return y?(s.originalMessage=s.message,s.message=v):s=new Error(v),s.shortMessage=b,s.command=o,s.escapedCommand=c,s.exitCode=r,s.signal=i,s.signalDescription=p,s.stdout=t,s.stderr=e,s.cwd=f,void 0!==n&&(s.all=n),"bufferedData"in s&&delete s.bufferedData,s.failed=!0,s.timedOut=Boolean(l),s.isCanceled=h,s.killed=u&&!l,s}),L=["stdin","stdout","stderr"],N=t=>{if(!t)return;const{stdio:e}=t;if(void 0===e)return L.map((e=>t[e]));if((t=>L.some((e=>void 0!==t[e])))(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${L.map((t=>`\`${t}\``)).join(", ")}`);if("string"==typeof e)return e;if(!Array.isArray(e))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof e}\``);const n=Math.max(e.length,L.length);return Array.from({length:n},((t,n)=>e[n]))},F=[];F.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&F.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&F.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const D=t=>!!t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on,G=Symbol.for("signal-exit emitter"),R=globalThis,U=Object.defineProperty.bind(Object);class W{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(R[G])return R[G];U(R,G,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(t,e){this.listeners[t].push(e)}removeListener(t,e){const n=this.listeners[t],s=n.indexOf(e);-1!==s&&(0===s&&1===n.length?n.length=0:n.splice(s,1))}emit(t,e,n){if(this.emitted[t])return!1;this.emitted[t]=!0;let s=!1;for(const i of this.listeners[t])s=!0===i(e,n)||s;return"exit"===t&&(s=this.emit("afterExit",e,n)||s),s}}class B{}const z=globalThis.process,{onExit:H,load:q,unload:V}=(K=D(z)?new class extends B{#t="win32"===z.platform?"SIGINT":"SIGHUP";#e=new W;#n;#s;#i;#r={};#o=!1;constructor(t){super(),this.#n=t,this.#r={};for(const e of F)this.#r[e]=()=>{const n=this.#n.listeners(e);let{count:s}=this.#e;const i=t;if("object"==typeof i.__signal_exit_emitter__&&"number"==typeof i.__signal_exit_emitter__.count&&(s+=i.__signal_exit_emitter__.count),n.length===s){this.unload();const n=this.#e.emit("exit",null,e),s="SIGHUP"===e?this.#t:e;n||t.kill(t.pid,s)}};this.#i=t.reallyExit,this.#s=t.emit}onExit(t,e){if(!D(this.#n))return()=>{};!1===this.#o&&this.load();const n=e?.alwaysLast?"afterExit":"exit";return this.#e.on(n,t),()=>{this.#e.removeListener(n,t),0===this.#e.listeners.exit.length&&0===this.#e.listeners.afterExit.length&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#e.count+=1;for(const t of F)try{const e=this.#r[t];e&&this.#n.on(t,e)}catch(t){}this.#n.emit=(t,...e)=>this.#a(t,...e),this.#n.reallyExit=t=>this.#c(t)}}unload(){this.#o&&(this.#o=!1,F.forEach((t=>{const e=this.#r[t];if(!e)throw new Error("Listener not defined for signal: "+t);try{this.#n.removeListener(t,e)}catch(t){}})),this.#n.emit=this.#s,this.#n.reallyExit=this.#i,this.#e.count-=1)}#c(t){return D(this.#n)?(this.#n.exitCode=t||0,this.#e.emit("exit",this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#a(t,...e){const n=this.#s;if("exit"===t&&D(this.#n)){"number"==typeof e[0]&&(this.#n.exitCode=e[0]);const s=n.call(this.#n,t,...e);return this.#e.emit("exit",this.#n.exitCode,null),s}return n.call(this.#n,t,...e)}}(z):new class extends B{onExit(){return()=>{}}load(){}unload(){}},{onExit:(t,e)=>K.onExit(t,e),load:()=>K.load(),unload:()=>K.unload()});var K;const Y=(t,e="SIGTERM",n={})=>{const s=t(e);return J(t,e,n,s),s},J=(t,e,n,s)=>{if(!Q(e,n,s))return;const i=Z(n),r=setTimeout((()=>{t("SIGKILL")}),i);r.unref&&r.unref()},Q=(t,{forceKillAfterTimeout:e},n)=>X(t)&&!1!==e&&n,X=t=>t===E.constants.signals.SIGTERM||"string"==typeof t&&"SIGTERM"===t.toUpperCase(),Z=({forceKillAfterTimeout:t=!0})=>{if(!0===t)return 5e3;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},tt=(t,e)=>{t.kill()&&(e.isCanceled=!0)},et=(t,{timeout:e,killSignal:n="SIGTERM"},s)=>{if(0===e||void 0===e)return s;let i;const r=new Promise(((s,r)=>{i=setTimeout((()=>{((t,e,n)=>{t.kill(e),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))})(t,n,r)}),e)})),o=s.finally((()=>{clearTimeout(i)}));return Promise.race([r,o])},nt=({timeout:t})=>{if(void 0!==t&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},st=async(t,{cleanup:e,detached:n},s)=>{if(!e||n)return s;const i=H((()=>{t.kill()}));return s.finally((()=>{i()}))};var it=s(3024);function rt(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function ot(t){return rt(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState}const at=(t,e,n)=>{if("string"==typeof n)return t[e].pipe((0,it.createWriteStream)(n)),t;if(ot(n))return t[e].pipe(n),t;if(!(t=>t instanceof o.ChildProcess&&"function"==typeof t.then)(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!ot(n.stdin))throw new TypeError("The target child process's stdin must be available.");return t[e].pipe(n.stdin),n},ct=t=>{null!==t.stdout&&(t.pipeStdout=at.bind(void 0,t,"stdout")),null!==t.stderr&&(t.pipeStderr=at.bind(void 0,t,"stderr")),void 0!==t.all&&(t.pipeAll=at.bind(void 0,t,"all"))},lt=t(import.meta.url)("node:timers/promises"),ht=async(t,{init:e,convertChunk:n,getSize:s,truncateChunk:i,addChunk:r,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{if(!pt(t))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");const l=e();l.length=0;try{for await(const e of t){const t=n[mt(e)](e,l);dt({convertedChunk:t,state:l,getSize:s,truncateChunk:i,addChunk:r,maxBuffer:c})}return ut({state:l,convertChunk:n,getSize:s,truncateChunk:i,addChunk:r,getFinalChunk:o,maxBuffer:c}),a(l)}catch(t){throw t.bufferedData=a(l),t}},ut=({state:t,getSize:e,truncateChunk:n,addChunk:s,getFinalChunk:i,maxBuffer:r})=>{const o=i(t);void 0!==o&&dt({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:s,maxBuffer:r})},dt=({convertedChunk:t,state:e,getSize:n,truncateChunk:s,addChunk:i,maxBuffer:r})=>{const o=n(t),a=e.length+o;if(a<=r)return void ft(t,e,i,a);const c=s(t,r-e.length);throw void 0!==c&&ft(c,e,i,r),new yt},ft=(t,e,n,s)=>{e.contents=n(t,e,s),e.length=s},pt=t=>"object"==typeof t&&null!==t&&"function"==typeof t[Symbol.asyncIterator],mt=t=>{const e=typeof t;if("string"===e)return"string";if("object"!==e||null===t)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=gt.call(t);return"[object ArrayBuffer]"===n?"arrayBuffer":"[object DataView]"===n?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&"[object ArrayBuffer]"===gt.call(t.buffer)?"typedArray":"others"},{toString:gt}=Object.prototype;class yt extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const bt=t=>t,vt=()=>{},wt=({contents:t})=>t,Ot=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},xt=t=>t.length;const Et=new TextEncoder,jt=t=>new Uint8Array(t),St=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),Ct=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(At(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},kt=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:At(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},At=t=>_t**Math.ceil(Math.log(t)/Math.log(_t)),_t=2,Pt=()=>"resize"in ArrayBuffer.prototype,$t={init:()=>({contents:new ArrayBuffer(0)}),convertChunk:{string:t=>Et.encode(t),buffer:jt,arrayBuffer:jt,dataView:St,typedArray:St,others:Ot},getSize:xt,truncateChunk:(t,e)=>t.slice(0,e),addChunk:(t,{contents:e,length:n},s)=>{const i=Pt()?kt(e,s):Ct(e,s);return new Uint8Array(i).set(t,n),i},getFinalChunk:vt,finalize:({contents:t,length:e})=>Pt()?t:t.slice(0,e)};async function It(t,e){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return Mt(await async function(t,e){return ht(t,$t,e)}(t,e))}catch(t){throw void 0!==t.bufferedData&&(t.bufferedData=Mt(t.bufferedData)),t}}const Mt=t=>globalThis.Buffer.from(t);const Tt=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),Lt={init:()=>({contents:"",textDecoder:new TextDecoder}),convertChunk:{string:bt,buffer:Tt,arrayBuffer:Tt,dataView:Tt,typedArray:Tt,others:Ot},getSize:xt,truncateChunk:(t,e)=>t.slice(0,e),addChunk:(t,{contents:e})=>e+t,getFinalChunk:({textDecoder:t})=>{const e=t.decode();return""===e?void 0:e},finalize:wt};var Nt=s(257);const Ft=t=>{if(void 0!==t)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},Dt=t=>{const e=(({input:t,inputFile:e})=>"string"!=typeof e?t:(Ft(t),(0,it.readFileSync)(e)))(t);if(rt(e))throw new TypeError("The `input` option cannot be a stream in sync mode");return e},Gt=(t,e)=>{const n=(({input:t,inputFile:e})=>"string"!=typeof e?t:(Ft(t),(0,it.createReadStream)(e)))(e);void 0!==n&&(rt(n)?n.pipe(t.stdin):t.stdin.end(n))},Rt=(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;const n=Nt();return t.stdout&&n.add(t.stdout),t.stderr&&n.add(t.stderr),n},Ut=async(t,e)=>{if(t&&void 0!==e){await(0,lt.setTimeout)(0),t.destroy();try{return await e}catch(t){return t.bufferedData}}},Wt=(t,{encoding:e,buffer:n,maxBuffer:s})=>{if(t&&n)return"utf8"===e||"utf-8"===e?async function(t,e){return ht(t,Lt,e)}(t,{maxBuffer:s}):null===e||"buffer"===e?It(t,{maxBuffer:s}):Bt(t,s,e)},Bt=async(t,e,n)=>(await It(t,{maxBuffer:e})).toString(n),zt=async({stdout:t,stderr:e,all:n},{encoding:s,buffer:i,maxBuffer:r},o)=>{const a=Wt(t,{encoding:s,buffer:i,maxBuffer:r}),c=Wt(e,{encoding:s,buffer:i,maxBuffer:r}),l=Wt(n,{encoding:s,buffer:i,maxBuffer:2*r});try{return await Promise.all([o,a,c,l])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},Ut(t,a),Ut(e,c),Ut(n,l)])}},Ht=(async()=>{})().constructor.prototype,qt=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(Ht,t)])),Vt=(t,e)=>{for(const[n,s]of qt){const i="function"==typeof e?(...t)=>Reflect.apply(s.value,e(),t):s.value.bind(e);Reflect.defineProperty(t,n,{...s,value:i})}},Kt=t=>new Promise(((e,n)=>{t.on("exit",((t,n)=>{e({exitCode:t,signal:n})})),t.on("error",(t=>{n(t)})),t.stdin&&t.stdin.on("error",(t=>{n(t)}))})),Yt=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],Jt=/^[\w.-]+$/,Qt=(t,e)=>Yt(t,e).join(" "),Xt=(t,e)=>Yt(t,e).map((t=>(t=>"string"!=typeof t||Jt.test(t)?t:`"${t.replaceAll('"','\\"')}"`)(t))).join(" "),Zt=/ +/g,te=t=>{const e=[];for(const n of t.trim().split(Zt)){const t=e.at(-1);t&&t.endsWith("\\")?e[e.length-1]=`${t.slice(0,-1)} ${n}`:e.push(n)}return e},ee=t=>{const e=typeof t;if("string"===e)return t;if("number"===e)return String(t);if("object"===e&&null!==t&&!(t instanceof o.ChildProcess)&&"stdout"in t){const e=typeof t.stdout;if("string"===e)return t.stdout;if(i.Buffer.isBuffer(t.stdout))return t.stdout.toString();throw new TypeError(`Unexpected "${e}" stdout in template expression`)}throw new TypeError(`Unexpected "${e}" in template expression`)},ne=(t,e,n)=>n||0===t.length||0===e.length?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],se=({templates:t,expressions:e,tokens:n,index:s,template:i})=>{const r=i??t.raw[s],o=r.split(Zt).filter(Boolean),a=ne(n,o,r.startsWith(" "));if(s===e.length)return a;const c=e[s],l=Array.isArray(c)?c.map((t=>ee(t))):[ee(c)];return ne(a,l,r.endsWith(" "))},ie=(t,e)=>{let n=[];for(const[s,i]of t.entries())n=se({templates:t,expressions:e,tokens:n,index:s,template:i});return n};const re=(0,s(7975).debuglog)("execa").enabled,oe=(t,e)=>String(t).padStart(e,"0"),ae=(t,{verbose:e})=>{e&&a.stderr.write(`[${(()=>{const t=new Date;return`${oe(t.getHours(),2)}:${oe(t.getMinutes(),2)}:${oe(t.getSeconds(),2)}.${oe(t.getMilliseconds(),3)}`})()}] ${t}\n`)},ce=(t,e,n={})=>{const s=c._parse(t,e,n);return t=s.command,e=s.args,(n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(n=s.options).cwd||a.cwd(),execPath:a.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:re,...n}).env=(({env:t,extendEnv:e,preferLocal:n,localDir:s,execPath:i})=>{const r=e?{...a.env,...t}:t;return n?f({env:r,cwd:s,execPath:i}):r})(n),n.stdio=N(n),"win32"===a.platform&&"cmd"===r.basename(t,".exe")&&e.unshift("/q"),{file:t,args:e,options:n,parsed:s}},le=(t,e,n)=>"string"==typeof e||i.Buffer.isBuffer(e)?t.stripFinalNewline?function(t){const e="string"==typeof t?"\n":"\n".charCodeAt(),n="string"==typeof t?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,-1)),t[t.length-1]===n&&(t=t.slice(0,-1)),t}(e):e:void 0===n?void 0:"";function he(t,e,n){const s=ce(t,e,n),i=Qt(t,e),r=Xt(t,e);let a;ae(r,s.options),nt(s.options);try{a=o.spawn(s.file,s.args,s.options)}catch(t){const e=new o.ChildProcess,n=Promise.reject(T({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return Vt(e,n),e}const c=Kt(a),l=et(a,s.options,c),h=st(a,s.options,l),u={isCanceled:!1};a.kill=Y.bind(null,a.kill.bind(a)),a.cancel=tt.bind(null,a,u);const d=x((async()=>{const[{error:t,exitCode:e,signal:n,timedOut:o},c,l,d]=await zt(a,s.options,h),f=le(s.options,c),p=le(s.options,l),m=le(s.options,d);if(t||0!==e||null!==n){const c=T({error:t,exitCode:e,signal:n,stdout:f,stderr:p,all:m,command:i,escapedCommand:r,parsed:s,timedOut:o,isCanceled:u.isCanceled||!!s.options.signal&&s.options.signal.aborted,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:i,escapedCommand:r,exitCode:0,stdout:f,stderr:p,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return Gt(a,s.options),a.all=Rt(a,s.options),ct(a),Vt(a,d),a}function ue(t,e,n){const s=ce(t,e,n),i=Qt(t,e),r=Xt(t,e);ae(r,s.options);const a=Dt(s.options);let c;try{c=o.spawnSync(s.file,s.args,{...s.options,input:a})}catch(t){throw T({error:t,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const l=le(s.options,c.stdout,c.error),h=le(s.options,c.stderr,c.error);if(c.error||0!==c.status||null!==c.signal){const t=T({stdout:l,stderr:h,error:c.error,signal:c.signal,exitCode:c.status,command:i,escapedCommand:r,parsed:s,timedOut:c.error&&"ETIMEDOUT"===c.error.code,isCanceled:!1,killed:null!==c.signal});if(!s.options.reject)return t;throw t}return{command:i,escapedCommand:r,exitCode:0,stdout:l,stderr:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}const de=({input:t,inputFile:e,stdio:n})=>void 0===t&&void 0===e&&void 0===n?{stdin:"inherit"}:{},fe=(t={})=>({preferLocal:!0,...de(t),...t});(function t(e){function n(n,...s){if(!Array.isArray(n))return t({...e,...n});const[i,...r]=ie(n,s);return he(i,r,fe(e))}return n.sync=(t,...n)=>{if(!Array.isArray(t))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");const[s,...i]=ie(t,n);return ue(s,i,fe(e))},n})();function pe(t,e){const[n,...s]=te(t);return he(n,s,e)}}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={exports:{}};return r[t](n,n.exports,a),n.exports}a.m=r,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,s){if(1&s&&(t=this(t)),8&s)return t;if("object"==typeof t&&t){if(4&s&&t.__esModule)return t;if(16&s&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var r={};e=e||[null,n({}),n([]),n(n)];for(var o=2&s&&t;"object"==typeof o&&!~e.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach((e=>r[e]=()=>t[e]));return r.default=()=>t,a.d(i,r),i},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>t+".mjs",a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s={27:0},i=t=>{var e,n,{ids:i,modules:r,runtime:o}=t,c=0;for(e in r)a.o(r,e)&&(a.m[e]=r[e]);for(o&&o(a);c<i.length;c++)n=i[c],a.o(s,n)&&s[n]&&s[n][0](),s[i[c]]=0},a.f.j=(t,e)=>{var n=a.o(s,t)?s[t]:void 0;if(0!==n)if(n)e.push(n[1]);else{var r=import("./"+a.u(t)).then(i,(e=>{throw 0!==s[t]&&(s[t]=void 0),e}));r=Promise.race([r,new Promise((e=>n=s[t]=[e]))]),e.push(n[1]=r)}},(()=>{var e={};a.r(e),a.d(e,{builder:()=>Ke,command:()=>ze,description:()=>He});var n={};a.r(n),a.d(n,{builder:()=>un,command:()=>hn});var s=a(9896),i=a(2613);const r={right:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n<e)return" ".repeat(e-n)+t;return t},center:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n>=e)return t;return" ".repeat(e-n>>1)+t}};class o{constructor(t){var e;this.width=t.width,this.wrap=null===(e=t.wrap)||void 0===e||e,this.rows=[]}span(...t){this.div(...t).span=!0}resetOutput(){this.rows=[]}div(...t){if(0===t.length&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&"string"==typeof t[0])return this.applyLayoutDSL(t[0]);const e=t.map((t=>"string"==typeof t?this.colFromString(t):t));return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return 1===t.length&&"string"==typeof t[0]&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const e=t.split("\n").map((t=>t.split("\t")));let n=0;return e.forEach((t=>{t.length>1&&l.stringWidth(t[0])>n&&(n=Math.min(Math.floor(.5*this.width),l.stringWidth(t[0])))})),e.forEach((t=>{this.div(...t.map(((e,s)=>({text:e.trim(),padding:this.measurePadding(e),width:0===s&&t.length>1?n:void 0}))))})),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const e=l.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){const t=[];return this.rows.forEach((e=>{this.rowToString(e,t)})),t.filter((t=>!t.hidden)).map((t=>t.text)).join("\n")}rowToString(t,e){return this.rasterize(t).forEach(((n,s)=>{let i="";n.forEach(((n,o)=>{const{width:a}=t[o],h=this.negatePadding(t[o]);let u=n;if(h>l.stringWidth(n)&&(u+=" ".repeat(h-l.stringWidth(n))),t[o].align&&"left"!==t[o].align&&this.wrap){u=(0,r[t[o].align])(u,h),l.stringWidth(u)<h&&(u+=" ".repeat((a||0)-l.stringWidth(u)-1))}const d=t[o].padding||[0,0,0,0];d[3]&&(i+=" ".repeat(d[3])),i+=c(t[o],u,"| "),i+=u,i+=c(t[o],u," |"),d[1]&&(i+=" ".repeat(d[1])),0===s&&e.length>0&&(i=this.renderInline(i,e[e.length-1]))})),e.push({text:i.replace(/ +$/,""),span:t.span})})),e}renderInline(t,e){const n=t.match(/^ */),s=n?n[0].length:0,i=e.text,r=l.stringWidth(i.trimRight());return e.span?this.wrap?s<r?t:(e.hidden=!0,i.trimRight()+" ".repeat(s-r)+t.trimLeft()):(e.hidden=!0,i+t):t}rasterize(t){const e=[],n=this.columnWidths(t);let s;return t.forEach(((t,i)=>{t.width=n[i],s=this.wrap?l.wrap(t.text,this.negatePadding(t),{hard:!0}).split("\n"):t.text.split("\n"),t.border&&(s.unshift("."+"-".repeat(this.negatePadding(t)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(t)+2)+"'")),t.padding&&(s.unshift(...new Array(t.padding[0]||0).fill("")),s.push(...new Array(t.padding[2]||0).fill(""))),s.forEach(((t,n)=>{e[n]||e.push([]);const s=e[n];for(let t=0;t<i;t++)void 0===s[t]&&s.push("");s.push(t)}))})),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[3]||0)+(t.padding[1]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map((t=>t.width||l.stringWidth(t.text)));let e=t.length,n=this.width;const s=t.map((t=>{if(t.width)return e--,n-=t.width,t.width})),i=e?Math.floor(n/e):0;return s.map(((e,n)=>void 0===e?Math.max(i,function(t){const e=t.padding||[],n=1+(e[3]||0)+(e[1]||0);if(t.border)return n+4;return n}(t[n])):e))}}function c(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":0!==e.trim().length?n:" ":""}let l;const h=new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function u(t){return t.replace(h,"")}function d(t,e){const[n,s]=t.match(h)||["",""];t=u(t);let i="";for(let n=0;n<t.length;n++)0!==n&&n%e==0&&(i+="\n"),i+=t.charAt(n);return n&&s&&(i=`${n}${i}${s}`),i}var f=a(6928);var p=a(9023);const m=t(import.meta.url)("url");function g(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),-1===t.indexOf("-")&&-1===t.indexOf("_"))return t;{let e="",n=!1;const s=t.match(/^-+/);for(let i=s?s[0].length:0;i<t.length;i++){let s=t.charAt(i);n&&(n=!1,s=s.toUpperCase()),0===i||"-"!==s&&"_"!==s?"-"!==s&&"_"!==s&&(e+=s):n=!0}return e}}function y(t,e){const n=t.toLowerCase();e=e||"-";let s="";for(let i=0;i<t.length;i++){const r=n.charAt(i),o=t.charAt(i);s+=r!==o&&i>0?`${e}${n.charAt(i)}`:o}return s}function b(t){return null!=t&&("number"==typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||!/^0[^.]/.test(t)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)))}var v;let w;!function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"}(v||(v={}));function O(t){return void 0!==t?t+1:1}function x(t){return"__proto__"===t?"___proto___":t}var E,j,S;const C=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,k=null!==(j=null===(E=null===process||void 0===process?void 0:process.versions)||void 0===E?void 0:E.node)&&void 0!==j?j:null===(S=null===process||void 0===process?void 0:process.version)||void 0===S?void 0:S.slice(1);if(k){if(Number(k.match(/^([^.]+)/)[1])<C)throw Error(`yargs parser supports a minimum Node.js version of ${C}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const A=process?process.env:{},_=new class{constructor(t){w=t}parse(t,e){const n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},e),s=function(t){if(Array.isArray(t))return t.map((t=>"string"!=typeof t?t+"":t));t=t.trim();let e=0,n=null,s=null,i=null;const r=[];for(let o=0;o<t.length;o++)n=s,s=t.charAt(o)," "!==s||i?(s===i?i=null:"'"!==s&&'"'!==s||i||(i=s),r[e]||(r[e]=""),r[e]+=s):" "!==n&&e++;return r}(t),i="string"==typeof t,r=function(t){const e=[],n=Object.create(null);let s=!0;Object.keys(t).forEach((function(n){e.push([].concat(t[n],n))}));for(;s;){s=!1;for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){if(e[t].filter((function(t){return-1!==e[n].indexOf(t)})).length){e[t]=e[t].concat(e[n]),e.splice(n,1),s=!0;break}}}return e.forEach((function(t){const e=(t=t.filter((function(t,e,n){return n.indexOf(t)===e}))).pop();void 0!==e&&"string"==typeof e&&(n[e]=t)})),n}(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,h=o["populate--"],u=h?"--":"_",d=Object.create(null),f=Object.create(null),p=n.__||w.format,m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,j=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(t){const e="object"==typeof t?t.key:t,n=Object.keys(t).map((function(t){return{boolean:"bools",string:"strings",number:"numbers"}[t]})).filter(Boolean).pop();n&&(m[n][e]=!0),m.arrays[e]=!0,m.keys.push(e)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(t){m.bools[t]=!0,m.keys.push(t)})),[].concat(n.string||[]).filter(Boolean).forEach((function(t){m.strings[t]=!0,m.keys.push(t)})),[].concat(n.number||[]).filter(Boolean).forEach((function(t){m.numbers[t]=!0,m.keys.push(t)})),[].concat(n.count||[]).filter(Boolean).forEach((function(t){m.counts[t]=!0,m.keys.push(t)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(t){m.normalize[t]=!0,m.keys.push(t)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([t,e])=>{"number"==typeof e&&(m.nargs[t]=e,m.keys.push(t))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([t,e])=>{"function"==typeof e&&(m.coercions[t]=e,m.keys.push(t))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(t){m.configs[t]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([t,e])=>{"boolean"!=typeof e&&"function"!=typeof e||(m.configs[t]=e)}))),function(...t){t.forEach((function(t){Object.keys(t||{}).forEach((function(t){m.aliases[t]||(m.aliases[t]=[].concat(r[t]||[]),m.aliases[t].concat(t).forEach((function(e){if(/-/.test(e)&&o["camel-case-expansion"]){const n=g(e);n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].concat(t).forEach((function(e){if(e.length>1&&/[A-Z]/.test(e)&&o["camel-case-expansion"]){const n=y(e,"-");n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].forEach((function(e){m.aliases[e]=[t].concat(m.aliases[t].filter((function(t){return e!==t})))})))}))}))}(n.key,r,n.default,m.arrays),Object.keys(a).forEach((function(t){(m.aliases[t]||[]).forEach((function(e){a[e]=a[t]}))}));let S=null;Object.keys(m.counts).find((t=>U(t,m.arrays)?(S=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",t)),!0):!!U(t,m.nargs)&&(S=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",t)),!0)));let C=[];const k=Object.assign(Object.create(null),{_:[]}),A={};for(let t=0;t<s.length;t++){const e=s[t],n=e.replace(/^-{3,}/,"---");let i,r,a,c,l,h;if("--"!==e&&/^-/.test(e)&&B(e))_(e);else{if(n.match(/^---+(=|$)/)){_(e);continue}if(e.match(/^--.+=/)||!o["short-option-groups"]&&e.match(/^-.+=/))c=e.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(U(c[1],m.arrays)?t=$(t,c[1],s,c[2]):!1!==U(c[1],m.nargs)?t=P(t,c[1],s,c[2]):I(c[1],c[2],!0));else if(e.match(j)&&o["boolean-negation"])c=e.match(j),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],I(r,!!U(r,m.arrays)&&[!1]));else if(e.match(/^--.+/)||!o["short-option-groups"]&&e.match(/^-[^-]+/))c=e.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],U(r,m.arrays)?t=$(t,r,s):!1!==U(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||l.match(/^-/)&&!l.match(E)||U(r,m.bools)||U(r,m.counts)?/^(true|false)$/.test(l)?(I(r,l),t++):I(r,z(r)):(I(r,l),t++)));else if(e.match(/^-.\..+=/))c=e.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&I(c[1],c[2]);else if(e.match(/^-.\..+/)&&!e.match(E))l=s[t+1],c=e.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],void 0===l||l.match(/^-/)||U(r,m.bools)||U(r,m.counts)?I(r,z(r)):(I(r,l),t++));else if(e.match(/^-[^-]+/)&&!e.match(E)){a=e.slice(1,-1).split(""),i=!1;for(let n=0;n<a.length;n++){if(l=e.slice(n+2),a[n+1]&&"="===a[n+1]){h=e.slice(n+3),r=a[n],U(r,m.arrays)?t=$(t,r,s,h):!1!==U(r,m.nargs)?t=P(t,r,s,h):I(r,h),i=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===U(l,m.bools)){I(a[n],l),i=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){I(a[n],l),i=!0;break}I(a[n],z(a[n]))}else I(a[n],l)}r=e.slice(-1)[0],i||"-"===r||(U(r,m.arrays)?t=$(t,r,s):!1!==U(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(E)||U(r,m.bools)||U(r,m.counts)?/^(true|false)$/.test(l)?(I(r,l),t++):I(r,z(r)):(I(r,l),t++)))}else if(e.match(/^-[0-9]$/)&&e.match(E)&&U(e.slice(1),m.bools))r=e.slice(1),I(r,z(r));else{if("--"===e){C=s.slice(t+1);break}if(o["halt-at-non-option"]){C=s.slice(t);break}_(e)}}}function _(t){const e=L("_",t);"string"!=typeof e&&"number"!=typeof e||k._.push(e)}function P(t,e,n,s){let i,r=U(e,m.nargs);if(r="number"!=typeof r||isNaN(r)?1:r,0===r)return H(s)||(S=Error(p("Argument unexpected for: %s",e))),I(e,z(e)),t;let a=H(s)?0:1;if(o["nargs-eats-options"])n.length-(t+1)+a<r&&(S=Error(p("Not enough arguments following: %s",e))),a=r;else{for(i=t+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(E)||B(n[i]));i++)a++;a<r&&(S=Error(p("Not enough arguments following: %s",e)))}let c=Math.min(a,r);for(!H(s)&&c>0&&(I(e,s),c--),i=t+1;i<c+t+1;i++)I(e,n[i]);return t+c}function $(t,e,n,s){let r=[],c=s||n[t+1];const l=U(e,m.nargs);if(U(e,m.bools)&&!/^(true|false)$/.test(c))r.push(!0);else if(H(c)||H(s)&&/^-/.test(c)&&!E.test(c)&&!B(c)){if(void 0!==a[e]){const t=a[e];r=Array.isArray(t)?t:[t]}}else{H(s)||r.push(T(e,s,!0));for(let s=t+1;s<n.length&&!(!o["greedy-arrays"]&&r.length>0||l&&"number"==typeof l&&r.length>=l)&&(c=n[s],!/^-/.test(c)||E.test(c)||B(c));s++)t=s,r.push(T(e,c,i))}return"number"==typeof l&&(l&&r.length<l||isNaN(l)&&0===r.length)&&(S=Error(p("Not enough arguments following: %s",e))),I(e,r),t}function I(t,e,n=i){if(/-/.test(t)&&o["camel-case-expansion"]){const e=t.split(".").map((function(t){return g(t)})).join(".");M(t,e)}const s=T(t,e,n),r=t.split(".");if(R(k,r,s),m.aliases[t]&&m.aliases[t].forEach((function(t){const e=t.split(".");R(k,e,s)})),r.length>1&&o["dot-notation"]&&(m.aliases[r[0]]||[]).forEach((function(e){let n=e.split(".");const i=[].concat(r);i.shift(),n=n.concat(i),(m.aliases[t]||[]).includes(n.join("."))||R(k,n,s)})),U(t,m.normalize)&&!U(t,m.arrays)){[t].concat(m.aliases[t]||[]).forEach((function(t){Object.defineProperty(A,t,{enumerable:!0,get:()=>e,set(t){e="string"==typeof t?w.normalize(t):t}})}))}}function M(t,e){m.aliases[t]&&m.aliases[t].length||(m.aliases[t]=[e],d[e]=!0),m.aliases[e]&&m.aliases[e].length||M(e,t)}function T(t,e,n){n&&(e=function(t){return"string"!=typeof t||"'"!==t[0]&&'"'!==t[0]||t[t.length-1]!==t[0]?t:t.substring(1,t.length-1)}(e)),(U(t,m.bools)||U(t,m.counts))&&"string"==typeof e&&(e="true"===e);let s=Array.isArray(e)?e.map((function(e){return L(t,e)})):L(t,e);return U(t,m.counts)&&(H(s)||"boolean"==typeof s)&&(s=O()),U(t,m.normalize)&&U(t,m.arrays)&&(s=Array.isArray(e)?e.map((t=>w.normalize(t))):w.normalize(e)),s}function L(t,e){if(!o["parse-positional-numbers"]&&"_"===t)return e;if(!U(t,m.strings)&&!U(t,m.bools)&&!Array.isArray(e)){(b(e)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${e}`)))||!H(e)&&U(t,m.numbers))&&(e=Number(e))}return e}function N(t,e){Object.keys(t).forEach((function(n){const s=t[n],i=e?e+"."+n:n;"object"==typeof s&&null!==s&&!Array.isArray(s)&&o["dot-notation"]?N(s,i):(!G(k,i.split("."))||U(i,m.arrays)&&o["combine-arrays"])&&I(i,s)}))}function F(t,e){if(void 0===l)return;const n="string"==typeof l?l:"",s=w.env();Object.keys(s).forEach((function(i){if(""===n||0===i.lastIndexOf(n,0)){const r=i.split("__").map((function(t,e){return 0===e&&(t=t.substring(n.length)),g(t)}));(e&&m.configs[r.join(".")]||!e)&&!G(t,r)&&I(r.join("."),s[i])}}))}function D(t,e,n,s=!1){Object.keys(n).forEach((function(i){G(t,i.split("."))||(R(t,i.split("."),n[i]),s&&(f[i]=!0),(e[i]||[]).forEach((function(e){G(t,e.split("."))||R(t,e.split("."),n[i])})))}))}function G(t,e){let n=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){n=n[t]||{}}));const s=e[e.length-1];return"object"==typeof n&&s in n}function R(t,e,n){let s=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){t=x(t),"object"==typeof s&&void 0===s[t]&&(s[t]={}),"object"!=typeof s[t]||Array.isArray(s[t])?(Array.isArray(s[t])?s[t].push({}):s[t]=[s[t],{}],s=s[t][s[t].length-1]):s=s[t]}));const i=x(e[e.length-1]),r=U(e.join("."),m.arrays),a=Array.isArray(n);let c=o["duplicate-arguments-array"];!c&&U(i,m.nargs)&&(c=!0,(!H(s[i])&&1===m.nargs[i]||Array.isArray(s[i])&&s[i].length===m.nargs[i])&&(s[i]=void 0)),n===O()?s[i]=O(s[i]):Array.isArray(s[i])?c&&r&&a?s[i]=o["flatten-duplicate-arrays"]?s[i].concat(n):(Array.isArray(s[i][0])?s[i]:[s[i]]).concat([n]):c||Boolean(r)!==Boolean(a)?s[i]=s[i].concat([n]):s[i]=n:void 0===s[i]&&r?s[i]=a?n:[n]:!c||void 0===s[i]||U(i,m.counts)||U(i,m.bools)?s[i]=n:s[i]=[s[i],n]}function U(t,e){const n=[].concat(m.aliases[t]||[],t),s=Object.keys(e),i=n.find((t=>s.includes(t)));return!!i&&e[i]}function W(t){const e=Object.keys(m);return[].concat(e.map((t=>m[t]))).some((function(e){return Array.isArray(e)?e.includes(t):e[t]}))}function B(t){return o["unknown-options-as-args"]&&function(t){if(t=t.replace(/^-{3,}/,"--"),t.match(E))return!1;if(function(t){if(t.match(E)||!t.match(/^-[^-]+/))return!1;let e,n=!0;const s=t.slice(1).split("");for(let i=0;i<s.length;i++){if(e=t.slice(i+2),!W(s[i])){n=!1;break}if(s[i+1]&&"="===s[i+1]||"-"===e||/[A-Za-z]/.test(s[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(e)||s[i+1]&&s[i+1].match(/\W/))break}return n}(t))return!1;return!function(t,...e){return[].concat(...e).some((function(e){const n=t.match(e);return n&&W(n[1])}))}(t,/^-+([^=]+?)=[\s\S]*$/,j,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(t)}function z(t){return U(t,m.bools)||U(t,m.counts)||!(`${t}`in a)?(e=function(t){let e=v.BOOLEAN;return U(t,m.strings)?e=v.STRING:U(t,m.numbers)?e=v.NUMBER:U(t,m.bools)?e=v.BOOLEAN:U(t,m.arrays)&&(e=v.ARRAY),e}(t),{[v.BOOLEAN]:!0,[v.STRING]:"",[v.NUMBER]:void 0,[v.ARRAY]:[]}[e]):a[t];var e}function H(t){return void 0===t}return F(k,!0),F(k,!1),function(t){const e=Object.create(null);D(e,m.aliases,a),Object.keys(m.configs).forEach((function(n){const s=t[n]||e[n];if(s)try{let t=null;const e=w.resolve(w.cwd(),s),i=m.configs[n];if("function"==typeof i){try{t=i(e)}catch(e){t=e}if(t instanceof Error)return void(S=t)}else t=w.require(e);N(t)}catch(e){"PermissionDenied"===e.name?S=e:t[n]&&(S=Error(p("Invalid JSON config file: %s",s)))}}))}(k),void 0!==c&&c.forEach((function(t){N(t)})),D(k,m.aliases,a,!0),function(t){let e;const n=new Set;Object.keys(t).forEach((function(s){if(!n.has(s)&&(e=U(s,m.coercions),"function"==typeof e))try{const i=L(s,e(t[s]));[].concat(m.aliases[s]||[],s).forEach((e=>{n.add(e),t[e]=i}))}catch(t){S=t}}))}(k),o["set-placeholder-key"]&&function(t){m.keys.forEach((e=>{~e.indexOf(".")||void 0===t[e]&&(t[e]=void 0)}))}(k),Object.keys(m.counts).forEach((function(t){G(k,t.split("."))||I(t,0)})),h&&C.length&&(k[u]=[]),C.forEach((function(t){k[u].push(t)})),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(k).filter((t=>"--"!==t&&t.includes("-"))).forEach((t=>{delete k[t]})),o["strip-aliased"]&&[].concat(...Object.keys(r).map((t=>r[t]))).forEach((t=>{o["camel-case-expansion"]&&t.includes("-")&&delete k[t.split(".").map((t=>g(t))).join(".")],delete k[t]})),{aliases:Object.assign({},m.aliases),argv:Object.assign(A,k),configuration:o,defaulted:Object.assign({},f),error:S,newAliases:Object.assign({},d)}}}({cwd:process.cwd,env:()=>A,format:p.format,normalize:f.normalize,resolve:f.resolve,require:t=>{if("undefined"!=typeof require)return require(t);if(t.match(/\.json$/))return JSON.parse((0,s.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),P=function(t,e){return _.parse(t.slice(),e).argv};P.detailed=function(t,e){return _.parse(t.slice(),e)},P.camelCase=g,P.decamelize=y,P.looksLikeNumber=b;const $=P;function I(){return process.versions.electron&&!process.defaultApp?0:1}class M extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,M)}}const T={fs:{readFileSync:s.readFileSync,writeFile:s.writeFile},format:p.format,resolve:f.resolve,exists:t=>{try{return(0,s.statSync)(t).isFile()}catch(t){return!1}}};let L;class N{constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles="boolean"!=typeof t.updateFiles||t.updateFiles,this.locale=t.locale||"en",this.fallbackToLanguage="boolean"!=typeof t.fallbackToLanguage||t.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return"function"==typeof t[t.length-1]&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),L.format.apply(L.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};"function"==typeof t[t.length-1]&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=1===s?e:n;if(this.cache[this.locale][e]){r=this.cache[this.locale][e][1===s?"one":"other"]}!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const o=[r];return~r.indexOf("%d")&&o.push(s),L.format.apply(L.format,o.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach((function(t,s){const i=e[s+1];n+=t,void 0!==i&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),o=JSON.stringify(this.cache[s],null,2);L.fs.writeFile(r,o,"utf-8",(function(e){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(e)}))}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{L.fs.readFileSync&&(t=JSON.parse(L.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),"ENOENT"!==n.code)throw n;t={}}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=L.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=L.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return L.exists(t)}}const F=t=>function(t,e){L=e;const n=new N(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}(t,T),D="loading a directory of commands is not supported yet for ESM";let G;try{G=(0,m.fileURLToPath)(import.meta.url)}catch(t){G=process.cwd()}const R=G.substring(0,G.lastIndexOf("node_modules")),U={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:function(t){return function(t,e){return l=e,new o({width:(null==t?void 0:t.width)||("object"==typeof process&&process.stdout&&process.stdout.columns?process.stdout.columns:80),wrap:null==t?void 0:t.wrap})}(t,{stringWidth:t=>[...t].length,stripAnsi:u,wrap:d})},findUp:function(t,e){let n,i=(0,f.resolve)(".",t);for((0,s.statSync)(i).isDirectory()||(i=(0,f.dirname)(i));;){if(n=e(i,(0,s.readdirSync)(i)),n)return(0,f.resolve)(i,n);if(i=(0,f.dirname)(n=i),n===i)break}},getEnv:t=>process.env[t],inspect:p.inspect,getCallerFile:()=>{throw new M(D)},getProcessArgvBin:function(){return process.argv[I()]},mainFilename:R||process.cwd(),Parser:$,path:{basename:f.basename,dirname:f.dirname,extname:f.extname,relative:f.relative,resolve:f.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:s.readFileSync,require:()=>{throw new M("require is not supported by ESM")},requireDirectory:()=>{throw new M(D)},stringWidth:t=>[...t].length,y18n:F({directory:(0,f.resolve)(G,"../../../locales"),updateFiles:!1})};function W(t,e,n,s){n.assert.notStrictEqual(t,e,s)}function B(t,e){e.assert.strictEqual(typeof t,"string")}function z(t){return Object.keys(t)}function H(t){return!!t&&!!t.then&&"function"==typeof t.then}function q(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${t}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach(((t,s)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&s===e.length-1&&(r=!0),/^\[/.test(t)?i.optional.push({cmd:t.replace(n,"").split("|"),variadic:r}):i.demanded.push({cmd:t.replace(n,"").split("|"),variadic:r})})),i}const V=["first","second","third","fourth","fifth","sixth"];function K(t,e,n){try{let s=0;const[i,r,o]="object"==typeof t?[{demanded:[],optional:[]},t,e]:[q(`cmd ${t}`),e,n],a=[].slice.call(r);for(;a.length&&void 0===a[a.length-1];)a.pop();const c=o||a.length;if(c<i.demanded.length)throw new M(`Not enough arguments provided. Expected ${i.demanded.length} but received ${a.length}.`);const l=i.demanded.length+i.optional.length;if(c>l)throw new M(`Too many arguments provided. Expected max ${l} but received ${c}.`);i.demanded.forEach((t=>{const e=Y(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&J(e,t.cmd,s),s+=1})),i.optional.forEach((t=>{if(0===a.length)return;const e=Y(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&J(e,t.cmd,s),s+=1}))}catch(t){console.warn(t.stack)}}function Y(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function J(t,e,n){throw new M(`Invalid ${V[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class Q{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(K("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if("function"!=typeof t[s])throw Error("middleware must be a function");const i=t[s];i.applyBeforeValidation=e,i.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const s=[...n[e]||[],e];return!t.option||!s.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function X(t,e,n,s){return n.reduce(((t,n)=>{if(n.applyBeforeValidation!==s)return t;if(n.mutates){if(n.applied)return t;n.applied=!0}if(H(t))return t.then((t=>Promise.all([t,n(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const s=n(t,e);return H(s)?s.then((e=>Object.assign(t,e))):Object.assign(t,s)}}),t)}function Z(t,e,n=(t=>{throw t})){try{const n="function"==typeof t?t():t;return H(n)?n.then((t=>e(t))):e(n)}catch(t){return n(t)}}const tt=/(^\*)|(^\$0)/;class et{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){"boolean"!=typeof(s=s||{}).recurse&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i="function"==typeof s.visit?s.visit:t=>t;s.visit=(t,e,n)=>{const s=i(t,e,n);if(s){if(this.requireCache.has(e))return s;this.requireCache.add(e),this.addHandler(s)}return s},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let o=[];const a=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(i);if(s=s||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...o]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(nt(n))return void this.addHandler([t].concat(o),e,n.builder,n.handler,n.middlewares,n.deprecated)}if("string"==typeof t){const i=q(t);o=o.map((t=>q(t).cmd));let c=!1;const l=[i.cmd].concat(o).filter((t=>!tt.test(t)||(c=!0,!1)));0===l.length&&c&&l.push("$0"),c&&(i.cmd=l[0],o=l.slice(1),t=t.replace(tt,i.cmd)),o.forEach((t=>{this.aliasMap[t]=i.cmd})),!1!==e&&this.usage.command(t,e,c,o,r),this.handlers[i.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:a,deprecated:r,demanded:i.demanded,optional:i.optional},c&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),c=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const h=this.applyBuilderUpdateUsageAndParse(l,o,e,n.aliases,c,s,i,r);return H(h)?h.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,i,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,h.innerArgv,a,i,h.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,o,a){const c=e.builder;let l=n;if(st(c)){n.getInternalMethods().getUsageInstance().freeze();const h=c(n.getInternalMethods().reset(s),a);if(H(h))return h.then((s=>{var a;return l=(a=s)&&"function"==typeof a.getInternalMethods?s:n,this.parseAndUpdateUsage(t,e,l,i,r,o)}))}else(function(t){return"object"==typeof t})(c)&&(n.getInternalMethods().getUsageInstance().freeze(),l=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach((t=>{l.option(t,c[t])})));return this.parseAndUpdateUsage(t,e,l,i,r,o)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return H(o)?o.then((t=>({aliases:n.parsed.aliases,innerArgv:t}))):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const n=tt.test(e.original)?e.original.replace(tt,"").trim():e.original,s=t.filter((t=>!tt.test(t)));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(i,a,r.parsed.error,t);n=Z(n,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const s=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,s,!1,!1),n=Z(n=X(n,r,o,!1),(t=>{const n=e.handler(t);return H(n)?n.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),H(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,o){let a={};if(i)return n;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,n,s,o));const c=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=X(n,o,c,!0);return H(l)?l.then((n=>this.handleValidationAndGetResult(t,e,n,s,r,o,c,a))):this.handleValidationAndGetResult(t,e,l,s,r,o,c,a)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const t=i.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=n.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),s),o}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=q(t);return n.demanded.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s,e.demand[n]=!0})),n.optional.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s})),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const t of Object.keys(n.alias))i.alias[t]=(i.alias[t]||[]).concat(n.alias[t]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{i.configuration["unknown-options-as-args"]&&(i.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(a.error)s.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const n=Object.keys(e);Object.keys(e).forEach((t=>{n.push(...a.aliases[t])})),Object.keys(a.argv).forEach((i=>{n.includes(i)&&(e[i]||(e[i]=a.argv[i]),!this.isInConfigs(s,i)&&!this.isDefaulted(s,i)&&Object.prototype.hasOwnProperty.call(t,i)&&Object.prototype.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||n.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=tt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(st(e))return e(t,!0);nt(e)||Object.keys(e).forEach((n=>{t.option(n,e[n])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,n=0,s=Object.keys(require.cache);n<s.length;n++)if(e=require.cache[s[n]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if("string"==typeof s||!1===s)return s;W(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();W(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function nt(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function st(t){return"function"==typeof t}function it(t={},e=(()=>!0)){const n={};return z(t).forEach((s=>{e(s,t[s])&&(n[s]=t[s])})),n}function rt(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const n=e;n._handle&&n.isTTY&&"function"==typeof n._handle.setBlocking&&n._handle.setBlocking(t)}))}function ot(t){return"boolean"==typeof t}function at(t,e){const n=e.y18n.__,s={},i=[];s.failFn=function(t){i.push(t)};let r=null,o=null,a=!0;s.showHelpOnFail=function(e=!0,n){const[i,c]="string"==typeof e?[!0,e]:[e,n];return t.getInternalMethods().isGlobalContext()&&(o=c),r=c,a=i,s};let c=!1;s.fail=function(e,n){const l=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&rt(!0),!c){c=!0,a&&(t.showHelp("error"),l.error()),(e||n)&&l.error(e||n);const s=r||o;s&&((e||n)&&l.error(""),l.error(s))}if(n=n||new M(e),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,n);throw n}for(let t=i.length-1;t>=0;--t){const r=i[t];if(ot(r)){if(n)throw n;if(e)throw Error(e)}else r(e,n,s)}};let l=[],h=!1;s.usage=(t,e)=>null===t?(h=!0,l=[],s):(h=!1,l.push([t,e||""]),s),s.getUsage=()=>l,s.getUsageDisabled=()=>h,s.getPositionalGroupName=()=>n("Positionals:");let u=[];s.example=(t,e)=>{u.push([t,e||""])};let d=[];s.command=function(t,e,n,s,i=!1){n&&(d=d.map((t=>(t[2]=!1,t)))),d.push([t,e||"",n,s,i])},s.getCommands=()=>d;let f={};s.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{s.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{s.describe(e,t[e])})):f[t]=e},s.getDescriptions=()=>f;let p=[];s.epilog=t=>{p.push(t)};let m,g=!1;s.wrap=t=>{g=!0,m=t},s.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(g||(m=function(){const t=80;return e.process.stdColumns?Math.min(t,e.process.stdColumns):t}(),g=!0),m);const y="__yargsString__:";function b(t,n,s){let i=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{i=Math.max(e.stringWidth(s?`${s} ${ht(t[0])}`:ht(t[0]))+lt(t[0]),i)})),n&&(i=Math.min(i,parseInt((.5*n).toString(),10))),i}let v;function w(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function O(t,e){let s=`[${n("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}s.deferY18nLookup=t=>y+t,s.help=function(){if(v)return v;!function(){const e=t.getDemandedOptions(),n=t.getOptions();(Object.keys(n.alias)||[]).forEach((i=>{n.alias[i].forEach((r=>{f[r]&&s.describe(i,f[r]),r in e&&t.demandOption(i,e[r]),n.boolean.includes(r)&&t.boolean(i),n.count.includes(r)&&t.count(i),n.string.includes(r)&&t.string(i),n.normalize.includes(r)&&t.normalize(i),n.array.includes(r)&&t.array(i),n.number.includes(r)&&t.number(i)}))}))}();const i=t.customScriptName?t.$0:e.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),c=t.getGroups(),m=t.getOptions();let g=[];g=g.concat(Object.keys(f)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(m.default)),g=g.filter(w),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const x=s.getWrap(),E=e.cliui({width:x,wrap:!!x});if(!h)if(l.length)l.forEach((t=>{E.div({text:`${t[0].replace(/\$0/g,i)}`}),t[1]&&E.div({text:`${t[1]}`,padding:[1,0,0,0]})})),E.div();else if(d.length){let t=null;t=o._?`${i} <${n("command")}>\n`:`${i} [${n("command")}]\n`,E.div(`${t}`)}if(d.length>1||1===d.length&&!d[0][2]){E.div(n("Commands:"));const e=t.getInternalMethods().getContext(),s=e.commands.length?`${e.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(d=d.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=i?`${i} `:"";d.forEach((t=>{const e=`${r}${s}${t[0].replace(/^\$0 ?/,"")}`;E.span({text:e,padding:[0,2,0,2],width:b(d,x,`${i}${s}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${n("default")}]`),t[3]&&t[3].length&&o.push(`[${n("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${n("deprecated: %s",t[4])}]`):o.push(`[${n("deprecated")}]`)),o.length?E.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):E.div()})),E.div()}const j=(Object.keys(m.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&j.every((t=>-1===(m.alias[t]||[]).indexOf(e)))));const S=n("Options:");c[S]||(c[S]=[]),function(t,e,n,s){let i=[],r=null;Object.keys(n).forEach((t=>{i=i.concat(n[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==i.indexOf(t)))||n[s].push(t)}))}(g,m.alias,c,S);const C=t=>/^--/.test(ht(t)),k=Object.keys(c).filter((t=>c[t].length>0)).map((t=>({groupName:t,normalizedKeys:c[t].filter(w).map((t=>{if(j.includes(t))return t;for(let e,n=0;void 0!==(e=j[n]);n++)if((m.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const n=e.reduce(((e,n)=>(e[n]=[n].concat(m.alias[n]||[]).map((e=>t===s.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?m.boolean.includes(n)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>C(t)===C(e)?0:C(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:n}}));if(k.filter((({groupName:t})=>t!==s.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>C(e[t])))))&&k.filter((({groupName:t})=>t!==s.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var n,s;C(e[t])&&(e[t]=(n=e[t],s=4,ct(n)?{text:n.text,indentation:n.indentation+s}:{text:n,indentation:s}))}))})),k.forEach((({groupName:e,normalizedKeys:i,switches:o})=>{E.div(e),i.forEach((e=>{const i=o[e];let c=f[e]||"",l=null;c.includes(y)&&(c=n(c.substring(16))),m.boolean.includes(e)&&(l=`[${n("boolean")}]`),m.count.includes(e)&&(l=`[${n("count")}]`),m.string.includes(e)&&(l=`[${n("string")}]`),m.normalize.includes(e)&&(l=`[${n("string")}]`),m.array.includes(e)&&(l=`[${n("array")}]`),m.number.includes(e)&&(l=`[${n("number")}]`);const h=[e in a?(u=a[e],"string"==typeof u?`[${n("deprecated: %s",u)}]`:`[${n("deprecated")}]`):null,l,e in r?`[${n("required")}]`:null,m.choices&&m.choices[e]?`[${n("choices:")} ${s.stringifiedValues(m.choices[e])}]`:null,O(m.default[e],m.defaultDescription[e])].filter(Boolean).join(" ");var u;E.span({text:ht(i),padding:[0,2,0,2+lt(i)],width:b(o,x)+4},c);const d=!0===t.getInternalMethods().getUsageConfiguration()["hide-types"];h&&!d?E.div({text:h,padding:[0,0,0,2],align:"right"}):E.div()})),E.div()})),u.length&&(E.div(n("Examples:")),u.forEach((t=>{t[0]=t[0].replace(/\$0/g,i)})),u.forEach((t=>{""===t[1]?E.div({text:t[0],padding:[0,2,0,2]}):E.div({text:t[0],padding:[0,2,0,2],width:b(u,x)+4},{text:t[1]})})),E.div()),p.length>0){const t=p.map((t=>t.replace(/\$0/g,i))).join("\n");E.div(`${t}\n`)}return E.toString().replace(/\s*$/,"")},s.cacheHelpMessage=function(){v=this.help()},s.clearCachedHelpMessage=function(){v=void 0},s.hasCachedHelpMessage=function(){return!!v},s.showHelp=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(s.help())},s.functionDescription=t=>["(",t.name?e.Parser.decamelize(t.name,"-"):n("generated-value"),")"].join(""),s.stringifiedValues=function(t,e){let n="";const s=e||", ",i=[].concat(t);return t&&i.length?(i.forEach((t=>{n.length&&(n+=s),n+=JSON.stringify(t)})),n):n};let x=null;s.version=t=>{x=t},s.showVersion=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(x)},s.reset=function(t){return r=null,c=!1,l=[],h=!1,p=[],u=[],d=[],f=it(f,(e=>!t[e])),s};const E=[];return s.freeze=function(){E.push({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f})},s.unfreeze=function(t=!1){const e=E.pop();e&&(t?(f={...e.descriptions,...f},d=[...e.commands,...d],l=[...e.usages,...l],u=[...e.examples,...u],p=[...e.epilogs,...p]):({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f}=e))},s}function ct(t){return"object"==typeof t}function lt(t){return ct(t)?t.indentation:0}function ht(t){return ct(t)?t.text:t}class ut{constructor(t,e,n,s){var i,r,o;this.yargs=t,this.usage=e,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(i=this.shim.getEnv("SHELL"))||void 0===i?void 0:i.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,n,s){const i=this.command.getCommandHandlers();for(let e=0,n=t.length;e<n;++e)if(i[t[e]]&&i[t[e]].builder){const n=i[t[e]].builder;if(st(n)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return n(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,n),this.optionCompletions(r,t,e,n),this.choicesFromOptionsCompletions(r,t,e,n),this.choicesFromPositionalsCompletions(r,t,e,n),s(null,r)}commandCompletions(t,e,n){const s=this.yargs.getInternalMethods().getContext().commands;n.match(/^-/)||s[s.length-1]===n||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((n=>{const s=q(n[0]).cmd;if(-1===e.indexOf(s))if(this.zshShell){const e=n[1]||"";t.push(s.replace(/:/g,"\\:")+":"+e)}else t.push(s)}))}optionCompletions(t,e,n,s){if((s.match(/^-/)||""===s&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((r=>{const o=!!n.configuration["boolean-negation"]&&n.boolean.includes(r);i.includes(r)||n.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||this.completeOptionKey(r,t,s,o&&!!n.default[r])}))}}choicesFromOptionsCompletions(t,e,n,s){if(this.previousArgHasChoices(e)){const n=this.getPreviousArgChoices(e);n&&n.length>0&&t.push(...n.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,n,s){if(""===s&&t.length>0&&this.previousArgHasChoices(e))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(s)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;const s=e.replace(/^-+/,""),i=this.yargs.getOptions(),r=[s,...this.yargs.getAliases()[s]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(i.key,t)&&Array.isArray(i.choices[t])){o=i.choices[t];break}return o?o.filter((t=>!n||t.startsWith(n))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,n){const s=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(s(e))return!0;if(n&&s(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(s(t))return!0;return!1}completeOptionKey(t,e,n,s){var i,r,o,a;let c=t;if(this.zshShell){const e=this.usage.getDescriptions(),n=null===(r=null===(i=null==this?void 0:this.aliases)||void 0===i?void 0:i[t])||void 0===r?void 0:r.find((t=>{const n=e[t];return"string"==typeof n&&n.length>0})),s=n?e[n]:void 0,l=null!==(a=null!==(o=e[t])&&void 0!==o?o:s)&&void 0!==a?a:"";c=`${t.replace(/:/g,"\\:")}:${l.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const l=!/^--/.test(n)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";e.push(l+c),s&&e.push(l+"no-"+c)}customCompletion(t,e,n,s){if(W(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(n,e);return H(t)?t.then((t=>{this.shim.process.nextTick((()=>{s(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{s(t,void 0)}))})):s(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(n,e,((i=s)=>this.defaultCompletion(t,e,n,i)),(t=>{s(null,t)})):this.customCompletionFunction(n,e,(t=>{s(null,t)}))}getCompletion(t,e){const n=t.length?t[t.length-1]:"",s=this.yargs.parse(t,!0),i=this.customCompletionFunction?s=>this.customCompletion(t,s,n,e):s=>this.defaultCompletion(t,s,n,e);return H(s)?s.then(i):i(s)}generateCompletionScript(t,e){let n=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const s=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function dt(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const n=[];let s,i;for(s=0;s<=e.length;s++)n[s]=[s];for(i=0;i<=t.length;i++)n[0][i]=i;for(s=1;s<=e.length;s++)for(i=1;i<=t.length;i++)e.charAt(s-1)===t.charAt(i-1)?n[s][i]=n[s-1][i-1]:s>1&&i>1&&e.charAt(s-2)===t.charAt(i-1)&&e.charAt(s-1)===t.charAt(i-2)?n[s][i]=n[s-2][i-2]+1:n[s][i]=Math.min(n[s-1][i-1]+1,Math.min(n[s][i-1]+1,n[s-1][i]+1));return n[e.length][t.length]}const ft=["$0","--","_"];let pt,mt=[];function gt(t,e,n,s){pt=s;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return i;const s=/\.json|\..*rc$/.test(t.extends);let r=null;if(s)r=function(t,e){return pt.path.resolve(t,e)}(e,t.extends);else try{r=require.resolve(t.extends)}catch(e){return t}!function(t){if(mt.indexOf(t)>-1)throw new M(`Circular extended configurations: '${t}'.`)}(r),mt.push(r),i=s?JSON.parse(pt.readFileSync(r,"utf8")):require(t.extends),delete t.extends,i=gt(i,pt.path.dirname(r),n,pt)}return mt=[],n?yt(i,t):Object.assign({},i,t)}function yt(t,e){const n={};function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(n,t);for(const i of Object.keys(e))s(e[i])&&s(n[i])?n[i]=yt(t[i],e[i]):n[i]=e[i];return n}var bt,vt,wt,Ot,xt,Et,jt,St,Ct,kt,At,_t,Pt,$t,It,Mt,Tt,Lt,Nt,Ft,Dt,Gt,Rt,Ut,Wt,Bt,zt,Ht,qt,Vt,Kt,Yt,Jt,Qt,Xt,Zt=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},te=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};const ee=Symbol("copyDoubleDash"),ne=Symbol("copyDoubleDash"),se=Symbol("deleteFromParserHintObject"),ie=Symbol("emitWarning"),re=Symbol("freeze"),oe=Symbol("getDollarZero"),ae=Symbol("getParserConfiguration"),ce=Symbol("getUsageConfiguration"),le=Symbol("guessLocale"),he=Symbol("guessVersion"),ue=Symbol("parsePositionalNumbers"),de=Symbol("pkgUp"),fe=Symbol("populateParserHintArray"),pe=Symbol("populateParserHintSingleValueDictionary"),me=Symbol("populateParserHintArrayDictionary"),ge=Symbol("populateParserHintDictionary"),ye=Symbol("sanitizeKey"),be=Symbol("setKey"),ve=Symbol("unfreeze"),we=Symbol("validateAsync"),Oe=Symbol("getCommandInstance"),xe=Symbol("getContext"),Ee=Symbol("getHasOutput"),je=Symbol("getLoggerInstance"),Se=Symbol("getParseContext"),Ce=Symbol("getUsageInstance"),ke=Symbol("getValidationInstance"),Ae=Symbol("hasParseCallback"),_e=Symbol("isGlobalContext"),Pe=Symbol("postProcess"),$e=Symbol("rebase"),Ie=Symbol("reset"),Me=Symbol("runYargsParserAndExecuteCommands"),Te=Symbol("runValidation"),Le=Symbol("setHasOutput"),Ne=Symbol("kTrackManuallySetKeys");class Fe{constructor(t=[],e,n,s){this.customScriptName=!1,this.parsed=!1,bt.set(this,void 0),vt.set(this,void 0),wt.set(this,{commands:[],fullCommands:[]}),Ot.set(this,null),xt.set(this,null),Et.set(this,"show-hidden"),jt.set(this,null),St.set(this,!0),Ct.set(this,{}),kt.set(this,!0),At.set(this,[]),_t.set(this,void 0),Pt.set(this,{}),$t.set(this,!1),It.set(this,null),Mt.set(this,!0),Tt.set(this,void 0),Lt.set(this,""),Nt.set(this,void 0),Ft.set(this,void 0),Dt.set(this,{}),Gt.set(this,null),Rt.set(this,null),Ut.set(this,{}),Wt.set(this,{}),Bt.set(this,void 0),zt.set(this,!1),Ht.set(this,void 0),qt.set(this,!1),Vt.set(this,!1),Kt.set(this,!1),Yt.set(this,void 0),Jt.set(this,{}),Qt.set(this,null),Xt.set(this,void 0),Zt(this,Ht,s,"f"),Zt(this,Bt,t,"f"),Zt(this,vt,e,"f"),Zt(this,Ft,n,"f"),Zt(this,_t,new Q(this),"f"),this.$0=this[oe](),this[Ie](),Zt(this,bt,te(this,bt,"f"),"f"),Zt(this,Yt,te(this,Yt,"f"),"f"),Zt(this,Xt,te(this,Xt,"f"),"f"),Zt(this,Nt,te(this,Nt,"f"),"f"),te(this,Nt,"f").showHiddenOpt=te(this,Et,"f"),Zt(this,Tt,this[ne](),"f")}addHelpOpt(t,e){return K("[string|boolean] [string]",[t,e],arguments.length),te(this,It,"f")&&(this[se](te(this,It,"f")),Zt(this,It,null,"f")),!1===t&&void 0===e||(Zt(this,It,"string"==typeof t?t:"help","f"),this.boolean(te(this,It,"f")),this.describe(te(this,It,"f"),e||te(this,Yt,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(K("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const n="string"==typeof t?t:te(this,Et,"f");return this.boolean(n),this.describe(n,e||te(this,Yt,"f").deferY18nLookup("Show hidden options")),te(this,Nt,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return K("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.alias.bind(this),"alias",t,e),this}array(t){return K("<array|string>",[t],arguments.length),this[fe]("array",t),this[Ne](t),this}boolean(t){return K("<array|string>",[t],arguments.length),this[fe]("boolean",t),this[Ne](t),this}check(t,e){return K("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,n)=>Z((()=>t(e,n.getOptions())),(n=>(n?("string"==typeof n||n instanceof Error)&&te(this,Yt,"f").fail(n.toString(),n):te(this,Yt,"f").fail(te(this,Ht,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(te(this,Yt,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return K("<object|string|array> [string|array]",[t,e],arguments.length),this[me](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(K("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new M("coerce callback must be provided");for(const n of t)this.coerce(n,e);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!e)throw new M("coerce callback must be provided");return te(this,Nt,"f").key[t]=!0,te(this,_t,"f").addCoerceMiddleware(((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,t)?Z((()=>(i=s.getAliases(),e(n[t]))),(e=>{n[t]=e;const r=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[t]&&!0!==r)for(const s of i[t])n[s]=e;return n}),(t=>{throw new M(t.message)})):n}),t),this}conflicts(t,e){return K("<string|object> [string|array]",[t,e],arguments.length),te(this,Xt,"f").conflicts(t,e),this}config(t="config",e,n){return K("[object|string] [string|function] [function]",[t,e,n],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(n=e,e=void 0),this.describe(t,e||te(this,Yt,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{te(this,Nt,"f").config[t]=n||!0})),this):(t=gt(t,te(this,vt,"f"),this[ae]()["deep-merge-config"]||!1,te(this,Ht,"f")),te(this,Nt,"f").configObjects=(te(this,Nt,"f").configObjects||[]).concat(t),this)}completion(t,e,n){return K("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),"function"==typeof e&&(n=e,e=void 0),Zt(this,xt,t||te(this,xt,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(te(this,xt,"f"),e),n&&te(this,Ot,"f").registerFunction(n),this}command(t,e,n,s,i,r){return K("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,s,i,r],arguments.length),te(this,bt,"f").addHandler(t,e,n,s,i,r),this}commands(t,e,n,s,i,r){return this.command(t,e,n,s,i,r)}commandDir(t,e){K("<string> [object]",[t,e],arguments.length);const n=te(this,Ft,"f")||te(this,Ht,"f").require;return te(this,bt,"f").addDirectory(t,n,te(this,Ht,"f").getCallerFile(),e),this}count(t){return K("<array|string>",[t],arguments.length),this[fe]("count",t),this[Ne](t),this}default(t,e,n){return K("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(B(t,te(this,Ht,"f")),te(this,Nt,"f").defaultDescription[t]=n),"function"==typeof e&&(B(t,te(this,Ht,"f")),te(this,Nt,"f").defaultDescription[t]||(te(this,Nt,"f").defaultDescription[t]=te(this,Yt,"f").functionDescription(e)),e=e.call()),this[pe](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,s){return K("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,s],arguments.length),"number"!=typeof e&&(n=e,e=1/0),this.global("_",!1),te(this,Nt,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:s},this}demand(t,e,n){return Array.isArray(e)?(e.forEach((t=>{W(n,!0,te(this,Ht,"f")),this.demandOption(t,n)})),e=1/0):"number"!=typeof e&&(n=e,e=1/0),"number"==typeof t?(W(n,!0,te(this,Ht,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach((t=>{W(n,!0,te(this,Ht,"f")),this.demandOption(t,n)})):"string"==typeof n?this.demandOption(t,n):!0!==n&&void 0!==n||this.demandOption(t),this}demandOption(t,e){return K("<object|string|array> [string]",[t,e],arguments.length),this[pe](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return K("<string> [string|boolean]",[t,e],arguments.length),te(this,Nt,"f").deprecatedOptions[t]=e,this}describe(t,e){return K("<object|string|array> [string]",[t,e],arguments.length),this[be](t,!0),te(this,Yt,"f").describe(t,e),this}detectLocale(t){return K("<boolean>",[t],arguments.length),Zt(this,St,t,"f"),this}env(t){return K("[string|boolean]",[t],arguments.length),!1===t?delete te(this,Nt,"f").envPrefix:te(this,Nt,"f").envPrefix=t||"",this}epilogue(t){return K("<string>",[t],arguments.length),te(this,Yt,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return K("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):te(this,Yt,"f").example(t,e),this}exit(t,e){Zt(this,$t,!0,"f"),Zt(this,jt,e,"f"),te(this,kt,"f")&&te(this,Ht,"f").process.exit(t)}exitProcess(t=!0){return K("[boolean]",[t],arguments.length),Zt(this,kt,t,"f"),this}fail(t){if(K("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new M("Invalid first argument. Expected function or boolean 'false'");return te(this,Yt,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return K("<array> [function]",[t,e],arguments.length),e?te(this,Ot,"f").getCompletion(t,e):new Promise(((e,n)=>{te(this,Ot,"f").getCompletion(t,((t,s)=>{t?n(t):e(s)}))}))}getDemandedOptions(){return K([],0),te(this,Nt,"f").demandedOptions}getDemandedCommands(){return K([],0),te(this,Nt,"f").demandedCommands}getDeprecatedOptions(){return K([],0),te(this,Nt,"f").deprecatedOptions}getDetectLocale(){return te(this,St,"f")}getExitProcess(){return te(this,kt,"f")}getGroups(){return Object.assign({},te(this,Pt,"f"),te(this,Wt,"f"))}getHelp(){if(Zt(this,$t,!0,"f"),!te(this,Yt,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Me](te(this,Bt,"f"),void 0,void 0,0,!0);if(H(t))return t.then((()=>te(this,Yt,"f").help()))}const t=te(this,bt,"f").runDefaultBuilderOn(this);if(H(t))return t.then((()=>te(this,Yt,"f").help()))}return Promise.resolve(te(this,Yt,"f").help())}getOptions(){return te(this,Nt,"f")}getStrict(){return te(this,qt,"f")}getStrictCommands(){return te(this,Vt,"f")}getStrictOptions(){return te(this,Kt,"f")}global(t,e){return K("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?te(this,Nt,"f").local=te(this,Nt,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{te(this,Nt,"f").local.includes(t)||te(this,Nt,"f").local.push(t)})),this}group(t,e){K("<string|array> <string>",[t,e],arguments.length);const n=te(this,Wt,"f")[e]||te(this,Pt,"f")[e];te(this,Wt,"f")[e]&&delete te(this,Wt,"f")[e];const s={};return te(this,Pt,"f")[e]=(n||[]).concat(t).filter((t=>!s[t]&&(s[t]=!0))),this}hide(t){return K("<string>",[t],arguments.length),te(this,Nt,"f").hiddenOptions.push(t),this}implies(t,e){return K("<string|object> [number|string|array]",[t,e],arguments.length),te(this,Xt,"f").implies(t,e),this}locale(t){return K("[string]",[t],arguments.length),void 0===t?(this[le](),te(this,Ht,"f").y18n.getLocale()):(Zt(this,St,!1,"f"),te(this,Ht,"f").y18n.setLocale(t),this)}middleware(t,e,n){return te(this,_t,"f").addMiddleware(t,!!e,n)}nargs(t,e){return K("<string|object|array> [number]",[t,e],arguments.length),this[pe](this.nargs.bind(this),"narg",t,e),this}normalize(t){return K("<array|string>",[t],arguments.length),this[fe]("normalize",t),this}number(t){return K("<array|string>",[t],arguments.length),this[fe]("number",t),this[Ne](t),this}option(t,e){if(K("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Ne](t),!te(this,Qt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[ie](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),void 0,"versionWarning"),te(this,Nt,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(te(this,Nt,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc,r=te(this,Yt,"f").getDescriptions();Object.prototype.hasOwnProperty.call(r,t)&&"string"!=typeof i||this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){K("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[re](),void 0===t&&(t=te(this,Bt,"f")),"object"==typeof e&&(Zt(this,Rt,e,"f"),e=n),"function"==typeof e&&(Zt(this,Gt,e,"f"),e=!1),e||Zt(this,Bt,t,"f"),te(this,Gt,"f")&&Zt(this,kt,!1,"f");const s=this[Me](t,!!e),i=this.parsed;return te(this,Ot,"f").setParsed(this.parsed),H(s)?s.then((t=>(te(this,Gt,"f")&&te(this,Gt,"f").call(this,te(this,jt,"f"),t,te(this,Lt,"f")),t))).catch((t=>{throw te(this,Gt,"f")&&te(this,Gt,"f")(t,this.parsed.argv,te(this,Lt,"f")),t})).finally((()=>{this[ve](),this.parsed=i})):(te(this,Gt,"f")&&te(this,Gt,"f").call(this,te(this,jt,"f"),s,te(this,Lt,"f")),this[ve](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return H(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(H(s))throw new M(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return K("<object>",[t],arguments.length),Zt(this,Dt,t,"f"),this}pkgConf(t,e){K("<string> [string]",[t,e],arguments.length);let n=null;const s=this[de](e||te(this,vt,"f"));return s[t]&&"object"==typeof s[t]&&(n=gt(s[t],e||te(this,vt,"f"),this[ae]()["deep-merge-config"]||!1,te(this,Ht,"f")),te(this,Nt,"f").configObjects=(te(this,Nt,"f").configObjects||[]).concat(n)),this}positional(t,e){K("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=it(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&n.includes(t)));const s=te(this,wt,"f").fullCommands[te(this,wt,"f").fullCommands.length-1],i=s?te(this,bt,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return z(i).forEach((n=>{const s=i[n];Array.isArray(s)?-1!==s.indexOf(t)&&(e[n]=!0):s[t]&&!(n in e)&&(e[n]=s[t])})),this.group(t,te(this,Yt,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return K("[boolean]",[t],arguments.length),Zt(this,zt,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return K("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&te(this,Nt,"f").narg[t]||this[pe](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return K("[string] [string]",[t,e],arguments.length),t=t||this.$0,te(this,Tt,"f").log(te(this,Ot,"f").generateCompletionScript(t,e||te(this,xt,"f")||"completion")),this}showHelp(t){if(K("[string|function]",[t],arguments.length),Zt(this,$t,!0,"f"),!te(this,Yt,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Me](te(this,Bt,"f"),void 0,void 0,0,!0);if(H(e))return e.then((()=>{te(this,Yt,"f").showHelp(t)})),this}const e=te(this,bt,"f").runDefaultBuilderOn(this);if(H(e))return e.then((()=>{te(this,Yt,"f").showHelp(t)})),this}return te(this,Yt,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return K("[boolean|string] [string]",[t,e],arguments.length),te(this,Yt,"f").showHelpOnFail(t,e),this}showVersion(t){return K("[string|function]",[t],arguments.length),te(this,Yt,"f").showVersion(t),this}skipValidation(t){return K("<array|string>",[t],arguments.length),this[fe]("skipValidation",t),this}strict(t){return K("[boolean]",[t],arguments.length),Zt(this,qt,!1!==t,"f"),this}strictCommands(t){return K("[boolean]",[t],arguments.length),Zt(this,Vt,!1!==t,"f"),this}strictOptions(t){return K("[boolean]",[t],arguments.length),Zt(this,Kt,!1!==t,"f"),this}string(t){return K("<array|string>",[t],arguments.length),this[fe]("string",t),this[Ne](t),this}terminalWidth(){return K([],0),te(this,Ht,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return K("<object>",[t],arguments.length),Zt(this,St,!1,"f"),te(this,Ht,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(K("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),void 0!==e){if(W(t,null,te(this,Ht,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new M(".usage() description must start with $0 if being used as alias for .command()")}return te(this,Yt,"f").usage(t),this}usageConfiguration(t){return K("<object>",[t],arguments.length),Zt(this,Jt,t,"f"),this}version(t,e,n){const s="version";if(K("[boolean|string] [string] [string]",[t,e,n],arguments.length),te(this,Qt,"f")&&(this[se](te(this,Qt,"f")),te(this,Yt,"f").version(void 0),Zt(this,Qt,null,"f")),0===arguments.length)n=this[he](),t=s;else if(1===arguments.length){if(!1===t)return this;n=t,t=s}else 2===arguments.length&&(n=e,e=void 0);return Zt(this,Qt,"string"==typeof t?t:s,"f"),e=e||te(this,Yt,"f").deferY18nLookup("Show version number"),te(this,Yt,"f").version(n||void 0),this.boolean(te(this,Qt,"f")),this.describe(te(this,Qt,"f"),e),this}wrap(t){return K("<number|null|undefined>",[t],arguments.length),te(this,Yt,"f").wrap(t),this}[(bt=new WeakMap,vt=new WeakMap,wt=new WeakMap,Ot=new WeakMap,xt=new WeakMap,Et=new WeakMap,jt=new WeakMap,St=new WeakMap,Ct=new WeakMap,kt=new WeakMap,At=new WeakMap,_t=new WeakMap,Pt=new WeakMap,$t=new WeakMap,It=new WeakMap,Mt=new WeakMap,Tt=new WeakMap,Lt=new WeakMap,Nt=new WeakMap,Ft=new WeakMap,Dt=new WeakMap,Gt=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ht=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Kt=new WeakMap,Yt=new WeakMap,Jt=new WeakMap,Qt=new WeakMap,Xt=new WeakMap,ee)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[ne](){return{log:(...t)=>{this[Ae]()||console.log(...t),Zt(this,$t,!0,"f"),te(this,Lt,"f").length&&Zt(this,Lt,te(this,Lt,"f")+"\n","f"),Zt(this,Lt,te(this,Lt,"f")+t.join(" "),"f")},error:(...t)=>{this[Ae]()||console.error(...t),Zt(this,$t,!0,"f"),te(this,Lt,"f").length&&Zt(this,Lt,te(this,Lt,"f")+"\n","f"),Zt(this,Lt,te(this,Lt,"f")+t.join(" "),"f")}}}[se](t){z(te(this,Nt,"f")).forEach((e=>{if("configObjects"===e)return;const n=te(this,Nt,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):"object"==typeof n&&delete n[t]})),delete te(this,Yt,"f").getDescriptions()[t]}[ie](t,e,n){te(this,Ct,"f")[n]||(te(this,Ht,"f").process.emitWarning(t,e),te(this,Ct,"f")[n]=!0)}[re](){te(this,At,"f").push({options:te(this,Nt,"f"),configObjects:te(this,Nt,"f").configObjects.slice(0),exitProcess:te(this,kt,"f"),groups:te(this,Pt,"f"),strict:te(this,qt,"f"),strictCommands:te(this,Vt,"f"),strictOptions:te(this,Kt,"f"),completionCommand:te(this,xt,"f"),output:te(this,Lt,"f"),exitError:te(this,jt,"f"),hasOutput:te(this,$t,"f"),parsed:this.parsed,parseFn:te(this,Gt,"f"),parseContext:te(this,Rt,"f")}),te(this,Yt,"f").freeze(),te(this,Xt,"f").freeze(),te(this,bt,"f").freeze(),te(this,_t,"f").freeze()}[oe](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(te(this,Ht,"f").process.argv()[0])?te(this,Ht,"f").process.argv().slice(1,2):te(this,Ht,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[$e](te(this,vt,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),te(this,Ht,"f").getEnv("_")&&te(this,Ht,"f").getProcessArgvBin()===te(this,Ht,"f").getEnv("_")&&(e=te(this,Ht,"f").getEnv("_").replace(`${te(this,Ht,"f").path.dirname(te(this,Ht,"f").process.execPath())}/`,"")),e}[ae](){return te(this,Dt,"f")}[ce](){return te(this,Jt,"f")}[le](){if(!te(this,St,"f"))return;const t=te(this,Ht,"f").getEnv("LC_ALL")||te(this,Ht,"f").getEnv("LC_MESSAGES")||te(this,Ht,"f").getEnv("LANG")||te(this,Ht,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[he](){return this[de]().version||"unknown"}[ue](t){const e=t["--"]?t["--"]:t._;for(let t,n=0;void 0!==(t=e[n]);n++)te(this,Ht,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[n]=Number(t));return t}[de](t){const e=t||"*";if(te(this,Ut,"f")[e])return te(this,Ut,"f")[e];let n={};try{let e=t||te(this,Ht,"f").mainFilename;!t&&te(this,Ht,"f").path.extname(e)&&(e=te(this,Ht,"f").path.dirname(e));const s=te(this,Ht,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));W(s,void 0,te(this,Ht,"f")),n=JSON.parse(te(this,Ht,"f").readFileSync(s,"utf8"))}catch(t){}return te(this,Ut,"f")[e]=n||{},te(this,Ut,"f")[e]}[fe](t,e){(e=[].concat(e)).forEach((e=>{e=this[ye](e),te(this,Nt,"f")[t].push(e)}))}[pe](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{te(this,Nt,"f")[t][e]=n}))}[me](t,e,n,s){this[ge](t,e,n,s,((t,e,n)=>{te(this,Nt,"f")[t][e]=(te(this,Nt,"f")[t][e]||[]).concat(n)}))}[ge](t,e,n,s,i){if(Array.isArray(n))n.forEach((e=>{t(e,s)}));else if((t=>"object"==typeof t)(n))for(const e of z(n))t(e,n[e]);else i(e,this[ye](n),s)}[ye](t){return"__proto__"===t?"___proto___":t}[be](t,e){return this[pe](this[be].bind(this),"key",t,e),this}[ve](){var t,e,n,s,i,r,o,a,c,l,h,u;const d=te(this,At,"f").pop();let f;W(d,void 0,te(this,Ht,"f")),t=this,e=this,n=this,s=this,i=this,r=this,o=this,a=this,c=this,l=this,h=this,u=this,({options:{set value(e){Zt(t,Nt,e,"f")}}.value,configObjects:f,exitProcess:{set value(t){Zt(e,kt,t,"f")}}.value,groups:{set value(t){Zt(n,Pt,t,"f")}}.value,output:{set value(t){Zt(s,Lt,t,"f")}}.value,exitError:{set value(t){Zt(i,jt,t,"f")}}.value,hasOutput:{set value(t){Zt(r,$t,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){Zt(o,qt,t,"f")}}.value,strictCommands:{set value(t){Zt(a,Vt,t,"f")}}.value,strictOptions:{set value(t){Zt(c,Kt,t,"f")}}.value,completionCommand:{set value(t){Zt(l,xt,t,"f")}}.value,parseFn:{set value(t){Zt(h,Gt,t,"f")}}.value,parseContext:{set value(t){Zt(u,Rt,t,"f")}}.value}=d),te(this,Nt,"f").configObjects=f,te(this,Yt,"f").unfreeze(),te(this,Xt,"f").unfreeze(),te(this,bt,"f").unfreeze(),te(this,_t,"f").unfreeze()}[we](t,e){return Z(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[Oe].bind(this),getContext:this[xe].bind(this),getHasOutput:this[Ee].bind(this),getLoggerInstance:this[je].bind(this),getParseContext:this[Se].bind(this),getParserConfiguration:this[ae].bind(this),getUsageConfiguration:this[ce].bind(this),getUsageInstance:this[Ce].bind(this),getValidationInstance:this[ke].bind(this),hasParseCallback:this[Ae].bind(this),isGlobalContext:this[_e].bind(this),postProcess:this[Pe].bind(this),reset:this[Ie].bind(this),runValidation:this[Te].bind(this),runYargsParserAndExecuteCommands:this[Me].bind(this),setHasOutput:this[Le].bind(this)}}[Oe](){return te(this,bt,"f")}[xe](){return te(this,wt,"f")}[Ee](){return te(this,$t,"f")}[je](){return te(this,Tt,"f")}[Se](){return te(this,Rt,"f")||{}}[Ce](){return te(this,Yt,"f")}[ke](){return te(this,Xt,"f")}[Ae](){return!!te(this,Gt,"f")}[_e](){return te(this,Mt,"f")}[Pe](t,e,n,s){if(n)return t;if(H(t))return t;e||(t=this[ee](t));return(this[ae]()["parse-positional-numbers"]||void 0===this[ae]()["parse-positional-numbers"])&&(t=this[ue](t)),s&&(t=X(t,this,te(this,_t,"f").getMiddleware(),!1)),t}[Ie](t={}){Zt(this,Nt,te(this,Nt,"f")||{},"f");const e={};e.local=te(this,Nt,"f").local||[],e.configObjects=te(this,Nt,"f").configObjects||[];const n={};e.local.forEach((e=>{n[e]=!0,(t[e]||[]).forEach((t=>{n[t]=!0}))})),Object.assign(te(this,Wt,"f"),Object.keys(te(this,Pt,"f")).reduce(((t,e)=>{const s=te(this,Pt,"f")[e].filter((t=>!(t in n)));return s.length>0&&(t[e]=s),t}),{})),Zt(this,Pt,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(te(this,Nt,"f")[t]||[]).filter((t=>!n[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=it(te(this,Nt,"f")[t],(t=>!n[t]))})),e.envPrefix=te(this,Nt,"f").envPrefix,Zt(this,Nt,e,"f"),Zt(this,Yt,te(this,Yt,"f")?te(this,Yt,"f").reset(n):at(this,te(this,Ht,"f")),"f"),Zt(this,Xt,te(this,Xt,"f")?te(this,Xt,"f").reset(n):function(t,e,n){const s=n.y18n.__,i=n.y18n.__n,r={nonOptionCount:function(n){const s=t.getDemandedCommands(),r=n._.length+(n["--"]?n["--"].length:0)-t.getInternalMethods().getContext().commands.length;s._&&(r<s._.min||r>s._.max)&&(r<s._.min?void 0!==s._.minMsg?e.fail(s._.minMsg?s._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),s._.min.toString())):r>s._.max&&(void 0!==s._.maxMsg?e.fail(s._.maxMsg?s._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),s._.max.toString()))))},positionalCount:function(t,n){n<t&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",n,n+"",t+""))},requiredArguments:function(t,n){let s=null;for(const e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(s=s||{},s[e]=n[e]);if(s){const t=[];for(const e of Object.keys(s)){const n=s[e];n&&t.indexOf(n)<0&&t.push(n)}const n=t.length?`\n${t.join("\n")}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(s).length,Object.keys(s).join(", ")+n))}},unknownArguments:function(n,s,o,a,c=!0){var l;const h=t.getInternalMethods().getCommandInstance().getCommands(),u=[],d=t.getInternalMethods().getContext();if(Object.keys(n).forEach((e=>{ft.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,s)||u.push(e)})),c&&(d.commands.length>0||h.length>0||a)&&n._.slice(d.commands.length).forEach((t=>{h.includes(""+t)||u.push(""+t)})),c){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,s=d.commands.length+e;s<n._.length&&n._.slice(s).forEach((t=>{t=String(t),d.commands.includes(t)||u.includes(t)||u.push(t)}))}u.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",u.length,u.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(n){const s=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||s.length>0)&&n._.slice(o.commands.length).forEach((t=>{s.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(i("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,n){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;const s=t.parsed.newAliases;return[e,...n[e]].some((t=>!Object.prototype.hasOwnProperty.call(s,t)||!s[e]))},limitedChoices:function(n){const i=t.getOptions(),r={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach((t=>{-1===ft.indexOf(t)&&Object.prototype.hasOwnProperty.call(i.choices,t)&&[].concat(n[t]).forEach((e=>{-1===i.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=s("Invalid values:");o.forEach((t=>{a+=`\n ${s("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(i.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const n=Number(e);return"number"==typeof(e=isNaN(n)?e:n)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,s){K("<string|object> [array|number|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(s)?s.forEach((t=>r.implies(e,t))):(W(s,void 0,n),o[e].push(s)))},r.getImplied=function(){return o},r.implications=function(t){const n=[];if(Object.keys(o).forEach((e=>{const s=e;(o[e]||[]).forEach((e=>{let i=s;const r=e;i=a(t,i),e=a(t,e),i&&!e&&n.push(` ${s} -> ${r}`)}))})),n.length){let t=`${s("Implications failed:")}\n`;n.forEach((e=>{t+=e})),e.fail(t)}};let c={};r.conflicts=function(e,n){K("<string|object> [array|string]",[e,n],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),c[e]||(c[e]=[]),Array.isArray(n)?n.forEach((t=>r.conflicts(e,t))):c[e].push(n))},r.getConflicting=()=>c,r.conflicting=function(i){Object.keys(i).forEach((t=>{c[t]&&c[t].forEach((n=>{n&&void 0!==i[t]&&void 0!==i[n]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,n))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach((t=>{c[t].forEach((r=>{r&&void 0!==i[n.Parser.camelCase(t)]&&void 0!==i[n.Parser.camelCase(r)]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,n){n=n.sort(((t,e)=>e.length-t.length));let i=null,r=1/0;for(let e,s=0;void 0!==(e=n[s]);s++){const n=dt(t,e);n<=3&&n<r&&(r=n,i=e)}i&&e.fail(s("Did you mean %s?",i))},r.reset=function(t){return o=it(o,(e=>!t[e])),c=it(c,(e=>!t[e])),r};const l=[];return r.freeze=function(){l.push({implied:o,conflicting:c})},r.unfreeze=function(){const t=l.pop();W(t,void 0,n),({implied:o,conflicting:c}=t)},r}(this,te(this,Yt,"f"),te(this,Ht,"f")),"f"),Zt(this,bt,te(this,bt,"f")?te(this,bt,"f").reset():function(t,e,n,s){return new et(t,e,n,s)}(te(this,Yt,"f"),te(this,Xt,"f"),te(this,_t,"f"),te(this,Ht,"f")),"f"),te(this,Ot,"f")||Zt(this,Ot,function(t,e,n,s){return new ut(t,e,n,s)}(this,te(this,Yt,"f"),te(this,bt,"f"),te(this,Ht,"f")),"f"),te(this,_t,"f").reset(),Zt(this,xt,null,"f"),Zt(this,Lt,"","f"),Zt(this,jt,null,"f"),Zt(this,$t,!1,"f"),this.parsed=!1,this}[$e](t,e){return te(this,Ht,"f").path.relative(t,e)}[Me](t,e,n,s=0,i=!1){let r=!!n||i;t=t||te(this,Bt,"f"),te(this,Nt,"f").__=te(this,Ht,"f").y18n.__,te(this,Nt,"f").configuration=this[ae]();const o=!!te(this,Nt,"f").configuration["populate--"],a=Object.assign({},te(this,Nt,"f").configuration,{"populate--":!0}),c=te(this,Ht,"f").Parser.detailed(t,Object.assign({},te(this,Nt,"f"),{configuration:{"parse-positional-numbers":!1,...a}})),l=Object.assign(c.argv,te(this,Rt,"f"));let h;const u=c.aliases;let d=!1,f=!1;Object.keys(l).forEach((t=>{t===te(this,It,"f")&&l[t]?d=!0:t===te(this,Qt,"f")&&l[t]&&(f=!0)})),l.$0=this.$0,this.parsed=c,0===s&&te(this,Yt,"f").clearCachedHelpMessage();try{if(this[le](),e)return this[Pe](l,o,!!n,!1);if(te(this,It,"f")){[te(this,It,"f")].concat(u[te(this,It,"f")]||[]).filter((t=>t.length>1)).includes(""+l._[l._.length-1])&&(l._.pop(),d=!0)}Zt(this,Mt,!1,"f");const a=te(this,bt,"f").getCommands(),p=te(this,Ot,"f").completionKey in l,m=d||p||i;if(l._.length){if(a.length){let t;for(let e,r=s||0;void 0!==l._[r];r++){if(e=String(l._[r]),a.includes(e)&&e!==te(this,xt,"f")){const t=te(this,bt,"f").runCommand(e,this,c,r+1,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(!t&&e!==te(this,xt,"f")){t=e;break}}!te(this,bt,"f").hasDefaultCommand()&&te(this,zt,"f")&&t&&!m&&te(this,Xt,"f").recommendCommands(t,a)}te(this,xt,"f")&&l._.includes(te(this,xt,"f"))&&!p&&(te(this,kt,"f")&&rt(!0),this.showCompletionScript(),this.exit(0))}if(te(this,bt,"f").hasDefaultCommand()&&!m){const t=te(this,bt,"f").runCommand(null,this,c,0,i,d||f||i);return this[Pe](t,o,!!n,!1)}if(p){te(this,kt,"f")&&rt(!0);const e=(t=[].concat(t)).slice(t.indexOf(`--${te(this,Ot,"f").completionKey}`)+1);return te(this,Ot,"f").getCompletion(e,((t,e)=>{if(t)throw new M(t.message);(e||[]).forEach((t=>{te(this,Tt,"f").log(t)})),this.exit(0)})),this[Pe](l,!o,!!n,!1)}if(te(this,$t,"f")||(d?(te(this,kt,"f")&&rt(!0),r=!0,this.showHelp("log"),this.exit(0)):f&&(te(this,kt,"f")&&rt(!0),r=!0,te(this,Yt,"f").showVersion("log"),this.exit(0))),!r&&te(this,Nt,"f").skipValidation.length>0&&(r=Object.keys(l).some((t=>te(this,Nt,"f").skipValidation.indexOf(t)>=0&&!0===l[t]))),!r){if(c.error)throw new M(c.error.message);if(!p){const t=this[Te](u,{},c.error);n||(h=X(l,this,te(this,_t,"f").getMiddleware(),!0)),h=this[we](t,null!=h?h:l),H(h)&&!n&&(h=h.then((()=>X(l,this,te(this,_t,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof M))throw t;te(this,Yt,"f").fail(t.message,t)}return this[Pe](null!=h?h:l,o,!!n,!0)}[Te](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new M(n.message);te(this,Xt,"f").nonOptionCount(r),te(this,Xt,"f").requiredArguments(r,i);let o=!1;te(this,Vt,"f")&&(o=te(this,Xt,"f").unknownCommands(r)),te(this,qt,"f")&&!o?te(this,Xt,"f").unknownArguments(r,t,e,!!s):te(this,Kt,"f")&&te(this,Xt,"f").unknownArguments(r,t,{},!1,!1),te(this,Xt,"f").limitedChoices(r),te(this,Xt,"f").implications(r),te(this,Xt,"f").conflicting(r)}}[Le](){Zt(this,$t,!0,"f")}[Ne](t){if("string"==typeof t)te(this,Nt,"f").key[t]=!0;else for(const e of t)te(this,Nt,"f").key[e]=!0}}const De=(Ge=U,(t=[],e=Ge.process.cwd(),n)=>{const s=new Fe(t,e,n,Ge);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s});var Ge;const Re=De;function Ue(t,e){const n=t.startsWith(".")?(0,f.join)(e,t):t;return import(n)}function We(t,e){const{homepage:n,site:s=n,repository:i}=e,r=s&&s!==i,o=t.getInternalMethods(),a=(c=o.getCommandInstance().handlers,Object.keys(c).some((t=>t&&"$0"!==t)));var c;return 0===o.getUsageInstance().getUsage().length&&(a?t.usage("Usage: $0 <command>"):t.usage("Usage: $0")),a&&t.demandCommand(1,"Won't work without a command"),r&&t.epilogue(`Website: ${s}`),i&&t.epilogue(`Repository: ${i}`),t}var Be=a(4867);const ze="git",He="",qe=process.cwd();function Ve(){try{return function(){try{return Boolean((0,Be.Kc)("git",["--version"],{cwd:qe}).stdout)}catch{throw new Error("git is not installed")}}()&&function(){try{return"true"===(0,Be.Kc)("git",["rev-parse","--is-inside-work-tree"],{cwd:qe}).stdout}catch{throw new Error("not a git repository")}}()}catch(t){return console.error("Fail:",t.message),!1}}function Ke(t){t.command("hooks","Set .githooks as git.hooksPath",{},(()=>{Ve()&&(0,Be.Ho)("git",["config","core.hooksPath",".githooks"],{cwd:qe}).then((()=>{console.log("Done: set .githooks")})).catch((()=>{console.error("Fail:","setting hooks failed"),process.exitCode=1}))})),t.demandCommand(1,"Typing `hooks`")}const Ye=t(import.meta.url)("node:module"),Je=t(import.meta.url)("module"),Qe=process.cwd();const Xe=(0,Je.createRequire)(import.meta.url);function Ze(t,e=Qe){return t.startsWith(".")?(0,f.resolve)(e,t):(0,f.isAbsolute)(t)?t:Xe.resolve(t)}function tn(t){try{return(0,s.statSync)(Ze(t)),!0}catch{return!1}}function en(t,e={}){const n=function(t){try{const e=(0,s.readFileSync)(Ze(t),"utf8");return JSON.parse(e)}catch{return{}}}("./package.json");if(t){const{[t]:s=e}=n;return s}return n}var nn=a(1455),sn=a(6760);const rn={"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"subject-case":[0],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]],"scope-case":[0],"body-case":[0],"header-case":[0]};function on(){return(0,nn.readFile)((0,sn.resolve)(process.cwd(),".git/COMMIT_EDITMSG"),"utf8")}function an(t){t.command("commit","Lint git commit message",{},(()=>{(async function(){const t=await on(),e=await a.e(609).then(a.bind(a,7609)).then((t=>t.default.default||t.default)),n=await a.e(290).then(a.bind(a,2290)).then((t=>t.default.default||t.default)),s=await e(t,rn);return{result:s,output:await n({results:[s]})}})().then((({result:t,output:e})=>{t.valid?console.log("Pass."):(console.log("Fail:"),console.log(e),process.exitCode=1)})).catch((t=>{console.error(t),process.exitCode=1}))}))}function cn({garou:t,stylelint:e,eslint:n,prettier:s}){const i=process.stdin.isTTY?" --color":"";return function(t){const e=Object.entries(t).map((([t,e])=>[t,e.filter(Boolean)])).filter((([t,e])=>e.length));return e.length>0?Object.fromEntries(e):void 0}({"*.{vue,html,htm,md}":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{ts,tsx,mts,cts}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{js,jsx,mjs,cjs,wxs,qs}":[t&&"garou",s&&`prettier -w -u${i}`,n&&`eslint --fix -f=pretty${i}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[t&&"garou",s&&`prettier -w -u${i}`,e&&`stylelint --fix${i}`],"*.{json,yml,yaml,svg}":[t&&"garou",s&&`prettier -w -u${i}`],"{*.{jsonc,webmanifest,editorconfig,toml},.{babel,npm}rc}":[s&&`prettier -w -u${i}`],"{*.jenkinsfile,{j,J}enkinsfile}":[s&&`prettier -w -u${i}`],"yarn.lock":[t&&"garou"]})}async function ln(){const{default:t}=await a.e(359).then(a.bind(a,5359));return t({allowEmpty:!0,concurrent:!0,config:cn(function(){const t=en("devDependencies");return{garou:"garou"in t,stylelint:"stylelint"in t,eslint:"eslint"in t,prettier:"prettier"in t}}()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})}const hn="lint";function un(t){an(t),function(t){t.command("staged","Lint and format git staged files",{},(()=>{ln().then((t=>{process.exitCode=t?0:1})).catch((t=>{console.error(t),process.exitCode=1}))}))}(t),t.demandCommand(1,"Typing `commit` or `staged`")}process.on("SIGINT",(()=>{})),new class{constructor(t,e){this.root=e;const{bin:n,homepage:i,name:r="cheetor",repository:{url:o=""}={},version:a}="string"==typeof t?JSON.parse((0,s.readFileSync)(new URL(t,e))):t;this.homepage=i,this.repository=o.includes("github.com")?o.replace(/\.git$/,""):"";const c=Re(process.argv.slice(2)).strict().alias("help","h").alias("version","v").hide("help").version(a).hide("version").detectLocale(!1),l=function(t,e){if("string"==typeof t||!t)return e;const n=Object.keys(t);return 1===n.length&&n[0]}(n,r);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(t){return this.cli=this.cli.then(t),this}command(...t){return this.cli=this.cli.then((e=>e.command(...t))),this}commandFrom(t){return this.cli=this.cli.then((async e=>{const n=await Ue(t,this.root);return e.command(n)})),this}commandSafe(t){return this.cli=this.cli.then((e=>function(t,e){return Ue(t,e).catch((t=>{if("ERR_MODULE_NOT_FOUND"===t.code&&t.message.endsWith(` imported from ${(0,m.fileURLToPath)(import.meta.url)}`))return!1;throw t}))}(t,this.root).then((t=>t&&t.command?e.command(t):e)))),this}commandSmart(t){return this.cli=this.cli.then((async e=>{const n=t();return n&&n.command?e.command(n):e})),this}website(t){return this.site=t,this}middleware(...t){return this.cli=this.cli.then((e=>e.middleware(...t))),this}setup(t){return this.cli.then((t=>We(t,this))).then((e=>"function"==typeof t?t(e.parse()):e.parse()))}}("../package.json",import.meta.url).website("https://www.npmjs.com/org/nice-move").command(n).command(e).commandSmart((function(){if(tn("svgo/package.json")&&tn("svgo-config/package.json"))return{command:"svgo",describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,e="./"]}){const n=(0,Ye.createRequire)(import.meta.url);(0,Be.Ho)("svgo",["-r","-q","--pretty","--indent","2","--config",n.resolve("svgo-config"),"-f",e]).then((()=>{console.log("Done: calling svgo")})).catch((t=>{process.exitCode=1,console.error("Error:",t.message)}))}}})).setup()})();
|