@redocly/cli 2.68.0 → 2.69.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/lib/chunks/{OTJ7YUYN.js → 243MQEX6.js} +1 -1
- package/lib/chunks/{QPVP57EH.js → 3H5PZ4V3.js} +1 -1
- package/lib/chunks/{EOKARLWT.js → 3HTGTFY4.js} +1 -1
- package/lib/chunks/{KYNKWTWW.js → 4334I5GX.js} +1 -1
- package/lib/chunks/{HWSIEITK.js → 52EURAWF.js} +1 -1
- package/lib/chunks/{MQZVKMKI.js → 73O3LNT4.js} +1 -1
- package/lib/chunks/{AQUMCT6T.js → 7ACLT4MM.js} +1 -1
- package/lib/chunks/{Y3JGLHGA.js → BKZRKQYB.js} +1 -1
- package/lib/chunks/{WDZ5HBFT.js → BS3Q5ILZ.js} +1 -1
- package/lib/chunks/{6G6FP5TG.js → BVBLILPR.js} +1 -1
- package/lib/chunks/{Q5R4NBZT.js → D7HDYZLR.js} +1 -1
- package/lib/chunks/{X4P7NOLS.js → DG7WQWAX.js} +1 -1
- package/lib/chunks/{75ZOIK55.js → DON4XZFC.js} +1 -1
- package/lib/chunks/{FUXTVOY4.js → EUQKOSKD.js} +1 -1
- package/lib/chunks/{BXTMOD4H.js → G7M5ZI6N.js} +1 -1
- package/lib/chunks/{Z3XLXW7C.js → INFNJGOA.js} +1 -1
- package/lib/chunks/{ITD3EM5W.js → J4XH7HTA.js} +1 -1
- package/lib/chunks/KXL2RBIR.js +12 -0
- package/lib/chunks/{DA2H4OAW.js → LNEYWAAB.js} +1 -1
- package/lib/chunks/LRRSU5UY.js +7 -0
- package/lib/chunks/{NX7EFVZB.js → PF7QVU6V.js} +1 -1
- package/lib/chunks/{AQP7QCH2.js → PWZVPJLX.js} +1 -1
- package/lib/chunks/{LHDP6XGD.js → QD6M6CHF.js} +2 -2
- package/lib/chunks/{BSGULHBA.js → QE4P4HKF.js} +1 -1
- package/lib/chunks/{XYU4RS2V.js → RDHOZ2UF.js} +1 -1
- package/lib/chunks/{65GGUTGJ.js → RRXAPLFU.js} +1 -1
- package/lib/chunks/{L7TGBNTN.js → W2B62OSA.js} +1 -1
- package/lib/chunks/{H4XTX67B.js → WES43REM.js} +1 -1
- package/lib/chunks/{HK5IGSDA.js → XEYJ6MHT.js} +1 -1
- package/lib/chunks/{ERYBD7YZ.js → Y4FNWDBX.js} +1 -1
- package/lib/chunks/{FAKRKMAE.js → Y5EDVLKT.js} +1 -1
- package/lib/chunks/{RJVYQHJ2.js → ZARMFMXI.js} +1 -1
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +2 -2
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +1 -1
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/index.js +37 -37
- package/lib/skills/redocly-cli/SKILL.md +4 -4
- package/package.json +1 -1
- package/lib/chunks/4PTNG4EI.js +0 -7
- package/lib/chunks/HFJYUUKX.js +0 -11
package/lib/index.js
CHANGED
|
@@ -5,19 +5,19 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
var __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
var __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as si,f as te}from"./chunks/U5DIFWGH.js";import{c as oi}from"./chunks/4PTNG4EI.js";import{a as er}from"./chunks/3NMOCTX3.js";import{a as Fa}from"./chunks/ERBLCNSR.js";import{a as ai,c as tr,d as Dr,e as li,g as ui}from"./chunks/TZMWTSOQ.js";import{a as Le,b as ni,c as ii}from"./chunks/OTJ7YUYN.js";import{a as ci}from"./chunks/S3LDGEL4.js";import{a as ri}from"./chunks/3M4I4RF5.js";import{Ba as ti,O as Yn,R as Kn,Z as Dt,a as Vn,aa as _t,ba as Jt,c as Oe,ea as ct,ga as Xn,ia as H,ja as Qt,ka as Jn,l as Tr,oa as ge,pa as Zt,sa as Qn,u as Bn,va as Zn,wa as ei}from"./chunks/A7GSAEEX.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as k,e as Xt}from"./chunks/RFWIIJFG.js";var St=k((Id,fi)=>{"use strict";var ka="2.0.0",za=Number.MAX_SAFE_INTEGER||9007199254740991,Ua=16,Ga=250,Wa=["major","premajor","minor","preminor","patch","prepatch","prerelease"];fi.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ua,MAX_SAFE_BUILD_LENGTH:Ga,MAX_SAFE_INTEGER:za,RELEASE_TYPES:Wa,SEMVER_SPEC_VERSION:ka,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qt=k((Ld,di)=>{"use strict";var Ha=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};di.exports=Ha});var Ct=k((Ge,pi)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:qr,MAX_SAFE_BUILD_LENGTH:Va,MAX_LENGTH:Ba}=St(),Ya=qt();Ge=pi.exports={};var Ka=Ge.re=[],Xa=Ge.safeRe=[],C=Ge.src=[],Ja=Ge.safeSrc=[],R=Ge.t={},Qa=0,Mr="[a-zA-Z0-9-]",Za=[["\\s",1],["\\d",Ba],[Mr,Va]],ec=r=>{for(let[e,t]of Za)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},G=(r,e,t)=>{let n=ec(e),i=Qa++;Ya(r,i,e),R[r]=i,C[i]=e,Ja[i]=n,Ka[i]=new RegExp(e,t?"g":void 0),Xa[i]=new RegExp(n,t?"g":void 0)};G("NUMERICIDENTIFIER","0|[1-9]\\d*");G("NUMERICIDENTIFIERLOOSE","\\d+");G("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Mr}*`);G("MAINVERSION",`(${C[R.NUMERICIDENTIFIER]})\\.(${C[R.NUMERICIDENTIFIER]})\\.(${C[R.NUMERICIDENTIFIER]})`);G("MAINVERSIONLOOSE",`(${C[R.NUMERICIDENTIFIERLOOSE]})\\.(${C[R.NUMERICIDENTIFIERLOOSE]})\\.(${C[R.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASEIDENTIFIER",`(?:${C[R.NONNUMERICIDENTIFIER]}|${C[R.NUMERICIDENTIFIER]})`);G("PRERELEASEIDENTIFIERLOOSE",`(?:${C[R.NONNUMERICIDENTIFIER]}|${C[R.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASE",`(?:-(${C[R.PRERELEASEIDENTIFIER]}(?:\\.${C[R.PRERELEASEIDENTIFIER]})*))`);G("PRERELEASELOOSE",`(?:-?(${C[R.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[R.PRERELEASEIDENTIFIERLOOSE]})*))`);G("BUILDIDENTIFIER",`${Mr}+`);G("BUILD",`(?:\\+(${C[R.BUILDIDENTIFIER]}(?:\\.${C[R.BUILDIDENTIFIER]})*))`);G("FULLPLAIN",`v?${C[R.MAINVERSION]}${C[R.PRERELEASE]}?${C[R.BUILD]}?`);G("FULL",`^${C[R.FULLPLAIN]}$`);G("LOOSEPLAIN",`[v=\\s]*${C[R.MAINVERSIONLOOSE]}${C[R.PRERELEASELOOSE]}?${C[R.BUILD]}?`);G("LOOSE",`^${C[R.LOOSEPLAIN]}$`);G("GTLT","((?:<|>)?=?)");G("XRANGEIDENTIFIERLOOSE",`${C[R.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);G("XRANGEIDENTIFIER",`${C[R.NUMERICIDENTIFIER]}|x|X|\\*`);G("XRANGEPLAIN",`[v=\\s]*(${C[R.XRANGEIDENTIFIER]})(?:\\.(${C[R.XRANGEIDENTIFIER]})(?:\\.(${C[R.XRANGEIDENTIFIER]})(?:${C[R.PRERELEASE]})?${C[R.BUILD]}?)?)?`);G("XRANGEPLAINLOOSE",`[v=\\s]*(${C[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[R.XRANGEIDENTIFIERLOOSE]})(?:${C[R.PRERELEASELOOSE]})?${C[R.BUILD]}?)?)?`);G("XRANGE",`^${C[R.GTLT]}\\s*${C[R.XRANGEPLAIN]}$`);G("XRANGELOOSE",`^${C[R.GTLT]}\\s*${C[R.XRANGEPLAINLOOSE]}$`);G("COERCEPLAIN",`(^|[^\\d])(\\d{1,${qr}})(?:\\.(\\d{1,${qr}}))?(?:\\.(\\d{1,${qr}}))?`);G("COERCE",`${C[R.COERCEPLAIN]}(?:$|[^\\d])`);G("COERCEFULL",C[R.COERCEPLAIN]+`(?:${C[R.PRERELEASE]})?(?:${C[R.BUILD]})?(?:$|[^\\d])`);G("COERCERTL",C[R.COERCE],!0);G("COERCERTLFULL",C[R.COERCEFULL],!0);G("LONETILDE","(?:~>?)");G("TILDETRIM",`(\\s*)${C[R.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";G("TILDE",`^${C[R.LONETILDE]}${C[R.XRANGEPLAIN]}$`);G("TILDELOOSE",`^${C[R.LONETILDE]}${C[R.XRANGEPLAINLOOSE]}$`);G("LONECARET","(?:\\^)");G("CARETTRIM",`(\\s*)${C[R.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";G("CARET",`^${C[R.LONECARET]}${C[R.XRANGEPLAIN]}$`);G("CARETLOOSE",`^${C[R.LONECARET]}${C[R.XRANGEPLAINLOOSE]}$`);G("COMPARATORLOOSE",`^${C[R.GTLT]}\\s*(${C[R.LOOSEPLAIN]})$|^$`);G("COMPARATOR",`^${C[R.GTLT]}\\s*(${C[R.FULLPLAIN]})$|^$`);G("COMPARATORTRIM",`(\\s*)${C[R.GTLT]}\\s*(${C[R.LOOSEPLAIN]}|${C[R.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";G("HYPHENRANGE",`^\\s*(${C[R.XRANGEPLAIN]})\\s+-\\s+(${C[R.XRANGEPLAIN]})\\s*$`);G("HYPHENRANGELOOSE",`^\\s*(${C[R.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[R.XRANGEPLAINLOOSE]})\\s*$`);G("STAR","(<|>)?=?\\s*\\*");G("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");G("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var rr=k((Pd,hi)=>{"use strict";var tc=Object.freeze({loose:!0}),rc=Object.freeze({}),nc=r=>r?typeof r!="object"?tc:r:rc;hi.exports=nc});var Fr=k((Nd,yi)=>{"use strict";var mi=/^[0-9]+$/,gi=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=mi.test(r),n=mi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},ic=(r,e)=>gi(e,r);yi.exports={compareIdentifiers:gi,rcompareIdentifiers:ic}});var ye=k((Td,wi)=>{"use strict";var nr=qt(),{MAX_LENGTH:bi,MAX_SAFE_INTEGER:ir}=St(),{safeRe:sr,t:or}=Ct(),sc=rr(),{compareIdentifiers:kr}=Fr(),oc=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(kr(r[n],t[n])!==0)return!1;return!0},zr=class r{constructor(e,t){if(t=sc(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>bi)throw new TypeError(`version is longer than ${bi} characters`);nr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?sr[or.LOOSE]:sr[or.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ir||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ir||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ir||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<ir)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(nr("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(nr("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return kr(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(nr("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return kr(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?sr[or.PRERELEASELOOSE]:sr[or.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];if(n===!1&&(s=[t]),oc(this.prerelease,t)){let o=this.prerelease[t.split(".").length];isNaN(o)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};wi.exports=zr});var et=k((Dd,Ai)=>{"use strict";var Ei=ye(),ac=(r,e,t=!1)=>{if(r instanceof Ei)return r;try{return new Ei(r,e)}catch(n){if(!t)return null;throw n}};Ai.exports=ac});var _i=k((qd,Oi)=>{"use strict";var cc=et(),lc=(r,e)=>{let t=cc(r,e);return t?t.version:null};Oi.exports=lc});var Ci=k((Md,Si)=>{"use strict";var uc=et(),fc=(r,e)=>{let t=uc(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Si.exports=fc});var ji=k((Fd,xi)=>{"use strict";var Ri=ye(),dc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new Ri(r instanceof Ri?r.version:r,t).inc(e,n,i).version}catch{return null}};xi.exports=dc});var Ii=k((kd,$i)=>{"use strict";var vi=et(),pc=(r,e)=>{let t=vi(r,null,!0),n=vi(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,a=s?n:t,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==n.major?h+"major":t.minor!==n.minor?h+"minor":t.patch!==n.patch?h+"patch":"prerelease"};$i.exports=pc});var Pi=k((zd,Li)=>{"use strict";var hc=ye(),mc=(r,e)=>new hc(r,e).major;Li.exports=mc});var Ti=k((Ud,Ni)=>{"use strict";var gc=ye(),yc=(r,e)=>new gc(r,e).minor;Ni.exports=yc});var qi=k((Gd,Di)=>{"use strict";var bc=ye(),wc=(r,e)=>new bc(r,e).patch;Di.exports=wc});var Fi=k((Wd,Mi)=>{"use strict";var Ec=et(),Ac=(r,e)=>{let t=Ec(r,e);return t&&t.prerelease.length?t.prerelease:null};Mi.exports=Ac});var Pe=k((Hd,zi)=>{"use strict";var ki=ye(),Oc=(r,e,t)=>new ki(r,t).compare(new ki(e,t));zi.exports=Oc});var Gi=k((Vd,Ui)=>{"use strict";var _c=Pe(),Sc=(r,e,t)=>_c(e,r,t);Ui.exports=Sc});var Hi=k((Bd,Wi)=>{"use strict";var Cc=Pe(),Rc=(r,e)=>Cc(r,e,!0);Wi.exports=Rc});var ar=k((Yd,Bi)=>{"use strict";var Vi=ye(),xc=(r,e,t)=>{let n=new Vi(r,t),i=new Vi(e,t);return n.compare(i)||n.compareBuild(i)};Bi.exports=xc});var Ki=k((Kd,Yi)=>{"use strict";var jc=ar(),vc=(r,e)=>r.sort((t,n)=>jc(t,n,e));Yi.exports=vc});var Ji=k((Xd,Xi)=>{"use strict";var $c=ar(),Ic=(r,e)=>r.sort((t,n)=>$c(n,t,e));Xi.exports=Ic});var Mt=k((Jd,Qi)=>{"use strict";var Lc=Pe(),Pc=(r,e,t)=>Lc(r,e,t)>0;Qi.exports=Pc});var cr=k((Qd,Zi)=>{"use strict";var Nc=Pe(),Tc=(r,e,t)=>Nc(r,e,t)<0;Zi.exports=Tc});var Ur=k((Zd,es)=>{"use strict";var Dc=Pe(),qc=(r,e,t)=>Dc(r,e,t)===0;es.exports=qc});var Gr=k((ep,ts)=>{"use strict";var Mc=Pe(),Fc=(r,e,t)=>Mc(r,e,t)!==0;ts.exports=Fc});var lr=k((tp,rs)=>{"use strict";var kc=Pe(),zc=(r,e,t)=>kc(r,e,t)>=0;rs.exports=zc});var ur=k((rp,ns)=>{"use strict";var Uc=Pe(),Gc=(r,e,t)=>Uc(r,e,t)<=0;ns.exports=Gc});var Wr=k((np,is)=>{"use strict";var Wc=Ur(),Hc=Gr(),Vc=Mt(),Bc=lr(),Yc=cr(),Kc=ur(),Xc=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Wc(r,t,n);case"!=":return Hc(r,t,n);case">":return Vc(r,t,n);case">=":return Bc(r,t,n);case"<":return Yc(r,t,n);case"<=":return Kc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};is.exports=Xc});var os=k((ip,ss)=>{"use strict";var Jc=ye(),Qc=et(),{safeRe:fr,t:dr}=Ct(),Zc=(r,e)=>{if(r instanceof Jc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?fr[dr.COERCEFULL]:fr[dr.COERCE]);else{let u=e.includePrerelease?fr[dr.COERCERTLFULL]:fr[dr.COERCERTL],p;for(;(p=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||p.index+p[0].length!==t.index+t[0].length)&&(t=p),u.lastIndex=p.index+p[1].length+p[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",a=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Qc(`${n}.${i}.${s}${o}${a}`,e)};ss.exports=Zc});var cs=k((sp,as)=>{"use strict";var el=et(),tl=St(),rl=ye(),nl=(r,e,t)=>{if(!tl.RELEASE_TYPES.includes(e))return null;let n=il(r,t);return n&&sl(n,e)},il=(r,e)=>{let t=r instanceof rl?r.version:r;return el(t,e)},sl=(r,e)=>{if(ol(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},ol=r=>r.startsWith("pre");as.exports=nl});var us=k((op,ls)=>{"use strict";var Hr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};ls.exports=Hr});var Ne=k((ap,hs)=>{"use strict";var al=/\s+/g,Vr=class r{constructor(e,t){if(t=ll(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Br)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(al," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!ds(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&bl(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(yl,"");let n=((this.options.includePrerelease&&ml)|(this.options.loose&&gl))+":"+e,i=fs.get(n);if(i)return i;let s=this.options.loose,o=s?_e[be.HYPHENRANGELOOSE]:_e[be.HYPHENRANGE];e=e.replace(o,vl(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(_e[be.COMPARATORTRIM],dl),re("comparator trim",e),e=e.replace(_e[be.TILDETRIM],pl),re("tilde trim",e),e=e.replace(_e[be.CARETTRIM],hl),re("caret trim",e);let a=e.split(" ").map(l=>wl(l,this.options)).join(" ").split(/\s+/).map(l=>jl(l,this.options));s&&(a=a.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(_e[be.COMPARATORLOOSE])))),re("range list",a);let u=new Map,p=a.map(l=>new Br(l,this.options));for(let l of p){if(ds(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return fs.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>ps(n,t)&&e.set.some(i=>ps(i,t)&&n.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new ul(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if($l(this.set[t],e,this.options))return!0;return!1}};hs.exports=Vr;var cl=us(),fs=new cl,ll=rr(),Br=Ft(),re=qt(),ul=ye(),{safeRe:_e,src:fl,t:be,comparatorTrimReplace:dl,tildeTrimReplace:pl,caretTrimReplace:hl}=Ct(),{FLAG_INCLUDE_PRERELEASE:ml,FLAG_LOOSE:gl}=St(),yl=new RegExp(fl[be.BUILD],"g"),ds=r=>r.value==="<0.0.0-0",bl=r=>r.value==="",ps=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},wl=(r,e)=>(r=r.replace(_e[be.BUILD],""),re("comp",r,e),r=_l(r,e),re("caret",r),r=Al(r,e),re("tildes",r),r=Cl(r,e),re("xrange",r),r=xl(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",El=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),Al=(r,e)=>r.trim().split(/\s+/).map(t=>Ol(t,e)).join(" "),Ol=(r,e)=>{let t=e.loose?_e[be.TILDELOOSE]:_e[be.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,a,u)=>{re("tilde",r,i,s,o,a,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(a)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},_l=(r,e)=>r.trim().split(/\s+/).map(t=>Sl(t,e)).join(" "),Sl=(r,e)=>{re("caret",r,e);let t=e.loose?_e[be.CARETLOOSE]:_e[be.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,a,u)=>{re("caret",r,i,s,o,a,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(a)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(re("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:p=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${a} <${s}.${o}.${+a+1}-0`:p=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),re("caret return",p),p})},Cl=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>Rl(t,e)).join(" ")),Rl=(r,e)=>{r=r.trim();let t=e.loose?_e[be.XRANGELOOSE]:_e[be.XRANGE];return r.replace(t,(n,i,s,o,a,u)=>{if(re("xRange",r,n,i,s,o,a,u),El(s,o,a))return r;let p=de(s),h=p||de(o),l=h||de(a),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),a=0,i===">"?(i=">=",h?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${a}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),re("xRange return",n),n})},xl=(r,e)=>(re("replaceStars",r,e),r.trim().replace(_e[be.STAR],"")),jl=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(_e[e.includePrerelease?be.GTE0PRE:be.GTE0],"")),vl=r=>(e,t,n,i,s,o,a,u,p,h,l,b)=>(de(n)?t="":de(i)?t=`>=${n}.0.0${r?"-0":""}`:de(s)?t=`>=${n}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,de(p)?u="":de(h)?u=`<${+p+1}.0.0-0`:de(l)?u=`<${p}.${+h+1}.0-0`:b?u=`<=${p}.${h}.${l}-${b}`:r?u=`<${p}.${h}.${+l+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),$l=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(re(r[n].semver),r[n].semver!==Br.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Ft=k((cp,Es)=>{"use strict";var kt=Symbol("SemVer ANY"),Xr=class r{static get ANY(){return kt}constructor(e,t){if(t=ms(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Kr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===kt?this.value="":this.value=this.operator+this.semver.version,Kr("comp",this)}parse(e){let t=this.options.loose?gs[ys.COMPARATORLOOSE]:gs[ys.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new bs(n[2],this.options.loose):this.semver=kt}toString(){return this.value}test(e){if(Kr("Comparator.test",e,this.options.loose),this.semver===kt||e===kt)return!0;if(typeof e=="string")try{e=new bs(e,this.options)}catch{return!1}return Yr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new ws(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new ws(this.value,t).test(e.semver):(t=ms(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Yr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Yr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};Es.exports=Xr;var ms=rr(),{safeRe:gs,t:ys}=Ct(),Yr=Wr(),Kr=qt(),bs=ye(),ws=Ne()});var zt=k((lp,As)=>{"use strict";var Il=Ne(),Ll=(r,e,t)=>{try{e=new Il(e,t)}catch{return!1}return e.test(r)};As.exports=Ll});var _s=k((up,Os)=>{"use strict";var Pl=Ne(),Nl=(r,e)=>new Pl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));Os.exports=Nl});var Cs=k((fp,Ss)=>{"use strict";var Tl=ye(),Dl=Ne(),ql=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Dl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Tl(n,t))}),n};Ss.exports=ql});var xs=k((dp,Rs)=>{"use strict";var Ml=ye(),Fl=Ne(),kl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new Fl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Ml(n,t))}),n};Rs.exports=kl});var $s=k((pp,vs)=>{"use strict";var Jr=ye(),zl=Ne(),js=Mt(),Ul=(r,e)=>{r=new zl(r,e);let t=new Jr("0.0.0");if(r.test(t)||(t=new Jr("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(o=>{let a=new Jr(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||js(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||js(t,s))&&(t=s)}return t&&r.test(t)?t:null};vs.exports=Ul});var Ls=k((hp,Is)=>{"use strict";var Gl=Ne(),Wl=(r,e)=>{try{return new Gl(r,e).range||"*"}catch{return null}};Is.exports=Wl});var pr=k((mp,Ds)=>{"use strict";var Hl=ye(),Ts=Ft(),{ANY:Vl}=Ts,Bl=Ne(),Yl=zt(),Ps=Mt(),Ns=cr(),Kl=ur(),Xl=lr(),Jl=(r,e,t,n)=>{r=new Hl(r,n),e=new Bl(e,n);let i,s,o,a,u;switch(t){case">":i=Ps,s=Kl,o=Ns,a=">",u=">=";break;case"<":i=Ns,s=Xl,o=Ps,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Yl(r,e,n))return!1;for(let p=0;p<e.set.length;++p){let h=e.set[p],l=null,b=null;if(h.forEach(m=>{m.semver===Vl&&(m=new Ts(">=0.0.0")),l=l||m,b=b||m,i(m.semver,l.semver,n)?l=m:o(m.semver,b.semver,n)&&(b=m)}),l.operator===a||l.operator===u||(!b.operator||b.operator===a)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};Ds.exports=Jl});var Ms=k((gp,qs)=>{"use strict";var Ql=pr(),Zl=(r,e,t)=>Ql(r,e,">",t);qs.exports=Zl});var ks=k((yp,Fs)=>{"use strict";var eu=pr(),tu=(r,e,t)=>eu(r,e,"<",t);Fs.exports=tu});var Gs=k((bp,Us)=>{"use strict";var zs=Ne(),ru=(r,e,t)=>(r=new zs(r,t),e=new zs(e,t),r.intersects(e,t));Us.exports=ru});var Hs=k((wp,Ws)=>{"use strict";var nu=zt(),iu=Pe();Ws.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>iu(h,l,t));for(let h of o)nu(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let a=[];for(let[h,l]of n)h===l?a.push(h):!l&&h===o[0]?a.push("*"):l?h===o[0]?a.push(`<=${l}`):a.push(`${h} - ${l}`):a.push(`>=${h}`);let u=a.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Js=k((Ep,Xs)=>{"use strict";var Vs=Ne(),en=Ft(),{ANY:Qr}=en,Zr=zt(),tn=Pe(),su=(r,e,t={})=>{if(r===e)return!0;r=new Vs(r,t),e=new Vs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=au(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},ou=[new en(">=0.0.0-0")],Bs=[new en(">=0.0.0")],au=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Qr){if(e.length===1&&e[0].semver===Qr)return!0;t.includePrerelease?r=ou:r=Bs}if(e.length===1&&e[0].semver===Qr){if(t.includePrerelease)return!0;e=Bs}let n=new Set,i,s;for(let m of r)m.operator===">"||m.operator===">="?i=Ys(i,m,t):m.operator==="<"||m.operator==="<="?s=Ks(s,m,t):n.add(m.semver);if(n.size>1)return null;let o;if(i&&s){if(o=tn(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let m of n){if(i&&!Zr(m,String(i),t)||s&&!Zr(m,String(s),t))return null;for(let E of e)if(!Zr(m,String(E),t))return!1;return!0}let a,u,p,h,l=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let m of e){if(h=h||m.operator===">"||m.operator===">=",p=p||m.operator==="<"||m.operator==="<=",i){if(b&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===b.major&&m.semver.minor===b.minor&&m.semver.patch===b.patch&&(b=!1),m.operator===">"||m.operator===">="){if(a=Ys(i,m,t),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(s){if(l&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===l.major&&m.semver.minor===l.minor&&m.semver.patch===l.patch&&(l=!1),m.operator==="<"||m.operator==="<="){if(u=Ks(s,m,t),u===m&&u!==s)return!1}else if(s.operator==="<="&&!m.test(s.semver))return!1}if(!m.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Ys=(r,e,t)=>{if(!r)return e;let n=tn(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Ks=(r,e,t)=>{if(!r)return e;let n=tn(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Xs.exports=su});var hr=k((Ap,eo)=>{"use strict";var rn=Ct(),Qs=St(),cu=ye(),Zs=Fr(),lu=et(),uu=_i(),fu=Ci(),du=ji(),pu=Ii(),hu=Pi(),mu=Ti(),gu=qi(),yu=Fi(),bu=Pe(),wu=Gi(),Eu=Hi(),Au=ar(),Ou=Ki(),_u=Ji(),Su=Mt(),Cu=cr(),Ru=Ur(),xu=Gr(),ju=lr(),vu=ur(),$u=Wr(),Iu=os(),Lu=cs(),Pu=Ft(),Nu=Ne(),Tu=zt(),Du=_s(),qu=Cs(),Mu=xs(),Fu=$s(),ku=Ls(),zu=pr(),Uu=Ms(),Gu=ks(),Wu=Gs(),Hu=Hs(),Vu=Js();eo.exports={parse:lu,valid:uu,clean:fu,inc:du,diff:pu,major:hu,minor:mu,patch:gu,prerelease:yu,compare:bu,rcompare:wu,compareLoose:Eu,compareBuild:Au,sort:Ou,rsort:_u,gt:Su,lt:Cu,eq:Ru,neq:xu,gte:ju,lte:vu,cmp:$u,coerce:Iu,truncate:Lu,Comparator:Pu,Range:Nu,satisfies:Tu,toComparators:Du,maxSatisfying:qu,minSatisfying:Mu,minVersion:Fu,validRange:ku,outside:zu,gtr:Uu,ltr:Gu,intersects:Wu,simplifyRange:Hu,subset:Vu,SemVer:cu,re:rn.re,src:rn.src,tokens:rn.t,SEMVER_SPEC_VERSION:Qs.SEMVER_SPEC_VERSION,RELEASE_TYPES:Qs.RELEASE_TYPES,compareIdentifiers:Zs.compareIdentifiers,rcompareIdentifiers:Zs.rcompareIdentifiers}});var mr=Xt(hr(),1);import*as Ut from"node:process";try{let r=ii?.node;typeof r=="string"&&!mr.satisfies(Ut.version,r)&&H.warn(`
|
|
8
|
+
import{a as si,f as te}from"./chunks/U5DIFWGH.js";import{a as oi,c as ai}from"./chunks/LRRSU5UY.js";import{a as er}from"./chunks/3NMOCTX3.js";import{a as ka}from"./chunks/ERBLCNSR.js";import{a as ci,c as tr,d as Dr,e as ui,g as fi}from"./chunks/TZMWTSOQ.js";import{a as Le,b as ni,c as ii}from"./chunks/243MQEX6.js";import{a as li}from"./chunks/S3LDGEL4.js";import{a as ri}from"./chunks/3M4I4RF5.js";import{Ba as ti,O as Yn,R as Kn,Z as Dt,a as Vn,aa as _t,ba as Jt,c as Oe,ea as ct,ga as Xn,ia as H,ja as Qt,ka as Jn,l as Tr,oa as ge,pa as Zt,sa as Qn,u as Bn,va as Zn,wa as ei}from"./chunks/A7GSAEEX.js";import"./chunks/NEWT5A6S.js";import{a as Ue,c as k,e as Xt}from"./chunks/RFWIIJFG.js";var St=k((Ld,di)=>{"use strict";var za="2.0.0",Ua=Number.MAX_SAFE_INTEGER||9007199254740991,Ga=16,Wa=250,Ha=["major","premajor","minor","preminor","patch","prepatch","prerelease"];di.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Ga,MAX_SAFE_BUILD_LENGTH:Wa,MAX_SAFE_INTEGER:Ua,RELEASE_TYPES:Ha,SEMVER_SPEC_VERSION:za,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qt=k((Pd,pi)=>{"use strict";var Va=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};pi.exports=Va});var Ct=k((Ge,hi)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:qr,MAX_SAFE_BUILD_LENGTH:Ba,MAX_LENGTH:Ya}=St(),Ka=qt();Ge=hi.exports={};var Xa=Ge.re=[],Ja=Ge.safeRe=[],C=Ge.src=[],Qa=Ge.safeSrc=[],R=Ge.t={},Za=0,Mr="[a-zA-Z0-9-]",ec=[["\\s",1],["\\d",Ya],[Mr,Ba]],tc=r=>{for(let[e,t]of ec)r=r.split(`${e}*`).join(`${e}{0,${t}}`).split(`${e}+`).join(`${e}{1,${t}}`);return r},G=(r,e,t)=>{let n=tc(e),i=Za++;Ka(r,i,e),R[r]=i,C[i]=e,Qa[i]=n,Xa[i]=new RegExp(e,t?"g":void 0),Ja[i]=new RegExp(n,t?"g":void 0)};G("NUMERICIDENTIFIER","0|[1-9]\\d*");G("NUMERICIDENTIFIERLOOSE","\\d+");G("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Mr}*`);G("MAINVERSION",`(${C[R.NUMERICIDENTIFIER]})\\.(${C[R.NUMERICIDENTIFIER]})\\.(${C[R.NUMERICIDENTIFIER]})`);G("MAINVERSIONLOOSE",`(${C[R.NUMERICIDENTIFIERLOOSE]})\\.(${C[R.NUMERICIDENTIFIERLOOSE]})\\.(${C[R.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASEIDENTIFIER",`(?:${C[R.NONNUMERICIDENTIFIER]}|${C[R.NUMERICIDENTIFIER]})`);G("PRERELEASEIDENTIFIERLOOSE",`(?:${C[R.NONNUMERICIDENTIFIER]}|${C[R.NUMERICIDENTIFIERLOOSE]})`);G("PRERELEASE",`(?:-(${C[R.PRERELEASEIDENTIFIER]}(?:\\.${C[R.PRERELEASEIDENTIFIER]})*))`);G("PRERELEASELOOSE",`(?:-?(${C[R.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${C[R.PRERELEASEIDENTIFIERLOOSE]})*))`);G("BUILDIDENTIFIER",`${Mr}+`);G("BUILD",`(?:\\+(${C[R.BUILDIDENTIFIER]}(?:\\.${C[R.BUILDIDENTIFIER]})*))`);G("FULLPLAIN",`v?${C[R.MAINVERSION]}${C[R.PRERELEASE]}?${C[R.BUILD]}?`);G("FULL",`^${C[R.FULLPLAIN]}$`);G("LOOSEPLAIN",`[v=\\s]*${C[R.MAINVERSIONLOOSE]}${C[R.PRERELEASELOOSE]}?${C[R.BUILD]}?`);G("LOOSE",`^${C[R.LOOSEPLAIN]}$`);G("GTLT","((?:<|>)?=?)");G("XRANGEIDENTIFIERLOOSE",`${C[R.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);G("XRANGEIDENTIFIER",`${C[R.NUMERICIDENTIFIER]}|x|X|\\*`);G("XRANGEPLAIN",`[v=\\s]*(${C[R.XRANGEIDENTIFIER]})(?:\\.(${C[R.XRANGEIDENTIFIER]})(?:\\.(${C[R.XRANGEIDENTIFIER]})(?:${C[R.PRERELEASE]})?${C[R.BUILD]}?)?)?`);G("XRANGEPLAINLOOSE",`[v=\\s]*(${C[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[R.XRANGEIDENTIFIERLOOSE]})(?:\\.(${C[R.XRANGEIDENTIFIERLOOSE]})(?:${C[R.PRERELEASELOOSE]})?${C[R.BUILD]}?)?)?`);G("XRANGE",`^${C[R.GTLT]}\\s*${C[R.XRANGEPLAIN]}$`);G("XRANGELOOSE",`^${C[R.GTLT]}\\s*${C[R.XRANGEPLAINLOOSE]}$`);G("COERCEPLAIN",`(^|[^\\d])(\\d{1,${qr}})(?:\\.(\\d{1,${qr}}))?(?:\\.(\\d{1,${qr}}))?`);G("COERCE",`${C[R.COERCEPLAIN]}(?:$|[^\\d])`);G("COERCEFULL",C[R.COERCEPLAIN]+`(?:${C[R.PRERELEASE]})?(?:${C[R.BUILD]})?(?:$|[^\\d])`);G("COERCERTL",C[R.COERCE],!0);G("COERCERTLFULL",C[R.COERCEFULL],!0);G("LONETILDE","(?:~>?)");G("TILDETRIM",`(\\s*)${C[R.LONETILDE]}\\s+`,!0);Ge.tildeTrimReplace="$1~";G("TILDE",`^${C[R.LONETILDE]}${C[R.XRANGEPLAIN]}$`);G("TILDELOOSE",`^${C[R.LONETILDE]}${C[R.XRANGEPLAINLOOSE]}$`);G("LONECARET","(?:\\^)");G("CARETTRIM",`(\\s*)${C[R.LONECARET]}\\s+`,!0);Ge.caretTrimReplace="$1^";G("CARET",`^${C[R.LONECARET]}${C[R.XRANGEPLAIN]}$`);G("CARETLOOSE",`^${C[R.LONECARET]}${C[R.XRANGEPLAINLOOSE]}$`);G("COMPARATORLOOSE",`^${C[R.GTLT]}\\s*(${C[R.LOOSEPLAIN]})$|^$`);G("COMPARATOR",`^${C[R.GTLT]}\\s*(${C[R.FULLPLAIN]})$|^$`);G("COMPARATORTRIM",`(\\s*)${C[R.GTLT]}\\s*(${C[R.LOOSEPLAIN]}|${C[R.XRANGEPLAIN]})`,!0);Ge.comparatorTrimReplace="$1$2$3";G("HYPHENRANGE",`^\\s*(${C[R.XRANGEPLAIN]})\\s+-\\s+(${C[R.XRANGEPLAIN]})\\s*$`);G("HYPHENRANGELOOSE",`^\\s*(${C[R.XRANGEPLAINLOOSE]})\\s+-\\s+(${C[R.XRANGEPLAINLOOSE]})\\s*$`);G("STAR","(<|>)?=?\\s*\\*");G("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");G("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var rr=k((Nd,mi)=>{"use strict";var rc=Object.freeze({loose:!0}),nc=Object.freeze({}),ic=r=>r?typeof r!="object"?rc:r:nc;mi.exports=ic});var Fr=k((Td,bi)=>{"use strict";var gi=/^[0-9]+$/,yi=(r,e)=>{if(typeof r=="number"&&typeof e=="number")return r===e?0:r<e?-1:1;let t=gi.test(r),n=gi.test(e);return t&&n&&(r=+r,e=+e),r===e?0:t&&!n?-1:n&&!t?1:r<e?-1:1},sc=(r,e)=>yi(e,r);bi.exports={compareIdentifiers:yi,rcompareIdentifiers:sc}});var ye=k((Dd,Ei)=>{"use strict";var nr=qt(),{MAX_LENGTH:wi,MAX_SAFE_INTEGER:ir}=St(),{safeRe:sr,t:or}=Ct(),oc=rr(),{compareIdentifiers:kr}=Fr(),ac=(r,e)=>{let t=e.split(".");if(t.length>r.length)return!1;for(let n=0;n<t.length;n++)if(kr(r[n],t[n])!==0)return!1;return!0},zr=class r{constructor(e,t){if(t=oc(t),e instanceof r){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>wi)throw new TypeError(`version is longer than ${wi} characters`);nr("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?sr[or.LOOSE]:sr[or.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ir||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ir||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ir||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let s=+i;if(s>=0&&s<ir)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(nr("SemVer.compare",this.version,this.options,e),!(e instanceof r)){if(typeof e=="string"&&e===this.version)return 0;e=new r(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof r||(e=new r(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof r||(e=new r(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let n=this.prerelease[t],i=e.prerelease[t];if(nr("prerelease compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return kr(n,i)}while(++t)}compareBuild(e){e instanceof r||(e=new r(e,this.options));let t=0;do{let n=this.build[t],i=e.build[t];if(nr("build compare",t,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return kr(n,i)}while(++t)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(t){let i=`-${t}`.match(this.options.loose?sr[or.PRERELEASELOOSE]:sr[or.PRERELEASE]);if(!i||i[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(t===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(t){let s=[t,i];if(n===!1&&(s=[t]),ac(this.prerelease,t)){let o=this.prerelease[t.split(".").length];isNaN(o)&&(this.prerelease=s)}else this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};Ei.exports=zr});var et=k((qd,Oi)=>{"use strict";var Ai=ye(),cc=(r,e,t=!1)=>{if(r instanceof Ai)return r;try{return new Ai(r,e)}catch(n){if(!t)return null;throw n}};Oi.exports=cc});var Si=k((Md,_i)=>{"use strict";var lc=et(),uc=(r,e)=>{let t=lc(r,e);return t?t.version:null};_i.exports=uc});var Ri=k((Fd,Ci)=>{"use strict";var fc=et(),dc=(r,e)=>{let t=fc(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};Ci.exports=dc});var vi=k((kd,ji)=>{"use strict";var xi=ye(),pc=(r,e,t,n,i)=>{typeof t=="string"&&(i=n,n=t,t=void 0);try{return new xi(r instanceof xi?r.version:r,t).inc(e,n,i).version}catch{return null}};ji.exports=pc});var Li=k((zd,Ii)=>{"use strict";var $i=et(),hc=(r,e)=>{let t=$i(r,null,!0),n=$i(e,null,!0),i=t.compare(n);if(i===0)return null;let s=i>0,o=s?t:n,a=s?n:t,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(o)===0)return a.minor&&!a.patch?"minor":"patch"}let h=u?"pre":"";return t.major!==n.major?h+"major":t.minor!==n.minor?h+"minor":t.patch!==n.patch?h+"patch":"prerelease"};Ii.exports=hc});var Ni=k((Ud,Pi)=>{"use strict";var mc=ye(),gc=(r,e)=>new mc(r,e).major;Pi.exports=gc});var Di=k((Gd,Ti)=>{"use strict";var yc=ye(),bc=(r,e)=>new yc(r,e).minor;Ti.exports=bc});var Mi=k((Wd,qi)=>{"use strict";var wc=ye(),Ec=(r,e)=>new wc(r,e).patch;qi.exports=Ec});var ki=k((Hd,Fi)=>{"use strict";var Ac=et(),Oc=(r,e)=>{let t=Ac(r,e);return t&&t.prerelease.length?t.prerelease:null};Fi.exports=Oc});var Pe=k((Vd,Ui)=>{"use strict";var zi=ye(),_c=(r,e,t)=>new zi(r,t).compare(new zi(e,t));Ui.exports=_c});var Wi=k((Bd,Gi)=>{"use strict";var Sc=Pe(),Cc=(r,e,t)=>Sc(e,r,t);Gi.exports=Cc});var Vi=k((Yd,Hi)=>{"use strict";var Rc=Pe(),xc=(r,e)=>Rc(r,e,!0);Hi.exports=xc});var ar=k((Kd,Yi)=>{"use strict";var Bi=ye(),jc=(r,e,t)=>{let n=new Bi(r,t),i=new Bi(e,t);return n.compare(i)||n.compareBuild(i)};Yi.exports=jc});var Xi=k((Xd,Ki)=>{"use strict";var vc=ar(),$c=(r,e)=>r.sort((t,n)=>vc(t,n,e));Ki.exports=$c});var Qi=k((Jd,Ji)=>{"use strict";var Ic=ar(),Lc=(r,e)=>r.sort((t,n)=>Ic(n,t,e));Ji.exports=Lc});var Mt=k((Qd,Zi)=>{"use strict";var Pc=Pe(),Nc=(r,e,t)=>Pc(r,e,t)>0;Zi.exports=Nc});var cr=k((Zd,es)=>{"use strict";var Tc=Pe(),Dc=(r,e,t)=>Tc(r,e,t)<0;es.exports=Dc});var Ur=k((ep,ts)=>{"use strict";var qc=Pe(),Mc=(r,e,t)=>qc(r,e,t)===0;ts.exports=Mc});var Gr=k((tp,rs)=>{"use strict";var Fc=Pe(),kc=(r,e,t)=>Fc(r,e,t)!==0;rs.exports=kc});var lr=k((rp,ns)=>{"use strict";var zc=Pe(),Uc=(r,e,t)=>zc(r,e,t)>=0;ns.exports=Uc});var ur=k((np,is)=>{"use strict";var Gc=Pe(),Wc=(r,e,t)=>Gc(r,e,t)<=0;is.exports=Wc});var Wr=k((ip,ss)=>{"use strict";var Hc=Ur(),Vc=Gr(),Bc=Mt(),Yc=lr(),Kc=cr(),Xc=ur(),Jc=(r,e,t,n)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Hc(r,t,n);case"!=":return Vc(r,t,n);case">":return Bc(r,t,n);case">=":return Yc(r,t,n);case"<":return Kc(r,t,n);case"<=":return Xc(r,t,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ss.exports=Jc});var as=k((sp,os)=>{"use strict";var Qc=ye(),Zc=et(),{safeRe:fr,t:dr}=Ct(),el=(r,e)=>{if(r instanceof Qc)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(e.includePrerelease?fr[dr.COERCEFULL]:fr[dr.COERCE]);else{let u=e.includePrerelease?fr[dr.COERCERTLFULL]:fr[dr.COERCERTL],p;for(;(p=u.exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||p.index+p[0].length!==t.index+t[0].length)&&(t=p),u.lastIndex=p.index+p[1].length+p[2].length;u.lastIndex=-1}if(t===null)return null;let n=t[2],i=t[3]||"0",s=t[4]||"0",o=e.includePrerelease&&t[5]?`-${t[5]}`:"",a=e.includePrerelease&&t[6]?`+${t[6]}`:"";return Zc(`${n}.${i}.${s}${o}${a}`,e)};os.exports=el});var ls=k((op,cs)=>{"use strict";var tl=et(),rl=St(),nl=ye(),il=(r,e,t)=>{if(!rl.RELEASE_TYPES.includes(e))return null;let n=sl(r,t);return n&&ol(n,e)},sl=(r,e)=>{let t=r instanceof nl?r.version:r;return tl(t,e)},ol=(r,e)=>{if(al(e))return r.version;switch(r.prerelease=[],e){case"major":r.minor=0,r.patch=0;break;case"minor":r.patch=0;break}return r.format()},al=r=>r.startsWith("pre");cs.exports=il});var fs=k((ap,us)=>{"use strict";var Hr=class{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(t!==void 0)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,t)}return this}};us.exports=Hr});var Ne=k((cp,ms)=>{"use strict";var cl=/\s+/g,Vr=class r{constructor(e,t){if(t=ul(t),e instanceof r)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new r(e.raw,t);if(e instanceof Br)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(cl," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!ps(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&wl(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let n=0;n<t.length;n++)n>0&&(this.formatted+=" "),this.formatted+=t[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(bl,"");let n=((this.options.includePrerelease&&gl)|(this.options.loose&&yl))+":"+e,i=ds.get(n);if(i)return i;let s=this.options.loose,o=s?_e[be.HYPHENRANGELOOSE]:_e[be.HYPHENRANGE];e=e.replace(o,$l(this.options.includePrerelease)),re("hyphen replace",e),e=e.replace(_e[be.COMPARATORTRIM],pl),re("comparator trim",e),e=e.replace(_e[be.TILDETRIM],hl),re("tilde trim",e),e=e.replace(_e[be.CARETTRIM],ml),re("caret trim",e);let a=e.split(" ").map(l=>El(l,this.options)).join(" ").split(/\s+/).map(l=>vl(l,this.options));s&&(a=a.filter(l=>(re("loose invalid filter",l,this.options),!!l.match(_e[be.COMPARATORLOOSE])))),re("range list",a);let u=new Map,p=a.map(l=>new Br(l,this.options));for(let l of p){if(ps(l))return[l];u.set(l.value,l)}u.size>1&&u.has("")&&u.delete("");let h=[...u.values()];return ds.set(n,h),h}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Range is required");return this.set.some(n=>hs(n,t)&&e.set.some(i=>hs(i,t)&&n.every(s=>i.every(o=>s.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new fl(e,this.options)}catch{return!1}for(let t=0;t<this.set.length;t++)if(Il(this.set[t],e,this.options))return!0;return!1}};ms.exports=Vr;var ll=fs(),ds=new ll,ul=rr(),Br=Ft(),re=qt(),fl=ye(),{safeRe:_e,src:dl,t:be,comparatorTrimReplace:pl,tildeTrimReplace:hl,caretTrimReplace:ml}=Ct(),{FLAG_INCLUDE_PRERELEASE:gl,FLAG_LOOSE:yl}=St(),bl=new RegExp(dl[be.BUILD],"g"),ps=r=>r.value==="<0.0.0-0",wl=r=>r.value==="",hs=(r,e)=>{let t=!0,n=r.slice(),i=n.pop();for(;t&&n.length;)t=n.every(s=>i.intersects(s,e)),i=n.pop();return t},El=(r,e)=>(r=r.replace(_e[be.BUILD],""),re("comp",r,e),r=Sl(r,e),re("caret",r),r=Ol(r,e),re("tildes",r),r=Rl(r,e),re("xrange",r),r=jl(r,e),re("stars",r),r),de=r=>!r||r.toLowerCase()==="x"||r==="*",Al=(r,e,t)=>de(r)&&!de(e)||de(e)&&t&&!de(t),Ol=(r,e)=>r.trim().split(/\s+/).map(t=>_l(t,e)).join(" "),_l=(r,e)=>{let t=e.loose?_e[be.TILDELOOSE]:_e[be.TILDE],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,a,u)=>{re("tilde",r,i,s,o,a,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(a)?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:u?(re("replaceTilde pr",u),p=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`):p=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`,re("tilde return",p),p})},Sl=(r,e)=>r.trim().split(/\s+/).map(t=>Cl(t,e)).join(" "),Cl=(r,e)=>{re("caret",r,e);let t=e.loose?_e[be.CARETLOOSE]:_e[be.CARET],n=e.includePrerelease?"-0":"";return r.replace(t,(i,s,o,a,u)=>{re("caret",r,i,s,o,a,u);let p;return de(s)?p="":de(o)?p=`>=${s}.0.0${n} <${+s+1}.0.0-0`:de(a)?s==="0"?p=`>=${s}.${o}.0${n} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.0${n} <${+s+1}.0.0-0`:u?(re("replaceCaret pr",u),s==="0"?o==="0"?p=`>=${s}.${o}.${a}-${u} <${s}.${o}.${+a+1}-0`:p=`>=${s}.${o}.${a}-${u} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${a}-${u} <${+s+1}.0.0-0`):(re("no pr"),s==="0"?o==="0"?p=`>=${s}.${o}.${a} <${s}.${o}.${+a+1}-0`:p=`>=${s}.${o}.${a} <${s}.${+o+1}.0-0`:p=`>=${s}.${o}.${a} <${+s+1}.0.0-0`),re("caret return",p),p})},Rl=(r,e)=>(re("replaceXRanges",r,e),r.split(/\s+/).map(t=>xl(t,e)).join(" ")),xl=(r,e)=>{r=r.trim();let t=e.loose?_e[be.XRANGELOOSE]:_e[be.XRANGE];return r.replace(t,(n,i,s,o,a,u)=>{if(re("xRange",r,n,i,s,o,a,u),Al(s,o,a))return r;let p=de(s),h=p||de(o),l=h||de(a),b=l;return i==="="&&b&&(i=""),u=e.includePrerelease?"-0":"",p?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&b?(h&&(o=0),a=0,i===">"?(i=">=",h?(s=+s+1,o=0,a=0):(o=+o+1,a=0)):i==="<="&&(i="<",h?s=+s+1:o=+o+1),i==="<"&&(u="-0"),n=`${i+s}.${o}.${a}${u}`):h?n=`>=${s}.0.0${u} <${+s+1}.0.0-0`:l&&(n=`>=${s}.${o}.0${u} <${s}.${+o+1}.0-0`),re("xRange return",n),n})},jl=(r,e)=>(re("replaceStars",r,e),r.trim().replace(_e[be.STAR],"")),vl=(r,e)=>(re("replaceGTE0",r,e),r.trim().replace(_e[e.includePrerelease?be.GTE0PRE:be.GTE0],"")),$l=r=>(e,t,n,i,s,o,a,u,p,h,l,b)=>(de(n)?t="":de(i)?t=`>=${n}.0.0${r?"-0":""}`:de(s)?t=`>=${n}.${i}.0${r?"-0":""}`:o?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,de(p)?u="":de(h)?u=`<${+p+1}.0.0-0`:de(l)?u=`<${p}.${+h+1}.0-0`:b?u=`<=${p}.${h}.${l}-${b}`:r?u=`<${p}.${h}.${+l+1}-0`:u=`<=${u}`,`${t} ${u}`.trim()),Il=(r,e,t)=>{for(let n=0;n<r.length;n++)if(!r[n].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let n=0;n<r.length;n++)if(re(r[n].semver),r[n].semver!==Br.ANY&&r[n].semver.prerelease.length>0){let i=r[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Ft=k((lp,As)=>{"use strict";var kt=Symbol("SemVer ANY"),Xr=class r{static get ANY(){return kt}constructor(e,t){if(t=gs(t),e instanceof r){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Kr("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===kt?this.value="":this.value=this.operator+this.semver.version,Kr("comp",this)}parse(e){let t=this.options.loose?ys[bs.COMPARATORLOOSE]:ys[bs.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new ws(n[2],this.options.loose):this.semver=kt}toString(){return this.value}test(e){if(Kr("Comparator.test",e,this.options.loose),this.semver===kt||e===kt)return!0;if(typeof e=="string")try{e=new ws(e,this.options)}catch{return!1}return Yr(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Es(e.value,t).test(this.value):e.operator===""?e.value===""?!0:new Es(this.value,t).test(e.semver):(t=gs(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Yr(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Yr(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};As.exports=Xr;var gs=rr(),{safeRe:ys,t:bs}=Ct(),Yr=Wr(),Kr=qt(),ws=ye(),Es=Ne()});var zt=k((up,Os)=>{"use strict";var Ll=Ne(),Pl=(r,e,t)=>{try{e=new Ll(e,t)}catch{return!1}return e.test(r)};Os.exports=Pl});var Ss=k((fp,_s)=>{"use strict";var Nl=Ne(),Tl=(r,e)=>new Nl(r,e).set.map(t=>t.map(n=>n.value).join(" ").trim().split(" "));_s.exports=Tl});var Rs=k((dp,Cs)=>{"use strict";var Dl=ye(),ql=Ne(),Ml=(r,e,t)=>{let n=null,i=null,s=null;try{s=new ql(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new Dl(n,t))}),n};Cs.exports=Ml});var js=k((pp,xs)=>{"use strict";var Fl=ye(),kl=Ne(),zl=(r,e,t)=>{let n=null,i=null,s=null;try{s=new kl(e,t)}catch{return null}return r.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Fl(n,t))}),n};xs.exports=zl});var Is=k((hp,$s)=>{"use strict";var Jr=ye(),Ul=Ne(),vs=Mt(),Gl=(r,e)=>{r=new Ul(r,e);let t=new Jr("0.0.0");if(r.test(t)||(t=new Jr("0.0.0-0"),r.test(t)))return t;t=null;for(let n=0;n<r.set.length;++n){let i=r.set[n],s=null;i.forEach(o=>{let a=new Jr(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||vs(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!t||vs(t,s))&&(t=s)}return t&&r.test(t)?t:null};$s.exports=Gl});var Ps=k((mp,Ls)=>{"use strict";var Wl=Ne(),Hl=(r,e)=>{try{return new Wl(r,e).range||"*"}catch{return null}};Ls.exports=Hl});var pr=k((gp,qs)=>{"use strict";var Vl=ye(),Ds=Ft(),{ANY:Bl}=Ds,Yl=Ne(),Kl=zt(),Ns=Mt(),Ts=cr(),Xl=ur(),Jl=lr(),Ql=(r,e,t,n)=>{r=new Vl(r,n),e=new Yl(e,n);let i,s,o,a,u;switch(t){case">":i=Ns,s=Xl,o=Ts,a=">",u=">=";break;case"<":i=Ts,s=Jl,o=Ns,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Kl(r,e,n))return!1;for(let p=0;p<e.set.length;++p){let h=e.set[p],l=null,b=null;if(h.forEach(m=>{m.semver===Bl&&(m=new Ds(">=0.0.0")),l=l||m,b=b||m,i(m.semver,l.semver,n)?l=m:o(m.semver,b.semver,n)&&(b=m)}),l.operator===a||l.operator===u||(!b.operator||b.operator===a)&&s(r,b.semver))return!1;if(b.operator===u&&o(r,b.semver))return!1}return!0};qs.exports=Ql});var Fs=k((yp,Ms)=>{"use strict";var Zl=pr(),eu=(r,e,t)=>Zl(r,e,">",t);Ms.exports=eu});var zs=k((bp,ks)=>{"use strict";var tu=pr(),ru=(r,e,t)=>tu(r,e,"<",t);ks.exports=ru});var Ws=k((wp,Gs)=>{"use strict";var Us=Ne(),nu=(r,e,t)=>(r=new Us(r,t),e=new Us(e,t),r.intersects(e,t));Gs.exports=nu});var Vs=k((Ep,Hs)=>{"use strict";var iu=zt(),su=Pe();Hs.exports=(r,e,t)=>{let n=[],i=null,s=null,o=r.sort((h,l)=>su(h,l,t));for(let h of o)iu(h,e,t)?(s=h,i||(i=h)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);let a=[];for(let[h,l]of n)h===l?a.push(h):!l&&h===o[0]?a.push("*"):l?h===o[0]?a.push(`<=${l}`):a.push(`${h} - ${l}`):a.push(`>=${h}`);let u=a.join(" || "),p=typeof e.raw=="string"?e.raw:String(e);return u.length<p.length?u:e}});var Qs=k((Ap,Js)=>{"use strict";var Bs=Ne(),en=Ft(),{ANY:Qr}=en,Zr=zt(),tn=Pe(),ou=(r,e,t={})=>{if(r===e)return!0;r=new Bs(r,t),e=new Bs(e,t);let n=!1;e:for(let i of r.set){for(let s of e.set){let o=cu(i,s,t);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},au=[new en(">=0.0.0-0")],Ys=[new en(">=0.0.0")],cu=(r,e,t)=>{if(r===e)return!0;if(r.length===1&&r[0].semver===Qr){if(e.length===1&&e[0].semver===Qr)return!0;t.includePrerelease?r=au:r=Ys}if(e.length===1&&e[0].semver===Qr){if(t.includePrerelease)return!0;e=Ys}let n=new Set,i,s;for(let m of r)m.operator===">"||m.operator===">="?i=Ks(i,m,t):m.operator==="<"||m.operator==="<="?s=Xs(s,m,t):n.add(m.semver);if(n.size>1)return null;let o;if(i&&s){if(o=tn(i.semver,s.semver,t),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(let m of n){if(i&&!Zr(m,String(i),t)||s&&!Zr(m,String(s),t))return null;for(let E of e)if(!Zr(m,String(E),t))return!1;return!0}let a,u,p,h,l=s&&!t.includePrerelease&&s.semver.prerelease.length?s.semver:!1,b=i&&!t.includePrerelease&&i.semver.prerelease.length?i.semver:!1;l&&l.prerelease.length===1&&s.operator==="<"&&l.prerelease[0]===0&&(l=!1);for(let m of e){if(h=h||m.operator===">"||m.operator===">=",p=p||m.operator==="<"||m.operator==="<=",i){if(b&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===b.major&&m.semver.minor===b.minor&&m.semver.patch===b.patch&&(b=!1),m.operator===">"||m.operator===">="){if(a=Ks(i,m,t),a===m&&a!==i)return!1}else if(i.operator===">="&&!m.test(i.semver))return!1}if(s){if(l&&m.semver.prerelease&&m.semver.prerelease.length&&m.semver.major===l.major&&m.semver.minor===l.minor&&m.semver.patch===l.patch&&(l=!1),m.operator==="<"||m.operator==="<="){if(u=Xs(s,m,t),u===m&&u!==s)return!1}else if(s.operator==="<="&&!m.test(s.semver))return!1}if(!m.operator&&(s||i)&&o!==0)return!1}return!(i&&p&&!s&&o!==0||s&&h&&!i&&o!==0||b||l)},Ks=(r,e,t)=>{if(!r)return e;let n=tn(r.semver,e.semver,t);return n>0?r:n<0||e.operator===">"&&r.operator===">="?e:r},Xs=(r,e,t)=>{if(!r)return e;let n=tn(r.semver,e.semver,t);return n<0?r:n>0||e.operator==="<"&&r.operator==="<="?e:r};Js.exports=ou});var hr=k((Op,to)=>{"use strict";var rn=Ct(),Zs=St(),lu=ye(),eo=Fr(),uu=et(),fu=Si(),du=Ri(),pu=vi(),hu=Li(),mu=Ni(),gu=Di(),yu=Mi(),bu=ki(),wu=Pe(),Eu=Wi(),Au=Vi(),Ou=ar(),_u=Xi(),Su=Qi(),Cu=Mt(),Ru=cr(),xu=Ur(),ju=Gr(),vu=lr(),$u=ur(),Iu=Wr(),Lu=as(),Pu=ls(),Nu=Ft(),Tu=Ne(),Du=zt(),qu=Ss(),Mu=Rs(),Fu=js(),ku=Is(),zu=Ps(),Uu=pr(),Gu=Fs(),Wu=zs(),Hu=Ws(),Vu=Vs(),Bu=Qs();to.exports={parse:uu,valid:fu,clean:du,inc:pu,diff:hu,major:mu,minor:gu,patch:yu,prerelease:bu,compare:wu,rcompare:Eu,compareLoose:Au,compareBuild:Ou,sort:_u,rsort:Su,gt:Cu,lt:Ru,eq:xu,neq:ju,gte:vu,lte:$u,cmp:Iu,coerce:Lu,truncate:Pu,Comparator:Nu,Range:Tu,satisfies:Du,toComparators:qu,maxSatisfying:Mu,minSatisfying:Fu,minVersion:ku,validRange:zu,outside:Uu,gtr:Gu,ltr:Wu,intersects:Hu,simplifyRange:Vu,subset:Bu,SemVer:lu,re:rn.re,src:rn.src,tokens:rn.t,SEMVER_SPEC_VERSION:Zs.SEMVER_SPEC_VERSION,RELEASE_TYPES:Zs.RELEASE_TYPES,compareIdentifiers:eo.compareIdentifiers,rcompareIdentifiers:eo.rcompareIdentifiers}});var mr=Xt(hr(),1);import*as Ut from"node:process";try{let r=ii?.node;typeof r=="string"&&!mr.satisfies(Ut.version,r)&&H.warn(`
|
|
9
9
|
\u26A0\uFE0F Warning: failed to satisfy expected node version. Expected: "${r}", Current "${Ut.version}"
|
|
10
10
|
|
|
11
|
-
`),mr.major(Ut.version)===20&&H.info(er([Dt(Jt("Deprecation warning: Node.js 20 support is ending")),"","Node.js 20 reached end-of-life on April 30, 2026.","Future Redocly CLI releases require Node.js 22.12.0 or later.",`You are using Node.js ${Ut.version}.`,"",`Update Node.js: ${ct("https://nodejs.org/en/download")}`]))}catch{}var
|
|
11
|
+
`),mr.major(Ut.version)===20&&H.info(er([Dt(Jt("Deprecation warning: Node.js 20 support is ending")),"","Node.js 20 reached end-of-life on April 30, 2026.","Future Redocly CLI releases require Node.js 22.12.0 or later.",`You are using Node.js ${Ut.version}.`,"",`Update Node.js: ${ct("https://nodejs.org/en/download")}`]))}catch{}var Ma=Xt(ka(),1);import*as Fa from"node:path";import{notStrictEqual as bf,strictEqual as wf}from"assert";var Yu={right:Zu,center:ef},Ku=0,gr=1,Xu=2,yr=3,nn=class{constructor(e){var t;this.width=e.width,this.wrap=(t=e.wrap)!==null&&t!==void 0?t:!0,this.rows=[]}span(...e){let t=this.div(...e);t.span=!0}resetOutput(){this.rows=[]}div(...e){if(e.length===0&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]=="string")return this.applyLayoutDSL(e[0]);let t=e.map(n=>typeof n=="string"?this.colFromString(n):n);return this.rows.push(t),t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]=="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){let t=e.split(`
|
|
12
12
|
`).map(i=>i.split(" ")),n=0;return t.forEach(i=>{i.length>1&&je.stringWidth(i[0])>n&&(n=Math.min(Math.floor(this.width*.5),je.stringWidth(i[0])))}),t.forEach(i=>{this.div(...i.map((s,o)=>({text:s.trim(),padding:this.measurePadding(s),width:o===0&&i.length>1?n:void 0})))}),this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){let t=je.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){let e=[];return this.rows.forEach(t=>{this.rowToString(t,e)}),e.filter(t=>!t.hidden).map(t=>t.text).join(`
|
|
13
|
-
`)}rowToString(e,t){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((o,a)=>{let{width:u}=e[a],p=this.negatePadding(e[a]),h=o;if(p>je.stringWidth(o)&&(h+=" ".repeat(p-je.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){let b=
|
|
13
|
+
`)}rowToString(e,t){return this.rasterize(e).forEach((n,i)=>{let s="";n.forEach((o,a)=>{let{width:u}=e[a],p=this.negatePadding(e[a]),h=o;if(p>je.stringWidth(o)&&(h+=" ".repeat(p-je.stringWidth(o))),e[a].align&&e[a].align!=="left"&&this.wrap){let b=Yu[e[a].align];h=b(h,p),je.stringWidth(h)<p&&(h+=" ".repeat((u||0)-je.stringWidth(h)-1))}let l=e[a].padding||[0,0,0,0];l[yr]&&(s+=" ".repeat(l[yr])),s+=ro(e[a],h,"| "),s+=h,s+=ro(e[a],h," |"),l[gr]&&(s+=" ".repeat(l[gr])),i===0&&t.length>0&&(s=this.renderInline(s,t[t.length-1]))}),t.push({text:s.replace(/ +$/,""),span:e.span})}),t}renderInline(e,t){let n=e.match(/^ */),i=n?n[0].length:0,s=t.text,o=je.stringWidth(s.trimRight());return t.span?this.wrap?i<o?e:(t.hidden=!0,s.trimRight()+" ".repeat(i-o)+e.trimLeft()):(t.hidden=!0,s+e):e}rasterize(e){let t=[],n=this.columnWidths(e),i;return e.forEach((s,o)=>{s.width=n[o],this.wrap?i=je.wrap(s.text,this.negatePadding(s),{hard:!0}).split(`
|
|
14
14
|
`):i=s.text.split(`
|
|
15
|
-
`),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[
|
|
16
|
-
`),i+=r.charAt(s);return t&&n&&(i=`${t}${i}${n}`),i}function on(r){return ro(r,{stringWidth:e=>[...e].length,stripAnsi:sn,wrap:io})}import{dirname as so,resolve as oo}from"path";import{readdirSync as ef,statSync as tf}from"fs";function ao(r,e){let t=oo(".",r),n;for(tf(t).isDirectory()||(t=so(t));;){if(n=e(t,ef(t)),n)return oo(t,n);if(t=so(n=t),n===t)break}}import{inspect as wf}from"util";import{readFileSync as Ef}from"fs";import{fileURLToPath as Eo}from"url";import{format as nf}from"util";import{readFileSync as sf}from"fs";import{normalize as of,resolve as af}from"path";function lt(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let t="",n=!1,i=r.match(/^-+/);for(let s=i?i[0].length:0;s<r.length;s++){let o=r.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function br(r,e){let t=r.toLowerCase();e=e||"-";let n="";for(let i=0;i<r.length;i++){let s=t.charAt(i),o=r.charAt(i);s!==o&&i>0?n+=`${e}${t.charAt(i)}`:n+=o}return n}function wr(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function co(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let e=0,t=null,n=null,i=null,s=[];for(let o=0;o<r.length;o++){if(t=n,n=r.charAt(o),n===" "&&!i){t!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[e]||(s[e]=""),s[e]+=n}return s}var Te;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Te||(Te={}));var Be,Er=class{constructor(e){Be=e}parse(e,t){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),i=co(e),s=rf(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),a=Object.assign(Object.create(null),n.default),u=n.configObjects||[],p=n.envPrefix,h=o["populate--"],l=h?"--":"_",b=Object.create(null),m=Object.create(null),E=n.__||Be.format,d={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:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,N=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(f){let g=typeof f=="object"?f.key:f,A=Object.keys(f).map(function(w){return{boolean:"bools",string:"strings",number:"numbers"}[w]}).filter(Boolean).pop();A&&(d[A][g]=!0),d.arrays[g]=!0,d.keys.push(g)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(f){d.bools[f]=!0,d.keys.push(f)}),[].concat(n.string||[]).filter(Boolean).forEach(function(f){d.strings[f]=!0,d.keys.push(f)}),[].concat(n.number||[]).filter(Boolean).forEach(function(f){d.numbers[f]=!0,d.keys.push(f)}),[].concat(n.count||[]).filter(Boolean).forEach(function(f){d.counts[f]=!0,d.keys.push(f)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(f){d.normalize[f]=!0,d.keys.push(f)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([f,g])=>{typeof g=="number"&&(d.nargs[f]=g,d.keys.push(f))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([f,g])=>{typeof g=="function"&&(d.coercions[f]=g,d.keys.push(f))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(f){d.configs[f]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([f,g])=>{(typeof g=="boolean"||typeof g=="function")&&(d.configs[f]=g)})),Tt(n.key,s,n.default,d.arrays),Object.keys(a).forEach(function(f){(d.aliases[f]||[]).forEach(function(g){a[g]=a[f]})});let O=null;Nr();let U=[],W=Object.assign(Object.create(null),{_:[]}),xe={};for(let f=0;f<i.length;f++){let g=i[f],A=g.replace(/^-{3,}/,"---"),w,y,x,j,q,pe;if(g!=="--"&&Q(g))Xe(g);else if(A.match(/---+(=|$)/)){Xe(g);continue}else if(g.match(/^--.+=/)||!o["short-option-groups"]&&g.match(/^-.+=/))j=g.match(/^--?([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&(T(j[1],d.arrays)?f=Qe(f,j[1],i,j[2]):T(j[1],d.nargs)!==!1?f=Je(f,j[1],i,j[2]):B(j[1],j[2]));else if(g.match(N)&&o["boolean-negation"])j=g.match(N),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],B(y,T(y,d.arrays)?[!1]:!1));else if(g.match(/^--.+/)||!o["short-option-groups"]&&g.match(/^-[^-]+/))j=g.match(/^--?(.+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],T(y,d.arrays)?f=Qe(f,y,i):T(y,d.nargs)!==!1?f=Je(f,y,i):(q=i[f+1],q!==void 0&&(!q.match(/^-/)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(B(y,q),f++):B(y,Y(y))));else if(g.match(/^-.\..+=/))j=g.match(/^-([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&B(j[1],j[2]);else if(g.match(/^-.\..+/)&&!g.match(S))q=i[f+1],j=g.match(/^-(.\..+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],q!==void 0&&!q.match(/^-/)&&!T(y,d.bools)&&!T(y,d.counts)?(B(y,q),f++):B(y,Y(y)));else if(g.match(/^-[^-]+/)&&!g.match(S)){x=g.slice(1,-1).split(""),w=!1;for(let Ae=0;Ae<x.length;Ae++){if(q=g.slice(Ae+2),x[Ae+1]&&x[Ae+1]==="="){pe=g.slice(Ae+3),y=x[Ae],T(y,d.arrays)?f=Qe(f,y,i,pe):T(y,d.nargs)!==!1?f=Je(f,y,i,pe):B(y,pe),w=!0;break}if(q==="-"){B(x[Ae],q);continue}if(/[A-Za-z]/.test(x[Ae])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&T(q,d.bools)===!1){B(x[Ae],q),w=!0;break}if(x[Ae+1]&&x[Ae+1].match(/\W/)){B(x[Ae],q),w=!0;break}else B(x[Ae],Y(x[Ae]))}y=g.slice(-1)[0],!w&&y!=="-"&&(T(y,d.arrays)?f=Qe(f,y,i):T(y,d.nargs)!==!1?f=Je(f,y,i):(q=i[f+1],q!==void 0&&(!/^(-|--)[^-]/.test(q)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(B(y,q),f++):B(y,Y(y))))}else if(g.match(/^-[0-9]$/)&&g.match(S)&&T(g.slice(1),d.bools))y=g.slice(1),B(y,Y(y));else if(g==="--"){U=i.slice(f+1);break}else if(o["halt-at-non-option"]){U=i.slice(f);break}else Xe(g)}se(W,!0),se(W,!1),P(W),ee(),Ze(W,d.aliases,a,!0),K(W),o["set-placeholder-key"]&&ue(W),Object.keys(d.counts).forEach(function(f){Z(W,f.split("."))||B(f,0)}),h&&U.length&&(W[l]=[]),U.forEach(function(f){W[l].push(f)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(W).filter(f=>f!=="--"&&f.includes("-")).forEach(f=>{delete W[f]}),o["strip-aliased"]&&[].concat(...Object.keys(s).map(f=>s[f])).forEach(f=>{o["camel-case-expansion"]&&f.includes("-")&&delete W[f.split(".").map(g=>lt(g)).join(".")],delete W[f]});function Xe(f){let g=_("_",f);(typeof g=="string"||typeof g=="number")&&W._.push(g)}function Je(f,g,A,w){let y,x=T(g,d.nargs);if(x=typeof x!="number"||isNaN(x)?1:x,x===0)return fe(w)||(O=Error(E("Argument unexpected for: %s",g))),B(g,Y(g)),f;let j=fe(w)?0:1;if(o["nargs-eats-options"])A.length-(f+1)+j<x&&(O=Error(E("Not enough arguments following: %s",g))),j=x;else{for(y=f+1;y<A.length&&(!A[y].match(/^-[^0-9]/)||A[y].match(S)||Q(A[y]));y++)j++;j<x&&(O=Error(E("Not enough arguments following: %s",g)))}let q=Math.min(j,x);for(!fe(w)&&q>0&&(B(g,w),q--),y=f+1;y<q+f+1;y++)B(g,A[y]);return f+q}function Qe(f,g,A,w){let y=[],x=w||A[f+1],j=T(g,d.nargs);if(T(g,d.bools)&&!/^(true|false)$/.test(x))y.push(!0);else if(fe(x)||fe(w)&&/^-/.test(x)&&!S.test(x)&&!Q(x)){if(a[g]!==void 0){let q=a[g];y=Array.isArray(q)?q:[q]}}else{fe(w)||y.push($(g,w));for(let q=f+1;q<A.length&&!(!o["greedy-arrays"]&&y.length>0||j&&typeof j=="number"&&y.length>=j||(x=A[q],/^-/.test(x)&&!S.test(x)&&!Q(x)));q++)f=q,y.push($(g,x))}return typeof j=="number"&&(j&&y.length<j||isNaN(j)&&y.length===0)&&(O=Error(E("Not enough arguments following: %s",g))),B(g,y),f}function B(f,g){if(/-/.test(f)&&o["camel-case-expansion"]){let y=f.split(".").map(function(x){return lt(x)}).join(".");He(f,y)}let A=$(f,g),w=f.split(".");Ve(W,w,A),d.aliases[f]&&d.aliases[f].forEach(function(y){let x=y.split(".");Ve(W,x,A)}),w.length>1&&o["dot-notation"]&&(d.aliases[w[0]]||[]).forEach(function(y){let x=y.split("."),j=[].concat(w);j.shift(),x=x.concat(j),(d.aliases[f]||[]).includes(x.join("."))||Ve(W,x,A)}),T(f,d.normalize)&&!T(f,d.arrays)&&[f].concat(d.aliases[f]||[]).forEach(function(x){Object.defineProperty(xe,x,{enumerable:!0,get(){return g},set(j){g=typeof j=="string"?Be.normalize(j):j}})})}function He(f,g){d.aliases[f]&&d.aliases[f].length||(d.aliases[f]=[g],b[g]=!0),d.aliases[g]&&d.aliases[g].length||He(g,f)}function $(f,g){typeof g=="string"&&(g[0]==="'"||g[0]==='"')&&g[g.length-1]===g[0]&&(g=g.substring(1,g.length-1)),(T(f,d.bools)||T(f,d.counts))&&typeof g=="string"&&(g=g==="true");let A=Array.isArray(g)?g.map(function(w){return _(f,w)}):_(f,g);return T(f,d.counts)&&(fe(A)||typeof A=="boolean")&&(A=an()),T(f,d.normalize)&&T(f,d.arrays)&&(Array.isArray(g)?A=g.map(w=>Be.normalize(w)):A=Be.normalize(g)),A}function _(f,g){return!o["parse-positional-numbers"]&&f==="_"||!T(f,d.strings)&&!T(f,d.bools)&&!Array.isArray(g)&&(wr(g)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${g}`)))||!fe(g)&&T(f,d.numbers))&&(g=Number(g)),g}function P(f){let g=Object.create(null);Ze(g,d.aliases,a),Object.keys(d.configs).forEach(function(A){let w=f[A]||g[A];if(w)try{let y=null,x=Be.resolve(Be.cwd(),w),j=d.configs[A];if(typeof j=="function"){try{y=j(x)}catch(q){y=q}if(y instanceof Error){O=y;return}}else y=Be.require(x);F(y)}catch(y){y.name==="PermissionDenied"?O=y:f[A]&&(O=Error(E("Invalid JSON config file: %s",w)))}})}function F(f,g){Object.keys(f).forEach(function(A){let w=f[A],y=g?g+"."+A:A;typeof w=="object"&&w!==null&&!Array.isArray(w)&&o["dot-notation"]?F(w,y):(!Z(W,y.split("."))||T(y,d.arrays)&&o["combine-arrays"])&&B(y,w)})}function ee(){typeof u<"u"&&u.forEach(function(f){F(f)})}function se(f,g){if(typeof p>"u")return;let A=typeof p=="string"?p:"",w=Be.env();Object.keys(w).forEach(function(y){if(A===""||y.lastIndexOf(A,0)===0){let x=y.split("__").map(function(j,q){return q===0&&(j=j.substring(A.length)),lt(j)});(g&&d.configs[x.join(".")]||!g)&&!Z(f,x)&&B(x.join("."),w[y])}})}function K(f){let g,A=new Set;Object.keys(f).forEach(function(w){if(!A.has(w)&&(g=T(w,d.coercions),typeof g=="function"))try{let y=_(w,g(f[w]));[].concat(d.aliases[w]||[],w).forEach(x=>{A.add(x),f[x]=y})}catch(y){O=y}})}function ue(f){return d.keys.forEach(g=>{~g.indexOf(".")||typeof f[g]>"u"&&(f[g]=void 0)}),f}function Ze(f,g,A,w=!1){Object.keys(A).forEach(function(y){Z(f,y.split("."))||(Ve(f,y.split("."),A[y]),w&&(m[y]=!0),(g[y]||[]).forEach(function(x){Z(f,x.split("."))||Ve(f,x.split("."),A[y])}))})}function Z(f,g){let A=f;o["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(y){A=A[y]||{}});let w=g[g.length-1];return typeof A!="object"?!1:w in A}function Ve(f,g,A){let w=f;o["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(pe){pe=lo(pe),typeof w=="object"&&w[pe]===void 0&&(w[pe]={}),typeof w[pe]!="object"||Array.isArray(w[pe])?(Array.isArray(w[pe])?w[pe].push({}):w[pe]=[w[pe],{}],w=w[pe][w[pe].length-1]):w=w[pe]});let y=lo(g[g.length-1]),x=T(g.join("."),d.arrays),j=Array.isArray(A),q=o["duplicate-arguments-array"];!q&&T(y,d.nargs)&&(q=!0,(!fe(w[y])&&d.nargs[y]===1||Array.isArray(w[y])&&w[y].length===d.nargs[y])&&(w[y]=void 0)),A===an()?w[y]=an(w[y]):Array.isArray(w[y])?q&&x&&j?w[y]=o["flatten-duplicate-arrays"]?w[y].concat(A):(Array.isArray(w[y][0])?w[y]:[w[y]]).concat([A]):!q&&!!x==!!j?w[y]=A:w[y]=w[y].concat([A]):w[y]===void 0&&x?w[y]=j?A:[A]:q&&!(w[y]===void 0||T(y,d.counts)||T(y,d.bools))?w[y]=[w[y],A]:w[y]=A}function Tt(...f){f.forEach(function(g){Object.keys(g||{}).forEach(function(A){d.aliases[A]||(d.aliases[A]=[].concat(s[A]||[]),d.aliases[A].concat(A).forEach(function(w){if(/-/.test(w)&&o["camel-case-expansion"]){let y=lt(w);y!==A&&d.aliases[A].indexOf(y)===-1&&(d.aliases[A].push(y),b[y]=!0)}}),d.aliases[A].concat(A).forEach(function(w){if(w.length>1&&/[A-Z]/.test(w)&&o["camel-case-expansion"]){let y=br(w,"-");y!==A&&d.aliases[A].indexOf(y)===-1&&(d.aliases[A].push(y),b[y]=!0)}}),d.aliases[A].forEach(function(w){d.aliases[w]=[A].concat(d.aliases[A].filter(function(y){return w!==y}))}))})})}function T(f,g){let A=[].concat(d.aliases[f]||[],f),w=Object.keys(g),y=A.find(x=>w.includes(x));return y?g[y]:!1}function Ot(f){let g=Object.keys(d);return[].concat(g.map(w=>d[w])).some(function(w){return Array.isArray(w)?w.includes(f):w[f]})}function Hn(f,...g){return[].concat(...g).some(function(w){let y=f.match(w);return y&&Ot(y[1])})}function D(f){if(f.match(S)||!f.match(/^-[^-]+/))return!1;let g=!0,A,w=f.slice(1).split("");for(let y=0;y<w.length;y++){if(A=f.slice(y+2),!Ot(w[y])){g=!1;break}if(w[y+1]&&w[y+1]==="="||A==="-"||/[A-Za-z]/.test(w[y])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(A)||w[y+1]&&w[y+1].match(/\W/))break}return g}function Q(f){return o["unknown-options-as-args"]&&X(f)}function X(f){return f=f.replace(/^-{3,}/,"--"),f.match(S)||D(f)?!1:!Hn(f,/^-+([^=]+?)=[\s\S]*$/,N,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Y(f){return!T(f,d.bools)&&!T(f,d.counts)&&`${f}`in a?a[f]:le(Ce(f))}function le(f){return{[Te.BOOLEAN]:!0,[Te.STRING]:"",[Te.NUMBER]:void 0,[Te.ARRAY]:[]}[f]}function Ce(f){let g=Te.BOOLEAN;return T(f,d.strings)?g=Te.STRING:T(f,d.numbers)?g=Te.NUMBER:T(f,d.bools)?g=Te.BOOLEAN:T(f,d.arrays)&&(g=Te.ARRAY),g}function fe(f){return f===void 0}function Nr(){Object.keys(d.counts).find(f=>T(f,d.arrays)?(O=Error(E("Invalid configuration: %s, opts.count excludes opts.array.",f)),!0):T(f,d.nargs)?(O=Error(E("Invalid configuration: %s, opts.count excludes opts.narg.",f)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(xe,W),configuration:o,defaulted:Object.assign({},m),error:O,newAliases:Object.assign({},b)}}};function rf(r){let e=[],t=Object.create(null),n=!0;for(Object.keys(r).forEach(function(i){e.push([].concat(r[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(a){return e[s].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,a,u){return u.indexOf(o)===a});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function an(r){return r!==void 0?r+1:1}function lo(r){return r==="__proto__"?"___proto___":r}var uo=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<uo)throw Error(`yargs parser supports a minimum Node.js version of ${uo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var cf=process?process.env:{},fo=new Er({cwd:process.cwd,env:()=>cf,format:nf,normalize:of,resolve:af,require:r=>{if(typeof Ue<"u")return Ue(r);if(r.match(/\.json$/))return sf(r,"utf8");throw Error("only .json config files are supported in ESM")}}),Gt=function(e,t){return fo.parse(e.slice(),t).argv};Gt.detailed=function(r,e){return fo.parse(r.slice(),e)};Gt.camelCase=lt;Gt.decamelize=br;Gt.looksLikeNumber=wr;var cn=Gt;import{basename as Af,dirname as Of,extname as _f,relative as Sf,resolve as bo}from"path";function po(){return lf()?0:1}function lf(){return uf()&&!process.defaultApp}function uf(){return!!process.versions.electron}function ln(r){return r.slice(po()+1)}function ho(){return process.argv[po()]}var ne=class r extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,r)}};import{readFileSync as ff,statSync as df,writeFile as pf}from"fs";import{format as hf}from"util";import{resolve as mf}from"path";var mo={fs:{readFileSync:ff,writeFile:pf},format:hf,resolve:mf,exists:r=>{try{return df(r).isFile()}catch{return!1}}};var ze,un=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),ze.format.apply(ze.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][i===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),ze.format.apply(ze.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 n="";return e.forEach(function(i,s){let o=t[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,i=t.locale,s=t.cb,o=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);ze.fs.writeFile(o,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{ze.fs.readFileSync&&(e=JSON.parse(ze.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=ze.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let i=ze.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return ze.exists(e)}};function go(r,e){ze=e;let t=new un(r);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 gf=r=>go(r,mo),yo=gf;var Cf="require is not supported by ESM",wo="loading a directory of commands is not supported yet for ESM",Rf=Eo(import.meta.url).split("node_modules")[0],xf=Eo(import.meta.url),fn={assert:{notStrictEqual:yf,strictEqual:bf},cliui:on,findUp:ao,getEnv:r=>process.env[r],inspect:wf,getCallerFile:()=>{throw new ne(wo)},getProcessArgvBin:ho,mainFilename:Rf||process.cwd(),Parser:cn,path:{basename:Af,dirname:Of,extname:_f,relative:Sf,resolve:bo},process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Ef,require:()=>{throw new ne(Cf)},requireDirectory:()=>{throw new ne(wo)},stringWidth:r=>[...r].length,y18n:yo({directory:bo(xf,"../../../locales"),updateFiles:!1})};function Se(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function dn(r,e){e.assert.strictEqual(typeof r,"string")}function Rt(r){return Object.keys(r)}function ie(r){return!!r&&!!r.then&&typeof r.then=="function"}function tt(r){let t=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=t.shift();if(!i)throw new Error(`No command found in: ${r}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return t.forEach((o,a)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===t.length-1&&(u=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:u})}),s}var jf=["first","second","third","fourth","fifth","sixth"];function v(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,e]:[tt(`cmd ${r}`),e,t]}try{let i=0,[s,o,a]=n(),u=[].slice.call(o);for(;u.length&&u[u.length-1]===void 0;)u.pop();let p=a||u.length;if(p<s.demanded.length)throw new ne(`Not enough arguments provided. Expected ${s.demanded.length} but received ${u.length}.`);let h=s.demanded.length+s.optional.length;if(p>h)throw new ne(`Too many arguments provided. Expected max ${h} but received ${p}.`);s.demanded.forEach(l=>{let b=u.shift(),m=Ao(b);l.cmd.filter(d=>d===m||d==="*").length===0&&Oo(m,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(u.length===0)return;let b=u.shift(),m=Ao(b);l.cmd.filter(d=>d===m||d==="*").length===0&&Oo(m,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Ao(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function Oo(r,e,t){throw new ne(`Invalid ${jf[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}var Ar=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if(v("<array|function> [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let i=0;i<e.length;i++){if(typeof e[i]!="function")throw Error("middleware must be a function");let s=e[i];s.applyBeforeValidation=t,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let i=e;i.applyBeforeValidation=t,i.global=n,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[t]||[],t];return i.option?!s.includes(i.option):!0}),e.option=t,this.addMiddleware(e,!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 _o(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function ut(r,e,t,n){return t.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(ie(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,e);return ie(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},r)}function ft(r,e,t=n=>{throw n}){try{let n=vf(r)?r():r;return ie(n)?n.then(i=>e(i)):e(n)}catch(n){return t(n)}}function vf(r){return typeof r=="function"}function pn(r){if(typeof Ue>"u")return null;for(let e=0,t=Object.keys(Ue.cache),n;e<t.length;e++)if(n=Ue.cache[t[e]],n.exports===r)return n;return null}var xt=/(^\*)|(^\$0)/,hn=class{constructor(e,t,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,a,u)=>{let p=s(o,a,u);if(p){if(this.requireCache.has(a))return p;this.requireCache.add(a),this.addHandler(p)}return p},this.shim.requireDirectory({require:t,filename:n},e,i)}addHandler(e,t,n,i,s,o){let a=[],u=_o(s);if(i=i||(()=>{}),Array.isArray(e))if($f(e))[e,...a]=e;else for(let p of e)this.addHandler(p);else if(Lf(e)){let p=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(p=[].concat(p).concat(e.aliases)),this.addHandler(p,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(So(n)){this.addHandler([e].concat(a),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let p=tt(e);a=a.map(b=>tt(b).cmd);let h=!1,l=[p.cmd].concat(a).filter(b=>xt.test(b)?(h=!0,!1):!0);l.length===0&&h&&l.push("$0"),h&&(p.cmd=l[0],a=l.slice(1),e=e.replace(xt,p.cmd)),a.forEach(b=>{this.aliasMap[b]=p.cmd}),t!==!1&&this.usage.command(e,t,h,a,o),this.handlers[p.cmd]={original:e,description:t,handler:i,builder:n||{},middlewares:u,deprecated:o,demanded:p.demanded,optional:p.optional},h&&(this.defaultCommand=this.handlers[p.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,i,s,o){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=t.getInternalMethods().getContext(),p=u.commands.slice(),h=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let l=this.applyBuilderUpdateUsageAndParse(h,a,t,n.aliases,p,i,s,o);return ie(l)?l.then(b=>this.applyMiddlewareAndGetResult(h,a,b.innerArgv,u,s,b.aliases,t)):this.applyMiddlewareAndGetResult(h,a,l.innerArgv,u,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,i,s,o,a,u){let p=t.builder,h=n;if(Or(p)){let l=p(n.getInternalMethods().reset(i),u);if(ie(l))return l.then(b=>(h=Ro(b)?b:n,this.parseAndUpdateUsage(e,t,h,s,o,a)))}else If(p)&&(h=n.getInternalMethods().reset(i),Object.keys(t.builder).forEach(l=>{h.option(l,p[l])}));return this.parseAndUpdateUsage(e,t,h,s,o,a)}parseAndUpdateUsage(e,t,n,i,s,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,t),t.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ie(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=xt.test(t.original)?t.original.replace(xt,"").trim():t.original,i=e.filter(s=>!xt.test(s));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,i,s,o,a){let u={};if(s)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(t,n,i,a));let p=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=ut(n,a,p,!0),!a.getInternalMethods().getHasOutput()){let h=a.getInternalMethods().runValidation(o,u,a.parsed.error,e);n=ft(n,l=>(h(l),l))}if(t.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let h=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(n,h,!1,!1),n=ut(n,a,p,!1),n=ft(n,l=>{let b=t.handler(l);return ie(b)?b.then(()=>l):l}),e||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(l=>{try{a.getInternalMethods().getUsageInstance().fail(null,l)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}populatePositionals(e,t,n,i){t._=t._.slice(n.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),a={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let u=s.shift();this.populatePositional(u,t,a)}for(;o.length;){let u=o.shift();this.populatePositional(u,t,a)}return t._=n.commands.concat(t._.map(u=>""+u)),this.postProcessPositionals(t,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,t,n){let i=e.cmd[0];e.variadic?n[i]=t._.splice(0).map(String):t._.length&&(n[i]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=tt(e);return n.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),n.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let p of Object.keys(n.alias))s.alias[p]=(s.alias[p]||[]).concat(n.alias[p]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(t).forEach(p=>{t[p].map(h=>{s.configuration["unknown-options-as-args"]&&(s.key[p]=!0),o.push(`--${p}`),o.push(h)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let p=Object.keys(t);Object.keys(t).forEach(h=>{p.push(...u.aliases[h])}),Object.keys(u.argv).forEach(h=>{p.indexOf(h)!==-1&&(t[h]||(t[h]=u.argv[h]),e[h]=u.argv[h])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=xt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(Or(t))return t(e,!0);So(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=pn(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:n}){for(let i of[e,t,n]){if(typeof i=="string"||i===!1)return i;Se(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Se(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 Co(r,e,t,n){return new hn(r,e,t,n)}function So(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function $f(r){return r.every(e=>typeof e=="string")}function Or(r){return typeof r=="function"}function If(r){return typeof r=="object"}function Lf(r){return typeof r=="object"&&!Array.isArray(r)}function rt(r={},e=()=>!0){let t={};return Rt(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function nt(r){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(r)})}function Pf(r){return typeof r=="boolean"}function jo(r,e){let t=e.y18n.__,n={},i=[];n.failFn=function(_){i.push(_)};let s=null,o=!0;n.showHelpOnFail=function(_=!0,P){function F(){return typeof _=="string"?[!0,_]:[_,P]}let[ee,se]=F();return s=se,o=ee,n};let a=!1;n.fail=function(_,P){let F=r.getInternalMethods().getLoggerInstance();if(i.length)for(let ee=i.length-1;ee>=0;--ee){let se=i[ee];if(Pf(se)){if(P)throw P;if(_)throw Error(_)}else se(_,P,n)}else{if(r.getExitProcess()&&nt(!0),a||(a=!0,o&&(r.showHelp("error"),F.error()),(_||P)&&F.error(_||P),s&&((_||P)&&F.error(""),F.error(s))),P=P||new ne(_),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,P);throw P}};let u=[],p=!1;n.usage=($,_)=>$===null?(p=!0,u=[],n):(p=!1,u.push([$,_||""]),n),n.getUsage=()=>u,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>t("Positionals:");let h=[];n.example=($,_)=>{h.push([$,_||""])};let l=[];n.command=function(_,P,F,ee,se=!1){F&&(l=l.map(K=>(K[2]=!1,K))),l.push([_,P||"",F,ee,se])},n.getCommands=()=>l;let b={};n.describe=function(_,P){Array.isArray(_)?_.forEach(F=>{n.describe(F,P)}):typeof _=="object"?Object.keys(_).forEach(F=>{n.describe(F,_[F])}):b[_]=P},n.getDescriptions=()=>b;let m=[];n.epilog=$=>{m.push($)};let E=!1,d;n.wrap=$=>{E=!0,d=$};function S(){return E||(d=Qe(),E=!0),d}let N="__yargsString__:";n.deferY18nLookup=$=>N+$,n.help=function(){if(W)return W;U();let _=r.customScriptName?r.$0:e.path.basename(r.$0),P=r.getDemandedOptions(),F=r.getDemandedCommands(),ee=r.getDeprecatedOptions(),se=r.getGroups(),K=r.getOptions(),ue=[];ue=ue.concat(Object.keys(b)),ue=ue.concat(Object.keys(P)),ue=ue.concat(Object.keys(F)),ue=ue.concat(Object.keys(K.default)),ue=ue.filter(Xe),ue=Object.keys(ue.reduce((D,Q)=>(Q!=="_"&&(D[Q]=!0),D),{}));let Ze=S(),Z=e.cliui({width:Ze,wrap:!!Ze});if(!p){if(u.length)u.forEach(D=>{Z.div(`${D[0].replace(/\$0/g,_)}`),D[1]&&Z.div({text:`${D[1]}`,padding:[1,0,0,0]})}),Z.div();else if(l.length){let D=null;F._?D=`${_} <${t("command")}>
|
|
15
|
+
`),s.border&&(i.unshift("."+"-".repeat(this.negatePadding(s)+2)+"."),i.push("'"+"-".repeat(this.negatePadding(s)+2)+"'")),s.padding&&(i.unshift(...new Array(s.padding[Ku]||0).fill("")),i.push(...new Array(s.padding[Xu]||0).fill(""))),i.forEach((a,u)=>{t[u]||t.push([]);let p=t[u];for(let h=0;h<o;h++)p[h]===void 0&&p.push("");p.push(a)})}),t}negatePadding(e){let t=e.width||0;return e.padding&&(t-=(e.padding[yr]||0)+(e.padding[gr]||0)),e.border&&(t-=4),t}columnWidths(e){if(!this.wrap)return e.map(o=>o.width||je.stringWidth(o.text));let t=e.length,n=this.width,i=e.map(o=>{if(o.width)return t--,n-=o.width,o.width}),s=t?Math.floor(n/t):0;return i.map((o,a)=>o===void 0?Math.max(s,Ju(e[a])):o)}};function ro(r,e,t){return r.border?/[.']-+[.']/.test(e)?"":e.trim().length!==0?t:" ":""}function Ju(r){let e=r.padding||[],t=1+(e[yr]||0)+(e[gr]||0);return r.border?t+4:t}function Qu(){return typeof process=="object"&&process.stdout&&process.stdout.columns?process.stdout.columns:80}function Zu(r,e){r=r.trim();let t=je.stringWidth(r);return t<e?" ".repeat(e-t)+r:r}function ef(r,e){r=r.trim();let t=je.stringWidth(r);return t>=e?r:" ".repeat(e-t>>1)+r}var je;function no(r,e){return je=e,new nn({width:r?.width||Qu(),wrap:r?.wrap})}var io=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function sn(r){return r.replace(io,"")}function so(r,e){let[t,n]=r.match(io)||["",""];r=sn(r);let i="";for(let s=0;s<r.length;s++)s!==0&&s%e===0&&(i+=`
|
|
16
|
+
`),i+=r.charAt(s);return t&&n&&(i=`${t}${i}${n}`),i}function on(r){return no(r,{stringWidth:e=>[...e].length,stripAnsi:sn,wrap:so})}import{dirname as oo,resolve as ao}from"path";import{readdirSync as tf,statSync as rf}from"fs";function co(r,e){let t=ao(".",r),n;for(rf(t).isDirectory()||(t=oo(t));;){if(n=e(t,tf(t)),n)return ao(t,n);if(t=oo(n=t),n===t)break}}import{inspect as Ef}from"util";import{readFileSync as Af}from"fs";import{fileURLToPath as Ao}from"url";import{format as sf}from"util";import{readFileSync as of}from"fs";import{normalize as af,resolve as cf}from"path";function lt(r){if(r!==r.toLowerCase()&&r!==r.toUpperCase()||(r=r.toLowerCase()),r.indexOf("-")===-1&&r.indexOf("_")===-1)return r;{let t="",n=!1,i=r.match(/^-+/);for(let s=i?i[0].length:0;s<r.length;s++){let o=r.charAt(s);n&&(n=!1,o=o.toUpperCase()),s!==0&&(o==="-"||o==="_")?n=!0:o!=="-"&&o!=="_"&&(t+=o)}return t}}function br(r,e){let t=r.toLowerCase();e=e||"-";let n="";for(let i=0;i<r.length;i++){let s=t.charAt(i),o=r.charAt(i);s!==o&&i>0?n+=`${e}${t.charAt(i)}`:n+=o}return n}function wr(r){return r==null?!1:typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^0[^.]/.test(r)?!1:/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}function lo(r){if(Array.isArray(r))return r.map(o=>typeof o!="string"?o+"":o);r=r.trim();let e=0,t=null,n=null,i=null,s=[];for(let o=0;o<r.length;o++){if(t=n,n=r.charAt(o),n===" "&&!i){t!==" "&&e++;continue}n===i?i=null:(n==="'"||n==='"')&&!i&&(i=n),s[e]||(s[e]=""),s[e]+=n}return s}var Te;(function(r){r.BOOLEAN="boolean",r.STRING="string",r.NUMBER="number",r.ARRAY="array"})(Te||(Te={}));var Be,Er=class{constructor(e){Be=e}parse(e,t){let n=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),i=lo(e),s=nf(Object.assign(Object.create(null),n.alias)),o=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},n.configuration),a=Object.assign(Object.create(null),n.default),u=n.configObjects||[],p=n.envPrefix,h=o["populate--"],l=h?"--":"_",b=Object.create(null),m=Object.create(null),E=n.__||Be.format,d={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:[]},S=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,N=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach(function(f){let g=typeof f=="object"?f.key:f,A=Object.keys(f).map(function(w){return{boolean:"bools",string:"strings",number:"numbers"}[w]}).filter(Boolean).pop();A&&(d[A][g]=!0),d.arrays[g]=!0,d.keys.push(g)}),[].concat(n.boolean||[]).filter(Boolean).forEach(function(f){d.bools[f]=!0,d.keys.push(f)}),[].concat(n.string||[]).filter(Boolean).forEach(function(f){d.strings[f]=!0,d.keys.push(f)}),[].concat(n.number||[]).filter(Boolean).forEach(function(f){d.numbers[f]=!0,d.keys.push(f)}),[].concat(n.count||[]).filter(Boolean).forEach(function(f){d.counts[f]=!0,d.keys.push(f)}),[].concat(n.normalize||[]).filter(Boolean).forEach(function(f){d.normalize[f]=!0,d.keys.push(f)}),typeof n.narg=="object"&&Object.entries(n.narg).forEach(([f,g])=>{typeof g=="number"&&(d.nargs[f]=g,d.keys.push(f))}),typeof n.coerce=="object"&&Object.entries(n.coerce).forEach(([f,g])=>{typeof g=="function"&&(d.coercions[f]=g,d.keys.push(f))}),typeof n.config<"u"&&(Array.isArray(n.config)||typeof n.config=="string"?[].concat(n.config).filter(Boolean).forEach(function(f){d.configs[f]=!0}):typeof n.config=="object"&&Object.entries(n.config).forEach(([f,g])=>{(typeof g=="boolean"||typeof g=="function")&&(d.configs[f]=g)})),Tt(n.key,s,n.default,d.arrays),Object.keys(a).forEach(function(f){(d.aliases[f]||[]).forEach(function(g){a[g]=a[f]})});let O=null;Nr();let U=[],W=Object.assign(Object.create(null),{_:[]}),xe={};for(let f=0;f<i.length;f++){let g=i[f],A=g.replace(/^-{3,}/,"---"),w,y,x,j,q,pe;if(g!=="--"&&Q(g))Xe(g);else if(A.match(/---+(=|$)/)){Xe(g);continue}else if(g.match(/^--.+=/)||!o["short-option-groups"]&&g.match(/^-.+=/))j=g.match(/^--?([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&(T(j[1],d.arrays)?f=Qe(f,j[1],i,j[2]):T(j[1],d.nargs)!==!1?f=Je(f,j[1],i,j[2]):B(j[1],j[2]));else if(g.match(N)&&o["boolean-negation"])j=g.match(N),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],B(y,T(y,d.arrays)?[!1]:!1));else if(g.match(/^--.+/)||!o["short-option-groups"]&&g.match(/^-[^-]+/))j=g.match(/^--?(.+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],T(y,d.arrays)?f=Qe(f,y,i):T(y,d.nargs)!==!1?f=Je(f,y,i):(q=i[f+1],q!==void 0&&(!q.match(/^-/)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(B(y,q),f++):B(y,Y(y))));else if(g.match(/^-.\..+=/))j=g.match(/^-([^=]+)=([\s\S]*)$/),j!==null&&Array.isArray(j)&&j.length>=3&&B(j[1],j[2]);else if(g.match(/^-.\..+/)&&!g.match(S))q=i[f+1],j=g.match(/^-(.\..+)/),j!==null&&Array.isArray(j)&&j.length>=2&&(y=j[1],q!==void 0&&!q.match(/^-/)&&!T(y,d.bools)&&!T(y,d.counts)?(B(y,q),f++):B(y,Y(y)));else if(g.match(/^-[^-]+/)&&!g.match(S)){x=g.slice(1,-1).split(""),w=!1;for(let Ae=0;Ae<x.length;Ae++){if(q=g.slice(Ae+2),x[Ae+1]&&x[Ae+1]==="="){pe=g.slice(Ae+3),y=x[Ae],T(y,d.arrays)?f=Qe(f,y,i,pe):T(y,d.nargs)!==!1?f=Je(f,y,i,pe):B(y,pe),w=!0;break}if(q==="-"){B(x[Ae],q);continue}if(/[A-Za-z]/.test(x[Ae])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(q)&&T(q,d.bools)===!1){B(x[Ae],q),w=!0;break}if(x[Ae+1]&&x[Ae+1].match(/\W/)){B(x[Ae],q),w=!0;break}else B(x[Ae],Y(x[Ae]))}y=g.slice(-1)[0],!w&&y!=="-"&&(T(y,d.arrays)?f=Qe(f,y,i):T(y,d.nargs)!==!1?f=Je(f,y,i):(q=i[f+1],q!==void 0&&(!/^(-|--)[^-]/.test(q)||q.match(S))&&!T(y,d.bools)&&!T(y,d.counts)||/^(true|false)$/.test(q)?(B(y,q),f++):B(y,Y(y))))}else if(g.match(/^-[0-9]$/)&&g.match(S)&&T(g.slice(1),d.bools))y=g.slice(1),B(y,Y(y));else if(g==="--"){U=i.slice(f+1);break}else if(o["halt-at-non-option"]){U=i.slice(f);break}else Xe(g)}se(W,!0),se(W,!1),P(W),ee(),Ze(W,d.aliases,a,!0),K(W),o["set-placeholder-key"]&&ue(W),Object.keys(d.counts).forEach(function(f){Z(W,f.split("."))||B(f,0)}),h&&U.length&&(W[l]=[]),U.forEach(function(f){W[l].push(f)}),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(W).filter(f=>f!=="--"&&f.includes("-")).forEach(f=>{delete W[f]}),o["strip-aliased"]&&[].concat(...Object.keys(s).map(f=>s[f])).forEach(f=>{o["camel-case-expansion"]&&f.includes("-")&&delete W[f.split(".").map(g=>lt(g)).join(".")],delete W[f]});function Xe(f){let g=_("_",f);(typeof g=="string"||typeof g=="number")&&W._.push(g)}function Je(f,g,A,w){let y,x=T(g,d.nargs);if(x=typeof x!="number"||isNaN(x)?1:x,x===0)return fe(w)||(O=Error(E("Argument unexpected for: %s",g))),B(g,Y(g)),f;let j=fe(w)?0:1;if(o["nargs-eats-options"])A.length-(f+1)+j<x&&(O=Error(E("Not enough arguments following: %s",g))),j=x;else{for(y=f+1;y<A.length&&(!A[y].match(/^-[^0-9]/)||A[y].match(S)||Q(A[y]));y++)j++;j<x&&(O=Error(E("Not enough arguments following: %s",g)))}let q=Math.min(j,x);for(!fe(w)&&q>0&&(B(g,w),q--),y=f+1;y<q+f+1;y++)B(g,A[y]);return f+q}function Qe(f,g,A,w){let y=[],x=w||A[f+1],j=T(g,d.nargs);if(T(g,d.bools)&&!/^(true|false)$/.test(x))y.push(!0);else if(fe(x)||fe(w)&&/^-/.test(x)&&!S.test(x)&&!Q(x)){if(a[g]!==void 0){let q=a[g];y=Array.isArray(q)?q:[q]}}else{fe(w)||y.push($(g,w));for(let q=f+1;q<A.length&&!(!o["greedy-arrays"]&&y.length>0||j&&typeof j=="number"&&y.length>=j||(x=A[q],/^-/.test(x)&&!S.test(x)&&!Q(x)));q++)f=q,y.push($(g,x))}return typeof j=="number"&&(j&&y.length<j||isNaN(j)&&y.length===0)&&(O=Error(E("Not enough arguments following: %s",g))),B(g,y),f}function B(f,g){if(/-/.test(f)&&o["camel-case-expansion"]){let y=f.split(".").map(function(x){return lt(x)}).join(".");He(f,y)}let A=$(f,g),w=f.split(".");Ve(W,w,A),d.aliases[f]&&d.aliases[f].forEach(function(y){let x=y.split(".");Ve(W,x,A)}),w.length>1&&o["dot-notation"]&&(d.aliases[w[0]]||[]).forEach(function(y){let x=y.split("."),j=[].concat(w);j.shift(),x=x.concat(j),(d.aliases[f]||[]).includes(x.join("."))||Ve(W,x,A)}),T(f,d.normalize)&&!T(f,d.arrays)&&[f].concat(d.aliases[f]||[]).forEach(function(x){Object.defineProperty(xe,x,{enumerable:!0,get(){return g},set(j){g=typeof j=="string"?Be.normalize(j):j}})})}function He(f,g){d.aliases[f]&&d.aliases[f].length||(d.aliases[f]=[g],b[g]=!0),d.aliases[g]&&d.aliases[g].length||He(g,f)}function $(f,g){typeof g=="string"&&(g[0]==="'"||g[0]==='"')&&g[g.length-1]===g[0]&&(g=g.substring(1,g.length-1)),(T(f,d.bools)||T(f,d.counts))&&typeof g=="string"&&(g=g==="true");let A=Array.isArray(g)?g.map(function(w){return _(f,w)}):_(f,g);return T(f,d.counts)&&(fe(A)||typeof A=="boolean")&&(A=an()),T(f,d.normalize)&&T(f,d.arrays)&&(Array.isArray(g)?A=g.map(w=>Be.normalize(w)):A=Be.normalize(g)),A}function _(f,g){return!o["parse-positional-numbers"]&&f==="_"||!T(f,d.strings)&&!T(f,d.bools)&&!Array.isArray(g)&&(wr(g)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${g}`)))||!fe(g)&&T(f,d.numbers))&&(g=Number(g)),g}function P(f){let g=Object.create(null);Ze(g,d.aliases,a),Object.keys(d.configs).forEach(function(A){let w=f[A]||g[A];if(w)try{let y=null,x=Be.resolve(Be.cwd(),w),j=d.configs[A];if(typeof j=="function"){try{y=j(x)}catch(q){y=q}if(y instanceof Error){O=y;return}}else y=Be.require(x);F(y)}catch(y){y.name==="PermissionDenied"?O=y:f[A]&&(O=Error(E("Invalid JSON config file: %s",w)))}})}function F(f,g){Object.keys(f).forEach(function(A){let w=f[A],y=g?g+"."+A:A;typeof w=="object"&&w!==null&&!Array.isArray(w)&&o["dot-notation"]?F(w,y):(!Z(W,y.split("."))||T(y,d.arrays)&&o["combine-arrays"])&&B(y,w)})}function ee(){typeof u<"u"&&u.forEach(function(f){F(f)})}function se(f,g){if(typeof p>"u")return;let A=typeof p=="string"?p:"",w=Be.env();Object.keys(w).forEach(function(y){if(A===""||y.lastIndexOf(A,0)===0){let x=y.split("__").map(function(j,q){return q===0&&(j=j.substring(A.length)),lt(j)});(g&&d.configs[x.join(".")]||!g)&&!Z(f,x)&&B(x.join("."),w[y])}})}function K(f){let g,A=new Set;Object.keys(f).forEach(function(w){if(!A.has(w)&&(g=T(w,d.coercions),typeof g=="function"))try{let y=_(w,g(f[w]));[].concat(d.aliases[w]||[],w).forEach(x=>{A.add(x),f[x]=y})}catch(y){O=y}})}function ue(f){return d.keys.forEach(g=>{~g.indexOf(".")||typeof f[g]>"u"&&(f[g]=void 0)}),f}function Ze(f,g,A,w=!1){Object.keys(A).forEach(function(y){Z(f,y.split("."))||(Ve(f,y.split("."),A[y]),w&&(m[y]=!0),(g[y]||[]).forEach(function(x){Z(f,x.split("."))||Ve(f,x.split("."),A[y])}))})}function Z(f,g){let A=f;o["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(y){A=A[y]||{}});let w=g[g.length-1];return typeof A!="object"?!1:w in A}function Ve(f,g,A){let w=f;o["dot-notation"]||(g=[g.join(".")]),g.slice(0,-1).forEach(function(pe){pe=uo(pe),typeof w=="object"&&w[pe]===void 0&&(w[pe]={}),typeof w[pe]!="object"||Array.isArray(w[pe])?(Array.isArray(w[pe])?w[pe].push({}):w[pe]=[w[pe],{}],w=w[pe][w[pe].length-1]):w=w[pe]});let y=uo(g[g.length-1]),x=T(g.join("."),d.arrays),j=Array.isArray(A),q=o["duplicate-arguments-array"];!q&&T(y,d.nargs)&&(q=!0,(!fe(w[y])&&d.nargs[y]===1||Array.isArray(w[y])&&w[y].length===d.nargs[y])&&(w[y]=void 0)),A===an()?w[y]=an(w[y]):Array.isArray(w[y])?q&&x&&j?w[y]=o["flatten-duplicate-arrays"]?w[y].concat(A):(Array.isArray(w[y][0])?w[y]:[w[y]]).concat([A]):!q&&!!x==!!j?w[y]=A:w[y]=w[y].concat([A]):w[y]===void 0&&x?w[y]=j?A:[A]:q&&!(w[y]===void 0||T(y,d.counts)||T(y,d.bools))?w[y]=[w[y],A]:w[y]=A}function Tt(...f){f.forEach(function(g){Object.keys(g||{}).forEach(function(A){d.aliases[A]||(d.aliases[A]=[].concat(s[A]||[]),d.aliases[A].concat(A).forEach(function(w){if(/-/.test(w)&&o["camel-case-expansion"]){let y=lt(w);y!==A&&d.aliases[A].indexOf(y)===-1&&(d.aliases[A].push(y),b[y]=!0)}}),d.aliases[A].concat(A).forEach(function(w){if(w.length>1&&/[A-Z]/.test(w)&&o["camel-case-expansion"]){let y=br(w,"-");y!==A&&d.aliases[A].indexOf(y)===-1&&(d.aliases[A].push(y),b[y]=!0)}}),d.aliases[A].forEach(function(w){d.aliases[w]=[A].concat(d.aliases[A].filter(function(y){return w!==y}))}))})})}function T(f,g){let A=[].concat(d.aliases[f]||[],f),w=Object.keys(g),y=A.find(x=>w.includes(x));return y?g[y]:!1}function Ot(f){let g=Object.keys(d);return[].concat(g.map(w=>d[w])).some(function(w){return Array.isArray(w)?w.includes(f):w[f]})}function Hn(f,...g){return[].concat(...g).some(function(w){let y=f.match(w);return y&&Ot(y[1])})}function D(f){if(f.match(S)||!f.match(/^-[^-]+/))return!1;let g=!0,A,w=f.slice(1).split("");for(let y=0;y<w.length;y++){if(A=f.slice(y+2),!Ot(w[y])){g=!1;break}if(w[y+1]&&w[y+1]==="="||A==="-"||/[A-Za-z]/.test(w[y])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(A)||w[y+1]&&w[y+1].match(/\W/))break}return g}function Q(f){return o["unknown-options-as-args"]&&X(f)}function X(f){return f=f.replace(/^-{3,}/,"--"),f.match(S)||D(f)?!1:!Hn(f,/^-+([^=]+?)=[\s\S]*$/,N,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function Y(f){return!T(f,d.bools)&&!T(f,d.counts)&&`${f}`in a?a[f]:le(Ce(f))}function le(f){return{[Te.BOOLEAN]:!0,[Te.STRING]:"",[Te.NUMBER]:void 0,[Te.ARRAY]:[]}[f]}function Ce(f){let g=Te.BOOLEAN;return T(f,d.strings)?g=Te.STRING:T(f,d.numbers)?g=Te.NUMBER:T(f,d.bools)?g=Te.BOOLEAN:T(f,d.arrays)&&(g=Te.ARRAY),g}function fe(f){return f===void 0}function Nr(){Object.keys(d.counts).find(f=>T(f,d.arrays)?(O=Error(E("Invalid configuration: %s, opts.count excludes opts.array.",f)),!0):T(f,d.nargs)?(O=Error(E("Invalid configuration: %s, opts.count excludes opts.narg.",f)),!0):!1)}return{aliases:Object.assign({},d.aliases),argv:Object.assign(xe,W),configuration:o,defaulted:Object.assign({},m),error:O,newAliases:Object.assign({},b)}}};function nf(r){let e=[],t=Object.create(null),n=!0;for(Object.keys(r).forEach(function(i){e.push([].concat(r[i],i))});n;){n=!1;for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].filter(function(a){return e[s].indexOf(a)!==-1}).length){e[i]=e[i].concat(e[s]),e.splice(s,1),n=!0;break}}return e.forEach(function(i){i=i.filter(function(o,a,u){return u.indexOf(o)===a});let s=i.pop();s!==void 0&&typeof s=="string"&&(t[s]=i)}),t}function an(r){return r!==void 0?r+1:1}function uo(r){return r==="__proto__"?"___proto___":r}var fo=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):10;if(process&&process.version&&Number(process.version.match(/v([^.]+)/)[1])<fo)throw Error(`yargs parser supports a minimum Node.js version of ${fo}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`);var lf=process?process.env:{},po=new Er({cwd:process.cwd,env:()=>lf,format:sf,normalize:af,resolve:cf,require:r=>{if(typeof Ue<"u")return Ue(r);if(r.match(/\.json$/))return of(r,"utf8");throw Error("only .json config files are supported in ESM")}}),Gt=function(e,t){return po.parse(e.slice(),t).argv};Gt.detailed=function(r,e){return po.parse(r.slice(),e)};Gt.camelCase=lt;Gt.decamelize=br;Gt.looksLikeNumber=wr;var cn=Gt;import{basename as Of,dirname as _f,extname as Sf,relative as Cf,resolve as wo}from"path";function ho(){return uf()?0:1}function uf(){return ff()&&!process.defaultApp}function ff(){return!!process.versions.electron}function ln(r){return r.slice(ho()+1)}function mo(){return process.argv[ho()]}var ne=class r extends Error{constructor(e){super(e||"yargs error"),this.name="YError",Error.captureStackTrace(this,r)}};import{readFileSync as df,statSync as pf,writeFile as hf}from"fs";import{format as mf}from"util";import{resolve as gf}from"path";var go={fs:{readFileSync:df,writeFile:hf},format:mf,resolve:gf,exists:r=>{try{return pf(r).isFile()}catch{return!1}}};var ze,un=class{constructor(e){e=e||{},this.directory=e.directory||"./locales",this.updateFiles=typeof e.updateFiles=="boolean"?e.updateFiles:!0,this.locale=e.locale||"en",this.fallbackToLanguage=typeof e.fallbackToLanguage=="boolean"?e.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...e){if(typeof arguments[0]!="string")return this._taggedLiteral(arguments[0],...arguments);let t=e.shift(),n=function(){};return typeof e[e.length-1]=="function"&&(n=e.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]=t,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),ze.format.apply(ze.format,[this.cache[this.locale][t]||t].concat(e))}__n(){let e=Array.prototype.slice.call(arguments),t=e.shift(),n=e.shift(),i=e.shift(),s=function(){};typeof e[e.length-1]=="function"&&(s=e.pop()),this.cache[this.locale]||this._readLocaleFile();let o=i===1?t:n;this.cache[this.locale][t]&&(o=this.cache[this.locale][t][i===1?"one":"other"]),!this.cache[this.locale][t]&&this.updateFiles?(this.cache[this.locale][t]={one:t,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:s})):s();let a=[o];return~o.indexOf("%d")&&a.push(i),ze.format.apply(ze.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 n="";return e.forEach(function(i,s){let o=t[s+1];n+=i,typeof o<"u"&&(n+="%s")}),this.__.apply(this,[n].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e),this.writeQueue.length===1&&this._processWriteQueue()}_processWriteQueue(){let e=this,t=this.writeQueue[0],n=t.directory,i=t.locale,s=t.cb,o=this._resolveLocaleFile(n,i),a=JSON.stringify(this.cache[i],null,2);ze.fs.writeFile(o,a,"utf-8",function(u){e.writeQueue.shift(),e.writeQueue.length>0&&e._processWriteQueue(),s(u)})}_readLocaleFile(){let e={},t=this._resolveLocaleFile(this.directory,this.locale);try{ze.fs.readFileSync&&(e=JSON.parse(ze.fs.readFileSync(t,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+t),n.code==="ENOENT")e={};else throw n}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let n=ze.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~t.lastIndexOf("_")){let i=ze.resolve(e,"./",t.split("_")[0]+".json");this._fileExistsSync(i)&&(n=i)}return n}_fileExistsSync(e){return ze.exists(e)}};function yo(r,e){ze=e;let t=new un(r);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 yf=r=>yo(r,go),bo=yf;var Rf="require is not supported by ESM",Eo="loading a directory of commands is not supported yet for ESM",xf=Ao(import.meta.url).split("node_modules")[0],jf=Ao(import.meta.url),fn={assert:{notStrictEqual:bf,strictEqual:wf},cliui:on,findUp:co,getEnv:r=>process.env[r],inspect:Ef,getCallerFile:()=>{throw new ne(Eo)},getProcessArgvBin:mo,mainFilename:xf||process.cwd(),Parser:cn,path:{basename:Of,dirname:_f,extname:Sf,relative:Cf,resolve:wo},process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:Af,require:()=>{throw new ne(Rf)},requireDirectory:()=>{throw new ne(Eo)},stringWidth:r=>[...r].length,y18n:bo({directory:wo(jf,"../../../locales"),updateFiles:!1})};function Se(r,e,t,n){t.assert.notStrictEqual(r,e,n)}function dn(r,e){e.assert.strictEqual(typeof r,"string")}function Rt(r){return Object.keys(r)}function ie(r){return!!r&&!!r.then&&typeof r.then=="function"}function tt(r){let t=r.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,i=t.shift();if(!i)throw new Error(`No command found in: ${r}`);let s={cmd:i.replace(n,""),demanded:[],optional:[]};return t.forEach((o,a)=>{let u=!1;o=o.replace(/\s/g,""),/\.+[\]>]/.test(o)&&a===t.length-1&&(u=!0),/^\[/.test(o)?s.optional.push({cmd:o.replace(n,"").split("|"),variadic:u}):s.demanded.push({cmd:o.replace(n,"").split("|"),variadic:u})}),s}var vf=["first","second","third","fourth","fifth","sixth"];function v(r,e,t){function n(){return typeof r=="object"?[{demanded:[],optional:[]},r,e]:[tt(`cmd ${r}`),e,t]}try{let i=0,[s,o,a]=n(),u=[].slice.call(o);for(;u.length&&u[u.length-1]===void 0;)u.pop();let p=a||u.length;if(p<s.demanded.length)throw new ne(`Not enough arguments provided. Expected ${s.demanded.length} but received ${u.length}.`);let h=s.demanded.length+s.optional.length;if(p>h)throw new ne(`Too many arguments provided. Expected max ${h} but received ${p}.`);s.demanded.forEach(l=>{let b=u.shift(),m=Oo(b);l.cmd.filter(d=>d===m||d==="*").length===0&&_o(m,l.cmd,i),i+=1}),s.optional.forEach(l=>{if(u.length===0)return;let b=u.shift(),m=Oo(b);l.cmd.filter(d=>d===m||d==="*").length===0&&_o(m,l.cmd,i),i+=1})}catch(i){console.warn(i.stack)}}function Oo(r){return Array.isArray(r)?"array":r===null?"null":typeof r}function _o(r,e,t){throw new ne(`Invalid ${vf[t]||"manyith"} argument. Expected ${e.join(" or ")} but received ${r}.`)}var Ar=class{constructor(e){this.globalMiddleware=[],this.frozens=[],this.yargs=e}addMiddleware(e,t,n=!0){if(v("<array|function> [boolean] [boolean]",[e,t,n],arguments.length),Array.isArray(e)){for(let i=0;i<e.length;i++){if(typeof e[i]!="function")throw Error("middleware must be a function");let s=e[i];s.applyBeforeValidation=t,s.global=n}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e=="function"){let i=e;i.applyBeforeValidation=t,i.global=n,this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){let n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter(i=>{let s=[...n[t]||[],t];return i.option?!s.includes(i.option):!0}),e.option=t,this.addMiddleware(e,!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 So(r){return r?r.map(e=>(e.applyBeforeValidation=!1,e)):[]}function ut(r,e,t,n){return t.reduce((i,s)=>{if(s.applyBeforeValidation!==n)return i;if(ie(i))return i.then(o=>Promise.all([o,s(o,e)])).then(([o,a])=>Object.assign(o,a));{let o=s(i,e);return ie(o)?o.then(a=>Object.assign(i,a)):Object.assign(i,o)}},r)}function ft(r,e,t=n=>{throw n}){try{let n=$f(r)?r():r;return ie(n)?n.then(i=>e(i)):e(n)}catch(n){return t(n)}}function $f(r){return typeof r=="function"}function pn(r){if(typeof Ue>"u")return null;for(let e=0,t=Object.keys(Ue.cache),n;e<t.length;e++)if(n=Ue.cache[t[e]],n.exports===r)return n;return null}var xt=/(^\*)|(^\$0)/,hn=class{constructor(e,t,n,i){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=i,this.usage=e,this.globalMiddleware=n,this.validation=t}addDirectory(e,t,n,i){i=i||{},typeof i.recurse!="boolean"&&(i.recurse=!1),Array.isArray(i.extensions)||(i.extensions=["js"]);let s=typeof i.visit=="function"?i.visit:o=>o;i.visit=(o,a,u)=>{let p=s(o,a,u);if(p){if(this.requireCache.has(a))return p;this.requireCache.add(a),this.addHandler(p)}return p},this.shim.requireDirectory({require:t,filename:n},e,i)}addHandler(e,t,n,i,s,o){let a=[],u=So(s);if(i=i||(()=>{}),Array.isArray(e))if(If(e))[e,...a]=e;else for(let p of e)this.addHandler(p);else if(Pf(e)){let p=Array.isArray(e.command)||typeof e.command=="string"?e.command:this.moduleName(e);e.aliases&&(p=[].concat(p).concat(e.aliases)),this.addHandler(p,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(Co(n)){this.addHandler([e].concat(a),t,n.builder,n.handler,n.middlewares,n.deprecated);return}if(typeof e=="string"){let p=tt(e);a=a.map(b=>tt(b).cmd);let h=!1,l=[p.cmd].concat(a).filter(b=>xt.test(b)?(h=!0,!1):!0);l.length===0&&h&&l.push("$0"),h&&(p.cmd=l[0],a=l.slice(1),e=e.replace(xt,p.cmd)),a.forEach(b=>{this.aliasMap[b]=p.cmd}),t!==!1&&this.usage.command(e,t,h,a,o),this.handlers[p.cmd]={original:e,description:t,handler:i,builder:n||{},middlewares:u,deprecated:o,demanded:p.demanded,optional:p.optional},h&&(this.defaultCommand=this.handlers[p.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,n,i,s,o){let a=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand,u=t.getInternalMethods().getContext(),p=u.commands.slice(),h=!e;e&&(u.commands.push(e),u.fullCommands.push(a.original));let l=this.applyBuilderUpdateUsageAndParse(h,a,t,n.aliases,p,i,s,o);return ie(l)?l.then(b=>this.applyMiddlewareAndGetResult(h,a,b.innerArgv,u,s,b.aliases,t)):this.applyMiddlewareAndGetResult(h,a,l.innerArgv,u,s,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,n,i,s,o,a,u){let p=t.builder,h=n;if(Or(p)){let l=p(n.getInternalMethods().reset(i),u);if(ie(l))return l.then(b=>(h=xo(b)?b:n,this.parseAndUpdateUsage(e,t,h,s,o,a)))}else Lf(p)&&(h=n.getInternalMethods().reset(i),Object.keys(t.builder).forEach(l=>{h.option(l,p[l])}));return this.parseAndUpdateUsage(e,t,h,s,o,a)}parseAndUpdateUsage(e,t,n,i,s,o){e&&n.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(i,t),t.description);let a=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,s,o);return ie(a)?a.then(u=>({aliases:n.parsed.aliases,innerArgv:u})):{aliases:n.parsed.aliases,innerArgv:a}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){let n=xt.test(t.original)?t.original.replace(xt,"").trim():t.original,i=e.filter(s=>!xt.test(s));return i.push(n),`$0 ${i.join(" ")}`}applyMiddlewareAndGetResult(e,t,n,i,s,o,a){let u={};if(s)return n;a.getInternalMethods().getHasOutput()||(u=this.populatePositionals(t,n,i,a));let p=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);if(n=ut(n,a,p,!0),!a.getInternalMethods().getHasOutput()){let h=a.getInternalMethods().runValidation(o,u,a.parsed.error,e);n=ft(n,l=>(h(l),l))}if(t.handler&&!a.getInternalMethods().getHasOutput()){a.getInternalMethods().setHasOutput();let h=!!a.getOptions().configuration["populate--"];a.getInternalMethods().postProcess(n,h,!1,!1),n=ut(n,a,p,!1),n=ft(n,l=>{let b=t.handler(l);return ie(b)?b.then(()=>l):l}),e||a.getInternalMethods().getUsageInstance().cacheHelpMessage(),ie(n)&&!a.getInternalMethods().hasParseCallback()&&n.catch(l=>{try{a.getInternalMethods().getUsageInstance().fail(null,l)}catch{}})}return e||(i.commands.pop(),i.fullCommands.pop()),n}populatePositionals(e,t,n,i){t._=t._.slice(n.commands.length);let s=e.demanded.slice(0),o=e.optional.slice(0),a={};for(this.validation.positionalCount(s.length,t._.length);s.length;){let u=s.shift();this.populatePositional(u,t,a)}for(;o.length;){let u=o.shift();this.populatePositional(u,t,a)}return t._=n.commands.concat(t._.map(u=>""+u)),this.postProcessPositionals(t,a,this.cmdToParseOptions(e.original),i),a}populatePositional(e,t,n){let i=e.cmd[0];e.variadic?n[i]=t._.splice(0).map(String):t._.length&&(n[i]=[String(t._.shift())])}cmdToParseOptions(e){let t={array:[],default:{},alias:{},demand:{}},n=tt(e);return n.demanded.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o,t.demand[s]=!0}),n.optional.forEach(i=>{let[s,...o]=i.cmd;i.variadic&&(t.array.push(s),t.default[s]=[]),t.alias[s]=o}),t}postProcessPositionals(e,t,n,i){let s=Object.assign({},i.getOptions());s.default=Object.assign(n.default,s.default);for(let p of Object.keys(n.alias))s.alias[p]=(s.alias[p]||[]).concat(n.alias[p]);s.array=s.array.concat(n.array),s.config={};let o=[];if(Object.keys(t).forEach(p=>{t[p].map(h=>{s.configuration["unknown-options-as-args"]&&(s.key[p]=!0),o.push(`--${p}`),o.push(h)})}),!o.length)return;let a=Object.assign({},s.configuration,{"populate--":!1}),u=this.shim.Parser.detailed(o,Object.assign({},s,{configuration:a}));if(u.error)i.getInternalMethods().getUsageInstance().fail(u.error.message,u.error);else{let p=Object.keys(t);Object.keys(t).forEach(h=>{p.push(...u.aliases[h])}),Object.keys(u.argv).forEach(h=>{p.indexOf(h)!==-1&&(t[h]||(t[h]=u.argv[h]),e[h]=u.argv[h])})}}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){let n=xt.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(n,this.defaultCommand.description)}let t=this.defaultCommand.builder;if(Or(t))return t(e,!0);Co(t)||Object.keys(t).forEach(n=>{e.option(n,t[n])})}moduleName(e){let t=pn(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:n}){for(let i of[e,t,n]){if(typeof i=="string"||i===!1)return i;Se(i,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let e=this.frozens.pop();Se(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 Ro(r,e,t,n){return new hn(r,e,t,n)}function Co(r){return typeof r=="object"&&!!r.builder&&typeof r.handler=="function"}function If(r){return r.every(e=>typeof e=="string")}function Or(r){return typeof r=="function"}function Lf(r){return typeof r=="object"}function Pf(r){return typeof r=="object"&&!Array.isArray(r)}function rt(r={},e=()=>!0){let t={};return Rt(r).forEach(n=>{e(n,r[n])&&(t[n]=r[n])}),t}function nt(r){typeof process>"u"||[process.stdout,process.stderr].forEach(e=>{let t=e;t._handle&&t.isTTY&&typeof t._handle.setBlocking=="function"&&t._handle.setBlocking(r)})}function Nf(r){return typeof r=="boolean"}function vo(r,e){let t=e.y18n.__,n={},i=[];n.failFn=function(_){i.push(_)};let s=null,o=!0;n.showHelpOnFail=function(_=!0,P){function F(){return typeof _=="string"?[!0,_]:[_,P]}let[ee,se]=F();return s=se,o=ee,n};let a=!1;n.fail=function(_,P){let F=r.getInternalMethods().getLoggerInstance();if(i.length)for(let ee=i.length-1;ee>=0;--ee){let se=i[ee];if(Nf(se)){if(P)throw P;if(_)throw Error(_)}else se(_,P,n)}else{if(r.getExitProcess()&&nt(!0),a||(a=!0,o&&(r.showHelp("error"),F.error()),(_||P)&&F.error(_||P),s&&((_||P)&&F.error(""),F.error(s))),P=P||new ne(_),r.getExitProcess())return r.exit(1);if(r.getInternalMethods().hasParseCallback())return r.exit(1,P);throw P}};let u=[],p=!1;n.usage=($,_)=>$===null?(p=!0,u=[],n):(p=!1,u.push([$,_||""]),n),n.getUsage=()=>u,n.getUsageDisabled=()=>p,n.getPositionalGroupName=()=>t("Positionals:");let h=[];n.example=($,_)=>{h.push([$,_||""])};let l=[];n.command=function(_,P,F,ee,se=!1){F&&(l=l.map(K=>(K[2]=!1,K))),l.push([_,P||"",F,ee,se])},n.getCommands=()=>l;let b={};n.describe=function(_,P){Array.isArray(_)?_.forEach(F=>{n.describe(F,P)}):typeof _=="object"?Object.keys(_).forEach(F=>{n.describe(F,_[F])}):b[_]=P},n.getDescriptions=()=>b;let m=[];n.epilog=$=>{m.push($)};let E=!1,d;n.wrap=$=>{E=!0,d=$};function S(){return E||(d=Qe(),E=!0),d}let N="__yargsString__:";n.deferY18nLookup=$=>N+$,n.help=function(){if(W)return W;U();let _=r.customScriptName?r.$0:e.path.basename(r.$0),P=r.getDemandedOptions(),F=r.getDemandedCommands(),ee=r.getDeprecatedOptions(),se=r.getGroups(),K=r.getOptions(),ue=[];ue=ue.concat(Object.keys(b)),ue=ue.concat(Object.keys(P)),ue=ue.concat(Object.keys(F)),ue=ue.concat(Object.keys(K.default)),ue=ue.filter(Xe),ue=Object.keys(ue.reduce((D,Q)=>(Q!=="_"&&(D[Q]=!0),D),{}));let Ze=S(),Z=e.cliui({width:Ze,wrap:!!Ze});if(!p){if(u.length)u.forEach(D=>{Z.div(`${D[0].replace(/\$0/g,_)}`),D[1]&&Z.div({text:`${D[1]}`,padding:[1,0,0,0]})}),Z.div();else if(l.length){let D=null;F._?D=`${_} <${t("command")}>
|
|
17
17
|
`:D=`${_} [${t("command")}]
|
|
18
|
-
`,Z.div(`${D}`)}}if(l.length>1||l.length===1&&!l[0][2]){Z.div(t("Commands:"));let D=r.getInternalMethods().getContext(),Q=D.commands.length?`${D.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(l=l.sort((X,Y)=>X[0].localeCompare(Y[0]))),l.forEach(X=>{let Y=`${_} ${Q}${X[0].replace(/^\$0 ?/,"")}`;Z.span({text:Y,padding:[0,2,0,2],width:O(l,Ze,`${_}${Q}`)+4},{text:X[1]});let le=[];X[2]&&le.push(`[${t("default")}]`),X[3]&&X[3].length&&le.push(`[${t("aliases:")} ${X[3].join(", ")}]`),X[4]&&(typeof X[4]=="string"?le.push(`[${t("deprecated: %s",X[4])}]`):le.push(`[${t("deprecated")}]`)),le.length?Z.div({text:le.join(" "),padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}let Ve=(Object.keys(K.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);ue=ue.filter(D=>!r.parsed.newAliases[D]&&Ve.every(Q=>(K.alias[Q]||[]).indexOf(D)===-1));let Tt=t("Options:");se[Tt]||(se[Tt]=[]),xe(ue,K.alias,se,Tt);let T=D=>/^--/.test(_r(D)),Ot=Object.keys(se).filter(D=>se[D].length>0).map(D=>{let Q=se[D].filter(Xe).map(X=>{if(~Ve.indexOf(X))return X;for(let Y=0,le;(le=Ve[Y])!==void 0;Y++)if(~(K.alias[le]||[]).indexOf(X))return le;return X});return{groupName:D,normalizedKeys:Q}}).filter(({normalizedKeys:D})=>D.length>0).map(({groupName:D,normalizedKeys:Q})=>{let X=Q.reduce((Y,le)=>(Y[le]=[le].concat(K.alias[le]||[]).map(Ce=>D===n.getPositionalGroupName()?Ce:(/^[0-9]$/.test(Ce)?~K.boolean.indexOf(le)?"-":"--":Ce.length>1?"--":"-")+Ce).sort((Ce,fe)=>T(Ce)===T(fe)?0:T(Ce)?1:-1).join(", "),Y),{});return{groupName:D,normalizedKeys:Q,switches:X}});if(Ot.filter(({groupName:D})=>D!==n.getPositionalGroupName()).some(({normalizedKeys:D,switches:Q})=>!D.every(X=>T(Q[X])))&&Ot.filter(({groupName:D})=>D!==n.getPositionalGroupName()).forEach(({normalizedKeys:D,switches:Q})=>{D.forEach(X=>{T(Q[X])&&(Q[X]=
|
|
18
|
+
`,Z.div(`${D}`)}}if(l.length>1||l.length===1&&!l[0][2]){Z.div(t("Commands:"));let D=r.getInternalMethods().getContext(),Q=D.commands.length?`${D.commands.join(" ")} `:"";r.getInternalMethods().getParserConfiguration()["sort-commands"]===!0&&(l=l.sort((X,Y)=>X[0].localeCompare(Y[0]))),l.forEach(X=>{let Y=`${_} ${Q}${X[0].replace(/^\$0 ?/,"")}`;Z.span({text:Y,padding:[0,2,0,2],width:O(l,Ze,`${_}${Q}`)+4},{text:X[1]});let le=[];X[2]&&le.push(`[${t("default")}]`),X[3]&&X[3].length&&le.push(`[${t("aliases:")} ${X[3].join(", ")}]`),X[4]&&(typeof X[4]=="string"?le.push(`[${t("deprecated: %s",X[4])}]`):le.push(`[${t("deprecated")}]`)),le.length?Z.div({text:le.join(" "),padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}let Ve=(Object.keys(K.alias)||[]).concat(Object.keys(r.parsed.newAliases)||[]);ue=ue.filter(D=>!r.parsed.newAliases[D]&&Ve.every(Q=>(K.alias[Q]||[]).indexOf(D)===-1));let Tt=t("Options:");se[Tt]||(se[Tt]=[]),xe(ue,K.alias,se,Tt);let T=D=>/^--/.test(_r(D)),Ot=Object.keys(se).filter(D=>se[D].length>0).map(D=>{let Q=se[D].filter(Xe).map(X=>{if(~Ve.indexOf(X))return X;for(let Y=0,le;(le=Ve[Y])!==void 0;Y++)if(~(K.alias[le]||[]).indexOf(X))return le;return X});return{groupName:D,normalizedKeys:Q}}).filter(({normalizedKeys:D})=>D.length>0).map(({groupName:D,normalizedKeys:Q})=>{let X=Q.reduce((Y,le)=>(Y[le]=[le].concat(K.alias[le]||[]).map(Ce=>D===n.getPositionalGroupName()?Ce:(/^[0-9]$/.test(Ce)?~K.boolean.indexOf(le)?"-":"--":Ce.length>1?"--":"-")+Ce).sort((Ce,fe)=>T(Ce)===T(fe)?0:T(Ce)?1:-1).join(", "),Y),{});return{groupName:D,normalizedKeys:Q,switches:X}});if(Ot.filter(({groupName:D})=>D!==n.getPositionalGroupName()).some(({normalizedKeys:D,switches:Q})=>!D.every(X=>T(Q[X])))&&Ot.filter(({groupName:D})=>D!==n.getPositionalGroupName()).forEach(({normalizedKeys:D,switches:Q})=>{D.forEach(X=>{T(Q[X])&&(Q[X]=Tf(Q[X],4))})}),Ot.forEach(({groupName:D,normalizedKeys:Q,switches:X})=>{Z.div(D),Q.forEach(Y=>{let le=X[Y],Ce=b[Y]||"",fe=null;~Ce.lastIndexOf(N)&&(Ce=t(Ce.substring(N.length))),~K.boolean.indexOf(Y)&&(fe=`[${t("boolean")}]`),~K.count.indexOf(Y)&&(fe=`[${t("count")}]`),~K.string.indexOf(Y)&&(fe=`[${t("string")}]`),~K.normalize.indexOf(Y)&&(fe=`[${t("string")}]`),~K.array.indexOf(Y)&&(fe=`[${t("array")}]`),~K.number.indexOf(Y)&&(fe=`[${t("number")}]`);let Nr=g=>typeof g=="string"?`[${t("deprecated: %s",g)}]`:`[${t("deprecated")}]`,f=[Y in ee?Nr(ee[Y]):null,fe,Y in P?`[${t("required")}]`:null,K.choices&&K.choices[Y]?`[${t("choices:")} ${n.stringifiedValues(K.choices[Y])}]`:null,Je(K.default[Y],K.defaultDescription[Y])].filter(Boolean).join(" ");Z.span({text:_r(le),padding:[0,2,0,2+jo(le)],width:O(X,Ze)+4},Ce),f?Z.div({text:f,padding:[0,0,0,2],align:"right"}):Z.div()}),Z.div()}),h.length&&(Z.div(t("Examples:")),h.forEach(D=>{D[0]=D[0].replace(/\$0/g,_)}),h.forEach(D=>{D[1]===""?Z.div({text:D[0],padding:[0,2,0,2]}):Z.div({text:D[0],padding:[0,2,0,2],width:O(h,Ze)+4},{text:D[1]})}),Z.div()),m.length>0){let D=m.map(Q=>Q.replace(/\$0/g,_)).join(`
|
|
19
19
|
`);Z.div(`${D}
|
|
20
|
-
`)}return Z.toString().replace(/\s*$/,"")};function O($,_,P){let F=0;return Array.isArray($)||($=Object.values($).map(ee=>[ee])),$.forEach(ee=>{F=Math.max(e.stringWidth(P?`${P} ${_r(ee[0])}`:_r(ee[0]))+
|
|
20
|
+
`)}return Z.toString().replace(/\s*$/,"")};function O($,_,P){let F=0;return Array.isArray($)||($=Object.values($).map(ee=>[ee])),$.forEach(ee=>{F=Math.max(e.stringWidth(P?`${P} ${_r(ee[0])}`:_r(ee[0]))+jo(ee[0]),F)}),_&&(F=Math.min(F,parseInt((_*.5).toString(),10))),F}function U(){let $=r.getDemandedOptions(),_=r.getOptions();(Object.keys(_.alias)||[]).forEach(P=>{_.alias[P].forEach(F=>{b[F]&&n.describe(P,b[F]),F in $&&r.demandOption(P,$[F]),~_.boolean.indexOf(F)&&r.boolean(P),~_.count.indexOf(F)&&r.count(P),~_.string.indexOf(F)&&r.string(P),~_.normalize.indexOf(F)&&r.normalize(P),~_.array.indexOf(F)&&r.array(P),~_.number.indexOf(F)&&r.number(P)})})}let W;n.cacheHelpMessage=function(){W=this.help()},n.clearCachedHelpMessage=function(){W=void 0},n.hasCachedHelpMessage=function(){return!!W};function xe($,_,P,F){let ee=[],se=null;return Object.keys(P).forEach(K=>{ee=ee.concat(P[K])}),$.forEach(K=>{se=[K].concat(_[K]),se.some(ue=>ee.indexOf(ue)!==-1)||P[F].push(K)}),ee}function Xe($){return r.getOptions().hiddenOptions.indexOf($)<0||r.parsed.argv[r.getOptions().showHiddenOpt]}n.showHelp=$=>{let _=r.getInternalMethods().getLoggerInstance();$||($="error"),(typeof $=="function"?$:_[$])(n.help())},n.functionDescription=$=>["(",$.name?e.Parser.decamelize($.name,"-"):t("generated-value"),")"].join(""),n.stringifiedValues=function(_,P){let F="",ee=P||", ",se=[].concat(_);return!_||!se.length||se.forEach(K=>{F.length&&(F+=ee),F+=JSON.stringify(K)}),F};function Je($,_){let P=`[${t("default:")} `;if($===void 0&&!_)return null;if(_)P+=_;else switch(typeof $){case"string":P+=`"${$}"`;break;case"object":P+=JSON.stringify($);break;default:P+=$}return`${P}]`}function Qe(){return e.process.stdColumns?Math.min(80,e.process.stdColumns):80}let B=null;n.version=$=>{B=$},n.showVersion=$=>{let _=r.getInternalMethods().getLoggerInstance();$||($="error"),(typeof $=="function"?$:_[$])(B)},n.reset=function(_){return s=null,a=!1,u=[],p=!1,m=[],h=[],l=[],b=rt(b,P=>!_[P]),n};let He=[];return n.freeze=function(){He.push({failMessage:s,failureOutput:a,usages:u,usageDisabled:p,epilogs:m,examples:h,commands:l,descriptions:b})},n.unfreeze=function(){let _=He.pop();_&&({failMessage:s,failureOutput:a,usages:u,usageDisabled:p,epilogs:m,examples:h,commands:l,descriptions:b}=_)},n}function mn(r){return typeof r=="object"}function Tf(r,e){return mn(r)?{text:r.text,indentation:r.indentation+e}:{text:r,indentation:e}}function jo(r){return mn(r)?r.indentation:0}function _r(r){return mn(r)?r.text:r}var $o=`###-begin-{{app_name}}-completions-###
|
|
21
21
|
#
|
|
22
22
|
# yargs command completion script
|
|
23
23
|
#
|
|
@@ -45,7 +45,7 @@ _{{app_name}}_yargs_completions()
|
|
|
45
45
|
}
|
|
46
46
|
complete -o default -F _{{app_name}}_yargs_completions {{app_name}}
|
|
47
47
|
###-end-{{app_name}}-completions-###
|
|
48
|
-
|
|
48
|
+
`,Io=`#compdef {{app_name}}
|
|
49
49
|
###-begin-{{app_name}}-completions-###
|
|
50
50
|
#
|
|
51
51
|
# yargs command completion script
|
|
@@ -64,57 +64,57 @@ _{{app_name}}_yargs_completions()
|
|
|
64
64
|
}
|
|
65
65
|
compdef _{{app_name}}_yargs_completions {{app_name}}
|
|
66
66
|
###-end-{{app_name}}-completions-###
|
|
67
|
-
`;var gn=class{constructor(e,t,n,i){var s,o,a;this.yargs=e,this.usage=t,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,t,n,i){let s=this.command.getCommandHandlers();for(let a=0,u=e.length;a<u;++a)if(s[e[a]]&&s[e[a]].builder){let p=s[e[a]].builder;if(Or(p)){let h=this.yargs.getInternalMethods().reset();return p(h,!0),h.argv}}let o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,t,n),i(null,o)}commandCompletions(e,t,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&this.usage.getCommands().forEach(s=>{let o=tt(s[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{let a=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,t,n,i){if(i.match(/^-/)||i===""&&e.length===0){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!this.argsContainKey(t,n,a,u)&&(this.completeOptionKey(a,e,i),u&&s.default[a]&&this.completeOptionKey(`no-${a}`,e,i))})}}argsContainKey(e,t,n,i){if(e.indexOf(`--${n}`)!==-1||i&&e.indexOf(`--no-${n}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[n])if(t[s]!==void 0)return!0}return!1}completeOptionKey(e,t,n){let i=this.usage.getDescriptions(),s=u=>/^--/.test(u),o=u=>/^[^0-9]$/.test(u),a=!s(n)&&o(e)?"-":"--";if(!this.zshShell)t.push(a+e);else{let u=i[e]||"";t.push(a+`${e.replace(/:/g,"\\:")}:${u.replace("__yargsString__:","")}`)}}customCompletion(e,t,n,i){if(Se(this.customCompletionFunction,null,this.shim),
|
|
67
|
+
`;var gn=class{constructor(e,t,n,i){var s,o,a;this.yargs=e,this.usage=t,this.command=n,this.shim=i,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=(a=((s=this.shim.getEnv("SHELL"))===null||s===void 0?void 0:s.includes("zsh"))||((o=this.shim.getEnv("ZSH_NAME"))===null||o===void 0?void 0:o.includes("zsh")))!==null&&a!==void 0?a:!1}defaultCompletion(e,t,n,i){let s=this.command.getCommandHandlers();for(let a=0,u=e.length;a<u;++a)if(s[e[a]]&&s[e[a]].builder){let p=s[e[a]].builder;if(Or(p)){let h=this.yargs.getInternalMethods().reset();return p(h,!0),h.argv}}let o=[];this.commandCompletions(o,e,n),this.optionCompletions(o,e,t,n),i(null,o)}commandCompletions(e,t,n){let i=this.yargs.getInternalMethods().getContext().commands;!n.match(/^-/)&&i[i.length-1]!==n&&this.usage.getCommands().forEach(s=>{let o=tt(s[0]).cmd;if(t.indexOf(o)===-1)if(!this.zshShell)e.push(o);else{let a=s[1]||"";e.push(o.replace(/:/g,"\\:")+":"+a)}})}optionCompletions(e,t,n,i){if(i.match(/^-/)||i===""&&e.length===0){let s=this.yargs.getOptions(),o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(s.key).forEach(a=>{let u=!!s.configuration["boolean-negation"]&&s.boolean.includes(a);!o.includes(a)&&!this.argsContainKey(t,n,a,u)&&(this.completeOptionKey(a,e,i),u&&s.default[a]&&this.completeOptionKey(`no-${a}`,e,i))})}}argsContainKey(e,t,n,i){if(e.indexOf(`--${n}`)!==-1||i&&e.indexOf(`--no-${n}`)!==-1)return!0;if(this.aliases){for(let s of this.aliases[n])if(t[s]!==void 0)return!0}return!1}completeOptionKey(e,t,n){let i=this.usage.getDescriptions(),s=u=>/^--/.test(u),o=u=>/^[^0-9]$/.test(u),a=!s(n)&&o(e)?"-":"--";if(!this.zshShell)t.push(a+e);else{let u=i[e]||"";t.push(a+`${e.replace(/:/g,"\\:")}:${u.replace("__yargsString__:","")}`)}}customCompletion(e,t,n,i){if(Se(this.customCompletionFunction,null,this.shim),qf(this.customCompletionFunction)){let s=this.customCompletionFunction(n,t);return ie(s)?s.then(o=>{this.shim.process.nextTick(()=>{i(null,o)})}).catch(o=>{this.shim.process.nextTick(()=>{i(o,void 0)})}):i(null,s)}else return Mf(this.customCompletionFunction)?this.customCompletionFunction(n,t,(s=i)=>this.defaultCompletion(e,t,n,s),s=>{i(null,s)}):this.customCompletionFunction(n,t,s=>{i(null,s)})}getCompletion(e,t){let n=e.length?e[e.length-1]:"",i=this.yargs.parse(e,!0),s=this.customCompletionFunction?o=>this.customCompletion(e,o,n,t):o=>this.defaultCompletion(e,o,n,t);return ie(i)?i.then(s):s(i)}generateCompletionScript(e,t){let n=this.zshShell?Io:$o,i=this.shim.path.basename(e);return e.match(/\.js$/)&&(e=`./${e}`),n=n.replace(/{{app_name}}/g,i),n=n.replace(/{{completion_command}}/g,t),n.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}};function Lo(r,e,t,n){return new gn(r,e,t,n)}function qf(r){return r.length<3}function Mf(r){return r.length>3}function Po(r,e){if(r.length===0)return e.length;if(e.length===0)return r.length;let t=[],n;for(n=0;n<=e.length;n++)t[n]=[n];let i;for(i=0;i<=r.length;i++)t[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=r.length;i++)e.charAt(n-1)===r.charAt(i-1)?t[n][i]=t[n-1][i-1]:t[n][i]=Math.min(t[n-1][i-1]+1,Math.min(t[n][i-1]+1,t[n-1][i]+1));return t[e.length][r.length]}var No=["$0","--","_"];function To(r,e,t){let n=t.y18n.__,i=t.y18n.__n,s={};s.nonOptionCount=function(l){let b=r.getDemandedCommands(),E=l._.length+(l["--"]?l["--"].length:0)-r.getInternalMethods().getContext().commands.length;b._&&(E<b._.min||E>b._.max)&&(E<b._.min?b._.minMsg!==void 0?e.fail(b._.minMsg?b._.minMsg.replace(/\$0/g,E.toString()).replace(/\$1/,b._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",E,E.toString(),b._.min.toString())):E>b._.max&&(b._.maxMsg!==void 0?e.fail(b._.maxMsg?b._.maxMsg.replace(/\$0/g,E.toString()).replace(/\$1/,b._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",E,E.toString(),b._.max.toString()))))},s.positionalCount=function(l,b){b<l&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",b,b+"",l+""))},s.requiredArguments=function(l,b){let m=null;for(let E of Object.keys(b))(!Object.prototype.hasOwnProperty.call(l,E)||typeof l[E]>"u")&&(m=m||{},m[E]=b[E]);if(m){let E=[];for(let S of Object.keys(m)){let N=m[S];N&&E.indexOf(N)<0&&E.push(N)}let d=E.length?`
|
|
68
68
|
${E.join(`
|
|
69
|
-
`)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(m).length,Object.keys(m).join(", ")+d))}},s.unknownArguments=function(l,b,m,E,d=!0){let S=r.getInternalMethods().getCommandInstance().getCommands(),N=[],O=r.getInternalMethods().getContext();Object.keys(l).forEach(U=>{
|
|
69
|
+
`)}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(m).length,Object.keys(m).join(", ")+d))}},s.unknownArguments=function(l,b,m,E,d=!0){let S=r.getInternalMethods().getCommandInstance().getCommands(),N=[],O=r.getInternalMethods().getContext();Object.keys(l).forEach(U=>{No.indexOf(U)===-1&&!Object.prototype.hasOwnProperty.call(m,U)&&!Object.prototype.hasOwnProperty.call(r.getInternalMethods().getParseContext(),U)&&!s.isValidAndSomeAliasIsNotNew(U,b)&&N.push(U)}),d&&(O.commands.length>0||S.length>0||E)&&l._.slice(O.commands.length).forEach(U=>{S.indexOf(""+U)===-1&&N.push(""+U)}),N.length>0&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",N.length,N.join(", ")))},s.unknownCommands=function(l){let b=r.getInternalMethods().getCommandInstance().getCommands(),m=[],E=r.getInternalMethods().getContext();return(E.commands.length>0||b.length>0)&&l._.slice(E.commands.length).forEach(d=>{b.indexOf(""+d)===-1&&m.push(""+d)}),m.length>0?(e.fail(i("Unknown command: %s","Unknown commands: %s",m.length,m.join(", "))),!0):!1},s.isValidAndSomeAliasIsNotNew=function(l,b){if(!Object.prototype.hasOwnProperty.call(b,l))return!1;let m=r.parsed.newAliases;return[l,...b[l]].some(E=>!Object.prototype.hasOwnProperty.call(m,E)||!m[l])},s.limitedChoices=function(l){let b=r.getOptions(),m={};if(!Object.keys(b.choices).length)return;Object.keys(l).forEach(S=>{No.indexOf(S)===-1&&Object.prototype.hasOwnProperty.call(b.choices,S)&&[].concat(l[S]).forEach(N=>{b.choices[S].indexOf(N)===-1&&N!==void 0&&(m[S]=(m[S]||[]).concat(N))})});let E=Object.keys(m);if(!E.length)return;let d=n("Invalid values:");E.forEach(S=>{d+=`
|
|
70
70
|
${n("Argument: %s, Given: %s, Choices: %s",S,e.stringifiedValues(m[S]),e.stringifiedValues(b.choices[S]))}`}),e.fail(d)};let o={};s.implies=function(l,b){v("<string|object> [array|number|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(m=>{s.implies(m,l[m])}):(r.global(l),o[l]||(o[l]=[]),Array.isArray(b)?b.forEach(m=>s.implies(l,m)):(Se(b,void 0,t),o[l].push(b)))},s.getImplied=function(){return o};function a(h,l){let b=Number(l);return l=isNaN(b)?l:b,typeof l=="number"?l=h._.length>=l:l.match(/^--no-.+/)?(l=l.match(/^--no-(.+)/)[1],l=!h[l]):l=h[l],l}s.implications=function(l){let b=[];if(Object.keys(o).forEach(m=>{let E=m;(o[m]||[]).forEach(d=>{let S=E,N=d;S=a(l,S),d=a(l,d),S&&!d&&b.push(` ${E} -> ${N}`)})}),b.length){let m=`${n("Implications failed:")}
|
|
71
|
-
`;b.forEach(E=>{m+=E}),e.fail(m)}};let u={};s.conflicts=function(l,b){v("<string|object> [array|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(m=>{s.conflicts(m,l[m])}):(r.global(l),u[l]||(u[l]=[]),Array.isArray(b)?b.forEach(m=>s.conflicts(l,m)):u[l].push(b))},s.getConflicting=()=>u,s.conflicting=function(l){Object.keys(l).forEach(b=>{u[b]&&u[b].forEach(m=>{m&&l[b]!==void 0&&l[m]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",b,m))})})},s.recommendCommands=function(l,b){b=b.sort((S,N)=>N.length-S.length);let E=null,d=1/0;for(let S=0,N;(N=b[S])!==void 0;S++){let O=Lo(l,N);O<=3&&O<d&&(d=O,E=N)}E&&e.fail(n("Did you mean %s?",E))},s.reset=function(l){return o=rt(o,b=>!l[b]),u=rt(u,b=>!l[b]),s};let p=[];return s.freeze=function(){p.push({implied:o,conflicting:u})},s.unfreeze=function(){let l=p.pop();Se(l,void 0,t),{implied:o,conflicting:u}=l},s}var yn=[],Wt;function Ht(r,e,t,n){Wt=n;let i={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return i;let s=/\.json|\..*rc$/.test(r.extends),o=null;if(s)o=Ff(e,r.extends);else try{o=Ue.resolve(r.extends)}catch{return r}Mf(o),yn.push(o),i=s?JSON.parse(Wt.readFileSync(o,"utf8")):Ue(r.extends),delete r.extends,i=Ht(i,Wt.path.dirname(o),t,Wt)}return yn=[],t?To(i,r):Object.assign({},i,r)}function Mf(r){if(yn.indexOf(r)>-1)throw new ne(`Circular extended configurations: '${r}'.`)}function Ff(r,e){return Wt.path.resolve(r,e)}function To(r,e){let t={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(t,r);for(let i of Object.keys(e))n(e[i])&&n(t[i])?t[i]=To(r[i],e[i]):t[i]=e[i];return t}var I=function(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t},c=function(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)},ce,dt,Vt,De,ve,Sr,it,pt,qe,Cr,Me,We,$e,Fe,jt,he,L,Rr,xr,Ie,ht,vt,mt,st,jr,M,gt,yt,bt,z,Ye,oe;function Qo(r){return(e=[],t=r.process.cwd(),n)=>{let i=new jn(e,t,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var Do=Symbol("copyDoubleDash"),qo=Symbol("copyDoubleDash"),bn=Symbol("deleteFromParserHintObject"),Mo=Symbol("freeze"),Fo=Symbol("getDollarZero"),wt=Symbol("getParserConfiguration"),wn=Symbol("guessLocale"),ko=Symbol("guessVersion"),zo=Symbol("parsePositionalNumbers"),En=Symbol("pkgUp"),ot=Symbol("populateParserHintArray"),$t=Symbol("populateParserHintSingleValueDictionary"),An=Symbol("populateParserHintArrayDictionary"),On=Symbol("populateParserHintDictionary"),_n=Symbol("sanitizeKey"),Sn=Symbol("setKey"),Cn=Symbol("unfreeze"),Uo=Symbol("validateAsync"),Go=Symbol("getCommandInstance"),Wo=Symbol("getContext"),Ho=Symbol("getHasOutput"),Vo=Symbol("getLoggerInstance"),Bo=Symbol("getParseContext"),Yo=Symbol("getUsageInstance"),Ko=Symbol("getValidationInstance"),vr=Symbol("hasParseCallback"),Et=Symbol("postProcess"),Xo=Symbol("rebase"),Rn=Symbol("reset"),Bt=Symbol("runYargsParserAndExecuteCommands"),xn=Symbol("runValidation"),Jo=Symbol("setHasOutput"),jn=class{constructor(e=[],t,n,i){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),dt.set(this,void 0),Vt.set(this,{commands:[],fullCommands:[]}),De.set(this,null),ve.set(this,null),Sr.set(this,"show-hidden"),it.set(this,null),pt.set(this,!0),qe.set(this,!0),Cr.set(this,[]),Me.set(this,void 0),We.set(this,{}),$e.set(this,!1),Fe.set(this,null),jt.set(this,void 0),he.set(this,""),L.set(this,void 0),Rr.set(this,void 0),xr.set(this,{}),Ie.set(this,null),ht.set(this,null),vt.set(this,{}),mt.set(this,{}),st.set(this,void 0),jr.set(this,!1),M.set(this,void 0),gt.set(this,!1),yt.set(this,!1),bt.set(this,!1),z.set(this,void 0),Ye.set(this,null),oe.set(this,void 0),I(this,M,i),I(this,st,e),I(this,dt,t),I(this,Rr,n),I(this,Me,new Ar(this)),this.$0=this[Fo](),this[Rn](),I(this,ce,c(this,ce)),I(this,z,c(this,z)),I(this,oe,c(this,oe)),I(this,L,c(this,L)),c(this,L).showHiddenOpt=c(this,Sr),I(this,jt,this[qo]())}addHelpOpt(e,t){let n="help";return v("[string|boolean] [string]",[e,t],arguments.length),c(this,Fe)&&(this[bn](c(this,Fe)),I(this,Fe,null)),e===!1&&t===void 0?this:(I(this,Fe,typeof e=="string"?e:n),this.boolean(c(this,Fe)),this.describe(c(this,Fe),t||c(this,z).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(v("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:c(this,Sr);return this.boolean(n),this.describe(n,t||c(this,z).deferY18nLookup("Show hidden options")),c(this,L).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return v("<object|string|array> [string|array]",[e,t],arguments.length),this[An](this.alias.bind(this),"alias",e,t),this}array(e){return v("<array|string>",[e],arguments.length),this[ot]("array",e),this}boolean(e){return v("<array|string>",[e],arguments.length),this[ot]("boolean",e),this}check(e,t){return v("<function> [boolean]",[e,t],arguments.length),this.middleware((n,i)=>ft(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&c(this,z).fail(s.toString(),s):c(this,z).fail(c(this,M).y18n.__("Argument check failed: %s",e.toString())),n),s=>(c(this,z).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return v("<object|string|array> [string|array]",[e,t],arguments.length),this[An](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(v("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new ne("coerce callback must be provided");for(let n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new ne("coerce callback must be provided");return c(this,L).key[e]=!0,c(this,Me).addCoerceMiddleware((n,i)=>{let s;return ft(()=>(s=i.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let a of s[e])n[a]=o;return n},o=>{throw new ne(o.message)})},e),this}conflicts(e,t){return v("<string|object> [string|array]",[e,t],arguments.length),c(this,oe).conflicts(e,t),this}config(e="config",t,n){return v("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=Ht(e,c(this,dt),this[wt]()["deep-merge-config"]||!1,c(this,M)),c(this,L).configObjects=(c(this,L).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||c(this,z).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{c(this,L).config[i]=n||!0}),this)}completion(e,t,n){return v("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),I(this,ve,e||c(this,ve)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(c(this,ve),t),n&&c(this,De).registerFunction(n),this}command(e,t,n,i,s,o){return v("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,i,s,o],arguments.length),c(this,ce).addHandler(e,t,n,i,s,o),this}commands(e,t,n,i,s,o){return this.command(e,t,n,i,s,o)}commandDir(e,t){v("<string> [object]",[e,t],arguments.length);let n=c(this,Rr)||c(this,M).require;return c(this,ce).addDirectory(e,n,c(this,M).getCallerFile(),t),this}count(e){return v("<array|string>",[e],arguments.length),this[ot]("count",e),this}default(e,t,n){return v("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(dn(e,c(this,M)),c(this,L).defaultDescription[e]=n),typeof t=="function"&&(dn(e,c(this,M)),c(this,L).defaultDescription[e]||(c(this,L).defaultDescription[e]=c(this,z).functionDescription(t)),t=t.call()),this[$t](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,i){return v("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,i],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),c(this,L).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:i},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(i=>{Se(n,!0,c(this,M)),this.demandOption(i,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(Se(n,!0,c(this,M)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(i=>{Se(n,!0,c(this,M)),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return v("<object|string|array> [string]",[e,t],arguments.length),this[$t](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return v("<string> [string|boolean]",[e,t],arguments.length),c(this,L).deprecatedOptions[e]=t,this}describe(e,t){return v("<object|string|array> [string]",[e,t],arguments.length),this[Sn](e,!0),c(this,z).describe(e,t),this}detectLocale(e){return v("<boolean>",[e],arguments.length),I(this,pt,e),this}env(e){return v("[string|boolean]",[e],arguments.length),e===!1?delete c(this,L).envPrefix:c(this,L).envPrefix=e||"",this}epilogue(e){return v("<string>",[e],arguments.length),c(this,z).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return v("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):c(this,z).example(e,t),this}exit(e,t){I(this,$e,!0),I(this,it,t),c(this,qe)&&c(this,M).process.exit(e)}exitProcess(e=!0){return v("[boolean]",[e],arguments.length),I(this,qe,e),this}fail(e){if(v("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new ne("Invalid first argument. Expected function or boolean 'false'");return c(this,z).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return v("<array> [function]",[e,t],arguments.length),t?c(this,De).getCompletion(e,t):new Promise((n,i)=>{c(this,De).getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return v([],0),c(this,L).demandedOptions}getDemandedCommands(){return v([],0),c(this,L).demandedCommands}getDeprecatedOptions(){return v([],0),c(this,L).deprecatedOptions}getDetectLocale(){return c(this,pt)}getExitProcess(){return c(this,qe)}getGroups(){return Object.assign({},c(this,We),c(this,mt))}getHelp(){if(I(this,$e,!0),!c(this,z).hasCachedHelpMessage()){if(!this.parsed){let t=this[Bt](c(this,st),void 0,void 0,0,!0);if(ie(t))return t.then(()=>c(this,z).help())}let e=c(this,ce).runDefaultBuilderOn(this);if(ie(e))return e.then(()=>c(this,z).help())}return Promise.resolve(c(this,z).help())}getOptions(){return c(this,L)}getStrict(){return c(this,gt)}getStrictCommands(){return c(this,yt)}getStrictOptions(){return c(this,bt)}global(e,t){return v("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?c(this,L).local=c(this,L).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{c(this,L).local.indexOf(n)===-1&&c(this,L).local.push(n)}),this}group(e,t){v("<string|array> <string>",[e,t],arguments.length);let n=c(this,mt)[t]||c(this,We)[t];c(this,mt)[t]&&delete c(this,mt)[t];let i={};return c(this,We)[t]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return v("<string>",[e],arguments.length),c(this,L).hiddenOptions.push(e),this}implies(e,t){return v("<string|object> [number|string|array]",[e,t],arguments.length),c(this,oe).implies(e,t),this}locale(e){return v("[string]",[e],arguments.length),e?(I(this,pt,!1),c(this,M).y18n.setLocale(e),this):(this[wn](),c(this,M).y18n.getLocale())}middleware(e,t,n){return c(this,Me).addMiddleware(e,!!t,n)}nargs(e,t){return v("<string|object|array> [number]",[e,t],arguments.length),this[$t](this.nargs.bind(this),"narg",e,t),this}normalize(e){return v("<array|string>",[e],arguments.length),this[ot]("normalize",e),this}number(e){return v("<array|string>",[e],arguments.length),this[ot]("number",e),this}option(e,t){if(v("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),c(this,L).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let i=t.demand||t.required||t.require;i&&this.demand(e,i),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&&(c(this,L).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc;this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){v("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[Mo](),typeof e>"u"&&(e=c(this,st)),typeof t=="object"&&(I(this,ht,t),t=n),typeof t=="function"&&(I(this,Ie,t),t=!1),t||I(this,st,e),c(this,Ie)&&I(this,qe,!1);let i=this[Bt](e,!!t),s=this.parsed;return c(this,De).setParsed(this.parsed),ie(i)?i.then(o=>(c(this,Ie)&&c(this,Ie).call(this,c(this,it),o,c(this,he)),o)).catch(o=>{throw c(this,Ie)&&c(this,Ie)(o,this.parsed.argv,c(this,he)),o}).finally(()=>{this[Cn](),this.parsed=s}):(c(this,Ie)&&c(this,Ie).call(this,c(this,it),i,c(this,he)),this[Cn](),this.parsed=s,i)}parseAsync(e,t,n){let i=this.parse(e,t,n);return ie(i)?i:Promise.resolve(i)}parseSync(e,t,n){let i=this.parse(e,t,n);if(ie(i))throw new ne(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return v("<object>",[e],arguments.length),I(this,xr,e),this}pkgConf(e,t){v("<string> [string]",[e,t],arguments.length);let n=null,i=this[En](t||c(this,dt));return i[e]&&typeof i[e]=="object"&&(n=Ht(i[e],t||c(this,dt),this[wt]()["deep-merge-config"]||!1,c(this,M)),c(this,L).configObjects=(c(this,L).configObjects||[]).concat(n)),this}positional(e,t){v("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=rt(t,(o,a)=>{let u=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(a)===-1&&(u=!1),u});let i=c(this,Vt).fullCommands[c(this,Vt).fullCommands.length-1],s=i?c(this,ce).cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Rt(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(e)!==-1&&(t[o]=!0):a[e]&&!(o in t)&&(t[o]=a[e])}),this.group(e,c(this,z).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return v("[boolean]",[e],arguments.length),I(this,jr,e),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return v("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&c(this,L).narg[e]?this:(this[$t](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return v("[string] [string]",[e,t],arguments.length),e=e||this.$0,c(this,jt).log(c(this,De).generateCompletionScript(e,t||c(this,ve)||"completion")),this}showHelp(e){if(v("[string|function]",[e],arguments.length),I(this,$e,!0),!c(this,z).hasCachedHelpMessage()){if(!this.parsed){let n=this[Bt](c(this,st),void 0,void 0,0,!0);if(ie(n))return n.then(()=>{c(this,z).showHelp(e)}),this}let t=c(this,ce).runDefaultBuilderOn(this);if(ie(t))return t.then(()=>{c(this,z).showHelp(e)}),this}return c(this,z).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return v("[boolean|string] [string]",[e,t],arguments.length),c(this,z).showHelpOnFail(e,t),this}showVersion(e){return v("[string|function]",[e],arguments.length),c(this,z).showVersion(e),this}skipValidation(e){return v("<array|string>",[e],arguments.length),this[ot]("skipValidation",e),this}strict(e){return v("[boolean]",[e],arguments.length),I(this,gt,e!==!1),this}strictCommands(e){return v("[boolean]",[e],arguments.length),I(this,yt,e!==!1),this}strictOptions(e){return v("[boolean]",[e],arguments.length),I(this,bt,e!==!1),this}string(e){return v("<array|string>",[e],arguments.length),this[ot]("string",e),this}terminalWidth(){return v([],0),c(this,M).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return v("<object>",[e],arguments.length),I(this,pt,!1),c(this,M).y18n.updateLocale(e),this}usage(e,t,n,i){if(v("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,i],arguments.length),t!==void 0){if(Se(e,null,c(this,M)),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,i);throw new ne(".usage() description must start with $0 if being used as alias for .command()")}else return c(this,z).usage(e),this}version(e,t,n){let i="version";if(v("[boolean|string] [string] [string]",[e,t,n],arguments.length),c(this,Ye)&&(this[bn](c(this,Ye)),c(this,z).version(void 0),I(this,Ye,null)),arguments.length===0)n=this[ko](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=t,t=void 0);return I(this,Ye,typeof e=="string"?e:i),t=t||c(this,z).deferY18nLookup("Show version number"),c(this,z).version(n||void 0),this.boolean(c(this,Ye)),this.describe(c(this,Ye),t),this}wrap(e){return v("<number|null|undefined>",[e],arguments.length),c(this,z).wrap(e),this}[(ce=new WeakMap,dt=new WeakMap,Vt=new WeakMap,De=new WeakMap,ve=new WeakMap,Sr=new WeakMap,it=new WeakMap,pt=new WeakMap,qe=new WeakMap,Cr=new WeakMap,Me=new WeakMap,We=new WeakMap,$e=new WeakMap,Fe=new WeakMap,jt=new WeakMap,he=new WeakMap,L=new WeakMap,Rr=new WeakMap,xr=new WeakMap,Ie=new WeakMap,ht=new WeakMap,vt=new WeakMap,mt=new WeakMap,st=new WeakMap,jr=new WeakMap,M=new WeakMap,gt=new WeakMap,yt=new WeakMap,bt=new WeakMap,z=new WeakMap,Ye=new WeakMap,oe=new WeakMap,Do)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[qo](){return{log:(...e)=>{this[vr]()||console.log(...e),I(this,$e,!0),c(this,he).length&&I(this,he,c(this,he)+`
|
|
71
|
+
`;b.forEach(E=>{m+=E}),e.fail(m)}};let u={};s.conflicts=function(l,b){v("<string|object> [array|string]",[l,b],arguments.length),typeof l=="object"?Object.keys(l).forEach(m=>{s.conflicts(m,l[m])}):(r.global(l),u[l]||(u[l]=[]),Array.isArray(b)?b.forEach(m=>s.conflicts(l,m)):u[l].push(b))},s.getConflicting=()=>u,s.conflicting=function(l){Object.keys(l).forEach(b=>{u[b]&&u[b].forEach(m=>{m&&l[b]!==void 0&&l[m]!==void 0&&e.fail(n("Arguments %s and %s are mutually exclusive",b,m))})})},s.recommendCommands=function(l,b){b=b.sort((S,N)=>N.length-S.length);let E=null,d=1/0;for(let S=0,N;(N=b[S])!==void 0;S++){let O=Po(l,N);O<=3&&O<d&&(d=O,E=N)}E&&e.fail(n("Did you mean %s?",E))},s.reset=function(l){return o=rt(o,b=>!l[b]),u=rt(u,b=>!l[b]),s};let p=[];return s.freeze=function(){p.push({implied:o,conflicting:u})},s.unfreeze=function(){let l=p.pop();Se(l,void 0,t),{implied:o,conflicting:u}=l},s}var yn=[],Wt;function Ht(r,e,t,n){Wt=n;let i={};if(Object.prototype.hasOwnProperty.call(r,"extends")){if(typeof r.extends!="string")return i;let s=/\.json|\..*rc$/.test(r.extends),o=null;if(s)o=kf(e,r.extends);else try{o=Ue.resolve(r.extends)}catch{return r}Ff(o),yn.push(o),i=s?JSON.parse(Wt.readFileSync(o,"utf8")):Ue(r.extends),delete r.extends,i=Ht(i,Wt.path.dirname(o),t,Wt)}return yn=[],t?Do(i,r):Object.assign({},i,r)}function Ff(r){if(yn.indexOf(r)>-1)throw new ne(`Circular extended configurations: '${r}'.`)}function kf(r,e){return Wt.path.resolve(r,e)}function Do(r,e){let t={};function n(i){return i&&typeof i=="object"&&!Array.isArray(i)}Object.assign(t,r);for(let i of Object.keys(e))n(e[i])&&n(t[i])?t[i]=Do(r[i],e[i]):t[i]=e[i];return t}var I=function(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t},c=function(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)},ce,dt,Vt,De,ve,Sr,it,pt,qe,Cr,Me,We,$e,Fe,jt,he,L,Rr,xr,Ie,ht,vt,mt,st,jr,M,gt,yt,bt,z,Ye,oe;function Zo(r){return(e=[],t=r.process.cwd(),n)=>{let i=new jn(e,t,n,r);return Object.defineProperty(i,"argv",{get:()=>i.parse(),enumerable:!0}),i.help(),i.version(),i}}var qo=Symbol("copyDoubleDash"),Mo=Symbol("copyDoubleDash"),bn=Symbol("deleteFromParserHintObject"),Fo=Symbol("freeze"),ko=Symbol("getDollarZero"),wt=Symbol("getParserConfiguration"),wn=Symbol("guessLocale"),zo=Symbol("guessVersion"),Uo=Symbol("parsePositionalNumbers"),En=Symbol("pkgUp"),ot=Symbol("populateParserHintArray"),$t=Symbol("populateParserHintSingleValueDictionary"),An=Symbol("populateParserHintArrayDictionary"),On=Symbol("populateParserHintDictionary"),_n=Symbol("sanitizeKey"),Sn=Symbol("setKey"),Cn=Symbol("unfreeze"),Go=Symbol("validateAsync"),Wo=Symbol("getCommandInstance"),Ho=Symbol("getContext"),Vo=Symbol("getHasOutput"),Bo=Symbol("getLoggerInstance"),Yo=Symbol("getParseContext"),Ko=Symbol("getUsageInstance"),Xo=Symbol("getValidationInstance"),vr=Symbol("hasParseCallback"),Et=Symbol("postProcess"),Jo=Symbol("rebase"),Rn=Symbol("reset"),Bt=Symbol("runYargsParserAndExecuteCommands"),xn=Symbol("runValidation"),Qo=Symbol("setHasOutput"),jn=class{constructor(e=[],t,n,i){this.customScriptName=!1,this.parsed=!1,ce.set(this,void 0),dt.set(this,void 0),Vt.set(this,{commands:[],fullCommands:[]}),De.set(this,null),ve.set(this,null),Sr.set(this,"show-hidden"),it.set(this,null),pt.set(this,!0),qe.set(this,!0),Cr.set(this,[]),Me.set(this,void 0),We.set(this,{}),$e.set(this,!1),Fe.set(this,null),jt.set(this,void 0),he.set(this,""),L.set(this,void 0),Rr.set(this,void 0),xr.set(this,{}),Ie.set(this,null),ht.set(this,null),vt.set(this,{}),mt.set(this,{}),st.set(this,void 0),jr.set(this,!1),M.set(this,void 0),gt.set(this,!1),yt.set(this,!1),bt.set(this,!1),z.set(this,void 0),Ye.set(this,null),oe.set(this,void 0),I(this,M,i),I(this,st,e),I(this,dt,t),I(this,Rr,n),I(this,Me,new Ar(this)),this.$0=this[ko](),this[Rn](),I(this,ce,c(this,ce)),I(this,z,c(this,z)),I(this,oe,c(this,oe)),I(this,L,c(this,L)),c(this,L).showHiddenOpt=c(this,Sr),I(this,jt,this[Mo]())}addHelpOpt(e,t){let n="help";return v("[string|boolean] [string]",[e,t],arguments.length),c(this,Fe)&&(this[bn](c(this,Fe)),I(this,Fe,null)),e===!1&&t===void 0?this:(I(this,Fe,typeof e=="string"?e:n),this.boolean(c(this,Fe)),this.describe(c(this,Fe),t||c(this,z).deferY18nLookup("Show help")),this)}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){if(v("[string|boolean] [string]",[e,t],arguments.length),e===!1&&t===void 0)return this;let n=typeof e=="string"?e:c(this,Sr);return this.boolean(n),this.describe(n,t||c(this,z).deferY18nLookup("Show hidden options")),c(this,L).showHiddenOpt=n,this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){return v("<object|string|array> [string|array]",[e,t],arguments.length),this[An](this.alias.bind(this),"alias",e,t),this}array(e){return v("<array|string>",[e],arguments.length),this[ot]("array",e),this}boolean(e){return v("<array|string>",[e],arguments.length),this[ot]("boolean",e),this}check(e,t){return v("<function> [boolean]",[e,t],arguments.length),this.middleware((n,i)=>ft(()=>e(n),s=>(s?(typeof s=="string"||s instanceof Error)&&c(this,z).fail(s.toString(),s):c(this,z).fail(c(this,M).y18n.__("Argument check failed: %s",e.toString())),n),s=>(c(this,z).fail(s.message?s.message:s.toString(),s),n)),!1,t),this}choices(e,t){return v("<object|string|array> [string|array]",[e,t],arguments.length),this[An](this.choices.bind(this),"choices",e,t),this}coerce(e,t){if(v("<object|string|array> [function]",[e,t],arguments.length),Array.isArray(e)){if(!t)throw new ne("coerce callback must be provided");for(let n of e)this.coerce(n,t);return this}else if(typeof e=="object"){for(let n of Object.keys(e))this.coerce(n,e[n]);return this}if(!t)throw new ne("coerce callback must be provided");return c(this,L).key[e]=!0,c(this,Me).addCoerceMiddleware((n,i)=>{let s;return ft(()=>(s=i.getAliases(),t(n[e])),o=>{if(n[e]=o,s[e])for(let a of s[e])n[a]=o;return n},o=>{throw new ne(o.message)})},e),this}conflicts(e,t){return v("<string|object> [string|array]",[e,t],arguments.length),c(this,oe).conflicts(e,t),this}config(e="config",t,n){return v("[object|string] [string|function] [function]",[e,t,n],arguments.length),typeof e=="object"&&!Array.isArray(e)?(e=Ht(e,c(this,dt),this[wt]()["deep-merge-config"]||!1,c(this,M)),c(this,L).configObjects=(c(this,L).configObjects||[]).concat(e),this):(typeof t=="function"&&(n=t,t=void 0),this.describe(e,t||c(this,z).deferY18nLookup("Path to JSON config file")),(Array.isArray(e)?e:[e]).forEach(i=>{c(this,L).config[i]=n||!0}),this)}completion(e,t,n){return v("[string] [string|boolean|function] [function]",[e,t,n],arguments.length),typeof t=="function"&&(n=t,t=void 0),I(this,ve,e||c(this,ve)||"completion"),!t&&t!==!1&&(t="generate completion script"),this.command(c(this,ve),t),n&&c(this,De).registerFunction(n),this}command(e,t,n,i,s,o){return v("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,n,i,s,o],arguments.length),c(this,ce).addHandler(e,t,n,i,s,o),this}commands(e,t,n,i,s,o){return this.command(e,t,n,i,s,o)}commandDir(e,t){v("<string> [object]",[e,t],arguments.length);let n=c(this,Rr)||c(this,M).require;return c(this,ce).addDirectory(e,n,c(this,M).getCallerFile(),t),this}count(e){return v("<array|string>",[e],arguments.length),this[ot]("count",e),this}default(e,t,n){return v("<object|string|array> [*] [string]",[e,t,n],arguments.length),n&&(dn(e,c(this,M)),c(this,L).defaultDescription[e]=n),typeof t=="function"&&(dn(e,c(this,M)),c(this,L).defaultDescription[e]||(c(this,L).defaultDescription[e]=c(this,z).functionDescription(t)),t=t.call()),this[$t](this.default.bind(this),"default",e,t),this}defaults(e,t,n){return this.default(e,t,n)}demandCommand(e=1,t,n,i){return v("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,n,i],arguments.length),typeof t!="number"&&(n=t,t=1/0),this.global("_",!1),c(this,L).demandedCommands._={min:e,max:t,minMsg:n,maxMsg:i},this}demand(e,t,n){return Array.isArray(t)?(t.forEach(i=>{Se(n,!0,c(this,M)),this.demandOption(i,n)}),t=1/0):typeof t!="number"&&(n=t,t=1/0),typeof e=="number"?(Se(n,!0,c(this,M)),this.demandCommand(e,t,n,n)):Array.isArray(e)?e.forEach(i=>{Se(n,!0,c(this,M)),this.demandOption(i,n)}):typeof n=="string"?this.demandOption(e,n):(n===!0||typeof n>"u")&&this.demandOption(e),this}demandOption(e,t){return v("<object|string|array> [string]",[e,t],arguments.length),this[$t](this.demandOption.bind(this),"demandedOptions",e,t),this}deprecateOption(e,t){return v("<string> [string|boolean]",[e,t],arguments.length),c(this,L).deprecatedOptions[e]=t,this}describe(e,t){return v("<object|string|array> [string]",[e,t],arguments.length),this[Sn](e,!0),c(this,z).describe(e,t),this}detectLocale(e){return v("<boolean>",[e],arguments.length),I(this,pt,e),this}env(e){return v("[string|boolean]",[e],arguments.length),e===!1?delete c(this,L).envPrefix:c(this,L).envPrefix=e||"",this}epilogue(e){return v("<string>",[e],arguments.length),c(this,z).epilog(e),this}epilog(e){return this.epilogue(e)}example(e,t){return v("<string|array> [string]",[e,t],arguments.length),Array.isArray(e)?e.forEach(n=>this.example(...n)):c(this,z).example(e,t),this}exit(e,t){I(this,$e,!0),I(this,it,t),c(this,qe)&&c(this,M).process.exit(e)}exitProcess(e=!0){return v("[boolean]",[e],arguments.length),I(this,qe,e),this}fail(e){if(v("<function|boolean>",[e],arguments.length),typeof e=="boolean"&&e!==!1)throw new ne("Invalid first argument. Expected function or boolean 'false'");return c(this,z).failFn(e),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){return v("<array> [function]",[e,t],arguments.length),t?c(this,De).getCompletion(e,t):new Promise((n,i)=>{c(this,De).getCompletion(e,(s,o)=>{s?i(s):n(o)})})}getDemandedOptions(){return v([],0),c(this,L).demandedOptions}getDemandedCommands(){return v([],0),c(this,L).demandedCommands}getDeprecatedOptions(){return v([],0),c(this,L).deprecatedOptions}getDetectLocale(){return c(this,pt)}getExitProcess(){return c(this,qe)}getGroups(){return Object.assign({},c(this,We),c(this,mt))}getHelp(){if(I(this,$e,!0),!c(this,z).hasCachedHelpMessage()){if(!this.parsed){let t=this[Bt](c(this,st),void 0,void 0,0,!0);if(ie(t))return t.then(()=>c(this,z).help())}let e=c(this,ce).runDefaultBuilderOn(this);if(ie(e))return e.then(()=>c(this,z).help())}return Promise.resolve(c(this,z).help())}getOptions(){return c(this,L)}getStrict(){return c(this,gt)}getStrictCommands(){return c(this,yt)}getStrictOptions(){return c(this,bt)}global(e,t){return v("<string|array> [boolean]",[e,t],arguments.length),e=[].concat(e),t!==!1?c(this,L).local=c(this,L).local.filter(n=>e.indexOf(n)===-1):e.forEach(n=>{c(this,L).local.indexOf(n)===-1&&c(this,L).local.push(n)}),this}group(e,t){v("<string|array> <string>",[e,t],arguments.length);let n=c(this,mt)[t]||c(this,We)[t];c(this,mt)[t]&&delete c(this,mt)[t];let i={};return c(this,We)[t]=(n||[]).concat(e).filter(s=>i[s]?!1:i[s]=!0),this}hide(e){return v("<string>",[e],arguments.length),c(this,L).hiddenOptions.push(e),this}implies(e,t){return v("<string|object> [number|string|array]",[e,t],arguments.length),c(this,oe).implies(e,t),this}locale(e){return v("[string]",[e],arguments.length),e?(I(this,pt,!1),c(this,M).y18n.setLocale(e),this):(this[wn](),c(this,M).y18n.getLocale())}middleware(e,t,n){return c(this,Me).addMiddleware(e,!!t,n)}nargs(e,t){return v("<string|object|array> [number]",[e,t],arguments.length),this[$t](this.nargs.bind(this),"narg",e,t),this}normalize(e){return v("<array|string>",[e],arguments.length),this[ot]("normalize",e),this}number(e){return v("<array|string>",[e],arguments.length),this[ot]("number",e),this}option(e,t){if(v("<string|object> [object]",[e,t],arguments.length),typeof e=="object")Object.keys(e).forEach(n=>{this.options(n,e[n])});else{typeof t!="object"&&(t={}),c(this,L).key[e]=!0,t.alias&&this.alias(e,t.alias);let n=t.deprecate||t.deprecated;n&&this.deprecateOption(e,n);let i=t.demand||t.required||t.require;i&&this.demand(e,i),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&&(c(this,L).defaultDescription[e]=t.defaultDescription),t.skipValidation&&this.skipValidation(e);let s=t.describe||t.description||t.desc;this.describe(e,s),t.hidden&&this.hide(e),t.requiresArg&&this.requiresArg(e)}return this}options(e,t){return this.option(e,t)}parse(e,t,n){v("[string|array] [function|boolean|object] [function]",[e,t,n],arguments.length),this[Fo](),typeof e>"u"&&(e=c(this,st)),typeof t=="object"&&(I(this,ht,t),t=n),typeof t=="function"&&(I(this,Ie,t),t=!1),t||I(this,st,e),c(this,Ie)&&I(this,qe,!1);let i=this[Bt](e,!!t),s=this.parsed;return c(this,De).setParsed(this.parsed),ie(i)?i.then(o=>(c(this,Ie)&&c(this,Ie).call(this,c(this,it),o,c(this,he)),o)).catch(o=>{throw c(this,Ie)&&c(this,Ie)(o,this.parsed.argv,c(this,he)),o}).finally(()=>{this[Cn](),this.parsed=s}):(c(this,Ie)&&c(this,Ie).call(this,c(this,it),i,c(this,he)),this[Cn](),this.parsed=s,i)}parseAsync(e,t,n){let i=this.parse(e,t,n);return ie(i)?i:Promise.resolve(i)}parseSync(e,t,n){let i=this.parse(e,t,n);if(ie(i))throw new ne(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(e){return v("<object>",[e],arguments.length),I(this,xr,e),this}pkgConf(e,t){v("<string> [string]",[e,t],arguments.length);let n=null,i=this[En](t||c(this,dt));return i[e]&&typeof i[e]=="object"&&(n=Ht(i[e],t||c(this,dt),this[wt]()["deep-merge-config"]||!1,c(this,M)),c(this,L).configObjects=(c(this,L).configObjects||[]).concat(n)),this}positional(e,t){v("<string> <object>",[e,t],arguments.length);let n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=rt(t,(o,a)=>{let u=n.indexOf(o)!==-1;return o==="type"&&["string","number","boolean"].indexOf(a)===-1&&(u=!1),u});let i=c(this,Vt).fullCommands[c(this,Vt).fullCommands.length-1],s=i?c(this,ce).cmdToParseOptions(i):{array:[],alias:{},default:{},demand:{}};return Rt(s).forEach(o=>{let a=s[o];Array.isArray(a)?a.indexOf(e)!==-1&&(t[o]=!0):a[e]&&!(o in t)&&(t[o]=a[e])}),this.group(e,c(this,z).getPositionalGroupName()),this.option(e,t)}recommendCommands(e=!0){return v("[boolean]",[e],arguments.length),I(this,jr,e),this}required(e,t,n){return this.demand(e,t,n)}require(e,t,n){return this.demand(e,t,n)}requiresArg(e){return v("<array|string|object> [number]",[e],arguments.length),typeof e=="string"&&c(this,L).narg[e]?this:(this[$t](this.requiresArg.bind(this),"narg",e,NaN),this)}showCompletionScript(e,t){return v("[string] [string]",[e,t],arguments.length),e=e||this.$0,c(this,jt).log(c(this,De).generateCompletionScript(e,t||c(this,ve)||"completion")),this}showHelp(e){if(v("[string|function]",[e],arguments.length),I(this,$e,!0),!c(this,z).hasCachedHelpMessage()){if(!this.parsed){let n=this[Bt](c(this,st),void 0,void 0,0,!0);if(ie(n))return n.then(()=>{c(this,z).showHelp(e)}),this}let t=c(this,ce).runDefaultBuilderOn(this);if(ie(t))return t.then(()=>{c(this,z).showHelp(e)}),this}return c(this,z).showHelp(e),this}scriptName(e){return this.customScriptName=!0,this.$0=e,this}showHelpOnFail(e,t){return v("[boolean|string] [string]",[e,t],arguments.length),c(this,z).showHelpOnFail(e,t),this}showVersion(e){return v("[string|function]",[e],arguments.length),c(this,z).showVersion(e),this}skipValidation(e){return v("<array|string>",[e],arguments.length),this[ot]("skipValidation",e),this}strict(e){return v("[boolean]",[e],arguments.length),I(this,gt,e!==!1),this}strictCommands(e){return v("[boolean]",[e],arguments.length),I(this,yt,e!==!1),this}strictOptions(e){return v("[boolean]",[e],arguments.length),I(this,bt,e!==!1),this}string(e){return v("<array|string>",[e],arguments.length),this[ot]("string",e),this}terminalWidth(){return v([],0),c(this,M).process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){return v("<object>",[e],arguments.length),I(this,pt,!1),c(this,M).y18n.updateLocale(e),this}usage(e,t,n,i){if(v("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,n,i],arguments.length),t!==void 0){if(Se(e,null,c(this,M)),(e||"").match(/^\$0( |$)/))return this.command(e,t,n,i);throw new ne(".usage() description must start with $0 if being used as alias for .command()")}else return c(this,z).usage(e),this}version(e,t,n){let i="version";if(v("[boolean|string] [string] [string]",[e,t,n],arguments.length),c(this,Ye)&&(this[bn](c(this,Ye)),c(this,z).version(void 0),I(this,Ye,null)),arguments.length===0)n=this[zo](),e=i;else if(arguments.length===1){if(e===!1)return this;n=e,e=i}else arguments.length===2&&(n=t,t=void 0);return I(this,Ye,typeof e=="string"?e:i),t=t||c(this,z).deferY18nLookup("Show version number"),c(this,z).version(n||void 0),this.boolean(c(this,Ye)),this.describe(c(this,Ye),t),this}wrap(e){return v("<number|null|undefined>",[e],arguments.length),c(this,z).wrap(e),this}[(ce=new WeakMap,dt=new WeakMap,Vt=new WeakMap,De=new WeakMap,ve=new WeakMap,Sr=new WeakMap,it=new WeakMap,pt=new WeakMap,qe=new WeakMap,Cr=new WeakMap,Me=new WeakMap,We=new WeakMap,$e=new WeakMap,Fe=new WeakMap,jt=new WeakMap,he=new WeakMap,L=new WeakMap,Rr=new WeakMap,xr=new WeakMap,Ie=new WeakMap,ht=new WeakMap,vt=new WeakMap,mt=new WeakMap,st=new WeakMap,jr=new WeakMap,M=new WeakMap,gt=new WeakMap,yt=new WeakMap,bt=new WeakMap,z=new WeakMap,Ye=new WeakMap,oe=new WeakMap,qo)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch{}return e}[Mo](){return{log:(...e)=>{this[vr]()||console.log(...e),I(this,$e,!0),c(this,he).length&&I(this,he,c(this,he)+`
|
|
72
72
|
`),I(this,he,c(this,he)+e.join(" "))},error:(...e)=>{this[vr]()||console.error(...e),I(this,$e,!0),c(this,he).length&&I(this,he,c(this,he)+`
|
|
73
|
-
`),I(this,he,c(this,he)+e.join(" "))}}}[bn](e){Rt(c(this,L)).forEach(t=>{if((i=>i==="configObjects")(t))return;let n=c(this,L)[t];Array.isArray(n)?~n.indexOf(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete c(this,z).getDescriptions()[e]}[
|
|
73
|
+
`),I(this,he,c(this,he)+e.join(" "))}}}[bn](e){Rt(c(this,L)).forEach(t=>{if((i=>i==="configObjects")(t))return;let n=c(this,L)[t];Array.isArray(n)?~n.indexOf(e)&&n.splice(n.indexOf(e),1):typeof n=="object"&&delete n[e]}),delete c(this,z).getDescriptions()[e]}[Fo](){c(this,Cr).push({options:c(this,L),configObjects:c(this,L).configObjects.slice(0),exitProcess:c(this,qe),groups:c(this,We),strict:c(this,gt),strictCommands:c(this,yt),strictOptions:c(this,bt),completionCommand:c(this,ve),output:c(this,he),exitError:c(this,it),hasOutput:c(this,$e),parsed:this.parsed,parseFn:c(this,Ie),parseContext:c(this,ht)}),c(this,z).freeze(),c(this,oe).freeze(),c(this,ce).freeze(),c(this,Me).freeze()}[ko](){let e="",t;return/\b(node|iojs|electron)(\.exe)?$/.test(c(this,M).process.argv()[0])?t=c(this,M).process.argv().slice(1,2):t=c(this,M).process.argv().slice(0,1),e=t.map(n=>{let i=this[Jo](c(this,dt),n);return n.match(/^(\/|([a-zA-Z]:)?\\)/)&&i.length<n.length?i:n}).join(" ").trim(),c(this,M).getEnv("_")&&c(this,M).getProcessArgvBin()===c(this,M).getEnv("_")&&(e=c(this,M).getEnv("_").replace(`${c(this,M).path.dirname(c(this,M).process.execPath())}/`,"")),e}[wt](){return c(this,xr)}[wn](){if(!c(this,pt))return;let e=c(this,M).getEnv("LC_ALL")||c(this,M).getEnv("LC_MESSAGES")||c(this,M).getEnv("LANG")||c(this,M).getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[zo](){return this[En]().version||"unknown"}[Uo](e){let t=e["--"]?e["--"]:e._;for(let n=0,i;(i=t[n])!==void 0;n++)c(this,M).Parser.looksLikeNumber(i)&&Number.isSafeInteger(Math.floor(parseFloat(`${i}`)))&&(t[n]=Number(i));return e}[En](e){let t=e||"*";if(c(this,vt)[t])return c(this,vt)[t];let n={};try{let i=e||c(this,M).mainFilename;!e&&c(this,M).path.extname(i)&&(i=c(this,M).path.dirname(i));let s=c(this,M).findUp(i,(o,a)=>{if(a.includes("package.json"))return"package.json"});Se(s,void 0,c(this,M)),n=JSON.parse(c(this,M).readFileSync(s,"utf8"))}catch{}return c(this,vt)[t]=n||{},c(this,vt)[t]}[ot](e,t){t=[].concat(t),t.forEach(n=>{n=this[_n](n),c(this,L)[e].push(n)})}[$t](e,t,n,i){this[On](e,t,n,i,(s,o,a)=>{c(this,L)[s][o]=a})}[An](e,t,n,i){this[On](e,t,n,i,(s,o,a)=>{c(this,L)[s][o]=(c(this,L)[s][o]||[]).concat(a)})}[On](e,t,n,i,s){if(Array.isArray(n))n.forEach(o=>{e(o,i)});else if((o=>typeof o=="object")(n))for(let o of Rt(n))e(o,n[o]);else s(t,this[_n](n),i)}[_n](e){return e==="__proto__"?"___proto___":e}[Sn](e,t){return this[$t](this[Sn].bind(this),"key",e,t),this}[Cn](){var e,t,n,i,s,o,a,u,p,h,l,b;let m=c(this,Cr).pop();Se(m,void 0,c(this,M));let E;e=this,t=this,n=this,i=this,s=this,o=this,a=this,u=this,p=this,h=this,l=this,b=this,{options:{set value(d){I(e,L,d)}}.value,configObjects:E,exitProcess:{set value(d){I(t,qe,d)}}.value,groups:{set value(d){I(n,We,d)}}.value,output:{set value(d){I(i,he,d)}}.value,exitError:{set value(d){I(s,it,d)}}.value,hasOutput:{set value(d){I(o,$e,d)}}.value,parsed:this.parsed,strict:{set value(d){I(a,gt,d)}}.value,strictCommands:{set value(d){I(u,yt,d)}}.value,strictOptions:{set value(d){I(p,bt,d)}}.value,completionCommand:{set value(d){I(h,ve,d)}}.value,parseFn:{set value(d){I(l,Ie,d)}}.value,parseContext:{set value(d){I(b,ht,d)}}.value}=m,c(this,L).configObjects=E,c(this,z).unfreeze(),c(this,oe).unfreeze(),c(this,ce).unfreeze(),c(this,Me).unfreeze()}[Go](e,t){return ft(t,n=>(e(n),n))}getInternalMethods(){return{getCommandInstance:this[Wo].bind(this),getContext:this[Ho].bind(this),getHasOutput:this[Vo].bind(this),getLoggerInstance:this[Bo].bind(this),getParseContext:this[Yo].bind(this),getParserConfiguration:this[wt].bind(this),getUsageInstance:this[Ko].bind(this),getValidationInstance:this[Xo].bind(this),hasParseCallback:this[vr].bind(this),postProcess:this[Et].bind(this),reset:this[Rn].bind(this),runValidation:this[xn].bind(this),runYargsParserAndExecuteCommands:this[Bt].bind(this),setHasOutput:this[Qo].bind(this)}}[Wo](){return c(this,ce)}[Ho](){return c(this,Vt)}[Vo](){return c(this,$e)}[Bo](){return c(this,jt)}[Yo](){return c(this,ht)||{}}[Ko](){return c(this,z)}[Xo](){return c(this,oe)}[vr](){return!!c(this,Ie)}[Et](e,t,n,i){return n||ie(e)||(t||(e=this[qo](e)),(this[wt]()["parse-positional-numbers"]||this[wt]()["parse-positional-numbers"]===void 0)&&(e=this[Uo](e)),i&&(e=ut(e,this,c(this,Me).getMiddleware(),!1))),e}[Rn](e={}){I(this,L,c(this,L)||{});let t={};t.local=c(this,L).local?c(this,L).local:[],t.configObjects=c(this,L).configObjects?c(this,L).configObjects:[];let n={};t.local.forEach(o=>{n[o]=!0,(e[o]||[]).forEach(a=>{n[a]=!0})}),Object.assign(c(this,mt),Object.keys(c(this,We)).reduce((o,a)=>{let u=c(this,We)[a].filter(p=>!(p in n));return u.length>0&&(o[a]=u),o},{})),I(this,We,{});let i=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],s=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];return i.forEach(o=>{t[o]=(c(this,L)[o]||[]).filter(a=>!n[a])}),s.forEach(o=>{t[o]=rt(c(this,L)[o],a=>!n[a])}),t.envPrefix=c(this,L).envPrefix,I(this,L,t),I(this,z,c(this,z)?c(this,z).reset(n):vo(this,c(this,M))),I(this,oe,c(this,oe)?c(this,oe).reset(n):To(this,c(this,z),c(this,M))),I(this,ce,c(this,ce)?c(this,ce).reset():Ro(c(this,z),c(this,oe),c(this,Me),c(this,M))),c(this,De)||I(this,De,Lo(this,c(this,z),c(this,ce),c(this,M))),c(this,Me).reset(),I(this,ve,null),I(this,he,""),I(this,it,null),I(this,$e,!1),this.parsed=!1,this}[Jo](e,t){return c(this,M).path.relative(e,t)}[Bt](e,t,n,i=0,s=!1){let o=!!n||s;e=e||c(this,st),c(this,L).__=c(this,M).y18n.__,c(this,L).configuration=this[wt]();let a=!!c(this,L).configuration["populate--"],u=Object.assign({},c(this,L).configuration,{"populate--":!0}),p=c(this,M).Parser.detailed(e,Object.assign({},c(this,L),{configuration:{"parse-positional-numbers":!1,...u}})),h=Object.assign(p.argv,c(this,ht)),l,b=p.aliases,m=!1,E=!1;Object.keys(h).forEach(d=>{d===c(this,Fe)&&h[d]?m=!0:d===c(this,Ye)&&h[d]&&(E=!0)}),h.$0=this.$0,this.parsed=p,i===0&&c(this,z).clearCachedHelpMessage();try{if(this[wn](),t)return this[Et](h,a,!!n,!1);c(this,Fe)&&~[c(this,Fe)].concat(b[c(this,Fe)]||[]).filter(U=>U.length>1).indexOf(""+h._[h._.length-1])&&(h._.pop(),m=!0);let d=c(this,ce).getCommands(),S=c(this,De).completionKey in h,N=m||S||s;if(h._.length){if(d.length){let O;for(let U=i||0,W;h._[U]!==void 0;U++)if(W=String(h._[U]),~d.indexOf(W)&&W!==c(this,ve)){let xe=c(this,ce).runCommand(W,this,p,U+1,s,m||E||s);return this[Et](xe,a,!!n,!1)}else if(!O&&W!==c(this,ve)){O=W;break}!c(this,ce).hasDefaultCommand()&&c(this,jr)&&O&&!N&&c(this,oe).recommendCommands(O,d)}c(this,ve)&&~h._.indexOf(c(this,ve))&&!S&&(c(this,qe)&&nt(!0),this.showCompletionScript(),this.exit(0))}if(c(this,ce).hasDefaultCommand()&&!N){let O=c(this,ce).runCommand(null,this,p,0,s,m||E||s);return this[Et](O,a,!!n,!1)}if(S){c(this,qe)&&nt(!0),e=[].concat(e);let O=e.slice(e.indexOf(`--${c(this,De).completionKey}`)+1);return c(this,De).getCompletion(O,(U,W)=>{if(U)throw new ne(U.message);(W||[]).forEach(xe=>{c(this,jt).log(xe)}),this.exit(0)}),this[Et](h,!a,!!n,!1)}if(c(this,$e)||(m?(c(this,qe)&&nt(!0),o=!0,this.showHelp("log"),this.exit(0)):E&&(c(this,qe)&&nt(!0),o=!0,c(this,z).showVersion("log"),this.exit(0))),!o&&c(this,L).skipValidation.length>0&&(o=Object.keys(h).some(O=>c(this,L).skipValidation.indexOf(O)>=0&&h[O]===!0)),!o){if(p.error)throw new ne(p.error.message);if(!S){let O=this[xn](b,{},p.error);n||(l=ut(h,this,c(this,Me).getMiddleware(),!0)),l=this[Go](O,l??h),ie(l)&&!n&&(l=l.then(()=>ut(h,this,c(this,Me).getMiddleware(),!1)))}}}catch(d){if(d instanceof ne)c(this,z).fail(d.message,d);else throw d}return this[Et](l??h,a,!!n,!0)}[xn](e,t,n,i){e={...e},t={...t};let s={...this.getDemandedOptions()};return o=>{if(n)throw new ne(n.message);c(this,oe).nonOptionCount(o),c(this,oe).requiredArguments(o,s);let a=!1;c(this,yt)&&(a=c(this,oe).unknownCommands(o)),c(this,gt)&&!a?c(this,oe).unknownArguments(o,e,t,!!i):c(this,bt)&&c(this,oe).unknownArguments(o,e,{},!1,!1),c(this,oe).limitedChoices(o),c(this,oe).implications(o),c(this,oe).conflicting(o)}}[Qo](){I(this,$e,!0)}};function xo(r){return!!r&&typeof r.getInternalMethods=="function"}var zf=Zo(fn),ea=zf;var At=Xt(hr(),1);import{spawnSync as In}from"node:child_process";import{existsSync as we,mkdirSync as Ln,mkdtempSync as aa,readdirSync as ca,readFileSync as Ee,realpathSync as ta,rmSync as la,statSync as Uf,writeFileSync as ae}from"node:fs";import{createRequire as Gf}from"node:module";import{tmpdir as ua}from"node:os";import{dirname as Yt,join as V,relative as ke,resolve as Wf}from"node:path";import{fileURLToPath as Hf}from"node:url";var It=new Set(["python","go","php","typescript","zod","mock","swr","tanstack-query","transformers","cli"]),ra=new Map([["tanstack-query-vue","vue"],["tanstack-query-svelte","svelte"],["tanstack-query-solid","solid"]]),Re="@redocly/client-generator",Vf="https://redocly.com/docs/cli/commands/eject-generator",vn="@redocly/openapi-core",na="<!-- redocly-generators:begin \u2014 managed by `redocly eject-generator`; content between markers is refreshed on eject -->",$n="<!-- redocly-generators:end -->";function Bf(){let r=Hf(new URL("./eject-assets/",import.meta.url));if(we(V(r,"generators")))return r;let e=Gf(import.meta.url).resolve(Re),t=V(Yt(e),"..","eject-assets");if(we(V(t,"generators")))return t;throw new ge(`
|
|
74
74
|
\u274C The ejectable generator sources are missing from ${Re}.
|
|
75
75
|
In a checkout of the CLI, build them first: npm run prepare -w ${Re}
|
|
76
|
-
`)}function
|
|
76
|
+
`)}function ia(r,e){let t=V(process.cwd(),".claude","skills",r,"SKILL.md");return Ln(Yt(t),{recursive:!0}),ae(t,Ee(V(e,"skills",r,"SKILL.md"),"utf-8"),"utf-8"),ke(process.cwd(),t)}function Pn(r,e){let t=["# Ejected client generators","","These files are Redocly client generators you own; `redocly generate-client` runs them.","Their design and the authoring toolkit are agent skills \u2014 edit the skill first, then make","the code match, and never hand-edit generated client output:","","- `.claude/skills/client-generators/SKILL.md` \u2014 the API model, the helpers, the loop.",...e.map(u=>`- \`.claude/skills/${u}-generator/SKILL.md\` \u2014 the \`${u}\` generator's design.`)],n=`${na}
|
|
77
77
|
|
|
78
78
|
${t.join(`
|
|
79
79
|
`)}
|
|
80
80
|
|
|
81
81
|
${$n}
|
|
82
|
-
`,i=V(r,"AGENTS.md");if(!we(i)){ae(i,n,"utf-8");return}let s=Ee(i,"utf-8"),o=s.indexOf(
|
|
83
|
-
`);return}ae(i,s.slice(0,o)+n.trimEnd()+s.slice(a+$n.length),"utf-8")}function Nn(r,e,t){let n=
|
|
82
|
+
`,i=V(r,"AGENTS.md");if(!we(i)){ae(i,n,"utf-8");return}let s=Ee(i,"utf-8"),o=s.indexOf(na),a=s.indexOf($n);if(o===-1||a===-1){H.warn(`eject-generator: ${i} exists without the managed markers \u2014 leaving it untouched.
|
|
83
|
+
`);return}ae(i,s.slice(0,o)+n.trimEnd()+s.slice(a+$n.length),"utf-8")}function Nn(r,e,t){let n=aa(V(ua(),"redocly-eject-merge-")),i={ours:V(n,".merge-ours"),base:V(n,".merge-base"),theirs:V(n,".merge-theirs")};ae(i.ours,r,"utf-8"),ae(i.base,e,"utf-8"),ae(i.theirs,t,"utf-8");let s=In("git",["merge-file","-p","-L","yours","-L","ejected-from","-L","update",i.ours,i.base,i.theirs],{encoding:"utf-8"});if(la(n,{recursive:!0,force:!0}),s.error||s.status===null)throw te.eject_generator_outcome="merge-tool-missing",new ge("\n\u274C `--update` needs `git` on PATH for the three-way merge. Alternative: eject to a temporary directory and diff by hand.\n");if(s.status>127)throw te.eject_generator_outcome="merge-failed",new ge(`
|
|
84
84
|
\u274C \`git merge-file\` could not merge the update (your copy is untouched): ${s.stderr.trim()}
|
|
85
|
-
`);return{merged:s.stdout,conflicts:s.status}}function
|
|
85
|
+
`);return{merged:s.stdout,conflicts:s.status}}function fa(r){return/Ejected from @redocly\/client-generator@(\S+)/.exec(r)?.[1]}function da(r,e){let t=aa(V(ua(),"redocly-eject-base-")),n=new Map;try{if(In("npm",["pack",r,"--pack-destination",t],{encoding:"utf-8"}).status!==0)return n;let s=ca(t).find(o=>o.endsWith(".tgz"));if(s===void 0)return n;for(let o of e)In("tar",["-xzf",V(t,s),"-C",t,o],{encoding:"utf-8"}).status===0&&n.set(o,Ee(V(t,o),"utf-8"));return n}finally{la(t,{recursive:!0,force:!0})}}var sa=r=>`package/eject-assets/generators/${r}.mjs`,oa=(r,e)=>`package/eject-assets/generators/${r}/${e}`,Lt=r=>`package/eject-assets/skills/${r}/SKILL.md`;function Yf(r,e){let t=V(r,"generators",e);if(!(!we(t)||!Uf(t).isDirectory()))return ca(t).filter(n=>n.endsWith(".ts")).sort()}function $r(r,e,t){let n=V(process.cwd(),".claude","skills",r,"SKILL.md"),i=Ee(V(e,"skills",r,"SKILL.md"),"utf-8");if(!we(n))return Ln(Yt(n),{recursive:!0}),ae(n,i,"utf-8"),0;let s=Ee(n,"utf-8");if(s===i)return 0;if(t===void 0)return ae(`${n}.new`,i,"utf-8"),H.warn(`${ke(process.cwd(),n)} was edited and has no merge base \u2014 the new skill is beside it as SKILL.md.new.
|
|
86
86
|
`),0;let{merged:o,conflicts:a}=Nn(s,t,i);return ae(n,o,"utf-8"),a}function Tn(r){return[...It].filter(e=>we(V(r,`${e}.mjs`))||we(V(r,e,"index.ts")))}function Dn(r,e=!1){let t=V(process.cwd(),"package.json");if(!we(t))return"no-package-json";let n=Ee(t,"utf-8"),i=JSON.parse(n),s="present",o={};for(let[u,p]of Object.entries(r)){let h=i.devDependencies?.[u]!==void 0?i.devDependencies:i.dependencies?.[u]!==void 0?i.dependencies:void 0;h===void 0?(o[u]=`^${p}`,s="added"):e&&!(At.validRange(h[u])!==null&&At.satisfies(p,h[u]))&&(h[u]=`^${p}`,s==="present"&&(s="updated"))}if(s==="present")return"present";if(Object.keys(o).length>0){let u={...i.devDependencies,...o};i.devDependencies=Object.fromEntries(Object.entries(u).sort(([p],[h])=>p.localeCompare(h)))}let a=/^([ \t]+)"/m.exec(n)?.[1]??" ";return ae(t,`${JSON.stringify(i,null,a)}
|
|
87
|
-
`,"utf-8"),s}function
|
|
87
|
+
`,"utf-8"),s}function Kf(r,e,t,n,i){let s=Yn(e),o=Oe(s)&&Oe(s.apis)?s.apis:{};if(Object.values(o).some(a=>Oe(a)&&Oe(a.client)))return!1;if(n===-1){if(/^client:/m.test(e))return!1;let a=e===""||e.endsWith(`
|
|
88
88
|
`)?"":`
|
|
89
89
|
`;return ae(r,`${e}${a}client:
|
|
90
90
|
generators:
|
|
91
91
|
- ${i}
|
|
92
92
|
`,"utf-8"),!0}return t.splice(n+1,0," generators:",` - ${i}`),ae(r,t.join(`
|
|
93
|
-
`),"utf-8"),!0}function
|
|
94
|
-
`),u=a.findIndex(m=>/^client:\s*$/.test(m)),p=u===-1?-1:a.findIndex((m,E)=>E>u&&/^\s+generators:/.test(m));if(p!==-1&&a.slice(u+1,p).some(m=>/^\S/.test(m))&&(p=-1),p===-1)return
|
|
93
|
+
`),"utf-8"),!0}function Xf(r,e,t){if(r===void 0||!we(r))return!1;let n=Ee(r,"utf-8"),i=m=>E=>E===m||E===`'${m}'`||E===`"${m}"`,s=i(e),o=i(t),a=n.split(`
|
|
94
|
+
`),u=a.findIndex(m=>/^client:\s*$/.test(m)),p=u===-1?-1:a.findIndex((m,E)=>E>u&&/^\s+generators:/.test(m));if(p!==-1&&a.slice(u+1,p).some(m=>/^\S/.test(m))&&(p=-1),p===-1)return Kf(r,n,a,u,t);let h=a[p].match(/^(\s+generators:\s*\[)(.*)\]\s*$/);if(h!==null){let m=h[2].split(",").map(d=>d.trim()).filter(d=>d!=="");if(m.some(o))return!0;let E=m.findIndex(s);return E===-1?m.push(t):m[E]=t,a[p]=`${h[1]}${m.join(", ")}]`,ae(r,a.join(`
|
|
95
95
|
`),"utf-8"),!0}if(!/^\s+generators:\s*$/.test(a[p]))return!1;let l=p,b=`${a[p].match(/^\s+/)[0]} `;for(let m=p+1;m<a.length;m++){if(/^\s*(#|$)/.test(a[m]))continue;let E=a[m].match(/^(\s+)- (.*?)\s*$/);if(E===null)break;let d=E[2].match(/\s+#.*$/)?.[0]??"",S=d===""?E[2]:E[2].slice(0,-d.length);if(o(S))return!0;if(s(S))return a[m]=`${E[1]}- ${t}${d}`,ae(r,a.join(`
|
|
96
96
|
`),"utf-8"),!0;l=m,b=E[1]}return a.splice(l+1,0,`${b}- ${t}`),ae(r,a.join(`
|
|
97
|
-
`),"utf-8"),!0}function
|
|
97
|
+
`),"utf-8"),!0}function Jf({name:r,files:e,toolkitVersion:t,assetsDir:n,dir:i,targetDir:s}){let o=V(s,"index.ts"),a=ke(process.cwd(),o)||o;if(!we(o)){te.eject_generator_outcome="missing-target";let S=V(i,`${r}.mjs`);throw new ge(we(S)?`
|
|
98
98
|
\u274C ${ke(process.cwd(),S)} is a single-file eject from an older version; this version ejects a folder. Eject fresh: redocly eject-generator ${r} --force
|
|
99
99
|
`:`
|
|
100
100
|
\u274C Nothing to update: ${a} does not exist. Eject first.
|
|
101
|
-
`)}let u=
|
|
101
|
+
`)}let u=fa(Ee(o,"utf-8"));u!==void 0&&At.valid(u)!==null&&(te.eject_generator_from_version=u),te.eject_generator_to_version=t;let p=u===t||u===void 0?new Map:da(`${Re}@${u}`,[...e.map(S=>oa(r,S)),Lt("client-generators"),Lt(`${r}-generator`)]);if(u===void 0)throw te.eject_generator_outcome="missing-base",new ge(`
|
|
102
102
|
\u274C Could not read the version ${a} was ejected from (not recorded in its header), so there is no merge base.
|
|
103
103
|
Eject to a temporary directory and diff by hand, or re-eject with --force.
|
|
104
|
-
`);let h=0;for(let S of e){let N=Ee(V(n,"generators",r,S),"utf-8"),O=V(s,S);if(!we(O)){ae(O,N,"utf-8");continue}let U=Ee(O,"utf-8");if(U===N)continue;let W=u===t?N:p.get(
|
|
104
|
+
`);let h=0;for(let S of e){let N=Ee(V(n,"generators",r,S),"utf-8"),O=V(s,S);if(!we(O)){ae(O,N,"utf-8");continue}let U=Ee(O,"utf-8");if(U===N)continue;let W=u===t?N:p.get(oa(r,S));if(W===void 0){ae(`${O}.new`,N,"utf-8"),H.warn(`${ke(process.cwd(),O)} has no merge base in ${Re}@${u} \u2014 the new file is beside it as ${S}.new.
|
|
105
105
|
`);continue}let xe=Nn(U,W,N);ae(O,xe.merged,"utf-8"),h+=xe.conflicts}let l=S=>u===t?Ee(V(n,"skills",S,"SKILL.md"),"utf-8"):p.get(Lt(S)),b=$r("client-generators",n,l("client-generators"))+$r(`${r}-generator`,n,l(`${r}-generator`));Pn(i,Tn(i));let m=Dn({[Re]:t},!0);(m==="updated"||m==="added")&&H.info(`Set ${Re} to ^${t} in package.json \u2014 run your installer.
|
|
106
106
|
`);let E=h+b;te.eject_generator_outcome=E>0?"conflicts":"success";let d=ke(process.cwd(),s)||s;E>0?(te.eject_generator_conflicts=E,H.warn(`Updated ${d} with ${E} conflict(s)${b>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
|
|
107
107
|
`)):H.info(`Updated ${d} cleanly.
|
|
108
|
-
`)}function
|
|
108
|
+
`)}function Qf({name:r,asset:e,toolkitVersion:t,assetsDir:n,dir:i,target:s,printedTarget:o}){if(!we(s))throw te.eject_generator_outcome="missing-target",new ge(`
|
|
109
109
|
\u274C Nothing to update: ${o} does not exist. Eject first.
|
|
110
|
-
`);let a=V(i,".pristine",`${r}.mjs`),u=Ee(s,"utf-8"),p=
|
|
110
|
+
`);let a=V(i,".pristine",`${r}.mjs`),u=Ee(s,"utf-8"),p=fa(u);p!==void 0&&At.valid(p)!==null&&(te.eject_generator_from_version=p),te.eject_generator_to_version=t;let h=we(a)||p===t||p===void 0?new Map:da(`${Re}@${p}`,[sa(r),Lt("client-generators"),Lt(`${r}-generator`)]),l=we(a)?Ee(a,"utf-8"):p===t?e:h.get(sa(r));if(l===void 0){te.eject_generator_outcome="missing-base";let O=`${s}.new`;throw ae(O,e,"utf-8"),new ge(`
|
|
111
111
|
\u274C Could not read the version this file was ejected from (${p??"not recorded in its header"}), so there is no merge base.
|
|
112
112
|
The current generator is written to ${ke(process.cwd(),O)} \u2014 diff it against your copy and merge by hand.
|
|
113
113
|
`)}let{merged:b,conflicts:m}=Nn(u,l,e);ae(s,b,"utf-8"),we(a)&&H.info(`Used ${ke(process.cwd(),a)} as the merge base. Later updates read the version from the file's header, so you can delete that .pristine directory.
|
|
114
114
|
`);let E=O=>p===t?Ee(V(n,"skills",O,"SKILL.md"),"utf-8"):h.get(Lt(O)),d=$r("client-generators",n,E("client-generators"))+$r(`${r}-generator`,n,E(`${r}-generator`));Pn(i,Tn(i));let S=Dn({[Re]:t},!0);(S==="updated"||S==="added")&&H.info(`Set ${Re} to ^${t} in package.json \u2014 run your installer.
|
|
115
115
|
`);let N=m+d;te.eject_generator_outcome=N>0?"conflicts":"success",N>0?(te.eject_generator_conflicts=N,H.warn(`Updated ${o} with ${N} conflict(s)${d>0?" (some in .claude/skills)":""} \u2014 resolve the <<<<<<< markers, then regenerate.
|
|
116
116
|
`)):H.info(`Updated ${o} cleanly.
|
|
117
|
-
`)}var
|
|
117
|
+
`)}var pa=async({argv:r,config:e})=>{let t=r.generator??"";te.eject_generator_action=r.update?"update":"eject",(It.has(t)||ra.has(t))&&(te.eject_generator_name=t),te.eject_generator_outcome="unexpected-error";let n=ra.get(t);if(n!==void 0){te.eject_generator_action="guidance",te.eject_generator_outcome="success",H.info(`
|
|
118
118
|
The "${t}" generator is the "tanstack-query" generator with one argument changed.
|
|
119
119
|
Eject that one and set the framework in your copy's default export:
|
|
120
120
|
|
|
@@ -122,9 +122,9 @@ Eject that one and set the framework in your copy's default export:
|
|
|
122
122
|
# then in generators/tanstack-query/index.ts: run: tanstackQueryGenerator('${n}')
|
|
123
123
|
`);return}if(!It.has(t))throw te.eject_generator_outcome="unknown-generator",new ge(`
|
|
124
124
|
\u274C Unknown generator "${t}". Ejectable generators: ${[...It].join(", ")}.
|
|
125
|
-
`);let i=
|
|
125
|
+
`);let i=Bf(),s=Yf(i,t),{GENERATOR_VERSION:o}=await import("./chunks/BVBLILPR.js"),a=Wf(r.dir??"./generators"),u=s===void 0?V(a,`${t}.mjs`):V(a,t,"index.ts"),p=ke(process.cwd(),u)||u;if(r.update){if(s===void 0){let O=Ee(V(i,"generators",`${t}.mjs`),"utf-8");Qf({name:t,asset:O,toolkitVersion:o,assetsDir:i,dir:a,target:u,printedTarget:p})}else Jf({name:t,files:s,toolkitVersion:o,assetsDir:i,dir:a,targetDir:V(a,t)});return}if(we(u)&&!r.force)throw te.eject_generator_outcome="already-exists",new ge(`
|
|
126
126
|
\u274C ${p} already exists. Use --update to merge the newer version in, or --force to overwrite.
|
|
127
|
-
`);Ln(Yt(u),{recursive:!0});let h=s===void 0?[Ee(V(i,"generators",`${t}.mjs`),"utf-8")]:s.map(O=>Ee(V(i,"generators",t,O),"utf-8"));s===void 0?ae(u,h[0],"utf-8"):s.forEach((O,U)=>{ae(V(a,t,O),h[U],"utf-8")});let l=
|
|
127
|
+
`);Ln(Yt(u),{recursive:!0});let h=s===void 0?[Ee(V(i,"generators",`${t}.mjs`),"utf-8")]:s.map(O=>Ee(V(i,"generators",t,O),"utf-8"));s===void 0?ae(u,h[0],"utf-8"):s.forEach((O,U)=>{ae(V(a,t,O),h[U],"utf-8")});let l=ia("client-generators",i),b=ia(`${t}-generator`,i);Pn(a,Tn(a));let m=`./${ke(e.configPath===void 0?process.cwd():ta(Yt(e.configPath)),ta(u)).split("\\").join("/")}`,E=Dn({[Re]:o}),d=h.some(O=>O.includes(`from "${vn}"`)||O.includes(`from '${vn}'`)),S=Xf(e.configPath,t,m),N=s===void 0?p:ke(process.cwd(),V(a,t))+"/";H.info(`Ejected the "${t}" generator to ${N}.
|
|
128
128
|
`+(E==="added"?`Added ${Re} to devDependencies (the ejected file imports its toolkit) \u2014 run your installer.
|
|
129
129
|
`:E==="no-package-json"?`The ejected file imports its toolkit from ${Re} \u2014 install it: npm install --save-dev ${Re}
|
|
130
130
|
`:"")+(d?`It also imports ${vn} (a dependency of the toolkit) \u2014 add it explicitly if your package manager does not hoist.
|
|
@@ -140,29 +140,29 @@ Eject that one and set the framework in your copy's default export:
|
|
|
140
140
|
|
|
141
141
|
Run it: redocly generate-client <api> --output <path>${S?"":` --generator ${m}`}
|
|
142
142
|
Edit ${N} and run that again to see your change.
|
|
143
|
-
Reference: ${
|
|
144
|
-
`),te.eject_generator_outcome="success"};function
|
|
143
|
+
Reference: ${Vf}
|
|
144
|
+
`),te.eject_generator_outcome="success"};function ma(r){if(Array.isArray(r)){let e={};for(let t of r)if(t&&typeof t=="string"){let n=ha(t);Object.assign(e,n)}return Object.keys(e).length>0?e:void 0}if(!(!r||typeof r!="string"))return ha(r)}function ha(r){try{let e=JSON.parse(r);if(!Oe(e))throw new Error("mTLS config must be an object mapping domains to certificate configurations");for(let[t,n]of Object.entries(e)){if(!Oe(n))throw new Error(`mTLS config for domain "${t}" must be an object`);qn(n,"clientCert",t,!0),qn(n,"clientKey",t,!0),qn(n,"caCert",t,!1)}return e}catch(e){throw e instanceof SyntaxError?new Error(`Invalid JSON for --mtls option: ${e.message}`):e}}function qn(r,e,t,n){let i=r[e];if(!i){if(n)throw new Error(`${e} is required for domain "${t}"`);return}if(typeof i!="string")throw new Error(`${e} for domain "${t}" must be a string`)}import{existsSync as Ir,mkdirSync as Zf,readdirSync as ed,readFileSync as Mn,writeFileSync as td}from"node:fs";import{homedir as rd}from"node:os";import{join as me,relative as nd}from"node:path";import{fileURLToPath as id}from"node:url";var ga=me(".agents","skills"),sd=["codex","cursor","copilot","gemini","opencode"],Ke=rd(),od=process.env.CLAUDE_CONFIG_DIR||me(Ke,".claude"),ad=process.env.XDG_CONFIG_HOME||me(Ke,".config"),ya=[{name:"claude",projectDir:".claude",homeDir:od},{name:"windsurf",projectDir:".windsurf",homeDir:me(Ke,".codeium","windsurf")},{name:"kiro",projectDir:".kiro",homeDir:me(Ke,".kiro")},{name:"continue",projectDir:".continue",homeDir:me(Ke,".continue")},{name:"roo",projectDir:".roo",homeDir:me(Ke,".roo")},{name:"goose",projectDir:".goose",homeDir:me(ad,"goose")},{name:"junie",projectDir:".junie",homeDir:me(Ke,".junie")},{name:"augment",projectDir:".augment",homeDir:me(Ke,".augment")}],ba=[...sd,...ya.map(r=>r.name)];async function wa({argv:r}){let e=ud(),t=ed(e);if(r.list){cd(e,t);return}let n=process.cwd(),i=r.global?Ke:n,s=[me(i,ga)];for(let a of ya)ld(a,r,n)&&(r.global?s.push(me(a.homeDir,"skills")):s.push(me(n,a.projectDir,"skills")));let o=0;for(let a of s)for(let u of t){let p=Mn(me(e,u,"SKILL.md"),"utf-8"),h=me(a,u,"SKILL.md"),l=r.global?h:nd(n,h),b="created",m=_t;Ir(h)&&(Mn(h,"utf-8")===p?(b="unchanged",m=Xn):(b="updated",m=Jt)),b!=="unchanged"&&(Zf(me(a,u),{recursive:!0}),td(h,p,"utf-8"),o++),H.output(`${m(b.padEnd(10))}${l}
|
|
145
145
|
`)}H.output(`
|
|
146
146
|
`),o===0&&H.output(`All skills are up to date.
|
|
147
|
-
`),H.output(`Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, and other agents read ${
|
|
147
|
+
`),H.output(`Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, and other agents read ${ga}.
|
|
148
148
|
`),!r.agent&&s.length===1&&H.output(`To install for an agent with its own folder, such as Claude Code, run: redocly skills --agent claude
|
|
149
|
-
`)}function
|
|
149
|
+
`)}function cd(r,e){let t=Math.min(process.stdout.columns||80,100)-4;for(let n of e){let s=Mn(me(r,n,"SKILL.md"),"utf-8").match(/^description: (.*)$/m);H.output(`${Dt(ct(n))}
|
|
150
150
|
`);let o="";for(let a of(s?s[1]:"").split(" "))o&&o.length+a.length+1>t?(H.output(` ${o}
|
|
151
151
|
`),o=a):o=o?`${o} ${a}`:a;H.output(` ${o}
|
|
152
152
|
|
|
153
153
|
`)}H.output(`To install the skills, run: ${Dt("redocly skills")}
|
|
154
|
-
`)}function
|
|
154
|
+
`)}function ld(r,e,t){return e.agent?e.agent.includes(r.name):Ir(r.homeDir)?!0:!e.global&&Ir(me(t,r.projectDir))}function ud(){let r=[new URL("./skills/",import.meta.url),new URL("../../lib/skills/",import.meta.url)];for(let e of r){let t=id(e);if(Ir(t))return t}throw new ge("The bundled agent skills are missing. In a checkout of the CLI, run: npm run compile")}var Ea=Xt(hr(),1);import{existsSync as fd,writeFileSync as dd,readFileSync as pd,statSync as hd}from"node:fs";import{tmpdir as Fn}from"node:os";import{join as kn}from"node:path";import*as Kt from"node:process";var zn="redocly-cli-version",md=1e3*60*60*12,Aa=Kt.env.NODE_ENV==="test"||Kt.env.CI||!!Kt.env.LAMBDA_TASK_ROOT||Kt.env.REDOCLY_SUPPRESS_UPDATE_NOTICE==="true",Oa=()=>{if(!Aa)try{let r=pd(kn(Fn(),zn)).toString();gd(Le,r)&&bd(Le,r)}catch{return}},gd=(r,e)=>(0,Ea.compare)(r,e)<0,yd=async r=>{let e=`http://registry.npmjs.org/${r}/latest`;try{let{fetchWithTimeout:t}=await import("./chunks/HHCU6T2V.js");return(await(await t(e,{timeout:tr})).json()).version}catch{return}},_a=()=>{!wd()||Aa||yd(ni).then(r=>{if(r){let e=kn(Fn(),zn);dd(e,r)}}).catch(()=>{})},bd=(r,e)=>{H.info(er([`A new version of ${ct("Redocly CLI")} (${_t(e)}) is available.`,`Update now: \`${ct("npm i -g @redocly/cli@latest")}\`.`,"Changelog: https://redocly.com/docs/cli/changelog/"]))},wd=()=>{try{let r=kn(Fn(),zn);if(!fd(r))return!0;let e=new Date().getTime(),n=hd(r).mtime.getTime();return e-n>=md}catch{return!1}};function Sa(r){if(!r||r==="/")throw new Error("Mount path cannot be empty or root path. Please use --mount-path option with a valid path.");return r}function at(r,e=!1){return t=>{let n=Number(t);if(isNaN(n)||n<=0)throw new Error(`${r} must be a positive number`);if(e&&!Number.isInteger(n))throw new Error(`${r} must be a positive integer`);return n}}function Ca(r){return r?._?.[0]??""}async function Ra(r,e,t){let n;try{n=await Qn({configPath:r.config,customExtends:r.extends,plugins:t})}catch(o){throw new ge(`Failed to load the configuration file:
|
|
155
155
|
|
|
156
|
-
- ${o.message}`)}if(r["lint-config"]==="off"||n.document===void 0)return n;let i=await ti({config:n,severity:r["lint-config"]||"warn"}),s=Zn(i);if(ei(i,{maxProblems:r["max-problems"],totals:s,version:e,command:"check-config"}),
|
|
156
|
+
- ${o.message}`)}if(r["lint-config"]==="off"||n.document===void 0)return n;let i=await ti({config:n,severity:r["lint-config"]||"warn"}),s=Zn(i);if(ei(i,{maxProblems:r["max-problems"],totals:s,version:e,command:"check-config"}),Ed(s,Ca(r)),s.errors>0)throw new Zt("Config check failed.");return n}function Ed(r,e){r.errors>0?H.error(`\u274C Your config has ${r.errors} ${Tr("error",r.errors)}.
|
|
157
157
|
`):r.warnings>0?H.warn(`\u26A0\uFE0F Your config has ${r.warnings} ${Tr("warning",r.warnings)}.
|
|
158
158
|
`):e==="check-config"&&H.info(_t(`\u2705 Your config is valid.
|
|
159
|
-
`))}import{execSync as
|
|
159
|
+
`))}import{execSync as Ad}from"node:child_process";import*as Nt from"node:fs";import{existsSync as Od,writeFileSync as _d,readFileSync as va}from"node:fs";import*as $a from"node:os";import{tmpdir as Ia}from"node:os";import{dirname as ja,join as Pr}from"node:path";async function xa(r=tr){try{let{fetchWithTimeout:e}=await import("./chunks/HHCU6T2V.js");return await e(ci,{timeout:r}),!0}catch{return!1}}var Lr="***";async function La({config:r,argv:e,exit_code:t,execution_time:n,spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:a,respect_source_description_types:u,respect_criterion_object_types:p,lint_rules_with_errors:h,lint_rules_with_warnings:l,lint_rules_with_ignored_problems:b,generate_client:m,eject_generator:E,bundle:d}){try{if(!e||!await xa(1e3))return;let{_:[N],$0:O,...U}=e,{RedoclyOAuthClient:W,getReuniteUrl:xe}=await import("./chunks/PSXVUJZM.js"),Xe=new W(Le),Je=xe(r,U.residency),Qe=await Xe.isAuthorized(Je),B=Id();B||(B=`ann_${fi()}`,$d(B));let He=Qt(i),$=[{id:N,object:"command",uri:`urn:redocly:cli:command:${N}`,logged_in:Qe?"yes":"no",command:N,...xd(U,process.argv.slice(2)),node_version:process.version,npm_version:vd(),version:Le,exit_code:t,execution_time:n,metadata:process.env.REDOCLY_CLI_TELEMETRY_METADATA,environment_ci:process.env.CI,environment:process.env.REDOCLY_ENVIRONMENT,has_config:typeof r?.document?.parsed>"u"?"no":"yes",spec_version:i,spec_keyword:s,spec_full_version:o,respect_x_security_auth_types:He==="arazzo1"&&a?.length?JSON.stringify(a):void 0,respect_source_description_types:He==="arazzo1"&&u?.length?JSON.stringify(u):void 0,respect_criterion_object_types:He==="arazzo1"&&p?.length?JSON.stringify(p):void 0,lint_rules_with_errors:h?.length?JSON.stringify(h):void 0,lint_rules_with_warnings:l?.length?JSON.stringify(l):void 0,lint_rules_with_ignored_problems:b?.length?JSON.stringify(b):void 0,generate_client_builtin_generators:m?.generate_client_builtin_generators?.length?JSON.stringify(m.generate_client_builtin_generators):void 0,generate_client_custom_generators_count:m?.generate_client_custom_generators_count,generate_client_toolkit_imports:m?.generate_client_toolkit_imports?.length?JSON.stringify(m.generate_client_toolkit_imports):void 0,generate_client_error_category:m?.generate_client_error_category,generate_client_ejected_generators:m?.generate_client_ejected_generators?.length?JSON.stringify(m.generate_client_ejected_generators):void 0,generate_client_composed_apis_count:m?.generate_client_composed_apis_count,eject_generator_action:E?.eject_generator_action,eject_generator_name:E?.eject_generator_name,eject_generator_outcome:E?.eject_generator_outcome,eject_generator_conflicts:E?.eject_generator_conflicts,eject_generator_from_version:E?.eject_generator_from_version,eject_generator_to_version:E?.eject_generator_to_version,bundle_overlays_count:d?.bundle_overlays_count}],_=ui.mapToCloudEvent({type:"com.redocly.command.ran",source:"urn:redocly:cli",origin:"redocly-cli",env:"production",osPlatform:$a.platform(),actor:{id:B,object:"user",uri:""},category:"product",data:$}),{otelTelemetry:P}=await import("./chunks/BS3Q5ILZ.js");P.send(_)}catch{}}function Pa(r,e){for(let t of r.sourceDescriptions??[])t.type&&e.add(t.type)}function Na(r,e){for(let t of r.workflows??[]){Pt(t.successActions,e),Pt(t.failureActions,e);for(let n of t.steps??[])Ta(n.successCriteria,e),Pt(n.onSuccess,e),Pt(n.onFailure,e)}Pt(Object.values(r.components?.successActions??{}),e),Pt(Object.values(r.components?.failureActions??{}),e)}function Pt(r,e){for(let t of r??[])Ta(t.criteria,e)}function Ta(r,e){for(let t of r??[]){let n=Sd(t);n&&e.add(n)}}function Sd(r){let e=r.type;return typeof e=="string"?e:e?.type||(r.condition?"simple":void 0)}function Da(r,e){for(let t of r.workflows??[]){for(let n of t["x-security"]??[]){let i=n.scheme;if(i?.type){let s=i.type==="http"?i.scheme:i.type;s&&e.add(s)}}for(let n of t.steps??[])for(let i of n["x-security"]??[]){let s=i.scheme;if(s?.type){let a=s.type==="http"?s.scheme:s.type;a&&e.add(a)}let o=i.schemeName;o&&e.add(o)}}}function Cd(r){return Nt.existsSync(r)&&Nt.statSync(r).isFile()}function Rd(r){return Nt.existsSync(r)&&Nt.statSync(r).isDirectory()}function Un(r){return r&&(Bn(r)?r.split("://")[0]+"://url":Cd(r)?r.replace(/.+\.([^.]+)$/,(e,t)=>"file-"+t):Rd(r)?"folder":r)}function Gn(r,e,t){let n=Array.isArray(e)?e:[e];for(let i of n)i.length>1&&(r=r.replaceAll(i,t));return r}function qa(r,e){let t={};for(let[n,i]of Object.entries(r))e.includes(n)?t[n]=Lr:Oe(i)?t[n]=qa(i,e):t[n]=i;return t}function Wn(r,e,t=[]){if(Array.isArray(r))return r.forEach(n=>Wn(n,e,t)),t;if(Oe(r))for(let[n,i]of Object.entries(r))e.includes(n)&&typeof i=="string"?t.push(i):(Oe(i)||Array.isArray(i))&&Wn(i,e,t);return t}function xd(r,e){let t=["organization","o","input","i","author","a","clientCert","clientKey","caCert","server","S"],n=e.join(" "),i={};for(let[s,o]of Object.entries(r))if(t.includes(s))i[s]=Lr,n=Gn(n,o,Lr);else if(typeof o=="string"){let a=Un(o);i[s]=a,n=Gn(n,o,a)}else if(Array.isArray(o)){i[s]=o.map(Un);for(let a of o){let u=Un(a);n.includes(a)&&(n=n.replaceAll(a,u))}}else if(Oe(o)){let a=Wn(o,t);for(let u of a)n=Gn(n,u,Lr);i[s]=qa(o,t)}else i[s]=o;return{arguments:JSON.stringify(i),raw_input:n}}var jd=process.platform==="win32"?Pr(ja(process.execPath),"node_modules","npm","package.json"):Pr(ja(process.execPath),"..","lib","node_modules","npm","package.json");function vd(){try{return JSON.parse(va(jd,"utf8")).version}catch{}try{return Ad("npm -v",{stdio:["ignore","pipe","ignore"]}).toString().trim()}catch{return"unknown"}}var $d=r=>{if(!(process.env.CI||!r))try{let t=Pr(Ia(),Dr);_d(t,r)}catch{}},Id=()=>{if(!process.env.CI)try{let e=Pr(Ia(),Dr);return Od(e)?va(e).toString().trim():void 0}catch{return}};function J(r,e={}){return async t=>{let n=performance.now(),i=2,s,o="unknown",a,u,p,h=new Set,l=new Set,b=new Set,m=({parsed:O,source:U})=>{if(o="unknown",a=void 0,u=void 0,U?.absoluteRef&&Kn(U.absoluteRef)){o="graphql";return}try{o=Jn(O)}catch{o="unsupported"}Oe(O)&&(a=O?.openapi?"openapi":O?.swagger?"swagger":O?.asyncapi?"asyncapi":O?.arazzo?"arazzo":O?.overlay?"overlay":void 0,a&&(u=O[a]),Qt(o)==="arazzo1"&&(Da(O,h),Pa(O,l),Na(O,b)))},E=new Set,d=new Set,S=new Set,N=O=>{for(let U of O)U.ignored?S.add(U.ruleId):U.severity==="error"?E.add(U.ruleId):U.severity==="warn"&&d.add(U.ruleId)};try{if(t.config&&!Vn(t.config))throw new ge("Please provide a valid path to the configuration file.");p=await Ra(t,Le,e.plugins),s=p.resolvedConfig.telemetry,i=1,typeof r=="function"&&await r({argv:t,config:p,version:Le,collectSpecData:m,collectResults:N}),i=0}catch(O){O instanceof Zt||(O instanceof ge?H.error(O.message+`
|
|
160
160
|
|
|
161
161
|
`):(H.error(`An unexpected error occurred. This is likely a bug that should be reported.
|
|
162
162
|
`),H.error(O instanceof Error?O.stack||O.message:String(O)),H.error(`
|
|
163
|
-
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&s!=="off"){let O=Math.round(performance.now()-n);await
|
|
164
|
-
`),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",r=>r.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),async r=>{let{handleStats:e}=await import("./chunks/TOMEEMQR.js");J(e)(r)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",r=>r.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async r=>{let{handleInspectNodeTypes:e}=await import("./chunks/AT7HZJNK.js");J(e)(r)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",r=>r.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),async r=>{let{handleScore:e}=await import("./chunks/RSQ3JLJS.js");J(e)(r)}).command("split [api]","Split an API description into a multi-file structure.",r=>r.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),async r=>{let{handleSplit:e}=await import("./chunks/LLJTDVWX.js");J(e)(r)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",r=>r.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleJoin:e}=await import("./chunks/764NQBHQ.js");J(e)(r)}).command("push-status [pushId]",!1,r=>r.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handlePushStatus:e}=await import("./chunks/WR7K7X6E.js");J(e)(r)}).command("push [files...]","Push documents to Reunite.",r=>r.env("REDOCLY_CLI_PUSH").positional("files",{type:"string",array:!0,demandOption:!0}).option({branch:{description:"Branch name to push to.",type:"string",alias:"b",required:!0},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",alias:"p",required:!0},"mount-path":{description:"The path files should be pushed to.",type:"string",alias:"mp",required:!0,coerce:_a},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async r=>{let{handlePush:e}=await import("./chunks/VOMZ2OLE.js");J(e)(r)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",r=>r.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async r=>{let{handleRecheck:e}=await import("./chunks/P37LFEGZ.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");J(e,{plugins:[t]})(r)}).command("lint [apis...]","Lint an API or Arazzo description.",r=>r.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),async r=>{let{handleLint:e}=await import("./chunks/G2LRTVYX.js");J(e)(r)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",r=>r.env("REDOCLY_CLI_BUNDLE").positional("apis",{array:!0,type:"string",demandOption:!0}).options({output:{type:"string",description:"Output file or folder for inline APIs.",alias:"o"},ext:{description:"Bundle file extension.",requiresArg:!0,choices:ri},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),async r=>{let{handleBundle:e}=await import("./chunks/SDJSWREQ.js");J(e)(r)}).command("check-config","Lint the Redocly configuration file.",async r=>r.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),r=>{J()(r)}).command("login","Log in to Redocly.",async r=>r.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleLogin:e}=await import("./chunks/E3B6BHM3.js");J(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/GJLQK75Q.js");J(e)(r)}).command("project","[early access] Work with a Redocly-hosted project.",r=>r.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/2TS7TKLJ.js");J(t)(e)}).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/MNBKIEMZ.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:Le}))}).demandCommand(1,"Specify a project subcommand: clone.")).command("preview","Preview Redocly project using one of the product NPM packages.",r=>r.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:["redoc","revel","reef","realm","redoc-revel","redoc-reef","revel-reef"],description:"Product used to launch preview. Default is inferred from project's package.json or 'realm' is used."},plan:{type:"string",choices:oi,default:"enterprise"},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:at("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{process.argv.some(t=>t.startsWith("--source-dir"))&&H.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
165
|
-
`);let{previewProject:e}=await import("./chunks/HFJYUUKX.js");J(e)(r)}).command("build-docs [api]","Produce API documentation as an HTML file",r=>r.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async r=>{let{handlerBuildCommand:e}=await import("./chunks/DA2H4OAW.js");J(e)(r)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",r=>r.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleTranslations:e}=await import("./chunks/SGRUTAKH.js");J(e)(r)}).command("eject <type> [path]","Helper function to eject project elements for customization.",r=>r.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleEject:e}=await import("./chunks/RDKZXSDY.js");J(e)(r)}).command("respect [files...]","Run Arazzo tests.",r=>r.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:ha},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:at("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:at("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:at("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async r=>{let{handleRespect:e}=await import("./chunks/T6ZSC7T2.js");J(e)(r)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",r=>r.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:at("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:at("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/IT5HS4O6.js");J(e)(r)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async r=>{let{handleGenerateClient:e}=await import("./chunks/LHDP6XGD.js");J(e)(r)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",r=>r.positional("generator",{describe:`Built-in generator to eject (${[...It].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async r=>{J(da)(r)}).command("skills","Install the Redocly CLI agent skills for AI coding agents.",r=>r.options({agent:{description:"Agents to install the skills for. Default: detected agents.",type:"array",string:!0,choices:ya},global:{description:"Install in your home folder instead of the current project.",type:"boolean",default:!1},list:{description:"List the bundled skills without installing them.",type:"boolean",default:!1}}),async r=>{J(ba)(r)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"openapi-version":{describe:"OpenAPI version of the generated description.",type:"string",choices:["3.1","3.2"],default:"3.2"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:at("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async r=>{let{handleGenerateSpec:e}=await import("./chunks/QZQVSDLN.js");J(e)(r)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async r=>{let{handleIntrospectMcp:e}=await import("./chunks/4OPAFHK3.js");J(e)(r)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",r=>r.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleScorecardClassic:e}=await import("./chunks/UQE7DXYL.js");J(e)(r)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleDrift:e}=await import("./chunks/A6KGBL3N.js");J(e)(r)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleProxy:e}=await import("./chunks/IN2HI2RR.js");J(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([Aa]).strict().argv;
|
|
163
|
+
`)))}finally{if(process.env.REDOCLY_TELEMETRY!=="off"&&s!=="off"){let O=Math.round(performance.now()-n);await La({config:p,argv:t,exit_code:i,execution_time:O,spec_version:o,spec_keyword:a,spec_full_version:u,respect_x_security_auth_types:[...h],respect_source_description_types:[...l],respect_criterion_object_types:[...b],lint_rules_with_errors:[...E],lint_rules_with_warnings:[...d],lint_rules_with_ignored_problems:[...S],generate_client:si,eject_generator:te,bundle:li})}process.once("beforeExit",()=>{process.exit(i)})}}}Ma.config({path:Fa.resolve(process.cwd(),"./.env")});_a();ea(ln(process.argv)).version(!1).option("version",{type:"boolean",description:"Show version number.",global:!1}).middleware(r=>{r.version&&r._.length===0&&(H.output(`${Le}
|
|
164
|
+
`),process.exit(0))},!0).help("help","Show help.").parserConfiguration({"greedy-arrays":!1,"boolean-negation":!1}).command("stats [api]","Show statistics for an API description.",r=>r.env("REDOCLY_CLI_STATS").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json","markdown"],default:"stylish"}}),async r=>{let{handleStats:e}=await import("./chunks/TOMEEMQR.js");J(e)(r)}).command("inspect-node-types <api>","Show the node types of an API description, for writing configurable rules and custom plugins [experimental].",r=>r.env("REDOCLY_CLI_INSPECT_NODE_TYPES").positional("api",{description:"API description file to inspect.",type:"string",demandOption:!0}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},pointer:{description:"JSON pointer to a node, optionally prefixed with a file: `#/paths` or `schemas.yaml#/User`.",type:"string",alias:"p"},type:{description:"List only the nodes of this type.",type:"string"},summary:{description:"List the node types used in the description, with counts.",type:"boolean"},parents:{description:"Show the chain of node types leading to the node: down to the node with --pointer, or the distinct chains that reach the type with --type.",type:"boolean"}}).conflicts({pointer:["type","summary"],type:["summary"],summary:["parents"]}).check(e=>{if(e.parents&&!e.pointer&&!e.type)throw new Error("The --parents option requires --pointer or --type.");return!0}),async r=>{let{handleInspectNodeTypes:e}=await import("./chunks/AT7HZJNK.js");J(e)(r)}).command("score [api]","Score an API description for integration simplicity and agent readiness.",r=>r.env("REDOCLY_CLI_SCORE").positional("api",{type:"string"}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["stylish","json"],default:"stylish"},"operation-details":{description:"Print per-operation metric details.",type:"boolean",default:!1},"debug-operation-id":{description:"Print detailed schema breakdown for a specific operation.",type:"string"}}),async r=>{let{handleScore:e}=await import("./chunks/RSQ3JLJS.js");J(e)(r)}).command("split [api]","Split an API description into a multi-file structure.",r=>r.env("REDOCLY_CLI_SPLIT").positional("api",{description:"API description file that you want to split",type:"string"}).option({outDir:{description:"Output directory where files will be saved.",required:!0,type:"string"},separator:{description:"File path separator used while splitting.",required:!1,type:"string",default:"_"},"file-name-conflicts-severity":{description:"Severity level for file name conflicts.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).demandOption("api"),async r=>{let{handleSplit:e}=await import("./chunks/LLJTDVWX.js");J(e)(r)}).command("join [apis...]","Join multiple API descriptions into one [experimental].",r=>r.env("REDOCLY_CLI_JOIN").positional("apis",{array:!0,type:"string",demandOption:!0}).option({"prefix-tags-with-info-prop":{description:"Prefix tags with property value from info object.",requiresArg:!0,type:"string"},"prefix-tags-with-filename":{description:"Prefix tags with property value from file name.",type:"boolean",default:!1},"prefix-components-with-info-prop":{description:"Prefix components with property value from info object.",requiresArg:!0,type:"string"},"without-x-tag-groups":{description:"Skip automated x-tagGroups creation",type:"boolean"},output:{description:"Output file.",alias:"o",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleJoin:e}=await import("./chunks/764NQBHQ.js");J(e)(r)}).command("push-status [pushId]",!1,r=>r.env("REDOCLY_CLI_PUSH_STATUS").positional("pushId",{description:"Push id.",type:"string",demandOption:!0}).implies("max-execution-time","wait").option({organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",required:!0,alias:"p"},domain:{description:"Specify a domain.",alias:"d",type:"string",required:!1},wait:{description:"Wait for build to finish.",type:"boolean",default:!1},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handlePushStatus:e}=await import("./chunks/WR7K7X6E.js");J(e)(r)}).command("push [files...]","Push documents to the Redocly platform.",r=>r.env("REDOCLY_CLI_PUSH").positional("files",{type:"string",array:!0,demandOption:!0}).option({branch:{description:"Branch name to push to.",type:"string",alias:"b",required:!0},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},organization:{description:"ID of the organization to push to.",type:"string",alias:"o",required:!0},project:{description:"ID of the project to push to.",type:"string",alias:"p",required:!0},"mount-path":{description:"The path files should be pushed to.",type:"string",alias:"mp",required:!0,coerce:Sa},author:{description:"Author of the commit.",type:"string",alias:"a",required:!0},message:{description:"Commit message.",type:"string",alias:"m",required:!0},"commit-sha":{description:"Commit SHA.",type:"string",alias:"sha"},"commit-url":{description:"Commit URL.",type:"string",alias:"url"},namespace:{description:"Repository namespace.",type:"string"},repository:{description:"Repository name.",type:"string"},"created-at":{description:"Commit creation date.",type:"string"},domain:{description:"Specify a domain.",alias:"d",type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},"default-branch":{type:"string",default:"main"},"max-execution-time":{description:"Maximum execution time in seconds.",type:"number"},"wait-for-deployment":{description:"Wait for build to finish.",type:"boolean",default:!1},replace:{description:"Remove the files under the mount path that are not part of this push.",type:"boolean",default:!1},verbose:{type:"boolean",default:!1},"continue-on-deploy-failures":{description:"Command does not fail even if the deployment fails.",type:"boolean",default:!1}}),async r=>{let{handlePush:e}=await import("./chunks/VOMZ2OLE.js");J(e)(r)}).command("recheck [paths..]","Lint Markdown prose and structure from the recheck block in redocly.yaml.",r=>r.env("REDOCLY_CLI_RECHECK").positional("paths",{array:!0,type:"string",describe:"Files or directories to lint. Default: the current directory."}).option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},format:{description:"Use a specific output format.",choices:["table","json","sarif","github-actions"],default:"table"},tags:{description:"Run only rules with these tags.",array:!0,type:"string"},rule:{description:"Run only these rules.",alias:"r",array:!0,type:"string"},"skip-rule":{description:"Skip these rules.",array:!0,type:"string"},stats:{description:"Print rule statistics.",alias:"s",type:"boolean"},fix:{description:"Apply fixes to Markdown files.",alias:"f",type:"boolean"},"max-problems":{description:"Maximum number of problems in the report.",type:"number"},summary:{description:"Print a run summary.",choices:["json","text"],type:"string"},"summary-path":{description:"Write the summary to a file.",type:"string"},readability:{description:"Report readability scores instead of linting.",type:"boolean"},"generate-baseline":{description:"Write the baseline file from the current findings.",type:"boolean"},"generate-markdoc-schema":{description:"Generate a Markdoc tag schema from theme modules.",type:"boolean"},from:{description:"Module paths to read Markdoc tags from (with --generate-markdoc-schema).",array:!0,type:"string"},output:{description:"Output file for the generated schema.",type:"string"},check:{description:"Fail if the generated schema differs from --output.",type:"boolean"}}),async r=>{let{handleRecheck:e}=await import("./chunks/P37LFEGZ.js"),{recheckPresetsPlugin:t}=await import("./chunks/WSDNWUOV.js");J(e,{plugins:[t]})(r)}).command("lint [apis...]","Lint an API or Arazzo description.",r=>r.env("REDOCLY_CLI_LINT").positional("apis",{array:!0,type:"string",demandOption:!0}).option({format:{description:"Use a specific output format.",choices:["stylish","codeframe","json","checkstyle","codeclimate","summary","markdown","github-actions","junit"],default:"codeframe"},"max-problems":{requiresArg:!0,description:"Reduce output to a maximum of N problems.",type:"number",default:100},"generate-ignore-file":{description:"Generate an ignore file.",type:"boolean"},"skip-rule":{description:"Ignore certain rules.",array:!0,type:"string"},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string"}}),async r=>{let{handleLint:e}=await import("./chunks/G2LRTVYX.js");J(e)(r)}).command("bundle [apis...]","Bundle a multi-file API description to a single file.",r=>r.env("REDOCLY_CLI_BUNDLE").positional("apis",{array:!0,type:"string",demandOption:!0}).options({output:{type:"string",description:"Output file or folder for inline APIs.",alias:"o"},ext:{description:"Bundle file extension.",requiresArg:!0,choices:ri},"skip-preprocessor":{description:"Ignore certain preprocessors.",array:!0,type:"string"},"skip-decorator":{description:"Ignore certain decorators.",array:!0,type:"string"},overlay:{description:"Overlay file to apply. Repeat to apply several, in order.",array:!0,type:"string",requiresArg:!0},dereferenced:{alias:"d",type:"boolean",description:"Produce a fully dereferenced bundle."},force:{alias:"f",type:"boolean",description:"Produce bundle output even when errors occur."},config:{description:"Path to the config file.",type:"string"},metafile:{description:"Produce metadata about the bundle",type:"string"},extends:{description:"Override extends configurations (defaults or config file settings).",requiresArg:!0,array:!0,type:"string",hidden:!0},"remove-unused-components":{description:"Remove unused components.",type:"boolean",default:!1},"keep-url-references":{description:"Keep absolute url references.",type:"boolean",alias:"k"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"},"component-renaming-conflicts-severity":{description:"Whether to show warnings or fail on renaming conflicts (defaults to warn).",choices:["warn","error","off"]},"component-names-strategy":{description:"How to name inlined Schema components: 'basename' (default) or 'title' (from each schema's `title`).",choices:["basename","title"],default:"basename"}}).check(e=>{if(e.output&&(!e.apis||e.apis.length===0))throw new Error("At least one inline API must be specified when using --output.");return!0}),async r=>{let{handleBundle:e}=await import("./chunks/SDJSWREQ.js");J(e)(r)}).command("check-config","Lint the Redocly configuration file.",async r=>r.env("REDOCLY_CLI_CHECK_CONFIG").option({config:{description:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error"],default:"error"}}),r=>{J()(r)}).command("login","Log in to Redocly.",async r=>r.env("REDOCLY_CLI_LOGIN").options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleLogin:e}=await import("./chunks/E3B6BHM3.js");J(e)(r)}).command("logout","Clear your stored credentials.",r=>r,async r=>{let{handleLogout:e}=await import("./chunks/GJLQK75Q.js");J(e)(r)}).command("project","[early access] Work with a Redocly-hosted project.",r=>r.env("REDOCLY_CLI_PROJECT").command("clone <project> [directory]","Clone a Redocly-hosted project as a Git repository.",e=>e.positional("project",{description:"Organization and project slugs or IDs, as `<organization>/<project>`.",type:"string",demandOption:!0}).positional("directory",{description:"Directory to clone into. Defaults to the project.",type:"string"}).options({residency:{description:"Residency of the application. Defaults to `us`.",alias:["r"],type:"string"},config:{description:"Path to the config file.",requiresArg:!0,type:"string"}}),async e=>{let{handleProjectClone:t}=await import("./chunks/2TS7TKLJ.js");J(t)(e)}).command("git-credentials <operation>",!1,e=>e.positional("operation",{description:"Credential helper operation: get, store, or erase.",type:"string",demandOption:!0}),async e=>{let{handleProjectGitCredentials:t}=await import("./chunks/MNBKIEMZ.js");process.stdout.write(await t({operation:e.operation,input:process.stdin,version:Le}))}).demandCommand(1,"Specify a project subcommand: clone.")).command("preview","Preview Redocly project.",r=>r.env("REDOCLY_CLI_PREVIEW").options({product:{type:"string",choices:Object.keys(oi),hidden:!0,deprecated:"the preview reads the package from package.json, @redocly/framework by default."},plan:{type:"string",choices:ai,default:"enterprise",description:"Plan whose features the preview enables: pro, scale or enterprise."},port:{alias:"p",type:"number",description:"Preview port.",default:4e3,coerce:at("port",!0)},"project-dir":{alias:["d","source-dir"],type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{process.argv.some(t=>t.startsWith("--source-dir"))&&H.error(`Option --source-dir is deprecated and will be removed soon. Use --project-dir instead.
|
|
165
|
+
`);let{previewProject:e}=await import("./chunks/KXL2RBIR.js");J(e)(r)}).command("build-docs [api]","Produce API documentation as an HTML file",r=>r.positional("api",{type:"string"}).options({o:{describe:"Output destination file.",alias:"output",type:"string",default:"redoc-static.html"},title:{describe:"Page title.",type:"string"},disableGoogleFont:{describe:"Disable Google fonts.",type:"boolean",default:!1},t:{alias:"template",describe:"Path to handlebars page template, see https://github.com/Redocly/redocly-cli/blob/main/packages/cli/src/commands/build-docs/template.hbs for the example.",type:"string"},templateOptions:{describe:"Additional options to pass to the template. Use dot notation, e.g. templateOptions.metaDescription"},theme:{describe:"Redoc theme.openapi configuration. Use dot notation, e.g. theme.openapi.nativeScrollbars"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}).check(e=>{if(e.theme&&!e.theme?.openapi)throw new Error("Invalid option: theme.openapi not set.");return!0}),async r=>{let{handlerBuildCommand:e}=await import("./chunks/LNEYWAAB.js");J(e)(r)}).command("translate <locale>","Creates or updates translations.yaml files and fills them with missing built-in translations and translations from the redocly.yaml and sidebars.yaml files.",r=>r.env("REDOCLY_CLI_TRANSLATE").positional("locale",{description:"Locale code to generate translations for, or `all` for all current project locales.",type:"string",demandOption:!0}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleTranslations:e}=await import("./chunks/SGRUTAKH.js");J(e)(r)}).command("eject <type> [path]","Helper function to eject project elements for customization.",r=>r.env("REDOCLY_CLI_EJECT").positional("type",{description:"Specifies what type of project element to eject. Currently this value must be `component`.",demandOption:!0,choices:["component"]}).positional("path",{description:"Filepath to a component or filepath with glob pattern.",type:"string"}).options({"project-dir":{alias:"d",type:"string",description:"Specifies the project content directory. The default value is the directory where the command is executed.",default:"."},force:{alias:"f",type:"boolean",description:'Skips the "overwrite existing" confirmation when ejecting a component that is already ejected in the destination.'},"lint-config":{description:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleEject:e}=await import("./chunks/RDKZXSDY.js");J(e)(r)}).command("respect [files...]","Run Arazzo tests.",r=>r.env("REDOCLY_CLI_RESPECT").positional("files",{describe:"Test files or glob pattern.",type:"string",array:!0,default:[]}).options({input:{alias:"i",describe:"Input parameters.",type:"string"},server:{alias:"S",describe:"Server parameters.",type:"string"},workflow:{alias:"w",describe:"Workflow name.",type:"string",array:!0},skip:{alias:"s",describe:"Workflow to skip.",type:"string",array:!0},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"},"har-output":{describe:"Har file output name.",type:"string",alias:"H"},"json-output":{describe:"JSON file output name.",type:"string",alias:"J"},mtls:{describe:'Per-domain mutual TLS certificates configuration as JSON. Format: {"<domain>": {"clientCert": "<path>", "clientKey": "<path>", "caCert": "<path>"}}',type:"string",array:!0,coerce:ma},severity:{describe:"Severity of the check.",type:"string"},"max-steps":{describe:"Maximum number of steps to run (default: 2000).",type:"number",default:2e3,coerce:at("max-steps",!0)},"max-fetch-timeout":{describe:"Maximum time to wait for API response per request in milliseconds (default: 40 seconds).",type:"number",default:4e4,coerce:at("max-fetch-timeout",!1)},"execution-timeout":{describe:"Maximum time to wait for the Respect execution in milliseconds (default: 1 hour).",type:"number",default:36e5,coerce:at("execution-timeout",!1)},"no-secrets-masking":{describe:"Do not mask secrets in the output.",type:"boolean",default:!1}}),async r=>{let{handleRespect:e}=await import("./chunks/T6ZSC7T2.js");J(e)(r)}).command("generate-arazzo <descriptionPath>","Auto-generate arazzo description file from an API description.",r=>r.env("REDOCLY_CLI_GENERATE_ARAZZO").positional("descriptionPath",{describe:"Description file path.",type:"string"}).options({"output-file":{alias:"o",describe:"Output File name.",type:"string",requiresArg:!0},"with-ai":{describe:"Redesign the generated workflows with an AI provider, using the OpenAPI description as context.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of workflows designed in parallel with --with-ai for large descriptions.",type:"number",default:4,coerce:at("ai-concurrency",!0)},"max-workflows":{describe:"Most workflows the AI may design with --with-ai.",type:"number",default:10,coerce:at("max-workflows",!0)}}),async r=>{let{handleGenerateArazzo:e}=await import("./chunks/IT5HS4O6.js");J(e)(r)}).command("generate-client [api]","Generate a TypeScript client from an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_CLIENT").positional("api",{describe:"OpenAPI description file path (or alias from redocly.yaml `apis:`).",type:"string"}).options({output:{alias:"o",describe:"Output file path for the generated client (must end in .ts).",type:"string",requiresArg:!0},"server-url":{describe:"Override the server URL inlined into the generated runtime. Defaults to `servers[0].url`.",type:"string",requiresArg:!0},"output-mode":{describe:"How the client is split across files: `single` (default, one file) or `split` (schema types and guards in a sibling `<name>.schemas.ts` the entry re-exports).",choices:["single","split"],requiresArg:!0},runtime:{describe:"Runtime distribution: 'inline' (default) embeds the runtime in the generated file; 'module' writes it as real files in a runtime/ folder beside the client.",choices:["inline","module"],requiresArg:!0},docs:{description:"Also write reference documentation for what this run generates: one Markdown page per selected generator that documents itself (the CLI, and each SDK).",type:"boolean"},"go-package":{description:"Package clause of the `go` generator's output (a valid Go package name). Defaults to `client`.",type:"string",requiresArg:!0},"import-ext":{describe:"Extension in generated relative imports: 'js' (default) suits tsc and bundlers; 'ts' suits runtimes that resolve specifiers literally, like Node's built-in type stripping (node client.ts).",choices:["js","ts"],requiresArg:!0},setup:{describe:"Path to a publisher setup module (a file default-exporting { config, middleware }) that gets included into the generated client \u2014 pre-configure defaults such as the server URL, retries, headers, and middleware, so a published SDK ships with them built in. Works across all output modes.",type:"string",requiresArg:!0},"args-style":{describe:"How operation inputs are passed: `flat` (default) spreads path params as positional arguments followed by `params`/`body`/`headers`; `grouped` bundles every input into a single `args` object (the per-call request `init` stays a separate trailing argument).",choices:["flat","grouped"],requiresArg:!0},"error-mode":{describe:"Error handling: 'throw' (default) throws ApiError on non-2xx; 'result' returns { data, error, response }.",choices:["throw","result"],requiresArg:!0},"date-type":{describe:"How `date-time`/`date` string fields are typed: 'string' (default) keeps the ISO wire shape; 'Date' emits a `Date` (pair with --generator transformers so the runtime value matches).",choices:["string","Date"],requiresArg:!0},"mock-data":{describe:"How the `mock` generator produces data: 'static' (default) inlines deterministic literals (zero-dep); 'faker' emits @faker-js/faker calls for realistic data (install @faker-js/faker as a dev dependency).",choices:["static","faker"],requiresArg:!0},"mock-seed":{describe:"Seed for faker-mode mocks: emits a top-level `faker.seed(<n>)` so generated data is reproducible across runs. Ignored in static mode.",type:"number",requiresArg:!0},generator:{describe:'Generator to run; repeat the flag to run several (default: typescript). Built-in: typescript, zod, tanstack-query, tanstack-query-vue, tanstack-query-svelte, tanstack-query-solid, swr, mock, transformers, cli, python, go, php \u2014 or a path/package specifier for a custom generator. What each one emits is in the "Use the generated client" guide. Example: --generator typescript --generator zod',type:"string",array:!0,requiresArg:!0},config:{describe:"Path to the config file.",type:"string",requiresArg:!0}}),async r=>{let{handleGenerateClient:e}=await import("./chunks/QD6M6CHF.js");J(e)(r)}).command("eject-generator [generator]","Vendor a built-in client generator into your repo as an editable file [experimental].",r=>r.positional("generator",{describe:`Built-in generator to eject (${[...It].join(", ")}).`,type:"string"}).options({config:{description:"Path to the config file.",type:"string"},dir:{describe:"Directory to eject into (default: ./generators).",type:"string",requiresArg:!0},force:{describe:"Overwrite an existing ejected file (discards local edits).",type:"boolean",default:!1},update:{describe:"Three-way merge a newer generator version into your customized copy (pristine \xD7 new \xD7 yours).",type:"boolean",default:!1}}),async r=>{J(pa)(r)}).command("skills","Install the Redocly CLI agent skills for AI coding agents.",r=>r.options({agent:{description:"Agents to install the skills for. Default: detected agents.",type:"array",string:!0,choices:ba},global:{description:"Install in your home folder instead of the current project.",type:"boolean",default:!1},list:{description:"List the bundled skills without installing them.",type:"boolean",default:!1}}),async r=>{J(wa)(r)}).command("generate-spec <traffic>","Infer an OpenAPI description from recorded HTTP traffic, optionally refined with AI [experimental].",r=>r.env("REDOCLY_CLI_GENERATE_SPEC").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({type:{describe:"Target API description type.",choices:["openapi"],default:"openapi"},"openapi-version":{describe:"OpenAPI version of the generated description.",type:"string",choices:["3.1","3.2"],default:"3.2"},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, the rest of their URL becomes the API path, and it becomes the servers URL of the generated description.",type:"string"},title:{describe:"Title for the generated API description.",type:"string"},"with-ai":{describe:"Refine the inferred description with an AI provider to narrow the hypothesis.",type:"boolean",default:!1},"ai-provider":{describe:'AI provider used with --with-ai; runs the "claude", "codex", or "cursor" CLI in non-interactive mode.',choices:["claude","codex","cursor"],default:"claude"},"ai-model":{describe:"Model passed to the selected AI provider (provider-specific default applies).",type:"string"},"ai-concurrency":{describe:"Number of operations refined in parallel with --with-ai.",type:"number",default:4,coerce:at("ai-concurrency",!0)},output:{alias:"o",describe:"Write the generated description to this file instead of stdout.",type:"string"},config:{describe:"Path to the config file.",type:"string"}}),async r=>{let{handleGenerateSpec:e}=await import("./chunks/QZQVSDLN.js");J(e)(r)}).command("introspect-mcp [server-url]","Introspect a running MCP server and record its capabilities in the x-mcp extension of an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_INTROSPECT_MCP").positional("server-url",{describe:"URL of the MCP server (Streamable HTTP, with a fallback to the legacy HTTP+SSE transport). Alternative to --command.",type:"string"}).option({command:{describe:'Command that starts a local MCP server to introspect over stdio, for example "npx -y my-mcp-server". Quote arguments that contain spaces. Alternative to a server URL.',type:"string",requiresArg:!0},output:{alias:"o",describe:"OpenAPI description file to create or update.",type:"string",default:"openapi.yaml"},header:{alias:"H",describe:'Header sent with every request to the MCP server, in "Name: value" format. Repeat the option for multiple headers.',array:!0,type:"string"},check:{describe:"Verify the description is up to date with the MCP server instead of writing: report the differences and exit with an error when it is not.",type:"boolean",default:!1},config:{describe:"Path to the config file.",type:"string"}}).check(e=>{if(!!e["server-url"]==!!e.command)throw new Error("Provide either an MCP server URL or --command, not both.");if(e.command&&e.header)throw new Error("The --header option only applies to an MCP server URL.");return!0}),async r=>{let{handleIntrospectMcp:e}=await import("./chunks/4OPAFHK3.js");J(e)(r)}).command("scorecard-classic [api]","Run quality scorecards with multiple rule levels to validate and maintain API description standards.",r=>r.positional("api",{type:"string"}).option({config:{describe:"Path to the config file.",type:"string"},"project-url":{describe:"URL to the project scorecard configuration.",type:"string"},format:{description:"Use a specific output format.",choices:["stylish","json","checkstyle","junit"],default:"stylish"},"target-level":{describe:"Target level for the scorecard.",type:"string"},verbose:{alias:"v",describe:"Apply verbose mode.",type:"boolean"}}),async r=>{let{handleScorecardClassic:e}=await import("./chunks/UQE7DXYL.js");J(e)(r)}).command("drift <traffic>","Detect drift between recorded HTTP traffic and an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_DRIFT").positional("traffic",{describe:"Path to a traffic log file or folder (HAR, Kong, Nginx/Apache JSON, NDJSON).",type:"string"}).option({api:{describe:"OpenAPI description file or folder to validate against.",type:"string",demandOption:!0},"traffic-format":{describe:"Traffic input format.",choices:["auto","har","kong","nginx-json","apache-json","ndjson"],default:"auto"},"report-format":{describe:"Output format.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode (how requests are located via the description servers). Mutually exclusive with --server.",choices:["strict-host","basepath"],defaultDescription:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks (useful for logs exported without cookies).",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},"min-severity":{describe:"Discard findings below this severity from the report.",choices:["info","warning","error"],default:"info"},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},output:{alias:"o",describe:"Write the drift report (in the format selected with --format) to this file instead of stdout.",type:"string"},server:{describe:"Server URL the traffic was captured against: only requests under it are considered, and the rest of their URL is treated as the API path. It replaces the description servers and the remaining path is matched against the description paths directly. Mutually exclusive with --match-mode.",type:"string"},coverage:{describe:"Print how much of the description the traffic exercised: operations, parameters, schema properties, and response codes.",type:"boolean",default:!1},"coverage-output":{describe:"Write a detailed JSON coverage report (per operation, with covered and missing items) to this file.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleDrift:e}=await import("./chunks/A6KGBL3N.js");J(e)(r)}).command("proxy","Capture live HTTP traffic through a reverse proxy into a HAR file, optionally validating it against an OpenAPI description [experimental].",r=>r.env("REDOCLY_CLI_PROXY").option({target:{describe:"Upstream base URL to forward captured requests to.",type:"string",demandOption:!0},port:{describe:"Port the proxy listens on.",type:"number",default:4040},host:{describe:"Host the proxy binds to.",type:"string",default:"127.0.0.1"},har:{describe:"Path to the HAR file where captured traffic is written.",type:"string",demandOption:!0},api:{describe:"OpenAPI description file or folder to validate captured traffic against (live).",type:"string"},"report-format":{describe:"Output format for the validation report printed on shutdown.",alias:"format",choices:["pretty","json","csv","sarif"],default:"pretty"},"match-mode":{describe:"Endpoint matching mode.",choices:["strict-host","basepath"],default:"strict-host"},"ignore-cookies":{describe:"Ignore cookie-based checks.",type:"boolean",default:!1},"ignore-headers":{describe:'Comma-separated header names to skip in undocumented-header checks. A trailing "*" matches by prefix, e.g. "x-consumer-*".',type:"string"},"max-findings":{describe:"Maximum findings shown in pretty output.",type:"number",default:10},rules:{describe:"Comma-separated builtin rules to run.",type:"string"},config:{describe:"Path to the config file.",type:"string"},"lint-config":{describe:"Severity level for config file linting.",choices:["warn","error","off"],default:"warn"}}),async r=>{let{handleProxy:e}=await import("./chunks/IN2HI2RR.js");J(e)(r)}).completion("completion","Generate autocomplete script for `redocly` command.").demandCommand(1).middleware([Oa]).strict().argv;
|
|
166
166
|
/*! Bundled license information:
|
|
167
167
|
|
|
168
168
|
yargs-parser/build/lib/string-utils.js:
|