@nice-move/init 0.8.19 → 0.8.21

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.
@@ -0,0 +1 @@
1
+ import{createRequire as e}from"node:module";var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),u=e(import.meta.url);export{s as __commonJSMin,u as __require,l as __toESM};
package/dist/cli.mjs CHANGED
@@ -1,28 +1,28 @@
1
1
  #!/usr/bin/env node
2
- import{__require as e}from"./chunk-D0Fku8VQ.mjs";import{readFileSync as t,readdirSync as n,statSync as r,writeFile as i}from"fs";import{notStrictEqual as a,strictEqual as o}from"assert";import{basename as s,dirname as c,extname as l,join as u,normalize as d,relative as f,resolve as p}from"path";import{format as m,inspect as h}from"util";import{fileURLToPath as g}from"url";const ee={right:S,center:ie},_=0,v=1,y=2,te=3;var ne=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)==null?!0:t,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(``),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==`string`)return this.applyLayoutDSL(e[0]);let t=e.map(e=>typeof e==`string`?this.colFromString(e):e);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==`string`&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
3
- `).map(e=>e.split(` `)),n=0;return t.forEach(e=>{e.length>1&&C.stringWidth(e[0])>n&&(n=Math.min(Math.floor(this.width*.5),C.stringWidth(e[0])))}),t.forEach(e=>{this.div(...e.map((t,r)=>({text:t.trim(),padding:this.measurePadding(t),width:r===0&&e.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=C.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(e=>!e.hidden).map(e=>e.text).join(`
4
- `)}rowToString(e,t){return this.rasterize(e).forEach((n,r)=>{let i=``;n.forEach((n,a)=>{let{width:o}=e[a],s=this.negatePadding(e[a]),c=n;if(s>C.stringWidth(n)&&(c+=` `.repeat(s-C.stringWidth(n))),e[a].align&&e[a].align!==`left`&&this.wrap){let t=ee[e[a].align];c=t(c,s),C.stringWidth(c)<s&&(c+=` `.repeat((o||0)-C.stringWidth(c)-1))}let l=e[a].padding||[0,0,0,0];l[te]&&(i+=` `.repeat(l[te])),i+=re(e[a],c,`| `),i+=c,i+=re(e[a],c,` |`),l[v]&&(i+=` `.repeat(l[v])),r===0&&t.length>0&&(i=this.renderInline(i,t[t.length-1]))}),t.push({text:i.replace(/ +$/,``),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),r=n?n[0].length:0,i=t.text,a=C.stringWidth(i.trimRight());return t.span?this.wrap?r<a?e:(t.hidden=!0,i.trimRight()+` `.repeat(r-a)+e.trimLeft()):(t.hidden=!0,i+e):e}rasterize(e){let t=[],n=this.columnWidths(e),r;return e.forEach((e,i)=>{e.width=n[i],r=this.wrap?C.wrap(e.text,this.negatePadding(e),{hard:!0}).split(`
2
+ import{__require as e}from"./chunk-D0Fku8VQ.mjs";import{readFileSync as t,readdirSync as n,statSync as r,writeFile as i}from"fs";import{notStrictEqual as a,strictEqual as o}from"assert";import{basename as s,dirname as c,extname as l,join as u,normalize as d,relative as f,resolve as p}from"path";import{format as m,inspect as h}from"util";import{fileURLToPath as g}from"url";const ee={right:re,center:ie};var _=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)==null?!0:t,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(``),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==`string`)return this.applyLayoutDSL(e[0]);let t=e.map(e=>typeof e==`string`?this.colFromString(e):e);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==`string`&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
3
+ `).map(e=>e.split(` `)),n=0;return t.forEach(e=>{e.length>1&&y.stringWidth(e[0])>n&&(n=Math.min(Math.floor(this.width*.5),y.stringWidth(e[0])))}),t.forEach(e=>{this.div(...e.map((t,r)=>({text:t.trim(),padding:this.measurePadding(t),width:r===0&&e.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=y.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(e=>!e.hidden).map(e=>e.text).join(`
4
+ `)}rowToString(e,t){return this.rasterize(e).forEach((n,r)=>{let i=``;n.forEach((n,a)=>{let{width:o}=e[a],s=this.negatePadding(e[a]),c=n;if(s>y.stringWidth(n)&&(c+=` `.repeat(s-y.stringWidth(n))),e[a].align&&e[a].align!==`left`&&this.wrap){let t=ee[e[a].align];c=t(c,s),y.stringWidth(c)<s&&(c+=` `.repeat((o||0)-y.stringWidth(c)-1))}let l=e[a].padding||[0,0,0,0];l[3]&&(i+=` `.repeat(l[3])),i+=te(e[a],c,`| `),i+=c,i+=te(e[a],c,` |`),l[1]&&(i+=` `.repeat(l[1])),r===0&&t.length>0&&(i=this.renderInline(i,t[t.length-1]))}),t.push({text:i.replace(/ +$/,``),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),r=n?n[0].length:0,i=t.text,a=y.stringWidth(i.trimRight());return t.span?this.wrap?r<a?e:(t.hidden=!0,i.trimRight()+` `.repeat(r-a)+e.trimLeft()):(t.hidden=!0,i+e):e}rasterize(e){let t=[],n=this.columnWidths(e),r;return e.forEach((e,i)=>{e.width=n[i],r=this.wrap?y.wrap(e.text,this.negatePadding(e),{hard:!0}).split(`
5
5
  `):e.text.split(`
6
- `),e.border&&(r.unshift(`.`+`-`.repeat(this.negatePadding(e)+2)+`.`),r.push(`'`+`-`.repeat(this.negatePadding(e)+2)+`'`)),e.padding&&(r.unshift(...Array(e.padding[_]||0).fill(``)),r.push(...Array(e.padding[y]||0).fill(``))),r.forEach((e,n)=>{t[n]||t.push([]);let r=t[n];for(let e=0;e<i;e++)r[e]===void 0&&r.push(``);r.push(e)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[te]||0)+(e.padding[v]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(e=>e.width||C.stringWidth(e.text));let t=e.length,n=this.width,r=e.map(e=>{if(e.width)return t--,n-=e.width,e.width}),i=t?Math.floor(n/t):0;return r.map((t,n)=>t===void 0?Math.max(i,b(e[n])):t)}};function re(e,t,n){return e.border?/[.']-+[.']/.test(t)?``:t.trim().length===0?` `:n:``}function b(e){let t=e.padding||[],n=1+(t[te]||0)+(t[v]||0);return e.border?n+4:n}function x(){return typeof process==`object`&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function S(e,t){e=e.trim();let n=C.stringWidth(e);return n<t?` `.repeat(t-n)+e:e}function ie(e,t){e=e.trim();let n=C.stringWidth(e);return n>=t?e:` `.repeat(t-n>>1)+e}let C;function ae(e,t){return C=t,new ne({width:(e==null?void 0:e.width)||x(),wrap:e==null?void 0:e.wrap})}const oe=RegExp(`\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)`,`g`);function se(e){return e.replace(oe,``)}function ce(e,t){let[n,r]=e.match(oe)||[``,``];e=se(e);let i=``;for(let n=0;n<e.length;n++)n!==0&&n%t===0&&(i+=`
7
- `),i+=e.charAt(n);return n&&r&&(i=`${n}${i}${r}`),i}function le(e){return ae(e,{stringWidth:e=>[...e].length,stripAnsi:se,wrap:ce})}function ue(e,t){let i=p(`.`,e),a,o=r(i);for(o.isDirectory()||(i=c(i));;){if(a=t(i,n(i)),a)return p(i,a);if(i=c(a=i),a===i)break}}
6
+ `),e.border&&(r.unshift(`.`+`-`.repeat(this.negatePadding(e)+2)+`.`),r.push(`'`+`-`.repeat(this.negatePadding(e)+2)+`'`)),e.padding&&(r.unshift(...Array(e.padding[0]||0).fill(``)),r.push(...Array(e.padding[2]||0).fill(``))),r.forEach((e,n)=>{t[n]||t.push([]);let r=t[n];for(let e=0;e<i;e++)r[e]===void 0&&r.push(``);r.push(e)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[3]||0)+(e.padding[1]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(e=>e.width||y.stringWidth(e.text));let t=e.length,n=this.width,r=e.map(e=>{if(e.width)return t--,n-=e.width,e.width}),i=t?Math.floor(n/t):0;return r.map((t,n)=>t===void 0?Math.max(i,v(e[n])):t)}};function te(e,t,n){return e.border?/[.']-+[.']/.test(t)?``:t.trim().length===0?` `:n:``}function v(e){let t=e.padding||[],n=1+(t[3]||0)+(t[1]||0);return e.border?n+4:n}function ne(){return typeof process==`object`&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function re(e,t){e=e.trim();let n=y.stringWidth(e);return n<t?` `.repeat(t-n)+e:e}function ie(e,t){e=e.trim();let n=y.stringWidth(e);return n>=t?e:` `.repeat(t-n>>1)+e}let y;function b(e,t){return y=t,new _({width:(e==null?void 0:e.width)||ne(),wrap:e==null?void 0:e.wrap})}const x=RegExp(`\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)`,`g`);function S(e){return e.replace(x,``)}function C(e,t){let[n,r]=e.match(x)||[``,``];e=S(e);let i=``;for(let n=0;n<e.length;n++)n!==0&&n%t===0&&(i+=`
7
+ `),i+=e.charAt(n);return n&&r&&(i=`${n}${i}${r}`),i}function ae(e){return b(e,{stringWidth:e=>[...e].length,stripAnsi:S,wrap:C})}function oe(e,t){let i=p(`.`,e),a;for(r(i).isDirectory()||(i=c(i));;){if(a=t(i,n(i)),a)return p(i,a);if(i=c(a=i),a===i)break}}
8
8
  /**
9
9
  * @license
10
10
  * Copyright (c) 2016, Contributors
11
11
  * SPDX-License-Identifier: ISC
12
12
  */
13
- function de(e){let t=e!==e.toLowerCase()&&e!==e.toUpperCase();if(t||(e=e.toLowerCase()),e.indexOf(`-`)===-1&&e.indexOf(`_`)===-1)return e;{let t=``,n=!1,r=e.match(/^-+/);for(let i=r?r[0].length:0;i<e.length;i++){let r=e.charAt(i);n&&(n=!1,r=r.toUpperCase()),i!==0&&(r===`-`||r===`_`)?n=!0:r!==`-`&&r!==`_`&&(t+=r)}return t}}function fe(e,t){let n=e.toLowerCase();t=t||`-`;let r=``;for(let i=0;i<e.length;i++){let a=n.charAt(i),o=e.charAt(i);a!==o&&i>0?r+=`${t}${n.charAt(i)}`:r+=o}return r}function pe(e){return e==null?!1:typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}
13
+ function se(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf(`-`)===-1&&e.indexOf(`_`)===-1)return e;{let t=``,n=!1,r=e.match(/^-+/);for(let i=r?r[0].length:0;i<e.length;i++){let r=e.charAt(i);n&&(n=!1,r=r.toUpperCase()),i!==0&&(r===`-`||r===`_`)?n=!0:r!==`-`&&r!==`_`&&(t+=r)}return t}}function ce(e,t){let n=e.toLowerCase();t=t||`-`;let r=``;for(let i=0;i<e.length;i++){let a=n.charAt(i),o=e.charAt(i);a!==o&&i>0?r+=`${t}${n.charAt(i)}`:r+=o}return r}function le(e){return e==null?!1:typeof e==`number`||/^0x[0-9a-f]+$/i.test(e)?!0:/^0[^.]/.test(e)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}
14
14
  /**
15
15
  * @license
16
16
  * Copyright (c) 2016, Contributors
17
17
  * SPDX-License-Identifier: ISC
18
18
  */
19
- function me(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e:e+``);e=e.trim();let t=0,n=null,r=null,i=null,a=[];for(let o=0;o<e.length;o++){if(n=r,r=e.charAt(o),r===` `&&!i){n!==` `&&t++;continue}r===i?i=null:(r===`'`||r===`"`)&&!i&&(i=r),a[t]||(a[t]=``),a[t]+=r}return a}
19
+ function ue(e){if(Array.isArray(e))return e.map(e=>typeof e==`string`?e:e+``);e=e.trim();let t=0,n=null,r=null,i=null,a=[];for(let o=0;o<e.length;o++){if(n=r,r=e.charAt(o),r===` `&&!i){n!==` `&&t++;continue}r===i?i=null:(r===`'`||r===`"`)&&!i&&(i=r),a[t]||(a[t]=``),a[t]+=r}return a}
20
20
  /**
21
21
  * @license
22
22
  * Copyright (c) 2016, Contributors
23
23
  * SPDX-License-Identifier: ISC
24
24
  */
