create-qwik 1.6.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +11 -11
- package/package.json +1 -1
- package/starters/apps/base/package.json +3 -3
- package/starters/apps/base/vite.config.ts +1 -1
- package/starters/apps/empty/package.json +1 -1
- package/starters/apps/empty/src/root.tsx +8 -2
- package/starters/apps/library/package.json +3 -3
- package/starters/apps/{basic → playground}/package.json +2 -2
- package/starters/apps/{site-with-visual-cms → playground}/src/root.tsx +8 -2
- package/starters/apps/basic/src/root.tsx +0 -32
- package/starters/apps/site-with-visual-cms/.env +0 -2
- package/starters/apps/site-with-visual-cms/README.md +0 -15
- package/starters/apps/site-with-visual-cms/package.json +0 -17
- package/starters/apps/site-with-visual-cms/public/favicon.svg +0 -1
- package/starters/apps/site-with-visual-cms/public/manifest.json +0 -9
- package/starters/apps/site-with-visual-cms/public/robots.txt +0 -0
- package/starters/apps/site-with-visual-cms/src/components/builder-registry.ts +0 -25
- package/starters/apps/site-with-visual-cms/src/components/counter/counter.module.css +0 -23
- package/starters/apps/site-with-visual-cms/src/components/counter/counter.tsx +0 -81
- package/starters/apps/site-with-visual-cms/src/components/footer/footer.module.css +0 -17
- package/starters/apps/site-with-visual-cms/src/components/footer/footer.tsx +0 -14
- package/starters/apps/site-with-visual-cms/src/components/gauge/gauge.module.css +0 -22
- package/starters/apps/site-with-visual-cms/src/components/gauge/index.tsx +0 -36
- package/starters/apps/site-with-visual-cms/src/components/header/header.module.css +0 -50
- package/starters/apps/site-with-visual-cms/src/components/header/header.tsx +0 -43
- package/starters/apps/site-with-visual-cms/src/components/icons/qwik.tsx +0 -44
- package/starters/apps/site-with-visual-cms/src/components/router-head/router-head.tsx +0 -32
- package/starters/apps/site-with-visual-cms/src/entry.dev.tsx +0 -17
- package/starters/apps/site-with-visual-cms/src/entry.preview.tsx +0 -20
- package/starters/apps/site-with-visual-cms/src/entry.ssr.tsx +0 -33
- package/starters/apps/site-with-visual-cms/src/global.css +0 -128
- package/starters/apps/site-with-visual-cms/src/routes/[...index]/index.tsx +0 -61
- package/starters/apps/site-with-visual-cms/src/routes/layout.tsx +0 -15
- package/starters/apps/site-with-visual-cms/src/routes/service-worker.ts +0 -18
- package/starters/apps/site-with-visual-cms/vite.config.ts +0 -11
- /package/starters/apps/{basic → playground}/public/favicon.svg +0 -0
- /package/starters/apps/{basic → playground}/public/fonts/poppins-400.woff2 +0 -0
- /package/starters/apps/{basic → playground}/public/fonts/poppins-500.woff2 +0 -0
- /package/starters/apps/{basic → playground}/public/fonts/poppins-700.woff2 +0 -0
- /package/starters/apps/{basic → playground}/public/manifest.json +0 -0
- /package/starters/apps/{basic → playground}/public/robots.txt +0 -0
- /package/starters/apps/{basic → playground}/src/components/router-head/router-head.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/counter/counter.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/counter/counter.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/footer/footer.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/footer/footer.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/gauge/gauge.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/gauge/index.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/header/header.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/header/header.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/hero/hero.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/hero/hero.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/icons/qwik.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/infobox/infobox.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/infobox/infobox.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/next-steps/next-steps.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/components/starter/next-steps/next-steps.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/global.css +0 -0
- /package/starters/apps/{basic → playground}/src/media/thunder.png +0 -0
- /package/starters/apps/{basic → playground}/src/routes/demo/flower/flower.css +0 -0
- /package/starters/apps/{basic → playground}/src/routes/demo/flower/index.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/routes/demo/todolist/index.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/routes/demo/todolist/todolist.module.css +0 -0
- /package/starters/apps/{basic → playground}/src/routes/index.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/routes/layout.tsx +0 -0
- /package/starters/apps/{basic → playground}/src/routes/service-worker.ts +0 -0
- /package/starters/apps/{basic → playground}/src/routes/styles.css +0 -0
package/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* create-qwik 1.
|
|
3
|
+
* create-qwik 1.7.0
|
|
4
4
|
* Copyright Builder.io, Inc. All Rights Reserved.
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://github.com/QwikDev/qwik/blob/main/LICENSE
|
|
@@ -102,11 +102,11 @@ ${Ye(ma+vr.repeat(r+2)+ga)}
|
|
|
102
102
|
`)}rowToString(e,t){return this.rasterize(e).forEach((s,r)=>{let o="";s.forEach((i,a)=>{let{width:D}=e[a],h=this.negatePadding(e[a]),f=i;if(h>ye.stringWidth(i)&&(f+=" ".repeat(h-ye.stringWidth(i))),e[a].align&&e[a].align!=="left"&&this.wrap){let d=ja[e[a].align];f=d(f,h),ye.stringWidth(f)<h&&(f+=" ".repeat((D||0)-ye.stringWidth(f)-1))}let c=e[a].padding||[0,0,0,0];c[Fn]&&(o+=" ".repeat(c[Fn])),o+=zr(e[a],f,"| "),o+=f,o+=zr(e[a],f," |"),c[Cn]&&(o+=" ".repeat(c[Cn])),r===0&&t.length>0&&(o=this.renderInline(o,t[t.length-1]))}),t.push({text:o.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let s=e.match(/^ */),r=s?s[0].length:0,o=t.text,i=ye.stringWidth(o.trimRight());return t.span?this.wrap?r<i?e:(t.hidden=!0,o.trimRight()+" ".repeat(r-i)+e.trimLeft()):(t.hidden=!0,o+e):e}rasterize(e){let t=[],s=this.columnWidths(e),r;return e.forEach((o,i)=>{o.width=s[i],this.wrap?r=ye.wrap(o.text,this.negatePadding(o),{hard:!0}).split(`
|
|
103
103
|
`):r=o.text.split(`
|
|
104
104
|
`),o.border&&(r.unshift("."+"-".repeat(this.negatePadding(o)+2)+"."),r.push("'"+"-".repeat(this.negatePadding(o)+2)+"'")),o.padding&&(r.unshift(...new Array(o.padding[Sa]||0).fill("")),r.push(...new Array(o.padding[Ia]||0).fill(""))),r.forEach((a,D)=>{t[D]||t.push([]);let h=t[D];for(let f=0;f<i;f++)h[f]===void 0&&h.push("");h.push(a)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[Fn]||0)+(e.padding[Cn]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(i=>i.width||ye.stringWidth(i.text));let t=e.length,s=this.width,r=e.map(i=>{if(i.width)return t--,s-=i.width,i.width}),o=t?Math.floor(s/t):0;return r.map((i,a)=>i===void 0?Math.max(o,Pa(e[a])):i)}};function zr(n,e,t){return n.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Pa(n){let e=n.padding||[],t=1+(e[Fn]||0)+(e[Cn]||0);return n.border?t+4:t}function Ma(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Ta(n,e){n=n.trim();let t=ye.stringWidth(n);return t<e?" ".repeat(e-t)+n:n}function Wa(n,e){n=n.trim();let t=ye.stringWidth(n);return t>=e?n:" ".repeat(e-t>>1)+n}var ye;function qr(n,e){return ye=e,new vs({width:(n==null?void 0:n.width)||Ma(),wrap:n==null?void 0:n.wrap})}var Ur=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Bs(n){return n.replace(Ur,"")}function Hr(n,e){let[t,s]=n.match(Ur)||["",""];n=Bs(n);let r="";for(let o=0;o<n.length;o++)o!==0&&o%e===0&&(r+=`
|
|
105
|
-
`),r+=n.charAt(o);return t&&s&&(r=`${t}${r}${s}`),r}function Os(n){return qr(n,{stringWidth:e=>[...e].length,stripAnsi:Bs,wrap:Hr})}var jt=require("path"),En=require("fs");function Vr(n,e){let t=(0,jt.resolve)(".",n),s;for((0,En.statSync)(t).isDirectory()||(t=(0,jt.dirname)(t));;){if(s=e(t,(0,En.readdirSync)(t)),s)return(0,jt.resolve)(t,s);if(t=(0,jt.dirname)(s=t),s===t)break}}var ao=require("util"),co=require("fs"),lo=require("url");var Qr=require("util"),An=require("path");function ut(n){if(n!==n.toLowerCase()&&n!==n.toUpperCase()||(n=n.toLowerCase()),n.indexOf("-")===-1&&n.indexOf("_")===-1)return n;{let t="",s=!1,r=n.match(/^-+/);for(let o=r?r[0].length:0;o<n.length;o++){let i=n.charAt(o);s&&(s=!1,i=i.toUpperCase()),o!==0&&(i==="-"||i==="_")?s=!0:i!=="-"&&i!=="_"&&(t+=i)}return t}}function bn(n,e){let t=n.toLowerCase();e=e||"-";let s="";for(let r=0;r<n.length;r++){let o=t.charAt(r),i=n.charAt(r);o!==i&&r>0?s+=`${e}${t.charAt(r)}`:s+=i}return s}function yn(n){return n==null?!1:typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^0[^.]/.test(n)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function Gr(n){if(Array.isArray(n))return n.map(i=>typeof i!="string"?i+"":i);n=n.trim();let e=0,t=null,s=null,r=null,o=[];for(let i=0;i<n.length;i++){if(t=s,s=n.charAt(i),s===" "&&!r){t!==" "&&e++;continue}s===r?r=null:(s==="'"||s==='"')&&!r&&(r=s),o[e]||(o[e]=""),o[e]+=s}return o}var Oe;(function(n){n.BOOLEAN="boolean",n.STRING="string",n.NUMBER="number",n.ARRAY="array"})(Oe||(Oe={}));var Ue,wn=class{constructor(e){Ue=e}parse(e,t){let s=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=Gr(e),o=typeof e=="string",i=Ra(Object.assign(Object.create(null),s.alias)),a=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},s.configuration),D=Object.assign(Object.create(null),s.default),h=s.configObjects||[],f=s.envPrefix,c=a["populate--"],d=c?"--":"_",C=Object.create(null),E=Object.create(null),b=s.__||Ue.format,g={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:[]},O=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,R=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(s.array||[]).filter(Boolean).forEach(function(l){let m=typeof l=="object"?l.key:l,y=Object.keys(l).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();y&&(g[y][m]=!0),g.arrays[m]=!0,g.keys.push(m)}),[].concat(s.boolean||[]).filter(Boolean).forEach(function(l){g.bools[l]=!0,g.keys.push(l)}),[].concat(s.string||[]).filter(Boolean).forEach(function(l){g.strings[l]=!0,g.keys.push(l)}),[].concat(s.number||[]).filter(Boolean).forEach(function(l){g.numbers[l]=!0,g.keys.push(l)}),[].concat(s.count||[]).filter(Boolean).forEach(function(l){g.counts[l]=!0,g.keys.push(l)}),[].concat(s.normalize||[]).filter(Boolean).forEach(function(l){g.normalize[l]=!0,g.keys.push(l)}),typeof s.narg=="object"&&Object.entries(s.narg).forEach(([l,m])=>{typeof m=="number"&&(g.nargs[l]=m,g.keys.push(l))}),typeof s.coerce=="object"&&Object.entries(s.coerce).forEach(([l,m])=>{typeof m=="function"&&(g.coercions[l]=m,g.keys.push(l))}),typeof s.config<"u"&&(Array.isArray(s.config)||typeof s.config=="string"?[].concat(s.config).filter(Boolean).forEach(function(l){g.configs[l]=!0}):typeof s.config=="object"&&Object.entries(s.config).forEach(([l,m])=>{(typeof m=="boolean"||typeof m=="function")&&(g.configs[l]=m)})),it(s.key,i,s.default,g.arrays),Object.keys(D).forEach(function(l){(g.aliases[l]||[]).forEach(function(m){D[m]=D[l]})});let U=null;Yt();let L=[],H=Object.assign(Object.create(null),{_:[]}),He={};for(let l=0;l<r.length;l++){let m=r[l],y=m.replace(/^-{3,}/,"---"),F,p,_,$,I,he;if(m!=="--"&&/^-/.test(m)&&ne(m))Pe(m);else if(y.match(/^---+(=|$)/)){Pe(m);continue}else if(m.match(/^--.+=/)||!a["short-option-groups"]&&m.match(/^-.+=/))$=m.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(M($[1],g.arrays)?l=nt(l,$[1],r,$[2]):M($[1],g.nargs)!==!1?l=Et(l,$[1],r,$[2]):V($[1],$[2],!0));else if(m.match(R)&&a["boolean-negation"])$=m.match(R),$!==null&&Array.isArray($)&&$.length>=2&&(p=$[1],V(p,M(p,g.arrays)?[!1]:!1));else if(m.match(/^--.+/)||!a["short-option-groups"]&&m.match(/^-[^-]+/))$=m.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(p=$[1],M(p,g.arrays)?l=nt(l,p,r):M(p,g.nargs)!==!1?l=Et(l,p,r):(I=r[l+1],I!==void 0&&(!I.match(/^-/)||I.match(O))&&!M(p,g.bools)&&!M(p,g.counts)||/^(true|false)$/.test(I)?(V(p,I),l++):V(p,se(p))));else if(m.match(/^-.\..+=/))$=m.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&V($[1],$[2]);else if(m.match(/^-.\..+/)&&!m.match(O))I=r[l+1],$=m.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(p=$[1],I!==void 0&&!I.match(/^-/)&&!M(p,g.bools)&&!M(p,g.counts)?(V(p,I),l++):V(p,se(p)));else if(m.match(/^-[^-]+/)&&!m.match(O)){_=m.slice(1,-1).split(""),F=!1;for(let me=0;me<_.length;me++){if(I=m.slice(me+2),_[me+1]&&_[me+1]==="="){he=m.slice(me+3),p=_[me],M(p,g.arrays)?l=nt(l,p,r,he):M(p,g.nargs)!==!1?l=Et(l,p,r,he):V(p,he),F=!0;break}if(I==="-"){V(_[me],I);continue}if(/[A-Za-z]/.test(_[me])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(I)&&M(I,g.bools)===!1){V(_[me],I),F=!0;break}if(_[me+1]&&_[me+1].match(/\W/)){V(_[me],I),F=!0;break}else V(_[me],se(_[me]))}p=m.slice(-1)[0],!F&&p!=="-"&&(M(p,g.arrays)?l=nt(l,p,r):M(p,g.nargs)!==!1?l=Et(l,p,r):(I=r[l+1],I!==void 0&&(!/^(-|--)[^-]/.test(I)||I.match(O))&&!M(p,g.bools)&&!M(p,g.counts)||/^(true|false)$/.test(I)?(V(p,I),l++):V(p,se(p))))}else if(m.match(/^-[0-9]$/)&&m.match(O)&&M(m.slice(1),g.bools))p=m.slice(1),V(p,se(p));else if(m==="--"){L=r.slice(l+1);break}else if(a["halt-at-non-option"]){L=r.slice(l);break}else Pe(m)}z(H,!0),z(H,!1),N(H),le(),X(H,g.aliases,D,!0),De(H),a["set-placeholder-key"]&&st(H),Object.keys(g.counts).forEach(function(l){Le(H,l.split("."))||V(l,0)}),c&&L.length&&(H[d]=[]),L.forEach(function(l){H[d].push(l)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(H).filter(l=>l!=="--"&&l.includes("-")).forEach(l=>{delete H[l]}),a["strip-aliased"]&&[].concat(...Object.keys(i).map(l=>i[l])).forEach(l=>{a["camel-case-expansion"]&&l.includes("-")&&delete H[l.split(".").map(m=>ut(m)).join(".")],delete H[l]});function Pe(l){let m=B("_",l);(typeof m=="string"||typeof m=="number")&&H._.push(m)}function Et(l,m,y,F){let p,_=M(m,g.nargs);if(_=typeof _!="number"||isNaN(_)?1:_,_===0)return Te(F)||(U=Error(b("Argument unexpected for: %s",m))),V(m,se(m)),l;let $=Te(F)?0:1;if(a["nargs-eats-options"])y.length-(l+1)+$<_&&(U=Error(b("Not enough arguments following: %s",m))),$=_;else{for(p=l+1;p<y.length&&(!y[p].match(/^-[^0-9]/)||y[p].match(O)||ne(y[p]));p++)$++;$<_&&(U=Error(b("Not enough arguments following: %s",m)))}let I=Math.min($,_);for(!Te(F)&&I>0&&(V(m,F),I--),p=l+1;p<I+l+1;p++)V(m,y[p]);return l+I}function nt(l,m,y,F){let p=[],_=F||y[l+1],$=M(m,g.nargs);if(M(m,g.bools)&&!/^(true|false)$/.test(_))p.push(!0);else if(Te(_)||Te(F)&&/^-/.test(_)&&!O.test(_)&&!ne(_)){if(D[m]!==void 0){let I=D[m];p=Array.isArray(I)?I:[I]}}else{Te(F)||p.push(A(m,F,!0));for(let I=l+1;I<y.length&&!(!a["greedy-arrays"]&&p.length>0||$&&typeof $=="number"&&p.length>=$||(_=y[I],/^-/.test(_)&&!O.test(_)&&!ne(_)));I++)l=I,p.push(A(m,_,o))}return typeof $=="number"&&($&&p.length<$||isNaN($)&&p.length===0)&&(U=Error(b("Not enough arguments following: %s",m))),V(m,p),l}function V(l,m,y=o){if(/-/.test(l)&&a["camel-case-expansion"]){let _=l.split(".").map(function($){return ut($)}).join(".");j(l,_)}let F=A(l,m,y),p=l.split(".");ze(H,p,F),g.aliases[l]&&g.aliases[l].forEach(function(_){let $=_.split(".");ze(H,$,F)}),p.length>1&&a["dot-notation"]&&(g.aliases[p[0]]||[]).forEach(function(_){let $=_.split("."),I=[].concat(p);I.shift(),$=$.concat(I),(g.aliases[l]||[]).includes($.join("."))||ze(H,$,F)}),M(l,g.normalize)&&!M(l,g.arrays)&&[l].concat(g.aliases[l]||[]).forEach(function($){Object.defineProperty(He,$,{enumerable:!0,get(){return m},set(I){m=typeof I=="string"?Ue.normalize(I):I}})})}function j(l,m){g.aliases[l]&&g.aliases[l].length||(g.aliases[l]=[m],C[m]=!0),g.aliases[m]&&g.aliases[m].length||j(m,l)}function A(l,m,y){y&&(m=Na(m)),(M(l,g.bools)||M(l,g.counts))&&typeof m=="string"&&(m=m==="true");let F=Array.isArray(m)?m.map(function(p){return B(l,p)}):B(l,m);return M(l,g.counts)&&(Te(F)||typeof F=="boolean")&&(F=_s()),M(l,g.normalize)&&M(l,g.arrays)&&(Array.isArray(m)?F=m.map(p=>Ue.normalize(p)):F=Ue.normalize(m)),F}function B(l,m){return!a["parse-positional-numbers"]&&l==="_"||!M(l,g.strings)&&!M(l,g.bools)&&!Array.isArray(m)&&(yn(m)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${m}`)))||!Te(m)&&M(l,g.numbers))&&(m=Number(m)),m}function N(l){let m=Object.create(null);X(m,g.aliases,D),Object.keys(g.configs).forEach(function(y){let F=l[y]||m[y];if(F)try{let p=null,_=Ue.resolve(Ue.cwd(),F),$=g.configs[y];if(typeof $=="function"){try{p=$(_)}catch(I){p=I}if(p instanceof Error){U=p;return}}else p=Ue.require(_);q(p)}catch(p){p.name==="PermissionDenied"?U=p:l[y]&&(U=Error(b("Invalid JSON config file: %s",F)))}})}function q(l,m){Object.keys(l).forEach(function(y){let F=l[y],p=m?m+"."+y:y;typeof F=="object"&&F!==null&&!Array.isArray(F)&&a["dot-notation"]?q(F,p):(!Le(H,p.split("."))||M(p,g.arrays)&&a["combine-arrays"])&&V(p,F)})}function le(){typeof h<"u"&&h.forEach(function(l){q(l)})}function z(l,m){if(typeof f>"u")return;let y=typeof f=="string"?f:"",F=Ue.env();Object.keys(F).forEach(function(p){if(y===""||p.lastIndexOf(y,0)===0){let _=p.split("__").map(function($,I){return I===0&&($=$.substring(y.length)),ut($)});(m&&g.configs[_.join(".")]||!m)&&!Le(l,_)&&V(_.join("."),F[p])}})}function De(l){let m,y=new Set;Object.keys(l).forEach(function(F){if(!y.has(F)&&(m=M(F,g.coercions),typeof m=="function"))try{let p=B(F,m(l[F]));[].concat(g.aliases[F]||[],F).forEach(_=>{y.add(_),l[_]=p})}catch(p){U=p}})}function st(l){return g.keys.forEach(m=>{~m.indexOf(".")||typeof l[m]>"u"&&(l[m]=void 0)}),l}function X(l,m,y,F=!1){Object.keys(y).forEach(function(p){Le(l,p.split("."))||(ze(l,p.split("."),y[p]),F&&(E[p]=!0),(m[p]||[]).forEach(function(_){Le(l,_.split("."))||ze(l,_.split("."),y[p])}))})}function Le(l,m){let y=l;a["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(p){y=y[p]||{}});let F=m[m.length-1];return typeof y!="object"?!1:F in y}function ze(l,m,y){let F=l;a["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(he){he=Yr(he),typeof F=="object"&&F[he]===void 0&&(F[he]={}),typeof F[he]!="object"||Array.isArray(F[he])?(Array.isArray(F[he])?F[he].push({}):F[he]=[F[he],{}],F=F[he][F[he].length-1]):F=F[he]});let p=Yr(m[m.length-1]),_=M(m.join("."),g.arrays),$=Array.isArray(y),I=a["duplicate-arguments-array"];!I&&M(p,g.nargs)&&(I=!0,(!Te(F[p])&&g.nargs[p]===1||Array.isArray(F[p])&&F[p].length===g.nargs[p])&&(F[p]=void 0)),y===_s()?F[p]=_s(F[p]):Array.isArray(F[p])?I&&_&&$?F[p]=a["flatten-duplicate-arrays"]?F[p].concat(y):(Array.isArray(F[p][0])?F[p]:[F[p]]).concat([y]):!I&&!!_==!!$?F[p]=y:F[p]=F[p].concat([y]):F[p]===void 0&&_?F[p]=$?y:[y]:I&&!(F[p]===void 0||M(p,g.counts)||M(p,g.bools))?F[p]=[F[p],y]:F[p]=y}function it(...l){l.forEach(function(m){Object.keys(m||{}).forEach(function(y){g.aliases[y]||(g.aliases[y]=[].concat(i[y]||[]),g.aliases[y].concat(y).forEach(function(F){if(/-/.test(F)&&a["camel-case-expansion"]){let p=ut(F);p!==y&&g.aliases[y].indexOf(p)===-1&&(g.aliases[y].push(p),C[p]=!0)}}),g.aliases[y].concat(y).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&a["camel-case-expansion"]){let p=bn(F,"-");p!==y&&g.aliases[y].indexOf(p)===-1&&(g.aliases[y].push(p),C[p]=!0)}}),g.aliases[y].forEach(function(F){g.aliases[F]=[y].concat(g.aliases[y].filter(function(p){return F!==p}))}))})})}function M(l,m){let y=[].concat(g.aliases[l]||[],l),F=Object.keys(m),p=y.find(_=>F.includes(_));return p?m[p]:!1}function Ln(l){let m=Object.keys(g);return[].concat(m.map(F=>g[F])).some(function(F){return Array.isArray(F)?F.includes(l):F[l]})}function P(l,...m){return[].concat(...m).some(function(F){let p=l.match(F);return p&&Ln(p[1])})}function K(l){if(l.match(O)||!l.match(/^-[^-]+/))return!1;let m=!0,y,F=l.slice(1).split("");for(let p=0;p<F.length;p++){if(y=l.slice(p+2),!Ln(F[p])){m=!1;break}if(F[p+1]&&F[p+1]==="="||y==="-"||/[A-Za-z]/.test(F[p])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(y)||F[p+1]&&F[p+1].match(/\W/))break}return m}function ne(l){return a["unknown-options-as-args"]&&k(l)}function k(l){return l=l.replace(/^-{3,}/,"--"),l.match(O)||K(l)?!1:!P(l,/^-+([^=]+?)=[\s\S]*$/,R,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function se(l){return!M(l,g.bools)&&!M(l,g.counts)&&`${l}`in D?D[l]:oe(Me(l))}function oe(l){return{[Oe.BOOLEAN]:!0,[Oe.STRING]:"",[Oe.NUMBER]:void 0,[Oe.ARRAY]:[]}[l]}function Me(l){let m=Oe.BOOLEAN;return M(l,g.strings)?m=Oe.STRING:M(l,g.numbers)?m=Oe.NUMBER:M(l,g.bools)?m=Oe.BOOLEAN:M(l,g.arrays)&&(m=Oe.ARRAY),m}function Te(l){return l===void 0}function Yt(){Object.keys(g.counts).find(l=>M(l,g.arrays)?(U=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",l)),!0):M(l,g.nargs)?(U=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",l)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(He,H),configuration:a,defaulted:Object.assign({},E),error:U,newAliases:Object.assign({},C)}}};function Ra(n){let e=[],t=Object.create(null),s=!0;for(Object.keys(n).forEach(function(r){e.push([].concat(n[r],r))});s;){s=!1;for(let r=0;r<e.length;r++)for(let o=r+1;o<e.length;o++)if(e[r].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[r]=e[r].concat(e[o]),e.splice(o,1),s=!0;break}}return e.forEach(function(r){r=r.filter(function(i,a,D){return D.indexOf(i)===a});let o=r.pop();o!==void 0&&typeof o=="string"&&(t[o]=r)}),t}function _s(n){return n!==void 0?n+1:1}function Yr(n){return n==="__proto__"?"___proto___":n}function Na(n){return typeof n=="string"&&(n[0]==="'"||n[0]==='"')&&n[n.length-1]===n[0]?n.substring(1,n.length-1):n}var Zr=require("fs");var js,Ss,Is,Jr=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Kr=(Ss=(js=process==null?void 0:process.versions)===null||js===void 0?void 0:js.node)!==null&&Ss!==void 0?Ss:(Is=process==null?void 0:process.version)===null||Is===void 0?void 0:Is.slice(1);if(Kr&&Number(Kr.match(/^([^.]+)/)[1])<Jr)throw Error(`yargs parser supports a minimum Node.js version of ${Jr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var ka=process?process.env:{},Xr=new wn({cwd:process.cwd,env:()=>ka,format:Qr.format,normalize:An.normalize,resolve:An.resolve,require:n=>{if(typeof require<"u")return require(n);if(n.match(/\.json$/))return JSON.parse((0,Zr.readFileSync)(n,"utf8"));throw Error("only .json config files are supported in ESM")}}),qt=function(e,t){return Xr.parse(e.slice(),t).argv};qt.detailed=function(n,e){return Xr.parse(n.slice(),e)};qt.camelCase=ut;qt.decamelize=bn;qt.looksLikeNumber=yn;var eo=qt;var Re=require("path");function La(){return za()?0:1}function za(){return qa()&&!process.defaultApp}function qa(){return!!process.versions.electron}function to(){return process.argv[La()]}var Y=class n extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,n)}};var St=require("fs"),no=require("util"),so=require("path"),io={fs:{readFileSync:St.readFileSync,writeFile:St.writeFile},format:no.format,resolve:so.resolve,exists:n=>{try{return(0,St.statSync)(n).isFile()}catch{return!1}}};var We,Ps=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(),s=function(){};return typeof e[e.length-1]=="function"&&(s=e.pop()),s=s||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:s})):s(),We.format.apply(We.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),s=e.shift(),r=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let i=r===1?t:s;this.cache[this.locale][t]&&(i=this.cache[this.locale][t][r===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:s},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[i];return~i.indexOf("%d")&&a.push(r),We.format.apply(We.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let s="";return e.forEach(function(r,o){let i=t[o+1];s+=r,typeof i<"u"&&(s+="%s")}),this.__.apply(this,[s].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],s=t.directory,r=t.locale,o=t.cb,i=this._resolveLocaleFile(s,r),a=JSON.stringify(this.cache[r],null,2);We.fs.writeFile(i,a,"utf-8",function(D){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(D)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{We.fs.readFileSync&&(e=JSON.parse(We.fs.readFileSync(t,"utf-8")))}catch(s){if(s instanceof SyntaxError&&(s.message="syntax error in "+t),s.code==="ENOENT")e={};else throw s}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let s=We.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(s)&&~t.lastIndexOf("_")){let r=We.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(r)&&(s=r)}return s}_fileExistsSync(e){return We.exists(e)}};function ro(n,e){We=e;let t=new Ps(n);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var Ua=n=>ro(n,io),oo=Ua;var Ga={},Ha="require is not supported by ESM",uo="loading a directory of commands is not supported yet for ESM",Ut;try{Ut=(0,lo.fileURLToPath)(Ga.url)}catch{Ut=process.cwd()}var Va=Ut.substring(0,Ut.lastIndexOf("node_modules")),Do={assert:{notStrictEqual:$n.notStrictEqual,strictEqual:$n.strictEqual},cliui:Os,findUp:Vr,getEnv:n=>process.env[n],inspect:ao.inspect,getCallerFile:()=>{throw new Y(uo)},getProcessArgvBin:to,mainFilename:Va||process.cwd(),Parser:eo,path:{basename:Re.basename,dirname:Re.dirname,extname:Re.extname,relative:Re.relative,resolve:Re.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(n,e)=>process.emitWarning(n,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:co.readFileSync,require:()=>{throw new Y(Ha)},requireDirectory:()=>{throw new Y(uo)},stringWidth:n=>[...n].length,y18n:oo({directory:(0,Re.resolve)(Ut,"../../../locales"),updateFiles:!1})};function Fe(n,e,t,s){t.assert.notStrictEqual(n,e,s)}function Ms(n,e){e.assert.strictEqual(typeof n,"string")}function It(n){return Object.keys(n)}function J(n){return!!n&&!!n.then&&typeof n.then=="function"}function Ke(n){let t=n.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,r=t.shift();if(!r)throw new Error(`No command found in: ${n}`);let o={cmd:r.replace(s,""),demanded:[],optional:[]};return t.forEach((i,a)=>{let D=!1;i=i.replace(/\s/g,""),/\.+[\]>]/.test(i)&&a===t.length-1&&(D=!0),/^\[/.test(i)?o.optional.push({cmd:i.replace(s,"").split("|"),variadic:D}):o.demanded.push({cmd:i.replace(s,"").split("|"),variadic:D})}),o}var Ya=["first","second","third","fourth","fifth","sixth"];function x(n,e,t){function s(){return typeof n=="object"?[{demanded:[],optional:[]},n,e]:[Ke(`cmd ${n}`),e,t]}try{let r=0,[o,i,a]=s(),D=[].slice.call(i);for(;D.length&&D[D.length-1]===void 0;)D.pop();let h=a||D.length;if(h<o.demanded.length)throw new Y(`Not enough arguments provided. Expected ${o.demanded.length} but received ${D.length}.`);let f=o.demanded.length+o.optional.length;if(h>f)throw new Y(`Too many arguments provided. Expected max ${f} but received ${h}.`);o.demanded.forEach(c=>{let d=D.shift(),C=ho(d);c.cmd.filter(b=>b===C||b==="*").length===0&&fo(C,c.cmd,r),r+=1}),o.optional.forEach(c=>{if(D.length===0)return;let d=D.shift(),C=ho(d);c.cmd.filter(b=>b===C||b==="*").length===0&&fo(C,c.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function ho(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function fo(n,e,t){throw new Y(`Invalid ${Ya[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${n}.`)}var xn=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,s=!0,r=!1){if(x("<array|function> [boolean] [boolean] [boolean]",[e,t,s],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let i=e[o];i.applyBeforeValidation=t,i.global=s}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=t,o.global=s,o.mutates=r,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let o=[...s[t]||[],t];return r.option?!o.includes(r.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 po(n){return n?n.map(e=>(e.applyBeforeValidation=!1,e)):[]}function at(n,e,t,s){return t.reduce((r,o)=>{if(o.applyBeforeValidation!==s)return r;if(o.mutates){if(o.applied)return r;o.applied=!0}if(J(r))return r.then(i=>Promise.all([i,o(i,e)])).then(([i,a])=>Object.assign(i,a));{let i=o(r,e);return J(i)?i.then(a=>Object.assign(r,a)):Object.assign(r,i)}},n)}function ct(n,e,t=s=>{throw s}){try{let s=Ja(n)?n():n;return J(s)?s.then(r=>e(r)):e(s)}catch(s){return t(s)}}function Ja(n){return typeof n=="function"}function Ts(n){if(typeof require>"u")return null;for(let e=0,t=Object.keys(require.cache),s;e<t.length;e++)if(s=require.cache[t[e]],s.exports===n)return s;return null}var Pt=/(^\*)|(^\$0)/,Ws=class{constructor(e,t,s,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=e,this.globalMiddleware=s,this.validation=t}addDirectory(e,t,s,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let o=typeof r.visit=="function"?r.visit:i=>i;r.visit=(i,a,D)=>{let h=o(i,a,D);if(h){if(this.requireCache.has(a))return h;this.requireCache.add(a),this.addHandler(h)}return h},this.shim.requireDirectory({require:t,filename:s},e,r)}addHandler(e,t,s,r,o,i){let a=[],D=po(o);if(r=r||(()=>{}),Array.isArray(e))if(Ka(e))[e,...a]=e;else for(let h of e)this.addHandler(h);else if(Za(e)){let h=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(h=[].concat(h).concat(e.aliases)),this.addHandler(h,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(mo(s)){this.addHandler([e].concat(a),t,s.builder,s.handler,s.middlewares,s.deprecated);return}if(typeof e=="string"){let h=Ke(e);a=a.map(d=>Ke(d).cmd);let f=!1,c=[h.cmd].concat(a).filter(d=>Pt.test(d)?(f=!0,!1):!0);c.length===0&&f&&c.push("$0"),f&&(h.cmd=c[0],a=c.slice(1),e=e.replace(Pt,h.cmd)),a.forEach(d=>{this.aliasMap[d]=h.cmd}),t!==!1&&this.usage.command(e,t,f,a,i),this.handlers[h.cmd]={original:e,description:t,handler:r,builder:s||{},middlewares:D,deprecated:i,demanded:h.demanded,optional:h.optional},f&&(this.defaultCommand=this.handlers[h.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,s,r,o,i){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,D=t.getInternalMethods().getContext(),h=D.commands.slice(),f=!e;e&&(D.commands.push(e),D.fullCommands.push(a.original));let c=this.applyBuilderUpdateUsageAndParse(f,a,t,s.aliases,h,r,o,i);return J(c)?c.then(d=>this.applyMiddlewareAndGetResult(f,a,d.innerArgv,D,o,d.aliases,t)):this.applyMiddlewareAndGetResult(f,a,c.innerArgv,D,o,c.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,s,r,o,i,a,D){let h=t.builder,f=s;if(vn(h)){s.getInternalMethods().getUsageInstance().freeze();let c=h(s.getInternalMethods().reset(r),D);if(J(c))return c.then(d=>(f=Co(d)?d:s,this.parseAndUpdateUsage(e,t,f,o,i,a)))}else Qa(h)&&(s.getInternalMethods().getUsageInstance().freeze(),f=s.getInternalMethods().reset(r),Object.keys(t.builder).forEach(c=>{f.option(c,h[c])}));return this.parseAndUpdateUsage(e,t,f,o,i,a)}parseAndUpdateUsage(e,t,s,r,o,i){e&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,t),t.description);let a=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,i);return J(a)?a.then(D=>({aliases:s.parsed.aliases,innerArgv:D})):{aliases:s.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let s=Pt.test(t.original)?t.original.replace(Pt,"").trim():t.original,r=e.filter(o=>!Pt.test(o));return r.push(s),`$0 ${r.join(" ")}`}handleValidationAndGetResult(e,t,s,r,o,i,a,D){if(!i.getInternalMethods().getHasOutput()){let h=i.getInternalMethods().runValidation(o,D,i.parsed.error,e);s=ct(s,f=>(h(f),f))}if(t.handler&&!i.getInternalMethods().getHasOutput()){i.getInternalMethods().setHasOutput();let h=!!i.getOptions().configuration["populate--"];i.getInternalMethods().postProcess(s,h,!1,!1),s=at(s,i,a,!1),s=ct(s,f=>{let c=t.handler(f);return J(c)?c.then(()=>f):f}),e||i.getInternalMethods().getUsageInstance().cacheHelpMessage(),J(s)&&!i.getInternalMethods().hasParseCallback()&&s.catch(f=>{try{i.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(r.commands.pop(),r.fullCommands.pop()),s}applyMiddlewareAndGetResult(e,t,s,r,o,i,a){let D={};if(o)return s;a.getInternalMethods().getHasOutput()||(D=this.populatePositionals(t,s,r,a));let h=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),f=at(s,a,h,!0);return J(f)?f.then(c=>this.handleValidationAndGetResult(e,t,c,r,i,a,h,D)):this.handleValidationAndGetResult(e,t,f,r,i,a,h,D)}populatePositionals(e,t,s,r){t._=t._.slice(s.commands.length);let o=e.demanded.slice(0),i=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,t._.length);o.length;){let D=o.shift();this.populatePositional(D,t,a)}for(;i.length;){let D=i.shift();this.populatePositional(D,t,a)}return t._=s.commands.concat(t._.map(D=>""+D)),this.postProcessPositionals(t,a,this.cmdToParseOptions(e.original),r),a}populatePositional(e,t,s){let r=e.cmd[0];e.variadic?s[r]=t._.splice(0).map(String):t._.length&&(s[r]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},s=Ke(e);return s.demanded.forEach(r=>{let[o,...i]=r.cmd;r.variadic&&(t.array.push(o),t.default[o]=[]),t.alias[o]=i,t.demand[o]=!0}),s.optional.forEach(r=>{let[o,...i]=r.cmd;r.variadic&&(t.array.push(o),t.default[o]=[]),t.alias[o]=i}),t}postProcessPositionals(e,t,s,r){let o=Object.assign({},r.getOptions());o.default=Object.assign(s.default,o.default);for(let h of Object.keys(s.alias))o.alias[h]=(o.alias[h]||[]).concat(s.alias[h]);o.array=o.array.concat(s.array),o.config={};let i=[];if(Object.keys(t).forEach(h=>{t[h].map(f=>{o.configuration["unknown-options-as-args"]&&(o.key[h]=!0),i.push(`--${h}`),i.push(f)})}),!i.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),D=this.shim.Parser.detailed(i,Object.assign({},o,{configuration:a}));if(D.error)r.getInternalMethods().getUsageInstance().fail(D.error.message,D.error);else{let h=Object.keys(t);Object.keys(t).forEach(f=>{h.push(...D.aliases[f])}),Object.keys(D.argv).forEach(f=>{h.includes(f)&&(t[f]||(t[f]=D.argv[f]),!this.isInConfigs(r,f)&&!this.isDefaulted(r,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(D.argv,f)&&(Array.isArray(e[f])||Array.isArray(D.argv[f]))?e[f]=[].concat(e[f],D.argv[f]):e[f]=D.argv[f])})}}isDefaulted(e,t){let{default:s}=e.getOptions();return Object.prototype.hasOwnProperty.call(s,t)||Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(t))}isInConfigs(e,t){let{configObjects:s}=e.getOptions();return s.some(r=>Object.prototype.hasOwnProperty.call(r,t))||s.some(r=>Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let s=Pt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(s,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(vn(t))return t(e,!0);mo(t)||Object.keys(t).forEach(s=>{e.option(s,t[s])})}moduleName(e){let t=Ts(e);if(!t)throw new 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:s}){for(let r of[e,t,s]){if(typeof r=="string"||r===!1)return r;Fe(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();Fe(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 go(n,e,t,s){return new Ws(n,e,t,s)}function mo(n){return typeof n=="object"&&!!n.builder&&typeof n.handler=="function"}function Ka(n){return n.every(e=>typeof e=="string")}function vn(n){return typeof n=="function"}function Qa(n){return typeof n=="object"}function Za(n){return typeof n=="object"&&!Array.isArray(n)}function Qe(n={},e=()=>!0){let t={};return It(n).forEach(s=>{e(s,n[s])&&(t[s]=n[s])}),t}function Ze(n){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(n)})}function Xa(n){return typeof n=="boolean"}function Eo(n,e){let t=e.y18n.__,s={},r=[];s.failFn=function(A){r.push(A)};let o=null,i=null,a=!0;s.showHelpOnFail=function(A=!0,B){let[N,q]=typeof A=="string"?[!0,A]:[A,B];return n.getInternalMethods().isGlobalContext()&&(i=q),o=q,a=N,s};let D=!1;s.fail=function(A,B){let N=n.getInternalMethods().getLoggerInstance();if(r.length)for(let q=r.length-1;q>=0;--q){let le=r[q];if(Xa(le)){if(B)throw B;if(A)throw Error(A)}else le(A,B,s)}else{if(n.getExitProcess()&&Ze(!0),!D){D=!0,a&&(n.showHelp("error"),N.error()),(A||B)&&N.error(A||B);let q=o||i;q&&((A||B)&&N.error(""),N.error(q))}if(B=B||new Y(A),n.getExitProcess())return n.exit(1);if(n.getInternalMethods().hasParseCallback())return n.exit(1,B);throw B}};let h=[],f=!1;s.usage=(j,A)=>j===null?(f=!0,h=[],s):(f=!1,h.push([j,A||""]),s),s.getUsage=()=>h,s.getUsageDisabled=()=>f,s.getPositionalGroupName=()=>t("Positionals:");let c=[];s.example=(j,A)=>{c.push([j,A||""])};let d=[];s.command=function(A,B,N,q,le=!1){N&&(d=d.map(z=>(z[2]=!1,z))),d.push([A,B||"",N,q,le])},s.getCommands=()=>d;let C={};s.describe=function(A,B){Array.isArray(A)?A.forEach(N=>{s.describe(N,B)}):typeof A=="object"?Object.keys(A).forEach(N=>{s.describe(N,A[N])}):C[A]=B},s.getDescriptions=()=>C;let E=[];s.epilog=j=>{E.push(j)};let b=!1,g;s.wrap=j=>{b=!0,g=j},s.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(b||(g=Et(),b=!0),g);let O="__yargsString__:";s.deferY18nLookup=j=>O+j,s.help=function(){if(L)return L;U();let A=n.customScriptName?n.$0:e.path.basename(n.$0),B=n.getDemandedOptions(),N=n.getDemandedCommands(),q=n.getDeprecatedOptions(),le=n.getGroups(),z=n.getOptions(),De=[];De=De.concat(Object.keys(C)),De=De.concat(Object.keys(B)),De=De.concat(Object.keys(N)),De=De.concat(Object.keys(z.default)),De=De.filter(He),De=Object.keys(De.reduce((P,K)=>(K!=="_"&&(P[K]=!0),P),{}));let st=s.getWrap(),X=e.cliui({width:st,wrap:!!st});if(!f){if(h.length)h.forEach(P=>{X.div({text:`${P[0].replace(/\$0/g,A)}`}),P[1]&&X.div({text:`${P[1]}`,padding:[1,0,0,0]})}),X.div();else if(d.length){let P=null;N._?P=`${A} <${t("command")}>
|
|
105
|
+
`),r+=n.charAt(o);return t&&s&&(r=`${t}${r}${s}`),r}function Os(n){return qr(n,{stringWidth:e=>[...e].length,stripAnsi:Bs,wrap:Hr})}var jt=require("path"),En=require("fs");function Vr(n,e){let t=(0,jt.resolve)(".",n),s;for((0,En.statSync)(t).isDirectory()||(t=(0,jt.dirname)(t));;){if(s=e(t,(0,En.readdirSync)(t)),s)return(0,jt.resolve)(t,s);if(t=(0,jt.dirname)(s=t),s===t)break}}var ao=require("util"),co=require("fs"),lo=require("url");var Qr=require("util"),An=require("path");function ut(n){if(n!==n.toLowerCase()&&n!==n.toUpperCase()||(n=n.toLowerCase()),n.indexOf("-")===-1&&n.indexOf("_")===-1)return n;{let t="",s=!1,r=n.match(/^-+/);for(let o=r?r[0].length:0;o<n.length;o++){let i=n.charAt(o);s&&(s=!1,i=i.toUpperCase()),o!==0&&(i==="-"||i==="_")?s=!0:i!=="-"&&i!=="_"&&(t+=i)}return t}}function bn(n,e){let t=n.toLowerCase();e=e||"-";let s="";for(let r=0;r<n.length;r++){let o=t.charAt(r),i=n.charAt(r);o!==i&&r>0?s+=`${e}${t.charAt(r)}`:s+=i}return s}function yn(n){return n==null?!1:typeof n=="number"||/^0x[0-9a-f]+$/i.test(n)?!0:/^0[^.]/.test(n)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(n)}function Gr(n){if(Array.isArray(n))return n.map(i=>typeof i!="string"?i+"":i);n=n.trim();let e=0,t=null,s=null,r=null,o=[];for(let i=0;i<n.length;i++){if(t=s,s=n.charAt(i),s===" "&&!r){t!==" "&&e++;continue}s===r?r=null:(s==="'"||s==='"')&&!r&&(r=s),o[e]||(o[e]=""),o[e]+=s}return o}var Oe;(function(n){n.BOOLEAN="boolean",n.STRING="string",n.NUMBER="number",n.ARRAY="array"})(Oe||(Oe={}));var Ue,wn=class{constructor(e){Ue=e}parse(e,t){let s=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=Gr(e),o=typeof e=="string",i=Ra(Object.assign(Object.create(null),s.alias)),a=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},s.configuration),D=Object.assign(Object.create(null),s.default),h=s.configObjects||[],f=s.envPrefix,c=a["populate--"],d=c?"--":"_",C=Object.create(null),E=Object.create(null),b=s.__||Ue.format,g={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:[]},B=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,W=new RegExp("^--"+a["negation-prefix"]+"(.+)");[].concat(s.array||[]).filter(Boolean).forEach(function(l){let m=typeof l=="object"?l.key:l,y=Object.keys(l).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();y&&(g[y][m]=!0),g.arrays[m]=!0,g.keys.push(m)}),[].concat(s.boolean||[]).filter(Boolean).forEach(function(l){g.bools[l]=!0,g.keys.push(l)}),[].concat(s.string||[]).filter(Boolean).forEach(function(l){g.strings[l]=!0,g.keys.push(l)}),[].concat(s.number||[]).filter(Boolean).forEach(function(l){g.numbers[l]=!0,g.keys.push(l)}),[].concat(s.count||[]).filter(Boolean).forEach(function(l){g.counts[l]=!0,g.keys.push(l)}),[].concat(s.normalize||[]).filter(Boolean).forEach(function(l){g.normalize[l]=!0,g.keys.push(l)}),typeof s.narg=="object"&&Object.entries(s.narg).forEach(([l,m])=>{typeof m=="number"&&(g.nargs[l]=m,g.keys.push(l))}),typeof s.coerce=="object"&&Object.entries(s.coerce).forEach(([l,m])=>{typeof m=="function"&&(g.coercions[l]=m,g.keys.push(l))}),typeof s.config<"u"&&(Array.isArray(s.config)||typeof s.config=="string"?[].concat(s.config).filter(Boolean).forEach(function(l){g.configs[l]=!0}):typeof s.config=="object"&&Object.entries(s.config).forEach(([l,m])=>{(typeof m=="boolean"||typeof m=="function")&&(g.configs[l]=m)})),it(s.key,i,s.default,g.arrays),Object.keys(D).forEach(function(l){(g.aliases[l]||[]).forEach(function(m){D[m]=D[l]})});let U=null;Yt();let L=[],H=Object.assign(Object.create(null),{_:[]}),He={};for(let l=0;l<r.length;l++){let m=r[l],y=m.replace(/^-{3,}/,"---"),F,p,_,$,I,he;if(m!=="--"&&/^-/.test(m)&&ne(m))Pe(m);else if(y.match(/^---+(=|$)/)){Pe(m);continue}else if(m.match(/^--.+=/)||!a["short-option-groups"]&&m.match(/^-.+=/))$=m.match(/^--?([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&(M($[1],g.arrays)?l=nt(l,$[1],r,$[2]):M($[1],g.nargs)!==!1?l=Et(l,$[1],r,$[2]):V($[1],$[2],!0));else if(m.match(W)&&a["boolean-negation"])$=m.match(W),$!==null&&Array.isArray($)&&$.length>=2&&(p=$[1],V(p,M(p,g.arrays)?[!1]:!1));else if(m.match(/^--.+/)||!a["short-option-groups"]&&m.match(/^-[^-]+/))$=m.match(/^--?(.+)/),$!==null&&Array.isArray($)&&$.length>=2&&(p=$[1],M(p,g.arrays)?l=nt(l,p,r):M(p,g.nargs)!==!1?l=Et(l,p,r):(I=r[l+1],I!==void 0&&(!I.match(/^-/)||I.match(B))&&!M(p,g.bools)&&!M(p,g.counts)||/^(true|false)$/.test(I)?(V(p,I),l++):V(p,se(p))));else if(m.match(/^-.\..+=/))$=m.match(/^-([^=]+)=([\s\S]*)$/),$!==null&&Array.isArray($)&&$.length>=3&&V($[1],$[2]);else if(m.match(/^-.\..+/)&&!m.match(B))I=r[l+1],$=m.match(/^-(.\..+)/),$!==null&&Array.isArray($)&&$.length>=2&&(p=$[1],I!==void 0&&!I.match(/^-/)&&!M(p,g.bools)&&!M(p,g.counts)?(V(p,I),l++):V(p,se(p)));else if(m.match(/^-[^-]+/)&&!m.match(B)){_=m.slice(1,-1).split(""),F=!1;for(let me=0;me<_.length;me++){if(I=m.slice(me+2),_[me+1]&&_[me+1]==="="){he=m.slice(me+3),p=_[me],M(p,g.arrays)?l=nt(l,p,r,he):M(p,g.nargs)!==!1?l=Et(l,p,r,he):V(p,he),F=!0;break}if(I==="-"){V(_[me],I);continue}if(/[A-Za-z]/.test(_[me])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(I)&&M(I,g.bools)===!1){V(_[me],I),F=!0;break}if(_[me+1]&&_[me+1].match(/\W/)){V(_[me],I),F=!0;break}else V(_[me],se(_[me]))}p=m.slice(-1)[0],!F&&p!=="-"&&(M(p,g.arrays)?l=nt(l,p,r):M(p,g.nargs)!==!1?l=Et(l,p,r):(I=r[l+1],I!==void 0&&(!/^(-|--)[^-]/.test(I)||I.match(B))&&!M(p,g.bools)&&!M(p,g.counts)||/^(true|false)$/.test(I)?(V(p,I),l++):V(p,se(p))))}else if(m.match(/^-[0-9]$/)&&m.match(B)&&M(m.slice(1),g.bools))p=m.slice(1),V(p,se(p));else if(m==="--"){L=r.slice(l+1);break}else if(a["halt-at-non-option"]){L=r.slice(l);break}else Pe(m)}z(H,!0),z(H,!1),N(H),le(),X(H,g.aliases,D,!0),De(H),a["set-placeholder-key"]&&st(H),Object.keys(g.counts).forEach(function(l){Le(H,l.split("."))||V(l,0)}),c&&L.length&&(H[d]=[]),L.forEach(function(l){H[d].push(l)}),a["camel-case-expansion"]&&a["strip-dashed"]&&Object.keys(H).filter(l=>l!=="--"&&l.includes("-")).forEach(l=>{delete H[l]}),a["strip-aliased"]&&[].concat(...Object.keys(i).map(l=>i[l])).forEach(l=>{a["camel-case-expansion"]&&l.includes("-")&&delete H[l.split(".").map(m=>ut(m)).join(".")],delete H[l]});function Pe(l){let m=O("_",l);(typeof m=="string"||typeof m=="number")&&H._.push(m)}function Et(l,m,y,F){let p,_=M(m,g.nargs);if(_=typeof _!="number"||isNaN(_)?1:_,_===0)return Te(F)||(U=Error(b("Argument unexpected for: %s",m))),V(m,se(m)),l;let $=Te(F)?0:1;if(a["nargs-eats-options"])y.length-(l+1)+$<_&&(U=Error(b("Not enough arguments following: %s",m))),$=_;else{for(p=l+1;p<y.length&&(!y[p].match(/^-[^0-9]/)||y[p].match(B)||ne(y[p]));p++)$++;$<_&&(U=Error(b("Not enough arguments following: %s",m)))}let I=Math.min($,_);for(!Te(F)&&I>0&&(V(m,F),I--),p=l+1;p<I+l+1;p++)V(m,y[p]);return l+I}function nt(l,m,y,F){let p=[],_=F||y[l+1],$=M(m,g.nargs);if(M(m,g.bools)&&!/^(true|false)$/.test(_))p.push(!0);else if(Te(_)||Te(F)&&/^-/.test(_)&&!B.test(_)&&!ne(_)){if(D[m]!==void 0){let I=D[m];p=Array.isArray(I)?I:[I]}}else{Te(F)||p.push(A(m,F,!0));for(let I=l+1;I<y.length&&!(!a["greedy-arrays"]&&p.length>0||$&&typeof $=="number"&&p.length>=$||(_=y[I],/^-/.test(_)&&!B.test(_)&&!ne(_)));I++)l=I,p.push(A(m,_,o))}return typeof $=="number"&&($&&p.length<$||isNaN($)&&p.length===0)&&(U=Error(b("Not enough arguments following: %s",m))),V(m,p),l}function V(l,m,y=o){if(/-/.test(l)&&a["camel-case-expansion"]){let _=l.split(".").map(function($){return ut($)}).join(".");j(l,_)}let F=A(l,m,y),p=l.split(".");ze(H,p,F),g.aliases[l]&&g.aliases[l].forEach(function(_){let $=_.split(".");ze(H,$,F)}),p.length>1&&a["dot-notation"]&&(g.aliases[p[0]]||[]).forEach(function(_){let $=_.split("."),I=[].concat(p);I.shift(),$=$.concat(I),(g.aliases[l]||[]).includes($.join("."))||ze(H,$,F)}),M(l,g.normalize)&&!M(l,g.arrays)&&[l].concat(g.aliases[l]||[]).forEach(function($){Object.defineProperty(He,$,{enumerable:!0,get(){return m},set(I){m=typeof I=="string"?Ue.normalize(I):I}})})}function j(l,m){g.aliases[l]&&g.aliases[l].length||(g.aliases[l]=[m],C[m]=!0),g.aliases[m]&&g.aliases[m].length||j(m,l)}function A(l,m,y){y&&(m=Na(m)),(M(l,g.bools)||M(l,g.counts))&&typeof m=="string"&&(m=m==="true");let F=Array.isArray(m)?m.map(function(p){return O(l,p)}):O(l,m);return M(l,g.counts)&&(Te(F)||typeof F=="boolean")&&(F=_s()),M(l,g.normalize)&&M(l,g.arrays)&&(Array.isArray(m)?F=m.map(p=>Ue.normalize(p)):F=Ue.normalize(m)),F}function O(l,m){return!a["parse-positional-numbers"]&&l==="_"||!M(l,g.strings)&&!M(l,g.bools)&&!Array.isArray(m)&&(yn(m)&&a["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${m}`)))||!Te(m)&&M(l,g.numbers))&&(m=Number(m)),m}function N(l){let m=Object.create(null);X(m,g.aliases,D),Object.keys(g.configs).forEach(function(y){let F=l[y]||m[y];if(F)try{let p=null,_=Ue.resolve(Ue.cwd(),F),$=g.configs[y];if(typeof $=="function"){try{p=$(_)}catch(I){p=I}if(p instanceof Error){U=p;return}}else p=Ue.require(_);q(p)}catch(p){p.name==="PermissionDenied"?U=p:l[y]&&(U=Error(b("Invalid JSON config file: %s",F)))}})}function q(l,m){Object.keys(l).forEach(function(y){let F=l[y],p=m?m+"."+y:y;typeof F=="object"&&F!==null&&!Array.isArray(F)&&a["dot-notation"]?q(F,p):(!Le(H,p.split("."))||M(p,g.arrays)&&a["combine-arrays"])&&V(p,F)})}function le(){typeof h<"u"&&h.forEach(function(l){q(l)})}function z(l,m){if(typeof f>"u")return;let y=typeof f=="string"?f:"",F=Ue.env();Object.keys(F).forEach(function(p){if(y===""||p.lastIndexOf(y,0)===0){let _=p.split("__").map(function($,I){return I===0&&($=$.substring(y.length)),ut($)});(m&&g.configs[_.join(".")]||!m)&&!Le(l,_)&&V(_.join("."),F[p])}})}function De(l){let m,y=new Set;Object.keys(l).forEach(function(F){if(!y.has(F)&&(m=M(F,g.coercions),typeof m=="function"))try{let p=O(F,m(l[F]));[].concat(g.aliases[F]||[],F).forEach(_=>{y.add(_),l[_]=p})}catch(p){U=p}})}function st(l){return g.keys.forEach(m=>{~m.indexOf(".")||typeof l[m]>"u"&&(l[m]=void 0)}),l}function X(l,m,y,F=!1){Object.keys(y).forEach(function(p){Le(l,p.split("."))||(ze(l,p.split("."),y[p]),F&&(E[p]=!0),(m[p]||[]).forEach(function(_){Le(l,_.split("."))||ze(l,_.split("."),y[p])}))})}function Le(l,m){let y=l;a["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(p){y=y[p]||{}});let F=m[m.length-1];return typeof y!="object"?!1:F in y}function ze(l,m,y){let F=l;a["dot-notation"]||(m=[m.join(".")]),m.slice(0,-1).forEach(function(he){he=Yr(he),typeof F=="object"&&F[he]===void 0&&(F[he]={}),typeof F[he]!="object"||Array.isArray(F[he])?(Array.isArray(F[he])?F[he].push({}):F[he]=[F[he],{}],F=F[he][F[he].length-1]):F=F[he]});let p=Yr(m[m.length-1]),_=M(m.join("."),g.arrays),$=Array.isArray(y),I=a["duplicate-arguments-array"];!I&&M(p,g.nargs)&&(I=!0,(!Te(F[p])&&g.nargs[p]===1||Array.isArray(F[p])&&F[p].length===g.nargs[p])&&(F[p]=void 0)),y===_s()?F[p]=_s(F[p]):Array.isArray(F[p])?I&&_&&$?F[p]=a["flatten-duplicate-arrays"]?F[p].concat(y):(Array.isArray(F[p][0])?F[p]:[F[p]]).concat([y]):!I&&!!_==!!$?F[p]=y:F[p]=F[p].concat([y]):F[p]===void 0&&_?F[p]=$?y:[y]:I&&!(F[p]===void 0||M(p,g.counts)||M(p,g.bools))?F[p]=[F[p],y]:F[p]=y}function it(...l){l.forEach(function(m){Object.keys(m||{}).forEach(function(y){g.aliases[y]||(g.aliases[y]=[].concat(i[y]||[]),g.aliases[y].concat(y).forEach(function(F){if(/-/.test(F)&&a["camel-case-expansion"]){let p=ut(F);p!==y&&g.aliases[y].indexOf(p)===-1&&(g.aliases[y].push(p),C[p]=!0)}}),g.aliases[y].concat(y).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&a["camel-case-expansion"]){let p=bn(F,"-");p!==y&&g.aliases[y].indexOf(p)===-1&&(g.aliases[y].push(p),C[p]=!0)}}),g.aliases[y].forEach(function(F){g.aliases[F]=[y].concat(g.aliases[y].filter(function(p){return F!==p}))}))})})}function M(l,m){let y=[].concat(g.aliases[l]||[],l),F=Object.keys(m),p=y.find(_=>F.includes(_));return p?m[p]:!1}function Ln(l){let m=Object.keys(g);return[].concat(m.map(F=>g[F])).some(function(F){return Array.isArray(F)?F.includes(l):F[l]})}function P(l,...m){return[].concat(...m).some(function(F){let p=l.match(F);return p&&Ln(p[1])})}function K(l){if(l.match(B)||!l.match(/^-[^-]+/))return!1;let m=!0,y,F=l.slice(1).split("");for(let p=0;p<F.length;p++){if(y=l.slice(p+2),!Ln(F[p])){m=!1;break}if(F[p+1]&&F[p+1]==="="||y==="-"||/[A-Za-z]/.test(F[p])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(y)||F[p+1]&&F[p+1].match(/\W/))break}return m}function ne(l){return a["unknown-options-as-args"]&&k(l)}function k(l){return l=l.replace(/^-{3,}/,"--"),l.match(B)||K(l)?!1:!P(l,/^-+([^=]+?)=[\s\S]*$/,W,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function se(l){return!M(l,g.bools)&&!M(l,g.counts)&&`${l}`in D?D[l]:oe(Me(l))}function oe(l){return{[Oe.BOOLEAN]:!0,[Oe.STRING]:"",[Oe.NUMBER]:void 0,[Oe.ARRAY]:[]}[l]}function Me(l){let m=Oe.BOOLEAN;return M(l,g.strings)?m=Oe.STRING:M(l,g.numbers)?m=Oe.NUMBER:M(l,g.bools)?m=Oe.BOOLEAN:M(l,g.arrays)&&(m=Oe.ARRAY),m}function Te(l){return l===void 0}function Yt(){Object.keys(g.counts).find(l=>M(l,g.arrays)?(U=Error(b("Invalid configuration: %s, opts.count excludes opts.array.",l)),!0):M(l,g.nargs)?(U=Error(b("Invalid configuration: %s, opts.count excludes opts.narg.",l)),!0):!1)}return{aliases:Object.assign({},g.aliases),argv:Object.assign(He,H),configuration:a,defaulted:Object.assign({},E),error:U,newAliases:Object.assign({},C)}}};function Ra(n){let e=[],t=Object.create(null),s=!0;for(Object.keys(n).forEach(function(r){e.push([].concat(n[r],r))});s;){s=!1;for(let r=0;r<e.length;r++)for(let o=r+1;o<e.length;o++)if(e[r].filter(function(a){return e[o].indexOf(a)!==-1}).length){e[r]=e[r].concat(e[o]),e.splice(o,1),s=!0;break}}return e.forEach(function(r){r=r.filter(function(i,a,D){return D.indexOf(i)===a});let o=r.pop();o!==void 0&&typeof o=="string"&&(t[o]=r)}),t}function _s(n){return n!==void 0?n+1:1}function Yr(n){return n==="__proto__"?"___proto___":n}function Na(n){return typeof n=="string"&&(n[0]==="'"||n[0]==='"')&&n[n.length-1]===n[0]?n.substring(1,n.length-1):n}var Zr=require("fs");var js,Ss,Is,Jr=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,Kr=(Ss=(js=process==null?void 0:process.versions)===null||js===void 0?void 0:js.node)!==null&&Ss!==void 0?Ss:(Is=process==null?void 0:process.version)===null||Is===void 0?void 0:Is.slice(1);if(Kr&&Number(Kr.match(/^([^.]+)/)[1])<Jr)throw Error(`yargs parser supports a minimum Node.js version of ${Jr}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var ka=process?process.env:{},Xr=new wn({cwd:process.cwd,env:()=>ka,format:Qr.format,normalize:An.normalize,resolve:An.resolve,require:n=>{if(typeof require<"u")return require(n);if(n.match(/\.json$/))return JSON.parse((0,Zr.readFileSync)(n,"utf8"));throw Error("only .json config files are supported in ESM")}}),qt=function(e,t){return Xr.parse(e.slice(),t).argv};qt.detailed=function(n,e){return Xr.parse(n.slice(),e)};qt.camelCase=ut;qt.decamelize=bn;qt.looksLikeNumber=yn;var eo=qt;var Re=require("path");function La(){return za()?0:1}function za(){return qa()&&!process.defaultApp}function qa(){return!!process.versions.electron}function to(){return process.argv[La()]}var Y=class n extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,n)}};var St=require("fs"),no=require("util"),so=require("path"),io={fs:{readFileSync:St.readFileSync,writeFile:St.writeFile},format:no.format,resolve:so.resolve,exists:n=>{try{return(0,St.statSync)(n).isFile()}catch{return!1}}};var We,Ps=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(),s=function(){};return typeof e[e.length-1]=="function"&&(s=e.pop()),s=s||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:s})):s(),We.format.apply(We.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),s=e.shift(),r=e.shift(),o=function(){};typeof e[e.length-1]=="function"&&(o=e.pop()),this.cache[this.locale]||this._readLocaleFile();let i=r===1?t:s;this.cache[this.locale][t]&&(i=this.cache[this.locale][t][r===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:s},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:o})):o();let a=[i];return~i.indexOf("%d")&&a.push(r),We.format.apply(We.format,a.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){this.cache[this.locale]||this._readLocaleFile();for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(this.cache[this.locale][t]=e[t])}_taggedLiteral(e,...t){let s="";return e.forEach(function(r,o){let i=t[o+1];s+=r,typeof i<"u"&&(s+="%s")}),this.__.apply(this,[s].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],s=t.directory,r=t.locale,o=t.cb,i=this._resolveLocaleFile(s,r),a=JSON.stringify(this.cache[r],null,2);We.fs.writeFile(i,a,"utf-8",function(D){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),o(D)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{We.fs.readFileSync&&(e=JSON.parse(We.fs.readFileSync(t,"utf-8")))}catch(s){if(s instanceof SyntaxError&&(s.message="syntax error in "+t),s.code==="ENOENT")e={};else throw s}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let s=We.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(s)&&~t.lastIndexOf("_")){let r=We.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(r)&&(s=r)}return s}_fileExistsSync(e){return We.exists(e)}};function ro(n,e){We=e;let t=new Ps(n);return{__:t.__.bind(t),__n:t.__n.bind(t),setLocale:t.setLocale.bind(t),getLocale:t.getLocale.bind(t),updateLocale:t.updateLocale.bind(t),locale:t.locale}}var Ua=n=>ro(n,io),oo=Ua;var Ga={},Ha="require is not supported by ESM",uo="loading a directory of commands is not supported yet for ESM",Ut;try{Ut=(0,lo.fileURLToPath)(Ga.url)}catch{Ut=process.cwd()}var Va=Ut.substring(0,Ut.lastIndexOf("node_modules")),Do={assert:{notStrictEqual:$n.notStrictEqual,strictEqual:$n.strictEqual},cliui:Os,findUp:Vr,getEnv:n=>process.env[n],inspect:ao.inspect,getCallerFile:()=>{throw new Y(uo)},getProcessArgvBin:to,mainFilename:Va||process.cwd(),Parser:eo,path:{basename:Re.basename,dirname:Re.dirname,extname:Re.extname,relative:Re.relative,resolve:Re.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(n,e)=>process.emitWarning(n,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:co.readFileSync,require:()=>{throw new Y(Ha)},requireDirectory:()=>{throw new Y(uo)},stringWidth:n=>[...n].length,y18n:oo({directory:(0,Re.resolve)(Ut,"../../../locales"),updateFiles:!1})};function Fe(n,e,t,s){t.assert.notStrictEqual(n,e,s)}function Ms(n,e){e.assert.strictEqual(typeof n,"string")}function It(n){return Object.keys(n)}function J(n){return!!n&&!!n.then&&typeof n.then=="function"}function Ke(n){let t=n.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,r=t.shift();if(!r)throw new Error(`No command found in: ${n}`);let o={cmd:r.replace(s,""),demanded:[],optional:[]};return t.forEach((i,a)=>{let D=!1;i=i.replace(/\s/g,""),/\.+[\]>]/.test(i)&&a===t.length-1&&(D=!0),/^\[/.test(i)?o.optional.push({cmd:i.replace(s,"").split("|"),variadic:D}):o.demanded.push({cmd:i.replace(s,"").split("|"),variadic:D})}),o}var Ya=["first","second","third","fourth","fifth","sixth"];function x(n,e,t){function s(){return typeof n=="object"?[{demanded:[],optional:[]},n,e]:[Ke(`cmd ${n}`),e,t]}try{let r=0,[o,i,a]=s(),D=[].slice.call(i);for(;D.length&&D[D.length-1]===void 0;)D.pop();let h=a||D.length;if(h<o.demanded.length)throw new Y(`Not enough arguments provided. Expected ${o.demanded.length} but received ${D.length}.`);let f=o.demanded.length+o.optional.length;if(h>f)throw new Y(`Too many arguments provided. Expected max ${f} but received ${h}.`);o.demanded.forEach(c=>{let d=D.shift(),C=ho(d);c.cmd.filter(b=>b===C||b==="*").length===0&&fo(C,c.cmd,r),r+=1}),o.optional.forEach(c=>{if(D.length===0)return;let d=D.shift(),C=ho(d);c.cmd.filter(b=>b===C||b==="*").length===0&&fo(C,c.cmd,r),r+=1})}catch(r){console.warn(r.stack)}}function ho(n){return Array.isArray(n)?"array":n===null?"null":typeof n}function fo(n,e,t){throw new Y(`Invalid ${Ya[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${n}.`)}var xn=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,s=!0,r=!1){if(x("<array|function> [boolean] [boolean] [boolean]",[e,t,s],arguments.length),Array.isArray(e)){for(let o=0;o<e.length;o++){if(typeof e[o]!="function")throw Error("middleware must be a function");let i=e[o];i.applyBeforeValidation=t,i.global=s}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let o=e;o.applyBeforeValidation=t,o.global=s,o.mutates=r,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(r=>{let o=[...s[t]||[],t];return r.option?!o.includes(r.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 po(n){return n?n.map(e=>(e.applyBeforeValidation=!1,e)):[]}function at(n,e,t,s){return t.reduce((r,o)=>{if(o.applyBeforeValidation!==s)return r;if(o.mutates){if(o.applied)return r;o.applied=!0}if(J(r))return r.then(i=>Promise.all([i,o(i,e)])).then(([i,a])=>Object.assign(i,a));{let i=o(r,e);return J(i)?i.then(a=>Object.assign(r,a)):Object.assign(r,i)}},n)}function ct(n,e,t=s=>{throw s}){try{let s=Ja(n)?n():n;return J(s)?s.then(r=>e(r)):e(s)}catch(s){return t(s)}}function Ja(n){return typeof n=="function"}function Ts(n){if(typeof require>"u")return null;for(let e=0,t=Object.keys(require.cache),s;e<t.length;e++)if(s=require.cache[t[e]],s.exports===n)return s;return null}var Pt=/(^\*)|(^\$0)/,Ws=class{constructor(e,t,s,r){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=r,this.usage=e,this.globalMiddleware=s,this.validation=t}addDirectory(e,t,s,r){r=r||{},typeof r.recurse!="boolean"&&(r.recurse=!1),Array.isArray(r.extensions)||(r.extensions=["js"]);let o=typeof r.visit=="function"?r.visit:i=>i;r.visit=(i,a,D)=>{let h=o(i,a,D);if(h){if(this.requireCache.has(a))return h;this.requireCache.add(a),this.addHandler(h)}return h},this.shim.requireDirectory({require:t,filename:s},e,r)}addHandler(e,t,s,r,o,i){let a=[],D=po(o);if(r=r||(()=>{}),Array.isArray(e))if(Ka(e))[e,...a]=e;else for(let h of e)this.addHandler(h);else if(Za(e)){let h=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(h=[].concat(h).concat(e.aliases)),this.addHandler(h,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(mo(s)){this.addHandler([e].concat(a),t,s.builder,s.handler,s.middlewares,s.deprecated);return}if(typeof e=="string"){let h=Ke(e);a=a.map(d=>Ke(d).cmd);let f=!1,c=[h.cmd].concat(a).filter(d=>Pt.test(d)?(f=!0,!1):!0);c.length===0&&f&&c.push("$0"),f&&(h.cmd=c[0],a=c.slice(1),e=e.replace(Pt,h.cmd)),a.forEach(d=>{this.aliasMap[d]=h.cmd}),t!==!1&&this.usage.command(e,t,f,a,i),this.handlers[h.cmd]={original:e,description:t,handler:r,builder:s||{},middlewares:D,deprecated:i,demanded:h.demanded,optional:h.optional},f&&(this.defaultCommand=this.handlers[h.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,s,r,o,i){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,D=t.getInternalMethods().getContext(),h=D.commands.slice(),f=!e;e&&(D.commands.push(e),D.fullCommands.push(a.original));let c=this.applyBuilderUpdateUsageAndParse(f,a,t,s.aliases,h,r,o,i);return J(c)?c.then(d=>this.applyMiddlewareAndGetResult(f,a,d.innerArgv,D,o,d.aliases,t)):this.applyMiddlewareAndGetResult(f,a,c.innerArgv,D,o,c.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,s,r,o,i,a,D){let h=t.builder,f=s;if(vn(h)){s.getInternalMethods().getUsageInstance().freeze();let c=h(s.getInternalMethods().reset(r),D);if(J(c))return c.then(d=>(f=Co(d)?d:s,this.parseAndUpdateUsage(e,t,f,o,i,a)))}else Qa(h)&&(s.getInternalMethods().getUsageInstance().freeze(),f=s.getInternalMethods().reset(r),Object.keys(t.builder).forEach(c=>{f.option(c,h[c])}));return this.parseAndUpdateUsage(e,t,f,o,i,a)}parseAndUpdateUsage(e,t,s,r,o,i){e&&s.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(r,t),t.description);let a=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,o,i);return J(a)?a.then(D=>({aliases:s.parsed.aliases,innerArgv:D})):{aliases:s.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let s=Pt.test(t.original)?t.original.replace(Pt,"").trim():t.original,r=e.filter(o=>!Pt.test(o));return r.push(s),`$0 ${r.join(" ")}`}handleValidationAndGetResult(e,t,s,r,o,i,a,D){if(!i.getInternalMethods().getHasOutput()){let h=i.getInternalMethods().runValidation(o,D,i.parsed.error,e);s=ct(s,f=>(h(f),f))}if(t.handler&&!i.getInternalMethods().getHasOutput()){i.getInternalMethods().setHasOutput();let h=!!i.getOptions().configuration["populate--"];i.getInternalMethods().postProcess(s,h,!1,!1),s=at(s,i,a,!1),s=ct(s,f=>{let c=t.handler(f);return J(c)?c.then(()=>f):f}),e||i.getInternalMethods().getUsageInstance().cacheHelpMessage(),J(s)&&!i.getInternalMethods().hasParseCallback()&&s.catch(f=>{try{i.getInternalMethods().getUsageInstance().fail(null,f)}catch{}})}return e||(r.commands.pop(),r.fullCommands.pop()),s}applyMiddlewareAndGetResult(e,t,s,r,o,i,a){let D={};if(o)return s;a.getInternalMethods().getHasOutput()||(D=this.populatePositionals(t,s,r,a));let h=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares),f=at(s,a,h,!0);return J(f)?f.then(c=>this.handleValidationAndGetResult(e,t,c,r,i,a,h,D)):this.handleValidationAndGetResult(e,t,f,r,i,a,h,D)}populatePositionals(e,t,s,r){t._=t._.slice(s.commands.length);let o=e.demanded.slice(0),i=e.optional.slice(0),a={};for(this.validation.positionalCount(o.length,t._.length);o.length;){let D=o.shift();this.populatePositional(D,t,a)}for(;i.length;){let D=i.shift();this.populatePositional(D,t,a)}return t._=s.commands.concat(t._.map(D=>""+D)),this.postProcessPositionals(t,a,this.cmdToParseOptions(e.original),r),a}populatePositional(e,t,s){let r=e.cmd[0];e.variadic?s[r]=t._.splice(0).map(String):t._.length&&(s[r]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},s=Ke(e);return s.demanded.forEach(r=>{let[o,...i]=r.cmd;r.variadic&&(t.array.push(o),t.default[o]=[]),t.alias[o]=i,t.demand[o]=!0}),s.optional.forEach(r=>{let[o,...i]=r.cmd;r.variadic&&(t.array.push(o),t.default[o]=[]),t.alias[o]=i}),t}postProcessPositionals(e,t,s,r){let o=Object.assign({},r.getOptions());o.default=Object.assign(s.default,o.default);for(let h of Object.keys(s.alias))o.alias[h]=(o.alias[h]||[]).concat(s.alias[h]);o.array=o.array.concat(s.array),o.config={};let i=[];if(Object.keys(t).forEach(h=>{t[h].map(f=>{o.configuration["unknown-options-as-args"]&&(o.key[h]=!0),i.push(`--${h}`),i.push(f)})}),!i.length)return;let a=Object.assign({},o.configuration,{"populate--":!1}),D=this.shim.Parser.detailed(i,Object.assign({},o,{configuration:a}));if(D.error)r.getInternalMethods().getUsageInstance().fail(D.error.message,D.error);else{let h=Object.keys(t);Object.keys(t).forEach(f=>{h.push(...D.aliases[f])}),Object.keys(D.argv).forEach(f=>{h.includes(f)&&(t[f]||(t[f]=D.argv[f]),!this.isInConfigs(r,f)&&!this.isDefaulted(r,f)&&Object.prototype.hasOwnProperty.call(e,f)&&Object.prototype.hasOwnProperty.call(D.argv,f)&&(Array.isArray(e[f])||Array.isArray(D.argv[f]))?e[f]=[].concat(e[f],D.argv[f]):e[f]=D.argv[f])})}}isDefaulted(e,t){let{default:s}=e.getOptions();return Object.prototype.hasOwnProperty.call(s,t)||Object.prototype.hasOwnProperty.call(s,this.shim.Parser.camelCase(t))}isInConfigs(e,t){let{configObjects:s}=e.getOptions();return s.some(r=>Object.prototype.hasOwnProperty.call(r,t))||s.some(r=>Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t)))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let s=Pt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(s,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(vn(t))return t(e,!0);mo(t)||Object.keys(t).forEach(s=>{e.option(s,t[s])})}moduleName(e){let t=Ts(e);if(!t)throw new 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:s}){for(let r of[e,t,s]){if(typeof r=="string"||r===!1)return r;Fe(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();Fe(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 go(n,e,t,s){return new Ws(n,e,t,s)}function mo(n){return typeof n=="object"&&!!n.builder&&typeof n.handler=="function"}function Ka(n){return n.every(e=>typeof e=="string")}function vn(n){return typeof n=="function"}function Qa(n){return typeof n=="object"}function Za(n){return typeof n=="object"&&!Array.isArray(n)}function Qe(n={},e=()=>!0){let t={};return It(n).forEach(s=>{e(s,n[s])&&(t[s]=n[s])}),t}function Ze(n){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(n)})}function Xa(n){return typeof n=="boolean"}function Eo(n,e){let t=e.y18n.__,s={},r=[];s.failFn=function(A){r.push(A)};let o=null,i=null,a=!0;s.showHelpOnFail=function(A=!0,O){let[N,q]=typeof A=="string"?[!0,A]:[A,O];return n.getInternalMethods().isGlobalContext()&&(i=q),o=q,a=N,s};let D=!1;s.fail=function(A,O){let N=n.getInternalMethods().getLoggerInstance();if(r.length)for(let q=r.length-1;q>=0;--q){let le=r[q];if(Xa(le)){if(O)throw O;if(A)throw Error(A)}else le(A,O,s)}else{if(n.getExitProcess()&&Ze(!0),!D){D=!0,a&&(n.showHelp("error"),N.error()),(A||O)&&N.error(A||O);let q=o||i;q&&((A||O)&&N.error(""),N.error(q))}if(O=O||new Y(A),n.getExitProcess())return n.exit(1);if(n.getInternalMethods().hasParseCallback())return n.exit(1,O);throw O}};let h=[],f=!1;s.usage=(j,A)=>j===null?(f=!0,h=[],s):(f=!1,h.push([j,A||""]),s),s.getUsage=()=>h,s.getUsageDisabled=()=>f,s.getPositionalGroupName=()=>t("Positionals:");let c=[];s.example=(j,A)=>{c.push([j,A||""])};let d=[];s.command=function(A,O,N,q,le=!1){N&&(d=d.map(z=>(z[2]=!1,z))),d.push([A,O||"",N,q,le])},s.getCommands=()=>d;let C={};s.describe=function(A,O){Array.isArray(A)?A.forEach(N=>{s.describe(N,O)}):typeof A=="object"?Object.keys(A).forEach(N=>{s.describe(N,A[N])}):C[A]=O},s.getDescriptions=()=>C;let E=[];s.epilog=j=>{E.push(j)};let b=!1,g;s.wrap=j=>{b=!0,g=j},s.getWrap=()=>e.getEnv("YARGS_DISABLE_WRAP")?null:(b||(g=Et(),b=!0),g);let B="__yargsString__:";s.deferY18nLookup=j=>B+j,s.help=function(){if(L)return L;U();let A=n.customScriptName?n.$0:e.path.basename(n.$0),O=n.getDemandedOptions(),N=n.getDemandedCommands(),q=n.getDeprecatedOptions(),le=n.getGroups(),z=n.getOptions(),De=[];De=De.concat(Object.keys(C)),De=De.concat(Object.keys(O)),De=De.concat(Object.keys(N)),De=De.concat(Object.keys(z.default)),De=De.filter(He),De=Object.keys(De.reduce((P,K)=>(K!=="_"&&(P[K]=!0),P),{}));let st=s.getWrap(),X=e.cliui({width:st,wrap:!!st});if(!f){if(h.length)h.forEach(P=>{X.div({text:`${P[0].replace(/\$0/g,A)}`}),P[1]&&X.div({text:`${P[1]}`,padding:[1,0,0,0]})}),X.div();else if(d.length){let P=null;N._?P=`${A} <${t("command")}>
|
|
106
106
|
`:P=`${A} [${t("command")}]
|
|
107
|
-
`,X.div(`${P}`)}}if(d.length>1||d.length===1&&!d[0][2]){X.div(t("Commands:"));let P=n.getInternalMethods().getContext(),K=P.commands.length?`${P.commands.join(" ")} `:"";n.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((k,se)=>k[0].localeCompare(se[0])));let ne=A?`${A} `:"";d.forEach(k=>{let se=`${ne}${K}${k[0].replace(/^\$0 ?/,"")}`;X.span({text:se,padding:[0,2,0,2],width:
|
|
107
|
+
`,X.div(`${P}`)}}if(d.length>1||d.length===1&&!d[0][2]){X.div(t("Commands:"));let P=n.getInternalMethods().getContext(),K=P.commands.length?`${P.commands.join(" ")} `:"";n.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(d=d.sort((k,se)=>k[0].localeCompare(se[0])));let ne=A?`${A} `:"";d.forEach(k=>{let se=`${ne}${K}${k[0].replace(/^\$0 ?/,"")}`;X.span({text:se,padding:[0,2,0,2],width:W(d,st,`${A}${K}`)+4},{text:k[1]});let oe=[];k[2]&&oe.push(`[${t("default")}]`),k[3]&&k[3].length&&oe.push(`[${t("aliases:")} ${k[3].join(", ")}]`),k[4]&&(typeof k[4]=="string"?oe.push(`[${t("deprecated: %s",k[4])}]`):oe.push(`[${t("deprecated")}]`)),oe.length?X.div({text:oe.join(" "),padding:[0,0,0,2],align:"right"}):X.div()}),X.div()}let Le=(Object.keys(z.alias)||[]).concat(Object.keys(n.parsed.newAliases)||[]);De=De.filter(P=>!n.parsed.newAliases[P]&&Le.every(K=>(z.alias[K]||[]).indexOf(P)===-1));let ze=t("Options:");le[ze]||(le[ze]=[]),H(De,z.alias,le,ze);let it=P=>/^--/.test(Bn(P)),M=Object.keys(le).filter(P=>le[P].length>0).map(P=>{let K=le[P].filter(He).map(ne=>{if(Le.includes(ne))return ne;for(let k=0,se;(se=Le[k])!==void 0;k++)if((z.alias[se]||[]).includes(ne))return se;return ne});return{groupName:P,normalizedKeys:K}}).filter(({normalizedKeys:P})=>P.length>0).map(({groupName:P,normalizedKeys:K})=>{let ne=K.reduce((k,se)=>(k[se]=[se].concat(z.alias[se]||[]).map(oe=>P===s.getPositionalGroupName()?oe:(/^[0-9]$/.test(oe)?z.boolean.includes(se)?"-":"--":oe.length>1?"--":"-")+oe).sort((oe,Me)=>it(oe)===it(Me)?0:it(oe)?1:-1).join(", "),k),{});return{groupName:P,normalizedKeys:K,switches:ne}});if(M.filter(({groupName:P})=>P!==s.getPositionalGroupName()).some(({normalizedKeys:P,switches:K})=>!P.every(ne=>it(K[ne])))&&M.filter(({groupName:P})=>P!==s.getPositionalGroupName()).forEach(({normalizedKeys:P,switches:K})=>{P.forEach(ne=>{it(K[ne])&&(K[ne]=ec(K[ne],4))})}),M.forEach(({groupName:P,normalizedKeys:K,switches:ne})=>{X.div(P),K.forEach(k=>{let se=ne[k],oe=C[k]||"",Me=null;oe.includes(B)&&(oe=t(oe.substring(B.length))),z.boolean.includes(k)&&(Me=`[${t("boolean")}]`),z.count.includes(k)&&(Me=`[${t("count")}]`),z.string.includes(k)&&(Me=`[${t("string")}]`),z.normalize.includes(k)&&(Me=`[${t("string")}]`),z.array.includes(k)&&(Me=`[${t("array")}]`),z.number.includes(k)&&(Me=`[${t("number")}]`);let Te=m=>typeof m=="string"?`[${t("deprecated: %s",m)}]`:`[${t("deprecated")}]`,Yt=[k in q?Te(q[k]):null,Me,k in O?`[${t("required")}]`:null,z.choices&&z.choices[k]?`[${t("choices:")} ${s.stringifiedValues(z.choices[k])}]`:null,Pe(z.default[k],z.defaultDescription[k])].filter(Boolean).join(" ");X.span({text:Bn(se),padding:[0,2,0,2+Fo(se)],width:W(ne,st)+4},oe);let l=n.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;Yt&&!l?X.div({text:Yt,padding:[0,0,0,2],align:"right"}):X.div()}),X.div()}),c.length&&(X.div(t("Examples:")),c.forEach(P=>{P[0]=P[0].replace(/\$0/g,A)}),c.forEach(P=>{P[1]===""?X.div({text:P[0],padding:[0,2,0,2]}):X.div({text:P[0],padding:[0,2,0,2],width:W(c,st)+4},{text:P[1]})}),X.div()),E.length>0){let P=E.map(K=>K.replace(/\$0/g,A)).join(`
|
|
108
108
|
`);X.div(`${P}
|
|
109
|
-
`)}return X.toString().replace(/\s*$/,"")};function
|
|
109
|
+
`)}return X.toString().replace(/\s*$/,"")};function W(j,A,O){let N=0;return Array.isArray(j)||(j=Object.values(j).map(q=>[q])),j.forEach(q=>{N=Math.max(e.stringWidth(O?`${O} ${Bn(q[0])}`:Bn(q[0]))+Fo(q[0]),N)}),A&&(N=Math.min(N,parseInt((A*.5).toString(),10))),N}function U(){let j=n.getDemandedOptions(),A=n.getOptions();(Object.keys(A.alias)||[]).forEach(O=>{A.alias[O].forEach(N=>{C[N]&&s.describe(O,C[N]),N in j&&n.demandOption(O,j[N]),A.boolean.includes(N)&&n.boolean(O),A.count.includes(N)&&n.count(O),A.string.includes(N)&&n.string(O),A.normalize.includes(N)&&n.normalize(O),A.array.includes(N)&&n.array(O),A.number.includes(N)&&n.number(O)})})}let L;s.cacheHelpMessage=function(){L=this.help()},s.clearCachedHelpMessage=function(){L=void 0},s.hasCachedHelpMessage=function(){return!!L};function H(j,A,O,N){let q=[],le=null;return Object.keys(O).forEach(z=>{q=q.concat(O[z])}),j.forEach(z=>{le=[z].concat(A[z]),le.some(De=>q.indexOf(De)!==-1)||O[N].push(z)}),q}function He(j){return n.getOptions().hiddenOptions.indexOf(j)<0||n.parsed.argv[n.getOptions().showHiddenOpt]}s.showHelp=j=>{let A=n.getInternalMethods().getLoggerInstance();j||(j="error"),(typeof j=="function"?j:A[j])(s.help())},s.functionDescription=j=>["(",j.name?e.Parser.decamelize(j.name,"-"):t("generated-value"),")"].join(""),s.stringifiedValues=function(A,O){let N="",q=O||", ",le=[].concat(A);return!A||!le.length||le.forEach(z=>{N.length&&(N+=q),N+=JSON.stringify(z)}),N};function Pe(j,A){let O=`[${t("default:")} `;if(j===void 0&&!A)return null;if(A)O+=A;else switch(typeof j){case"string":O+=`"${j}"`;break;case"object":O+=JSON.stringify(j);break;default:O+=j}return`${O}]`}function Et(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let nt=null;s.version=j=>{nt=j},s.showVersion=j=>{let A=n.getInternalMethods().getLoggerInstance();j||(j="error"),(typeof j=="function"?j:A[j])(nt)},s.reset=function(A){return o=null,D=!1,h=[],f=!1,E=[],c=[],d=[],C=Qe(C,O=>!A[O]),s};let V=[];return s.freeze=function(){V.push({failMessage:o,failureOutput:D,usages:h,usageDisabled:f,epilogs:E,examples:c,commands:d,descriptions:C})},s.unfreeze=function(A=!1){let O=V.pop();O&&(A?(C={...O.descriptions,...C},d=[...O.commands,...d],h=[...O.usages,...h],c=[...O.examples,...c],E=[...O.epilogs,...E]):{failMessage:o,failureOutput:D,usages:h,usageDisabled:f,epilogs:E,examples:c,commands:d,descriptions:C}=O)},s}function Rs(n){return typeof n=="object"}function ec(n,e){return Rs(n)?{text:n.text,indentation:n.indentation+e}:{text:n,indentation:e}}function Fo(n){return Rs(n)?n.indentation:0}function Bn(n){return Rs(n)?n.text:n}var bo=`###-begin-{{app_name}}-completions-###
|
|
110
110
|
#
|
|
111
111
|
# yargs command completion script
|
|
112
112
|
#
|
|
@@ -153,15 +153,15 @@ _{{app_name}}_yargs_completions()
|
|
|
153
153
|
}
|
|
154
154
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
155
155
|
###-end-{{app_name}}-completions-###
|
|
156
|
-
`;var Ns=class{constructor(e,t,s,r){var o,i,a;this.yargs=e,this.usage=t,this.command=s,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((i=this.shim.getEnv("ZSH_NAME"))===null||i===void 0?void 0:i.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,t,s,r){let o=this.command.getCommandHandlers();for(let a=0,D=e.length;a<D;++a)if(o[e[a]]&&o[e[a]].builder){let h=o[e[a]].builder;if(vn(h)){this.indexAfterLastReset=a+1;let f=this.yargs.getInternalMethods().reset();return h(f,!0),f.argv}}let i=[];this.commandCompletions(i,e,s),this.optionCompletions(i,e,t,s),this.choicesFromOptionsCompletions(i,e,t,s),this.choicesFromPositionalsCompletions(i,e,t,s),r(null,i)}commandCompletions(e,t,s){let r=this.yargs.getInternalMethods().getContext().commands;!s.match(/^-/)&&r[r.length-1]!==s&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(o=>{let i=Ke(o[0]).cmd;if(t.indexOf(i)===-1)if(!this.zshShell)e.push(i);else{let a=o[1]||"";e.push(i.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,t,s,r){if((r.match(/^-/)||r===""&&e.length===0)&&!this.previousArgHasChoices(t)){let o=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let D=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!i.includes(a)&&!o.hiddenOptions.includes(a)&&!this.argsContainKey(t,a,D)&&this.completeOptionKey(a,e,r,D&&!!o.default[a])})}}choicesFromOptionsCompletions(e,t,s,r){if(this.previousArgHasChoices(t)){let o=this.getPreviousArgChoices(t);o&&o.length>0&&e.push(...o.map(i=>i.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,t,s,r){if(r===""&&e.length>0&&this.previousArgHasChoices(t))return;let o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],i=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=o[s._.length-i-1];if(!a)return;let D=this.yargs.getOptions().choices[a]||[];for(let h of D)h.startsWith(r)&&e.push(h.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],s="";if(!t.startsWith("-")&&e.length>1&&(s=t,t=e[e.length-2]),!t.startsWith("-"))return;let r=t.replace(/^-+/,""),o=this.yargs.getOptions(),i=[r,...this.yargs.getAliases()[r]||[]],a;for(let D of i)if(Object.prototype.hasOwnProperty.call(o.key,D)&&Array.isArray(o.choices[D])){a=o.choices[D];break}if(a)return a.filter(D=>!s||D.startsWith(s))}previousArgHasChoices(e){let t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,s){let r=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(r(t)||s&&r(`no-${t}`))return!0;if(this.aliases){for(let o of this.aliases[t])if(r(o))return!0}return!1}completeOptionKey(e,t,s,r){var o,i,a,D;let h=e;if(this.zshShell){let C=this.usage.getDescriptions(),E=(i=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||i===void 0?void 0:i.find(
|
|
156
|
+
`;var Ns=class{constructor(e,t,s,r){var o,i,a;this.yargs=e,this.usage=t,this.command=s,this.shim=r,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(a=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((i=this.shim.getEnv("ZSH_NAME"))===null||i===void 0?void 0:i.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,t,s,r){let o=this.command.getCommandHandlers();for(let a=0,D=e.length;a<D;++a)if(o[e[a]]&&o[e[a]].builder){let h=o[e[a]].builder;if(vn(h)){this.indexAfterLastReset=a+1;let f=this.yargs.getInternalMethods().reset();return h(f,!0),f.argv}}let i=[];this.commandCompletions(i,e,s),this.optionCompletions(i,e,t,s),this.choicesFromOptionsCompletions(i,e,t,s),this.choicesFromPositionalsCompletions(i,e,t,s),r(null,i)}commandCompletions(e,t,s){let r=this.yargs.getInternalMethods().getContext().commands;!s.match(/^-/)&&r[r.length-1]!==s&&!this.previousArgHasChoices(t)&&this.usage.getCommands().forEach(o=>{let i=Ke(o[0]).cmd;if(t.indexOf(i)===-1)if(!this.zshShell)e.push(i);else{let a=o[1]||"";e.push(i.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,t,s,r){if((r.match(/^-/)||r===""&&e.length===0)&&!this.previousArgHasChoices(t)){let o=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(o.key).forEach(a=>{let D=!!o.configuration["boolean-negation"]&&o.boolean.includes(a);!i.includes(a)&&!o.hiddenOptions.includes(a)&&!this.argsContainKey(t,a,D)&&this.completeOptionKey(a,e,r,D&&!!o.default[a])})}}choicesFromOptionsCompletions(e,t,s,r){if(this.previousArgHasChoices(t)){let o=this.getPreviousArgChoices(t);o&&o.length>0&&e.push(...o.map(i=>i.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions(e,t,s,r){if(r===""&&e.length>0&&this.previousArgHasChoices(t))return;let o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],i=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),a=o[s._.length-i-1];if(!a)return;let D=this.yargs.getOptions().choices[a]||[];for(let h of D)h.startsWith(r)&&e.push(h.replace(/:/g,"\\:"))}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1],s="";if(!t.startsWith("-")&&e.length>1&&(s=t,t=e[e.length-2]),!t.startsWith("-"))return;let r=t.replace(/^-+/,""),o=this.yargs.getOptions(),i=[r,...this.yargs.getAliases()[r]||[]],a;for(let D of i)if(Object.prototype.hasOwnProperty.call(o.key,D)&&Array.isArray(o.choices[D])){a=o.choices[D];break}if(a)return a.filter(D=>!s||D.startsWith(s))}previousArgHasChoices(e){let t=this.getPreviousArgChoices(e);return t!==void 0&&t.length>0}argsContainKey(e,t,s){let r=o=>e.indexOf((/^[^0-9]$/.test(o)?"-":"--")+o)!==-1;if(r(t)||s&&r(`no-${t}`))return!0;if(this.aliases){for(let o of this.aliases[t])if(r(o))return!0}return!1}completeOptionKey(e,t,s,r){var o,i,a,D;let h=e;if(this.zshShell){let C=this.usage.getDescriptions(),E=(i=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||i===void 0?void 0:i.find(B=>{let W=C[B];return typeof W=="string"&&W.length>0}),b=E?C[E]:void 0,g=(D=(a=C[e])!==null&&a!==void 0?a:b)!==null&&D!==void 0?D:"";h=`${e.replace(/:/g,"\\:")}:${g.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let f=C=>/^--/.test(C),c=C=>/^[^0-9]$/.test(C),d=!f(s)&&c(e)?"-":"--";t.push(d+h),r&&t.push(d+"no-"+h)}customCompletion(e,t,s,r){if(Fe(this.customCompletionFunction,null,this.shim),nc(this.customCompletionFunction)){let o=this.customCompletionFunction(s,t);return J(o)?o.then(i=>{this.shim.process.nextTick(()=>{r(null,i)})}).catch(i=>{this.shim.process.nextTick(()=>{r(i,void 0)})}):r(null,o)}else return sc(this.customCompletionFunction)?this.customCompletionFunction(s,t,(o=r)=>this.defaultCompletion(e,t,s,o),o=>{r(null,o)}):this.customCompletionFunction(s,t,o=>{r(null,o)})}getCompletion(e,t){let s=e.length?e[e.length-1]:"",r=this.yargs.parse(e,!0),o=this.customCompletionFunction?i=>this.customCompletion(e,i,s,t):i=>this.defaultCompletion(e,i,s,t);return J(r)?r.then(o):o(r)}generateCompletionScript(e,t){let s=this.zshShell?yo:bo,r=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),s=s.replace(/{{app_name}}/g,r),s=s.replace(/{{completion_command}}/g,t),s.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function wo(n,e,t,s){return new Ns(n,e,t,s)}function nc(n){return n.length<3}function sc(n){return n.length>3}function Ao(n,e){if(n.length===0)return e.length;if(e.length===0)return n.length;let t=[],s;for(s=0;s<=e.length;s++)t[s]=[s];let r;for(r=0;r<=n.length;r++)t[0][r]=r;for(s=1;s<=e.length;s++)for(r=1;r<=n.length;r++)e.charAt(s-1)===n.charAt(r-1)?t[s][r]=t[s-1][r-1]:s>1&&r>1&&e.charAt(s-2)===n.charAt(r-1)&&e.charAt(s-1)===n.charAt(r-2)?t[s][r]=t[s-2][r-2]+1:t[s][r]=Math.min(t[s-1][r-1]+1,Math.min(t[s][r-1]+1,t[s-1][r]+1));return t[e.length][n.length]}var $o=["$0","--","_"];function xo(n,e,t){let s=t.y18n.__,r=t.y18n.__n,o={};o.nonOptionCount=function(c){let d=n.getDemandedCommands(),E=c._.length+(c["--"]?c["--"].length:0)-n.getInternalMethods().getContext().commands.length;d._&&(E<d._.min||E>d._.max)&&(E<d._.min?d._.minMsg!==void 0?e.fail(d._.minMsg?d._.minMsg.replace(/\$0/g,E.toString()).replace(/\$1/,d._.min.toString()):null):e.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",E,E.toString(),d._.min.toString())):E>d._.max&&(d._.maxMsg!==void 0?e.fail(d._.maxMsg?d._.maxMsg.replace(/\$0/g,E.toString()).replace(/\$1/,d._.max.toString()):null):e.fail(r("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",E,E.toString(),d._.max.toString()))))},o.positionalCount=function(c,d){d<c&&e.fail(r("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",d,d+"",c+""))},o.requiredArguments=function(c,d){let C=null;for(let E of Object.keys(d))(!Object.prototype.hasOwnProperty.call(c,E)||typeof c[E]>"u")&&(C=C||{},C[E]=d[E]);if(C){let E=[];for(let g of Object.keys(C)){let B=C[g];B&&E.indexOf(B)<0&&E.push(B)}let b=E.length?`
|
|
157
157
|
${E.join(`
|
|
158
|
-
`)}`:"";e.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(C).length,Object.keys(C).join(", ")+b))}},o.unknownArguments=function(c,d,C,E,b=!0){var g;let
|
|
159
|
-
${s("Argument: %s, Given: %s, Choices: %s",g,e.stringifiedValues(C[g]),e.stringifiedValues(d.choices[g]))}`}),e.fail(b)};let i={};o.implies=function(c,d){x("<string|object> [array|number|string]",[c,d],arguments.length),typeof c=="object"?Object.keys(c).forEach(C=>{o.implies(C,c[C])}):(n.global(c),i[c]||(i[c]=[]),Array.isArray(d)?d.forEach(C=>o.implies(c,C)):(Fe(d,void 0,t),i[c].push(d)))},o.getImplied=function(){return i};function a(f,c){let d=Number(c);return c=isNaN(d)?c:d,typeof c=="number"?c=f._.length>=c:c.match(/^--no-.+/)?(c=c.match(/^--no-(.+)/)[1],c=!Object.prototype.hasOwnProperty.call(f,c)):c=Object.prototype.hasOwnProperty.call(f,c),c}o.implications=function(c){let d=[];if(Object.keys(i).forEach(C=>{let E=C;(i[C]||[]).forEach(b=>{let g=E,
|
|
160
|
-
`;d.forEach(E=>{C+=E}),e.fail(C)}};let D={};o.conflicts=function(c,d){x("<string|object> [array|string]",[c,d],arguments.length),typeof c=="object"?Object.keys(c).forEach(C=>{o.conflicts(C,c[C])}):(n.global(c),D[c]||(D[c]=[]),Array.isArray(d)?d.forEach(C=>o.conflicts(c,C)):D[c].push(d))},o.getConflicting=()=>D,o.conflicting=function(c){Object.keys(c).forEach(d=>{D[d]&&D[d].forEach(C=>{C&&c[d]!==void 0&&c[C]!==void 0&&e.fail(s("Arguments %s and %s are mutually exclusive",d,C))})}),n.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(D).forEach(d=>{D[d].forEach(C=>{C&&c[t.Parser.camelCase(d)]!==void 0&&c[t.Parser.camelCase(C)]!==void 0&&e.fail(s("Arguments %s and %s are mutually exclusive",d,C))})})},o.recommendCommands=function(c,d){d=d.sort((g,O)=>O.length-g.length);let E=null,b=1/0;for(let g=0,O;(O=d[g])!==void 0;g++){let R=Ao(c,O);R<=3&&R<b&&(b=R,E=O)}E&&e.fail(s("Did you mean %s?",E))},o.reset=function(c){return i=Qe(i,d=>!c[d]),D=Qe(D,d=>!c[d]),o};let h=[];return o.freeze=function(){h.push({implied:i,conflicting:D})},o.unfreeze=function(){let c=h.pop();Fe(c,void 0,t),{implied:i,conflicting:D}=c},o}var ks=[],Ht;function On(n,e,t,s){Ht=s;let r={};if(Object.prototype.hasOwnProperty.call(n,"extends")){if(typeof n.extends!="string")return r;let o=/\.json|\..*rc$/.test(n.extends),i=null;if(o)i=rc(e,n.extends);else try{i=require.resolve(n.extends)}catch{return n}ic(i),ks.push(i),r=o?JSON.parse(Ht.readFileSync(i,"utf8")):require(n.extends),delete n.extends,r=On(r,Ht.path.dirname(i),t,Ht)}return ks=[],t?vo(r,n):Object.assign({},r,n)}function ic(n){if(ks.indexOf(n)>-1)throw new Y(`Circular extended configurations: '${n}'.`)}function rc(n,e){return Ht.path.resolve(n,e)}function vo(n,e){let t={};function s(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(t,n);for(let r of Object.keys(e))s(e[r])&&s(t[r])?t[r]=vo(n[r],e[r]):t[r]=e[r];return t}var v=function(n,e,t,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},u=function(n,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(n):s?s.value:e.get(n)},ae,lt,Vt,_e,we,_n,Xe,Dt,jn,je,Sn,Se,Ne,Ae,Ie,In,Mt,fe,S,Pn,Mn,$e,ht,Tt,ft,et,Tn,T,pt,dt,mt,W,Wn,ke,re;function Go(n){return(e=[],t=n.process.cwd(),s)=>{let r=new Qs(e,t,s,n);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Bo=Symbol("copyDoubleDash"),Oo=Symbol("copyDoubleDash"),Ls=Symbol("deleteFromParserHintObject"),_o=Symbol("emitWarning"),jo=Symbol("freeze"),So=Symbol("getDollarZero"),gt=Symbol("getParserConfiguration"),Io=Symbol("getUsageConfiguration"),zs=Symbol("guessLocale"),Po=Symbol("guessVersion"),Mo=Symbol("parsePositionalNumbers"),qs=Symbol("pkgUp"),tt=Symbol("populateParserHintArray"),Wt=Symbol("populateParserHintSingleValueDictionary"),Us=Symbol("populateParserHintArrayDictionary"),Hs=Symbol("populateParserHintDictionary"),Vs=Symbol("sanitizeKey"),Gs=Symbol("setKey"),Ys=Symbol("unfreeze"),To=Symbol("validateAsync"),Wo=Symbol("getCommandInstance"),Ro=Symbol("getContext"),No=Symbol("getHasOutput"),ko=Symbol("getLoggerInstance"),Lo=Symbol("getParseContext"),zo=Symbol("getUsageInstance"),qo=Symbol("getValidationInstance"),Rn=Symbol("hasParseCallback"),Uo=Symbol("isGlobalContext"),Ct=Symbol("postProcess"),Ho=Symbol("rebase"),Js=Symbol("reset"),Gt=Symbol("runYargsParserAndExecuteCommands"),Ks=Symbol("runValidation"),Vo=Symbol("setHasOutput"),Ft=Symbol("kTrackManuallySetKeys"),Qs=class{constructor(e=[],t,s,r){this.customScriptName=!1,this.parsed=!1,ae.set(this,void 0),lt.set(this,void 0),Vt.set(this,{commands:[],fullCommands:[]}),_e.set(this,null),we.set(this,null),_n.set(this,"show-hidden"),Xe.set(this,null),Dt.set(this,!0),jn.set(this,{}),je.set(this,!0),Sn.set(this,[]),Se.set(this,void 0),Ne.set(this,{}),Ae.set(this,!1),Ie.set(this,null),In.set(this,!0),Mt.set(this,void 0),fe.set(this,""),S.set(this,void 0),Pn.set(this,void 0),Mn.set(this,{}),$e.set(this,null),ht.set(this,null),Tt.set(this,{}),ft.set(this,{}),et.set(this,void 0),Tn.set(this,!1),T.set(this,void 0),pt.set(this,!1),dt.set(this,!1),mt.set(this,!1),W.set(this,void 0),Wn.set(this,{}),ke.set(this,null),re.set(this,void 0),v(this,T,r,"f"),v(this,et,e,"f"),v(this,lt,t,"f"),v(this,Pn,s,"f"),v(this,Se,new xn(this),"f"),this.$0=this[So](),this[Js](),v(this,ae,u(this,ae,"f"),"f"),v(this,W,u(this,W,"f"),"f"),v(this,re,u(this,re,"f"),"f"),v(this,S,u(this,S,"f"),"f"),u(this,S,"f").showHiddenOpt=u(this,_n,"f"),v(this,Mt,this[Oo](),"f")}addHelpOpt(e,t){let s="help";return x("[string|boolean] [string]",[e,t],arguments.length),u(this,Ie,"f")&&(this[Ls](u(this,Ie,"f")),v(this,Ie,null,"f")),e===!1&&t===void 0?this:(v(this,Ie,typeof e=="string"?e:s,"f"),this.boolean(u(this,Ie,"f")),this.describe(u(this,Ie,"f"),t||u(this,W,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(x("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let s=typeof e=="string"?e:u(this,_n,"f");return this.boolean(s),this.describe(s,t||u(this,W,"f").deferY18nLookup("Show hidden options")),u(this,S,"f").showHiddenOpt=s,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return x("<object|string|array> [string|array]",[e,t],arguments.length),this[Us](this.alias.bind(this),"alias",e,t),this}array(e){return x("<array|string>",[e],arguments.length),this[tt]("array",e),this[Ft](e),this}boolean(e){return x("<array|string>",[e],arguments.length),this[tt]("boolean",e),this[Ft](e),this}check(e,t){return x("<function> [boolean]",[e,t],arguments.length),this.middleware((s,r)=>ct(()=>e(s,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&u(this,W,"f").fail(o.toString(),o):u(this,W,"f").fail(u(this,T,"f").y18n.__("Argument check failed: %s",e.toString())),s),o=>(u(this,W,"f").fail(o.message?o.message:o.toString(),o),s)),!1,t),this}choices(e,t){return x("<object|string|array> [string|array]",[e,t],arguments.length),this[Us](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(x("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new Y("coerce callback must be provided");for(let s of e)this.coerce(s,t);return this}else if(typeof e=="object"){for(let s of Object.keys(e))this.coerce(s,e[s]);return this}if(!t)throw new Y("coerce callback must be provided");return u(this,S,"f").key[e]=!0,u(this,Se,"f").addCoerceMiddleware((s,r)=>{let o;return Object.prototype.hasOwnProperty.call(s,e)?ct(()=>(o=r.getAliases(),t(s[e])),a=>{s[e]=a;let D=r.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&D!==!0)for(let h of o[e])s[h]=a;return s},a=>{throw new Y(a.message)}):s},e),this}conflicts(e,t){return x("<string|object> [string|array]",[e,t],arguments.length),u(this,re,"f").conflicts(e,t),this}config(e="config",t,s){return x("[object|string] [string|function] [function]",[e,t,s],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=On(e,u(this,lt,"f"),this[gt]()["deep-merge-config"]||!1,u(this,T,"f")),u(this,S,"f").configObjects=(u(this,S,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(s=t,t=void 0),this.describe(e,t||u(this,W,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(r=>{u(this,S,"f").config[r]=s||!0}),this)}completion(e,t,s){return x("[string] [string|boolean|function] [function]",[e,t,s],arguments.length),typeof t=="function"&&(s=t,t=void 0),v(this,we,e||u(this,we,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion script"),this.command(u(this,we,"f"),t),s&&u(this,_e,"f").registerFunction(s),this}command(e,t,s,r,o,i){return x("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,s,r,o,i],arguments.length),u(this,ae,"f").addHandler(e,t,s,r,o,i),this}commands(e,t,s,r,o,i){return this.command(e,t,s,r,o,i)}commandDir(e,t){x("<string> [object]",[e,t],arguments.length);let s=u(this,Pn,"f")||u(this,T,"f").require;return u(this,ae,"f").addDirectory(e,s,u(this,T,"f").getCallerFile(),t),this}count(e){return x("<array|string>",[e],arguments.length),this[tt]("count",e),this[Ft](e),this}default(e,t,s){return x("<object|string|array> [*] [string]",[e,t,s],arguments.length),s&&(Ms(e,u(this,T,"f")),u(this,S,"f").defaultDescription[e]=s),typeof t=="function"&&(Ms(e,u(this,T,"f")),u(this,S,"f").defaultDescription[e]||(u(this,S,"f").defaultDescription[e]=u(this,W,"f").functionDescription(t)),t=t.call()),this[Wt](this.default.bind(this),"default",e,t),this}defaults(e,t,s){return this.default(e,t,s)}demandCommand(e=1,t,s,r){return x("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,s,r],arguments.length),typeof t!="number"&&(s=t,t=1/0),this.global("_",!1),u(this,S,"f").demandedCommands._={min:e,max:t,minMsg:s,maxMsg:r},this}demand(e,t,s){return Array.isArray(t)?(t.forEach(r=>{Fe(s,!0,u(this,T,"f")),this.demandOption(r,s)}),t=1/0):typeof t!="number"&&(s=t,t=1/0),typeof e=="number"?(Fe(s,!0,u(this,T,"f")),this.demandCommand(e,t,s,s)):Array.isArray(e)?e.forEach(r=>{Fe(s,!0,u(this,T,"f")),this.demandOption(r,s)}):typeof s=="string"?this.demandOption(e,s):(s===!0||typeof s>"u")&&this.demandOption(e),this}demandOption(e,t){return x("<object|string|array> [string]",[e,t],arguments.length),this[Wt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return x("<string> [string|boolean]",[e,t],arguments.length),u(this,S,"f").deprecatedOptions[e]=t,this}describe(e,t){return x("<object|string|array> [string]",[e,t],arguments.length),this[Gs](e,!0),u(this,W,"f").describe(e,t),this}detectLocale(e){return x("<boolean>",[e],arguments.length),v(this,Dt,e,"f"),this}env(e){return x("[string|boolean]",[e],arguments.length),e===!1?delete u(this,S,"f").envPrefix:u(this,S,"f").envPrefix=e||"",this}epilogue(e){return x("<string>",[e],arguments.length),u(this,W,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return x("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(s=>this.example(...s)):u(this,W,"f").example(e,t),this}exit(e,t){v(this,Ae,!0,"f"),v(this,Xe,t,"f"),u(this,je,"f")&&u(this,T,"f").process.exit(e)}exitProcess(e=!0){return x("[boolean]",[e],arguments.length),v(this,je,e,"f"),this}fail(e){if(x("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Y("Invalid first argument. Expected function or boolean 'false'");return u(this,W,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return x("<array> [function]",[e,t],arguments.length),t?u(this,_e,"f").getCompletion(e,t):new Promise((s,r)=>{u(this,_e,"f").getCompletion(e,(o,i)=>{o?r(o):s(i)})})}getDemandedOptions(){return x([],0),u(this,S,"f").demandedOptions}getDemandedCommands(){return x([],0),u(this,S,"f").demandedCommands}getDeprecatedOptions(){return x([],0),u(this,S,"f").deprecatedOptions}getDetectLocale(){return u(this,Dt,"f")}getExitProcess(){return u(this,je,"f")}getGroups(){return Object.assign({},u(this,Ne,"f"),u(this,ft,"f"))}getHelp(){if(v(this,Ae,!0,"f"),!u(this,W,"f").hasCachedHelpMessage()){if(!this.parsed){let t=this[Gt](u(this,et,"f"),void 0,void 0,0,!0);if(J(t))return t.then(()=>u(this,W,"f").help())}let e=u(this,ae,"f").runDefaultBuilderOn(this);if(J(e))return e.then(()=>u(this,W,"f").help())}return Promise.resolve(u(this,W,"f").help())}getOptions(){return u(this,S,"f")}getStrict(){return u(this,pt,"f")}getStrictCommands(){return u(this,dt,"f")}getStrictOptions(){return u(this,mt,"f")}global(e,t){return x("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?u(this,S,"f").local=u(this,S,"f").local.filter(s=>e.indexOf(s)===-1):e.forEach(s=>{u(this,S,"f").local.includes(s)||u(this,S,"f").local.push(s)}),this}group(e,t){x("<string|array> <string>",[e,t],arguments.length);let s=u(this,ft,"f")[t]||u(this,Ne,"f")[t];u(this,ft,"f")[t]&&delete u(this,ft,"f")[t];let r={};return u(this,Ne,"f")[t]=(s||[]).concat(e).filter(o=>r[o]?!1:r[o]=!0),this}hide(e){return x("<string>",[e],arguments.length),u(this,S,"f").hiddenOptions.push(e),this}implies(e,t){return x("<string|object> [number|string|array]",[e,t],arguments.length),u(this,re,"f").implies(e,t),this}locale(e){return x("[string]",[e],arguments.length),e===void 0?(this[zs](),u(this,T,"f").y18n.getLocale()):(v(this,Dt,!1,"f"),u(this,T,"f").y18n.setLocale(e),this)}middleware(e,t,s){return u(this,Se,"f").addMiddleware(e,!!t,s)}nargs(e,t){return x("<string|object|array> [number]",[e,t],arguments.length),this[Wt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return x("<array|string>",[e],arguments.length),this[tt]("normalize",e),this}number(e){return x("<array|string>",[e],arguments.length),this[tt]("number",e),this[Ft](e),this}option(e,t){if(x("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(s=>{this.options(s,e[s])});else{typeof t!="object"&&(t={}),this[Ft](e),u(this,ke,"f")&&(e==="version"||(t==null?void 0:t.alias)==="version")&&this[_o](['"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(`
|
|
161
|
-
`),void 0,"versionWarning"),u(this,S,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);let s=t.deprecate||t.deprecated;s&&this.deprecateOption(e,s);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&&(u(this,S,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let o=t.describe||t.description||t.desc,i=u(this,
|
|
158
|
+
`)}`:"";e.fail(r("Missing required argument: %s","Missing required arguments: %s",Object.keys(C).length,Object.keys(C).join(", ")+b))}},o.unknownArguments=function(c,d,C,E,b=!0){var g;let B=n.getInternalMethods().getCommandInstance().getCommands(),W=[],U=n.getInternalMethods().getContext();if(Object.keys(c).forEach(L=>{!$o.includes(L)&&!Object.prototype.hasOwnProperty.call(C,L)&&!Object.prototype.hasOwnProperty.call(n.getInternalMethods().getParseContext(),L)&&!o.isValidAndSomeAliasIsNotNew(L,d)&&W.push(L)}),b&&(U.commands.length>0||B.length>0||E)&&c._.slice(U.commands.length).forEach(L=>{B.includes(""+L)||W.push(""+L)}),b){let H=((g=n.getDemandedCommands()._)===null||g===void 0?void 0:g.max)||0,He=U.commands.length+H;He<c._.length&&c._.slice(He).forEach(Pe=>{Pe=String(Pe),!U.commands.includes(Pe)&&!W.includes(Pe)&&W.push(Pe)})}W.length&&e.fail(r("Unknown argument: %s","Unknown arguments: %s",W.length,W.map(L=>L.trim()?L:`"${L}"`).join(", ")))},o.unknownCommands=function(c){let d=n.getInternalMethods().getCommandInstance().getCommands(),C=[],E=n.getInternalMethods().getContext();return(E.commands.length>0||d.length>0)&&c._.slice(E.commands.length).forEach(b=>{d.includes(""+b)||C.push(""+b)}),C.length>0?(e.fail(r("Unknown command: %s","Unknown commands: %s",C.length,C.join(", "))),!0):!1},o.isValidAndSomeAliasIsNotNew=function(c,d){if(!Object.prototype.hasOwnProperty.call(d,c))return!1;let C=n.parsed.newAliases;return[c,...d[c]].some(E=>!Object.prototype.hasOwnProperty.call(C,E)||!C[c])},o.limitedChoices=function(c){let d=n.getOptions(),C={};if(!Object.keys(d.choices).length)return;Object.keys(c).forEach(g=>{$o.indexOf(g)===-1&&Object.prototype.hasOwnProperty.call(d.choices,g)&&[].concat(c[g]).forEach(B=>{d.choices[g].indexOf(B)===-1&&B!==void 0&&(C[g]=(C[g]||[]).concat(B))})});let E=Object.keys(C);if(!E.length)return;let b=s("Invalid values:");E.forEach(g=>{b+=`
|
|
159
|
+
${s("Argument: %s, Given: %s, Choices: %s",g,e.stringifiedValues(C[g]),e.stringifiedValues(d.choices[g]))}`}),e.fail(b)};let i={};o.implies=function(c,d){x("<string|object> [array|number|string]",[c,d],arguments.length),typeof c=="object"?Object.keys(c).forEach(C=>{o.implies(C,c[C])}):(n.global(c),i[c]||(i[c]=[]),Array.isArray(d)?d.forEach(C=>o.implies(c,C)):(Fe(d,void 0,t),i[c].push(d)))},o.getImplied=function(){return i};function a(f,c){let d=Number(c);return c=isNaN(d)?c:d,typeof c=="number"?c=f._.length>=c:c.match(/^--no-.+/)?(c=c.match(/^--no-(.+)/)[1],c=!Object.prototype.hasOwnProperty.call(f,c)):c=Object.prototype.hasOwnProperty.call(f,c),c}o.implications=function(c){let d=[];if(Object.keys(i).forEach(C=>{let E=C;(i[C]||[]).forEach(b=>{let g=E,B=b;g=a(c,g),b=a(c,b),g&&!b&&d.push(` ${E} -> ${B}`)})}),d.length){let C=`${s("Implications failed:")}
|
|
160
|
+
`;d.forEach(E=>{C+=E}),e.fail(C)}};let D={};o.conflicts=function(c,d){x("<string|object> [array|string]",[c,d],arguments.length),typeof c=="object"?Object.keys(c).forEach(C=>{o.conflicts(C,c[C])}):(n.global(c),D[c]||(D[c]=[]),Array.isArray(d)?d.forEach(C=>o.conflicts(c,C)):D[c].push(d))},o.getConflicting=()=>D,o.conflicting=function(c){Object.keys(c).forEach(d=>{D[d]&&D[d].forEach(C=>{C&&c[d]!==void 0&&c[C]!==void 0&&e.fail(s("Arguments %s and %s are mutually exclusive",d,C))})}),n.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(D).forEach(d=>{D[d].forEach(C=>{C&&c[t.Parser.camelCase(d)]!==void 0&&c[t.Parser.camelCase(C)]!==void 0&&e.fail(s("Arguments %s and %s are mutually exclusive",d,C))})})},o.recommendCommands=function(c,d){d=d.sort((g,B)=>B.length-g.length);let E=null,b=1/0;for(let g=0,B;(B=d[g])!==void 0;g++){let W=Ao(c,B);W<=3&&W<b&&(b=W,E=B)}E&&e.fail(s("Did you mean %s?",E))},o.reset=function(c){return i=Qe(i,d=>!c[d]),D=Qe(D,d=>!c[d]),o};let h=[];return o.freeze=function(){h.push({implied:i,conflicting:D})},o.unfreeze=function(){let c=h.pop();Fe(c,void 0,t),{implied:i,conflicting:D}=c},o}var ks=[],Ht;function On(n,e,t,s){Ht=s;let r={};if(Object.prototype.hasOwnProperty.call(n,"extends")){if(typeof n.extends!="string")return r;let o=/\.json|\..*rc$/.test(n.extends),i=null;if(o)i=rc(e,n.extends);else try{i=require.resolve(n.extends)}catch{return n}ic(i),ks.push(i),r=o?JSON.parse(Ht.readFileSync(i,"utf8")):require(n.extends),delete n.extends,r=On(r,Ht.path.dirname(i),t,Ht)}return ks=[],t?vo(r,n):Object.assign({},r,n)}function ic(n){if(ks.indexOf(n)>-1)throw new Y(`Circular extended configurations: '${n}'.`)}function rc(n,e){return Ht.path.resolve(n,e)}function vo(n,e){let t={};function s(r){return r&&typeof r=="object"&&!Array.isArray(r)}Object.assign(t,n);for(let r of Object.keys(e))s(e[r])&&s(t[r])?t[r]=vo(n[r],e[r]):t[r]=e[r];return t}var v=function(n,e,t,s,r){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?r.call(n,t):r?r.value=t:e.set(n,t),t},u=function(n,e,t,s){if(t==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!s:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?s:t==="a"?s.call(n):s?s.value:e.get(n)},ae,lt,Vt,_e,we,_n,Xe,Dt,jn,je,Sn,Se,Ne,Ae,Ie,In,Mt,fe,S,Pn,Mn,$e,ht,Tt,ft,et,Tn,T,pt,dt,mt,R,Wn,ke,re;function Go(n){return(e=[],t=n.process.cwd(),s)=>{let r=new Qs(e,t,s,n);return Object.defineProperty(r,"argv",{get:()=>r.parse(),enumerable:!0}),r.help(),r.version(),r}}var Bo=Symbol("copyDoubleDash"),Oo=Symbol("copyDoubleDash"),Ls=Symbol("deleteFromParserHintObject"),_o=Symbol("emitWarning"),jo=Symbol("freeze"),So=Symbol("getDollarZero"),gt=Symbol("getParserConfiguration"),Io=Symbol("getUsageConfiguration"),zs=Symbol("guessLocale"),Po=Symbol("guessVersion"),Mo=Symbol("parsePositionalNumbers"),qs=Symbol("pkgUp"),tt=Symbol("populateParserHintArray"),Wt=Symbol("populateParserHintSingleValueDictionary"),Us=Symbol("populateParserHintArrayDictionary"),Hs=Symbol("populateParserHintDictionary"),Vs=Symbol("sanitizeKey"),Gs=Symbol("setKey"),Ys=Symbol("unfreeze"),To=Symbol("validateAsync"),Wo=Symbol("getCommandInstance"),Ro=Symbol("getContext"),No=Symbol("getHasOutput"),ko=Symbol("getLoggerInstance"),Lo=Symbol("getParseContext"),zo=Symbol("getUsageInstance"),qo=Symbol("getValidationInstance"),Rn=Symbol("hasParseCallback"),Uo=Symbol("isGlobalContext"),Ct=Symbol("postProcess"),Ho=Symbol("rebase"),Js=Symbol("reset"),Gt=Symbol("runYargsParserAndExecuteCommands"),Ks=Symbol("runValidation"),Vo=Symbol("setHasOutput"),Ft=Symbol("kTrackManuallySetKeys"),Qs=class{constructor(e=[],t,s,r){this.customScriptName=!1,this.parsed=!1,ae.set(this,void 0),lt.set(this,void 0),Vt.set(this,{commands:[],fullCommands:[]}),_e.set(this,null),we.set(this,null),_n.set(this,"show-hidden"),Xe.set(this,null),Dt.set(this,!0),jn.set(this,{}),je.set(this,!0),Sn.set(this,[]),Se.set(this,void 0),Ne.set(this,{}),Ae.set(this,!1),Ie.set(this,null),In.set(this,!0),Mt.set(this,void 0),fe.set(this,""),S.set(this,void 0),Pn.set(this,void 0),Mn.set(this,{}),$e.set(this,null),ht.set(this,null),Tt.set(this,{}),ft.set(this,{}),et.set(this,void 0),Tn.set(this,!1),T.set(this,void 0),pt.set(this,!1),dt.set(this,!1),mt.set(this,!1),R.set(this,void 0),Wn.set(this,{}),ke.set(this,null),re.set(this,void 0),v(this,T,r,"f"),v(this,et,e,"f"),v(this,lt,t,"f"),v(this,Pn,s,"f"),v(this,Se,new xn(this),"f"),this.$0=this[So](),this[Js](),v(this,ae,u(this,ae,"f"),"f"),v(this,R,u(this,R,"f"),"f"),v(this,re,u(this,re,"f"),"f"),v(this,S,u(this,S,"f"),"f"),u(this,S,"f").showHiddenOpt=u(this,_n,"f"),v(this,Mt,this[Oo](),"f")}addHelpOpt(e,t){let s="help";return x("[string|boolean] [string]",[e,t],arguments.length),u(this,Ie,"f")&&(this[Ls](u(this,Ie,"f")),v(this,Ie,null,"f")),e===!1&&t===void 0?this:(v(this,Ie,typeof e=="string"?e:s,"f"),this.boolean(u(this,Ie,"f")),this.describe(u(this,Ie,"f"),t||u(this,R,"f").deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(x("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let s=typeof e=="string"?e:u(this,_n,"f");return this.boolean(s),this.describe(s,t||u(this,R,"f").deferY18nLookup("Show hidden options")),u(this,S,"f").showHiddenOpt=s,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return x("<object|string|array> [string|array]",[e,t],arguments.length),this[Us](this.alias.bind(this),"alias",e,t),this}array(e){return x("<array|string>",[e],arguments.length),this[tt]("array",e),this[Ft](e),this}boolean(e){return x("<array|string>",[e],arguments.length),this[tt]("boolean",e),this[Ft](e),this}check(e,t){return x("<function> [boolean]",[e,t],arguments.length),this.middleware((s,r)=>ct(()=>e(s,r.getOptions()),o=>(o?(typeof o=="string"||o instanceof Error)&&u(this,R,"f").fail(o.toString(),o):u(this,R,"f").fail(u(this,T,"f").y18n.__("Argument check failed: %s",e.toString())),s),o=>(u(this,R,"f").fail(o.message?o.message:o.toString(),o),s)),!1,t),this}choices(e,t){return x("<object|string|array> [string|array]",[e,t],arguments.length),this[Us](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(x("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new Y("coerce callback must be provided");for(let s of e)this.coerce(s,t);return this}else if(typeof e=="object"){for(let s of Object.keys(e))this.coerce(s,e[s]);return this}if(!t)throw new Y("coerce callback must be provided");return u(this,S,"f").key[e]=!0,u(this,Se,"f").addCoerceMiddleware((s,r)=>{let o;return Object.prototype.hasOwnProperty.call(s,e)?ct(()=>(o=r.getAliases(),t(s[e])),a=>{s[e]=a;let D=r.getInternalMethods().getParserConfiguration()["strip-aliased"];if(o[e]&&D!==!0)for(let h of o[e])s[h]=a;return s},a=>{throw new Y(a.message)}):s},e),this}conflicts(e,t){return x("<string|object> [string|array]",[e,t],arguments.length),u(this,re,"f").conflicts(e,t),this}config(e="config",t,s){return x("[object|string] [string|function] [function]",[e,t,s],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=On(e,u(this,lt,"f"),this[gt]()["deep-merge-config"]||!1,u(this,T,"f")),u(this,S,"f").configObjects=(u(this,S,"f").configObjects||[]).concat(e),this):(typeof t=="function"&&(s=t,t=void 0),this.describe(e,t||u(this,R,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(r=>{u(this,S,"f").config[r]=s||!0}),this)}completion(e,t,s){return x("[string] [string|boolean|function] [function]",[e,t,s],arguments.length),typeof t=="function"&&(s=t,t=void 0),v(this,we,e||u(this,we,"f")||"completion","f"),!t&&t!==!1&&(t="generate completion script"),this.command(u(this,we,"f"),t),s&&u(this,_e,"f").registerFunction(s),this}command(e,t,s,r,o,i){return x("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,s,r,o,i],arguments.length),u(this,ae,"f").addHandler(e,t,s,r,o,i),this}commands(e,t,s,r,o,i){return this.command(e,t,s,r,o,i)}commandDir(e,t){x("<string> [object]",[e,t],arguments.length);let s=u(this,Pn,"f")||u(this,T,"f").require;return u(this,ae,"f").addDirectory(e,s,u(this,T,"f").getCallerFile(),t),this}count(e){return x("<array|string>",[e],arguments.length),this[tt]("count",e),this[Ft](e),this}default(e,t,s){return x("<object|string|array> [*] [string]",[e,t,s],arguments.length),s&&(Ms(e,u(this,T,"f")),u(this,S,"f").defaultDescription[e]=s),typeof t=="function"&&(Ms(e,u(this,T,"f")),u(this,S,"f").defaultDescription[e]||(u(this,S,"f").defaultDescription[e]=u(this,R,"f").functionDescription(t)),t=t.call()),this[Wt](this.default.bind(this),"default",e,t),this}defaults(e,t,s){return this.default(e,t,s)}demandCommand(e=1,t,s,r){return x("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,s,r],arguments.length),typeof t!="number"&&(s=t,t=1/0),this.global("_",!1),u(this,S,"f").demandedCommands._={min:e,max:t,minMsg:s,maxMsg:r},this}demand(e,t,s){return Array.isArray(t)?(t.forEach(r=>{Fe(s,!0,u(this,T,"f")),this.demandOption(r,s)}),t=1/0):typeof t!="number"&&(s=t,t=1/0),typeof e=="number"?(Fe(s,!0,u(this,T,"f")),this.demandCommand(e,t,s,s)):Array.isArray(e)?e.forEach(r=>{Fe(s,!0,u(this,T,"f")),this.demandOption(r,s)}):typeof s=="string"?this.demandOption(e,s):(s===!0||typeof s>"u")&&this.demandOption(e),this}demandOption(e,t){return x("<object|string|array> [string]",[e,t],arguments.length),this[Wt](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return x("<string> [string|boolean]",[e,t],arguments.length),u(this,S,"f").deprecatedOptions[e]=t,this}describe(e,t){return x("<object|string|array> [string]",[e,t],arguments.length),this[Gs](e,!0),u(this,R,"f").describe(e,t),this}detectLocale(e){return x("<boolean>",[e],arguments.length),v(this,Dt,e,"f"),this}env(e){return x("[string|boolean]",[e],arguments.length),e===!1?delete u(this,S,"f").envPrefix:u(this,S,"f").envPrefix=e||"",this}epilogue(e){return x("<string>",[e],arguments.length),u(this,R,"f").epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return x("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(s=>this.example(...s)):u(this,R,"f").example(e,t),this}exit(e,t){v(this,Ae,!0,"f"),v(this,Xe,t,"f"),u(this,je,"f")&&u(this,T,"f").process.exit(e)}exitProcess(e=!0){return x("[boolean]",[e],arguments.length),v(this,je,e,"f"),this}fail(e){if(x("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new Y("Invalid first argument. Expected function or boolean 'false'");return u(this,R,"f").failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return x("<array> [function]",[e,t],arguments.length),t?u(this,_e,"f").getCompletion(e,t):new Promise((s,r)=>{u(this,_e,"f").getCompletion(e,(o,i)=>{o?r(o):s(i)})})}getDemandedOptions(){return x([],0),u(this,S,"f").demandedOptions}getDemandedCommands(){return x([],0),u(this,S,"f").demandedCommands}getDeprecatedOptions(){return x([],0),u(this,S,"f").deprecatedOptions}getDetectLocale(){return u(this,Dt,"f")}getExitProcess(){return u(this,je,"f")}getGroups(){return Object.assign({},u(this,Ne,"f"),u(this,ft,"f"))}getHelp(){if(v(this,Ae,!0,"f"),!u(this,R,"f").hasCachedHelpMessage()){if(!this.parsed){let t=this[Gt](u(this,et,"f"),void 0,void 0,0,!0);if(J(t))return t.then(()=>u(this,R,"f").help())}let e=u(this,ae,"f").runDefaultBuilderOn(this);if(J(e))return e.then(()=>u(this,R,"f").help())}return Promise.resolve(u(this,R,"f").help())}getOptions(){return u(this,S,"f")}getStrict(){return u(this,pt,"f")}getStrictCommands(){return u(this,dt,"f")}getStrictOptions(){return u(this,mt,"f")}global(e,t){return x("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?u(this,S,"f").local=u(this,S,"f").local.filter(s=>e.indexOf(s)===-1):e.forEach(s=>{u(this,S,"f").local.includes(s)||u(this,S,"f").local.push(s)}),this}group(e,t){x("<string|array> <string>",[e,t],arguments.length);let s=u(this,ft,"f")[t]||u(this,Ne,"f")[t];u(this,ft,"f")[t]&&delete u(this,ft,"f")[t];let r={};return u(this,Ne,"f")[t]=(s||[]).concat(e).filter(o=>r[o]?!1:r[o]=!0),this}hide(e){return x("<string>",[e],arguments.length),u(this,S,"f").hiddenOptions.push(e),this}implies(e,t){return x("<string|object> [number|string|array]",[e,t],arguments.length),u(this,re,"f").implies(e,t),this}locale(e){return x("[string]",[e],arguments.length),e===void 0?(this[zs](),u(this,T,"f").y18n.getLocale()):(v(this,Dt,!1,"f"),u(this,T,"f").y18n.setLocale(e),this)}middleware(e,t,s){return u(this,Se,"f").addMiddleware(e,!!t,s)}nargs(e,t){return x("<string|object|array> [number]",[e,t],arguments.length),this[Wt](this.nargs.bind(this),"narg",e,t),this}normalize(e){return x("<array|string>",[e],arguments.length),this[tt]("normalize",e),this}number(e){return x("<array|string>",[e],arguments.length),this[tt]("number",e),this[Ft](e),this}option(e,t){if(x("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(s=>{this.options(s,e[s])});else{typeof t!="object"&&(t={}),this[Ft](e),u(this,ke,"f")&&(e==="version"||(t==null?void 0:t.alias)==="version")&&this[_o](['"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(`
|
|
161
|
+
`),void 0,"versionWarning"),u(this,S,"f").key[e]=!0,t.alias&&this.alias(e,t.alias);let s=t.deprecate||t.deprecated;s&&this.deprecateOption(e,s);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&&(u(this,S,"f").defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let o=t.describe||t.description||t.desc,i=u(this,R,"f").getDescriptions();(!Object.prototype.hasOwnProperty.call(i,e)||typeof o=="string")&&this.describe(e,o),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,s){x("[string|array] [function|boolean|object] [function]",[e,t,s],arguments.length),this[jo](),typeof e>"u"&&(e=u(this,et,"f")),typeof t=="object"&&(v(this,ht,t,"f"),t=s),typeof t=="function"&&(v(this,$e,t,"f"),t=!1),t||v(this,et,e,"f"),u(this,$e,"f")&&v(this,je,!1,"f");let r=this[Gt](e,!!t),o=this.parsed;return u(this,_e,"f").setParsed(this.parsed),J(r)?r.then(i=>(u(this,$e,"f")&&u(this,$e,"f").call(this,u(this,Xe,"f"),i,u(this,fe,"f")),i)).catch(i=>{throw u(this,$e,"f")&&u(this,$e,"f")(i,this.parsed.argv,u(this,fe,"f")),i}).finally(()=>{this[Ys](),this.parsed=o}):(u(this,$e,"f")&&u(this,$e,"f").call(this,u(this,Xe,"f"),r,u(this,fe,"f")),this[Ys](),this.parsed=o,r)}parseAsync(e,t,s){let r=this.parse(e,t,s);return J(r)?r:Promise.resolve(r)}parseSync(e,t,s){let r=this.parse(e,t,s);if(J(r))throw new Y(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return r}parserConfiguration(e){return x("<object>",[e],arguments.length),v(this,Mn,e,"f"),this}pkgConf(e,t){x("<string> [string]",[e,t],arguments.length);let s=null,r=this[qs](t||u(this,lt,"f"));return r[e]&&typeof r[e]=="object"&&(s=On(r[e],t||u(this,lt,"f"),this[gt]()["deep-merge-config"]||!1,u(this,T,"f")),u(this,S,"f").configObjects=(u(this,S,"f").configObjects||[]).concat(s)),this}positional(e,t){x("<string> <object>",[e,t],arguments.length);let s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=Qe(t,(i,a)=>i==="type"&&!["string","number","boolean"].includes(a)?!1:s.includes(i));let r=u(this,Vt,"f").fullCommands[u(this,Vt,"f").fullCommands.length-1],o=r?u(this,ae,"f").cmdToParseOptions(r):{array:[],alias:{},default:{},demand:{}};return It(o).forEach(i=>{let a=o[i];Array.isArray(a)?a.indexOf(e)!==-1&&(t[i]=!0):a[e]&&!(i in t)&&(t[i]=a[e])}),this.group(e,u(this,R,"f").getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return x("[boolean]",[e],arguments.length),v(this,Tn,e,"f"),this}required(e,t,s){return this.demand(e,t,s)}require(e,t,s){return this.demand(e,t,s)}requiresArg(e){return x("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&u(this,S,"f").narg[e]?this:(this[Wt](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return x("[string] [string]",[e,t],arguments.length),e=e||this.$0,u(this,Mt,"f").log(u(this,_e,"f").generateCompletionScript(e,t||u(this,we,"f")||"completion")),this}showHelp(e){if(x("[string|function]",[e],arguments.length),v(this,Ae,!0,"f"),!u(this,R,"f").hasCachedHelpMessage()){if(!this.parsed){let s=this[Gt](u(this,et,"f"),void 0,void 0,0,!0);if(J(s))return s.then(()=>{u(this,R,"f").showHelp(e)}),this}let t=u(this,ae,"f").runDefaultBuilderOn(this);if(J(t))return t.then(()=>{u(this,R,"f").showHelp(e)}),this}return u(this,R,"f").showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return x("[boolean|string] [string]",[e,t],arguments.length),u(this,R,"f").showHelpOnFail(e,t),this}showVersion(e){return x("[string|function]",[e],arguments.length),u(this,R,"f").showVersion(e),this}skipValidation(e){return x("<array|string>",[e],arguments.length),this[tt]("skipValidation",e),this}strict(e){return x("[boolean]",[e],arguments.length),v(this,pt,e!==!1,"f"),this}strictCommands(e){return x("[boolean]",[e],arguments.length),v(this,dt,e!==!1,"f"),this}strictOptions(e){return x("[boolean]",[e],arguments.length),v(this,mt,e!==!1,"f"),this}string(e){return x("<array|string>",[e],arguments.length),this[tt]("string",e),this[Ft](e),this}terminalWidth(){return x([],0),u(this,T,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return x("<object>",[e],arguments.length),v(this,Dt,!1,"f"),u(this,T,"f").y18n.updateLocale(e),this}usage(e,t,s,r){if(x("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,s,r],arguments.length),t!==void 0){if(Fe(e,null,u(this,T,"f")),(e||"").match(/^\$0( |$)/))return this.command(e,t,s,r);throw new Y(".usage() description must start with $0 if being used as alias for .command()")}else return u(this,R,"f").usage(e),this}usageConfiguration(e){return x("<object>",[e],arguments.length),v(this,Wn,e,"f"),this}version(e,t,s){let r="version";if(x("[boolean|string] [string] [string]",[e,t,s],arguments.length),u(this,ke,"f")&&(this[Ls](u(this,ke,"f")),u(this,R,"f").version(void 0),v(this,ke,null,"f")),arguments.length===0)s=this[Po](),e=r;else if(arguments.length===1){if(e===!1)return this;s=e,e=r}else arguments.length===2&&(s=t,t=void 0);return v(this,ke,typeof e=="string"?e:r,"f"),t=t||u(this,R,"f").deferY18nLookup("Show version number"),u(this,R,"f").version(s||void 0),this.boolean(u(this,ke,"f")),this.describe(u(this,ke,"f"),t),this}wrap(e){return x("<number|null|undefined>",[e],arguments.length),u(this,R,"f").wrap(e),this}[(ae=new WeakMap,lt=new WeakMap,Vt=new WeakMap,_e=new WeakMap,we=new WeakMap,_n=new WeakMap,Xe=new WeakMap,Dt=new WeakMap,jn=new WeakMap,je=new WeakMap,Sn=new WeakMap,Se=new WeakMap,Ne=new WeakMap,Ae=new WeakMap,Ie=new WeakMap,In=new WeakMap,Mt=new WeakMap,fe=new WeakMap,S=new WeakMap,Pn=new WeakMap,Mn=new WeakMap,$e=new WeakMap,ht=new WeakMap,Tt=new WeakMap,ft=new WeakMap,et=new WeakMap,Tn=new WeakMap,T=new WeakMap,pt=new WeakMap,dt=new WeakMap,mt=new WeakMap,R=new WeakMap,Wn=new WeakMap,ke=new WeakMap,re=new WeakMap,Bo)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Oo](){return{log:(...e)=>{this[Rn]()||console.log(...e),v(this,Ae,!0,"f"),u(this,fe,"f").length&&v(this,fe,u(this,fe,"f")+`
|
|
162
162
|
`,"f"),v(this,fe,u(this,fe,"f")+e.join(" "),"f")},error:(...e)=>{this[Rn]()||console.error(...e),v(this,Ae,!0,"f"),u(this,fe,"f").length&&v(this,fe,u(this,fe,"f")+`
|
|
163
|
-
`,"f"),v(this,fe,u(this,fe,"f")+e.join(" "),"f")}}}[Ls](e){It(u(this,S,"f")).forEach(t=>{if((r=>r==="configObjects")(t))return;let s=u(this,S,"f")[t];Array.isArray(s)?s.includes(e)&&s.splice(s.indexOf(e),1):typeof s=="object"&&delete s[e]}),delete u(this,W,"f").getDescriptions()[e]}[_o](e,t,s){u(this,jn,"f")[s]||(u(this,T,"f").process.emitWarning(e,t),u(this,jn,"f")[s]=!0)}[jo](){u(this,Sn,"f").push({options:u(this,S,"f"),configObjects:u(this,S,"f").configObjects.slice(0),exitProcess:u(this,je,"f"),groups:u(this,Ne,"f"),strict:u(this,pt,"f"),strictCommands:u(this,dt,"f"),strictOptions:u(this,mt,"f"),completionCommand:u(this,we,"f"),output:u(this,fe,"f"),exitError:u(this,Xe,"f"),hasOutput:u(this,Ae,"f"),parsed:this.parsed,parseFn:u(this,$e,"f"),parseContext:u(this,ht,"f")}),u(this,W,"f").freeze(),u(this,re,"f").freeze(),u(this,ae,"f").freeze(),u(this,Se,"f").freeze()}[So](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(u(this,T,"f").process.argv()[0])?t=u(this,T,"f").process.argv().slice(1,2):t=u(this,T,"f").process.argv().slice(0,1),e=t.map(s=>{let r=this[Ho](u(this,lt,"f"),s);return s.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<s.length?r:s}).join(" ").trim(),u(this,T,"f").getEnv("_")&&u(this,T,"f").getProcessArgvBin()===u(this,T,"f").getEnv("_")&&(e=u(this,T,"f").getEnv("_").replace(`${u(this,T,"f").path.dirname(u(this,T,"f").process.execPath())}/`,"")),e}[gt](){return u(this,Mn,"f")}[Io](){return u(this,Wn,"f")}[zs](){if(!u(this,Dt,"f"))return;let e=u(this,T,"f").getEnv("LC_ALL")||u(this,T,"f").getEnv("LC_MESSAGES")||u(this,T,"f").getEnv("LANG")||u(this,T,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Po](){return this[qs]().version||"unknown"}[Mo](e){let t=e["--"]?e["--"]:e._;for(let s=0,r;(r=t[s])!==void 0;s++)u(this,T,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(t[s]=Number(r));return e}[qs](e){let t=e||"*";if(u(this,Tt,"f")[t])return u(this,Tt,"f")[t];let s={};try{let r=e||u(this,T,"f").mainFilename;!e&&u(this,T,"f").path.extname(r)&&(r=u(this,T,"f").path.dirname(r));let o=u(this,T,"f").findUp(r,(i,a)=>{if(a.includes("package.json"))return"package.json"});Fe(o,void 0,u(this,T,"f")),s=JSON.parse(u(this,T,"f").readFileSync(o,"utf8"))}catch{}return u(this,Tt,"f")[t]=s||{},u(this,Tt,"f")[t]}[tt](e,t){t=[].concat(t),t.forEach(s=>{s=this[Vs](s),u(this,S,"f")[e].push(s)})}[Wt](e,t,s,r){this[Hs](e,t,s,r,(o,i,a)=>{u(this,S,"f")[o][i]=a})}[Us](e,t,s,r){this[Hs](e,t,s,r,(o,i,a)=>{u(this,S,"f")[o][i]=(u(this,S,"f")[o][i]||[]).concat(a)})}[Hs](e,t,s,r,o){if(Array.isArray(s))s.forEach(i=>{e(i,r)});else if((i=>typeof i=="object")(s))for(let i of It(s))e(i,s[i]);else o(t,this[Vs](s),r)}[Vs](e){return e==="__proto__"?"___proto___":e}[Gs](e,t){return this[Wt](this[Gs].bind(this),"key",e,t),this}[Ys](){var e,t,s,r,o,i,a,D,h,f,c,d;let C=u(this,Sn,"f").pop();Fe(C,void 0,u(this,T,"f"));let E;e=this,t=this,s=this,r=this,o=this,i=this,a=this,D=this,h=this,f=this,c=this,d=this,{options:{set value(b){v(e,S,b,"f")}}.value,configObjects:E,exitProcess:{set value(b){v(t,je,b,"f")}}.value,groups:{set value(b){v(s,Ne,b,"f")}}.value,output:{set value(b){v(r,fe,b,"f")}}.value,exitError:{set value(b){v(o,Xe,b,"f")}}.value,hasOutput:{set value(b){v(i,Ae,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){v(a,pt,b,"f")}}.value,strictCommands:{set value(b){v(D,dt,b,"f")}}.value,strictOptions:{set value(b){v(h,mt,b,"f")}}.value,completionCommand:{set value(b){v(f,we,b,"f")}}.value,parseFn:{set value(b){v(c,$e,b,"f")}}.value,parseContext:{set value(b){v(d,ht,b,"f")}}.value}=C,u(this,S,"f").configObjects=E,u(this,W,"f").unfreeze(),u(this,re,"f").unfreeze(),u(this,ae,"f").unfreeze(),u(this,Se,"f").unfreeze()}[To](e,t){return ct(t,s=>(e(s),s))}getInternalMethods(){return{getCommandInstance:this[Wo].bind(this),getContext:this[Ro].bind(this),getHasOutput:this[No].bind(this),getLoggerInstance:this[ko].bind(this),getParseContext:this[Lo].bind(this),getParserConfiguration:this[gt].bind(this),getUsageConfiguration:this[Io].bind(this),getUsageInstance:this[zo].bind(this),getValidationInstance:this[qo].bind(this),hasParseCallback:this[Rn].bind(this),isGlobalContext:this[Uo].bind(this),postProcess:this[Ct].bind(this),reset:this[Js].bind(this),runValidation:this[Ks].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Vo].bind(this)}}[Wo](){return u(this,ae,"f")}[Ro](){return u(this,Vt,"f")}[No](){return u(this,Ae,"f")}[ko](){return u(this,Mt,"f")}[Lo](){return u(this,ht,"f")||{}}[zo](){return u(this,W,"f")}[qo](){return u(this,re,"f")}[Rn](){return!!u(this,$e,"f")}[Uo](){return u(this,In,"f")}[Ct](e,t,s,r){return s||J(e)||(t||(e=this[Bo](e)),(this[gt]()["parse-positional-numbers"]||this[gt]()["parse-positional-numbers"]===void 0)&&(e=this[Mo](e)),r&&(e=at(e,this,u(this,Se,"f").getMiddleware(),!1))),e}[Js](e={}){v(this,S,u(this,S,"f")||{},"f");let t={};t.local=u(this,S,"f").local||[],t.configObjects=u(this,S,"f").configObjects||[];let s={};t.local.forEach(i=>{s[i]=!0,(e[i]||[]).forEach(a=>{s[a]=!0})}),Object.assign(u(this,ft,"f"),Object.keys(u(this,Ne,"f")).reduce((i,a)=>{let D=u(this,Ne,"f")[a].filter(h=>!(h in s));return D.length>0&&(i[a]=D),i},{})),v(this,Ne,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(i=>{t[i]=(u(this,S,"f")[i]||[]).filter(a=>!s[a])}),o.forEach(i=>{t[i]=Qe(u(this,S,"f")[i],a=>!s[a])}),t.envPrefix=u(this,S,"f").envPrefix,v(this,S,t,"f"),v(this,W,u(this,W,"f")?u(this,W,"f").reset(s):Eo(this,u(this,T,"f")),"f"),v(this,re,u(this,re,"f")?u(this,re,"f").reset(s):xo(this,u(this,W,"f"),u(this,T,"f")),"f"),v(this,ae,u(this,ae,"f")?u(this,ae,"f").reset():go(u(this,W,"f"),u(this,re,"f"),u(this,Se,"f"),u(this,T,"f")),"f"),u(this,_e,"f")||v(this,_e,wo(this,u(this,W,"f"),u(this,ae,"f"),u(this,T,"f")),"f"),u(this,Se,"f").reset(),v(this,we,null,"f"),v(this,fe,"","f"),v(this,Xe,null,"f"),v(this,Ae,!1,"f"),this.parsed=!1,this}[Ho](e,t){return u(this,T,"f").path.relative(e,t)}[Gt](e,t,s,r=0,o=!1){let i=!!s||o;e=e||u(this,et,"f"),u(this,S,"f").__=u(this,T,"f").y18n.__,u(this,S,"f").configuration=this[gt]();let a=!!u(this,S,"f").configuration["populate--"],D=Object.assign({},u(this,S,"f").configuration,{"populate--":!0}),h=u(this,T,"f").Parser.detailed(e,Object.assign({},u(this,S,"f"),{configuration:{"parse-positional-numbers":!1,...D}})),f=Object.assign(h.argv,u(this,ht,"f")),c,d=h.aliases,C=!1,E=!1;Object.keys(f).forEach(b=>{b===u(this,Ie,"f")&&f[b]?C=!0:b===u(this,ke,"f")&&f[b]&&(E=!0)}),f.$0=this.$0,this.parsed=h,r===0&&u(this,W,"f").clearCachedHelpMessage();try{if(this[zs](),t)return this[Ct](f,a,!!s,!1);u(this,Ie,"f")&&[u(this,Ie,"f")].concat(d[u(this,Ie,"f")]||[]).filter(U=>U.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),C=!0),v(this,In,!1,"f");let b=u(this,ae,"f").getCommands(),g=u(this,_e,"f").completionKey in f,O=C||g||o;if(f._.length){if(b.length){let R;for(let U=r||0,L;f._[U]!==void 0;U++)if(L=String(f._[U]),b.includes(L)&&L!==u(this,we,"f")){let H=u(this,ae,"f").runCommand(L,this,h,U+1,o,C||E||o);return this[Ct](H,a,!!s,!1)}else if(!R&&L!==u(this,we,"f")){R=L;break}!u(this,ae,"f").hasDefaultCommand()&&u(this,Tn,"f")&&R&&!O&&u(this,re,"f").recommendCommands(R,b)}u(this,we,"f")&&f._.includes(u(this,we,"f"))&&!g&&(u(this,je,"f")&&Ze(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ae,"f").hasDefaultCommand()&&!O){let R=u(this,ae,"f").runCommand(null,this,h,0,o,C||E||o);return this[Ct](R,a,!!s,!1)}if(g){u(this,je,"f")&&Ze(!0),e=[].concat(e);let R=e.slice(e.indexOf(`--${u(this,_e,"f").completionKey}`)+1);return u(this,_e,"f").getCompletion(R,(U,L)=>{if(U)throw new Y(U.message);(L||[]).forEach(H=>{u(this,Mt,"f").log(H)}),this.exit(0)}),this[Ct](f,!a,!!s,!1)}if(u(this,Ae,"f")||(C?(u(this,je,"f")&&Ze(!0),i=!0,this.showHelp("log"),this.exit(0)):E&&(u(this,je,"f")&&Ze(!0),i=!0,u(this,W,"f").showVersion("log"),this.exit(0))),!i&&u(this,S,"f").skipValidation.length>0&&(i=Object.keys(f).some(R=>u(this,S,"f").skipValidation.indexOf(R)>=0&&f[R]===!0)),!i){if(h.error)throw new Y(h.error.message);if(!g){let R=this[Ks](d,{},h.error);s||(c=at(f,this,u(this,Se,"f").getMiddleware(),!0)),c=this[To](R,c??f),J(c)&&!s&&(c=c.then(()=>at(f,this,u(this,Se,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Y)u(this,W,"f").fail(b.message,b);else throw b}return this[Ct](c??f,a,!!s,!0)}[Ks](e,t,s,r){let o={...this.getDemandedOptions()};return i=>{if(s)throw new Y(s.message);u(this,re,"f").nonOptionCount(i),u(this,re,"f").requiredArguments(i,o);let a=!1;u(this,dt,"f")&&(a=u(this,re,"f").unknownCommands(i)),u(this,pt,"f")&&!a?u(this,re,"f").unknownArguments(i,e,t,!!r):u(this,mt,"f")&&u(this,re,"f").unknownArguments(i,e,{},!1,!1),u(this,re,"f").limitedChoices(i),u(this,re,"f").implications(i),u(this,re,"f").conflicting(i)}}[Vo](){v(this,Ae,!0,"f")}[Ft](e){if(typeof e=="string")u(this,S,"f").key[e]=!0;else for(let t of e)u(this,S,"f").key[t]=!0}};function Co(n){return!!n&&typeof n.getInternalMethods=="function"}var oc=Go(Do),Yo=oc;function uc(n,e){return Yo(n).strict().command("* <template> <outDir>","Create a new project powered by qwik",s=>s.positional("template",{type:"string",desc:"Starter template",choices:e}).positional("outDir",{type:"string",desc:"Directory of the project"}).option("force",{alias:"f",type:"boolean",default:!1,desc:"Overwrite target directory if it exists"}).option("installDeps",{alias:"i",default:!1,type:"boolean",desc:"Install dependencies"}).usage("npm create qwik@latest base ./my-project <options>")).argv}async function Xs(...n){let e=Je(),t=await Ot("app"),s=t.standaloneTemplates.map(({id:d})=>d),r=uc(n,s),{force:o,installDeps:i,template:a}=r,D=r.outDir;nn(`Let's create a ${kt(" Qwik App ")} \u2728 (v1.6.0)`),ac()?D=process.cwd():(D=gn(D),Zs.default.existsSync(D)&&Zs.default.readdirSync(D).length>0&&(o?await rn(D):(te.error(`Directory "${D}" already exists.`),te.info("Please either remove this directory, choose another location or run the command again with '--force | -f' flag."),rt(),process.exit(1))));let h=await _t({outDir:D,appId:a,pkgManager:e,templateManager:t}),f=At(),c=!1;return i&&(c=await dn(async()=>await ot(e,D).install,{pkgManager:e,spinner:f})),mn(e,h,c),h}function ac(){return cc()}function cc(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var kn=require("node:path");var Nn=ce(require("node:fs"));var ei=[["What's the best thing about a Boolean?","Even if you're wrong, you're only off by a bit."],["Why did the developer stay at home?","Because he couldn't find his keys."],["How many programmers does it take to change a lightbulb?","None that's a hardware problem"],["A user interface is like a joke.","If you have to explain it then it is not that good."],["['hip', 'hip']","(hip hip array)"],["A SQL query goes into a bar, walks up to two tables and asks:","'Can I JOIN you?'"],["Why did the developer go to therapy?","He had too many unresolved issues."],["Why do C# and Java developers keep breaking their keyboards?","Because they use a strongly typed language."],["What's the object-oriented way to become wealthy?","Inheritance"],["Where do programmers like to hangout?","The Foo Bar."],["Why do Java programmers wear glasses?","Because they don't C#"],["To understand what recursion is...","You must first understand what recursion is"],["The punchline often arrives before the set-up.","Do you know the problem with UDP jokes?"],["Why did the programmer quit his job?","Because he didn't get arrays."],["Why was the computer tired when it got home?","It had a hard drive."],["There are 10 types of people in this world...","Those who understand binary and those who don't"],["Why do programmers always mix up Halloween and Christmas?","Because Oct 31 == Dec 25"],["I was gonna tell you a joke about UDP...","...but you might not get it."],["Normal People: give me just a second","Developers: give me 100 milliseconds!"],["Why do programmers prefer dark mode?","Because light attracts bugs."],["Why don't programmers like nature?","It has too many bugs."],["Why was the computer freezing?","It left its Windows open!"],["What did the Java code say to the C code?","You've got no class."],["Why did the programmer always carry a pencil?","In case he needed to draw bugs."],["Why do programmers prefer the outdoors?","Because it's free of bugs."],["Why do programmers love movies?","Because they can 'script' the ending."],["why do desert animals hate Qwik?","Because there's no hydration...."],["What can you do if you cannot push your git changes?","Use the --force, Luke"],["How did the developer announce he's getting married?","'She returned true!'"],["How many Prolog programmers does it take to change a lightbulb?","Yes."],["Why did the developer ground their kid?","They weren't telling the truthy"],["!false","It's funny 'cause it's true."],["Where did the parallel function wash its hands?","Async"],["How do functions break up?","They stop calling each other"],["Why did the functions stop calling each other?","Because they had constant arguments."],["What's the second movie about a database engineer called?","The SQL."],["What did the computer do at lunchtime?","NoSQL."],["Why doesn't Hollywood make more Big Data movies?","Had a byte!"],["What does a baby computer call his father?","Data!"],["I never tell the same joke twice","I have a DRY sense of humor."],["How do programming pirates pass method parameters?","ARRRRRGS."],["Why don't bachelors like Git?","Because they are afraid to commit."],["Why do astronauts use Linux?","They can't open Windows in space!"],["How do front end devs like their brownies?","GUI"],["What do hackers do on a boat?","Phishing."],["Why couldn't the HTML list be trusted?","There were LI's everywhere"],["To the person who invented zero:","Thank's for nothing!"],["What do you call a bee that lives in America?","A USB"],["want about to a race conditions hear joke?",""],["What is a Package Managers favorite holiday?","Dependency Day"],["Where do we get all of these dad jokes from?","A dad-a-base!"],["What advice do you give to a JS developer who has never played baseball?","Try catch."],["We don't have any DNS jokes, know why?","Because it may take 24 hours to get them"],["Why do Front-End Developers eat lunch alone?","Because they don't know how to join tables."],["How do you help JS errors?","You `console` them!"],["When do front end developers go out to eat?","On their lunch <br>."],["What do you call optimistic front-end developers?","Stack half-full developers."]];function Jo(){let n=Math.floor(Math.random()*ei.length);return ei[n]}async function ti(){let n=Je(),e=await Ot("app"),t="./qwik-app";nn(`Let's create a ${kt(" Qwik App ")} \u2728 (v1.6.0)`),await Sr(500);let s=await $i({message:`Where would you like to create your new project? ${Ye("(Use '.' or './' for current directory)")}`,placeholder:t})||t;Ge(s)&&(rt("Operation cancelled."),process.exit(0));let r=e.getBaseApp();if(!r)throw new Error("Base app not found");let o=e.templates.filter(O=>O.id!==r.id),i=gn(s.trim());r.target=i;let a=Wr(n,r);te.info(`Creating new project in ${kt(" "+i+" ")} ... \u{1F407}`);let D=null;if(Nn.default.existsSync(i)&&Nn.default.readdirSync(i).length>0){let O=await ss({message:`Directory "./${(0,kn.relative)(process.cwd(),i)}" already exists and is not empty. What would you like to do?`,options:[{value:"exit",label:"Do not overwrite this directory and exit"},{value:"replace",label:"Remove contents of this directory"}]});(Ge(O)||O==="exit")&&(rt("Operation cancelled."),process.exit(0)),O==="replace"&&(D=rn(i))}let h=await ss({message:"Select a starter",options:o.map(O=>{var R;return{label:O.name,value:O.id,hint:(R=O.pkgJson)==null?void 0:R.description}})});Ge(h)&&(rt("Operation cancelled."),process.exit(0));let f=h,c=await tn({message:`Would you like to install ${n} dependencies?`,initialValue:!0});Ge(c)&&(rt("Operation cancelled."),process.exit(0));let d=await tn({message:"Initialize a new git repository?",initialValue:!0});D&&await D;let C=c;if(!C)a.abort();else if(typeof a.success>"u")try{let O=await tn({message:"Finishing the install. Wanna hear a joke?",initialValue:!0});if(!Ge(O)&&O){let[R,U]=Jo();an(Ce(`${R.trim()}
|
|
164
|
-
${U.trim()}`),"\u{1F648}")}}catch{}let E=At();E.start("Creating App...");let b=await _t({appId:f,outDir:i,pkgManager:n,templateManager:e});if(E.stop("App Created \u{1F430}"),d)if(Nn.default.existsSync((0,kn.join)(i,".git")))te.info("Git has already been initialized before. Skipping...");else{E.start("Git initializing...");try{let
|
|
163
|
+
`,"f"),v(this,fe,u(this,fe,"f")+e.join(" "),"f")}}}[Ls](e){It(u(this,S,"f")).forEach(t=>{if((r=>r==="configObjects")(t))return;let s=u(this,S,"f")[t];Array.isArray(s)?s.includes(e)&&s.splice(s.indexOf(e),1):typeof s=="object"&&delete s[e]}),delete u(this,R,"f").getDescriptions()[e]}[_o](e,t,s){u(this,jn,"f")[s]||(u(this,T,"f").process.emitWarning(e,t),u(this,jn,"f")[s]=!0)}[jo](){u(this,Sn,"f").push({options:u(this,S,"f"),configObjects:u(this,S,"f").configObjects.slice(0),exitProcess:u(this,je,"f"),groups:u(this,Ne,"f"),strict:u(this,pt,"f"),strictCommands:u(this,dt,"f"),strictOptions:u(this,mt,"f"),completionCommand:u(this,we,"f"),output:u(this,fe,"f"),exitError:u(this,Xe,"f"),hasOutput:u(this,Ae,"f"),parsed:this.parsed,parseFn:u(this,$e,"f"),parseContext:u(this,ht,"f")}),u(this,R,"f").freeze(),u(this,re,"f").freeze(),u(this,ae,"f").freeze(),u(this,Se,"f").freeze()}[So](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(u(this,T,"f").process.argv()[0])?t=u(this,T,"f").process.argv().slice(1,2):t=u(this,T,"f").process.argv().slice(0,1),e=t.map(s=>{let r=this[Ho](u(this,lt,"f"),s);return s.match(/^(\/|([a-zA-Z]:)?\\)/)&&r.length<s.length?r:s}).join(" ").trim(),u(this,T,"f").getEnv("_")&&u(this,T,"f").getProcessArgvBin()===u(this,T,"f").getEnv("_")&&(e=u(this,T,"f").getEnv("_").replace(`${u(this,T,"f").path.dirname(u(this,T,"f").process.execPath())}/`,"")),e}[gt](){return u(this,Mn,"f")}[Io](){return u(this,Wn,"f")}[zs](){if(!u(this,Dt,"f"))return;let e=u(this,T,"f").getEnv("LC_ALL")||u(this,T,"f").getEnv("LC_MESSAGES")||u(this,T,"f").getEnv("LANG")||u(this,T,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[Po](){return this[qs]().version||"unknown"}[Mo](e){let t=e["--"]?e["--"]:e._;for(let s=0,r;(r=t[s])!==void 0;s++)u(this,T,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))&&(t[s]=Number(r));return e}[qs](e){let t=e||"*";if(u(this,Tt,"f")[t])return u(this,Tt,"f")[t];let s={};try{let r=e||u(this,T,"f").mainFilename;!e&&u(this,T,"f").path.extname(r)&&(r=u(this,T,"f").path.dirname(r));let o=u(this,T,"f").findUp(r,(i,a)=>{if(a.includes("package.json"))return"package.json"});Fe(o,void 0,u(this,T,"f")),s=JSON.parse(u(this,T,"f").readFileSync(o,"utf8"))}catch{}return u(this,Tt,"f")[t]=s||{},u(this,Tt,"f")[t]}[tt](e,t){t=[].concat(t),t.forEach(s=>{s=this[Vs](s),u(this,S,"f")[e].push(s)})}[Wt](e,t,s,r){this[Hs](e,t,s,r,(o,i,a)=>{u(this,S,"f")[o][i]=a})}[Us](e,t,s,r){this[Hs](e,t,s,r,(o,i,a)=>{u(this,S,"f")[o][i]=(u(this,S,"f")[o][i]||[]).concat(a)})}[Hs](e,t,s,r,o){if(Array.isArray(s))s.forEach(i=>{e(i,r)});else if((i=>typeof i=="object")(s))for(let i of It(s))e(i,s[i]);else o(t,this[Vs](s),r)}[Vs](e){return e==="__proto__"?"___proto___":e}[Gs](e,t){return this[Wt](this[Gs].bind(this),"key",e,t),this}[Ys](){var e,t,s,r,o,i,a,D,h,f,c,d;let C=u(this,Sn,"f").pop();Fe(C,void 0,u(this,T,"f"));let E;e=this,t=this,s=this,r=this,o=this,i=this,a=this,D=this,h=this,f=this,c=this,d=this,{options:{set value(b){v(e,S,b,"f")}}.value,configObjects:E,exitProcess:{set value(b){v(t,je,b,"f")}}.value,groups:{set value(b){v(s,Ne,b,"f")}}.value,output:{set value(b){v(r,fe,b,"f")}}.value,exitError:{set value(b){v(o,Xe,b,"f")}}.value,hasOutput:{set value(b){v(i,Ae,b,"f")}}.value,parsed:this.parsed,strict:{set value(b){v(a,pt,b,"f")}}.value,strictCommands:{set value(b){v(D,dt,b,"f")}}.value,strictOptions:{set value(b){v(h,mt,b,"f")}}.value,completionCommand:{set value(b){v(f,we,b,"f")}}.value,parseFn:{set value(b){v(c,$e,b,"f")}}.value,parseContext:{set value(b){v(d,ht,b,"f")}}.value}=C,u(this,S,"f").configObjects=E,u(this,R,"f").unfreeze(),u(this,re,"f").unfreeze(),u(this,ae,"f").unfreeze(),u(this,Se,"f").unfreeze()}[To](e,t){return ct(t,s=>(e(s),s))}getInternalMethods(){return{getCommandInstance:this[Wo].bind(this),getContext:this[Ro].bind(this),getHasOutput:this[No].bind(this),getLoggerInstance:this[ko].bind(this),getParseContext:this[Lo].bind(this),getParserConfiguration:this[gt].bind(this),getUsageConfiguration:this[Io].bind(this),getUsageInstance:this[zo].bind(this),getValidationInstance:this[qo].bind(this),hasParseCallback:this[Rn].bind(this),isGlobalContext:this[Uo].bind(this),postProcess:this[Ct].bind(this),reset:this[Js].bind(this),runValidation:this[Ks].bind(this),runYargsParserAndExecuteCommands:this[Gt].bind(this),setHasOutput:this[Vo].bind(this)}}[Wo](){return u(this,ae,"f")}[Ro](){return u(this,Vt,"f")}[No](){return u(this,Ae,"f")}[ko](){return u(this,Mt,"f")}[Lo](){return u(this,ht,"f")||{}}[zo](){return u(this,R,"f")}[qo](){return u(this,re,"f")}[Rn](){return!!u(this,$e,"f")}[Uo](){return u(this,In,"f")}[Ct](e,t,s,r){return s||J(e)||(t||(e=this[Bo](e)),(this[gt]()["parse-positional-numbers"]||this[gt]()["parse-positional-numbers"]===void 0)&&(e=this[Mo](e)),r&&(e=at(e,this,u(this,Se,"f").getMiddleware(),!1))),e}[Js](e={}){v(this,S,u(this,S,"f")||{},"f");let t={};t.local=u(this,S,"f").local||[],t.configObjects=u(this,S,"f").configObjects||[];let s={};t.local.forEach(i=>{s[i]=!0,(e[i]||[]).forEach(a=>{s[a]=!0})}),Object.assign(u(this,ft,"f"),Object.keys(u(this,Ne,"f")).reduce((i,a)=>{let D=u(this,Ne,"f")[a].filter(h=>!(h in s));return D.length>0&&(i[a]=D),i},{})),v(this,Ne,{},"f");let r=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return r.forEach(i=>{t[i]=(u(this,S,"f")[i]||[]).filter(a=>!s[a])}),o.forEach(i=>{t[i]=Qe(u(this,S,"f")[i],a=>!s[a])}),t.envPrefix=u(this,S,"f").envPrefix,v(this,S,t,"f"),v(this,R,u(this,R,"f")?u(this,R,"f").reset(s):Eo(this,u(this,T,"f")),"f"),v(this,re,u(this,re,"f")?u(this,re,"f").reset(s):xo(this,u(this,R,"f"),u(this,T,"f")),"f"),v(this,ae,u(this,ae,"f")?u(this,ae,"f").reset():go(u(this,R,"f"),u(this,re,"f"),u(this,Se,"f"),u(this,T,"f")),"f"),u(this,_e,"f")||v(this,_e,wo(this,u(this,R,"f"),u(this,ae,"f"),u(this,T,"f")),"f"),u(this,Se,"f").reset(),v(this,we,null,"f"),v(this,fe,"","f"),v(this,Xe,null,"f"),v(this,Ae,!1,"f"),this.parsed=!1,this}[Ho](e,t){return u(this,T,"f").path.relative(e,t)}[Gt](e,t,s,r=0,o=!1){let i=!!s||o;e=e||u(this,et,"f"),u(this,S,"f").__=u(this,T,"f").y18n.__,u(this,S,"f").configuration=this[gt]();let a=!!u(this,S,"f").configuration["populate--"],D=Object.assign({},u(this,S,"f").configuration,{"populate--":!0}),h=u(this,T,"f").Parser.detailed(e,Object.assign({},u(this,S,"f"),{configuration:{"parse-positional-numbers":!1,...D}})),f=Object.assign(h.argv,u(this,ht,"f")),c,d=h.aliases,C=!1,E=!1;Object.keys(f).forEach(b=>{b===u(this,Ie,"f")&&f[b]?C=!0:b===u(this,ke,"f")&&f[b]&&(E=!0)}),f.$0=this.$0,this.parsed=h,r===0&&u(this,R,"f").clearCachedHelpMessage();try{if(this[zs](),t)return this[Ct](f,a,!!s,!1);u(this,Ie,"f")&&[u(this,Ie,"f")].concat(d[u(this,Ie,"f")]||[]).filter(U=>U.length>1).includes(""+f._[f._.length-1])&&(f._.pop(),C=!0),v(this,In,!1,"f");let b=u(this,ae,"f").getCommands(),g=u(this,_e,"f").completionKey in f,B=C||g||o;if(f._.length){if(b.length){let W;for(let U=r||0,L;f._[U]!==void 0;U++)if(L=String(f._[U]),b.includes(L)&&L!==u(this,we,"f")){let H=u(this,ae,"f").runCommand(L,this,h,U+1,o,C||E||o);return this[Ct](H,a,!!s,!1)}else if(!W&&L!==u(this,we,"f")){W=L;break}!u(this,ae,"f").hasDefaultCommand()&&u(this,Tn,"f")&&W&&!B&&u(this,re,"f").recommendCommands(W,b)}u(this,we,"f")&&f._.includes(u(this,we,"f"))&&!g&&(u(this,je,"f")&&Ze(!0),this.showCompletionScript(),this.exit(0))}if(u(this,ae,"f").hasDefaultCommand()&&!B){let W=u(this,ae,"f").runCommand(null,this,h,0,o,C||E||o);return this[Ct](W,a,!!s,!1)}if(g){u(this,je,"f")&&Ze(!0),e=[].concat(e);let W=e.slice(e.indexOf(`--${u(this,_e,"f").completionKey}`)+1);return u(this,_e,"f").getCompletion(W,(U,L)=>{if(U)throw new Y(U.message);(L||[]).forEach(H=>{u(this,Mt,"f").log(H)}),this.exit(0)}),this[Ct](f,!a,!!s,!1)}if(u(this,Ae,"f")||(C?(u(this,je,"f")&&Ze(!0),i=!0,this.showHelp("log"),this.exit(0)):E&&(u(this,je,"f")&&Ze(!0),i=!0,u(this,R,"f").showVersion("log"),this.exit(0))),!i&&u(this,S,"f").skipValidation.length>0&&(i=Object.keys(f).some(W=>u(this,S,"f").skipValidation.indexOf(W)>=0&&f[W]===!0)),!i){if(h.error)throw new Y(h.error.message);if(!g){let W=this[Ks](d,{},h.error);s||(c=at(f,this,u(this,Se,"f").getMiddleware(),!0)),c=this[To](W,c??f),J(c)&&!s&&(c=c.then(()=>at(f,this,u(this,Se,"f").getMiddleware(),!1)))}}}catch(b){if(b instanceof Y)u(this,R,"f").fail(b.message,b);else throw b}return this[Ct](c??f,a,!!s,!0)}[Ks](e,t,s,r){let o={...this.getDemandedOptions()};return i=>{if(s)throw new Y(s.message);u(this,re,"f").nonOptionCount(i),u(this,re,"f").requiredArguments(i,o);let a=!1;u(this,dt,"f")&&(a=u(this,re,"f").unknownCommands(i)),u(this,pt,"f")&&!a?u(this,re,"f").unknownArguments(i,e,t,!!r):u(this,mt,"f")&&u(this,re,"f").unknownArguments(i,e,{},!1,!1),u(this,re,"f").limitedChoices(i),u(this,re,"f").implications(i),u(this,re,"f").conflicting(i)}}[Vo](){v(this,Ae,!0,"f")}[Ft](e){if(typeof e=="string")u(this,S,"f").key[e]=!0;else for(let t of e)u(this,S,"f").key[t]=!0}};function Co(n){return!!n&&typeof n.getInternalMethods=="function"}var oc=Go(Do),Yo=oc;function uc(n,e){return Yo(n).strict().command("* <template> <outDir>","Create a new project powered by qwik",s=>s.positional("template",{type:"string",desc:"Starter template",choices:e}).positional("outDir",{type:"string",desc:"Directory of the project"}).option("force",{alias:"f",type:"boolean",default:!1,desc:"Overwrite target directory if it exists"}).option("installDeps",{alias:"i",default:!1,type:"boolean",desc:"Install dependencies"}).usage("npm create qwik@latest base ./my-project <options>")).argv}async function Xs(...n){let e=Je(),t=await Ot("app"),s=t.standaloneTemplates.map(({id:d})=>d),r=uc(n,s),{force:o,installDeps:i,template:a}=r,D=r.outDir;nn(`Let's create a ${kt(" Qwik App ")} \u2728 (v1.7.0)`),ac()?D=process.cwd():(D=gn(D),Zs.default.existsSync(D)&&Zs.default.readdirSync(D).length>0&&(o?await rn(D):(te.error(`Directory "${D}" already exists.`),te.info("Please either remove this directory, choose another location or run the command again with '--force | -f' flag."),rt(),process.exit(1))));let h=await _t({outDir:D,appId:a,pkgManager:e,templateManager:t}),f=At(),c=!1;return i&&(c=await dn(async()=>await ot(e,D).install,{pkgManager:e,spinner:f})),mn(e,h,c),h}function ac(){return cc()}function cc(){try{return process.cwd().startsWith("/home/projects/")}catch{}return!1}var kn=require("node:path");var Nn=ce(require("node:fs"));var ei=[["What's the best thing about a Boolean?","Even if you're wrong, you're only off by a bit."],["Why did the developer stay at home?","Because he couldn't find his keys."],["How many programmers does it take to change a lightbulb?","None that's a hardware problem"],["A user interface is like a joke.","If you have to explain it then it is not that good."],["['hip', 'hip']","(hip hip array)"],["A SQL query goes into a bar, walks up to two tables and asks:","'Can I JOIN you?'"],["Why did the developer go to therapy?","He had too many unresolved issues."],["Why do C# and Java developers keep breaking their keyboards?","Because they use a strongly typed language."],["What's the object-oriented way to become wealthy?","Inheritance"],["Where do programmers like to hangout?","The Foo Bar."],["Why do Java programmers wear glasses?","Because they don't C#"],["To understand what recursion is...","You must first understand what recursion is"],["The punchline often arrives before the set-up.","Do you know the problem with UDP jokes?"],["Why did the programmer quit his job?","Because he didn't get arrays."],["Why was the computer tired when it got home?","It had a hard drive."],["There are 10 types of people in this world...","Those who understand binary and those who don't"],["Why do programmers always mix up Halloween and Christmas?","Because Oct 31 == Dec 25"],["I was gonna tell you a joke about UDP...","...but you might not get it."],["Normal People: give me just a second","Developers: give me 100 milliseconds!"],["Why do programmers prefer dark mode?","Because light attracts bugs."],["Why don't programmers like nature?","It has too many bugs."],["Why was the computer freezing?","It left its Windows open!"],["What did the Java code say to the C code?","You've got no class."],["Why did the programmer always carry a pencil?","In case he needed to draw bugs."],["Why do programmers prefer the outdoors?","Because it's free of bugs."],["Why do programmers love movies?","Because they can 'script' the ending."],["why do desert animals hate Qwik?","Because there's no hydration...."],["What can you do if you cannot push your git changes?","Use the --force, Luke"],["How did the developer announce he's getting married?","'She returned true!'"],["How many Prolog programmers does it take to change a lightbulb?","Yes."],["Why did the developer ground their kid?","They weren't telling the truthy"],["!false","It's funny 'cause it's true."],["Where did the parallel function wash its hands?","Async"],["How do functions break up?","They stop calling each other"],["Why did the functions stop calling each other?","Because they had constant arguments."],["What's the second movie about a database engineer called?","The SQL."],["What did the computer do at lunchtime?","NoSQL."],["Why doesn't Hollywood make more Big Data movies?","Had a byte!"],["What does a baby computer call his father?","Data!"],["I never tell the same joke twice","I have a DRY sense of humor."],["How do programming pirates pass method parameters?","ARRRRRGS."],["Why don't bachelors like Git?","Because they are afraid to commit."],["Why do astronauts use Linux?","They can't open Windows in space!"],["How do front end devs like their brownies?","GUI"],["What do hackers do on a boat?","Phishing."],["Why couldn't the HTML list be trusted?","There were LI's everywhere"],["To the person who invented zero:","Thank's for nothing!"],["What do you call a bee that lives in America?","A USB"],["want about to a race conditions hear joke?",""],["What is a Package Managers favorite holiday?","Dependency Day"],["Where do we get all of these dad jokes from?","A dad-a-base!"],["What advice do you give to a JS developer who has never played baseball?","Try catch."],["We don't have any DNS jokes, know why?","Because it may take 24 hours to get them"],["Why do Front-End Developers eat lunch alone?","Because they don't know how to join tables."],["How do you help JS errors?","You `console` them!"],["When do front end developers go out to eat?","On their lunch <br>."],["What do you call optimistic front-end developers?","Stack half-full developers."]];function Jo(){let n=Math.floor(Math.random()*ei.length);return ei[n]}async function ti(){let n=Je(),e=await Ot("app"),t="./qwik-app";nn(`Let's create a ${kt(" Qwik App ")} \u2728 (v1.7.0)`),await Sr(500);let s=await $i({message:`Where would you like to create your new project? ${Ye("(Use '.' or './' for current directory)")}`,placeholder:t})||t;Ge(s)&&(rt("Operation cancelled."),process.exit(0));let r=e.getBaseApp();if(!r)throw new Error("Base app not found");let o=e.templates.filter(B=>B.id!==r.id).sort((B,W)=>B.name.localeCompare(W.name)),i=gn(s.trim());r.target=i;let a=Wr(n,r);te.info(`Creating new project in ${kt(" "+i+" ")} ... \u{1F407}`);let D=null;if(Nn.default.existsSync(i)&&Nn.default.readdirSync(i).length>0){let B=await ss({message:`Directory "./${(0,kn.relative)(process.cwd(),i)}" already exists and is not empty. What would you like to do?`,options:[{value:"exit",label:"Do not overwrite this directory and exit"},{value:"replace",label:"Remove contents of this directory"}]});(Ge(B)||B==="exit")&&(rt("Operation cancelled."),process.exit(0)),B==="replace"&&(D=rn(i))}let h=await ss({message:"Select a starter",options:o.map(B=>{var W;return{label:B.name,value:B.id,hint:(W=B.pkgJson)==null?void 0:W.description}})});Ge(h)&&(rt("Operation cancelled."),process.exit(0));let f=h,c=await tn({message:`Would you like to install ${n} dependencies?`,initialValue:!0});Ge(c)&&(rt("Operation cancelled."),process.exit(0));let d=await tn({message:"Initialize a new git repository?",initialValue:!0});D&&await D;let C=c;if(!C)a.abort();else if(typeof a.success>"u")try{let B=await tn({message:"Finishing the install. Wanna hear a joke?",initialValue:!0});if(!Ge(B)&&B){let[W,U]=Jo();an(Ce(`${W.trim()}
|
|
164
|
+
${U.trim()}`),"\u{1F648}")}}catch{}let E=At();E.start("Creating App...");let b=await _t({appId:f,outDir:i,pkgManager:n,templateManager:e});if(E.stop("App Created \u{1F430}"),d)if(Nn.default.existsSync((0,kn.join)(i,".git")))te.info("Git has already been initialized before. Skipping...");else{E.start("Git initializing...");try{let B=[];if(B.push(await vt("git",["init"],i).install),B.push(await vt("git",["add","-A"],i).install),B.push(await vt("git",["commit","-m","Initial commit \u26A1\uFE0F"],i).install),B.some(W=>W===!1))throw"";E.stop("Git initialized \u{1F3B2}")}catch{E.stop("Git failed to initialize"),te.error(Ee("Git failed to initialize. You can do this manually by running: git init"))}}let g=!1;return C&&(g=await dn(async()=>{let B=await a.complete(b.outDir);return B&&await ot(n,b.outDir).install},{pkgManager:n,spinner:E})),mn(n,b,g),b}async function Ko(n){let e=Je(),t=await Ot("app");return await _t({appId:n.starterId,templateManager:t,outDir:n.outDir,pkgManager:e})}async function Dc(){Mr(),hc();try{let n=process.argv.slice(2);n.length>0?await Xs(...n):await ti()}catch(n){un(n.message||n)}}function hc(){let n=process.version,[e,t]=n.replace("v","").split(".");Number(e)<16?(console.error(Ee(`Qwik requires Node.js 16.8 or higher. You are currently running Node.js ${n}.`)),process.exit(1)):Number(e)===16?Number(t)<8&&console.warn(Ii(`Node.js 16.8 or higher is recommended. You are currently running Node.js ${n}.`)):Number(e)===18&&Number(t)<11&&console.error(Ee(`Node.js 18.11 or higher is REQUIRED. From Node 18.0.0 to 18.11.0, there is a bug preventing correct behaviour of Qwik. You are currently running Node.js ${n}. https://github.com/QwikDev/qwik/issues/3035`))}0&&(module.exports={createApp,runCli,runCreateCli,runCreateInteractiveCli});
|
|
165
165
|
/*! Bundled license information:
|
|
166
166
|
|
|
167
167
|
yargs-parser/build/lib/string-utils.js:
|
package/package.json
CHANGED
|
@@ -16,14 +16,14 @@
|
|
|
16
16
|
"qwik": "qwik"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@builder.io/qwik": "^1.
|
|
20
|
-
"@builder.io/qwik-city": "^1.
|
|
19
|
+
"@builder.io/qwik": "^1.7.0",
|
|
20
|
+
"@builder.io/qwik-city": "^1.7.0",
|
|
21
21
|
"@types/eslint": "^8.56.10",
|
|
22
22
|
"@types/node": "^20.12.7",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
|
24
24
|
"@typescript-eslint/parser": "^7.7.1",
|
|
25
25
|
"eslint": "^8.57.0",
|
|
26
|
-
"eslint-plugin-qwik": "^1.
|
|
26
|
+
"eslint-plugin-qwik": "^1.7.0",
|
|
27
27
|
"prettier": "^3.2.5",
|
|
28
28
|
"typescript": "5.4.5",
|
|
29
29
|
"undici": "*",
|
|
@@ -30,7 +30,7 @@ export default defineConfig(({ command, mode }): UserConfig => {
|
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* This is an advanced setting. It improves the bundling of your server code. To use it, make sure you understand when your consumed packages are dependencies or dev
|
|
33
|
+
* This is an advanced setting. It improves the bundling of your server code. To use it, make sure you understand when your consumed packages are dependencies or dev dependencies. (otherwise things will break in production)
|
|
34
34
|
*/
|
|
35
35
|
// ssr:
|
|
36
36
|
// command === "build" && mode === "production"
|