25
- var w;(function(e){e.BOOLEAN=`boolean`,e.STRING=`string`,e.NUMBER=`number`,e.ARRAY=`array`})(w||(w={}));let T;var he=class{constructor(e){T=e}parse(e,t){let 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},t),r=me(e),i=typeof e==`string`,a=ge(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),s=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,u=o[`populate--`],d=u?`--`:`_`,f=Object.create(null),p=Object.create(null),m=n.__||T.format,h={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:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,ee=RegExp(`^--`+o[`negation-prefix`]+`(.+)`);[].concat(n.array||[]).filter(Boolean).forEach(function(e){let t=typeof e==`object`?e.key:e,n=Object.keys(e).map(function(e){let t={boolean:`bools`,string:`strings`,number:`numbers`};return t[e]}).filter(Boolean).pop();n&&(h[n][t]=!0),h.arrays[t]=!0,h.keys.push(t)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(e){h.bools[e]=!0,h.keys.push(e)}),[].concat(n.string||[]).filter(Boolean).forEach(function(e){h.strings[e]=!0,h.keys.push(e)}),[].concat(n.number||[]).filter(Boolean).forEach(function(e){h.numbers[e]=!0,h.keys.push(e)}),[].concat(n.count||[]).filter(Boolean).forEach(function(e){h.counts[e]=!0,h.keys.push(e)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(e){h.normalize[e]=!0,h.keys.push(e)}),typeof n.narg==`object`&&Object.entries(n.narg).forEach(([e,t])=>{typeof t==`number`&&(h.nargs[e]=t,h.keys.push(e))}),typeof n.coerce==`object`&&Object.entries(n.coerce).forEach(([e,t])=>{typeof t==`function`&&(h.coercions[e]=t,h.keys.push(e))}),n.config!==void 0&&(Array.isArray(n.config)||typeof n.config==`string`?[].concat(n.config).filter(Boolean).forEach(function(e){h.configs[e]=!0}):typeof n.config==`object`&&Object.entries(n.config).forEach(([e,t])=>{(typeof t==`boolean`||typeof t==`function`)&&(h.configs[e]=t)})),Se(n.key,a,n.default,h.arrays),Object.keys(s).forEach(function(e){(h.aliases[e]||[]).forEach(function(t){s[t]=s[e]})});let _=null;k();let v=[],y=Object.assign(Object.create(null),{_:[]}),te={};for(let e=0;e<r.length;e++){let t=r[e],n=t.replace(/^-{3,}/,`---`),i,a,s,c,l,u;if(t!==`--`&&/^-/.test(t)&&D(t))ne(t);else if(n.match(/^---+(=|$)/)){ne(t);continue}else if(t.match(/^--.+=/)||!o[`short-option-groups`]&&t.match(/^-.+=/))c=t.match(/^--?([^=]+)=([\s\S]*)$/),c!==null&&Array.isArray(c)&&c.length>=3&&(E(c[1],h.arrays)?e=b(e,c[1],r,c[2]):E(c[1],h.nargs)===!1?x(c[1],c[2],!0):e=re(e,c[1],r,c[2]));else if(t.match(ee)&&o[`boolean-negation`])c=t.match(ee),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],x(a,E(a,h.arrays)?[!1]:!1));else if(t.match(/^--.+/)||!o[`short-option-groups`]&&t.match(/^-[^-]+/))c=t.match(/^--?(.+)/),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],E(a,h.arrays)?e=b(e,a,r):E(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!l.match(/^-/)||l.match(g))&&!E(a,h.bools)&&!E(a,h.counts)||/^(true|false)$/.test(l)?(x(a,l),e++):x(a,De(a))):e=re(e,a,r));else if(t.match(/^-.\..+=/))c=t.match(/^-([^=]+)=([\s\S]*)$/),c!==null&&Array.isArray(c)&&c.length>=3&&x(c[1],c[2]);else if(t.match(/^-.\..+/)&&!t.match(g))l=r[e+1],c=t.match(/^-(.\..+)/),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],l!==void 0&&!l.match(/^-/)&&!E(a,h.bools)&&!E(a,h.counts)?(x(a,l),e++):x(a,De(a)));else if(t.match(/^-[^-]+/)&&!t.match(g)){s=t.slice(1,-1).split(``),i=!1;for(let n=0;n<s.length;n++){if(l=t.slice(n+2),s[n+1]&&s[n+1]===`=`){u=t.slice(n+3),a=s[n],E(a,h.arrays)?e=b(e,a,r,u):E(a,h.nargs)===!1?x(a,u):e=re(e,a,r,u),i=!0;break}if(l===`-`){x(s[n],l);continue}if(/[A-Za-z]/.test(s[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&E(l,h.bools)===!1){x(s[n],l),i=!0;break}if(s[n+1]&&s[n+1].match(/\W/)){x(s[n],l),i=!0;break}else x(s[n],De(s[n]))}a=t.slice(-1)[0],!i&&a!==`-`&&(E(a,h.arrays)?e=b(e,a,r):E(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!/^(-|--)[^-]/.test(l)||l.match(g))&&!E(a,h.bools)&&!E(a,h.counts)||/^(true|false)$/.test(l)?(x(a,l),e++):x(a,De(a))):e=re(e,a,r))}else if(t.match(/^-[0-9]$/)&&t.match(g)&&E(t.slice(1),h.bools))a=t.slice(1),x(a,De(a));else if(t===`--`){v=r.slice(e+1);break}else if(o[`halt-at-non-option`]){v=r.slice(e);break}else ne(t)}ce(y,!0),ce(y,!1),ae(y),se(),he(y,h.aliases,s,!0),le(y),o[`set-placeholder-key`]&&ue(y),Object.keys(h.counts).forEach(function(e){be(y,e.split(`.`))||x(e,0)}),u&&v.length&&(y[d]=[]),v.forEach(function(e){y[d].push(e)}),o[`camel-case-expansion`]&&o[`strip-dashed`]&&Object.keys(y).filter(e=>e!==`--`&&e.includes(`-`)).forEach(e=>{delete y[e]}),o[`strip-aliased`]&&[].concat(...Object.keys(a).map(e=>a[e])).forEach(e=>{o[`camel-case-expansion`]&&e.includes(`-`)&&delete y[e.split(`.`).map(e=>de(e)).join(`.`)],delete y[e]});function ne(e){let t=C(`_`,e);(typeof t==`string`||typeof t==`number`)&&y._.push(t)}function re(e,t,n,r){let i,a=E(t,h.nargs);if(a=typeof a!=`number`||isNaN(a)?1:a,a===0)return O(r)||(_=Error(m(`Argument unexpected for: %s`,t))),x(t,De(t)),e;let s=O(r)?0:1;if(o[`nargs-eats-options`])n.length-(e+1)+s<a&&(_=Error(m(`Not enough arguments following: %s`,t))),s=a;else{for(i=e+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(g)||D(n[i]));i++)s++;s<a&&(_=Error(m(`Not enough arguments following: %s`,t)))}let c=Math.min(s,a);for(!O(r)&&c>0&&(x(t,r),c--),i=e+1;i<c+e+1;i++)x(t,n[i]);return e+c}function b(e,t,n,r){let a=[],c=r||n[e+1],l=E(t,h.nargs);if(E(t,h.bools)&&!/^(true|false)$/.test(c))a.push(!0);else if(O(c)||O(r)&&/^-/.test(c)&&!g.test(c)&&!D(c)){if(s[t]!==void 0){let e=s[t];a=Array.isArray(e)?e:[e]}}else{O(r)||a.push(ie(t,r,!0));for(let r=e+1;r<n.length&&!(!o[`greedy-arrays`]&&a.length>0||l&&typeof l==`number`&&a.length>=l||(c=n[r],/^-/.test(c)&&!g.test(c)&&!D(c)));r++)e=r,a.push(ie(t,c,i))}return typeof l==`number`&&(l&&a.length<l||isNaN(l)&&a.length===0)&&(_=Error(m(`Not enough arguments following: %s`,t))),x(t,a),e}function x(e,t,n=i){if(/-/.test(e)&&o[`camel-case-expansion`]){let t=e.split(`.`).map(function(e){return de(e)}).join(`.`);S(e,t)}let r=ie(e,t,n),a=e.split(`.`);if(xe(y,a,r),h.aliases[e]&&h.aliases[e].forEach(function(e){let t=e.split(`.`);xe(y,t,r)}),a.length>1&&o[`dot-notation`]&&(h.aliases[a[0]]||[]).forEach(function(t){let n=t.split(`.`),i=[].concat(a);i.shift(),n=n.concat(i),(h.aliases[e]||[]).includes(n.join(`.`))||xe(y,n,r)}),E(e,h.normalize)&&!E(e,h.arrays)){let n=[e].concat(h.aliases[e]||[]);n.forEach(function(e){Object.defineProperty(te,e,{enumerable:!0,get(){return t},set(e){t=typeof e==`string`?T.normalize(e):e}})})}}function S(e,t){h.aliases[e]&&h.aliases[e].length||(h.aliases[e]=[t],f[t]=!0),h.aliases[t]&&h.aliases[t].length||S(t,e)}function ie(e,t,n){n&&(t=ye(t)),(E(e,h.bools)||E(e,h.counts))&&typeof t==`string`&&(t=t===`true`);let r=Array.isArray(t)?t.map(function(t){return C(e,t)}):C(e,t);return E(e,h.counts)&&(O(r)||typeof r==`boolean`)&&(r=_e()),E(e,h.normalize)&&E(e,h.arrays)&&(r=Array.isArray(t)?t.map(e=>T.normalize(e)):T.normalize(t)),r}function C(e,t){if(!o[`parse-positional-numbers`]&&e===`_`)return t;if(!E(e,h.strings)&&!E(e,h.bools)&&!Array.isArray(t)){let n=pe(t)&&o[`parse-numbers`]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)));(n||!O(t)&&E(e,h.numbers))&&(t=Number(t))}return t}function ae(e){let t=Object.create(null);he(t,h.aliases,s),Object.keys(h.configs).forEach(function(n){let r=e[n]||t[n];if(r)try{let e=null,t=T.resolve(T.cwd(),r),i=h.configs[n];if(typeof i==`function`){try{e=i(t)}catch(t){e=t}if(e instanceof Error){_=e;return}}else e=T.require(t);oe(e)}catch(t){t.name===`PermissionDenied`?_=t:e[n]&&(_=Error(m(`Invalid JSON config file: %s`,r)))}})}function oe(e,t){Object.keys(e).forEach(function(n){let r=e[n],i=t?t+`.`+n:n;typeof r==`object`&&r&&!Array.isArray(r)&&o[`dot-notation`]?oe(r,i):(!be(y,i.split(`.`))||E(i,h.arrays)&&o[`combine-arrays`])&&x(i,r)})}function se(){c!==void 0&&c.forEach(function(e){oe(e)})}function ce(e,t){if(l===void 0)return;let n=typeof l==`string`?l:``,r=T.env();Object.keys(r).forEach(function(i){if(n===``||i.lastIndexOf(n,0)===0){let a=i.split(`__`).map(function(e,t){return t===0&&(e=e.substring(n.length)),de(e)});(t&&h.configs[a.join(`.`)]||!t)&&!be(e,a)&&x(a.join(`.`),r[i])}})}function le(e){let t,n=new Set;Object.keys(e).forEach(function(r){if(!n.has(r)&&(t=E(r,h.coercions),typeof t==`function`))try{let i=C(r,t(e[r]));[].concat(h.aliases[r]||[],r).forEach(t=>{n.add(t),e[t]=i})}catch(e){_=e}})}function ue(e){return h.keys.forEach(t=>{~t.indexOf(`.`)||e[t]===void 0&&(e[t]=void 0)}),e}function he(e,t,n,r=!1){Object.keys(n).forEach(function(i){be(e,i.split(`.`))||(xe(e,i.split(`.`),n[i]),r&&(p[i]=!0),(t[i]||[]).forEach(function(t){be(e,t.split(`.`))||xe(e,t.split(`.`),n[i])}))})}function be(e,t){let n=e;o[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){n=n[e]||{}});let r=t[t.length-1];return typeof n==`object`?r in n:!1}function xe(e,t,n){let r=e;o[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){e=ve(e),typeof r==`object`&&r[e]===void 0&&(r[e]={}),typeof r[e]!=`object`||Array.isArray(r[e])?(Array.isArray(r[e])?r[e].push({}):r[e]=[r[e],{}],r=r[e][r[e].length-1]):r=r[e]});let i=ve(t[t.length-1]),a=E(t.join(`.`),h.arrays),s=Array.isArray(n),c=o[`duplicate-arguments-array`];!c&&E(i,h.nargs)&&(c=!0,(!O(r[i])&&h.nargs[i]===1||Array.isArray(r[i])&&r[i].length===h.nargs[i])&&(r[i]=void 0)),n===_e()?r[i]=_e(r[i]):Array.isArray(r[i])?c&&a&&s?r[i]=o[`flatten-duplicate-arrays`]?r[i].concat(n):(Array.isArray(r[i][0])?r[i]:[r[i]]).concat([n]):!c&&!!a==!!s?r[i]=n:r[i]=r[i].concat([n]):r[i]===void 0&&a?r[i]=s?n:[n]:c&&!(r[i]===void 0||E(i,h.counts)||E(i,h.bools))?r[i]=[r[i],n]:r[i]=n}function Se(...e){e.forEach(function(e){Object.keys(e||{}).forEach(function(e){h.aliases[e]||(h.aliases[e]=[].concat(a[e]||[]),h.aliases[e].concat(e).forEach(function(t){if(/-/.test(t)&&o[`camel-case-expansion`]){let n=de(t);n!==e&&h.aliases[e].indexOf(n)===-1&&(h.aliases[e].push(n),f[n]=!0)}}),h.aliases[e].concat(e).forEach(function(t){if(t.length>1&&/[A-Z]/.test(t)&&o[`camel-case-expansion`]){let n=fe(t,`-`);n!==e&&h.aliases[e].indexOf(n)===-1&&(h.aliases[e].push(n),f[n]=!0)}}),h.aliases[e].forEach(function(t){h.aliases[t]=[e].concat(h.aliases[e].filter(function(e){return t!==e}))}))})})}function E(e,t){let n=[].concat(h.aliases[e]||[],e),r=Object.keys(t),i=n.find(e=>r.includes(e));return i?t[i]:!1}function Ce(e){let t=Object.keys(h),n=[].concat(t.map(e=>h[e]));return n.some(function(t){return Array.isArray(t)?t.includes(e):t[e]})}function we(e,...t){let n=[].concat(...t);return n.some(function(t){let n=e.match(t);return n&&Ce(n[1])})}function Te(e){if(e.match(g)||!e.match(/^-[^-]+/))return!1;let t=!0,n,r=e.slice(1).split(``);for(let i=0;i<r.length;i++){if(n=e.slice(i+2),!Ce(r[i])){t=!1;break}if(r[i+1]&&r[i+1]===`=`||n===`-`||/[A-Za-z]/.test(r[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(n)||r[i+1]&&r[i+1].match(/\W/))break}return t}function D(e){return o[`unknown-options-as-args`]&&Ee(e)}function Ee(e){if(e=e.replace(/^-{3,}/,`--`),e.match(g)||Te(e))return!1;let t=/^-+([^=]+?)=[\s\S]*$/,n=/^-+([^=]+?)$/,r=/^-+([^=]+?)-$/,i=/^-+([^=]+?\d+)$/,a=/^-+([^=]+?)\W+.*$/;return!we(e,t,ee,n,r,i,a)}function De(e){return!E(e,h.bools)&&!E(e,h.counts)&&`${e}`in s?s[e]:Oe(ke(e))}function Oe(e){let t={[w.BOOLEAN]:!0,[w.STRING]:``,[w.NUMBER]:void 0,[w.ARRAY]:[]};return t[e]}function ke(e){let t=w.BOOLEAN;return E(e,h.strings)?t=w.STRING:E(e,h.numbers)?t=w.NUMBER:E(e,h.bools)?t=w.BOOLEAN:E(e,h.arrays)&&(t=w.ARRAY),t}function O(e){return e===void 0}function k(){Object.keys(h.counts).find(e=>E(e,h.arrays)?(_=Error(m(`Invalid configuration: %s, opts.count excludes opts.array.`,e)),!0):E(e,h.nargs)?(_=Error(m(`Invalid configuration: %s, opts.count excludes opts.narg.`,e)),!0):!1)}return{aliases:Object.assign({},h.aliases),argv:Object.assign(te,y),configuration:o,defaulted:Object.assign({},p),error:_,newAliases:Object.assign({},f)}}};function ge(e){let t=[],n=Object.create(null),r=!0;for(Object.keys(e).forEach(function(n){t.push([].concat(e[n],n))});r;){r=!1;for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++){let i=t[e].filter(function(e){return t[n].indexOf(e)!==-1});if(i.length){t[e]=t[e].concat(t[n]),t.splice(n,1),r=!0;break}}}return t.forEach(function(e){e=e.filter(function(e,t,n){return n.indexOf(e)===t});let t=e.pop();t!==void 0&&typeof t==`string`&&(n[t]=e)}),n}function _e(e){return e===void 0?1:e+1}function ve(e){return e===`__proto__`?`___proto___`:e}function ye(e){return typeof e==`string`&&(e[0]===`'`||e[0]===`"`)&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}
25
+ var w;(function(e){e.BOOLEAN=`boolean`,e.STRING=`string`,e.NUMBER=`number`,e.ARRAY=`array`})(w||(w={}));let T;var de=class{constructor(e){T=e}parse(e,t){let 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},t),r=ue(e),i=typeof e==`string`,a=fe(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),s=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,u=o[`populate--`],d=u?`--`:`_`,f=Object.create(null),p=Object.create(null),m=n.__||T.format,h={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:[]},g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,ee=RegExp(`^--`+o[`negation-prefix`]+`(.+)`);[].concat(n.array||[]).filter(Boolean).forEach(function(e){let t=typeof e==`object`?e.key:e,n=Object.keys(e).map(function(e){return{boolean:`bools`,string:`strings`,number:`numbers`}[e]}).filter(Boolean).pop();n&&(h[n][t]=!0),h.arrays[t]=!0,h.keys.push(t)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(e){h.bools[e]=!0,h.keys.push(e)}),[].concat(n.string||[]).filter(Boolean).forEach(function(e){h.strings[e]=!0,h.keys.push(e)}),[].concat(n.number||[]).filter(Boolean).forEach(function(e){h.numbers[e]=!0,h.keys.push(e)}),[].concat(n.count||[]).filter(Boolean).forEach(function(e){h.counts[e]=!0,h.keys.push(e)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(e){h.normalize[e]=!0,h.keys.push(e)}),typeof n.narg==`object`&&Object.entries(n.narg).forEach(([e,t])=>{typeof t==`number`&&(h.nargs[e]=t,h.keys.push(e))}),typeof n.coerce==`object`&&Object.entries(n.coerce).forEach(([e,t])=>{typeof t==`function`&&(h.coercions[e]=t,h.keys.push(e))}),n.config!==void 0&&(Array.isArray(n.config)||typeof n.config==`string`?[].concat(n.config).filter(Boolean).forEach(function(e){h.configs[e]=!0}):typeof n.config==`object`&&Object.entries(n.config).forEach(([e,t])=>{(typeof t==`boolean`||typeof t==`function`)&&(h.configs[e]=t)})),Se(n.key,a,n.default,h.arrays),Object.keys(s).forEach(function(e){(h.aliases[e]||[]).forEach(function(t){s[t]=s[e]})});let _=null;ke();let te=[],v=Object.assign(Object.create(null),{_:[]}),ne={};for(let e=0;e<r.length;e++){let t=r[e],n=t.replace(/^-{3,}/,`---`),i,a,s,c,l,u;if(t!==`--`&&/^-/.test(t)&&Ee(t))re(t);else if(n.match(/^---+(=|$)/)){re(t);continue}else if(t.match(/^--.+=/)||!o[`short-option-groups`]&&t.match(/^-.+=/))c=t.match(/^--?([^=]+)=([\s\S]*)$/),c!==null&&Array.isArray(c)&&c.length>=3&&(E(c[1],h.arrays)?e=y(e,c[1],r,c[2]):E(c[1],h.nargs)===!1?b(c[1],c[2],!0):e=ie(e,c[1],r,c[2]));else if(t.match(ee)&&o[`boolean-negation`])c=t.match(ee),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],b(a,E(a,h.arrays)?[!1]:!1));else if(t.match(/^--.+/)||!o[`short-option-groups`]&&t.match(/^-[^-]+/))c=t.match(/^--?(.+)/),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],E(a,h.arrays)?e=y(e,a,r):E(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!l.match(/^-/)||l.match(g))&&!E(a,h.bools)&&!E(a,h.counts)||/^(true|false)$/.test(l)?(b(a,l),e++):b(a,D(a))):e=ie(e,a,r));else if(t.match(/^-.\..+=/))c=t.match(/^-([^=]+)=([\s\S]*)$/),c!==null&&Array.isArray(c)&&c.length>=3&&b(c[1],c[2]);else if(t.match(/^-.\..+/)&&!t.match(g))l=r[e+1],c=t.match(/^-(.\..+)/),c!==null&&Array.isArray(c)&&c.length>=2&&(a=c[1],l!==void 0&&!l.match(/^-/)&&!E(a,h.bools)&&!E(a,h.counts)?(b(a,l),e++):b(a,D(a)));else if(t.match(/^-[^-]+/)&&!t.match(g)){s=t.slice(1,-1).split(``),i=!1;for(let n=0;n<s.length;n++){if(l=t.slice(n+2),s[n+1]&&s[n+1]===`=`){u=t.slice(n+3),a=s[n],E(a,h.arrays)?e=y(e,a,r,u):E(a,h.nargs)===!1?b(a,u):e=ie(e,a,r,u),i=!0;break}if(l===`-`){b(s[n],l);continue}if(/[A-Za-z]/.test(s[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&E(l,h.bools)===!1){b(s[n],l),i=!0;break}if(s[n+1]&&s[n+1].match(/\W/)){b(s[n],l),i=!0;break}else b(s[n],D(s[n]))}a=t.slice(-1)[0],!i&&a!==`-`&&(E(a,h.arrays)?e=y(e,a,r):E(a,h.nargs)===!1?(l=r[e+1],l!==void 0&&(!/^(-|--)[^-]/.test(l)||l.match(g))&&!E(a,h.bools)&&!E(a,h.counts)||/^(true|false)$/.test(l)?(b(a,l),e++):b(a,D(a))):e=ie(e,a,r))}else if(t.match(/^-[0-9]$/)&&t.match(g)&&E(t.slice(1),h.bools))a=t.slice(1),b(a,D(a));else if(t===`--`){te=r.slice(e+1);break}else if(o[`halt-at-non-option`]){te=r.slice(e);break}else re(t)}ge(v,!0),ge(v,!1),ae(v),de(),ye(v,h.aliases,s,!0),_e(v),o[`set-placeholder-key`]&&ve(v),Object.keys(h.counts).forEach(function(e){be(v,e.split(`.`))||b(e,0)}),u&&te.length&&(v[d]=[]),te.forEach(function(e){v[d].push(e)}),o[`camel-case-expansion`]&&o[`strip-dashed`]&&Object.keys(v).filter(e=>e!==`--`&&e.includes(`-`)).forEach(e=>{delete v[e]}),o[`strip-aliased`]&&[].concat(...Object.keys(a).map(e=>a[e])).forEach(e=>{o[`camel-case-expansion`]&&e.includes(`-`)&&delete v[e.split(`.`).map(e=>se(e)).join(`.`)],delete v[e]});function re(e){let t=C(`_`,e);(typeof t==`string`||typeof t==`number`)&&v._.push(t)}function ie(e,t,n,r){let i,a=E(t,h.nargs);if(a=typeof a!=`number`||isNaN(a)?1:a,a===0)return k(r)||(_=Error(m(`Argument unexpected for: %s`,t))),b(t,D(t)),e;let s=k(r)?0:1;if(o[`nargs-eats-options`])n.length-(e+1)+s<a&&(_=Error(m(`Not enough arguments following: %s`,t))),s=a;else{for(i=e+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(g)||Ee(n[i]));i++)s++;s<a&&(_=Error(m(`Not enough arguments following: %s`,t)))}let c=Math.min(s,a);for(!k(r)&&c>0&&(b(t,r),c--),i=e+1;i<c+e+1;i++)b(t,n[i]);return e+c}function y(e,t,n,r){let a=[],c=r||n[e+1],l=E(t,h.nargs);if(E(t,h.bools)&&!/^(true|false)$/.test(c))a.push(!0);else if(k(c)||k(r)&&/^-/.test(c)&&!g.test(c)&&!Ee(c)){if(s[t]!==void 0){let e=s[t];a=Array.isArray(e)?e:[e]}}else{k(r)||a.push(S(t,r,!0));for(let r=e+1;r<n.length&&!(!o[`greedy-arrays`]&&a.length>0||l&&typeof l==`number`&&a.length>=l||(c=n[r],/^-/.test(c)&&!g.test(c)&&!Ee(c)));r++)e=r,a.push(S(t,c,i))}return typeof l==`number`&&(l&&a.length<l||isNaN(l)&&a.length===0)&&(_=Error(m(`Not enough arguments following: %s`,t))),b(t,a),e}function b(e,t,n=i){if(/-/.test(e)&&o[`camel-case-expansion`]){let t=e.split(`.`).map(function(e){return se(e)}).join(`.`);x(e,t)}let r=S(e,t,n),a=e.split(`.`);xe(v,a,r),h.aliases[e]&&h.aliases[e].forEach(function(e){let t=e.split(`.`);xe(v,t,r)}),a.length>1&&o[`dot-notation`]&&(h.aliases[a[0]]||[]).forEach(function(t){let n=t.split(`.`),i=[].concat(a);i.shift(),n=n.concat(i),(h.aliases[e]||[]).includes(n.join(`.`))||xe(v,n,r)}),E(e,h.normalize)&&!E(e,h.arrays)&&[e].concat(h.aliases[e]||[]).forEach(function(e){Object.defineProperty(ne,e,{enumerable:!0,get(){return t},set(e){t=typeof e==`string`?T.normalize(e):e}})})}function x(e,t){h.aliases[e]&&h.aliases[e].length||(h.aliases[e]=[t],f[t]=!0),h.aliases[t]&&h.aliases[t].length||x(t,e)}function S(e,t,n){n&&(t=he(t)),(E(e,h.bools)||E(e,h.counts))&&typeof t==`string`&&(t=t===`true`);let r=Array.isArray(t)?t.map(function(t){return C(e,t)}):C(e,t);return E(e,h.counts)&&(k(r)||typeof r==`boolean`)&&(r=pe()),E(e,h.normalize)&&E(e,h.arrays)&&(r=Array.isArray(t)?t.map(e=>T.normalize(e)):T.normalize(t)),r}function C(e,t){return!o[`parse-positional-numbers`]&&e===`_`||!E(e,h.strings)&&!E(e,h.bools)&&!Array.isArray(t)&&(le(t)&&o[`parse-numbers`]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))||!k(t)&&E(e,h.numbers))&&(t=Number(t)),t}function ae(e){let t=Object.create(null);ye(t,h.aliases,s),Object.keys(h.configs).forEach(function(n){let r=e[n]||t[n];if(r)try{let e=null,t=T.resolve(T.cwd(),r),i=h.configs[n];if(typeof i==`function`){try{e=i(t)}catch(t){e=t}if(e instanceof Error){_=e;return}}else e=T.require(t);oe(e)}catch(t){t.name===`PermissionDenied`?_=t:e[n]&&(_=Error(m(`Invalid JSON config file: %s`,r)))}})}function oe(e,t){Object.keys(e).forEach(function(n){let r=e[n],i=t?t+`.`+n:n;typeof r==`object`&&r&&!Array.isArray(r)&&o[`dot-notation`]?oe(r,i):(!be(v,i.split(`.`))||E(i,h.arrays)&&o[`combine-arrays`])&&b(i,r)})}function de(){c!==void 0&&c.forEach(function(e){oe(e)})}function ge(e,t){if(l===void 0)return;let n=typeof l==`string`?l:``,r=T.env();Object.keys(r).forEach(function(i){if(n===``||i.lastIndexOf(n,0)===0){let a=i.split(`__`).map(function(e,t){return t===0&&(e=e.substring(n.length)),se(e)});(t&&h.configs[a.join(`.`)]||!t)&&!be(e,a)&&b(a.join(`.`),r[i])}})}function _e(e){let t,n=new Set;Object.keys(e).forEach(function(r){if(!n.has(r)&&(t=E(r,h.coercions),typeof t==`function`))try{let i=C(r,t(e[r]));[].concat(h.aliases[r]||[],r).forEach(t=>{n.add(t),e[t]=i})}catch(e){_=e}})}function ve(e){return h.keys.forEach(t=>{~t.indexOf(`.`)||e[t]===void 0&&(e[t]=void 0)}),e}function ye(e,t,n,r=!1){Object.keys(n).forEach(function(i){be(e,i.split(`.`))||(xe(e,i.split(`.`),n[i]),r&&(p[i]=!0),(t[i]||[]).forEach(function(t){be(e,t.split(`.`))||xe(e,t.split(`.`),n[i])}))})}function be(e,t){let n=e;o[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){n=n[e]||{}});let r=t[t.length-1];return typeof n==`object`?r in n:!1}function xe(e,t,n){let r=e;o[`dot-notation`]||(t=[t.join(`.`)]),t.slice(0,-1).forEach(function(e){e=me(e),typeof r==`object`&&r[e]===void 0&&(r[e]={}),typeof r[e]!=`object`||Array.isArray(r[e])?(Array.isArray(r[e])?r[e].push({}):r[e]=[r[e],{}],r=r[e][r[e].length-1]):r=r[e]});let i=me(t[t.length-1]),a=E(t.join(`.`),h.arrays),s=Array.isArray(n),c=o[`duplicate-arguments-array`];!c&&E(i,h.nargs)&&(c=!0,(!k(r[i])&&h.nargs[i]===1||Array.isArray(r[i])&&r[i].length===h.nargs[i])&&(r[i]=void 0)),n===pe()?r[i]=pe(r[i]):Array.isArray(r[i])?c&&a&&s?r[i]=o[`flatten-duplicate-arrays`]?r[i].concat(n):(Array.isArray(r[i][0])?r[i]:[r[i]]).concat([n]):!c&&!!a==!!s?r[i]=n:r[i]=r[i].concat([n]):r[i]===void 0&&a?r[i]=s?n:[n]:c&&!(r[i]===void 0||E(i,h.counts)||E(i,h.bools))?r[i]=[r[i],n]:r[i]=n}function Se(...e){e.forEach(function(e){Object.keys(e||{}).forEach(function(e){h.aliases[e]||(h.aliases[e]=[].concat(a[e]||[]),h.aliases[e].concat(e).forEach(function(t){if(/-/.test(t)&&o[`camel-case-expansion`]){let n=se(t);n!==e&&h.aliases[e].indexOf(n)===-1&&(h.aliases[e].push(n),f[n]=!0)}}),h.aliases[e].concat(e).forEach(function(t){if(t.length>1&&/[A-Z]/.test(t)&&o[`camel-case-expansion`]){let n=ce(t,`-`);n!==e&&h.aliases[e].indexOf(n)===-1&&(h.aliases[e].push(n),f[n]=!0)}}),h.aliases[e].forEach(function(t){h.aliases[t]=[e].concat(h.aliases[e].filter(function(e){return t!==e}))}))})})}function E(e,t){let n=[].concat(h.aliases[e]||[],e),r=Object.keys(t),i=n.find(e=>r.includes(e));return i?t[i]:!1}function Ce(e){let t=Object.keys(h);return[].concat(t.map(e=>h[e])).some(function(t){return Array.isArray(t)?t.includes(e):t[e]})}function we(e,...t){return[].concat(...t).some(function(t){let n=e.match(t);return n&&Ce(n[1])})}function Te(e){if(e.match(g)||!e.match(/^-[^-]+/))return!1;let t=!0,n,r=e.slice(1).split(``);for(let i=0;i<r.length;i++){if(n=e.slice(i+2),!Ce(r[i])){t=!1;break}if(r[i+1]&&r[i+1]===`=`||n===`-`||/[A-Za-z]/.test(r[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(n)||r[i+1]&&r[i+1].match(/\W/))break}return t}function Ee(e){return o[`unknown-options-as-args`]&&De(e)}function De(e){return e=e.replace(/^-{3,}/,`--`),e.match(g)||Te(e)?!1:!we(e,/^-+([^=]+?)=[\s\S]*$/,ee,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function D(e){return!E(e,h.bools)&&!E(e,h.counts)&&`${e}`in s?s[e]:Oe(O(e))}function Oe(e){return{[w.BOOLEAN]:!0,[w.STRING]:``,[w.NUMBER]:void 0,[w.ARRAY]:[]}[e]}function O(e){let t=w.BOOLEAN;return E(e,h.strings)?t=w.STRING:E(e,h.numbers)?t=w.NUMBER:E(e,h.bools)?t=w.BOOLEAN:E(e,h.arrays)&&(t=w.ARRAY),t}function k(e){return e===void 0}function ke(){Object.keys(h.counts).find(e=>E(e,h.arrays)?(_=Error(m(`Invalid configuration: %s, opts.count excludes opts.array.`,e)),!0):E(e,h.nargs)?(_=Error(m(`Invalid configuration: %s, opts.count excludes opts.narg.`,e)),!0):!1)}return{aliases:Object.assign({},h.aliases),argv:Object.assign(ne,v),configuration:o,defaulted:Object.assign({},p),error:_,newAliases:Object.assign({},f)}}};function fe(e){let t=[],n=Object.create(null),r=!0;for(Object.keys(e).forEach(function(n){t.push([].concat(e[n],n))});r;){r=!1;for(let e=0;e<t.length;e++)for(let n=e+1;n<t.length;n++)if(t[e].filter(function(e){return t[n].indexOf(e)!==-1}).length){t[e]=t[e].concat(t[n]),t.splice(n,1),r=!0;break}}return t.forEach(function(e){e=e.filter(function(e,t,n){return n.indexOf(e)===t});let t=e.pop();t!==void 0&&typeof t==`string`&&(n[t]=e)}),n}function pe(e){return e===void 0?1:e+1}function me(e){return e===`__proto__`?`___proto___`:e}function he(e){return typeof e==`string`&&(e[0]===`'`||e[0]===`"`)&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}
26
26
  /**
27
27
  * @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
28
28
  * CJS and ESM environments.
@@ -31,8 +31,27 @@ var w;(function(e){e.BOOLEAN=`boolean`,e.STRING=`string`,e.NUMBER=`number`,e.ARR
31
31
  * Copyright (c) 2016, Contributors
32
32
  * SPDX-License-Identifier: ISC
33
33
  */
34
- var be,xe,Se;const E=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Ce=(xe=(be=process==null?void 0:process.versions)==null?void 0:be.node)==null?(Se=process==null?void 0:process.version)==null?void 0:Se.slice(1):xe;if(Ce){let e=Number(Ce.match(/^([^.]+)/)[1]);if(e<E)throw Error(`yargs parser supports a minimum Node.js version of ${E}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const we=process?process.env:{},Te=new he({cwd:process.cwd,env:()=>we,format:m,normalize:d,resolve:p,require:n=>{if(e!==void 0)return e(n);if(n.match(/\.json$/))return JSON.parse(t(n,`utf8`));throw Error(`only .json config files are supported in ESM`)}}),D=function(e,t){let n=Te.parse(e.slice(),t);return n.argv};D.detailed=function(e,t){return Te.parse(e.slice(),t)},D.camelCase=de,D.decamelize=fe,D.looksLikeNumber=pe;var Ee=D;function De(){return Oe()?0:1}function Oe(){return ke()&&!process.defaultApp}function ke(){return!!process.versions.electron}function O(){return process.argv[De()]}var k=class e extends Error{constructor(t){super(t||`yargs error`),this.name=`YError`,Error.captureStackTrace&&Error.captureStackTrace(this,e)}},Ae={fs:{readFileSync:t,writeFile:i},format:m,resolve:p,exists:e=>{try{return r(e).isFile()}catch(e){return!1}}};let A;var je=class{constructor(e){e=e||{},this.directory=e.directory||`./locales`,this.updateFiles=typeof e.updateFiles==`boolean`?e.updateFiles:!0,this.locale=e.locale||`en`,this.fallbackToLanguage=typeof e.fallbackToLanguage==`boolean`?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!=`string`)return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]==`function`&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),A.format.apply(A.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),r=e.shift(),i=function(){};typeof e[e.length-1]==`function`&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let a=r===1?t:n;if(this.cache[this.locale][t]){let e=this.cache[this.locale][t];a=e[r===1?`one`:`other`]}!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();let o=[a];return~a.indexOf(`%d`)&&o.push(r),A.format.apply(A.format,o.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){for(let t in this.cache[this.locale]||this._readLocaleFile(),e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n=``;return e.forEach(function(e,r){let i=t[r+1];n+=e,i!==void 0&&(n+=`%s`)}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,r=t.locale,i=t.cb,a=this._resolveLocaleFile(n,r),o=JSON.stringify(this.cache[r],null,2);A.fs.writeFile(a,o,`utf-8`,function(t){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(t)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{A.fs.readFileSync&&(e=JSON.parse(A.fs.readFileSync(t,`utf-8`)))}catch(n){if(n instanceof SyntaxError&&(n.message=`syntax error in `+t),n.code===`ENOENT`)e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=A.resolve(e,`./`,t+`.json`);if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf(`_`)){let r=A.resolve(e,`./`,t.split(`_`)[0]+`.json`);this._fileExistsSync(r)&&(n=r)}return n}_fileExistsSync(e){return A.exists(e)}};function Me(e,t){A=t;let n=new je(e);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}}const Ne=e=>Me(e,Ae);var Pe=Ne;const Fe=`require is not supported by ESM`,Ie=`loading a directory of commands is not supported yet for ESM`;let Le;try{Le=g(import.meta.url)}catch(e){Le=process.cwd()}const Re=Le.substring(0,Le.lastIndexOf(`node_modules`));var ze={assert:{notStrictEqual:a,strictEqual:o},cliui:le,findUp:ue,getEnv:e=>process.env[e],inspect:h,getCallerFile:()=>{throw new k(Ie)},getProcessArgvBin:O,mainFilename:Re||process.cwd(),Parser:Ee,path:{basename:s,dirname:c,extname:l,relative:f,resolve:p},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:process.stdout.columns===void 0?null:process.stdout.columns},readFileSync:t,require:()=>{throw new k(Fe)},requireDirectory:()=>{throw new k(Ie)},stringWidth:e=>[...e].length,y18n:Pe({directory:p(Le,`../../../locales`),updateFiles:!1})};function j(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function Be(e,t){t.assert.strictEqual(typeof e,`string`)}function Ve(e){return Object.keys(e)}function M(e){return!!e&&!!e.then&&typeof e.then==`function`}function He(e){let t=e.replace(/\s{2,}/g,` `),n=t.split(/\s+(?![^[]*]|[^<]*>)/),r=/\.*[\][<>]/g,i=n.shift();if(!i)throw Error(`No command found in: ${e}`);let a={cmd:i.replace(r,``),demanded:[],optional:[]};return n.forEach((e,t)=>{let i=!1;e=e.replace(/\s/g,``),/\.+[\]>]/.test(e)&&t===n.length-1&&(i=!0),/^\[/.test(e)?a.optional.push({cmd:e.replace(r,``).split(`|`),variadic:i}):a.demanded.push({cmd:e.replace(r,``).split(`|`),variadic:i})}),a}const Ue=[`first`,`second`,`third`,`fourth`,`fifth`,`sixth`];function N(e,t,n){function r(){return typeof e==`object`?[{demanded:[],optional:[]},e,t]:[He(`cmd ${e}`),t,n]}try{let e=0,[t,n,i]=r(),a=[].slice.call(n);for(;a.length&&a[a.length-1]===void 0;)a.pop();let o=i||a.length;if(o<t.demanded.length)throw new k(`Not enough arguments provided. Expected ${t.demanded.length} but received ${a.length}.`);let s=t.demanded.length+t.optional.length;if(o>s)throw new k(`Too many arguments provided. Expected max ${s} but received ${o}.`);t.demanded.forEach(t=>{let n=a.shift(),r=We(n),i=t.cmd.filter(e=>e===r||e===`*`);i.length===0&&Ge(r,t.cmd,e),e+=1}),t.optional.forEach(t=>{if(a.length===0)return;let n=a.shift(),r=We(n),i=t.cmd.filter(e=>e===r||e===`*`);i.length===0&&Ge(r,t.cmd,e),e+=1})}catch(e){console.warn(e.stack)}}function We(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e}function Ge(e,t,n){throw new k(`Invalid ${Ue[n]||`manyith`} argument. Expected ${t.join(` or `)} but received ${e}.`)}var Ke=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0,r=!1){if(N(`<array|function> [boolean] [boolean] [boolean]`,[e,t,n],arguments.length),Array.isArray(e)){for(let r=0;r<e.length;r++){if(typeof e[r]!=`function`)throw Error(`middleware must be a function`);let i=e[r];i.applyBeforeValidation=t,i.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e==`function`){let i=e;i.applyBeforeValidation=t,i.global=n,i.mutates=r,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(e=>{let r=[...n[t]||[],t];return e.option?!r.includes(e.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function qe(e){return e?e.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Je(e,t,n,r){return n.reduce((e,n)=>{if(n.applyBeforeValidation!==r)return e;if(n.mutates){if(n.applied)return e;n.applied=!0}if(M(e))return e.then(e=>Promise.all([e,n(e,t)])).then(([e,t])=>Object.assign(e,t));{let r=n(e,t);return M(r)?r.then(t=>Object.assign(e,t)):Object.assign(e,r)}},e)}function Ye(e,t,n=e=>{throw e}){try{let n=Xe(e)?e():e;return M(n)?n.then(e=>t(e)):t(n)}catch(e){return n(e)}}function Xe(e){return typeof e==`function`}function Ze(t){if(e===void 0)return null;for(let n=0,r=Object.keys(e.cache),i;n<r.length;n++)if(i=e.cache[r[n]],i.exports===t)return i;return null}const Qe=/(^\*)|(^\$0)/;var $e=class{constructor(e,t,n,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,r){r=r||{},typeof r.recurse!=`boolean`&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=[`js`]);let i=typeof r.visit==`function`?r.visit:e=>e;r.visit=(e,t,n)=>{let r=i(e,t,n);if(r){if(this.requireCache.has(t))return r;this.requireCache.add(t),this.addHandler(r)}return r},this.shim.requireDirectory({require:t,filename:n},e,r)}addHandler(e,t,n,r,i,a){let o=[],s=qe(i);if(r=r||(()=>{}),Array.isArray(e))if(nt(e))[e,...o]=e;else for(let t of e)this.addHandler(t);else if(at(e)){let t=Array.isArray(e.command)||typeof e.command==`string`?e.command:this.moduleName(e);e.aliases&&(t=[].concat(t,e.aliases)),this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(tt(n)){this.addHandler([e].concat(o),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e==`string`){let i=He(e);o=o.map(e=>He(e).cmd);let c=!1,l=[i.cmd].concat(o).filter(e=>Qe.test(e)?(c=!0,!1):!0);l.length===0&&c&&l.push(`$0`),c&&(i.cmd=l[0],o=l.slice(1),e=e.replace(Qe,i.cmd)),o.forEach(e=>{this.aliasMap[e]=i.cmd}),t!==!1&&this.usage.command(e,t,c,o,a),this.handlers[i.cmd]={original:e,description:t,handler:r,builder:n||{},middlewares:s,deprecated:a,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(e,t,n,r,i,a){let o=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,s=t.getInternalMethods().getContext(),c=s.commands.slice(),l=!e;e&&(s.commands.push(e),s.fullCommands.push(o.original));let u=this.applyBuilderUpdateUsageAndParse(l,o,t,n.aliases,c,r,i,a);return M(u)?u.then(e=>this.applyMiddlewareAndGetResult(l,o,e.innerArgv,s,i,e.aliases,t)):this.applyMiddlewareAndGetResult(l,o,u.innerArgv,s,i,u.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,r,i,a,o,s){let c=t.builder,l=n;if(rt(c)){n.getInternalMethods().getUsageInstance().freeze();let u=c(n.getInternalMethods().reset(r),s);if(M(u))return u.then(r=>(l=jn(r)?r:n,this.parseAndUpdateUsage(e,t,l,i,a,o)))}else it(c)&&(n.getInternalMethods().getUsageInstance().freeze(),l=n.getInternalMethods().reset(r),Object.keys(t.builder).forEach(e=>{l.option(e,c[e])}));return this.parseAndUpdateUsage(e,t,l,i,a,o)}parseAndUpdateUsage(e,t,n,r,i,a){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,t),t.description);let o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,a);return M(o)?o.then(e=>({aliases:n.parsed.aliases,innerArgv:e})):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=Qe.test(t.original)?t.original.replace(Qe,``).trim():t.original,r=e.filter(e=>!Qe.test(e));return r.push(n),`$0 ${r.join(` `)}`}handleValidationAndGetResult(e,t,n,r,i,a,o,s){if(!a.getInternalMethods().getHasOutput()){let t=a.getInternalMethods().runValidation(i,s,a.parsed.error,e);n=Ye(n,e=>(t(e),e))}if(t.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let r=!!a.getOptions().configuration[`populate--`];a.getInternalMethods().postProcess(n,r,!1,!1),n=Je(n,a,o,!1),n=Ye(n,e=>{let n=t.handler(e);return M(n)?n.then(()=>e):e}),e||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),M(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(e=>{try{a.getInternalMethods().getUsageInstance().fail(null,e)}catch(e){}})}return e||(r.commands.pop(),r.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,t,n,r,i,a,o){let s={};if(i)return n;o.getInternalMethods().getHasOutput()||(s=this.populatePositionals(t,n,r,o));let c=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),l=Je(n,o,c,!0);return M(l)?l.then(n=>this.handleValidationAndGetResult(e,t,n,r,a,o,c,s)):this.handleValidationAndGetResult(e,t,l,r,a,o,c,s)}populatePositionals(e,t,n,r){t._=t._.slice(n.commands.length);let i=e.demanded.slice(0),a=e.optional.slice(0),o={};for(this.validation.positionalCount(i.length,t._.length);i.length;){let e=i.shift();this.populatePositional(e,t,o)}for(;a.length;){let e=a.shift();this.populatePositional(e,t,o)}return t._=n.commands.concat(t._.map(e=>``+e)),this.postProcessPositionals(t,o,this.cmdToParseOptions(e.original),r),o}populatePositional(e,t,n){let r=e.cmd[0];e.variadic?n[r]=t._.splice(0).map(String):t._.length&&(n[r]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=He(e);return n.demanded.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r,t.demand[n]=!0}),n.optional.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r}),t}postProcessPositionals(e,t,n,r){let i=Object.assign({},r.getOptions());i.default=Object.assign(n.default,i.default);for(let e of Object.keys(n.alias))i.alias[e]=(i.alias[e]||[]).concat(n.alias[e]);i.array=i.array.concat(n.array),i.config={};let a=[];if(Object.keys(t).forEach(e=>{t[e].map(t=>{i.configuration[`unknown-options-as-args`]&&(i.key[e]=!0),a.push(`--${e}`),a.push(t)})}),!a.length)return;let o=Object.assign({},i.configuration,{"populate--":!1}),s=this.shim.Parser.detailed(a,Object.assign({},i,{configuration:o}));if(s.error)r.getInternalMethods().getUsageInstance().fail(s.error.message,s.error);else{let n=Object.keys(t);Object.keys(t).forEach(e=>{n.push(...s.aliases[e])}),Object.keys(s.argv).forEach(i=>{n.includes(i)&&(t[i]||(t[i]=s.argv[i]),!this.isInConfigs(r,i)&&!this.isDefaulted(r,i)&&Object.prototype.hasOwnProperty.call(e,i)&&Object.prototype.hasOwnProperty.call(s.argv,i)&&(Array.isArray(e[i])||Array.isArray(s.argv[i]))?e[i]=[].concat(e[i],s.argv[i]):e[i]=s.argv[i])})}}isDefaulted(e,t){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,t)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(t))}isInConfigs(e,t){let{configObjects:n}=e.getOptions();return n.some(e=>Object.prototype.hasOwnProperty.call(e,t))||n.some(e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let t=Qe.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,`$0 `);e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(rt(t))return t(e,!0);tt(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=Ze(e);if(!t)throw Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(let r of[e,t,n]){if(typeof r==`string`||r===!1)return r;j(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();j(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function et(e,t,n,r){return new $e(e,t,n,r)}function tt(e){return typeof e==`object`&&!!e.builder&&typeof e.handler==`function`}function nt(e){return e.every(e=>typeof e==`string`)}function rt(e){return typeof e==`function`}function it(e){return typeof e==`object`}function at(e){return typeof e==`object`&&!Array.isArray(e)}function ot(e={},t=()=>!0){let n={};return Ve(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function st(e){typeof process>`u`||[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking==`function`&&n._handle.setBlocking(e)})}function ct(e){return typeof e==`boolean`}function lt(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(e){i.push(e)};let a=null,o=null,s=!0;r.showHelpOnFail=function(t=!0,n){let[i,c]=typeof t==`string`?[!0,t]:[t,n];return e.getInternalMethods().isGlobalContext()&&(o=c),a=c,s=i,r};let c=!1;r.fail=function(t,n){let l=e.getInternalMethods().getLoggerInstance();if(i.length)for(let e=i.length-1;e>=0;--e){let a=i[e];if(ct(a)){if(n)throw n;if(t)throw Error(t)}else a(t,n,r)}else{if(e.getExitProcess()&&st(!0),!c){c=!0,s&&(e.showHelp(`error`),l.error()),(t||n)&&l.error(t||n);let r=a||o;r&&((t||n)&&l.error(``),l.error(r))}if(n=n||new k(t),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,n);throw n}};let l=[],u=!1;r.usage=(e,t)=>e===null?(u=!0,l=[],r):(u=!1,l.push([e,t||``]),r),r.getUsage=()=>l,r.getUsageDisabled=()=>u,r.getPositionalGroupName=()=>n(`Positionals:`);let d=[];r.example=(e,t)=>{d.push([e,t||``])};let f=[];r.command=function(e,t,n,r,i=!1){n&&(f=f.map(e=>(e[2]=!1,e))),f.push([e,t||``,n,r,i])},r.getCommands=()=>f;let p={};r.describe=function(e,t){Array.isArray(e)?e.forEach(e=>{r.describe(e,t)}):typeof e==`object`?Object.keys(e).forEach(t=>{r.describe(t,e[t])}):p[e]=t},r.getDescriptions=()=>p;let m=[];r.epilog=e=>{m.push(e)};let h=!1,g;r.wrap=e=>{h=!0,g=e},r.getWrap=()=>t.getEnv(`YARGS_DISABLE_WRAP`)?null:(h||(g=b(),h=!0),g);let ee=`__yargsString__:`;r.deferY18nLookup=e=>ee+e,r.help=function(){if(y)return y;v();let i=e.customScriptName?e.$0:t.path.basename(e.$0),a=e.getDemandedOptions(),o=e.getDemandedCommands(),s=e.getDeprecatedOptions(),c=e.getGroups(),h=e.getOptions(),g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(a)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(h.default)),g=g.filter(ne),g=Object.keys(g.reduce((e,t)=>(t!==`_`&&(e[t]=!0),e),{}));let b=r.getWrap(),x=t.cliui({width:b,wrap:!!b});if(!u){if(l.length)l.forEach(e=>{x.div({text:`${e[0].replace(/\$0/g,i)}`}),e[1]&&x.div({text:`${e[1]}`,padding:[1,0,0,0]})}),x.div();else if(f.length){let e=null;e=o._?`${i} <${n(`command`)}>\n`:`${i} [${n(`command`)}]\n`,x.div(`${e}`)}}if(f.length>1||f.length===1&&!f[0][2]){x.div(n(`Commands:`));let t=e.getInternalMethods().getContext(),r=t.commands.length?`${t.commands.join(` `)} `:``;e.getInternalMethods().getParserConfiguration()[`sort-commands`]===!0&&(f=f.sort((e,t)=>e[0].localeCompare(t[0])));let a=i?`${i} `:``;f.forEach(e=>{let t=`${a}${r}${e[0].replace(/^\$0 ?/,``)}`;x.span({text:t,padding:[0,2,0,2],width:_(f,b,`${i}${r}`)+4},{text:e[1]});let o=[];e[2]&&o.push(`[${n(`default`)}]`),e[3]&&e[3].length&&o.push(`[${n(`aliases:`)} ${e[3].join(`, `)}]`),e[4]&&(typeof e[4]==`string`?o.push(`[${n(`deprecated: %s`,e[4])}]`):o.push(`[${n(`deprecated`)}]`)),o.length?x.div({text:o.join(` `),padding:[0,0,0,2],align:`right`}):x.div()}),x.div()}let S=(Object.keys(h.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter(t=>!e.parsed.newAliases[t]&&S.every(e=>(h.alias[e]||[]).indexOf(t)===-1));let ie=n(`Options:`);c[ie]||(c[ie]=[]),te(g,h.alias,c,ie);let C=e=>/^--/.test(pt(e)),ae=Object.keys(c).filter(e=>c[e].length>0).map(e=>{let t=c[e].filter(ne).map(e=>{if(S.includes(e))return e;for(let t=0,n;(n=S[t])!==void 0;t++)if((h.alias[n]||[]).includes(e))return n;return e});return{groupName:e,normalizedKeys:t}}).filter(({normalizedKeys:e})=>e.length>0).map(({groupName:e,normalizedKeys:t})=>{let n=t.reduce((t,n)=>(t[n]=[n].concat(h.alias[n]||[]).map(t=>e===r.getPositionalGroupName()?t:(/^[0-9]$/.test(t)?h.boolean.includes(n)?`-`:`--`:t.length>1?`--`:`-`)+t).sort((e,t)=>C(e)===C(t)?0:C(e)?1:-1).join(`, `),t),{});return{groupName:e,normalizedKeys:t,switches:n}}),oe=ae.filter(({groupName:e})=>e!==r.getPositionalGroupName()).some(({normalizedKeys:e,switches:t})=>!e.every(e=>C(t[e])));if(oe&&ae.filter(({groupName:e})=>e!==r.getPositionalGroupName()).forEach(({normalizedKeys:e,switches:t})=>{e.forEach(e=>{C(t[e])&&(t[e]=dt(t[e],4))})}),ae.forEach(({groupName:t,normalizedKeys:i,switches:o})=>{x.div(t),i.forEach(t=>{let i=o[t],c=p[t]||``,l=null;c.includes(ee)&&(c=n(c.substring(ee.length))),h.boolean.includes(t)&&(l=`[${n(`boolean`)}]`),h.count.includes(t)&&(l=`[${n(`count`)}]`),h.string.includes(t)&&(l=`[${n(`string`)}]`),h.normalize.includes(t)&&(l=`[${n(`string`)}]`),h.array.includes(t)&&(l=`[${n(`array`)}]`),h.number.includes(t)&&(l=`[${n(`number`)}]`);let u=e=>typeof e==`string`?`[${n(`deprecated: %s`,e)}]`:`[${n(`deprecated`)}]`,d=[t in s?u(s[t]):null,l,t in a?`[${n(`required`)}]`:null,h.choices&&h.choices[t]?`[${n(`choices:`)} ${r.stringifiedValues(h.choices[t])}]`:null,re(h.default[t],h.defaultDescription[t])].filter(Boolean).join(` `);x.span({text:pt(i),padding:[0,2,0,2+ft(i)],width:_(o,b)+4},c);let f=e.getInternalMethods().getUsageConfiguration()[`hide-types`]===!0;d&&!f?x.div({text:d,padding:[0,0,0,2],align:`right`}):x.div()}),x.div()}),d.length&&(x.div(n(`Examples:`)),d.forEach(e=>{e[0]=e[0].replace(/\$0/g,i)}),d.forEach(e=>{e[1]===``?x.div({text:e[0],padding:[0,2,0,2]}):x.div({text:e[0],padding:[0,2,0,2],width:_(d,b)+4},{text:e[1]})}),x.div()),m.length>0){let e=m.map(e=>e.replace(/\$0/g,i)).join(`
35
- `);x.div(`${e}\n`)}return x.toString().replace(/\s*$/,``)};function _(e,n,r){let i=0;return Array.isArray(e)||(e=Object.values(e).map(e=>[e])),e.forEach(e=>{i=Math.max(t.stringWidth(r?`${r} ${pt(e[0])}`:pt(e[0]))+ft(e[0]),i)}),n&&(i=Math.min(i,parseInt((n*.5).toString(),10))),i}function v(){let t=e.getDemandedOptions(),n=e.getOptions();(Object.keys(n.alias)||[]).forEach(i=>{n.alias[i].forEach(a=>{p[a]&&r.describe(i,p[a]),a in t&&e.demandOption(i,t[a]),n.boolean.includes(a)&&e.boolean(i),n.count.includes(a)&&e.count(i),n.string.includes(a)&&e.string(i),n.normalize.includes(a)&&e.normalize(i),n.array.includes(a)&&e.array(i),n.number.includes(a)&&e.number(i)})})}let y;r.cacheHelpMessage=function(){y=this.help()},r.clearCachedHelpMessage=function(){y=void 0},r.hasCachedHelpMessage=function(){return!!y};function te(e,t,n,r){let i=[],a=null;return Object.keys(n).forEach(e=>{i=i.concat(n[e])}),e.forEach(e=>{a=[e].concat(t[e]),a.some(e=>i.indexOf(e)!==-1)||n[r].push(e)}),i}function ne(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=t=>{let n=e.getInternalMethods().getLoggerInstance();t||(t=`error`);let i=typeof t==`function`?t:n[t];i(r.help())},r.functionDescription=e=>{let r=e.name?t.Parser.decamelize(e.name,`-`):n(`generated-value`);return[`(`,r,`)`].join(``)},r.stringifiedValues=function(e,t){let n=``,r=t||`, `,i=[].concat(e);return!e||!i.length||i.forEach(e=>{n.length&&(n+=r),n+=JSON.stringify(e)}),n};function re(e,t){let r=`[${n(`default:`)} `;if(e===void 0&&!t)return null;if(t)r+=t;else switch(typeof e){case`string`:r+=`"${e}"`;break;case`object`:r+=JSON.stringify(e);break;default:r+=e}return`${r}]`}function b(){let e=80;return t.process.stdColumns?Math.min(e,t.process.stdColumns):e}let x=null;r.version=e=>{x=e},r.showVersion=t=>{let n=e.getInternalMethods().getLoggerInstance();t||(t=`error`);let r=typeof t==`function`?t:n[t];r(x)},r.reset=function(e){return a=null,c=!1,l=[],u=!1,m=[],d=[],f=[],p=ot(p,t=>!e[t]),r};let S=[];return r.freeze=function(){S.push({failMessage:a,failureOutput:c,usages:l,usageDisabled:u,epilogs:m,examples:d,commands:f,descriptions:p})},r.unfreeze=function(e=!1){let t=S.pop();t&&(e?(p={...t.descriptions,...p},f=[...t.commands,...f],l=[...t.usages,...l],d=[...t.examples,...d],m=[...t.epilogs,...m]):{failMessage:a,failureOutput:c,usages:l,usageDisabled:u,epilogs:m,examples:d,commands:f,descriptions:p}=t)},r}function ut(e){return typeof e==`object`}function dt(e,t){return ut(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function ft(e){return ut(e)?e.indentation:0}function pt(e){return ut(e)?e.text:e}const mt=`###-begin-{{app_name}}-completions-###
34
+ var ge,_e,ve;const ye=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,be=(_e=(ge=process==null?void 0:process.versions)==null?void 0:ge.node)==null?(ve=process==null?void 0:process.version)==null?void 0:ve.slice(1):_e;if(be&&Number(be.match(/^([^.]+)/)[1])<ye)throw Error(`yargs parser supports a minimum Node.js version of ${ye}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);const xe=process?process.env:{},Se=new de({cwd:process.cwd,env:()=>xe,format:m,normalize:d,resolve:p,require:n=>{if(e!==void 0)return e(n);if(n.match(/\.json$/))return JSON.parse(t(n,`utf8`));throw Error(`only .json config files are supported in ESM`)}}),E=function(e,t){return Se.parse(e.slice(),t).argv};E.detailed=function(e,t){return Se.parse(e.slice(),t)},E.camelCase=se,E.decamelize=ce,E.looksLikeNumber=le;var Ce=E;function we(){return Te()?0:1}function Te(){return Ee()&&!process.defaultApp}function Ee(){return!!process.versions.electron}function De(){return process.argv[we()]}var D=class e extends Error{constructor(t){super(t||`yargs error`),this.name=`YError`,Error.captureStackTrace&&Error.captureStackTrace(this,e)}},Oe={fs:{readFileSync:t,writeFile:i},format:m,resolve:p,exists:e=>{try{return r(e).isFile()}catch(e){return!1}}};let O;var k=class{constructor(e){e=e||{},this.directory=e.directory||`./locales`,this.updateFiles=typeof e.updateFiles==`boolean`?e.updateFiles:!0,this.locale=e.locale||`en`,this.fallbackToLanguage=typeof e.fallbackToLanguage==`boolean`?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!=`string`)return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]==`function`&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),O.format.apply(O.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),r=e.shift(),i=function(){};typeof e[e.length-1]==`function`&&(i=e.pop()),this.cache[this.locale]||this._readLocaleFile();let a=r===1?t:n;this.cache[this.locale][t]&&(a=this.cache[this.locale][t][r===1?`one`:`other`]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();let o=[a];return~a.indexOf(`%d`)&&o.push(r),O.format.apply(O.format,o.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){for(let t in this.cache[this.locale]||this._readLocaleFile(),e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let n=``;return e.forEach(function(e,r){let i=t[r+1];n+=e,i!==void 0&&(n+=`%s`)}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,r=t.locale,i=t.cb,a=this._resolveLocaleFile(n,r),o=JSON.stringify(this.cache[r],null,2);O.fs.writeFile(a,o,`utf-8`,function(t){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),i(t)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{O.fs.readFileSync&&(e=JSON.parse(O.fs.readFileSync(t,`utf-8`)))}catch(n){if(n instanceof SyntaxError&&(n.message=`syntax error in `+t),n.code===`ENOENT`)e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=O.resolve(e,`./`,t+`.json`);if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf(`_`)){let r=O.resolve(e,`./`,t.split(`_`)[0]+`.json`);this._fileExistsSync(r)&&(n=r)}return n}_fileExistsSync(e){return O.exists(e)}};function ke(e,t){O=t;let n=new k(e);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}}var Ae=e=>ke(e,Oe);const je=`loading a directory of commands is not supported yet for ESM`;let Me;try{Me=g(import.meta.url)}catch(e){Me=process.cwd()}const Ne=Me.substring(0,Me.lastIndexOf(`node_modules`));var Pe={assert:{notStrictEqual:a,strictEqual:o},cliui:ae,findUp:oe,getEnv:e=>process.env[e],inspect:h,getCallerFile:()=>{throw new D(je)},getProcessArgvBin:De,mainFilename:Ne||process.cwd(),Parser:Ce,path:{basename:s,dirname:c,extname:l,relative:f,resolve:p},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:process.stdout.columns===void 0?null:process.stdout.columns},readFileSync:t,require:()=>{throw new D(`require is not supported by ESM`)},requireDirectory:()=>{throw new D(je)},stringWidth:e=>[...e].length,y18n:Ae({directory:p(Me,`../../../locales`),updateFiles:!1})};function A(e,t,n,r){n.assert.notStrictEqual(e,t,r)}function Fe(e,t){t.assert.strictEqual(typeof e,`string`)}function Ie(e){return Object.keys(e)}function j(e){return!!e&&!!e.then&&typeof e.then==`function`}function Le(e){let t=e.replace(/\s{2,}/g,` `).split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,r=t.shift();if(!r)throw Error(`No command found in: ${e}`);let i={cmd:r.replace(n,``),demanded:[],optional:[]};return t.forEach((e,r)=>{let a=!1;e=e.replace(/\s/g,``),/\.+[\]>]/.test(e)&&r===t.length-1&&(a=!0),/^\[/.test(e)?i.optional.push({cmd:e.replace(n,``).split(`|`),variadic:a}):i.demanded.push({cmd:e.replace(n,``).split(`|`),variadic:a})}),i}const Re=[`first`,`second`,`third`,`fourth`,`fifth`,`sixth`];function M(e,t,n){function r(){return typeof e==`object`?[{demanded:[],optional:[]},e,t]:[Le(`cmd ${e}`),t,n]}try{let e=0,[t,n,i]=r(),a=[].slice.call(n);for(;a.length&&a[a.length-1]===void 0;)a.pop();let o=i||a.length;if(o<t.demanded.length)throw new D(`Not enough arguments provided. Expected ${t.demanded.length} but received ${a.length}.`);let s=t.demanded.length+t.optional.length;if(o>s)throw new D(`Too many arguments provided. Expected max ${s} but received ${o}.`);t.demanded.forEach(t=>{let n=a.shift(),r=ze(n);t.cmd.filter(e=>e===r||e===`*`).length===0&&Be(r,t.cmd,e),e+=1}),t.optional.forEach(t=>{if(a.length===0)return;let n=a.shift(),r=ze(n);t.cmd.filter(e=>e===r||e===`*`).length===0&&Be(r,t.cmd,e),e+=1})}catch(e){console.warn(e.stack)}}function ze(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e}function Be(e,t,n){throw new D(`Invalid ${Re[n]||`manyith`} argument. Expected ${t.join(` or `)} but received ${e}.`)}var Ve=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0,r=!1){if(M(`<array|function> [boolean] [boolean] [boolean]`,[e,t,n],arguments.length),Array.isArray(e)){for(let r=0;r<e.length;r++){if(typeof e[r]!=`function`)throw Error(`middleware must be a function`);let i=e[r];i.applyBeforeValidation=t,i.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e==`function`){let i=e;i.applyBeforeValidation=t,i.global=n,i.mutates=r,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(e=>{let r=[...n[t]||[],t];return e.option?!r.includes(e.option):!0}),e.option=t,this.addMiddleware(e,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let e=this.frozens.pop();e!==void 0&&(this.globalMiddleware=e)}reset(){this.globalMiddleware=this.globalMiddleware.filter(e=>e.global)}};function He(e){return e?e.map(e=>(e.applyBeforeValidation=!1,e)):[]}function Ue(e,t,n,r){return n.reduce((e,n)=>{if(n.applyBeforeValidation!==r)return e;if(n.mutates){if(n.applied)return e;n.applied=!0}if(j(e))return e.then(e=>Promise.all([e,n(e,t)])).then(([e,t])=>Object.assign(e,t));{let r=n(e,t);return j(r)?r.then(t=>Object.assign(e,t)):Object.assign(e,r)}},e)}function We(e,t,n=e=>{throw e}){try{let n=Ge(e)?e():e;return j(n)?n.then(e=>t(e)):t(n)}catch(e){return n(e)}}function Ge(e){return typeof e==`function`}function Ke(t){if(e===void 0)return null;for(let n=0,r=Object.keys(e.cache),i;n<r.length;n++)if(i=e.cache[r[n]],i.exports===t)return i;return null}const qe=/(^\*)|(^\$0)/;var Je=class{constructor(e,t,n,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,r){r=r||{},typeof r.recurse!=`boolean`&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=[`js`]);let i=typeof r.visit==`function`?r.visit:e=>e;r.visit=(e,t,n)=>{let r=i(e,t,n);if(r){if(this.requireCache.has(t))return r;this.requireCache.add(t),this.addHandler(r)}return r},this.shim.requireDirectory({require:t,filename:n},e,r)}addHandler(e,t,n,r,i,a){let o=[],s=He(i);if(r=r||(()=>{}),Array.isArray(e))if(Ze(e))[e,...o]=e;else for(let t of e)this.addHandler(t);else if(et(e)){let t=Array.isArray(e.command)||typeof e.command==`string`?e.command:this.moduleName(e);e.aliases&&(t=[].concat(t,e.aliases)),this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Xe(n)){this.addHandler([e].concat(o),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e==`string`){let i=Le(e);o=o.map(e=>Le(e).cmd);let c=!1,l=[i.cmd].concat(o).filter(e=>qe.test(e)?(c=!0,!1):!0);l.length===0&&c&&l.push(`$0`),c&&(i.cmd=l[0],o=l.slice(1),e=e.replace(qe,i.cmd)),o.forEach(e=>{this.aliasMap[e]=i.cmd}),t!==!1&&this.usage.command(e,t,c,o,a),this.handlers[i.cmd]={original:e,description:t,handler:r,builder:n||{},middlewares:s,deprecated:a,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(e,t,n,r,i,a){let o=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,s=t.getInternalMethods().getContext(),c=s.commands.slice(),l=!e;e&&(s.commands.push(e),s.fullCommands.push(o.original));let u=this.applyBuilderUpdateUsageAndParse(l,o,t,n.aliases,c,r,i,a);return j(u)?u.then(e=>this.applyMiddlewareAndGetResult(l,o,e.innerArgv,s,i,e.aliases,t)):this.applyMiddlewareAndGetResult(l,o,u.innerArgv,s,i,u.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,r,i,a,o,s){let c=t.builder,l=n;if(Qe(c)){n.getInternalMethods().getUsageInstance().freeze();let u=c(n.getInternalMethods().reset(r),s);if(j(u))return u.then(r=>(l=Cn(r)?r:n,this.parseAndUpdateUsage(e,t,l,i,a,o)))}else $e(c)&&(n.getInternalMethods().getUsageInstance().freeze(),l=n.getInternalMethods().reset(r),Object.keys(t.builder).forEach(e=>{l.option(e,c[e])}));return this.parseAndUpdateUsage(e,t,l,i,a,o)}parseAndUpdateUsage(e,t,n,r,i,a){e&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,t),t.description);let o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,a);return j(o)?o.then(e=>({aliases:n.parsed.aliases,innerArgv:e})):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=qe.test(t.original)?t.original.replace(qe,``).trim():t.original,r=e.filter(e=>!qe.test(e));return r.push(n),`$0 ${r.join(` `)}`}handleValidationAndGetResult(e,t,n,r,i,a,o,s){if(!a.getInternalMethods().getHasOutput()){let t=a.getInternalMethods().runValidation(i,s,a.parsed.error,e);n=We(n,e=>(t(e),e))}if(t.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let r=!!a.getOptions().configuration[`populate--`];a.getInternalMethods().postProcess(n,r,!1,!1),n=Ue(n,a,o,!1),n=We(n,e=>{let n=t.handler(e);return j(n)?n.then(()=>e):e}),e||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),j(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(e=>{try{a.getInternalMethods().getUsageInstance().fail(null,e)}catch(e){}})}return e||(r.commands.pop(),r.fullCommands.pop()),n}applyMiddlewareAndGetResult(e,t,n,r,i,a,o){let s={};if(i)return n;o.getInternalMethods().getHasOutput()||(s=this.populatePositionals(t,n,r,o));let c=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),l=Ue(n,o,c,!0);return j(l)?l.then(n=>this.handleValidationAndGetResult(e,t,n,r,a,o,c,s)):this.handleValidationAndGetResult(e,t,l,r,a,o,c,s)}populatePositionals(e,t,n,r){t._=t._.slice(n.commands.length);let i=e.demanded.slice(0),a=e.optional.slice(0),o={};for(this.validation.positionalCount(i.length,t._.length);i.length;){let e=i.shift();this.populatePositional(e,t,o)}for(;a.length;){let e=a.shift();this.populatePositional(e,t,o)}return t._=n.commands.concat(t._.map(e=>``+e)),this.postProcessPositionals(t,o,this.cmdToParseOptions(e.original),r),o}populatePositional(e,t,n){let r=e.cmd[0];e.variadic?n[r]=t._.splice(0).map(String):t._.length&&(n[r]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=Le(e);return n.demanded.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r,t.demand[n]=!0}),n.optional.forEach(e=>{let[n,...r]=e.cmd;e.variadic&&(t.array.push(n),t.default[n]=[]),t.alias[n]=r}),t}postProcessPositionals(e,t,n,r){let i=Object.assign({},r.getOptions());i.default=Object.assign(n.default,i.default);for(let e of Object.keys(n.alias))i.alias[e]=(i.alias[e]||[]).concat(n.alias[e]);i.array=i.array.concat(n.array),i.config={};let a=[];if(Object.keys(t).forEach(e=>{t[e].map(t=>{i.configuration[`unknown-options-as-args`]&&(i.key[e]=!0),a.push(`--${e}`),a.push(t)})}),!a.length)return;let o=Object.assign({},i.configuration,{"populate--":!1}),s=this.shim.Parser.detailed(a,Object.assign({},i,{configuration:o}));if(s.error)r.getInternalMethods().getUsageInstance().fail(s.error.message,s.error);else{let n=Object.keys(t);Object.keys(t).forEach(e=>{n.push(...s.aliases[e])}),Object.keys(s.argv).forEach(i=>{n.includes(i)&&(t[i]||(t[i]=s.argv[i]),!this.isInConfigs(r,i)&&!this.isDefaulted(r,i)&&Object.prototype.hasOwnProperty.call(e,i)&&Object.prototype.hasOwnProperty.call(s.argv,i)&&(Array.isArray(e[i])||Array.isArray(s.argv[i]))?e[i]=[].concat(e[i],s.argv[i]):e[i]=s.argv[i])})}}isDefaulted(e,t){let{default:n}=e.getOptions();return Object.prototype.hasOwnProperty.call(n,t)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(t))}isInConfigs(e,t){let{configObjects:n}=e.getOptions();return n.some(e=>Object.prototype.hasOwnProperty.call(e,t))||n.some(e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let t=qe.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,`$0 `);e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(Qe(t))return t(e,!0);Xe(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=Ke(e);if(!t)throw Error(`No command name given for module: ${this.shim.inspect(e)}`);return this.commandFromFilename(t.filename)}commandFromFilename(e){return this.shim.path.basename(e,this.shim.path.extname(e))}extractDesc({describe:e,description:t,desc:n}){for(let r of[e,t,n]){if(typeof r==`string`||r===!1)return r;A(r,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();A(e,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}};function Ye(e,t,n,r){return new Je(e,t,n,r)}function Xe(e){return typeof e==`object`&&!!e.builder&&typeof e.handler==`function`}function Ze(e){return e.every(e=>typeof e==`string`)}function Qe(e){return typeof e==`function`}function $e(e){return typeof e==`object`}function et(e){return typeof e==`object`&&!Array.isArray(e)}function tt(e={},t=()=>!0){let n={};return Ie(e).forEach(r=>{t(r,e[r])&&(n[r]=e[r])}),n}function nt(e){typeof process>`u`||[process.stdout,process.stderr].forEach(t=>{let n=t;n._handle&&n.isTTY&&typeof n._handle.setBlocking==`function`&&n._handle.setBlocking(e)})}function rt(e){return typeof e==`boolean`}function it(e,t){let n=t.y18n.__,r={},i=[];r.failFn=function(e){i.push(e)};let a=null,o=null,s=!0;r.showHelpOnFail=function(t=!0,n){let[i,c]=typeof t==`string`?[!0,t]:[t,n];return e.getInternalMethods().isGlobalContext()&&(o=c),a=c,s=i,r};let c=!1;r.fail=function(t,n){let l=e.getInternalMethods().getLoggerInstance();if(i.length)for(let e=i.length-1;e>=0;--e){let a=i[e];if(rt(a)){if(n)throw n;if(t)throw Error(t)}else a(t,n,r)}else{if(e.getExitProcess()&&nt(!0),!c){c=!0,s&&(e.showHelp(`error`),l.error()),(t||n)&&l.error(t||n);let r=a||o;r&&((t||n)&&l.error(``),l.error(r))}if(n=n||new D(t),e.getExitProcess())return e.exit(1);if(e.getInternalMethods().hasParseCallback())return e.exit(1,n);throw n}};let l=[],u=!1;r.usage=(e,t)=>e===null?(u=!0,l=[],r):(u=!1,l.push([e,t||``]),r),r.getUsage=()=>l,r.getUsageDisabled=()=>u,r.getPositionalGroupName=()=>n(`Positionals:`);let d=[];r.example=(e,t)=>{d.push([e,t||``])};let f=[];r.command=function(e,t,n,r,i=!1){n&&(f=f.map(e=>(e[2]=!1,e))),f.push([e,t||``,n,r,i])},r.getCommands=()=>f;let p={};r.describe=function(e,t){Array.isArray(e)?e.forEach(e=>{r.describe(e,t)}):typeof e==`object`?Object.keys(e).forEach(t=>{r.describe(t,e[t])}):p[e]=t},r.getDescriptions=()=>p;let m=[];r.epilog=e=>{m.push(e)};let h=!1,g;r.wrap=e=>{h=!0,g=e},r.getWrap=()=>t.getEnv(`YARGS_DISABLE_WRAP`)?null:(h||(g=y(),h=!0),g);let ee=`__yargsString__:`;r.deferY18nLookup=e=>ee+e,r.help=function(){if(v)return v;te();let i=e.customScriptName?e.$0:t.path.basename(e.$0),a=e.getDemandedOptions(),o=e.getDemandedCommands(),s=e.getDeprecatedOptions(),c=e.getGroups(),h=e.getOptions(),g=[];g=g.concat(Object.keys(p)),g=g.concat(Object.keys(a)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(h.default)),g=g.filter(re),g=Object.keys(g.reduce((e,t)=>(t!==`_`&&(e[t]=!0),e),{}));let y=r.getWrap(),b=t.cliui({width:y,wrap:!!y});if(!u){if(l.length)l.forEach(e=>{b.div({text:`${e[0].replace(/\$0/g,i)}`}),e[1]&&b.div({text:`${e[1]}`,padding:[1,0,0,0]})}),b.div();else if(f.length){let e=null;e=o._?`${i} <${n(`command`)}>\n`:`${i} [${n(`command`)}]\n`,b.div(`${e}`)}}if(f.length>1||f.length===1&&!f[0][2]){b.div(n(`Commands:`));let t=e.getInternalMethods().getContext(),r=t.commands.length?`${t.commands.join(` `)} `:``;e.getInternalMethods().getParserConfiguration()[`sort-commands`]===!0&&(f=f.sort((e,t)=>e[0].localeCompare(t[0])));let a=i?`${i} `:``;f.forEach(e=>{let t=`${a}${r}${e[0].replace(/^\$0 ?/,``)}`;b.span({text:t,padding:[0,2,0,2],width:_(f,y,`${i}${r}`)+4},{text:e[1]});let o=[];e[2]&&o.push(`[${n(`default`)}]`),e[3]&&e[3].length&&o.push(`[${n(`aliases:`)} ${e[3].join(`, `)}]`),e[4]&&(typeof e[4]==`string`?o.push(`[${n(`deprecated: %s`,e[4])}]`):o.push(`[${n(`deprecated`)}]`)),o.length?b.div({text:o.join(` `),padding:[0,0,0,2],align:`right`}):b.div()}),b.div()}let x=(Object.keys(h.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter(t=>!e.parsed.newAliases[t]&&x.every(e=>(h.alias[e]||[]).indexOf(t)===-1));let S=n(`Options:`);c[S]||(c[S]=[]),ne(g,h.alias,c,S);let C=e=>/^--/.test(ct(e)),ae=Object.keys(c).filter(e=>c[e].length>0).map(e=>{let t=c[e].filter(re).map(e=>{if(x.includes(e))return e;for(let t=0,n;(n=x[t])!==void 0;t++)if((h.alias[n]||[]).includes(e))return n;return e});return{groupName:e,normalizedKeys:t}}).filter(({normalizedKeys:e})=>e.length>0).map(({groupName:e,normalizedKeys:t})=>{let n=t.reduce((t,n)=>(t[n]=[n].concat(h.alias[n]||[]).map(t=>e===r.getPositionalGroupName()?t:(/^[0-9]$/.test(t)?h.boolean.includes(n)?`-`:`--`:t.length>1?`--`:`-`)+t).sort((e,t)=>C(e)===C(t)?0:C(e)?1:-1).join(`, `),t),{});return{groupName:e,normalizedKeys:t,switches:n}});if(ae.filter(({groupName:e})=>e!==r.getPositionalGroupName()).some(({normalizedKeys:e,switches:t})=>!e.every(e=>C(t[e])))&&ae.filter(({groupName:e})=>e!==r.getPositionalGroupName()).forEach(({normalizedKeys:e,switches:t})=>{e.forEach(e=>{C(t[e])&&(t[e]=ot(t[e],4))})}),ae.forEach(({groupName:t,normalizedKeys:i,switches:o})=>{b.div(t),i.forEach(t=>{let i=o[t],c=p[t]||``,l=null;c.includes(ee)&&(c=n(c.substring(16))),h.boolean.includes(t)&&(l=`[${n(`boolean`)}]`),h.count.includes(t)&&(l=`[${n(`count`)}]`),h.string.includes(t)&&(l=`[${n(`string`)}]`),h.normalize.includes(t)&&(l=`[${n(`string`)}]`),h.array.includes(t)&&(l=`[${n(`array`)}]`),h.number.includes(t)&&(l=`[${n(`number`)}]`);let u=[t in s?(e=>typeof e==`string`?`[${n(`deprecated: %s`,e)}]`:`[${n(`deprecated`)}]`)(s[t]):null,l,t in a?`[${n(`required`)}]`:null,h.choices&&h.choices[t]?`[${n(`choices:`)} ${r.stringifiedValues(h.choices[t])}]`:null,ie(h.default[t],h.defaultDescription[t])].filter(Boolean).join(` `);b.span({text:ct(i),padding:[0,2,0,2+st(i)],width:_(o,y)+4},c);let d=e.getInternalMethods().getUsageConfiguration()[`hide-types`]===!0;u&&!d?b.div({text:u,padding:[0,0,0,2],align:`right`}):b.div()}),b.div()}),d.length&&(b.div(n(`Examples:`)),d.forEach(e=>{e[0]=e[0].replace(/\$0/g,i)}),d.forEach(e=>{e[1]===``?b.div({text:e[0],padding:[0,2,0,2]}):b.div({text:e[0],padding:[0,2,0,2],width:_(d,y)+4},{text:e[1]})}),b.div()),m.length>0){let e=m.map(e=>e.replace(/\$0/g,i)).join(`
35
+ `);b.div(`${e}\n`)}return b.toString().replace(/\s*$/,``)};function _(e,n,r){let i=0;return Array.isArray(e)||(e=Object.values(e).map(e=>[e])),e.forEach(e=>{i=Math.max(t.stringWidth(r?`${r} ${ct(e[0])}`:ct(e[0]))+st(e[0]),i)}),n&&(i=Math.min(i,parseInt((n*.5).toString(),10))),i}function te(){let t=e.getDemandedOptions(),n=e.getOptions();(Object.keys(n.alias)||[]).forEach(i=>{n.alias[i].forEach(a=>{p[a]&&r.describe(i,p[a]),a in t&&e.demandOption(i,t[a]),n.boolean.includes(a)&&e.boolean(i),n.count.includes(a)&&e.count(i),n.string.includes(a)&&e.string(i),n.normalize.includes(a)&&e.normalize(i),n.array.includes(a)&&e.array(i),n.number.includes(a)&&e.number(i)})})}let v;r.cacheHelpMessage=function(){v=this.help()},r.clearCachedHelpMessage=function(){v=void 0},r.hasCachedHelpMessage=function(){return!!v};function ne(e,t,n,r){let i=[],a=null;return Object.keys(n).forEach(e=>{i=i.concat(n[e])}),e.forEach(e=>{a=[e].concat(t[e]),a.some(e=>i.indexOf(e)!==-1)||n[r].push(e)}),i}function re(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}r.showHelp=t=>{let n=e.getInternalMethods().getLoggerInstance();t||(t=`error`),(typeof t==`function`?t:n[t])(r.help())},r.functionDescription=e=>[`(`,e.name?t.Parser.decamelize(e.name,`-`):n(`generated-value`),`)`].join(``),r.stringifiedValues=function(e,t){let n=``,r=t||`, `,i=[].concat(e);return!e||!i.length||i.forEach(e=>{n.length&&(n+=r),n+=JSON.stringify(e)}),n};function ie(e,t){let r=`[${n(`default:`)} `;if(e===void 0&&!t)return null;if(t)r+=t;else switch(typeof e){case`string`:r+=`"${e}"`;break;case`object`:r+=JSON.stringify(e);break;default:r+=e}return`${r}]`}function y(){return t.process.stdColumns?Math.min(80,t.process.stdColumns):80}let b=null;r.version=e=>{b=e},r.showVersion=t=>{let n=e.getInternalMethods().getLoggerInstance();t||(t=`error`),(typeof t==`function`?t:n[t])(b)},r.reset=function(e){return a=null,c=!1,l=[],u=!1,m=[],d=[],f=[],p=tt(p,t=>!e[t]),r};let x=[];return r.freeze=function(){x.push({failMessage:a,failureOutput:c,usages:l,usageDisabled:u,epilogs:m,examples:d,commands:f,descriptions:p})},r.unfreeze=function(e=!1){let t=x.pop();t&&(e?(p={...t.descriptions,...p},f=[...t.commands,...f],l=[...t.usages,...l],d=[...t.examples,...d],m=[...t.epilogs,...m]):{failMessage:a,failureOutput:c,usages:l,usageDisabled:u,epilogs:m,examples:d,commands:f,descriptions:p}=t)},r}function at(e){return typeof e==`object`}function ot(e,t){return at(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function st(e){return at(e)?e.indentation:0}function ct(e){return at(e)?e.text:e}var lt=class{constructor(e,t,n,r){var i,a,o;this.yargs=e,this.usage=t,this.command=n,this.shim=r,this.completionKey=`get-yargs-completions`,this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(o=((i=this.shim.getEnv(`SHELL`))==null?void 0:i.includes(`zsh`))||((a=this.shim.getEnv(`ZSH_NAME`))==null?void 0:a.includes(`zsh`)))==null?!1:o}defaultCompletion(e,t,n,r){let i=this.command.getCommandHandlers();for(let t=0,n=e.length;t<n;++t)if(i[e[t]]&&i[e[t]].builder){let n=i[e[t]].builder;if(Qe(n)){this.indexAfterLastReset=t+1;let e=this.yargs.getInternalMethods().reset();return n(e,!0),e.argv}}let a=[];this.commandCompletions(a,e,n),this.optionCompletions(a,e,t,n),this.choicesFromOptionsCompletions(a,e,t,n),this.choicesFromPositionalsCompletions(a,e,t,n),r(null,a)}commandCompletions(e,t,n){let r=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&r[r.length-1]!==n&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(n=>{let r=Le(n[0]).cmd;if(t.indexOf(r)===-1)if(!this.zshShell)e.push(r);else{let t=n[1]||``;e.push(r.replace(/:/g,`\\:`)+`:`+t)}})}optionCompletions(e,t,n,r){if((r.match(/^-/)||r===``&&e.length===0)&&!this.previousArgHasChoices(t)){let n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach(a=>{let o=!!n.configuration[`boolean-negation`]&&n.boolean.includes(a);!i.includes(a)&&!n.hiddenOptions.includes(a)&&!this.argsContainKey(t,a,o)&&this.completeOptionKey(a,e,r,o&&!!n.default[a])})}}choicesFromOptionsCompletions(e,t,n,r){if(this.previousArgHasChoices(t)){let n=this.getPreviousArgChoices(t);n&&n.length>0&&e.push(...n.map(e=>e.replace(/:/g,`\\:`)))}}choicesFromPositionalsCompletions(e,t,n,r){if(r===``&&e.length>0&&this.previousArgHasChoices(t))return;let i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],a=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-a-1];if(!o)return;let s=this.yargs.getOptions().choices[o]||[];for(let t of s)t.startsWith(r)&&e.push(t.replace(/:/g,`\\:`))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],n=``;if(!t.startsWith(`-`)&&e.length>1&&(n=t,t=e[e.length-2]),!t.startsWith(`-`))return;let r=t.replace(/^-+/,``),i=this.yargs.getOptions(),a=[r,...this.yargs.getAliases()[r]||[]],o;for(let e of a)if(Object.prototype.hasOwnProperty.call(i.key,e)&&Array.isArray(i.choices[e])){o=i.choices[e];break}if(o)return o.filter(e=>!n||e.startsWith(n))}previousArgHasChoices(e){let t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,n){let r=t=>e.indexOf((/^[^0-9]$/.test(t)?`-`:`--`)+t)!==-1;if(r(t)||n&&r(`no-${t}`))return!0;if(this.aliases){for(let e of this.aliases[t])if(r(e))return!0}return!1}completeOptionKey(e,t,n,r){var i,a,o,s;let c=e;if(this.zshShell){let t=this.usage.getDescriptions(),n=(a=(i=this===null||this===void 0?void 0:this.aliases)==null?void 0:i[e])==null?void 0:a.find(e=>{let n=t[e];return typeof n==`string`&&n.length>0}),r=n?t[n]:void 0,l=(s=(o=t[e])==null?r:o)==null?``:s;c=`${e.replace(/:/g,`\\:`)}:${l.replace(`__yargsString__:`,``).replace(/(\r\n|\n|\r)/gm,` `)}`}let l=!(e=>/^--/.test(e))(n)&&(e=>/^[^0-9]$/.test(e))(e)?`-`:`--`;t.push(l+c),r&&t.push(l+`no-`+c)}customCompletion(e,t,n,r){if(A(this.customCompletionFunction,null,this.shim),dt(this.customCompletionFunction)){let e=this.customCompletionFunction(n,t);return j(e)?e.then(e=>{this.shim.process.nextTick(()=>{r(null,e)})}).catch(e=>{this.shim.process.nextTick(()=>{r(e,void 0)})}):r(null,e)}else if(ft(this.customCompletionFunction))return this.customCompletionFunction(n,t,(i=r)=>this.defaultCompletion(e,t,n,i),e=>{r(null,e)});else return this.customCompletionFunction(n,t,e=>{r(null,e)})}getCompletion(e,t){let n=e.length?e[e.length-1]:``,r=this.yargs.parse(e,!0),i=this.customCompletionFunction?r=>this.customCompletion(e,r,n,t):r=>this.defaultCompletion(e,r,n,t);return j(r)?r.then(i):i(r)}generateCompletionScript(e,t){let n=this.zshShell?`#compdef {{app_name}}
36
+ ###-begin-{{app_name}}-completions-###
37
+ #
38
+ # yargs command completion script
39
+ #
40
+ # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
41
+ # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
42
+ #
43
+ _{{app_name}}_yargs_completions()
44
+ {
45
+ local reply
46
+ local si=$IFS
47
+ IFS=$'
48
+ ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
49
+ IFS=$si
50
+ _describe 'values' reply
51
+ }
52
+ compdef _{{app_name}}_yargs_completions {{app_name}}
53
+ ###-end-{{app_name}}-completions-###
54
+ `:`###-begin-{{app_name}}-completions-###
36
55
  #
37
56
  # yargs command completion script
38
57
  #
@@ -60,27 +79,8 @@ _{{app_name}}_yargs_completions()
60
79
  }
61
80
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
62
81
  ###-end-{{app_name}}-completions-###
63
- `,ht=`#compdef {{app_name}}
64
- ###-begin-{{app_name}}-completions-###
65
- #
66
- # yargs command completion script
67
- #
68
- # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
69
- # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
70
- #
71
- _{{app_name}}_yargs_completions()
72
- {
73
- local reply
74
- local si=$IFS
75
- IFS=$'
76
- ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
77
- IFS=$si
78
- _describe 'values' reply
79
- }
80
- compdef _{{app_name}}_yargs_completions {{app_name}}
81
- ###-end-{{app_name}}-completions-###
82
- `;var gt=class{constructor(e,t,n,r){var i,a,o;this.yargs=e,this.usage=t,this.command=n,this.shim=r,this.completionKey=`get-yargs-completions`,this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(o=((i=this.shim.getEnv(`SHELL`))==null?void 0:i.includes(`zsh`))||((a=this.shim.getEnv(`ZSH_NAME`))==null?void 0:a.includes(`zsh`)))==null?!1:o}defaultCompletion(e,t,n,r){let i=this.command.getCommandHandlers();for(let t=0,n=e.length;t<n;++t)if(i[e[t]]&&i[e[t]].builder){let n=i[e[t]].builder;if(rt(n)){this.indexAfterLastReset=t+1;let e=this.yargs.getInternalMethods().reset();return n(e,!0),e.argv}}let a=[];this.commandCompletions(a,e,n),this.optionCompletions(a,e,t,n),this.choicesFromOptionsCompletions(a,e,t,n),this.choicesFromPositionalsCompletions(a,e,t,n),r(null,a)}commandCompletions(e,t,n){let r=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&r[r.length-1]!==n&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(n=>{let r=He(n[0]).cmd;if(t.indexOf(r)===-1)if(!this.zshShell)e.push(r);else{let t=n[1]||``;e.push(r.replace(/:/g,`\\:`)+`:`+t)}})}optionCompletions(e,t,n,r){if((r.match(/^-/)||r===``&&e.length===0)&&!this.previousArgHasChoices(t)){let n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach(a=>{let o=!!n.configuration[`boolean-negation`]&&n.boolean.includes(a),s=i.includes(a);!s&&!n.hiddenOptions.includes(a)&&!this.argsContainKey(t,a,o)&&this.completeOptionKey(a,e,r,o&&!!n.default[a])})}}choicesFromOptionsCompletions(e,t,n,r){if(this.previousArgHasChoices(t)){let n=this.getPreviousArgChoices(t);n&&n.length>0&&e.push(...n.map(e=>e.replace(/:/g,`\\:`)))}}choicesFromPositionalsCompletions(e,t,n,r){if(r===``&&e.length>0&&this.previousArgHasChoices(t))return;let i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],a=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-a-1];if(!o)return;let s=this.yargs.getOptions().choices[o]||[];for(let t of s)t.startsWith(r)&&e.push(t.replace(/:/g,`\\:`))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],n=``;if(!t.startsWith(`-`)&&e.length>1&&(n=t,t=e[e.length-2]),!t.startsWith(`-`))return;let r=t.replace(/^-+/,``),i=this.yargs.getOptions(),a=[r,...this.yargs.getAliases()[r]||[]],o;for(let e of a)if(Object.prototype.hasOwnProperty.call(i.key,e)&&Array.isArray(i.choices[e])){o=i.choices[e];break}if(o)return o.filter(e=>!n||e.startsWith(n))}previousArgHasChoices(e){let t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,n){let r=t=>e.indexOf((/^[^0-9]$/.test(t)?`-`:`--`)+t)!==-1;if(r(t)||n&&r(`no-${t}`))return!0;if(this.aliases){for(let e of this.aliases[t])if(r(e))return!0}return!1}completeOptionKey(e,t,n,r){var i,a,o,s;let c=e;if(this.zshShell){let t=this.usage.getDescriptions(),n=(a=(i=this===null||this===void 0?void 0:this.aliases)==null?void 0:i[e])==null?void 0:a.find(e=>{let n=t[e];return typeof n==`string`&&n.length>0}),r=n?t[n]:void 0,l=(s=(o=t[e])==null?r:o)==null?``:s;c=`${e.replace(/:/g,`\\:`)}:${l.replace(`__yargsString__:`,``).replace(/(\r\n|\n|\r)/gm,` `)}`}let l=e=>/^--/.test(e),u=e=>/^[^0-9]$/.test(e),d=!l(n)&&u(e)?`-`:`--`;t.push(d+c),r&&t.push(d+`no-`+c)}customCompletion(e,t,n,r){if(j(this.customCompletionFunction,null,this.shim),vt(this.customCompletionFunction)){let e=this.customCompletionFunction(n,t);return M(e)?e.then(e=>{this.shim.process.nextTick(()=>{r(null,e)})}).catch(e=>{this.shim.process.nextTick(()=>{r(e,void 0)})}):r(null,e)}else if(yt(this.customCompletionFunction))return this.customCompletionFunction(n,t,(i=r)=>this.defaultCompletion(e,t,n,i),e=>{r(null,e)});else return this.customCompletionFunction(n,t,e=>{r(null,e)})}getCompletion(e,t){let n=e.length?e[e.length-1]:``,r=this.yargs.parse(e,!0),i=this.customCompletionFunction?r=>this.customCompletion(e,r,n,t):r=>this.defaultCompletion(e,r,n,t);return M(r)?r.then(i):i(r)}generateCompletionScript(e,t){let n=this.zshShell?ht:mt,r=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,r),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function _t(e,t,n,r){return new gt(e,t,n,r)}function vt(e){return e.length<3}function yt(e){return e.length>3}function bt(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],r;for(r=0;r<=t.length;r++)n[r]=[r];let i;for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:r>1&&i>1&&t.charAt(r-2)===e.charAt(i-1)&&t.charAt(r-1)===e.charAt(i-2)?n[r][i]=n[r-2][i-2]+1:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}const xt=[`$0`,`--`,`_`];function St(e,t,n){let r=n.y18n.__,i=n.y18n.__n,a={};a.nonOptionCount=function(n){let r=e.getDemandedCommands(),a=n._.length+(n[`--`]?n[`--`].length:0),o=a-e.getInternalMethods().getContext().commands.length;r._&&(o<r._.min||o>r._.max)&&(o<r._.min?r._.minMsg===void 0?t.fail(i(`Not enough non-option arguments: got %s, need at least %s`,`Not enough non-option arguments: got %s, need at least %s`,o,o.toString(),r._.min.toString())):t.fail(r._.minMsg?r._.minMsg.replace(/\$0/g,o.toString()).replace(/\$1/,r._.min.toString()):null):o>r._.max&&(r._.maxMsg===void 0?t.fail(i(`Too many non-option arguments: got %s, maximum of %s`,`Too many non-option arguments: got %s, maximum of %s`,o,o.toString(),r._.max.toString())):t.fail(r._.maxMsg?r._.maxMsg.replace(/\$0/g,o.toString()).replace(/\$1/,r._.max.toString()):null)))},a.positionalCount=function(e,n){n<e&&t.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+``,e+``))},a.requiredArguments=function(e,n){let r=null;for(let t of Object.keys(n))(!Object.prototype.hasOwnProperty.call(e,t)||e[t]===void 0)&&(r=r||{},r[t]=n[t]);if(r){let e=[];for(let t of Object.keys(r)){let n=r[t];n&&e.indexOf(n)<0&&e.push(n)}let n=e.length?`\n${e.join(`
83
- `)}`:``;t.fail(i(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(r).length,Object.keys(r).join(`, `)+n))}},a.unknownArguments=function(n,r,o,s,c=!0){var l;let u=e.getInternalMethods().getCommandInstance().getCommands(),d=[],f=e.getInternalMethods().getContext();if(Object.keys(n).forEach(t=>{!xt.includes(t)&&!Object.prototype.hasOwnProperty.call(o,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!a.isValidAndSomeAliasIsNotNew(t,r)&&d.push(t)}),c&&(f.commands.length>0||u.length>0||s)&&n._.slice(f.commands.length).forEach(e=>{u.includes(``+e)||d.push(``+e)}),c){let t=e.getDemandedCommands(),r=((l=t._)==null?void 0:l.max)||0,i=f.commands.length+r;i<n._.length&&n._.slice(i).forEach(e=>{e=String(e),!f.commands.includes(e)&&!d.includes(e)&&d.push(e)})}d.length&&t.fail(i(`Unknown argument: %s`,`Unknown arguments: %s`,d.length,d.map(e=>e.trim()?e:`"${e}"`).join(`, `)))},a.unknownCommands=function(n){let r=e.getInternalMethods().getCommandInstance().getCommands(),a=[],o=e.getInternalMethods().getContext();return(o.commands.length>0||r.length>0)&&n._.slice(o.commands.length).forEach(e=>{r.includes(``+e)||a.push(``+e)}),a.length>0?(t.fail(i(`Unknown command: %s`,`Unknown commands: %s`,a.length,a.join(`, `))),!0):!1},a.isValidAndSomeAliasIsNotNew=function(t,n){if(!Object.prototype.hasOwnProperty.call(n,t))return!1;let r=e.parsed.newAliases;return[t,...n[t]].some(e=>!Object.prototype.hasOwnProperty.call(r,e)||!r[t])},a.limitedChoices=function(n){let i=e.getOptions(),a={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach(e=>{xt.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(i.choices,e)&&[].concat(n[e]).forEach(t=>{i.choices[e].indexOf(t)===-1&&t!==void 0&&(a[e]=(a[e]||[]).concat(t))})});let o=Object.keys(a);if(!o.length)return;let s=r(`Invalid values:`);o.forEach(e=>{s+=`\n ${r(`Argument: %s, Given: %s, Choices: %s`,e,t.stringifiedValues(a[e]),t.stringifiedValues(i.choices[e]))}`}),t.fail(s)};let o={};a.implies=function(t,r){N(`<string|object> [array|number|string]`,[t,r],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.implies(e,t[e])}):(e.global(t),o[t]||(o[t]=[]),Array.isArray(r)?r.forEach(e=>a.implies(t,e)):(j(r,void 0,n),o[t].push(r)))},a.getImplied=function(){return o};function s(e,t){let n=Number(t);return t=isNaN(n)?t:n,typeof t==`number`?t=e._.length>=t:t.match(/^--no-.+/)?(t=t.match(/^--no-(.+)/)[1],t=!Object.prototype.hasOwnProperty.call(e,t)):t=Object.prototype.hasOwnProperty.call(e,t),t}a.implications=function(e){let n=[];if(Object.keys(o).forEach(t=>{let r=t;(o[t]||[]).forEach(t=>{let i=r,a=t;i=s(e,i),t=s(e,t),i&&!t&&n.push(` ${r} -> ${a}`)})}),n.length){let e=`${r(`Implications failed:`)}\n`;n.forEach(t=>{e+=t}),t.fail(e)}};let c={};a.conflicts=function(t,n){N(`<string|object> [array|string]`,[t,n],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.conflicts(e,t[e])}):(e.global(t),c[t]||(c[t]=[]),Array.isArray(n)?n.forEach(e=>a.conflicts(t,e)):c[t].push(n))},a.getConflicting=()=>c,a.conflicting=function(i){Object.keys(i).forEach(e=>{c[e]&&c[e].forEach(n=>{n&&i[e]!==void 0&&i[n]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,n))})}),e.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(c).forEach(e=>{c[e].forEach(a=>{a&&i[n.Parser.camelCase(e)]!==void 0&&i[n.Parser.camelCase(a)]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,a))})})},a.recommendCommands=function(e,n){let i=3;n=n.sort((e,t)=>t.length-e.length);let a=null,o=1/0;for(let t=0,r;(r=n[t])!==void 0;t++){let t=bt(e,r);t<=i&&t<o&&(o=t,a=r)}a&&t.fail(r(`Did you mean %s?`,a))},a.reset=function(e){return o=ot(o,t=>!e[t]),c=ot(c,t=>!e[t]),a};let l=[];return a.freeze=function(){l.push({implied:o,conflicting:c})},a.unfreeze=function(){let e=l.pop();j(e,void 0,n),{implied:o,conflicting:c}=e},a}let Ct=[],wt;function Tt(t,n,r,i){wt=i;let a={};if(Object.prototype.hasOwnProperty.call(t,`extends`)){if(typeof t.extends!=`string`)return a;let i=/\.json|\..*rc$/.test(t.extends),o=null;if(i)o=Dt(n,t.extends);else try{o=e.resolve(t.extends)}catch(e){return t}Et(o),Ct.push(o),a=i?JSON.parse(wt.readFileSync(o,`utf8`)):e(t.extends),delete t.extends,a=Tt(a,wt.path.dirname(o),r,wt)}return Ct=[],r?Ot(a,t):Object.assign({},a,t)}function Et(e){if(Ct.indexOf(e)>-1)throw new k(`Circular extended configurations: '${e}'.`)}function Dt(e,t){return wt.path.resolve(e,t)}function Ot(e,t){let n={};function r(e){return e&&typeof e==`object`&&!Array.isArray(e)}Object.assign(n,e);for(let i of Object.keys(t))r(t[i])&&r(n[i])?n[i]=Ot(e[i],t[i]):n[i]=t[i];return n}var P=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},F=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},I,kt,At,L,R,jt,z,Mt,Nt,B,Pt,V,H,U,W,Ft,It,G,K,Lt,Rt,q,zt,Bt,Vt,J,Ht,Y,Ut,Wt,Gt,X,Kt,Z,Q;function qt(e){return(t=[],n=e.process.cwd(),r)=>{let i=new An(t,n,r,e);return Object.defineProperty(i,`argv`,{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}const Jt=Symbol(`copyDoubleDash`),Yt=Symbol(`copyDoubleDash`),Xt=Symbol(`deleteFromParserHintObject`),Zt=Symbol(`emitWarning`),Qt=Symbol(`freeze`),$t=Symbol(`getDollarZero`),en=Symbol(`getParserConfiguration`),tn=Symbol(`getUsageConfiguration`),nn=Symbol(`guessLocale`),rn=Symbol(`guessVersion`),an=Symbol(`parsePositionalNumbers`),on=Symbol(`pkgUp`),$=Symbol(`populateParserHintArray`),sn=Symbol(`populateParserHintSingleValueDictionary`),cn=Symbol(`populateParserHintArrayDictionary`),ln=Symbol(`populateParserHintDictionary`),un=Symbol(`sanitizeKey`),dn=Symbol(`setKey`),fn=Symbol(`unfreeze`),pn=Symbol(`validateAsync`),mn=Symbol(`getCommandInstance`),hn=Symbol(`getContext`),gn=Symbol(`getHasOutput`),_n=Symbol(`getLoggerInstance`),vn=Symbol(`getParseContext`),yn=Symbol(`getUsageInstance`),bn=Symbol(`getValidationInstance`),xn=Symbol(`hasParseCallback`),Sn=Symbol(`isGlobalContext`),Cn=Symbol(`postProcess`),wn=Symbol(`rebase`),Tn=Symbol(`reset`),En=Symbol(`runYargsParserAndExecuteCommands`),Dn=Symbol(`runValidation`),On=Symbol(`setHasOutput`),kn=Symbol(`kTrackManuallySetKeys`);var An=class{constructor(e=[],t,n,r){this.customScriptName=!1,this.parsed=!1,I.set(this,void 0),kt.set(this,void 0),At.set(this,{commands:[],fullCommands:[]}),L.set(this,null),R.set(this,null),jt.set(this,`show-hidden`),z.set(this,null),Mt.set(this,!0),Nt.set(this,{}),B.set(this,!0),Pt.set(this,[]),V.set(this,void 0),H.set(this,{}),U.set(this,!1),W.set(this,null),Ft.set(this,!0),It.set(this,void 0),G.set(this,``),K.set(this,void 0),Lt.set(this,void 0),Rt.set(this,{}),q.set(this,null),zt.set(this,null),Bt.set(this,{}),Vt.set(this,{}),J.set(this,void 0),Ht.set(this,!1),Y.set(this,void 0),Ut.set(this,!1),Wt.set(this,!1),Gt.set(this,!1),X.set(this,void 0),Kt.set(this,{}),Z.set(this,null),Q.set(this,void 0),P(this,Y,r,`f`),P(this,J,e,`f`),P(this,kt,t,`f`),P(this,Lt,n,`f`),P(this,V,new Ke(this),`f`),this.$0=this[$t](),this[Tn](),P(this,I,F(this,I,`f`),`f`),P(this,X,F(this,X,`f`),`f`),P(this,Q,F(this,Q,`f`),`f`),P(this,K,F(this,K,`f`),`f`),F(this,K,`f`).showHiddenOpt=F(this,jt,`f`),P(this,It,this[Yt](),`f`)}addHelpOpt(e,t){let n=`help`;return N(`[string|boolean] [string]`,[e,t],arguments.length),F(this,W,`f`)&&(this[Xt](F(this,W,`f`)),P(this,W,null,`f`)),e===!1&&t===void 0?this:(P(this,W,typeof e==`string`?e:n,`f`),this.boolean(F(this,W,`f`)),this.describe(F(this,W,`f`),t||F(this,X,`f`).deferY18nLookup(`Show help`)),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(N(`[string|boolean] [string]`,[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e==`string`?e:F(this,jt,`f`);return this.boolean(n),this.describe(n,t||F(this,X,`f`).deferY18nLookup(`Show hidden options`)),F(this,K,`f`).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return N(`<object|string|array> [string|array]`,[e,t],arguments.length),this[cn](this.alias.bind(this),`alias`,e,t),this}array(e){return N(`<array|string>`,[e],arguments.length),this[$](`array`,e),this[kn](e),this}boolean(e){return N(`<array|string>`,[e],arguments.length),this[$](`boolean`,e),this[kn](e),this}check(e,t){return N(`<function> [boolean]`,[e,t],arguments.length),this.middleware((t,n)=>Ye(()=>e(t,n.getOptions()),n=>(n?(typeof n==`string`||n instanceof Error)&&F(this,X,`f`).fail(n.toString(),n):F(this,X,`f`).fail(F(this,Y,`f`).y18n.__(`Argument check failed: %s`,e.toString())),t),e=>(F(this,X,`f`).fail(e.message?e.message:e.toString(),e),t)),!1,t),this}choices(e,t){return N(`<object|string|array> [string|array]`,[e,t],arguments.length),this[cn](this.choices.bind(this),`choices`,e,t),this}coerce(e,t){if(N(`<object|string|array> [function]`,[e,t],arguments.length),Array.isArray(e)){if(!t)throw new k(`coerce callback must be provided`);for(let n of e)this.coerce(n,t);return this}else if(typeof e==`object`){for(let t of Object.keys(e))this.coerce(t,e[t]);return this}if(!t)throw new k(`coerce callback must be provided`);return F(this,K,`f`).key[e]=!0,F(this,V,`f`).addCoerceMiddleware((n,r)=>{let i,a=Object.prototype.hasOwnProperty.call(n,e);return a?Ye(()=>(i=r.getAliases(),t(n[e])),t=>{n[e]=t;let a=r.getInternalMethods().getParserConfiguration()[`strip-aliased`];if(i[e]&&a!==!0)for(let r of i[e])n[r]=t;return n},e=>{throw new k(e.message)}):n},e),this}conflicts(e,t){return N(`<string|object> [string|array]`,[e,t],arguments.length),F(this,Q,`f`).conflicts(e,t),this}config(e=`config`,t,n){return N(`[object|string] [string|function] [function]`,[e,t,n],arguments.length),typeof e==`object`&&!Array.isArray(e)?(e=Tt(e,F(this,kt,`f`),this[en]()[`deep-merge-config`]||!1,F(this,Y,`f`)),F(this,K,`f`).configObjects=(F(this,K,`f`).configObjects||[]).concat(e),this):(typeof t==`function`&&(n=t,t=void 0),this.describe(e,t||F(this,X,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(e)?e:[e]).forEach(e=>{F(this,K,`f`).config[e]=n||!0}),this)}completion(e,t,n){return N(`[string] [string|boolean|function] [function]`,[e,t,n],arguments.length),typeof t==`function`&&(n=t,t=void 0),P(this,R,e||F(this,R,`f`)||`completion`,`f`),!t&&t!==!1&&(t=`generate completion script`),this.command(F(this,R,`f`),t),n&&F(this,L,`f`).registerFunction(n),this}command(e,t,n,r,i,a){return N(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[e,t,n,r,i,a],arguments.length),F(this,I,`f`).addHandler(e,t,n,r,i,a),this}commands(e,t,n,r,i,a){return this.command(e,t,n,r,i,a)}commandDir(e,t){N(`<string> [object]`,[e,t],arguments.length);let n=F(this,Lt,`f`)||F(this,Y,`f`).require;return F(this,I,`f`).addDirectory(e,n,F(this,Y,`f`).getCallerFile(),t),this}count(e){return N(`<array|string>`,[e],arguments.length),this[$](`count`,e),this[kn](e),this}default(e,t,n){return N(`<object|string|array> [*] [string]`,[e,t,n],arguments.length),n&&(Be(e,F(this,Y,`f`)),F(this,K,`f`).defaultDescription[e]=n),typeof t==`function`&&(Be(e,F(this,Y,`f`)),F(this,K,`f`).defaultDescription[e]||(F(this,K,`f`).defaultDescription[e]=F(this,X,`f`).functionDescription(t)),t=t.call()),this[sn](this.default.bind(this),`default`,e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,r){return N(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[e,t,n,r],arguments.length),typeof t!=`number`&&(n=t,t=1/0),this.global(`_`,!1),F(this,K,`f`).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:r},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(e=>{j(n,!0,F(this,Y,`f`)),this.demandOption(e,n)}),t=1/0):typeof t!=`number`&&(n=t,t=1/0),typeof e==`number`?(j(n,!0,F(this,Y,`f`)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(e=>{j(n,!0,F(this,Y,`f`)),this.demandOption(e,n)}):typeof n==`string`?this.demandOption(e,n):(n===!0||n===void 0)&&this.demandOption(e),this}demandOption(e,t){return N(`<object|string|array> [string]`,[e,t],arguments.length),this[sn](this.demandOption.bind(this),`demandedOptions`,e,t),this}deprecateOption(e,t){return N(`<string> [string|boolean]`,[e,t],arguments.length),F(this,K,`f`).deprecatedOptions[e]=t,this}describe(e,t){return N(`<object|string|array> [string]`,[e,t],arguments.length),this[dn](e,!0),F(this,X,`f`).describe(e,t),this}detectLocale(e){return N(`<boolean>`,[e],arguments.length),P(this,Mt,e,`f`),this}env(e){return N(`[string|boolean]`,[e],arguments.length),e===!1?delete F(this,K,`f`).envPrefix:F(this,K,`f`).envPrefix=e||``,this}epilogue(e){return N(`<string>`,[e],arguments.length),F(this,X,`f`).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return N(`<string|array> [string]`,[e,t],arguments.length),Array.isArray(e)?e.forEach(e=>this.example(...e)):F(this,X,`f`).example(e,t),this}exit(e,t){P(this,U,!0,`f`),P(this,z,t,`f`),F(this,B,`f`)&&F(this,Y,`f`).process.exit(e)}exitProcess(e=!0){return N(`[boolean]`,[e],arguments.length),P(this,B,e,`f`),this}fail(e){if(N(`<function|boolean>`,[e],arguments.length),typeof e==`boolean`&&e!==!1)throw new k(`Invalid first argument. Expected function or boolean 'false'`);return F(this,X,`f`).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return N(`<array> [function]`,[e,t],arguments.length),t?F(this,L,`f`).getCompletion(e,t):new Promise((t,n)=>{F(this,L,`f`).getCompletion(e,(e,r)=>{e?n(e):t(r)})})}getDemandedOptions(){return N([],0),F(this,K,`f`).demandedOptions}getDemandedCommands(){return N([],0),F(this,K,`f`).demandedCommands}getDeprecatedOptions(){return N([],0),F(this,K,`f`).deprecatedOptions}getDetectLocale(){return F(this,Mt,`f`)}getExitProcess(){return F(this,B,`f`)}getGroups(){return Object.assign({},F(this,H,`f`),F(this,Vt,`f`))}getHelp(){if(P(this,U,!0,`f`),!F(this,X,`f`).hasCachedHelpMessage()){if(!this.parsed){let e=this[En](F(this,J,`f`),void 0,void 0,0,!0);if(M(e))return e.then(()=>F(this,X,`f`).help())}let e=F(this,I,`f`).runDefaultBuilderOn(this);if(M(e))return e.then(()=>F(this,X,`f`).help())}return Promise.resolve(F(this,X,`f`).help())}getOptions(){return F(this,K,`f`)}getStrict(){return F(this,Ut,`f`)}getStrictCommands(){return F(this,Wt,`f`)}getStrictOptions(){return F(this,Gt,`f`)}global(e,t){return N(`<string|array> [boolean]`,[e,t],arguments.length),e=[].concat(e),t===!1?e.forEach(e=>{F(this,K,`f`).local.includes(e)||F(this,K,`f`).local.push(e)}):F(this,K,`f`).local=F(this,K,`f`).local.filter(t=>e.indexOf(t)===-1),this}group(e,t){N(`<string|array> <string>`,[e,t],arguments.length);let n=F(this,Vt,`f`)[t]||F(this,H,`f`)[t];F(this,Vt,`f`)[t]&&delete F(this,Vt,`f`)[t];let r={};return F(this,H,`f`)[t]=(n||[]).concat(e).filter(e=>r[e]?!1:r[e]=!0),this}hide(e){return N(`<string>`,[e],arguments.length),F(this,K,`f`).hiddenOptions.push(e),this}implies(e,t){return N(`<string|object> [number|string|array]`,[e,t],arguments.length),F(this,Q,`f`).implies(e,t),this}locale(e){return N(`[string]`,[e],arguments.length),e===void 0?(this[nn](),F(this,Y,`f`).y18n.getLocale()):(P(this,Mt,!1,`f`),F(this,Y,`f`).y18n.setLocale(e),this)}middleware(e,t,n){return F(this,V,`f`).addMiddleware(e,!!t,n)}nargs(e,t){return N(`<string|object|array> [number]`,[e,t],arguments.length),this[sn](this.nargs.bind(this),`narg`,e,t),this}normalize(e){return N(`<array|string>`,[e],arguments.length),this[$](`normalize`,e),this}number(e){return N(`<array|string>`,[e],arguments.length),this[$](`number`,e),this[kn](e),this}option(e,t){if(N(`<string|object> [object]`,[e,t],arguments.length),typeof e==`object`)Object.keys(e).forEach(t=>{this.options(t,e[t])});else{typeof t!=`object`&&(t={}),this[kn](e),F(this,Z,`f`)&&(e===`version`||(t==null?void 0:t.alias)===`version`)&&this[Zt]([`"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(`
84
- `),void 0,`versionWarning`),F(this,K,`f`).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let r=t.demand||t.required||t.require;r&&this.demand(e,r),t.demandOption&&this.demandOption(e,typeof t.demandOption==`string`?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),`default`in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type===`boolean`)&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type===`array`)&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type===`number`)&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type===`string`)&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type===`count`)&&this.count(e),typeof t.global==`boolean`&&this.global(e,t.global),t.defaultDescription&&(F(this,K,`f`).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let i=t.describe||t.description||t.desc,a=F(this,X,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(a,e)||typeof i==`string`)&&this.describe(e,i),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){N(`[string|array] [function|boolean|object] [function]`,[e,t,n],arguments.length),this[Qt](),e===void 0&&(e=F(this,J,`f`)),typeof t==`object`&&(P(this,zt,t,`f`),t=n),typeof t==`function`&&(P(this,q,t,`f`),t=!1),t||P(this,J,e,`f`),F(this,q,`f`)&&P(this,B,!1,`f`);let r=this[En](e,!!t),i=this.parsed;return F(this,L,`f`).setParsed(this.parsed),M(r)?r.then(e=>(F(this,q,`f`)&&F(this,q,`f`).call(this,F(this,z,`f`),e,F(this,G,`f`)),e)).catch(e=>{throw F(this,q,`f`)&&F(this,q,`f`)(e,this.parsed.argv,F(this,G,`f`)),e}).finally(()=>{this[fn](),this.parsed=i}):(F(this,q,`f`)&&F(this,q,`f`).call(this,F(this,z,`f`),r,F(this,G,`f`)),this[fn](),this.parsed=i,r)}parseAsync(e,t,n){let r=this.parse(e,t,n);return M(r)?r:Promise.resolve(r)}parseSync(e,t,n){let r=this.parse(e,t,n);if(M(r))throw new k(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return r}parserConfiguration(e){return N(`<object>`,[e],arguments.length),P(this,Rt,e,`f`),this}pkgConf(e,t){N(`<string> [string]`,[e,t],arguments.length);let n=null,r=this[on](t||F(this,kt,`f`));return r[e]&&typeof r[e]==`object`&&(n=Tt(r[e],t||F(this,kt,`f`),this[en]()[`deep-merge-config`]||!1,F(this,Y,`f`)),F(this,K,`f`).configObjects=(F(this,K,`f`).configObjects||[]).concat(n)),this}positional(e,t){N(`<string> <object>`,[e,t],arguments.length);let n=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];t=ot(t,(e,t)=>e===`type`&&![`string`,`number`,`boolean`].includes(t)?!1:n.includes(e));let r=F(this,At,`f`).fullCommands[F(this,At,`f`).fullCommands.length-1],i=r?F(this,I,`f`).cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Ve(i).forEach(n=>{let r=i[n];Array.isArray(r)?r.indexOf(e)!==-1&&(t[n]=!0):r[e]&&!(n in t)&&(t[n]=r[e])}),this.group(e,F(this,X,`f`).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return N(`[boolean]`,[e],arguments.length),P(this,Ht,e,`f`),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return N(`<array|string|object> [number]`,[e],arguments.length),typeof e==`string`&&F(this,K,`f`).narg[e]||this[sn](this.requiresArg.bind(this),`narg`,e,NaN),this}showCompletionScript(e,t){return N(`[string] [string]`,[e,t],arguments.length),e=e||this.$0,F(this,It,`f`).log(F(this,L,`f`).generateCompletionScript(e,t||F(this,R,`f`)||`completion`)),this}showHelp(e){if(N(`[string|function]`,[e],arguments.length),P(this,U,!0,`f`),!F(this,X,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[En](F(this,J,`f`),void 0,void 0,0,!0);if(M(t))return t.then(()=>{F(this,X,`f`).showHelp(e)}),this}let t=F(this,I,`f`).runDefaultBuilderOn(this);if(M(t))return t.then(()=>{F(this,X,`f`).showHelp(e)}),this}return F(this,X,`f`).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return N(`[boolean|string] [string]`,[e,t],arguments.length),F(this,X,`f`).showHelpOnFail(e,t),this}showVersion(e){return N(`[string|function]`,[e],arguments.length),F(this,X,`f`).showVersion(e),this}skipValidation(e){return N(`<array|string>`,[e],arguments.length),this[$](`skipValidation`,e),this}strict(e){return N(`[boolean]`,[e],arguments.length),P(this,Ut,e!==!1,`f`),this}strictCommands(e){return N(`[boolean]`,[e],arguments.length),P(this,Wt,e!==!1,`f`),this}strictOptions(e){return N(`[boolean]`,[e],arguments.length),P(this,Gt,e!==!1,`f`),this}string(e){return N(`<array|string>`,[e],arguments.length),this[$](`string`,e),this[kn](e),this}terminalWidth(){return N([],0),F(this,Y,`f`).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return N(`<object>`,[e],arguments.length),P(this,Mt,!1,`f`),F(this,Y,`f`).y18n.updateLocale(e),this}usage(e,t,n,r){if(N(`<string|null|undefined> [string|boolean] [function|object] [function]`,[e,t,n,r],arguments.length),t!==void 0){if(j(e,null,F(this,Y,`f`)),(e||``).match(/^\$0( |$)/))return this.command(e,t,n,r);throw new k(`.usage() description must start with $0 if being used as alias for .command()`)}else return F(this,X,`f`).usage(e),this}usageConfiguration(e){return N(`<object>`,[e],arguments.length),P(this,Kt,e,`f`),this}version(e,t,n){let r=`version`;if(N(`[boolean|string] [string] [string]`,[e,t,n],arguments.length),F(this,Z,`f`)&&(this[Xt](F(this,Z,`f`)),F(this,X,`f`).version(void 0),P(this,Z,null,`f`)),arguments.length===0)n=this[rn](),e=r;else if(arguments.length===1){if(e===!1)return this;n=e,e=r}else arguments.length===2&&(n=t,t=void 0);return P(this,Z,typeof e==`string`?e:r,`f`),t=t||F(this,X,`f`).deferY18nLookup(`Show version number`),F(this,X,`f`).version(n||void 0),this.boolean(F(this,Z,`f`)),this.describe(F(this,Z,`f`),t),this}wrap(e){return N(`<number|null|undefined>`,[e],arguments.length),F(this,X,`f`).wrap(e),this}[(I=new WeakMap,kt=new WeakMap,At=new WeakMap,L=new WeakMap,R=new WeakMap,jt=new WeakMap,z=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,B=new WeakMap,Pt=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,W=new WeakMap,Ft=new WeakMap,It=new WeakMap,G=new WeakMap,K=new WeakMap,Lt=new WeakMap,Rt=new WeakMap,q=new WeakMap,zt=new WeakMap,Bt=new WeakMap,Vt=new WeakMap,J=new WeakMap,Ht=new WeakMap,Y=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,X=new WeakMap,Kt=new WeakMap,Z=new WeakMap,Q=new WeakMap,Jt)](e){if(!e._||!e[`--`])return e;e._.push.apply(e._,e[`--`]);try{delete e[`--`]}catch(e){}return e}[Yt](){return{log:(...e)=>{this[xn]()||console.log(...e),P(this,U,!0,`f`),F(this,G,`f`).length&&P(this,G,F(this,G,`f`)+`
85
- `,`f`),P(this,G,F(this,G,`f`)+e.join(` `),`f`)},error:(...e)=>{this[xn]()||console.error(...e),P(this,U,!0,`f`),F(this,G,`f`).length&&P(this,G,F(this,G,`f`)+`
86
- `,`f`),P(this,G,F(this,G,`f`)+e.join(` `),`f`)}}}[Xt](e){Ve(F(this,K,`f`)).forEach(t=>{if((e=>e===`configObjects`)(t))return;let n=F(this,K,`f`)[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n==`object`&&delete n[e]}),delete F(this,X,`f`).getDescriptions()[e]}[Zt](e,t,n){F(this,Nt,`f`)[n]||(F(this,Y,`f`).process.emitWarning(e,t),F(this,Nt,`f`)[n]=!0)}[Qt](){F(this,Pt,`f`).push({options:F(this,K,`f`),configObjects:F(this,K,`f`).configObjects.slice(0),exitProcess:F(this,B,`f`),groups:F(this,H,`f`),strict:F(this,Ut,`f`),strictCommands:F(this,Wt,`f`),strictOptions:F(this,Gt,`f`),completionCommand:F(this,R,`f`),output:F(this,G,`f`),exitError:F(this,z,`f`),hasOutput:F(this,U,`f`),parsed:this.parsed,parseFn:F(this,q,`f`),parseContext:F(this,zt,`f`)}),F(this,X,`f`).freeze(),F(this,Q,`f`).freeze(),F(this,I,`f`).freeze(),F(this,V,`f`).freeze()}[$t](){let e=``,t;return t=/\b(node|iojs|electron)(\.exe)?$/.test(F(this,Y,`f`).process.argv()[0])?F(this,Y,`f`).process.argv().slice(1,2):F(this,Y,`f`).process.argv().slice(0,1),e=t.map(e=>{let t=this[wn](F(this,kt,`f`),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e}).join(` `).trim(),F(this,Y,`f`).getEnv(`_`)&&F(this,Y,`f`).getProcessArgvBin()===F(this,Y,`f`).getEnv(`_`)&&(e=F(this,Y,`f`).getEnv(`_`).replace(`${F(this,Y,`f`).path.dirname(F(this,Y,`f`).process.execPath())}/`,``)),e}[en](){return F(this,Rt,`f`)}[tn](){return F(this,Kt,`f`)}[nn](){if(!F(this,Mt,`f`))return;let e=F(this,Y,`f`).getEnv(`LC_ALL`)||F(this,Y,`f`).getEnv(`LC_MESSAGES`)||F(this,Y,`f`).getEnv(`LANG`)||F(this,Y,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(e.replace(/[.:].*/,``))}[rn](){let e=this[on]();return e.version||`unknown`}[an](e){let t=e[`--`]?e[`--`]:e._;for(let e=0,n;(n=t[e])!==void 0;e++)F(this,Y,`f`).Parser.looksLikeNumber(n)&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))&&(t[e]=Number(n));return e}[on](e){let t=e||`*`;if(F(this,Bt,`f`)[t])return F(this,Bt,`f`)[t];let n={};try{let t=e||F(this,Y,`f`).mainFilename;!e&&F(this,Y,`f`).path.extname(t)&&(t=F(this,Y,`f`).path.dirname(t));let r=F(this,Y,`f`).findUp(t,(e,t)=>{if(t.includes(`package.json`))return`package.json`});j(r,void 0,F(this,Y,`f`)),n=JSON.parse(F(this,Y,`f`).readFileSync(r,`utf8`))}catch(e){}return F(this,Bt,`f`)[t]=n||{},F(this,Bt,`f`)[t]}[$](e,t){t=[].concat(t),t.forEach(t=>{t=this[un](t),F(this,K,`f`)[e].push(t)})}[sn](e,t,n,r){this[ln](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=n})}[cn](e,t,n,r){this[ln](e,t,n,r,(e,t,n)=>{F(this,K,`f`)[e][t]=(F(this,K,`f`)[e][t]||[]).concat(n)})}[ln](e,t,n,r,i){if(Array.isArray(n))n.forEach(t=>{e(t,r)});else if((e=>typeof e==`object`)(n))for(let t of Ve(n))e(t,n[t]);else i(t,this[un](n),r)}[un](e){return e===`__proto__`?`___proto___`:e}[dn](e,t){return this[sn](this[dn].bind(this),`key`,e,t),this}[fn](){var e,t,n,r,i,a,o,s,c,l,u,d;let f=F(this,Pt,`f`).pop();j(f,void 0,F(this,Y,`f`));let p;e=this,t=this,n=this,r=this,i=this,a=this,o=this,s=this,c=this,l=this,u=this,d=this,{options:{set value(t){P(e,K,t,`f`)}}.value,configObjects:p,exitProcess:{set value(e){P(t,B,e,`f`)}}.value,groups:{set value(e){P(n,H,e,`f`)}}.value,output:{set value(e){P(r,G,e,`f`)}}.value,exitError:{set value(e){P(i,z,e,`f`)}}.value,hasOutput:{set value(e){P(a,U,e,`f`)}}.value,parsed:this.parsed,strict:{set value(e){P(o,Ut,e,`f`)}}.value,strictCommands:{set value(e){P(s,Wt,e,`f`)}}.value,strictOptions:{set value(e){P(c,Gt,e,`f`)}}.value,completionCommand:{set value(e){P(l,R,e,`f`)}}.value,parseFn:{set value(e){P(u,q,e,`f`)}}.value,parseContext:{set value(e){P(d,zt,e,`f`)}}.value}=f,F(this,K,`f`).configObjects=p,F(this,X,`f`).unfreeze(),F(this,Q,`f`).unfreeze(),F(this,I,`f`).unfreeze(),F(this,V,`f`).unfreeze()}[pn](e,t){return Ye(t,t=>(e(t),t))}getInternalMethods(){return{getCommandInstance:this[mn].bind(this),getContext:this[hn].bind(this),getHasOutput:this[gn].bind(this),getLoggerInstance:this[_n].bind(this),getParseContext:this[vn].bind(this),getParserConfiguration:this[en].bind(this),getUsageConfiguration:this[tn].bind(this),getUsageInstance:this[yn].bind(this),getValidationInstance:this[bn].bind(this),hasParseCallback:this[xn].bind(this),isGlobalContext:this[Sn].bind(this),postProcess:this[Cn].bind(this),reset:this[Tn].bind(this),runValidation:this[Dn].bind(this),runYargsParserAndExecuteCommands:this[En].bind(this),setHasOutput:this[On].bind(this)}}[mn](){return F(this,I,`f`)}[hn](){return F(this,At,`f`)}[gn](){return F(this,U,`f`)}[_n](){return F(this,It,`f`)}[vn](){return F(this,zt,`f`)||{}}[yn](){return F(this,X,`f`)}[bn](){return F(this,Q,`f`)}[xn](){return!!F(this,q,`f`)}[Sn](){return F(this,Ft,`f`)}[Cn](e,t,n,r){if(n||M(e))return e;t||(e=this[Jt](e));let i=this[en]()[`parse-positional-numbers`]||this[en]()[`parse-positional-numbers`]===void 0;return i&&(e=this[an](e)),r&&(e=Je(e,this,F(this,V,`f`).getMiddleware(),!1)),e}[Tn](e={}){P(this,K,F(this,K,`f`)||{},`f`);let t={};t.local=F(this,K,`f`).local||[],t.configObjects=F(this,K,`f`).configObjects||[];let n={};t.local.forEach(t=>{n[t]=!0,(e[t]||[]).forEach(e=>{n[e]=!0})}),Object.assign(F(this,Vt,`f`),Object.keys(F(this,H,`f`)).reduce((e,t)=>{let r=F(this,H,`f`)[t].filter(e=>!(e in n));return r.length>0&&(e[t]=r),e},{})),P(this,H,{},`f`);let r=[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`],i=[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`];return r.forEach(e=>{t[e]=(F(this,K,`f`)[e]||[]).filter(e=>!n[e])}),i.forEach(e=>{t[e]=ot(F(this,K,`f`)[e],e=>!n[e])}),t.envPrefix=F(this,K,`f`).envPrefix,P(this,K,t,`f`),P(this,X,F(this,X,`f`)?F(this,X,`f`).reset(n):lt(this,F(this,Y,`f`)),`f`),P(this,Q,F(this,Q,`f`)?F(this,Q,`f`).reset(n):St(this,F(this,X,`f`),F(this,Y,`f`)),`f`),P(this,I,F(this,I,`f`)?F(this,I,`f`).reset():et(F(this,X,`f`),F(this,Q,`f`),F(this,V,`f`),F(this,Y,`f`)),`f`),F(this,L,`f`)||P(this,L,_t(this,F(this,X,`f`),F(this,I,`f`),F(this,Y,`f`)),`f`),F(this,V,`f`).reset(),P(this,R,null,`f`),P(this,G,``,`f`),P(this,z,null,`f`),P(this,U,!1,`f`),this.parsed=!1,this}[wn](e,t){return F(this,Y,`f`).path.relative(e,t)}[En](e,t,n,r=0,i=!1){let a=!!n||i;e=e||F(this,J,`f`),F(this,K,`f`).__=F(this,Y,`f`).y18n.__,F(this,K,`f`).configuration=this[en]();let o=!!F(this,K,`f`).configuration[`populate--`],s=Object.assign({},F(this,K,`f`).configuration,{"populate--":!0}),c=F(this,Y,`f`).Parser.detailed(e,Object.assign({},F(this,K,`f`),{configuration:{"parse-positional-numbers":!1,...s}})),l=Object.assign(c.argv,F(this,zt,`f`)),u,d=c.aliases,f=!1,p=!1;Object.keys(l).forEach(e=>{e===F(this,W,`f`)&&l[e]?f=!0:e===F(this,Z,`f`)&&l[e]&&(p=!0)}),l.$0=this.$0,this.parsed=c,r===0&&F(this,X,`f`).clearCachedHelpMessage();try{if(this[nn](),t)return this[Cn](l,o,!!n,!1);if(F(this,W,`f`)){let e=[F(this,W,`f`)].concat(d[F(this,W,`f`)]||[]).filter(e=>e.length>1);e.includes(``+l._[l._.length-1])&&(l._.pop(),f=!0)}P(this,Ft,!1,`f`);let s=F(this,I,`f`).getCommands(),m=F(this,L,`f`).completionKey in l,h=f||m||i;if(l._.length){if(s.length){let e;for(let t=r||0,a;l._[t]!==void 0;t++)if(a=String(l._[t]),s.includes(a)&&a!==F(this,R,`f`)){let e=F(this,I,`f`).runCommand(a,this,c,t+1,i,f||p||i);return this[Cn](e,o,!!n,!1)}else if(!e&&a!==F(this,R,`f`)){e=a;break}!F(this,I,`f`).hasDefaultCommand()&&F(this,Ht,`f`)&&e&&!h&&F(this,Q,`f`).recommendCommands(e,s)}F(this,R,`f`)&&l._.includes(F(this,R,`f`))&&!m&&(F(this,B,`f`)&&st(!0),this.showCompletionScript(),this.exit(0))}if(F(this,I,`f`).hasDefaultCommand()&&!h){let e=F(this,I,`f`).runCommand(null,this,c,0,i,f||p||i);return this[Cn](e,o,!!n,!1)}if(m){F(this,B,`f`)&&st(!0),e=[].concat(e);let t=e.slice(e.indexOf(`--${F(this,L,`f`).completionKey}`)+1);return F(this,L,`f`).getCompletion(t,(e,t)=>{if(e)throw new k(e.message);(t||[]).forEach(e=>{F(this,It,`f`).log(e)}),this.exit(0)}),this[Cn](l,!o,!!n,!1)}if(F(this,U,`f`)||(f?(F(this,B,`f`)&&st(!0),a=!0,this.showHelp(`log`),this.exit(0)):p&&(F(this,B,`f`)&&st(!0),a=!0,F(this,X,`f`).showVersion(`log`),this.exit(0))),!a&&F(this,K,`f`).skipValidation.length>0&&(a=Object.keys(l).some(e=>F(this,K,`f`).skipValidation.indexOf(e)>=0&&l[e]===!0)),!a){if(c.error)throw new k(c.error.message);if(!m){let e=this[Dn](d,{},c.error);n||(u=Je(l,this,F(this,V,`f`).getMiddleware(),!0)),u=this[pn](e,u==null?l:u),M(u)&&!n&&(u=u.then(()=>Je(l,this,F(this,V,`f`).getMiddleware(),!1)))}}}catch(e){if(e instanceof k)F(this,X,`f`).fail(e.message,e);else throw e}return this[Cn](u==null?l:u,o,!!n,!0)}[Dn](e,t,n,r){let i={...this.getDemandedOptions()};return a=>{if(n)throw new k(n.message);F(this,Q,`f`).nonOptionCount(a),F(this,Q,`f`).requiredArguments(a,i);let o=!1;F(this,Wt,`f`)&&(o=F(this,Q,`f`).unknownCommands(a)),F(this,Ut,`f`)&&!o?F(this,Q,`f`).unknownArguments(a,e,t,!!r):F(this,Gt,`f`)&&F(this,Q,`f`).unknownArguments(a,e,{},!1,!1),F(this,Q,`f`).limitedChoices(a),F(this,Q,`f`).implications(a),F(this,Q,`f`).conflicting(a)}}[On](){P(this,U,!0,`f`)}[kn](e){if(typeof e==`string`)F(this,K,`f`).key[e]=!0;else for(let t of e)F(this,K,`f`).key[t]=!0}};function jn(e){return!!e&&typeof e.getInternalMethods==`function`}const Mn=qt(ze);var Nn=Mn;function Pn(e,t){let n=e.startsWith(`.`)?u(t,e):e;return import(n)}function Fn(e,t){return Pn(e,t).catch(e=>{if(e.code===`ERR_MODULE_NOT_FOUND`&&e.message.endsWith(` imported from ${g(import.meta.url)}`))return!1;throw e})}function In(e){return Object.keys(e).some(e=>e&&e!==`$0`)}function Ln(e,t){let{homepage:n,site:r=n,repository:i}=t,a=r&&r!==i,o=e.getInternalMethods(),s=In(o.getCommandInstance().handlers);return o.getUsageInstance().getUsage().length===0&&(s?e.usage(`Usage: $0 <command>`):e.usage(`Usage: $0`)),s&&e.demandCommand(1,`Won't work without a command`),a&&e.epilogue(`Website: ${r}`),i&&e.epilogue(`Repository: ${i}`),e}function Rn(e,t){if(typeof e==`string`||!e)return t;let n=Object.keys(e);return n.length===1?n[0]:!1}var zn=class{constructor(e,n){this.root=n;let{bin:r,homepage:i,name:a=`cheetor`,repository:{url:o=``}={},version:s}=typeof e==`string`?JSON.parse(t(new URL(e,n))):e;this.homepage=i,this.repository=o.includes(`github.com`)?o.replace(/\.git$/,``):``;let c=Nn(process.argv.slice(2)).strict().alias(`help`,`h`).alias(`version`,`v`).hide(`help`).version(s).hide(`version`).detectLocale(!1),l=Rn(r,a);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(e){return this.cli=this.cli.then(e),this}command(...e){return this.cli=this.cli.then(t=>t.command(...e)),this}commandFrom(e){return this.cli=this.cli.then(async t=>{let n=await Pn(e,this.root);return t.command(n)}),this}commandSafe(e){return this.cli=this.cli.then(t=>Fn(e,this.root).then(e=>e&&e.command?t.command(e):t)),this}commandSmart(e){return this.cli=this.cli.then(async t=>{let n=e();return n&&n.command?t.command(n):t}),this}website(e){return this.site=e,this}middleware(...e){return this.cli=this.cli.then(t=>t.middleware(...e)),this}setup(e){return this.cli.then(e=>Ln(e,this)).then(t=>typeof e==`function`?e(t.parse()):t.parse())}};process.on(`SIGINT`,()=>{}),new zn(`../package.json`,import.meta.url).website(`https://www.npmjs.com/org/nice-move`).setup(()=>{import(`./lib-T4cb7oFr.mjs`).then(({init:e})=>{e()}).catch(e=>{if(e.message!==`cancel`)throw e})});
82
+ `,r=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,r),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function ut(e,t,n,r){return new lt(e,t,n,r)}function dt(e){return e.length<3}function ft(e){return e.length>3}function pt(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let n=[],r;for(r=0;r<=t.length;r++)n[r]=[r];let i;for(i=0;i<=e.length;i++)n[0][i]=i;for(r=1;r<=t.length;r++)for(i=1;i<=e.length;i++)t.charAt(r-1)===e.charAt(i-1)?n[r][i]=n[r-1][i-1]:r>1&&i>1&&t.charAt(r-2)===e.charAt(i-1)&&t.charAt(r-1)===e.charAt(i-2)?n[r][i]=n[r-2][i-2]+1:n[r][i]=Math.min(n[r-1][i-1]+1,Math.min(n[r][i-1]+1,n[r-1][i]+1));return n[t.length][e.length]}const mt=[`$0`,`--`,`_`];function ht(e,t,n){let r=n.y18n.__,i=n.y18n.__n,a={};a.nonOptionCount=function(n){let r=e.getDemandedCommands(),a=n._.length+(n[`--`]?n[`--`].length:0)-e.getInternalMethods().getContext().commands.length;r._&&(a<r._.min||a>r._.max)&&(a<r._.min?r._.minMsg===void 0?t.fail(i(`Not enough non-option arguments: got %s, need at least %s`,`Not enough non-option arguments: got %s, need at least %s`,a,a.toString(),r._.min.toString())):t.fail(r._.minMsg?r._.minMsg.replace(/\$0/g,a.toString()).replace(/\$1/,r._.min.toString()):null):a>r._.max&&(r._.maxMsg===void 0?t.fail(i(`Too many non-option arguments: got %s, maximum of %s`,`Too many non-option arguments: got %s, maximum of %s`,a,a.toString(),r._.max.toString())):t.fail(r._.maxMsg?r._.maxMsg.replace(/\$0/g,a.toString()).replace(/\$1/,r._.max.toString()):null)))},a.positionalCount=function(e,n){n<e&&t.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+``,e+``))},a.requiredArguments=function(e,n){let r=null;for(let t of Object.keys(n))(!Object.prototype.hasOwnProperty.call(e,t)||e[t]===void 0)&&(r=r||{},r[t]=n[t]);if(r){let e=[];for(let t of Object.keys(r)){let n=r[t];n&&e.indexOf(n)<0&&e.push(n)}let n=e.length?`\n${e.join(`
83
+ `)}`:``;t.fail(i(`Missing required argument: %s`,`Missing required arguments: %s`,Object.keys(r).length,Object.keys(r).join(`, `)+n))}},a.unknownArguments=function(n,r,o,s,c=!0){var l;let u=e.getInternalMethods().getCommandInstance().getCommands(),d=[],f=e.getInternalMethods().getContext();if(Object.keys(n).forEach(t=>{!mt.includes(t)&&!Object.prototype.hasOwnProperty.call(o,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!a.isValidAndSomeAliasIsNotNew(t,r)&&d.push(t)}),c&&(f.commands.length>0||u.length>0||s)&&n._.slice(f.commands.length).forEach(e=>{u.includes(``+e)||d.push(``+e)}),c){let t=((l=e.getDemandedCommands()._)==null?void 0:l.max)||0,r=f.commands.length+t;r<n._.length&&n._.slice(r).forEach(e=>{e=String(e),!f.commands.includes(e)&&!d.includes(e)&&d.push(e)})}d.length&&t.fail(i(`Unknown argument: %s`,`Unknown arguments: %s`,d.length,d.map(e=>e.trim()?e:`"${e}"`).join(`, `)))},a.unknownCommands=function(n){let r=e.getInternalMethods().getCommandInstance().getCommands(),a=[],o=e.getInternalMethods().getContext();return(o.commands.length>0||r.length>0)&&n._.slice(o.commands.length).forEach(e=>{r.includes(``+e)||a.push(``+e)}),a.length>0?(t.fail(i(`Unknown command: %s`,`Unknown commands: %s`,a.length,a.join(`, `))),!0):!1},a.isValidAndSomeAliasIsNotNew=function(t,n){if(!Object.prototype.hasOwnProperty.call(n,t))return!1;let r=e.parsed.newAliases;return[t,...n[t]].some(e=>!Object.prototype.hasOwnProperty.call(r,e)||!r[t])},a.limitedChoices=function(n){let i=e.getOptions(),a={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach(e=>{mt.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(i.choices,e)&&[].concat(n[e]).forEach(t=>{i.choices[e].indexOf(t)===-1&&t!==void 0&&(a[e]=(a[e]||[]).concat(t))})});let o=Object.keys(a);if(!o.length)return;let s=r(`Invalid values:`);o.forEach(e=>{s+=`\n ${r(`Argument: %s, Given: %s, Choices: %s`,e,t.stringifiedValues(a[e]),t.stringifiedValues(i.choices[e]))}`}),t.fail(s)};let o={};a.implies=function(t,r){M(`<string|object> [array|number|string]`,[t,r],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.implies(e,t[e])}):(e.global(t),o[t]||(o[t]=[]),Array.isArray(r)?r.forEach(e=>a.implies(t,e)):(A(r,void 0,n),o[t].push(r)))},a.getImplied=function(){return o};function s(e,t){let n=Number(t);return t=isNaN(n)?t:n,typeof t==`number`?t=e._.length>=t:t.match(/^--no-.+/)?(t=t.match(/^--no-(.+)/)[1],t=!Object.prototype.hasOwnProperty.call(e,t)):t=Object.prototype.hasOwnProperty.call(e,t),t}a.implications=function(e){let n=[];if(Object.keys(o).forEach(t=>{let r=t;(o[t]||[]).forEach(t=>{let i=r,a=t;i=s(e,i),t=s(e,t),i&&!t&&n.push(` ${r} -> ${a}`)})}),n.length){let e=`${r(`Implications failed:`)}\n`;n.forEach(t=>{e+=t}),t.fail(e)}};let c={};a.conflicts=function(t,n){M(`<string|object> [array|string]`,[t,n],arguments.length),typeof t==`object`?Object.keys(t).forEach(e=>{a.conflicts(e,t[e])}):(e.global(t),c[t]||(c[t]=[]),Array.isArray(n)?n.forEach(e=>a.conflicts(t,e)):c[t].push(n))},a.getConflicting=()=>c,a.conflicting=function(i){Object.keys(i).forEach(e=>{c[e]&&c[e].forEach(n=>{n&&i[e]!==void 0&&i[n]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,n))})}),e.getInternalMethods().getParserConfiguration()[`strip-dashed`]&&Object.keys(c).forEach(e=>{c[e].forEach(a=>{a&&i[n.Parser.camelCase(e)]!==void 0&&i[n.Parser.camelCase(a)]!==void 0&&t.fail(r(`Arguments %s and %s are mutually exclusive`,e,a))})})},a.recommendCommands=function(e,n){n=n.sort((e,t)=>t.length-e.length);let i=null,a=1/0;for(let t=0,r;(r=n[t])!==void 0;t++){let t=pt(e,r);t<=3&&t<a&&(a=t,i=r)}i&&t.fail(r(`Did you mean %s?`,i))},a.reset=function(e){return o=tt(o,t=>!e[t]),c=tt(c,t=>!e[t]),a};let l=[];return a.freeze=function(){l.push({implied:o,conflicting:c})},a.unfreeze=function(){let e=l.pop();A(e,void 0,n),{implied:o,conflicting:c}=e},a}let gt=[],_t;function vt(t,n,r,i){_t=i;let a={};if(Object.prototype.hasOwnProperty.call(t,`extends`)){if(typeof t.extends!=`string`)return a;let i=/\.json|\..*rc$/.test(t.extends),o=null;if(i)o=bt(n,t.extends);else try{o=e.resolve(t.extends)}catch(e){return t}yt(o),gt.push(o),a=i?JSON.parse(_t.readFileSync(o,`utf8`)):e(t.extends),delete t.extends,a=vt(a,_t.path.dirname(o),r,_t)}return gt=[],r?xt(a,t):Object.assign({},a,t)}function yt(e){if(gt.indexOf(e)>-1)throw new D(`Circular extended configurations: '${e}'.`)}function bt(e,t){return _t.path.resolve(e,t)}function xt(e,t){let n={};function r(e){return e&&typeof e==`object`&&!Array.isArray(e)}Object.assign(n,e);for(let i of Object.keys(t))r(t[i])&&r(n[i])?n[i]=xt(e[i],t[i]):n[i]=t[i];return n}var N=function(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n},P=function(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)},F,St,Ct,I,L,wt,R,Tt,Et,z,Dt,B,V,H,U,Ot,kt,W,G,At,jt,K,Mt,Nt,Pt,q,Ft,J,It,Lt,Rt,Y,zt,X,Z;function Bt(e){return(t=[],n=e.process.cwd(),r)=>{let i=new Sn(t,n,r,e);return Object.defineProperty(i,`argv`,{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}const Vt=Symbol(`copyDoubleDash`),Ht=Symbol(`copyDoubleDash`),Ut=Symbol(`deleteFromParserHintObject`),Wt=Symbol(`emitWarning`),Gt=Symbol(`freeze`),Kt=Symbol(`getDollarZero`),Q=Symbol(`getParserConfiguration`),qt=Symbol(`getUsageConfiguration`),Jt=Symbol(`guessLocale`),Yt=Symbol(`guessVersion`),Xt=Symbol(`parsePositionalNumbers`),Zt=Symbol(`pkgUp`),$=Symbol(`populateParserHintArray`),Qt=Symbol(`populateParserHintSingleValueDictionary`),$t=Symbol(`populateParserHintArrayDictionary`),en=Symbol(`populateParserHintDictionary`),tn=Symbol(`sanitizeKey`),nn=Symbol(`setKey`),rn=Symbol(`unfreeze`),an=Symbol(`validateAsync`),on=Symbol(`getCommandInstance`),sn=Symbol(`getContext`),cn=Symbol(`getHasOutput`),ln=Symbol(`getLoggerInstance`),un=Symbol(`getParseContext`),dn=Symbol(`getUsageInstance`),fn=Symbol(`getValidationInstance`),pn=Symbol(`hasParseCallback`),mn=Symbol(`isGlobalContext`),hn=Symbol(`postProcess`),gn=Symbol(`rebase`),_n=Symbol(`reset`),vn=Symbol(`runYargsParserAndExecuteCommands`),yn=Symbol(`runValidation`),bn=Symbol(`setHasOutput`),xn=Symbol(`kTrackManuallySetKeys`);var Sn=class{constructor(e=[],t,n,r){this.customScriptName=!1,this.parsed=!1,F.set(this,void 0),St.set(this,void 0),Ct.set(this,{commands:[],fullCommands:[]}),I.set(this,null),L.set(this,null),wt.set(this,`show-hidden`),R.set(this,null),Tt.set(this,!0),Et.set(this,{}),z.set(this,!0),Dt.set(this,[]),B.set(this,void 0),V.set(this,{}),H.set(this,!1),U.set(this,null),Ot.set(this,!0),kt.set(this,void 0),W.set(this,``),G.set(this,void 0),At.set(this,void 0),jt.set(this,{}),K.set(this,null),Mt.set(this,null),Nt.set(this,{}),Pt.set(this,{}),q.set(this,void 0),Ft.set(this,!1),J.set(this,void 0),It.set(this,!1),Lt.set(this,!1),Rt.set(this,!1),Y.set(this,void 0),zt.set(this,{}),X.set(this,null),Z.set(this,void 0),N(this,J,r,`f`),N(this,q,e,`f`),N(this,St,t,`f`),N(this,At,n,`f`),N(this,B,new Ve(this),`f`),this.$0=this[Kt](),this[_n](),N(this,F,P(this,F,`f`),`f`),N(this,Y,P(this,Y,`f`),`f`),N(this,Z,P(this,Z,`f`),`f`),N(this,G,P(this,G,`f`),`f`),P(this,G,`f`).showHiddenOpt=P(this,wt,`f`),N(this,kt,this[Ht](),`f`)}addHelpOpt(e,t){return M(`[string|boolean] [string]`,[e,t],arguments.length),P(this,U,`f`)&&(this[Ut](P(this,U,`f`)),N(this,U,null,`f`)),e===!1&&t===void 0?this:(N(this,U,typeof e==`string`?e:`help`,`f`),this.boolean(P(this,U,`f`)),this.describe(P(this,U,`f`),t||P(this,Y,`f`).deferY18nLookup(`Show help`)),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(M(`[string|boolean] [string]`,[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e==`string`?e:P(this,wt,`f`);return this.boolean(n),this.describe(n,t||P(this,Y,`f`).deferY18nLookup(`Show hidden options`)),P(this,G,`f`).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return M(`<object|string|array> [string|array]`,[e,t],arguments.length),this[$t](this.alias.bind(this),`alias`,e,t),this}array(e){return M(`<array|string>`,[e],arguments.length),this[$](`array`,e),this[xn](e),this}boolean(e){return M(`<array|string>`,[e],arguments.length),this[$](`boolean`,e),this[xn](e),this}check(e,t){return M(`<function> [boolean]`,[e,t],arguments.length),this.middleware((t,n)=>We(()=>e(t,n.getOptions()),n=>(n?(typeof n==`string`||n instanceof Error)&&P(this,Y,`f`).fail(n.toString(),n):P(this,Y,`f`).fail(P(this,J,`f`).y18n.__(`Argument check failed: %s`,e.toString())),t),e=>(P(this,Y,`f`).fail(e.message?e.message:e.toString(),e),t)),!1,t),this}choices(e,t){return M(`<object|string|array> [string|array]`,[e,t],arguments.length),this[$t](this.choices.bind(this),`choices`,e,t),this}coerce(e,t){if(M(`<object|string|array> [function]`,[e,t],arguments.length),Array.isArray(e)){if(!t)throw new D(`coerce callback must be provided`);for(let n of e)this.coerce(n,t);return this}else if(typeof e==`object`){for(let t of Object.keys(e))this.coerce(t,e[t]);return this}if(!t)throw new D(`coerce callback must be provided`);return P(this,G,`f`).key[e]=!0,P(this,B,`f`).addCoerceMiddleware((n,r)=>{let i;return Object.prototype.hasOwnProperty.call(n,e)?We(()=>(i=r.getAliases(),t(n[e])),t=>{n[e]=t;let a=r.getInternalMethods().getParserConfiguration()[`strip-aliased`];if(i[e]&&a!==!0)for(let r of i[e])n[r]=t;return n},e=>{throw new D(e.message)}):n},e),this}conflicts(e,t){return M(`<string|object> [string|array]`,[e,t],arguments.length),P(this,Z,`f`).conflicts(e,t),this}config(e=`config`,t,n){return M(`[object|string] [string|function] [function]`,[e,t,n],arguments.length),typeof e==`object`&&!Array.isArray(e)?(e=vt(e,P(this,St,`f`),this[Q]()[`deep-merge-config`]||!1,P(this,J,`f`)),P(this,G,`f`).configObjects=(P(this,G,`f`).configObjects||[]).concat(e),this):(typeof t==`function`&&(n=t,t=void 0),this.describe(e,t||P(this,Y,`f`).deferY18nLookup(`Path to JSON config file`)),(Array.isArray(e)?e:[e]).forEach(e=>{P(this,G,`f`).config[e]=n||!0}),this)}completion(e,t,n){return M(`[string] [string|boolean|function] [function]`,[e,t,n],arguments.length),typeof t==`function`&&(n=t,t=void 0),N(this,L,e||P(this,L,`f`)||`completion`,`f`),!t&&t!==!1&&(t=`generate completion script`),this.command(P(this,L,`f`),t),n&&P(this,I,`f`).registerFunction(n),this}command(e,t,n,r,i,a){return M(`<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]`,[e,t,n,r,i,a],arguments.length),P(this,F,`f`).addHandler(e,t,n,r,i,a),this}commands(e,t,n,r,i,a){return this.command(e,t,n,r,i,a)}commandDir(e,t){M(`<string> [object]`,[e,t],arguments.length);let n=P(this,At,`f`)||P(this,J,`f`).require;return P(this,F,`f`).addDirectory(e,n,P(this,J,`f`).getCallerFile(),t),this}count(e){return M(`<array|string>`,[e],arguments.length),this[$](`count`,e),this[xn](e),this}default(e,t,n){return M(`<object|string|array> [*] [string]`,[e,t,n],arguments.length),n&&(Fe(e,P(this,J,`f`)),P(this,G,`f`).defaultDescription[e]=n),typeof t==`function`&&(Fe(e,P(this,J,`f`)),P(this,G,`f`).defaultDescription[e]||(P(this,G,`f`).defaultDescription[e]=P(this,Y,`f`).functionDescription(t)),t=t.call()),this[Qt](this.default.bind(this),`default`,e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,r){return M(`[number] [number|string] [string|null|undefined] [string|null|undefined]`,[e,t,n,r],arguments.length),typeof t!=`number`&&(n=t,t=1/0),this.global(`_`,!1),P(this,G,`f`).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:r},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(e=>{A(n,!0,P(this,J,`f`)),this.demandOption(e,n)}),t=1/0):typeof t!=`number`&&(n=t,t=1/0),typeof e==`number`?(A(n,!0,P(this,J,`f`)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(e=>{A(n,!0,P(this,J,`f`)),this.demandOption(e,n)}):typeof n==`string`?this.demandOption(e,n):(n===!0||n===void 0)&&this.demandOption(e),this}demandOption(e,t){return M(`<object|string|array> [string]`,[e,t],arguments.length),this[Qt](this.demandOption.bind(this),`demandedOptions`,e,t),this}deprecateOption(e,t){return M(`<string> [string|boolean]`,[e,t],arguments.length),P(this,G,`f`).deprecatedOptions[e]=t,this}describe(e,t){return M(`<object|string|array> [string]`,[e,t],arguments.length),this[nn](e,!0),P(this,Y,`f`).describe(e,t),this}detectLocale(e){return M(`<boolean>`,[e],arguments.length),N(this,Tt,e,`f`),this}env(e){return M(`[string|boolean]`,[e],arguments.length),e===!1?delete P(this,G,`f`).envPrefix:P(this,G,`f`).envPrefix=e||``,this}epilogue(e){return M(`<string>`,[e],arguments.length),P(this,Y,`f`).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return M(`<string|array> [string]`,[e,t],arguments.length),Array.isArray(e)?e.forEach(e=>this.example(...e)):P(this,Y,`f`).example(e,t),this}exit(e,t){N(this,H,!0,`f`),N(this,R,t,`f`),P(this,z,`f`)&&P(this,J,`f`).process.exit(e)}exitProcess(e=!0){return M(`[boolean]`,[e],arguments.length),N(this,z,e,`f`),this}fail(e){if(M(`<function|boolean>`,[e],arguments.length),typeof e==`boolean`&&e!==!1)throw new D(`Invalid first argument. Expected function or boolean 'false'`);return P(this,Y,`f`).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return M(`<array> [function]`,[e,t],arguments.length),t?P(this,I,`f`).getCompletion(e,t):new Promise((t,n)=>{P(this,I,`f`).getCompletion(e,(e,r)=>{e?n(e):t(r)})})}getDemandedOptions(){return M([],0),P(this,G,`f`).demandedOptions}getDemandedCommands(){return M([],0),P(this,G,`f`).demandedCommands}getDeprecatedOptions(){return M([],0),P(this,G,`f`).deprecatedOptions}getDetectLocale(){return P(this,Tt,`f`)}getExitProcess(){return P(this,z,`f`)}getGroups(){return Object.assign({},P(this,V,`f`),P(this,Pt,`f`))}getHelp(){if(N(this,H,!0,`f`),!P(this,Y,`f`).hasCachedHelpMessage()){if(!this.parsed){let e=this[vn](P(this,q,`f`),void 0,void 0,0,!0);if(j(e))return e.then(()=>P(this,Y,`f`).help())}let e=P(this,F,`f`).runDefaultBuilderOn(this);if(j(e))return e.then(()=>P(this,Y,`f`).help())}return Promise.resolve(P(this,Y,`f`).help())}getOptions(){return P(this,G,`f`)}getStrict(){return P(this,It,`f`)}getStrictCommands(){return P(this,Lt,`f`)}getStrictOptions(){return P(this,Rt,`f`)}global(e,t){return M(`<string|array> [boolean]`,[e,t],arguments.length),e=[].concat(e),t===!1?e.forEach(e=>{P(this,G,`f`).local.includes(e)||P(this,G,`f`).local.push(e)}):P(this,G,`f`).local=P(this,G,`f`).local.filter(t=>e.indexOf(t)===-1),this}group(e,t){M(`<string|array> <string>`,[e,t],arguments.length);let n=P(this,Pt,`f`)[t]||P(this,V,`f`)[t];P(this,Pt,`f`)[t]&&delete P(this,Pt,`f`)[t];let r={};return P(this,V,`f`)[t]=(n||[]).concat(e).filter(e=>r[e]?!1:r[e]=!0),this}hide(e){return M(`<string>`,[e],arguments.length),P(this,G,`f`).hiddenOptions.push(e),this}implies(e,t){return M(`<string|object> [number|string|array]`,[e,t],arguments.length),P(this,Z,`f`).implies(e,t),this}locale(e){return M(`[string]`,[e],arguments.length),e===void 0?(this[Jt](),P(this,J,`f`).y18n.getLocale()):(N(this,Tt,!1,`f`),P(this,J,`f`).y18n.setLocale(e),this)}middleware(e,t,n){return P(this,B,`f`).addMiddleware(e,!!t,n)}nargs(e,t){return M(`<string|object|array> [number]`,[e,t],arguments.length),this[Qt](this.nargs.bind(this),`narg`,e,t),this}normalize(e){return M(`<array|string>`,[e],arguments.length),this[$](`normalize`,e),this}number(e){return M(`<array|string>`,[e],arguments.length),this[$](`number`,e),this[xn](e),this}option(e,t){if(M(`<string|object> [object]`,[e,t],arguments.length),typeof e==`object`)Object.keys(e).forEach(t=>{this.options(t,e[t])});else{typeof t!=`object`&&(t={}),this[xn](e),P(this,X,`f`)&&(e===`version`||(t==null?void 0:t.alias)===`version`)&&this[Wt]([`"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(`
84
+ `),void 0,`versionWarning`),P(this,G,`f`).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let r=t.demand||t.required||t.require;r&&this.demand(e,r),t.demandOption&&this.demandOption(e,typeof t.demandOption==`string`?t.demandOption:void 0),t.conflicts&&this.conflicts(e,t.conflicts),`default`in t&&this.default(e,t.default),t.implies!==void 0&&this.implies(e,t.implies),t.nargs!==void 0&&this.nargs(e,t.nargs),t.config&&this.config(e,t.configParser),t.normalize&&this.normalize(e),t.choices&&this.choices(e,t.choices),t.coerce&&this.coerce(e,t.coerce),t.group&&this.group(e,t.group),(t.boolean||t.type===`boolean`)&&(this.boolean(e),t.alias&&this.boolean(t.alias)),(t.array||t.type===`array`)&&(this.array(e),t.alias&&this.array(t.alias)),(t.number||t.type===`number`)&&(this.number(e),t.alias&&this.number(t.alias)),(t.string||t.type===`string`)&&(this.string(e),t.alias&&this.string(t.alias)),(t.count||t.type===`count`)&&this.count(e),typeof t.global==`boolean`&&this.global(e,t.global),t.defaultDescription&&(P(this,G,`f`).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let i=t.describe||t.description||t.desc,a=P(this,Y,`f`).getDescriptions();(!Object.prototype.hasOwnProperty.call(a,e)||typeof i==`string`)&&this.describe(e,i),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){M(`[string|array] [function|boolean|object] [function]`,[e,t,n],arguments.length),this[Gt](),e===void 0&&(e=P(this,q,`f`)),typeof t==`object`&&(N(this,Mt,t,`f`),t=n),typeof t==`function`&&(N(this,K,t,`f`),t=!1),t||N(this,q,e,`f`),P(this,K,`f`)&&N(this,z,!1,`f`);let r=this[vn](e,!!t),i=this.parsed;return P(this,I,`f`).setParsed(this.parsed),j(r)?r.then(e=>(P(this,K,`f`)&&P(this,K,`f`).call(this,P(this,R,`f`),e,P(this,W,`f`)),e)).catch(e=>{throw P(this,K,`f`)&&P(this,K,`f`)(e,this.parsed.argv,P(this,W,`f`)),e}).finally(()=>{this[rn](),this.parsed=i}):(P(this,K,`f`)&&P(this,K,`f`).call(this,P(this,R,`f`),r,P(this,W,`f`)),this[rn](),this.parsed=i,r)}parseAsync(e,t,n){let r=this.parse(e,t,n);return j(r)?r:Promise.resolve(r)}parseSync(e,t,n){let r=this.parse(e,t,n);if(j(r))throw new D(`.parseSync() must not be used with asynchronous builders, handlers, or middleware`);return r}parserConfiguration(e){return M(`<object>`,[e],arguments.length),N(this,jt,e,`f`),this}pkgConf(e,t){M(`<string> [string]`,[e,t],arguments.length);let n=null,r=this[Zt](t||P(this,St,`f`));return r[e]&&typeof r[e]==`object`&&(n=vt(r[e],t||P(this,St,`f`),this[Q]()[`deep-merge-config`]||!1,P(this,J,`f`)),P(this,G,`f`).configObjects=(P(this,G,`f`).configObjects||[]).concat(n)),this}positional(e,t){M(`<string> <object>`,[e,t],arguments.length);let n=[`default`,`defaultDescription`,`implies`,`normalize`,`choices`,`conflicts`,`coerce`,`type`,`describe`,`desc`,`description`,`alias`];t=tt(t,(e,t)=>e===`type`&&![`string`,`number`,`boolean`].includes(t)?!1:n.includes(e));let r=P(this,Ct,`f`).fullCommands[P(this,Ct,`f`).fullCommands.length-1],i=r?P(this,F,`f`).cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return Ie(i).forEach(n=>{let r=i[n];Array.isArray(r)?r.indexOf(e)!==-1&&(t[n]=!0):r[e]&&!(n in t)&&(t[n]=r[e])}),this.group(e,P(this,Y,`f`).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return M(`[boolean]`,[e],arguments.length),N(this,Ft,e,`f`),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return M(`<array|string|object> [number]`,[e],arguments.length),typeof e==`string`&&P(this,G,`f`).narg[e]||this[Qt](this.requiresArg.bind(this),`narg`,e,NaN),this}showCompletionScript(e,t){return M(`[string] [string]`,[e,t],arguments.length),e=e||this.$0,P(this,kt,`f`).log(P(this,I,`f`).generateCompletionScript(e,t||P(this,L,`f`)||`completion`)),this}showHelp(e){if(M(`[string|function]`,[e],arguments.length),N(this,H,!0,`f`),!P(this,Y,`f`).hasCachedHelpMessage()){if(!this.parsed){let t=this[vn](P(this,q,`f`),void 0,void 0,0,!0);if(j(t))return t.then(()=>{P(this,Y,`f`).showHelp(e)}),this}let t=P(this,F,`f`).runDefaultBuilderOn(this);if(j(t))return t.then(()=>{P(this,Y,`f`).showHelp(e)}),this}return P(this,Y,`f`).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return M(`[boolean|string] [string]`,[e,t],arguments.length),P(this,Y,`f`).showHelpOnFail(e,t),this}showVersion(e){return M(`[string|function]`,[e],arguments.length),P(this,Y,`f`).showVersion(e),this}skipValidation(e){return M(`<array|string>`,[e],arguments.length),this[$](`skipValidation`,e),this}strict(e){return M(`[boolean]`,[e],arguments.length),N(this,It,e!==!1,`f`),this}strictCommands(e){return M(`[boolean]`,[e],arguments.length),N(this,Lt,e!==!1,`f`),this}strictOptions(e){return M(`[boolean]`,[e],arguments.length),N(this,Rt,e!==!1,`f`),this}string(e){return M(`<array|string>`,[e],arguments.length),this[$](`string`,e),this[xn](e),this}terminalWidth(){return M([],0),P(this,J,`f`).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return M(`<object>`,[e],arguments.length),N(this,Tt,!1,`f`),P(this,J,`f`).y18n.updateLocale(e),this}usage(e,t,n,r){if(M(`<string|null|undefined> [string|boolean] [function|object] [function]`,[e,t,n,r],arguments.length),t!==void 0){if(A(e,null,P(this,J,`f`)),(e||``).match(/^\$0( |$)/))return this.command(e,t,n,r);throw new D(`.usage() description must start with $0 if being used as alias for .command()`)}else return P(this,Y,`f`).usage(e),this}usageConfiguration(e){return M(`<object>`,[e],arguments.length),N(this,zt,e,`f`),this}version(e,t,n){let r=`version`;if(M(`[boolean|string] [string] [string]`,[e,t,n],arguments.length),P(this,X,`f`)&&(this[Ut](P(this,X,`f`)),P(this,Y,`f`).version(void 0),N(this,X,null,`f`)),arguments.length===0)n=this[Yt](),e=r;else if(arguments.length===1){if(e===!1)return this;n=e,e=r}else arguments.length===2&&(n=t,t=void 0);return N(this,X,typeof e==`string`?e:r,`f`),t=t||P(this,Y,`f`).deferY18nLookup(`Show version number`),P(this,Y,`f`).version(n||void 0),this.boolean(P(this,X,`f`)),this.describe(P(this,X,`f`),t),this}wrap(e){return M(`<number|null|undefined>`,[e],arguments.length),P(this,Y,`f`).wrap(e),this}[(F=new WeakMap,St=new WeakMap,Ct=new WeakMap,I=new WeakMap,L=new WeakMap,wt=new WeakMap,R=new WeakMap,Tt=new WeakMap,Et=new WeakMap,z=new WeakMap,Dt=new WeakMap,B=new WeakMap,V=new WeakMap,H=new WeakMap,U=new WeakMap,Ot=new WeakMap,kt=new WeakMap,W=new WeakMap,G=new WeakMap,At=new WeakMap,jt=new WeakMap,K=new WeakMap,Mt=new WeakMap,Nt=new WeakMap,Pt=new WeakMap,q=new WeakMap,Ft=new WeakMap,J=new WeakMap,It=new WeakMap,Lt=new WeakMap,Rt=new WeakMap,Y=new WeakMap,zt=new WeakMap,X=new WeakMap,Z=new WeakMap,Vt)](e){if(!e._||!e[`--`])return e;e._.push.apply(e._,e[`--`]);try{delete e[`--`]}catch(e){}return e}[Ht](){return{log:(...e)=>{this[pn]()||console.log(...e),N(this,H,!0,`f`),P(this,W,`f`).length&&N(this,W,P(this,W,`f`)+`
85
+ `,`f`),N(this,W,P(this,W,`f`)+e.join(` `),`f`)},error:(...e)=>{this[pn]()||console.error(...e),N(this,H,!0,`f`),P(this,W,`f`).length&&N(this,W,P(this,W,`f`)+`
86
+ `,`f`),N(this,W,P(this,W,`f`)+e.join(` `),`f`)}}}[Ut](e){Ie(P(this,G,`f`)).forEach(t=>{if((e=>e===`configObjects`)(t))return;let n=P(this,G,`f`)[t];Array.isArray(n)?n.includes(e)&&n.splice(n.indexOf(e),1):typeof n==`object`&&delete n[e]}),delete P(this,Y,`f`).getDescriptions()[e]}[Wt](e,t,n){P(this,Et,`f`)[n]||(P(this,J,`f`).process.emitWarning(e,t),P(this,Et,`f`)[n]=!0)}[Gt](){P(this,Dt,`f`).push({options:P(this,G,`f`),configObjects:P(this,G,`f`).configObjects.slice(0),exitProcess:P(this,z,`f`),groups:P(this,V,`f`),strict:P(this,It,`f`),strictCommands:P(this,Lt,`f`),strictOptions:P(this,Rt,`f`),completionCommand:P(this,L,`f`),output:P(this,W,`f`),exitError:P(this,R,`f`),hasOutput:P(this,H,`f`),parsed:this.parsed,parseFn:P(this,K,`f`),parseContext:P(this,Mt,`f`)}),P(this,Y,`f`).freeze(),P(this,Z,`f`).freeze(),P(this,F,`f`).freeze(),P(this,B,`f`).freeze()}[Kt](){let e=``,t;return t=/\b(node|iojs|electron)(\.exe)?$/.test(P(this,J,`f`).process.argv()[0])?P(this,J,`f`).process.argv().slice(1,2):P(this,J,`f`).process.argv().slice(0,1),e=t.map(e=>{let t=this[gn](P(this,St,`f`),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e}).join(` `).trim(),P(this,J,`f`).getEnv(`_`)&&P(this,J,`f`).getProcessArgvBin()===P(this,J,`f`).getEnv(`_`)&&(e=P(this,J,`f`).getEnv(`_`).replace(`${P(this,J,`f`).path.dirname(P(this,J,`f`).process.execPath())}/`,``)),e}[Q](){return P(this,jt,`f`)}[qt](){return P(this,zt,`f`)}[Jt](){if(!P(this,Tt,`f`))return;let e=P(this,J,`f`).getEnv(`LC_ALL`)||P(this,J,`f`).getEnv(`LC_MESSAGES`)||P(this,J,`f`).getEnv(`LANG`)||P(this,J,`f`).getEnv(`LANGUAGE`)||`en_US`;this.locale(e.replace(/[.:].*/,``))}[Yt](){return this[Zt]().version||`unknown`}[Xt](e){let t=e[`--`]?e[`--`]:e._;for(let e=0,n;(n=t[e])!==void 0;e++)P(this,J,`f`).Parser.looksLikeNumber(n)&&Number.isSafeInteger(Math.floor(parseFloat(`${n}`)))&&(t[e]=Number(n));return e}[Zt](e){let t=e||`*`;if(P(this,Nt,`f`)[t])return P(this,Nt,`f`)[t];let n={};try{let t=e||P(this,J,`f`).mainFilename;!e&&P(this,J,`f`).path.extname(t)&&(t=P(this,J,`f`).path.dirname(t));let r=P(this,J,`f`).findUp(t,(e,t)=>{if(t.includes(`package.json`))return`package.json`});A(r,void 0,P(this,J,`f`)),n=JSON.parse(P(this,J,`f`).readFileSync(r,`utf8`))}catch(e){}return P(this,Nt,`f`)[t]=n||{},P(this,Nt,`f`)[t]}[$](e,t){t=[].concat(t),t.forEach(t=>{t=this[tn](t),P(this,G,`f`)[e].push(t)})}[Qt](e,t,n,r){this[en](e,t,n,r,(e,t,n)=>{P(this,G,`f`)[e][t]=n})}[$t](e,t,n,r){this[en](e,t,n,r,(e,t,n)=>{P(this,G,`f`)[e][t]=(P(this,G,`f`)[e][t]||[]).concat(n)})}[en](e,t,n,r,i){if(Array.isArray(n))n.forEach(t=>{e(t,r)});else if((e=>typeof e==`object`)(n))for(let t of Ie(n))e(t,n[t]);else i(t,this[tn](n),r)}[tn](e){return e===`__proto__`?`___proto___`:e}[nn](e,t){return this[Qt](this[nn].bind(this),`key`,e,t),this}[rn](){var e,t,n,r,i,a,o,s,c,l,u,d;let f=P(this,Dt,`f`).pop();A(f,void 0,P(this,J,`f`));let p;e=this,t=this,n=this,r=this,i=this,a=this,o=this,s=this,c=this,l=this,u=this,d=this,{options:{set value(t){N(e,G,t,`f`)}}.value,configObjects:p,exitProcess:{set value(e){N(t,z,e,`f`)}}.value,groups:{set value(e){N(n,V,e,`f`)}}.value,output:{set value(e){N(r,W,e,`f`)}}.value,exitError:{set value(e){N(i,R,e,`f`)}}.value,hasOutput:{set value(e){N(a,H,e,`f`)}}.value,parsed:this.parsed,strict:{set value(e){N(o,It,e,`f`)}}.value,strictCommands:{set value(e){N(s,Lt,e,`f`)}}.value,strictOptions:{set value(e){N(c,Rt,e,`f`)}}.value,completionCommand:{set value(e){N(l,L,e,`f`)}}.value,parseFn:{set value(e){N(u,K,e,`f`)}}.value,parseContext:{set value(e){N(d,Mt,e,`f`)}}.value}=f,P(this,G,`f`).configObjects=p,P(this,Y,`f`).unfreeze(),P(this,Z,`f`).unfreeze(),P(this,F,`f`).unfreeze(),P(this,B,`f`).unfreeze()}[an](e,t){return We(t,t=>(e(t),t))}getInternalMethods(){return{getCommandInstance:this[on].bind(this),getContext:this[sn].bind(this),getHasOutput:this[cn].bind(this),getLoggerInstance:this[ln].bind(this),getParseContext:this[un].bind(this),getParserConfiguration:this[Q].bind(this),getUsageConfiguration:this[qt].bind(this),getUsageInstance:this[dn].bind(this),getValidationInstance:this[fn].bind(this),hasParseCallback:this[pn].bind(this),isGlobalContext:this[mn].bind(this),postProcess:this[hn].bind(this),reset:this[_n].bind(this),runValidation:this[yn].bind(this),runYargsParserAndExecuteCommands:this[vn].bind(this),setHasOutput:this[bn].bind(this)}}[on](){return P(this,F,`f`)}[sn](){return P(this,Ct,`f`)}[cn](){return P(this,H,`f`)}[ln](){return P(this,kt,`f`)}[un](){return P(this,Mt,`f`)||{}}[dn](){return P(this,Y,`f`)}[fn](){return P(this,Z,`f`)}[pn](){return!!P(this,K,`f`)}[mn](){return P(this,Ot,`f`)}[hn](e,t,n,r){return n||j(e)?e:(t||(e=this[Vt](e)),(this[Q]()[`parse-positional-numbers`]||this[Q]()[`parse-positional-numbers`]===void 0)&&(e=this[Xt](e)),r&&(e=Ue(e,this,P(this,B,`f`).getMiddleware(),!1)),e)}[_n](e={}){N(this,G,P(this,G,`f`)||{},`f`);let t={};t.local=P(this,G,`f`).local||[],t.configObjects=P(this,G,`f`).configObjects||[];let n={};return t.local.forEach(t=>{n[t]=!0,(e[t]||[]).forEach(e=>{n[e]=!0})}),Object.assign(P(this,Pt,`f`),Object.keys(P(this,V,`f`)).reduce((e,t)=>{let r=P(this,V,`f`)[t].filter(e=>!(e in n));return r.length>0&&(e[t]=r),e},{})),N(this,V,{},`f`),[`array`,`boolean`,`string`,`skipValidation`,`count`,`normalize`,`number`,`hiddenOptions`].forEach(e=>{t[e]=(P(this,G,`f`)[e]||[]).filter(e=>!n[e])}),[`narg`,`key`,`alias`,`default`,`defaultDescription`,`config`,`choices`,`demandedOptions`,`demandedCommands`,`deprecatedOptions`].forEach(e=>{t[e]=tt(P(this,G,`f`)[e],e=>!n[e])}),t.envPrefix=P(this,G,`f`).envPrefix,N(this,G,t,`f`),N(this,Y,P(this,Y,`f`)?P(this,Y,`f`).reset(n):it(this,P(this,J,`f`)),`f`),N(this,Z,P(this,Z,`f`)?P(this,Z,`f`).reset(n):ht(this,P(this,Y,`f`),P(this,J,`f`)),`f`),N(this,F,P(this,F,`f`)?P(this,F,`f`).reset():Ye(P(this,Y,`f`),P(this,Z,`f`),P(this,B,`f`),P(this,J,`f`)),`f`),P(this,I,`f`)||N(this,I,ut(this,P(this,Y,`f`),P(this,F,`f`),P(this,J,`f`)),`f`),P(this,B,`f`).reset(),N(this,L,null,`f`),N(this,W,``,`f`),N(this,R,null,`f`),N(this,H,!1,`f`),this.parsed=!1,this}[gn](e,t){return P(this,J,`f`).path.relative(e,t)}[vn](e,t,n,r=0,i=!1){let a=!!n||i;e=e||P(this,q,`f`),P(this,G,`f`).__=P(this,J,`f`).y18n.__,P(this,G,`f`).configuration=this[Q]();let o=!!P(this,G,`f`).configuration[`populate--`],s=Object.assign({},P(this,G,`f`).configuration,{"populate--":!0}),c=P(this,J,`f`).Parser.detailed(e,Object.assign({},P(this,G,`f`),{configuration:{"parse-positional-numbers":!1,...s}})),l=Object.assign(c.argv,P(this,Mt,`f`)),u,d=c.aliases,f=!1,p=!1;Object.keys(l).forEach(e=>{e===P(this,U,`f`)&&l[e]?f=!0:e===P(this,X,`f`)&&l[e]&&(p=!0)}),l.$0=this.$0,this.parsed=c,r===0&&P(this,Y,`f`).clearCachedHelpMessage();try{if(this[Jt](),t)return this[hn](l,o,!!n,!1);P(this,U,`f`)&&[P(this,U,`f`)].concat(d[P(this,U,`f`)]||[]).filter(e=>e.length>1).includes(``+l._[l._.length-1])&&(l._.pop(),f=!0),N(this,Ot,!1,`f`);let s=P(this,F,`f`).getCommands(),m=P(this,I,`f`).completionKey in l,h=f||m||i;if(l._.length){if(s.length){let e;for(let t=r||0,a;l._[t]!==void 0;t++)if(a=String(l._[t]),s.includes(a)&&a!==P(this,L,`f`)){let e=P(this,F,`f`).runCommand(a,this,c,t+1,i,f||p||i);return this[hn](e,o,!!n,!1)}else if(!e&&a!==P(this,L,`f`)){e=a;break}!P(this,F,`f`).hasDefaultCommand()&&P(this,Ft,`f`)&&e&&!h&&P(this,Z,`f`).recommendCommands(e,s)}P(this,L,`f`)&&l._.includes(P(this,L,`f`))&&!m&&(P(this,z,`f`)&&nt(!0),this.showCompletionScript(),this.exit(0))}if(P(this,F,`f`).hasDefaultCommand()&&!h){let e=P(this,F,`f`).runCommand(null,this,c,0,i,f||p||i);return this[hn](e,o,!!n,!1)}if(m){P(this,z,`f`)&&nt(!0),e=[].concat(e);let t=e.slice(e.indexOf(`--${P(this,I,`f`).completionKey}`)+1);return P(this,I,`f`).getCompletion(t,(e,t)=>{if(e)throw new D(e.message);(t||[]).forEach(e=>{P(this,kt,`f`).log(e)}),this.exit(0)}),this[hn](l,!o,!!n,!1)}if(P(this,H,`f`)||(f?(P(this,z,`f`)&&nt(!0),a=!0,this.showHelp(`log`),this.exit(0)):p&&(P(this,z,`f`)&&nt(!0),a=!0,P(this,Y,`f`).showVersion(`log`),this.exit(0))),!a&&P(this,G,`f`).skipValidation.length>0&&(a=Object.keys(l).some(e=>P(this,G,`f`).skipValidation.indexOf(e)>=0&&l[e]===!0)),!a){if(c.error)throw new D(c.error.message);if(!m){let e=this[yn](d,{},c.error);n||(u=Ue(l,this,P(this,B,`f`).getMiddleware(),!0)),u=this[an](e,u==null?l:u),j(u)&&!n&&(u=u.then(()=>Ue(l,this,P(this,B,`f`).getMiddleware(),!1)))}}}catch(e){if(e instanceof D)P(this,Y,`f`).fail(e.message,e);else throw e}return this[hn](u==null?l:u,o,!!n,!0)}[yn](e,t,n,r){let i={...this.getDemandedOptions()};return a=>{if(n)throw new D(n.message);P(this,Z,`f`).nonOptionCount(a),P(this,Z,`f`).requiredArguments(a,i);let o=!1;P(this,Lt,`f`)&&(o=P(this,Z,`f`).unknownCommands(a)),P(this,It,`f`)&&!o?P(this,Z,`f`).unknownArguments(a,e,t,!!r):P(this,Rt,`f`)&&P(this,Z,`f`).unknownArguments(a,e,{},!1,!1),P(this,Z,`f`).limitedChoices(a),P(this,Z,`f`).implications(a),P(this,Z,`f`).conflicting(a)}}[bn](){N(this,H,!0,`f`)}[xn](e){if(typeof e==`string`)P(this,G,`f`).key[e]=!0;else for(let t of e)P(this,G,`f`).key[t]=!0}};function Cn(e){return!!e&&typeof e.getInternalMethods==`function`}var wn=Bt(Pe);function Tn(e,t){return e.startsWith(`.`)?import(u(t,e)):import(e)}function En(e,t){return Tn(e,t).catch(e=>{if(e.code===`ERR_MODULE_NOT_FOUND`&&e.message.endsWith(` imported from ${g(import.meta.url)}`))return!1;throw e})}function Dn(e){return Object.keys(e).some(e=>e&&e!==`$0`)}function On(e,t){let{homepage:n,site:r=n,repository:i}=t,a=r&&r!==i,o=e.getInternalMethods(),s=Dn(o.getCommandInstance().handlers);return o.getUsageInstance().getUsage().length===0&&(s?e.usage(`Usage: $0 <command>`):e.usage(`Usage: $0`)),s&&e.demandCommand(1,`Won't work without a command`),a&&e.epilogue(`Website: ${r}`),i&&e.epilogue(`Repository: ${i}`),e}function kn(e,t){if(typeof e==`string`||!e)return t;let n=Object.keys(e);return n.length===1?n[0]:!1}var An=class{constructor(e,n){this.root=n;let{bin:r,homepage:i,name:a=`cheetor`,repository:{url:o=``}={},version:s}=typeof e==`string`?JSON.parse(t(new URL(e,n))):e;this.homepage=i,this.repository=o.includes(`github.com`)?o.replace(/\.git$/,``):``;let c=wn(process.argv.slice(2)).strict().alias(`help`,`h`).alias(`version`,`v`).hide(`help`).version(s).hide(`version`).detectLocale(!1),l=kn(r,a);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(e){return this.cli=this.cli.then(e),this}command(...e){return this.cli=this.cli.then(t=>t.command(...e)),this}commandFrom(e){return this.cli=this.cli.then(async t=>{let n=await Tn(e,this.root);return t.command(n)}),this}commandSafe(e){return this.cli=this.cli.then(t=>En(e,this.root).then(e=>e&&e.command?t.command(e):t)),this}commandSmart(e){return this.cli=this.cli.then(async t=>{let n=e();return n&&n.command?t.command(n):t}),this}website(e){return this.site=e,this}middleware(...e){return this.cli=this.cli.then(t=>t.middleware(...e)),this}setup(e){return this.cli.then(e=>On(e,this)).then(t=>typeof e==`function`?e(t.parse()):t.parse())}};process.on(`SIGINT`,()=>{}),new An(`../package.json`,import.meta.url).website(`https://www.npmjs.com/org/nice-move`).setup(()=>{import(`./lib-tgLtEyYy.mjs`).then(({init:e})=>{e()}).catch(e=>{if(e.message!==`cancel`)throw e})});export{};